2009-01-09 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / ChangeLog
1 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
2
3         * metadata-verify.c: Add lfanew verification.
4
5 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
6
7         * metadata-verify.c: Initial skeleton of the metadata verifier.
8
9         * pedump.c: Add support for the metadata verifier.
10
11         * verify-internal.h: Export the whole assembly metadata verifier function.
12
13 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
14
15         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
16
17 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
18
19         * Makefile.am: Upgrade dtrace-prelink.sh location.
20
21 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
22
23         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
24         well. Otherwise the shutdown deadlock that happens on unix will can happen
25         as well.
26         If the main thread code finishes too fast it's possible that the finalizer
27         thread won't have executed yet, won't record itself as the finalizer thread
28         and the shutdown sequence will wait on it forever.
29
30 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
31
32         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
33         with MSVC.
34
35 2009-01-08  Miguel de Icaza  <miguel@novell.com>
36
37         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
38         Robert Jordan for pointing this out.
39
40 2009-01-07  Miguel de Icaza  <miguel@novell.com>
41
42         * icall.c: Wrap calls to mono_strtod in CriticalSection
43         invocations when using eglib, to work around #464316.
44
45 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
46
47         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
48         return value of GetCurrentDirectory to never access unitialized memory.
49
50 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
51
52         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
53         return value of GetCurrentDirectory and expand the buffer if needed.
54
55         Fixes #459094.
56
57 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
58
59         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
60           Adding a call to mono_init_com_types.
61
62         Code is contributed under MIT/X11 license.
63
64 2009-01-07  Geoff Norton  <gnorton@novell.com>
65
66         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
67         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
68         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
69         be the value of the ip buffer.
70
71 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
72
73         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
74         interfaces_packed here.
75
76         Fixes part of #463294.
77
78 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
79
80         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
81
82         Fixes part of #463294.
83
84 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
85
86         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
87         is a boxed complex as well.
88
89         Fixes part of #463294.
90
91 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
92
93         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
94         control if a methodspec should be created for the generic method definition from external assemblies.
95         Caching of methodspec is done using the handleref hash table.
96
97         Fixes #462592.
98
99 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
100
101         * loader.c (find_method): When searching the interfaces of a class
102         check the transitive closure of implemented interfaces.
103
104         Fixes #463303.
105
106 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
107
108         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
109         
110 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
111
112         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
113         interfaces calculation to fill_valuetype_array_derived_types.
114
115         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
116         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
117         for example.
118
119         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
120         interfaces for valuetypes if needed.    
121
122         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
123         for their basetype as well. Types are array expanded if rank is > 0.
124
125         Fixes #400716.
126
127 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
128
129         * socket-io.h : Changing the signature of
130           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
131           the blocking state.
132
133         * icall-def.h :  Changing the signature of
134           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
135
136         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
137           For Windows only.  Avoid blocking when calling accept by
138           querying for a connection via select.  The loop also queries
139           the thread state every 1000 micro seconds for the thread
140           stop state.  This will avoid the process hanging on shutdown
141           when using a TcpChannel that is never connected to.
142
143         Code is contributed under MIT/X11 license.
144
145 2008-12-30  Marek Safar  <marek.safar@gmail.com>
146
147         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
148
149 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
150
151         * class.c (get_implicit_generic_array_interfaces): Extract common
152         code to a helper function making it a lot easier on the eyes.
153
154 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
155
156         * class.c (get_implicit_generic_array_interfaces): If the internal
157         enumerator is an interface inflate System.Object instead of itself.
158
159         Fixes #461261.
160
161 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
162
163         * object.c (mono_runtime_invoke_array): Don't assert with
164         byref nullable types.
165
166         * marshal.c (mono_marshal_get_runtime_invoke): To handle
167         byref nullables we unbox the object and store it on the
168         stack. 
169         We can't use the boxed object since it is the T of Nullable<T>
170         and the boxed representation of a nullable it's underlying type
171         or null.
172         We could cheat and create a boxed nullable and use the same
173         machinery of other byref VTs but this feels like a hack and
174         using the stack has the bonus of reducing heap pressure.
175
176         Fixes #461941.
177
178 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
179
180         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
181         return value.
182
183         Fixes #461867.
184
185 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
186
187         * icall-def.h : Adding an internal call definition for 
188           System.Environment.internalBroadcastSettingChange.
189
190         * icall.c : Adding a Windows only implementation to broadcast a 
191           WM_SETTINGCHANGE when an environment variable has changed.
192
193         Code is contributed under MIT/X11 license.
194
195 2008-12-19  Mark Probst  <mark.probst@gmail.com>
196
197         * class.c, class-internals.h: Made
198         mono_class_has_parent_and_ignore_generics() non-static.
199
200 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
201
202         * image.c: deal with the mmap failing when loading an image.
203
204 2008-12-17  Geoff Norton  <gnorton@novell.com>
205
206         * threadpool.c: Ensure that the io_queue_lock is initialized
207         in all circumstances, as we always attempt to cleanup against it.
208
209 2008-12-17  Miguel de Icaza  <miguel@novell.com>
210
211         * icall.c (ves_icall_System_Environment_get_Platform): For
212         compatibility reasons for existing client code we will keep
213         returning 4 for a while.   
214
215         For how long will depend on the documentation being updated, and
216         for us to give client code a chance to be updated.
217
218         This reverts the original decison on #433108 since we did not
219         catch roughly 33 instances of the broken code in our own source
220         code base, we did not catch failures on the buildbots, and QA did
221         not bring this as a problem.
222
223         Only today I found some customer's code breaking due to our own
224         class libraries not being fully updated and tracked it down to
225         this change.  I am reverting it because if we could not even get
226         our story straight in our own code base, how can we hope that our
227         end user code be fixed?
228
229         As of this morning, our Wiki page that documents how to detect
230         Unix had not been fixed.    
231
232 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
233
234         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
235
236         * class.c (mono_class_get_fields): Handle loading errors.
237
238 2008-12-12 Mark Mason <mmason@upwardaccess.com>
239
240         * metadata.c (mono_type_stack_size_internal): If SIZEOF_REGISTER > SIZEOF_VOID_P then use SIZEOF_REGISTER as the size and alignment of the stack slots.
241         
242 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
243
244         * mono-perfcounters.c: avoid warning.
245
246 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
247
248         * reflection.c (ensure_runtime_vtable): Work on generic instances and
249         make sure all interfaces have MonoClass::interface_id set.
250
251         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
252         method table is property set.
253
254 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
255
256         * class.c: New function mono_class_setup_interface_id that setup
257         MonoClass::interface_id if needed.
258
259         * class-internals.h: Export new function.
260
261 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
262
263         * class.c: Add code to sanity check the vtable after setup_vtable_general
264         has done it's work.
265
266 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
267
268         * icall.c: make Assembly.GetExecutingAssembly work properly when
269         reflection is used to invoke the method.
270         Bug #321781 fixed.
271
272 2008-12-11  Mark Probst  <mark.probst@gmail.com>
273
274         * metadata/generic-sharing.c: Look for constraints in all type
275         arguments, not just the first one.
276
277 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
278
279         * appdomain.c: return the correct CodeBase for an Assembly instance
280         that was loaded from the shadow-copy directories.
281         Bug #458190 fixed.
282
283 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
284
285         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
286
287         * sgen-gc.c (check_object): New debugging helper function.
288
289         * object.c: Fix calls to mono_value_copy_array ().
290
291 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
292
293         * class.c (mono_class_setup_fields): If working on an inflated class
294         first check if the generic definition did init with success.
295
296         Fixes #445361.
297
298 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
299
300         pedump.c (main): Fix a warning.
301
302 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
303
304         * object-internals.h : Adding a definition for 
305           MonoReflectionComVisibleAttribute.
306
307         * marshal.c (cominterop_com_visible) :  Method added to check the 
308           ComVisible attribute of a class.
309
310         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
311           cominterop_raise_hr_exception added to consolidate common code 
312           to raise hr exceptions.
313
314         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
315           if a managed class should support IDispatch.
316
317         * marshal.c 
318           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
319           Added additional checks for managed object when getting 
320           an IDispatch interface.
321
322         Code is contributed under MIT/X11 license.
323
324 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
325
326         pedump.c (main): Handle mono_get_method () returning NULL. 
327
328 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
329
330         * marshal.h: Fix a warning.
331
332 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
333
334         * marshal.c : Adding cominterop_release_all_rcws to release all
335           runtime callable wrappers held by the runtime.
336
337         * marshal.h : Adding declaration for cominterop_release_all_rcws.
338           
339         Code is contributed under MIT/X11 license.
340
341 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
342
343         * metadata.c (mono_image_alloc_lock): New helper function.
344         (mono_image_alloc0_lock): Ditto.
345
346         * metadata.c: Use the alloc_lock () helper functions for allocating
347         memory from the image mempool.
348
349 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
350
351         * class.c (mono_class_from_generic_parameter): Document it's
352         locking behavior. Fix double checked locking here, we stored in
353         param->pklass a partially initialized MonoClass and no membar was used.
354
355 2008-12-05  Marek Habersack  <mhabersack@novell.com>
356
357         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
358         (3) functions are present in the C library use them to do the
359         job. If they are absent, make sure that the sum of int_part and
360         dec_part is rounded before returning. This is necessary due to the
361         division of dec_part by the power of 10 before the final addition
362         is performed - if the result is not rounded in some cases it will
363         yield invalid results.
364
365 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
366
367         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
368         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
369         instruction instead of a pointer constant.
370
371 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
372
373         * loader.c (mono_method_get_header): Do most of the work outside the
374         loader lock, to avoid assembly load hook deadlocks.
375
376         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
377         (mono_metadata_parse_type_full): Ditto.
378
379 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
380
381         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
382         Make the stack depth fixed. Ensure proper argument passing to the backtrace
383         funtions. Finally, use a lock to produce well ordered output.
384
385         The lock looks silly, as all calls to the corlib mempool should be guarded
386         with the loader lock, but for some reason this fact doesn't help. 
387
388         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
389
390 2008-12-02  Mark Probst  <mark.probst@gmail.com>
391
392         * socket-io.c: 64 bit big-endian fixes.
393
394 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
395
396         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
397         targets that require strict compatibility between the types.
398
399         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
400         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
401         Kill the strict argument and create a new one valuetype_must_be_boxed.
402
403         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
404         state that all valuetypes must be boxed.
405
406         Fixes #448560.
407
408 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
409
410         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
411         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
412
413         Contributed under MIT/X11 license.
414
415 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
416
417         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
418         the inflate_generic_type machinery should handle it.
419
420         This avoids a crash when the field's flags is zero and it's type is
421         a primitive.
422         What happens is that mono_metadata_parse_type_full will see that opt_attrs
423         is zero and will return one of the cached built-in primitive types. Since
424         those types live in read-only memory, the code that copies it crashes.  
425
426 2008-11-28  Mark Probst  <mark.probst@gmail.com>
427
428         * object.c: Don't put function descriptors into generalized IMT
429         thunks.
430
431 2008-11-28  Mark Probst  <mark.probst@gmail.com>
432
433         * class.c: Enable generic code sharing on PPC64.
434
435 2008-11-27  Mark Probst  <mark.probst@gmail.com>
436
437         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
438         from mini/mini.c.
439
440         * generic-sharing.c: Allocate the method template slists from the
441         image mempool so it doesn't leak.
442
443 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
444
445         * class.c (generic_array_methods): Release the linked list.
446
447 2008-11-27  Mark Probst  <mark.probst@gmail.com>
448
449         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
450         invocation to g_utf16_to_utf8().
451
452 2008-11-26  Mark Probst  <mark.probst@gmail.com>
453
454         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
455         arguments on big endian archs.
456
457 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
458
459         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
460         the type name (test added in corlib).
461
462 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
463
464         * pedump.c: initialize perf. counters. Fixes a segv.
465
466 2008-11-25  Martin Baulig  <martin@ximian.com>
467
468         * mono-debug-debugger.c
469         (mono_debugger_runtime_invoke): Return the exception object if an
470         exception was thrown.  Visual Studio displays the exception object
471         in the locals window.
472
473 2008-11-24  Mark Probst  <mark.probst@gmail.com>
474
475         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
476         ftnptr.
477
478 2008-11-24  Mark Probst  <mark.probst@gmail.com>
479
480         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
481         MONO_TYPE_U are sizeof (gpointer), too.
482
483 2008-11-24  Mark Probst  <mark.probst@gmail.com>
484
485         * marshal.c (mono_type_native_stack_size): Fixed size and
486         alignment for reference types.
487
488 2008-11-23  Mark Probst  <mark.probst@gmail.com>
489
490         * class.c (mono_class_generic_sharing_enabled): Disable generic
491         code sharing for PPC64.
492
493 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
494
495         * icall.c (mono_method_get_equivalent_method): Make sure
496         method->klass->methods is inited before looping over it.
497
498 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
499
500         * object.c: when calling ExecuteAssembly in a newly created domain,
501         the configuration file and application base are already set up.
502         Bug #446353 take 2 fixed.
503
504 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
505
506         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
507         Fixes #444715. Fix a warning.
508
509 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
510
511         * appdomain.c: write the full path of the assembly to the .ini file
512         created when "shadow-copying"
513         Bug #446353 fixed.
514
515 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
516
517         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
518         if signature==FALSE.
519
520 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
521
522         * marshal.h : Fix the cygwin build.
523            marshal.c:12442: undefined reference to `_IID_IMarshal'
524           
525         Code is contributed under MIT/X11 license.
526
527 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
528
529         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
530           free threaded marshaler when QueryInterface is called on a COM callable
531           wrapper requesting the IMarshal interface.
532           
533         Code is contributed under MIT/X11 license.
534
535 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
536
537         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
538
539         * reflection.c (mono_type_get_object): Special case the very common
540         void type.
541
542         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
543         hold typeof(void).
544
545 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
546
547         * process.h : Adding method declaration for
548           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
549           
550         * process.c : Adding implementation for
551           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
552           
553         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
554           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
555
556         Code is contributed under MIT/X11 license.
557
558 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
559
560         * appdomain.c (unload_thread_main): Clean up threadpool by
561         calling mono_thread_pool_remove_domain_jobs.
562
563         * domain-internals.h (struct _MonoDomain): Add new fields to
564         help coordinate the cleanup of the threadpool.
565
566         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
567         that cleans up the threadpool of all jobs associated with an appdomain.
568         It does that by cleaning up the queues and making sure all active
569         threads are accounted.
570
571         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
572         unloaded or in the process of. Take this is such way that there is
573         no race condition between another thread starting the unload and the
574         current thread acknowledging it.
575
576         * threadpool.c (async_invoke_thread): Same.
577
578         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
579         firing the new thread.
580
581         * threadpool.c (start_tpthread): Same.
582
583         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
584
585         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
586
587 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
588
589         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
590         Add support for DuplicateHandle.
591         
592         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
593         Add support for DuplicateHandle.
594         
595         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
596         Add support for DuplicateHandle.
597
598         Code is contributed under MIT/X11 license.
599
600 2008-11-06  Mark Probst  <mark.probst@gmail.com>
601
602         * class-internals.h: Make min_align into a whole byte.
603
604         * class.c: Set min_align for SIMD types to 16.
605
606 2008-11-05  Geoff Norton  <gnorton@novell.com>
607
608         * attach.c: Default the attacher to enabled for all cases including
609         embedded.
610
611 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
612
613         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
614         change r117650.
615
616 2008-11-04  Mark Probst  <mark.probst@gmail.com>
617
618         * monitor.c, monitor.h: New function for querying offsets of
619         members of MonoThreadsSync.
620
621 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
622
623         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
624         to speed up this function and to avoid the boundless memory growth caused by
625         the signature_dup () calls.
626
627 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
628
629         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
630         wrapper.
631
632         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
633         by 1 bit.
634
635         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
636
637 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
638
639         * appdomain.c:
640         * domain-internals.h: made mono_set_private_bin_path_from_config()
641         "internal".
642         * object.c: call the above function after setting the configuration
643         file path for the root domain.
644         Fixes bug #314478.
645
646 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
647
648         * assembly.c: when the assembly is loaded from an absolute path, end
649         basedir with a directory separator.
650         Bug #440781 fixed.
651
652 2008-10-30  Mark Probst  <mark.probst@gmail.com>
653
654         * monitor.c (mono_monitor_get_fast_enter_method): If
655         CompareExchange is not available, don't create the fastpath
656         instead of asserting.  (The method is missing in the 1.1 profile.)
657
658 2008-10-30  Mark Probst  <mark.probst@gmail.com>
659
660         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
661
662         * monitor.c, monitor.h: Code for generating Monitor.Enter and
663         Monitor.Exit IL fastpaths.
664
665 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
666
667         * class.c (mono_class_create_from_typedef): Added Vector2ul.
668
669 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
670
671         * class.c (mono_class_create_from_typedef): Added Vector2l.
672
673 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
674
675         * class.c (mono_class_create_from_typedef): Added Vector2d.
676
677 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
678
679         * appdomain.c: translate \ into / for cache_path.
680         * domain-internals.h: new mono_is_shadow_copy_enabled().
681         * icall.c: (fill_reflection_assembly_name) do the same path
682         manipulations that get_code_base does.
683         (get_code_base) use mono_is_shadow_copy_enabled.
684
685 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
686
687         * appdomain.c: shadow-copied assemblies go to CachePath +
688         ApplicationName when both are set. DynamicBase has nothing to do with
689         shadow copies.
690         Bug #406877 fixed.
691
692 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
693
694         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
695         STANDALONESIG table.
696
697         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
698         standalone signatures.
699
700         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
701         comparison code: instead of comparing the signatures using a custom
702         equals function, transform them to a common signature and compare that. This
703         works better with AOT.
704
705 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
706
707         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
708
709         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
710         call for generic instances.
711         (mono_class_setup_properties): Call setup_properties () before accessing
712         gklass->properties.
713
714         * class.c (mono_class_get_virtual_methods): New helper function to iterate
715         over the virtual methods of a class using metadata if possible, avoiding the
716         creation of MonoMethod's for non-virtual methods.
717         
718         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
719         get_virtual_methods () to iterate over the virtual methods of classes.
720
721 2008-10-25  Martin Baulig  <martin@ximian.com>
722
723         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
724
725 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
726
727         * class.c (mono_class_create_from_typedef): Added Vector4i.
728
729 2008-10-24  Mark Probst  <mark.probst@gmail.com>
730
731         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
732         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
733         special-casing applies to eliminate the call completely.
734
735 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
736
737         * class.c (mono_class_create_from_typedef): Added Vector8s.
738
739 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
740
741         * class.c (mono_class_create_from_typedef): Added Vector16sb.
742
743 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
744
745         * icall.c: get rid of annoying warning.
746
747 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
748
749         * threadpool.c: in 1.x, if you change the background status of the
750         threadpool thread, it's not reset.
751         Remove unnecessary calls to SetState.
752
753 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
754
755         * threadpool.c: asynchronously create a set of idle threads upon first
756         use of the threadpool. SetMinThreads will now start the appropriate
757         number of idle threads if they are not already running. The default is
758         1 threadpool thread per CPU. Increased the maximum number of threads
759         per CPU to 10.
760
761 2008-10-22  Martin Baulig  <martin@ximian.com>
762
763         Revert r116521 from Zoltan, it breaks the debugger:
764
765         * class.c (mono_class_get_virtual_methods): New helper function to iterate
766         over the virtual methods of a class using metadata if possible, avoiding the
767         creation of MonoMethod's for non-virtual methods.
768         
769         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
770         get_virtual_methods () to iterate over the virtual methods of classes.
771
772 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
773
774         * threads.c: when creating a threadpool thread, set its state to
775         'background'.
776         * threadpool.c: reset the background state of a threadpool thread
777         after finishing each work item
778         Bug #437888 fixed.
779
780 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
781
782         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
783         
784         * class.c (mono_class_setup_vtable_general): Add an optimized version for
785         generic instances which works by inflating the methods in the container
786         class's vtable.
787
788         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
789         variant which doesn't make a copy if no inflation was done.
790         (mono_class_setup_fields): Use it.
791
792         * metadata.c (mono_metadata_get_shared_type): New helper function to
793         return a shared instance of a given MonoType.
794
795         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
796         a copy of most non-generic types.
797
798 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
799
800         * threadpool.c: remove one more GetSystemInfo () call.
801
802 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
803
804         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
805         use the code in mono-proclib.h to get processor information.
806
807 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
808
809         * appdomain.c: fixed the logic that determines whether assemblies in a
810         directory are "shadow-copied" or not. Bug #433483 fixed.
811
812 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
813
814         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
815         warning.
816
817 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
818
819         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
820         returning a vtype.
821
822         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
823         reflection.c: Use mono_field_get_name () for accessing a field's name.
824
825         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
826         class.c
827
828         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
829         field.
830
831         * loader.c (find_method_in_class): Reenable the metadata optimization by
832         not using it for generic instances.
833
834         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
835         data/def_type fields from MonoClassField into a separate structure.
836         (struct MonoClassField): Remove data/def_type fields.
837         (struct _MonoClass): Add a 'field_def_values' array to store the default
838         values/RVA for fields.
839
840         * class.c reflection.c: Update after the changes.
841         
842         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
843         for accessing field->data.
844
845         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
846
847         * loader.c (find_method_in_class): Revert the last change for now as
848         it breaks Mono.C5 unit tests.
849
850         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
851         'field_generic_types' and 'field_objects' which contain the information
852         previously stored in MonoInflatedField.
853         (MonoInflatedField): Delete.
854         (struct _MonoClassField): Delete 'generic_info' field.
855
856         * reflection.c: Store the information which was previously in 
857         field->generic_info in MonoDynamicGenericClass instead.
858
859         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
860         MonoClassField changes.
861
862 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
863
864         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
865         store the value inside the data array of the MonoMethodWrapper.
866         This saves memory, is faster and fixes the lifetime issues (methods
867         were never removed from the hash previously). May also fix bug#436996.
868
869 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
870
871         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
872         generic instances, compute the type from the generic definition instead of
873         looking in field->generic_info.
874
875         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
876         for inflated fields, the only user was get_fieldref_token () which no
877         longer needs it.
878
879         * class.c (mono_class_init): Revert the last change as it seems to cause
880         crashes.
881
882         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
883         bytes on 64 bit platforms.
884
885         * object.c (mono_class_create_runtime_vtable): Fix a warning.
886         
887         * object.c (mono_class_create_runtime_vtable): Don't initalize
888         field->data/field->def_type here, it is done lazily by 
889         mono_class_get_field_default_value ().
890
891         * icall.c (ves_icall_get_enum_info): Call 
892         mono_class_get_field_default_value () instead of directly accessing
893         field->data and field->def_type.
894
895         * object.c (get_default_field_value): Ditto.
896
897         * class.c (mono_field_get_data): Ditto.
898         
899         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
900         call for generic instances.
901
902         * loader.c (find_method_in_class): If klass != from_class, then inflate
903         the method with the context of from_class, since the caller assumes this.
904
905 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
906
907         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
908         for accessing method->slot.
909
910 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
911
912         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
913
914 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
915
916         * class.c (mono_method_get_vtable_index): Use
917         mono_method_get_vtable_slot () for accessing method->slot.
918
919         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
920         accessing klass->methods.
921
922         * class.c (mono_method_get_vtable_slot): New helper function.
923         (mono_class_get_vtable_entry): Ditto.
924         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
925         accessing method->slot.
926
927         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
928         method to get_inflated_method ().
929
930         * class.c (mono_class_get_inflated_method): New helper method to obtain
931         a method of an inflated class without calling setup_methods ().
932         (mono_class_get_cctor): Use get_inflated_method.
933
934         * generic-sharing.c (mono_class_get_method_generic): Ditto.
935         
936         * marshal.c image.c: Lazily create all the marshal caches.
937
938         * image.c (mono_image_init): Move initialization of runtime_invoke
939         caches to marshal.c.
940
941         * marshal.c (get_cache): New helper function to lazily initialize a 
942         wrapper cache.
943         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
944
945         * debug-helpers.c (mono_method_full_name): Include generic arguments.
946
947 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
948
949         * loader.c: fixed check for interface type.
950
951 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
952
953         * appdomain.c: check for NULL setup before it's referenced.
954
955 p
956 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
957
958         * class.c: remove the unused old vtable setup code.
959
960 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
961
962         * class.c: don't depend on interface order in
963         setup_interface_offsets (bug #435777).
964         * reflection.c: sort the InterfaceImpl table (patch from
965         Jb Evain  <jbevain@novell.com>).
966
967 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
968
969         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
970         the low level assemblies lock.
971
972 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
973
974         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
975         object.c, reflection.c, socket-io.c, threads.c: introduced
976         mono_framework_version () to return the major framewrok version,
977         changed the code that was using more complex patterns to use it.
978         Return the correct value for PlatformID for OSX.
979
980 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
981
982         * icall-def.h, process.h, process.c: added an icall to get info about
983         processes using mono-proclib.
984
985 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
986
987         * mono-perfcounters.c: use the mono-proclib functions to
988         access process information.
989
990 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
991
992         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
993         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
994         reflection.c: remove rawbuffer usage: mmap support is more sanely
995         provided by utils/mono-mmap.
996
997 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
998
999         * gc.c: use posix semaphores when possible so that
1000         mono_gc_finalize_notify() is signal safe.
1001
1002 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
1003
1004         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
1005         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
1006         be #ifdef-ed out, the linker will remove the rest.
1007
1008         * marshal.c: Implement DISABLE_COM.
1009
1010         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
1011
1012 2008-10-11  Miguel de Icaza  <miguel@novell.com>
1013
1014         * locales.c (string_invariant_compare_char): Optimization: do not
1015         call g_unichar_type unless we actually need the information.
1016
1017 2008-10-10  Mark Probst  <mark.probst@gmail.com>
1018
1019         * object.c, class-internals.h: Also create remoting trampolines
1020         for generic methods.  Pass the domain to the remoting trampoline
1021         creation function, too.
1022
1023 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
1024
1025         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
1026
1027 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
1028
1029         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
1030         Vector4ui.
1031
1032 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
1033
1034         * assembly.c:
1035         * locales.c: remove the use of g_strdown. Fixes bug #322313.
1036
1037 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
1038
1039         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
1040         for the least possible amount of time (extending the fix in r113458).
1041
1042 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
1043
1044         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
1045
1046 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
1047
1048         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
1049         as possible simd intrinsic types.
1050         Optimized the test to check for the common prefix first.
1051
1052 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
1053
1054         * class.c: back out part of a broken optimization committed on
1055         May 23th (bug #433908).
1056
1057 2008-10-09  Mark Probst  <mark.probst@gmail.com>
1058
1059         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
1060         Win32.  Should fix #432388 for most cases until we have the new
1061         profiler on Win32.
1062
1063 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
1064
1065         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
1066         instead of using inst->id so the hash is stable for AOT.
1067
1068 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1069
1070         * appdomain.c:
1071         * icall.c: create a .ini file for shadow-copied assemblies that
1072         contains the location of the original assembly. Use this to return the
1073         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
1074         Also fix the number of '/' for windows when returning the CodeBase.
1075         Fixes bug #430920.
1076
1077 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1078
1079         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
1080
1081         Code is contributed under MIT/X11 license.
1082
1083 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1084
1085         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
1086           if if the class vtable needs initialized.
1087
1088         Code is contributed under MIT/X11 license.
1089
1090 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
1091
1092         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
1093           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
1094           STRING->BSTR, and CLASS->INTERFACE.
1095
1096         Code is contributed under MIT/X11 license.
1097
1098 2008-10-07  Marek Habersack  <mhabersack@novell.com>
1099
1100         * sysmath.h: changed the declaration of the
1101         ves_icall_System_Math_Round2 icall by adding an extra
1102         away_from_zero parameter.
1103
1104         * sysmath.c (ves_icall_System_Math_Round2): added support for
1105         away from zero rounding. The icall now takes an extra boolean
1106         parameter to signal that away from zero operation is requested.
1107
1108 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
1109
1110         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
1111         the delegate klass so it can work with full-aot.
1112         (mono_marshal_get_delegate_end_invoke): Ditto.
1113         (mono_marshal_get_delegate_invoke): Ditto.
1114
1115 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
1116
1117         * gc.c, attach.h, attach.c: remove a bad pattern:
1118         add_finalizer_callback () is not implemented correctly, it can't
1119         without adding more overhead to the finalizer loop and it's not
1120         even needed, since we know exactly what we need to call, so there is
1121         no need to do so through an expensive function pointer.
1122
1123 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
1124
1125         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
1126         for the no-gc case.
1127         * attach.c (mono_attach_init): Remove the #ifdef.
1128
1129 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
1130
1131         * attach.c (mono_attach_init): Don't use
1132         mono_gc_add_finalizer_thread_callback when compiling without GC.
1133         Fixes #432306.
1134         
1135         Code is contributed under MIT/X11 license.
1136
1137 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
1138
1139         * class.c (mono_class_create_from_typedef): Remove the 
1140         #ifndef DISABLE_SIMD stuff.
1141
1142 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
1143
1144         * class-internals.h (MonoClass): Added simd_type bit field.
1145
1146         * class.c (mono_class_create_from_typedef): Check if type is a simd
1147         intrinsic.
1148
1149 2008-10-03  Mark Probst  <mark.probst@gmail.com>
1150
1151         * object.c (mono_method_add_generic_virtual_invocation): Only add
1152         instantiations to the thunk whose count is at least as large as
1153         the threshold.
1154
1155 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
1156
1157         * icall.c: changed the Type of the exception thrown when trying to
1158         invoke a constructor on an abstract class. Part of the fix for bug
1159         #324185.
1160
1161 2008-10-02  Mark Probst  <mark.probst@gmail.com>
1162
1163         * class.c, class-internals.h (mono_method_get_vtable_index): New
1164         function which returns the index into the vtable and properly
1165         handles inflated virtual generic methods.
1166
1167 2008-10-01  Mark Probst  <mark.probst@gmail.com>
1168
1169         * object.c, domain.c, object-internals.h, domain-internals.h:
1170         Generalize IMT thunk machinery to also handle thunks for virtual
1171         generic method invokes.  When a virtual generic method is invoked
1172         more than a number of times we insert it into the thunk so that it
1173         can be called without lookup in unmanaged code.
1174
1175         * generic-sharing.c, class-internals.h: Fetching a
1176         MonoGenericInst* for a method from an (M)RGCTX.
1177
1178 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
1179
1180         * marshal.c (emit_marshal_string): Applied a variant of a patch by
1181         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
1182         marshalling. Fixes #431304.
1183
1184 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
1185
1186         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
1187           handle when ref is specified without In or Out.
1188
1189         Code is contributed under MIT/X11 license.
1190
1191 2008-09-30  Mark Probst  <mark.probst@gmail.com>
1192
1193         * loader.c (mono_get_method_constrained): Don't expand method with
1194         the class's context, because it's already a method of that class.
1195
1196 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
1197
1198         * attach.c : should be correct build fix.
1199
1200 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
1201
1202         * attach.c: Fix the previous change.
1203
1204 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
1205
1206         * attach.c : quick w32 build fix.
1207
1208 2008-09-27  Miguel de Icaza  <miguel@novell.com>
1209
1210         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
1211         crashes MonoDevelop: #430455.
1212
1213 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
1214
1215         * domain-internals.h (struct _MonoDomain): Move most fields used only by
1216         the JIT do MonoJitDomainInfo in ../mini/mini.h.
1217
1218         * domain.c: Remove initialization/cleanup of the removed fields.
1219
1220 2008-09-27  Mark Probst  <mark.probst@gmail.com>
1221
1222         * class.c (mono_class_generic_sharing_enabled): Enable generic
1223         code sharing for PPC.
1224
1225 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
1226
1227         * attach.c : Fixing the Windows builds.
1228
1229         Code is contributed under MIT/X11 license.
1230
1231 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
1232
1233         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
1234         the default generic sharing mode to 'all'.
1235
1236 2008-09-25  Mark Probst  <mark.probst@gmail.com>
1237
1238         * generic-sharing.c, class-internals.h: New function for checking
1239         whether a method needs a static RGCTX invoke wrapper.  A few
1240         funtions moved from mini/generic-sharing.c.
1241
1242         * icall.c: New function used.
1243
1244 2008-09-25  Mark Probst  <mark.probst@gmail.com>
1245
1246         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
1247         Static RGCTX invoke wrapping applies to value type methods, too.
1248
1249         * class.c (mono_class_setup_vtable_general): In generic-shared
1250         value types, wrap methods with a static RGCTX invoke wrapper.
1251
1252 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
1253
1254         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
1255         osx build.
1256
1257 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
1258
1259         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
1260         register a callback which is called when the finalizer thread is woken
1261         up.
1262         (finalizer_thread): Call the callback if it exists.
1263
1264         * attach.h attach.c: New files, implementing the attach mechanism.
1265
1266         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
1267         
1268         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
1269         by the previous change.
1270
1271 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
1272
1273         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
1274         loader.c, marshal.c, metadata-internals.h, metadata.c,
1275         method-builder.c, object.c, reflection.c: introduced specific functions
1276         to allocate from the domain and image mempools and cleaned up most of
1277         the code to use them (still missing a few in reflection.c).
1278         Keep the loader bytes counter updated.
1279
1280 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
1281
1282         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
1283         loader-related counters.
1284
1285 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
1286
1287         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
1288         added more MS-compatible counters.
1289
1290 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
1291
1292         * class.c (mono_class_setup_fields): Call setup_fields before accessing
1293         class->blittable. Fixes #428217.
1294
1295 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
1296
1297         * reflection.c (mono_image_get_field_on_inst_token): Call 
1298         field_encode_signature () since that handles custom modifiers too.
1299         Fixes #424663.
1300
1301 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
1302
1303         * reflection.c (add_custom_modifiers): New helper function to merge custom
1304         modifiers stored in objects to a MonoType.
1305         (fieldref_encode_signature): Encode custom modifiers.
1306         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
1307         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
1308
1309 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
1310
1311         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
1312         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
1313         64-bit IL only images because imports are not resolved for IL only images.
1314         Special thanks to Bill Holmes for finding this bug and testing the patch.
1315         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
1316
1317         Contributed under MIT/X11 license.
1318
1319 2008-09-19  Miguel de Icaza  <miguel@novell.com>
1320
1321         * mono-config.c (dllmap_start): Add support for the bits keyword
1322         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
1323
1324 2008-09-19  Mark Probst  <mark.probst@gmail.com>
1325
1326         * reflection.c (inflate_mono_method): When the class the method is
1327         to be inflated for is itself not inflated, just return the method.
1328
1329 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
1330
1331         * mono-perfcounters.c: use more user friendly process instance names.
1332
1333 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
1334
1335         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
1336           handle "[in] ref" and "[in][out] ref" cases.
1337
1338         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
1339           to mono_mb_create_method.  This was causing problems calling native to
1340           managed passing Variants by value.
1341
1342         Code is contributed under MIT/X11 license.
1343
1344 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
1345
1346         * class.c (can_access_internals): Call mono_assembly_load_friends ()
1347         before accessing the friend_assembly_names field.
1348
1349         * assembly.c (mono_assembly_load_friends): Make this callable multiple
1350         times.
1351         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
1352         called lazily when it is needed.
1353
1354         * metadata-internals.h (struct _MonoAssembly): Add 
1355         'friend_assembly_names_inited' flag.
1356
1357 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
1358
1359         * mono-perfcounters-def.h: fix the types of a few counters.
1360         * mono-perfcounters.c: implemented the instance names getter
1361         and a few bugfixes.
1362
1363 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
1364
1365         * culture-info-table.h : regenerated.
1366
1367 2008-09-17  Robert Jordan  <robertj@gmx.net>
1368
1369         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
1370         context bound objects. Fixes #415577.
1371
1372         Code is contributed under MIT/X11 license.
1373
1374 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
1375
1376         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
1377         implementation (bug #423582).
1378
1379 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
1380
1381         * object.c (mono_object_get_virtual_method): Handle the case method->slot
1382         is not set. Fixes #426309.
1383
1384 2008-09-16  Jb Evain  <jbevain@novell.com>
1385
1386         * class.c (mono_class_from_name): fix the exported type look up
1387         when the type is defined in a referenced assembly.
1388
1389 2008-09-16  Jb Evain  <jbevain@novell.com>
1390
1391         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
1392         increment the next index counter on each iteration to make that work
1393         for more than one type forwarder. Unmanaged part to fix #422929.
1394
1395 2008-09-15  Mark Probst  <mark.probst@gmail.com>
1396
1397         * object-internals.h: enum ComInterfaceType in
1398         MonoInterfaceTypeAttribute is guint32, not guint16.
1399
1400 2008-09-12  Mark Probst  <mark.probst@gmail.com>
1401
1402         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
1403         writing code.
1404
1405 2008-09-11  Mark Probst  <mark.probst@gmail.com>
1406
1407         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
1408         not gboolean.
1409
1410 2008-09-11  Mark Probst  <mark.probst@gmail.com>
1411
1412         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
1413         Endianness fixes for MonoSymbolFileOffsetTable.
1414
1415 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
1416
1417         * process.c (complete_path) : Removing quotes from the 
1418           input path.  The glib file routines do not handle file paths
1419           that have quotes around them.
1420
1421         Code is contributed under MIT/X11 license.
1422
1423 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
1424
1425         * socket-io.h : Adding a comment to provide locations where 
1426           changes to MonoSocketAsyncResult need to be synced.
1427
1428         Code is contributed under MIT/X11 license.
1429
1430 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
1431
1432         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
1433         parameters as well. Fixes #425001.
1434
1435 2008-09-08  Miguel de Icaza  <miguel@novell.com>
1436
1437         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
1438         windows build.
1439
1440 2008-09-07  Miguel de Icaza  <miguel@novell.com>
1441
1442         * console-io.c: Add support for tracking the window size if it
1443         changes.
1444
1445         The setup is very simple: the TtySetup function will now return a
1446         pointer to a location in memory that tracks the current console
1447         size.  The managed code checks its current value every time its
1448         queried against the last value set, and updates accordingly.
1449
1450         With this setup we can work with multiple consoles, and we do not
1451         require to poke into managed code from a signal handler.
1452
1453         Additionally, the environment for COLUMNS and LINES is now handled
1454         in unmanaged code.
1455
1456         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
1457
1458 2008-09-07  Mark Probst  <mark.probst@gmail.com>
1459
1460         * marshal.c (mono_type_native_stack_size): Treat
1461         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
1462
1463 2008-09-04  Jb Evain  <jbevain@novell.com>
1464
1465         * class.c (mono_class_is_assignable_from): fix assignability of nullables
1466         to nullables.
1467
1468 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
1469
1470         * verify.c (verify_type_compatibility_full): Revert change
1471         to allow converting a native int to unmanaged pointer be verifiable
1472         under non-strict mode.
1473         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
1474
1475         * verify.c: Added some TODOs.
1476
1477 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
1478
1479         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
1480           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
1481           Changed to use GlobalAlloc for the memory returned on Windows platforms.
1482
1483         Code is contributed under MIT/X11 license.
1484
1485 2008-09-02  Jb Evain  <jbevain@novell.com>
1486
1487         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
1488
1489 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
1490
1491         reflection.c (typebuilder_setup_fields): Handle classes with
1492         explicit size.
1493
1494 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
1495
1496         class.c (mono_class_setup_events): Add memory barrier due to
1497         double checked locking.
1498         
1499         class.c (mono_class_setup_properties): Same.
1500
1501 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
1502
1503         * class.c (mono_class_is_assignable_from): Fix the build.
1504         
1505         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
1506         before accessing klass->interface_bitmap. Fixes #421744.
1507
1508 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
1509
1510         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
1511         the runtime into no-exec mode, useful when running the AOT compiler.
1512
1513         * appdomain.c gc.c object.c: Avoid executing managed code when running
1514         in no-exec mode.
1515         
1516         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
1517
1518         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
1519         special case when the mono_assembly_loaded () returns NULL because the 
1520         search hook is not installed.
1521
1522 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
1523
1524         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
1525         crashes in bstr marshalling on linux.
1526
1527 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
1528
1529         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
1530         with more than one parameter.
1531
1532 2008-08-24  Miguel de Icaza  <miguel@novell.com>
1533
1534         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
1535         start/stop flow control as well when turning off ICANON (allows
1536         C-s and C-q to be read by Console.ReadKey).
1537
1538 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
1539
1540         * class.c (mono_class_init): Move the initialization of nested classes
1541         into mono_class_get_nested_types (). Fixes #418433.
1542
1543         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
1544         flag.
1545
1546         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
1547         iterating tough the nested classes of a class.
1548
1549 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
1550
1551         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
1552         on arm.
1553
1554 2008-08-22  Miguel de Icaza  <miguel@novell.com>
1555
1556         * console-io.c (sigcont_handler): Support signal chaining for
1557         SIGCONT.
1558
1559         (console_set_signal_handlers): Use best practices with sigaction,
1560         clear the structure before using it. 
1561
1562 2008-08-22  Robert Jordan  <robertj@gmx.net>
1563
1564         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
1565         Fix the Windows build.
1566
1567 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
1568
1569         * class.c (mono_class_generic_sharing_enabled): Make the default
1570         sharing mode 'corlib'.
1571
1572 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
1573
1574         * console-io.c (console_set_signal_handlers): Fix a warning.
1575
1576         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
1577         method normally, the JIT will take care of avoiding recursion.
1578
1579 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
1580
1581         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
1582
1583         Code is contributed under MIT/X11 license.
1584
1585 2008-08-20  Miguel de Icaza  <miguel@novell.com>
1586
1587         * console-io.c (sigcont_handler): We need to restore the entire
1588         termios state, not only the original settings, as things like echo
1589         can be controlled after this (Booish exposes this issue with its
1590         own ReadLine implementation).
1591
1592         Additionally, we need to set the terminal back into keypad_xmit
1593         mode.
1594         
1595         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
1596         string as a paramter as well.   Otherwise we get different
1597         keyboard sequences.
1598
1599 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
1600
1601         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
1602         delegates with byref out parameter passing. Fixes #351520.
1603
1604         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
1605         a generic context.
1606         (mono_type_get_desc): Add the type arguments for GENERICINST.
1607         (mono_method_full_name): Stringify the class name using mono_type_full_name
1608         so it picks up generic arguments.
1609
1610 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
1611
1612         * console-io.c: Removed debug output.
1613
1614 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
1615
1616         reflection.c (mono_reflection_create_runtime_class): Alloc
1617         the nested classes linked list using the dynamic image mempool.
1618         Fixes leak in corlib compilation.
1619
1620 2008-08-19  Miguel de Icaza  <miguel@novell.com>
1621
1622         * console-io.c: Fix incredibly annoying behavior on the console
1623         after resuming execution after control-z.   This affected every
1624         console application.
1625
1626 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
1627
1628         * mempool-internals.h: Header for mono private mempool functions. The first
1629         two function are for allocating glib linked lists using pools.
1630
1631         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
1632
1633         * Makefile.am: Added mempool-internals.h.
1634
1635 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
1636
1637         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
1638         (mono_domain_free): Ditto.
1639
1640         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
1641         be used by the JIT to store its domain-specific information, instead of putting
1642         it directly into MonoDomain.
1643
1644         * domain.c (mono_install_create_domain_hook): New helper function to install
1645         a hook which initializes domain->runtime_info.
1646
1647         * domain.c (mono_install_free_domain_hook): Ditto.
1648         
1649 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
1650
1651         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
1652         asserting if the ares parameter is null.
1653
1654         * mono-perfcounters.c: Fix warnings.
1655
1656         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
1657         is not needed, don't check for interruptions either.
1658         (mono_marshal_get_delegate_end_invoke): Ditto.
1659
1660 2008-08-15  Marek Habersack  <mhabersack@novell.com>
1661
1662         * mono-perfcounters.c (predef_readonly_counter): added support for
1663         reading the ASP.NET Requests Queued counter from another process.
1664
1665 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
1666
1667         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
1668         MonoImage to simplify the AOT code.
1669
1670 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
1671
1672         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
1673         marshalling. Fixes #416078.
1674
1675 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
1676         
1677         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
1678         it is set, looking up the icall address is deferred to the JIT, since 
1679         in embedded scenarios, the icall might not be registered in the runtime
1680         doing the AOT compilation. Backported from the 2.0 branch.
1681
1682 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
1683
1684         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
1685         Fixes #415621.
1686
1687 2008-08-05  Marek Habersack  <mhabersack@novell.com>
1688
1689         * Makefile.am: added support for cross-compilation.
1690
1691 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
1692
1693         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
1694
1695 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
1696
1697         * mono-perfcounters.c: jitted methods and jitted bytes counters.
1698
1699 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
1700
1701         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
1702         mono-perfcounters.c: performance counters implementation.
1703
1704 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
1705
1706         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
1707         to gpointer, letting the AOT code decide what to store in it.
1708
1709 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
1710
1711         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
1712           mono_class_setup_methods if the methods are not initialized.
1713
1714         Code is contributed under MIT/X11 license.
1715
1716 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1717
1718         * verify.c: Remove some debug code I commited by accident.
1719
1720         * verify.c (mono_method_is_valid_in_context): Change the return value
1721         to make possible to distinguish between invalid and unverifiable.
1722
1723         * verify.c (verifier_load_method): Don't return NULL for unverifiable
1724         methods.
1725
1726 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1727
1728         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
1729         constraints. Fixes regression in gtest-253.
1730
1731 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
1732
1733         * verify.c (mono_verifier_verify_class): Don't allow generic types
1734         with explicit layout.
1735
1736         * verify.c (mono_method_verify): Check locals and argument types.
1737
1738 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
1739
1740         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
1741         wait if the thread is in StopRequested state.
1742
1743         * class.c (mono_class_from_name): Refactor the module searching code into
1744         a separate function so it can be reused in the AOT case too.
1745
1746 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1747
1748         * verify.c (mono_type_is_valid_in_context): Improve the error message.
1749         Check both the type and it's generic type definition for loader errors.
1750         
1751         * verify.c (mono_method_is_valid_in_context): Don't generate another
1752         error when a type errors occur, this leads to the wrong exception been
1753         thrown.
1754
1755 2008-07-28  Dick Porter  <dick@ximian.com>
1756
1757         * icall-def.h
1758         * process.c
1759         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
1760         New internal calls to duplicate and close a process handle.
1761
1762 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
1763
1764         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
1765
1766 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
1767
1768         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
1769
1770 2008-07-27  Robert Jordan  <robertj@gmx.net>
1771
1772         * class.c (mono_class_init): Don't compute class.has_finalize for
1773         valuetypes. Fixes #412477.
1774
1775 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
1776
1777         * verify.c: Implement constraint equivalence checking.
1778         This is required when a generic parameter is used as
1779         argument to a constrained one.
1780
1781         Fixes #410637.
1782
1783 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
1784
1785         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
1786
1787         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
1788
1789         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
1790         synch with managed object layout.
1791
1792 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
1793
1794         * verify.c (do_branch_op): Handle valuetypes and generic
1795         arguments properly.
1796
1797         * verify.c (do_cmp_op): Same.
1798
1799         Fixes #410383.
1800
1801 2008-07-24  Mark Probst  <mark.probst@gmail.com>
1802
1803         * generic-sharing.c: Fix memory leaks.
1804
1805         * class.c, class-internals.h: Make
1806         mono_class_inflate_generic_type_with_mempool() non-static.
1807
1808 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
1809
1810         * pedump.c (dump_verify_info): Dump full class name.
1811
1812 2008-07-24  Mark Probst  <mark.probst@gmail.com>
1813
1814         * generic-sharing.c: Removed some old code that didn't do anything.
1815
1816 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
1817         * profiler.c: Added runtime_initialized_event,
1818         mono_profiler_install_runtime_initialized and
1819         mono_profiler_runtime_initialized. This new hook tells the profiler
1820         when the runtime is sufficiently initialized to be able to call
1821         mono_thread_attach on the root appdomain.
1822         * profiler.h, profiler-private.h: Likewise.
1823
1824 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
1825
1826         * verify.c (do_cast): Do boxing for generic arguments as well.
1827
1828         * class.c (is_nesting_type): Drop generic instantiations before
1829         checking for nesting.
1830
1831         * class.c (can_access_instantiation): Allow access to generic
1832         arguments.
1833
1834 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
1835
1836         * verify.c (verify_class_for_overlapping_reference_fields):
1837         On some cases, the field size might be zero, guard against that.
1838         Fix the explicit layout check to work as expected.
1839
1840 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
1841
1842         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
1843         mono_thread_resume () during shutdown, since the thread we want to abort
1844         might be suspended.
1845
1846 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
1847
1848         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
1849         warning.
1850
1851         * debug-mono-symfile.c: Fix a warning.
1852
1853         * mono-perfcounters.c (get_cpu_times): Fix a warning.
1854
1855         * object.c (mono_class_vtable): Check if exception_type is set, and return
1856         NULL as defined by the function comments.
1857
1858 2008-07-22  Mark Probst  <mark.probst@gmail.com>
1859
1860         * mempool.c: Use malloc for every single mempool allocation if the
1861         configure option is set.  This makes it easier to track mempool
1862         allocations with tools like Valgrind.
1863
1864 2008-07-22  Jb Evain  <jbevain@novell.com>
1865
1866         * reflection.c (create_dynamic_mono_image): emit the same
1867         metadata version that SL2 does when creating a SL2 image.
1868
1869 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
1870
1871         * icall-def.h:
1872         * icall.c: New icall System.Enum:get_hashcode. This function
1873         avoids the overhead of boxing the enum to the underlying type.
1874
1875 2008-07-21  Mark Probst  <mark.probst@gmail.com>
1876
1877         * reflection.c (mono_method_get_object): Don't let static RGCTX
1878         invoke wrappers get into MonoReflectionMethods.
1879
1880 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
1881
1882         * object-internals.h:
1883         * object.c: New mono_runtime_class_init_full function
1884         that makes throwing the exception optinal.
1885
1886         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
1887         for the case where the exception object is supplied.
1888
1889 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
1890
1891         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
1892         old ld versions.
1893
1894         Contributed under MIT/X11 license.
1895
1896 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1897
1898         * string-icalls.c (ves_icall_System_String_InternalSplit):
1899         Optimize array allocation by caching the MonoClass of the
1900         array type.
1901
1902         * icall.c (ves_icall_Type_GetMethodsByName): Same.
1903
1904         * reflection.c (mono_param_get_objects): Same.
1905
1906 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1907
1908         * icall-def.h:
1909         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
1910         It inflates the given type using the class context.
1911
1912 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1913
1914         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
1915         the vtable if it already exists.
1916
1917         * object-internals.h: Add mono_class_try_get_vtable as part of the
1918         internal API.
1919
1920         * reflection.c (mono_type_get_object): Use the MonoObject from the
1921         vtable when possible. Reduces locking contention on reflection heavy
1922         code.
1923
1924 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
1925
1926         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
1927         g_bit_nth_msf () since that macro is not implemented in eglib.
1928
1929 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
1930
1931         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
1932         on platforms which do not support it.
1933
1934 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
1935
1936         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
1937
1938 2008-07-11  Martin Baulig  <martin@ximian.com>
1939
1940         * mono-debug-debugger.h
1941         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
1942
1943         * mono-debug-debugger.c
1944         (_mono_debugger_interruption_request): New global volatile variable.
1945         (mono_debugger_check_interruption): New public function.
1946
1947         * threads.c
1948         (mono_thread_current_check_pending_interrupt): Call
1949         mono_debugger_check_interruption().
1950         (mono_thread_interruption_checkpoint_request): Likewise.
1951
1952 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1953
1954         * verify.c: Add more type checks for loaded types. Verify the result
1955         handle from ldtoken.
1956
1957 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1958
1959         * loader.c (field_from_memberref): Don't crash if the field
1960         wasn't found.
1961
1962 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1963
1964         * verify.c: Verify if type and method instantiations
1965         don't have invalid VAR or MVAR arguments.
1966
1967 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1968
1969         * verify.c: Fix double free of function pointer list.
1970
1971 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
1972
1973         * object.c (mono_string_to_utf8): Comment the new code as it
1974         breaks under eglib.
1975
1976 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
1977
1978         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
1979
1980 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
1981
1982         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
1983           is not throw too many times.
1984
1985         Code is contributed under MIT/X11 license.
1986
1987 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
1988
1989         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
1990         debugging is turned off.
1991
1992 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
1993
1994         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
1995
1996 2008-07-04  Mark Probst  <mark.probst@gmail.com>
1997
1998         * class-internals.h, class.c: Added new generic sharing option:
1999         Share only stuff in System.Collections.Generic, which is now the
2000         default.
2001
2002 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2003
2004         * generic-sharing.c, class-internals.h: New function for getting a
2005         generic method in a generic class given the corresponding method
2006         for a different instantiation of the class.  Partly refactored
2007         from mini-trampolines.c.
2008
2009         * class.c: Make sure generic methods have a class_inst if they are
2010         part of a generic class.
2011
2012         * metadata.c (mono_type_stack_size_internal): Handle type
2013         variables.
2014
2015 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2016
2017         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
2018         Signifies whether information on the this/vtable/mrgctx variable
2019         is available.
2020
2021 2008-07-04  Mark Probst  <mark.probst@gmail.com>
2022
2023         * object.c, object-internals.h, icall.c: New function
2024         mono_delegate_ctor_with_method(), which does the same as
2025         mono_delegate_ctor(), but takes an explicit method argument
2026         instead of taking the method from the jit info.
2027
2028         * marshal.c: When creating a delegate with an inflated method take
2029         the "this" argument as the target class for the castclass.
2030
2031 2008-07-03  Mark Probst  <mark.probst@gmail.com>
2032
2033         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
2034         mono_jit_info_table_find() to perform very badly in some cases.
2035
2036 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
2037
2038         * icall.c (type_from_typename): Handle 'string'.
2039
2040         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
2041         wrappers into the wrapper_hash, since the key is not a MonoMethod.
2042
2043 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
2044
2045         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
2046
2047         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
2048         number of available managed allocator types.
2049
2050         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
2051         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
2052
2053 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
2054
2055         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
2056         which is a low level lock protecting just the 'jit_code_hash' hash table.
2057
2058         * domain.c: Initialize+cleanup jit_code_hash_lock.
2059         
2060 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
2061
2062         * coree.c (mono_load_coree): Set coree_module_handle global variable only
2063         after initialization.
2064
2065         * coree.h: Make MonoFixupExe internal.
2066
2067         Contributed under MIT/X11 license.
2068
2069 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
2070
2071         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
2072         because that is platform independent. Check NumberOfRvaAndSizes in PE32
2073         as well.
2074         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
2075         image being loaded is a CLI image and _CorValidateImage gets called.
2076
2077         * coree.h: Add MonoLoadImage.
2078
2079         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
2080         instead of LoadLibrary.
2081
2082         Contributed under MIT/X11 license.
2083
2084 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
2085
2086         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
2087         for any primitive type.
2088
2089 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
2090
2091         * object.c (mono_array_new_specific): Optimize this and the other allocation
2092         functions a bit.
2093         
2094         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
2095         domains too if mono_dont_free_domains is set.
2096
2097         * domain-internals.h (mono_dont_free_domains): New internal option controlling
2098         whenever to free appdomain data after it has been unloaded.
2099
2100         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
2101         
2102 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
2103
2104         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
2105         (mono_method_get_equivalent_method): Fix a warning.
2106
2107         * object.c (mono_message_init): Avoid looking up array types for each call.
2108
2109 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
2110
2111         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
2112         call.
2113
2114         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
2115         even more.
2116
2117         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
2118         each iteration.
2119
2120         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
2121         fields of an enum.
2122
2123 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
2124
2125         * object.c (mono_value_box): Fix boxing of nullables.
2126
2127 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
2128
2129         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
2130         mono_module_handle that is defined by the linker; no initialization required.
2131         * coree.h: Remove mono_module_handle, add __ImageBase, update
2132         mono_image_open_from_module_handle.
2133         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
2134         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
2135         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
2136         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
2137         to 4 GB away from image base address. IA64 version is not tested but was very
2138         easy to implement and should work if we ever need it.
2139         * domain.c (mono_init_internal): Avoid system error message boxes.
2140         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
2141         with has_entry_point. Handle do_mono_image_load fauilre correctly.
2142         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
2143         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
2144         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
2145
2146         Contributed under MIT/X11 license.
2147
2148 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2149
2150         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
2151         as part of the private mono API.
2152         
2153         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
2154         Do proper argument checking for methods that belong to generic classes.
2155         Do proper type resolution for GMFH/2.
2156         Fixes #377324.
2157         
2158 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2159
2160         * verify.c (do_switch): Fix a memory corruption bug with
2161         the jump index is out of bound.
2162
2163 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2164
2165         * verify.c: Disable debug code.
2166
2167 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
2168
2169         * reflection.c (mono_image_get_methodbuilder_token): Use
2170         mono_image_get_methodspec_token_for_generic_method_definition
2171         instead of mono_image_get_memberref_token. We cache more memberef
2172         entries now.
2173
2174 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2175
2176         * verify.c: Inflate exception clause types.
2177         Fixes #402606.
2178         
2179 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2180
2181         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
2182         name.
2183
2184         * reflection.c (mono_image_get_ctorbuilder_token): Same.
2185
2186         * reflection.c (mono_image_create_method_token): Same.
2187
2188 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2189
2190         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
2191         It does the same as mono_image_get_methodref_token but works on
2192         MethodBuilder.
2193
2194         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
2195         and always generate a methodspec. This follows the old behavior and fixes
2196         the regressions in System.Core. 
2197
2198 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
2199
2200         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
2201         don't event mono_class_get () succeeds. Fixes #402182.
2202
2203 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
2204
2205         * metadata-internals.h: Added MonoDynamicImage::methodspec
2206         hashtable to store methodspec tokens created for MethodBuilders.
2207
2208         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
2209         MethodBuilders as open instantiations if a methodspec was requested.
2210
2211         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
2212
2213         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
2214
2215         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
2216
2217         Fixes bug #349190.
2218
2219 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
2220
2221         * loader.c (method_from_methodspec): Avoid crashing if the
2222         method lookup fails.
2223
2224 2008-06-20  Dick Porter  <dick@ximian.com>
2225
2226         * socket-io.c (get_socket_assembly): Cope with Moonlight network
2227         classes being in a different assembly.  Fixes bug 399184.
2228
2229 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
2230
2231         * loader.c (mono_loader_init): Make this callable multiple times.
2232         (mono_dllmap_insert): Call mono_loader_init () so this works even before
2233         the runtime is initialized. Fixes #401755.
2234
2235 2008-06-19  Dick Porter  <dick@ximian.com>
2236
2237         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
2238         Fixes bug 349688.
2239
2240 2008-06-19  Dick Porter  <dick@ximian.com>
2241
2242         * socket-io.c:
2243         * icall-def.h: Implement Socket generic Send() and Receive()
2244         methods.  Fixes bug 395168.
2245
2246 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
2247
2248         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
2249
2250         Contributed under MIT/X11 license.
2251
2252 2008-06-18  Martin Baulig  <martin@ximian.com>
2253
2254         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
2255         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
2256         set to 80.0.  The debugger <-> runtime interface is now frozen as
2257         well.   
2258
2259         * mono-debug.c
2260         (mono_debug_debugger_version): Bump to 4.
2261
2262 2008-06-18  Martin Baulig  <martin@ximian.com>
2263
2264         * debug-mono-symfile.c
2265         (load_symfile): Don't check the minor version.
2266
2267         * debug-mono-symfile.h: Bump the version number to 50.0.
2268
2269 2008-06-18  Martin Baulig  <martin@ximian.com>
2270
2271         * debug-mono-symfile.c
2272         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
2273         minimum required version.
2274
2275 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
2276
2277         * reflection.c (mono_custom_attrs_from_property): Fix support for
2278         retriveving cattrs of dynamic inflated generic types.
2279
2280         * reflection.c (mono_custom_attrs_from_event): Same.
2281
2282         * reflection.c (mono_custom_attrs_from_field): Same;
2283
2284         * reflection.c (typebuilder_setup_events): Same cattrs of events.
2285
2286         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
2287         Moved to metadata.c.
2288
2289         * metadata.c: New functions to retrive the equivalent field, event
2290         of property from the generic type definition.
2291
2292         * metadata-internals.h: Added new functions from metadata.c.
2293
2294 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
2295
2296         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
2297         to cached in a mempool is used.
2298
2299         * metadata.c (free_generic_class): In some situations field generic_info type
2300         is not properly dup'ed and leads to double free'ing.
2301
2302         Fixes #400643.
2303
2304 2008-06-17  Mark Probst  <mark.probst@gmail.com>
2305
2306         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
2307         this arguments (will be needed later for generic methods).
2308         Collect stats.
2309
2310 2008-06-17  Mark Probst  <mark.probst@gmail.com>
2311
2312         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
2313         Create a static RGCTX invoke wrapper for methods which require it.
2314
2315 2008-06-17  Mark Probst  <mark.probst@gmail.com>
2316
2317         * object.c, class-internals.h: New function for checking whether
2318         an individual field is special static.
2319
2320 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
2321
2322         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
2323         linear search since the table is sorted.
2324
2325         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
2326         Fixes #324180.
2327
2328 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
2329
2330         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
2331         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
2332
2333         * gc.c (mono_domain_finalize): Allow an infinite timeout.
2334
2335         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
2336         
2337         * threads.c (mono_thread_request_interruption): Get rid of locking, use
2338         InterlockedCompareExchange to query and modify 
2339         thread->interruption_requested.
2340
2341         * object-internals.h (struct _MonoThread): Change interruption_requested
2342         to a gint32 so it can be modified by atomic operations. Add 
2343         'critical_region_level' from the managed side, change small_id to a guint32,
2344         add new set of 'unused' fields.
2345
2346         * appdomain.c: Bump corlib version.
2347
2348 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
2349
2350         * class.c (mono_class_from_name): Search modules as well. Fixes
2351         #322332.
2352
2353 2008-06-13  Mark Probst  <mark.probst@gmail.com>
2354
2355         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
2356         templates.  Templates are generalized with an additional type_argc
2357         argument.  RGCTX templates have type_argc==0, MRGCTX templates
2358         have type_argc>0.
2359
2360         * domain-internals.h, domain.c: New hash table for looking up
2361         MRGCTXs.
2362
2363         * metadata.c, metadata-internals.h: Rename hash and equal
2364         functions for MonoGenericInst's and make them public.
2365
2366         * class-internals.h: New data structures for the MRGCTX.  Macros
2367         for distinguishing slots in the RGCTX and the MRGCTX.
2368
2369 2008-06-13  Mark Probst  <mark.probst@gmail.com>
2370
2371         * object.c (mono_method_get_imt_slot): Put the same methods of
2372         different instantiations of the same generic interface in the same
2373         IMT slots, to make generic sharing simpler.
2374
2375 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
2376
2377         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
2378
2379         * metadata.c (mono_metadata_field_info_with_mempool): Added.
2380         This function works just like mono_metadata_field_info, but
2381         accept a mempool as argument to be used allocating memory.
2382
2383         * marshal.c (mono_marshal_load_type_info): Use new function
2384         to load marshal data into image mempool.
2385
2386 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
2387
2388         * class.c (mono_class_inflate_generic_type_with_mempool):
2389         This function allows to inflate a generic type using
2390         a mempool.
2391
2392         * class.c (inflate_generic_type): Take a mempool as argument
2393         and use it to do type dup'ing.
2394
2395         * class.c (mono_class_setup_fields): Field type for generic
2396         generic classes are allocated from the image mempool.
2397
2398         * metadata.c (free_generic_class): Inflated field type is
2399         now allocated in the image mempool.
2400
2401 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
2402
2403         * threads.c (thread_cleanup): Free MonoThread::name.
2404
2405 2008-06-12  Marek Habersack  <mhabersack@novell.com>
2406
2407         * appdomain.c (ensure_directory_exists): avoid unnecessary
2408         mkdir(2) calls when the shadow directory already exists.
2409         (mono_make_shadow_copy): copy also satellite assemblies from the
2410         private bin directories.
2411
2412 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
2413
2414         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
2415         
2416         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
2417         a page boundary. Fixes #396219.
2418
2419 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2420
2421         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
2422         due to double-checked locking.
2423
2424 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2425
2426         * assembly.c (build_assembly_name): Release memory on failure.
2427
2428         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
2429
2430 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2431
2432         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
2433         memory on failure.
2434
2435 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2436
2437         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
2438         memory on failure.
2439
2440 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2441
2442         * loader.c (field_from_memberref): Check if field signature type is equal
2443         to the non-inflated type of the field. Fixes #398980.
2444
2445 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
2446
2447         * assembly.c (mono_assembly_load_from_full): Call 
2448         mono_assembly_load_friends () outside the assemblies lock, since it can
2449         acquire the loader lock. Fixes #323696.
2450
2451         * reflection.c (resolve_object): Inflate the inst with the context for
2452         FieldOnTypeBuilderInst. Fixes #399010.
2453
2454 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2455
2456         * reflection.c (mono_image_get_field_on_inst_token): Don't
2457         inflate the field to encode it's signature. If it's a
2458         VAR or MVAR it should stay that way in the signature.
2459         Fixes #399047.
2460
2461 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2462
2463         * reflection.c (resolve_object): Release memory of inflated types.
2464
2465 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2466
2467         * loader.c (mono_method_get_signature_full): Remove assert about
2468         loading a methodspec to a generic method. We have such methods, such as
2469         System.Threading.Interlocked::CompareExchange<T>.
2470         This assert was removed since it crashes the verifier when it checks
2471         methods calling CompareExchange<T>.
2472
2473 2008-06-10  Marek Safar  <marek.safar@gmail.com>
2474
2475         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
2476         of Type array and not MonoType.
2477
2478 2008-06-10  Marek Habersack  <mhabersack@novell.com>
2479
2480         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
2481         <lupus@ximian.com>
2482
2483 2008-06-10  Martin Baulig  <martin@ximian.com>
2484
2485         * debug-mono-symfile.h
2486         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
2487         changes to the file format, but we were generating incorrect
2488         source file indices in the line number table due to a bug, which
2489         made backtraces report an incorrect source file.
2490
2491 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2492
2493         * mono-debug.c: Moved mono_debug_free_method_jit_info from
2494         mini/debug-mini.c to here.
2495
2496         * mono-debug.c (il_offset_from_address): Free memory from find_method.
2497
2498         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
2499         use it to release structs returned by mono_debug_find_method.
2500
2501 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
2502
2503         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
2504         since it needs to set method->slot for all interface methods.
2505
2506 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2507
2508         * class-internals.h: Forgot to add.
2509
2510 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2511
2512         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
2513
2514         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
2515         Lookup the custom attributes from property_hash.
2516
2517         * reflection.c (mono_save_custom_attrs): Save the custom attributes
2518         in property_hash. Allocate all data using the image mempool.
2519
2520         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
2521         for dynamic_custom_attrs to checks if the image is dynamic.
2522
2523 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
2524
2525         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
2526         assemblies array.
2527         
2528         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
2529         runtime functions while holding the domain assemblies lock.
2530
2531 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2532
2533         * verify.c: Reapplied the last bit of the reverted changes.
2534
2535 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2536
2537         * verify.c: Reapplied more of the reverted changes.
2538
2539 2008-06-09  Martin Baulig  <martin@ximian.com>
2540
2541         * debug-mono-symfile.c (load_symfile): Check the major version
2542         first; if it's wrong, don't print the minor version in the error message.
2543
2544 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
2545
2546         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
2547         lock instead of the domain lock to avoid deadlocks, since the thread might
2548         already hold the loader lock.
2549
2550         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
2551         (mono_thread_attach): Ditto.
2552
2553         * monitor.c: Use a TLS variable for holding the current thread id instead
2554         of calling pthread_self ().
2555         (mono_monitor_init_tls): New internal function to initialize the TLS
2556         variable.
2557         (mono_monitor_try_enter_internal): Put the owner == id check after the
2558         owner == 0 check.
2559
2560         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
2561         missed optimizations when using gcc-4.3.
2562
2563 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
2564
2565         * reflection.c (mono_dynamic_image_free): Free the memory
2566         used by MonoGenericParam in MonoDynamicImage::gen_param.
2567
2568         * reflection.c (mono_reflection_setup_generic_class): Allocate
2569         container from mempool.
2570
2571         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
2572         container from mempool.
2573
2574 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
2575
2576         * threads.c (mono_set_pending_exception): New internal function to set the
2577         pending exception of the current thread.
2578         (mono_thread_get_and_clear_pending_exception): Check for 
2579         thread->pending_exception as well.
2580
2581         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
2582
2583         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
2584         it can trigger a collection.
2585
2586 2008-06-06  Martin Baulig  <martin@ximian.com>
2587
2588         Merged the `debugger-kahalo' branch.
2589
2590         * mono-debug.h
2591         (MONO_DEBUGGER_VERSION): Bumped to 72.
2592
2593         * debug-mono-symfile.h
2594         (MonoSymbolFileMethodIndexEntry): Removed.
2595         (MonoSymbolFileMethodEntry): New public typedef.
2596         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
2597         (MonoSymbolFileSourceEntry): Remove everything except `index' and
2598         `data_offset'.
2599         (MonoSymbolFileMethodEntry): Removed.
2600         (MonoSymbolFileLexicalBlockEntry): Removed.
2601         (MonoSymbolFileLineNumberEntry): Removed.
2602         (MonoDebugLexicalBlockEntry): Removed.
2603         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
2604         removed `num_il_offsets' and `il_offsets'.
2605         (MonoSymbolFile): Replace `version' with `major_version' and
2606         `minor_version'.
2607         (MONO_SYMBOL_FILE_VERSION): Replace with
2608         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
2609         `MONO_SYMBOL_FILE_MINOR_VERSION'.
2610
2611         * debug-mono-symfile.c
2612         (mono_debug_symfile_lookup_location): Add support for the new line
2613         number table format.
2614
2615 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
2616
2617         * metadata.c (free_generic_class): Release the inflated
2618         MonoClass of dynamic generic classes if it's not a generic
2619         type definition.
2620
2621 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
2622
2623         * verify.c: Reapplied more of the reverted changes.
2624
2625 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
2626
2627         * reflection.c (lookup_custom_attr): Clean the cached flag or
2628         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
2629         for SRE types.
2630
2631 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
2632
2633         * verify.c: Reapplied a small part of the reverted changes.
2634
2635 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
2636
2637         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
2638
2639         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
2640         previously in managed code.
2641         (mono_monitor_exit): Ditto.
2642         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
2643
2644         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
2645         the managed definition.
2646
2647 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
2648
2649         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
2650
2651 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
2652
2653         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
2654         
2655         * monitor.c: Add some micro optimizations.
2656
2657         * icall.c (type_from_typename): Handle 'bool'.
2658
2659 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
2660
2661         * verify.c: Implement constructor verification per P III 1.8.1.4.
2662         Fixes #396716.
2663
2664 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
2665
2666         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
2667         holding the assemblies lock here too.
2668
2669 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2670
2671         * verify.c: Kill stack_top function.
2672
2673 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2674
2675         * verify.c: Kill stack_get function.
2676
2677 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2678
2679         * verify.c (mono_method_verify): Last change broke the build. Fixed.
2680
2681 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2682
2683         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
2684         more reliable.
2685
2686         * verify.c (mono_method_verify): Inflate params and locals to avoid
2687         mismatch when checking for compatibility.
2688
2689 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
2690
2691         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
2692         Length prefix should be size in bytes. Fix bug #339530.
2693         
2694         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
2695         Length prefix should be size in bytes. Fix bug #339530.
2696
2697         Code is contributed under MIT/X11 license.
2698
2699 2008-06-05  Bill Holmes <billholmes54@gmail.com>
2700
2701         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
2702
2703         Contributed under MIT/X11 license.
2704
2705 2008-06-05  Martin Baulig  <martin@ximian.com>
2706
2707         * mono-debug-debugger.c
2708         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
2709
2710 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
2711
2712         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
2713         while holding the assemblies lock to prevent deadlocks. Handle the case
2714         where the search hook returns NULL but the assembly was still loaded.
2715         Fixes #323696.
2716
2717         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
2718         modify domain state.
2719
2720 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
2721
2722         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
2723         * Makefile.am (pedump_LDADD): Post-process object files and
2724         add dtrace-generated object file, if necessary.
2725
2726         Code is contributed under MIT/X11 license.
2727
2728 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2729
2730         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
2731
2732 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2733
2734         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
2735
2736 2008-06-04  Mark Probst  <mark.probst@gmail.com>
2737
2738         * threads.c: Try to free everything from the delayed free table
2739         when shutting down threads, and set the variable to NULL after the
2740         table is freed so that calling
2741         mono_thread_hazardous_try_free_all() when shutting down the root
2742         domain doesn't crash.
2743
2744 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2745
2746         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
2747         the caller if resulting type was inflated.
2748
2749         * class.c (mono_class_create_from_typespec): Free the MonoType if it
2750         was inflated.
2751
2752         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
2753
2754
2755 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
2756
2757         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
2758         class library tests.
2759
2760         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
2761         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
2762         #396989.
2763
2764 2008-06-04  Mark Probst  <mark.probst@gmail.com>
2765
2766         * domain.c, domain-internals.h: The JIT infos are now freed by the
2767         JIT info table code.  They are freed immediately if there only a
2768         single JIT info table in circulation.  If there is more, the free
2769         is delayed via a queue.
2770
2771         * threads.c, threads-types.h: New hazard pointer function for
2772         freeing all freeable delayed items in one sitting.
2773
2774 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2775
2776         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
2777
2778         * reflection.c (typebuilder_setup_properties): Same.
2779
2780         * reflection.c (typebuilder_setup_events): Same.
2781
2782 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2783
2784         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
2785         and use it for allocating memory.
2786
2787         * reflection.c (mono_marshal_spec_from_builder): Same.
2788
2789         * reflection.c: Change code to use new signatures.
2790
2791         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
2792
2793 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2794
2795         * decimal.c (rescale128): Put back one line which was accidently commented
2796         out.
2797         
2798         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
2799         to cause crashes.
2800
2801 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2802
2803         * reflection.c (mono_reflection_generic_class_initialize): Name must
2804         be always malloc'ed so we can free it later on. Do this for field, property
2805         and event.
2806
2807         * metadata.c (free_generic_class): Free field, property and event names.
2808
2809 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2810
2811         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
2812         instead of g_memdup.
2813
2814         * reflection.c (typebuilder_setup_fields): Same.
2815
2816 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2817
2818         * decimal.c (rescale128): Optimize this function a bit more.
2819
2820 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2821
2822         * metadata.c (free_generic_class): Release some memory from
2823         SRE generic classes.
2824
2825 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2826
2827         * reflection.c (mono_image_get_generic_field_token): No reference
2828         to name is kept, free it.
2829
2830         * reflection.c (mono_reflection_generic_class_initialize): Free
2831         more memory of the inflated field.
2832
2833 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
2834
2835         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
2836         code.
2837
2838 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
2839
2840         * reflection.c (mono_dynamic_image_free): Release memory used by
2841         MonoDynamicImage::array_methods elements.
2842
2843         * reflection.c (assembly_add_win32_resources): Release memory after
2844         encoding.
2845
2846 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
2847
2848         * decimal.c (log2_32): Use an optimized version for this function too.
2849         
2850         * decimal.c (log2_64): Fix this on 32 bit machines.
2851
2852 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
2853
2854         * class.c (mono_dup_array_type): Implement allocation using a mempool.
2855
2856         * class.c (mono_metadata_signature_deep_dup): Same.
2857
2858         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
2859         a mempool.
2860
2861         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
2862
2863         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
2864
2865         * metadata-internals.h: Added mono_metadata_signature_dup_full.
2866
2867         * class-internals.h: Update signatures to take a MonoMemPool.
2868
2869 2008-06-02  Dick Porter  <dick@ximian.com>
2870
2871         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
2872         * icall-def.h: Add
2873         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
2874         FormatMessage API to get the error text.  Fixes bug 321827.
2875
2876 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
2877
2878         * decimal.c: Add some micro optimizations to make decimal operations faster.
2879
2880 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2881
2882         * reflection.c (method_encode_clauses): Take a mempool
2883         as parameter and use it to allocate the clause array.
2884
2885         * reflection.c (mono_image_get_field_on_inst_token): Free
2886         the inflated type after encoding it.
2887
2888         * reflection.c (mono_dynamic_image_free): Free each element
2889         of MonoDynamicImage::gen_params.
2890
2891         * reflection.c (reflection_methodbuilder_to_mono_method):
2892         Allocate the generic param array from the mempool.
2893         Allocate signature params from the mempool.
2894
2895         * reflection.c (mono_reflection_generic_class_initialize):
2896         Free inflated fields after been used.
2897
2898 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
2899
2900         * icall.c: Reapply the memory leak fixes as they no
2901         longer make mono crash.
2902
2903 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
2904
2905         * reflection.c (mono_type_get_object): Don't store the suplied
2906         MonoType with type_hash. A caller which pass a type that
2907         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
2908         might end with a pointer to freed memory.
2909         The solution is to use byval_arg or this_arg from the associated
2910         MonoClass of the supplied type.
2911
2912 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
2913
2914         * icall.c: Revert the rest of the last change as it breaks the build too.
2915
2916 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2917
2918         * icall.c: Revert a leak fix as it's breaking the build.
2919
2920 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2921
2922         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
2923
2924 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2925
2926         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
2927
2928 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2929
2930         * icall.c: Fix some memory leaks.
2931
2932 2008-05-29  Dick Porter  <dick@ximian.com>
2933
2934         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
2935         async socket operations from the pending list when a socket
2936         closes.  Leaving it until the threadpool services the event
2937         exposes a race condition when a socket descriptor is reused.
2938         Fixes bug 377589.
2939
2940 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2941
2942         * object.c: Fix negative index check for array alocation.
2943
2944 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2945
2946         * icall.c, marshal.c: Delegate wrappers should skip visibility.
2947         This check is performed by the verifier for IL created delegates
2948         and by Delegate::CreateDelegate for programatically created ones.
2949         Fixes #372406.
2950
2951 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2952
2953         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
2954         Fix code to use mono_array_size_t instead of int.
2955
2956         Based on patch by Luis F. Ortiz.
2957         Contributed under X11 license.
2958         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2959
2960 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2961
2962         * icall.c: Added ves_icall_System_Array_GetLongLength and
2963         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
2964         arrays.
2965
2966         * icall.h: Export both new functions.
2967
2968         Based on patch by Luis F. Ortiz.
2969         Contributed under X11 license.
2970         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2971
2972 2008-05-28  Martin Baulig  <martin@ximian.com>
2973
2974         The debugger now requires exactly r103463.
2975
2976         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
2977         This version is not supported by the debugger, wait for 72.
2978
2979 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2980
2981         * object.h: Changed array related functions to use
2982         mono_array_size_t instead of guint32. Forgot to commit this file.
2983
2984         Patch by Luis F. Ortiz.
2985         Contributed under X11 license.
2986         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
2987
2988
2989 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2990
2991         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
2992         don't define it. Use the number literal instead.
2993
2994 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2995
2996         * icall.c: Changed array related functions to use
2997         mono_array_size_t instead of guint32.
2998
2999         * icall.c (ves_icall_System_Array_GetLength): Check for length
3000         overflow under MONO_BIG_ARRAYS.
3001
3002         Based on patch by Luis F. Ortiz.
3003         Contributed under X11 license.
3004         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3005
3006 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3007
3008         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
3009
3010         Based on patch by Luis F. Ortiz.
3011         Contributed under X11 license.
3012         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3013
3014 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3015
3016         * object.c, object.h: Changed array related functions to use
3017         mono_array_size_t instead of guint32.
3018
3019         Patch by Luis F. Ortiz.
3020         Contributed under X11 license.
3021         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3022
3023 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
3024
3025         * object.h: Introduced mono_array_size_t typedef. This must be used
3026         in all places an array length is expected. This is 64bits wide if
3027         MONO_BIG_ARRAYS is enabled.
3028
3029         Patch by Luis F. Ortiz.
3030         Contributed under X11 license.
3031         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
3032
3033 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
3034
3035         * security-manager.c class.c: Set the class exception info by calling
3036         mono_class_set_failure ().
3037
3038         * class.c (mono_class_get_exception_data): New accessor function.
3039         (mono_class_set_failure): Store exception_data in the property hash.
3040
3041         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
3042         the struct as a property.
3043
3044         * loader.c (mono_get_method_full): Store the lookup result for method
3045         tokens in method_cache, the others in methodref_cache to decrease the memory
3046         usage of hash tables.
3047
3048         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
3049         (mono_image_init): method_cache is lazy inited now.
3050
3051         * metadata-internals.h (struct _MonoImage): Change method_cache to
3052         a MonoValueHashTable, add a separate methodref_cache.
3053
3054 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
3055
3056         * number-formatter.h: Fix tables to avoid arithemtic overflow in
3057           Double.ToString as exposed by Bug #383531.
3058
3059 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
3060
3061         * number-formatter.h: Make some tables static.
3062
3063         * class.c (mono_method_set_generic_container): New accessor function.
3064         (mono_method_get_generic_container): Ditto.
3065
3066         * class-internals.h (struct _MonoMethod): Remove rarely used 
3067         'generic_container' field, store it in the property hash instead. Add 
3068         'is_generic' boolean field instead.
3069
3070         * image.c (mono_image_init): Initialize property_hash.
3071         (mono_image_close): Destroy property_hash.
3072
3073         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
3074         hold rarely used fields of runtime structures belonging to this image.
3075
3076         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
3077         to get/set method->generic_container.
3078
3079         * loader.c (mono_get_method_from_token): Avoid loading the method header for
3080         generic methods.
3081
3082 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
3083
3084         * class.c (mono_class_inflate_generic_method_full): Don't increase
3085         mono_stats.inflated_method_count for methods found in the cache.
3086
3087         * threads.c (mono_thread_request_interruption): Add a comment about 
3088         QueueUserAPC ().
3089
3090 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
3091
3092         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
3093         interface_offsets_packed table.
3094         
3095         * class.c (mono_class_init): Remove some dead code.
3096
3097         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
3098         mono_class_setup_vtable () when CAS is active to detect security problems.
3099
3100 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
3101
3102         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
3103
3104         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
3105         parameters as it's irrelevant for delegate checking.
3106
3107 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
3108
3109         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
3110
3111         * class.c (mono_class_init): Control the creation of a generic vtable using
3112         a global which is true by default, but set to false by the runtime startup code.
3113         
3114         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
3115         Disabled for now since it breaks the embedding API.
3116         Move the setup of class->methods for arrays to mono_class_setup_methods ().
3117         (mono_class_setup_methods): Add a memory barrier.
3118
3119         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
3120         when mono_class_init () doesn't compute the generic vtable.
3121         
3122 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
3123         * profiler.c: Added mono_profiler_install_statistical_call_chain,
3124         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
3125         to support call chains (backtrace) in the stat profiler.
3126         * profiler.c, profiler-private.h: Likewise.
3127
3128 2008-05-22  Mark Probst  <mark.probst@gmail.com>
3129
3130         * generic-sharing.c: Init generic class when a method of it is
3131         requested via a runtime generic context.
3132
3133 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
3134
3135         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
3136
3137         * reflection.c (mono_type_get_object): Add a FIXME.
3138
3139         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
3140
3141         * class.c (mono_class_get_method_by_index): New helper function, returning an
3142         entry in the class->methods array.
3143
3144 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
3145
3146         * class.c (mono_class_init): Only do the array optimization for szarrays. 
3147         Avoid creating a generic vtable for generic instances as well.
3148         (mono_class_get_method_from_name_flags): Don't search in the metadata for
3149         generic instances.
3150
3151 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
3152
3153         * loader.c (mono_get_method_constrained): Inflate the signature
3154         with class context. Fix #325283.
3155
3156 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
3157
3158         * object.c (mono_class_create_runtime_vtable): Add a comment.
3159
3160         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
3161         where needed.
3162         (setup_interface_offsets): Handle the case when this is called twice for arrays.
3163         (mono_class_setup_vtable_general): Add an assert.
3164         (mono_class_init): Avoid creating a generic vtable for arrays.
3165
3166         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
3167         here, let mono_class_init () do that.
3168
3169         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
3170         interfaces in mscorlib.
3171
3172         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
3173         interfaces. Add some comments.
3174         (mono_class_init): Call mono_class_setup_methods () here since it is no
3175         longer called by mono_class_setup_vtable ().
3176
3177         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
3178         not set in class->vtable.
3179         (mono_class_create_runtime_vtable): Reenable the disabled code.
3180
3181         * object.c (mono_class_create_runtime_vtable): Disable the last change for
3182         now as it causes some test failures.
3183
3184         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
3185         if using the vtable trampoline. Also remove some strange code which put the
3186         generic methods themselves into the vtable slots. Remove the AOT init_vtable
3187         stuff as it is no longer needed.
3188
3189 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
3190
3191         * pedump.c: Give make --verify all option check code as well.
3192         Using --verify code won't check for metadata now.
3193
3194 2008-05-19  Martin Baulig  <martin@ximian.com>
3195
3196         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
3197
3198         * mono-debug.c
3199         (_mono_debug_using_mono_debugger): New global variable; it's set
3200         directly by the debugger, so mono_debug_using_mono_debugger() also
3201         works after attaching.
3202
3203 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
3204
3205         * object.c (mono_class_create_runtime_vtable): Use memory barriers
3206         as we do double checked locking on MonoClass::runtime_info and
3207         MonoClassRuntimeInfo::domain_vtables.
3208
3209 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
3210
3211         * debug-helpers.c (print_field_value): Fix a warning.
3212
3213 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
3214
3215         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
3216         set in the AOT case.
3217
3218 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
3219
3220         * class.c (mono_class_setup_vtable_general): Use memory barriers
3221         as we do double checked locking on MonoClass::vtable.
3222
3223 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
3224
3225         * reflection.c (resolve_object): Inflate only if the generic context
3226         is not null. Fixes #389886.
3227
3228 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
3229
3230         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
3231         instead of g_free.
3232
3233         Code is contributed under MIT/X11 license.
3234
3235 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3236
3237         * class.c: Revert unrelated change.
3238
3239 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3240
3241         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
3242         a generic instantiation, use mono_class_from_mono_type instead of playing
3243         with MonoType directly.
3244
3245 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
3246
3247         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
3248         checks must ignore generic instantiations, so mono_class_has_parent is not
3249         suitable. Fixes #390128.
3250
3251 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
3252
3253         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
3254         it to avoid registering tokens during metadata generation. Fixes #390023.
3255
3256 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
3257
3258         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
3259         consistent.
3260
3261         Contributed under MIT/X11 license.
3262
3263 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
3264
3265         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
3266         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
3267         to fixup the EXE image.
3268         (mono_cleanup): Use mono_close_exe_image.
3269         (mono_close_exe_image): New function.
3270         * image.c: Include "marshal.h".
3271         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
3272         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
3273         counting when the image is loaded outside of mono_image_open_full. Set status
3274         based on GetLastError.
3275         * coree.c: Include required headers. Add init_from_coree.
3276         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
3277         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
3278         (_CorExeMain): Set init_from_coree.
3279         (CorExitProcess): Only call ExitProcess for now.
3280         (CorBindToRuntimeEx): New stub implementation.
3281         (CorBindToRuntime): New function.
3282         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
3283         (MonoFixupExe): ILONLY executables require no fixups.
3284         (mono_set_act_ctx): New function to set activation context.
3285         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
3286         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
3287         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
3288         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
3289         as MONO_INTERNAL.
3290         * domain-internals.h: Add mono_close_exe_image.
3291
3292         Contributed under MIT/X11 license.
3293
3294 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
3295
3296         * metadata.c (mono_metadata_compute_size): Correctly calculate field
3297         size for generic param and event tables. Fixes #388977.
3298
3299 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
3300
3301         * loader.c (mono_method_signature): Use memory barriers because of the double
3302         checked locking pattern.
3303
3304         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
3305         aborting or aborted as well. Fixes #376391.
3306         
3307         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
3308         existing runtime state in the Suspend handler during shutdown.
3309
3310 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
3311
3312         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
3313
3314         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
3315         which are starting up or shutting down.
3316
3317         * threads.c (mono_threads_set_shutting_down): Don't return a value since
3318         this function never returns if the runtime is already shutting down.
3319
3320         * icall.c (ves_icall_System_Environment_Exit): Update after 
3321         mono_threads_set_shutting_down () signature change.
3322         
3323 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
3324
3325         * class.c: Added can_access_instantiation to verify if the instantiation
3326         is visible. Fix access check for nested types as they returned TRUE
3327         before doing type and generic instantiation visibility checks.
3328
3329 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
3330
3331         * reflection.c (mono_reflection_create_generic_class): The created type
3332         must have a different container from its TypeBuilder. Otherwise they
3333         will end sharing generic arguments, which is wrong.
3334
3335         Due to the sharing, making a generic instance of the created type using
3336         the TypeBuider generic arguments resulted in the generic type definition
3337         been returned, which is wrong as well.
3338
3339         As a bonus the code was leaking the type_params array. This memory should
3340         be allocated from the image mempool.
3341
3342         This fixes bug #354047.
3343
3344 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
3345
3346         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
3347         to here         as they are now used in assembly.c new code.
3348         Added a skipverification flag to MonoAssembly.
3349         New internal function mono_assembly_has_skip_verification.
3350
3351         * assembly.c: New function mono_assembly_has_skip_verification. It checks
3352         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
3353         part of #387274.
3354
3355 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
3356
3357         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
3358         needed. Fixes #387034.
3359
3360         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
3361
3362 2008-05-06  Miguel de Icaza  <miguel@novell.com>
3363
3364         * assembly.c (mono_assembly_load_reference): Prevent crash while
3365         disassembling Silverlight 2.0 executables while we still do not
3366         have GACed libraries.
3367
3368 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
3369
3370         * reflection.c: Special case generic type definitions as well. Fixes #383444.
3371
3372 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
3373
3374         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
3375         of the dynamic case. Fixes #387404.
3376
3377 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3378
3379         *verify.c (mono_verifier_is_class_full_trust): If under
3380         verify_all and the verifier mode was not set, only
3381         gac and corlib types are fulltrust. This makes --verify-all
3382         usable to detect unverifiable code, which is the expected
3383         use case.
3384
3385 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3386
3387         * verify.h: Ops, commited the header with debug
3388         enabled.
3389
3390 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
3391
3392         * verify.c (merge_stack): Use the new value on unverifiable
3393         stack merges.
3394
3395         * verify.c (verify_type_compatibility_full): Comparison
3396         of nullable types can't use mono_class_is_assignable_from.
3397
3398         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
3399         that makes all verification errors be reported.
3400
3401         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
3402         mono_method_verify.
3403
3404 2008-05-05  Robert Jordan  <robertj@gmx.net>
3405
3406         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
3407         support for value types. See #386415.
3408
3409         * object.c: comments.
3410
3411         Code is contributed under MIT/X11 license.
3412
3413 2008-05-05  Martin Baulig  <martin@ximian.com>
3414
3415         * debug-mono-symfile.h
3416         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
3417         for old pre-terrania symbol files.
3418
3419 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
3420
3421         * mono-config.c: Add ppc64 architecture.
3422
3423         Code is contributed under MIT/X11 license.
3424
3425 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
3426
3427         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
3428           PPC64 uses function descriptors as well.
3429
3430         Code is contributed under MIT/X11 license.
3431
3432 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
3433
3434         * object.c (compute_class_bitmap): Ignore literal static fields.
3435
3436         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
3437         var has an invalid format.
3438         (describe_ptr): Add some sanity checks for the vtable.
3439         (add_nursery_frag): Clear unused nursery fragments.
3440         (major_collection): Clear all remaining nursery fragments.
3441
3442 2008-05-03  Robert Jordan  <robertj@gmx.net>
3443
3444         * image.c, metadata-internals.h: add thunk_invoke_cache.
3445
3446         * marshal.c, marshal.h: implement
3447         mono_marshal_get_thunk_invoke_wrapper ().
3448
3449         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
3450
3451         Code is contributed under MIT/X11 license.
3452
3453 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
3454
3455         * verify.c (do_leave): Empty the stack.
3456
3457 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
3458
3459         * class.c (mono_class_is_assignable_from): Variance
3460         doesn't work between reference and value types. For example,
3461         given type C<T+>, C<int32> is not assignable to C<object>.
3462         Break the argument checking loop on first error. 
3463
3464 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
3465
3466         * icall.c : base64_to_byte_array() needs some more strict
3467           check for sequence of '=' characters. Patch by Santa
3468           Marta (http://deee.g.hatena.ne.jp/santamarta).
3469
3470           Contributed under MIT/X11 license.
3471           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
3472
3473 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
3474
3475         * domain.c: Disable LoadLibrary support to fix Win32 build.
3476
3477         Code is contributed under MIT/X11 license.
3478
3479 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
3480
3481         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
3482         to help with cache behaviour.
3483
3484 2008-05-01  Miguel de Icaza  <miguel@novell.com>
3485
3486         * appdomain.c (mono_domain_from_appdomain): Add new accessor
3487         method. 
3488
3489 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
3490
3491         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
3492
3493 2008-05-01  Dick Porter  <dick@ximian.com>
3494
3495         * process.c (process_get_fileversion): Only pass 16 bits of
3496         language ID to VerLanguageName.  Fixes bug 381204.
3497
3498 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3499
3500         * verify.c (mono_method_verify): Fix the comparison
3501         operator for code bounds check.
3502
3503 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
3504
3505         * verify.c (mono_method_verify): Check the bounds of
3506         all access of the code array.
3507
3508 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
3509
3510         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
3511
3512 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
3513
3514         * image.c (mono_image_strong_name_position): Fix return value when the rva is
3515         not valid.
3516
3517 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
3518
3519         * loader.c (mono_get_method_from_token, mono_method_signature): Add
3520         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
3521         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
3522         fixup main EXE images when using mono.exe for mixed-mode assembly support.
3523         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
3524         mono_runtime_load.
3525         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
3526         runtime initialization from metadata.
3527         * assembly.c: Remove obsolete ceGetModuleFileNameA.
3528         (mono_set_rootdir): Use mono_get_module_file_name.
3529         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
3530         handles.
3531         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
3532         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
3533         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
3534         MonoCLIImageInfo. Add support for module handles.
3535         (load_cli_header): Update mono_cli_rva_image_map signature.
3536         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
3537         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
3538         (mono_image_rva_map): Add support for module handles.
3539         (mono_image_ensure_section_idx): Add support for module handles.
3540         (mono_image_close): Add support for module handles.
3541         (do_load_header): Add support for module handles.
3542         (mono_image_open_from_module_handle): New function for internal use.
3543         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
3544         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
3545         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
3546         handles.
3547         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
3548         * image.h: Add mono_image_fixup_vtable.
3549         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
3550         support.
3551         * coree.h: New file.
3552         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
3553         unsupported native code.
3554         (mono_marshal_set_callconv_from_modopt): New function splitted from
3555         mono_marshal_get_managed_wrapper.
3556         (mono_marshal_get_managed_wrapper): Use
3557         mono_marshal_set_callconv_from_modopt.
3558         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
3559         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
3560         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
3561         that results in a deadlock when the runtime is loaded in _CorDllMain.
3562         * Makefile.am: Add coree.c and coree.h.
3563
3564         Contributed under MIT/X11 license.
3565
3566 2008-04-28  Mark Probst  <mark.probst@gmail.com>
3567
3568         * generic-sharing.c: Search for type arguments in array element
3569         types as well.
3570
3571 2008-04-28  Mark Probst  <mark.probst@gmail.com>
3572
3573         * class-internals.h, generic-sharing.c: New, small runtime generic context.
3574
3575         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
3576
3577         * object.c: Don't setup the RGCTX when the vtable is created,
3578         because we're setting it up lazily now.
3579
3580 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
3581
3582         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
3583         64 bit support.
3584
3585 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3586
3587         * verify.c (verify_class_for_overlapping_reference_fields): 
3588         If class is under fulltrust allow reference types to overllap
3589         if they have the same RVA.
3590
3591 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
3592
3593         * pedump.c: Added new flag valid-only, that makes the verifier
3594         behaves just like --security=validil. It won't fail type load
3595         due to unverifiable restrictions.
3596
3597 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3598
3599         * class-internals.h (struct MonoMethod): Added a verification_success
3600         field to cache verifier executions. Reduced MonoMethod:slot size by
3601         one bit.
3602
3603 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
3604
3605         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
3606         instead of a 'vt' argument to save an indirection and to allow these to be used
3607         for valuetypes.
3608         (scan_vtype): New helper function to scan an area using a gc descriptor.
3609         (mono_gc_wbarrier_value_copy): Implement this.
3610         (handle_remset): Add support for REMSET_VTYPE.
3611         (find_in_remset_loc): Ditto.
3612         (mono_gc_base_init): Allow some debugging options to be controlled through the
3613         use of the MONO_GC_DEBUG env variable.
3614         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
3615         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
3616
3617 2008-04-23  Martin Baulig  <martin@ximian.com>
3618
3619         * domain.c (mono_domain_create): Move the call to
3620         mono_debug_domain_create() down, after allocating the domain id.
3621
3622 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3623
3624         verify.c (verify_class_for_overlapping_reference_fields): Skip
3625         static fields while verifying for overlapping fields as they
3626         don't matter at all.
3627
3628 2008-04-23  Marek Habersack  <mhabersack@novell.com>
3629
3630         * domain-internals.h: added a declaration of
3631         mono_make_shadow_copy.
3632
3633         * assembly.c (mono_assembly_open_full): shadow copying of
3634         assemblies moved to here, so that all the assemblies within the
3635         application domain's private binary directories can be
3636         processed. Fixes bug #380546
3637
3638         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
3639         mono_make_shadow_copy and made non-static. The decision whether
3640         to shadow-copy an assembly is made based on its location - it's
3641         copied if it's in one of the private application domain binary
3642         directories and its different to the target file in the shadow
3643         directory. Fixes bug #380546
3644
3645 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
3646
3647         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
3648
3649         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
3650         types.
3651
3652         * reflection.c (mono_image_create_token): Handle 
3653         Method/ConstructorOnTypeBuilderInst.
3654         (resolve_object): Ditto.
3655         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
3656         so it can be called from resolve_object. Also handle the case when the inflated
3657         class already has its methods setup.
3658
3659 2008-04-21  Martin Baulig  <martin@ximian.com>
3660
3661         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
3662
3663 2008-04-20  Geoff Norton  <gnorton@novell.com>
3664
3665         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
3666         pointer dereference.
3667
3668 2008-04-15  Marek Habersack  <mhabersack@novell.com>
3669
3670         * appdomain.c (try_load_from): if IOMAP is in effect, call the
3671         portability API to look up the assembly file. Fixes behavior in
3672         situations when the application has a bin/ directory, but the
3673         assembly search patch refers to Bin/ (and thus the requested file
3674         name is Bin/SomeLibrary.dll). Fixes bug #379888
3675
3676 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3677
3678         verify.c (mono_type_is_generic_argument): Extracted this check
3679         from a dozen places to here.
3680
3681         verify.c: Fixed all issues related to boxing generic arguments
3682         and their constraints.
3683
3684 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3685
3686         verify.c (mono_class_interface_implements_interface): Fix win32 build.
3687
3688 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
3689
3690         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
3691         isn't finished yet. Fixes #363447.
3692
3693 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
3694
3695         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
3696         Fixes #346419.
3697
3698 2008-04-13  Jb Evain  <jbevain@novell.com>
3699
3700         * domain.c: update the 2.1 profile versions.
3701         Merged from the Moonlight 2 branch.
3702
3703 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
3704
3705         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
3706         mscorlibs for the non-refonly case as well.
3707
3708         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
3709         in mono_assembly_load_from_full (). Fixes #378924.
3710
3711 2008-04-11  Geoff Norton  <gnorton@novell.com>
3712
3713         * icall.c: The global extern environ doesn't exist on Mac.  We
3714         need to call NSGetEnviron instead.
3715
3716 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3717
3718         verify.c: Add generic method constraint verification.
3719
3720 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3721
3722         class.c (mono_class_inflate_generic_method_full): Add a long
3723         explanation to the is_mb_open hack. Remove the FIXME.
3724
3725 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3726
3727         * verify.c (mono_method_verify): Mark all unknown opcodes
3728         as invalid. Mark jmp as unverifiable.
3729
3730 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3731
3732         * verify.c: Add code to do type constraint verification on class instances.
3733
3734         * verify.c (mono_verifier_verify_class): Use the type constraint 
3735         verification code.
3736
3737 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
3738
3739         * class.c (mono_class_get_field_default_value): Don't pass cindex
3740         as hint to mono_metadata_get_constant_index. The local is not initialized
3741         and should contain garbage most of the time. This could only work
3742         with a lot of luck.
3743
3744 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3745
3746         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
3747
3748 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3749
3750         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
3751
3752         * class.c (mono_class_from_generic_parameter): Save the token of the
3753         generic param in MonoClass::sizes.generic_param_token.
3754
3755         * reflection.c (mono_custom_attrs_from_class): If the class type is
3756         VAR or MVAR retrieve the attributes of the generic param.
3757
3758 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3759
3760         * class.c (mono_class_init): Do class verification if the verifier
3761         is enabled.
3762
3763 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3764
3765         * verify-internal.h: Added mono_verifier_verify_class.
3766
3767         * verify.c: Added mono_verifier_verify_class. It checks for
3768         classes with explicit layout that have overlapping reference fields.
3769
3770         * pedump.c: Init the verifier state prior to verification. Fixed
3771         command line arguments.
3772
3773 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3774
3775         * Makefile.am: Added verify-internals.h, hopefully fix the build.
3776
3777 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
3778
3779         * verify-internals.h: Fix a warning.
3780
3781 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3782
3783         * verify-internals.h: New header with the verifier configuration
3784         extracted from mini.c.
3785
3786         * verify.c: Implemented the new functions exported by verify-internals.h.
3787
3788 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3789
3790         * verify.c: Add proper verification of ckfinite.
3791
3792 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3793
3794         * verify.c (do_conversion): Improved error message to something
3795         more meanfull.
3796
3797         * verify.c (check_is_valid_type_for_field_ops): Fix to work
3798         with primitive types.
3799
3800 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3801
3802         * verify.c: Added tail prefix checking. Marked icall
3803         as unverifible.
3804
3805 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
3806
3807         * verify.c: Fix the detection of branches to the middle
3808         of an instruction.
3809
3810 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
3811
3812         * verify.c: Implemented verification of volatile. and
3813         unaligned. prefix. Check if a type is valid after retrieving it.
3814
3815 2008-04-01  Dick Porter  <dick@ximian.com>
3816
3817         * process.c (process_get_fileversion): If there's no string block,
3818         set the file language to en_US.  Fixes the other new part of bug
3819         374600.
3820
3821 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
3822
3823         * class.c: New functions mono_method_can_access_field_full and
3824         mono_method_can_access_method_full. They perform type visibility
3825         and type site check.
3826
3827         * class-internal.h: Added exported functions.
3828
3829         * verify.c: Use new functions to implement proper visibility checks.
3830
3831 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
3832
3833         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
3834
3835 2008-03-28  Dick Porter  <dick@ximian.com>
3836
3837         * process.c (process_get_fileversion): Use the first language ID
3838         we see, rather than insisting on an invariant language.  Fixes bug
3839         374600.
3840
3841 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
3842
3843         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
3844         the streams to fix reading of invalid memory later.
3845
3846         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
3847         to ease debugging.
3848
3849 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
3850
3851         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
3852         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
3853
3854 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
3855         * threads.h: Added MonoThreadManageCallback type and
3856         mono_thread_set_manage_callback prototype
3857         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
3858         (used to store the mono_thread_manage callback).
3859         * threads.c: Added mono_thread_set_manage_callback, and handle
3860         "MonoThread->manage_callback" in build_wait_tids.
3861
3862 2008-03-26  Dick Porter  <dick@ximian.com>
3863
3864         * process.c (process_get_fileversion): Set FileVersionInfo strings
3865         to Empty when the resource doesn't have the particular info.
3866         Fixes bug 355717.
3867
3868 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
3869
3870         * verify.c (mono_method_verify): Proper prefix validation.
3871
3872 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
3873
3874         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
3875         itself in a separate argument instead of throwing them. Fixes #373448.
3876
3877         * appdomain.c: Bump corlib version.
3878
3879 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3880
3881         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
3882
3883 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
3884
3885         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
3886         version macros.
3887
3888 2008-03-20  Mark Probst  <mark.probst@gmail.com>
3889
3890         * generic-sharing.c, class-internals.h: Code for putting
3891         reflection types into the runtime generic context.
3892
3893 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3894
3895         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
3896         Fixes #340662. 
3897
3898
3899 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
3900
3901         * verify.c (VerifyContext): Added instruction prefix data to the struct.
3902
3903         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
3904
3905         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
3906
3907         * verify.c (do_cast): Let the result value keep the boxed status.
3908
3909         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
3910
3911 2008-03-17  Jb Evain  <jbevain@novell.com>
3912
3913         * reflection.c: when running on a 2.0 runtime, emit
3914         unconditionally the #~ header version as 2.0, and the
3915         CLI header version as 2.5, for symmetry's sake with csc.
3916
3917 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
3918
3919         * class.c: Remove the unused cache_interface_offsets stuff.
3920
3921         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
3922         profiler.c: Fix warnings.
3923
3924 2008-03-16  Mark Probst  <mark.probst@gmail.com>
3925
3926         * generic-sharing.c, class-internals.h: Support for putting
3927         methods into the runtime generic context.
3928
3929 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
3930
3931         * class.c (mono_class_setup_fields): Ignore calls made to this function for
3932         classes which are generic instances of not-yet finished typebuilders. Fixes
3933         #351172.
3934
3935         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
3936
3937 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
3938
3939         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
3940
3941         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
3942         field, replace it with a hash table in MonoDynamicImage.
3943
3944         * reflection.c (inflate_mono_method): Access the generic definition object from
3945         image->generic_def_objects instead of imethod->reflection_info.
3946
3947         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
3948
3949         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
3950         
3951         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
3952         function in reflection.c so it is easier to keep in sync with the dynamic image
3953         creation code.
3954
3955         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
3956         mono_image_close ().
3957
3958 2008-03-15  Mark Probst  <mark.probst@gmail.com>
3959
3960         * class.c (mono_class_generic_sharing_enabled): Disable generic
3961         sharing for all architectures except AMD64 and x86 to fix build.
3962
3963 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
3964
3965         * verify.c: Use the generic definition MonoGenericContext when available.
3966         Remove code for checking generics instance compatibility in favor of
3967         mono_class_is_assignable_from.
3968
3969 2008-03-14  Mark Probst  <mark.probst@gmail.com>
3970
3971         * marshal.c, marshal.h, metadata-internals.h, image.c,
3972         wrapper-types.h: New wrapper for invoking a shared static method
3973         without having to pass the runtime generic context argument.
3974
3975 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
3976
3977         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
3978
3979 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
3980
3981         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
3982         
3983         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
3984         create a token from a FieldOnTypeBuilderInst.
3985         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
3986         (resolve_object): Ditto.
3987
3988         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
3989         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
3990
3991 2008-03-14  Martin Baulig  <martin@ximian.com>
3992
3993         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
3994
3995         * debug-mono-symfile.h
3996         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
3997         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
3998
3999 2008-03-10  Martin Baulig  <martin@ximian.com>
4000
4001         * debug-mono-symfile.h
4002         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
4003         `lexical_block_table_offset'.
4004         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
4005         `lexical_blocks'.
4006         (MonoSymbolFile): Added `version'.
4007
4008         * mono-debug.h
4009         (MonoDebugLexicalBlockEntry): Removed.
4010         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
4011         `lexical_blocks'.
4012
4013         * mono-debug.c (mono_debug_add_method): Don't compute lexical
4014         blocks here; the debugger now does this internally.
4015
4016 2008-02-27  Martin Baulig  <martin@ximian.com>
4017
4018         * object.c (mono_runtime_exec_main): Call
4019         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
4020         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
4021
4022 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4023
4024         * verify.c (verify_type_compatibility_full): Allow native int to be converted
4025         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
4026
4027 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
4028
4029         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
4030         ldftn with a virtual method.
4031
4032 2008-03-13  Geoff Norton  <gnorton@novell.com>
4033
4034         * decimal.c:  Only include memory.h if the platform has it.
4035
4036 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
4037
4038         * assembly.c, class.c, metadata-internals.h: make sure public key
4039         tokesns are compared in a case-insensitive way. Also, all
4040         the lookups in the GAC use a lowercase public key token
4041         (gaacutil already does the lowercasing on install). Fixes
4042         bug #369541.
4043
4044 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
4045
4046         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
4047         and return value.
4048
4049 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
4050
4051         * image.c: when someone loads a mscorlib from a file, return the
4052         currently loaded mscorlib (fixes bug #369253).
4053
4054 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
4055
4056         * class.c: handle types with no parents by forcing them to have
4057         System.Object as a parent and marking them as broken (this currently
4058         allows the first part of bug #369173 to work as well, likely because
4059         we don't check for typeload exceptions everywhere yet).
4060
4061 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
4062
4063         * class.c: more complete check that types belong to corlib
4064         (fixes second part of bug #369173).
4065
4066 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
4067
4068         * generic-sharing.c:  Including glib.h for the MSVC builds to define
4069           "inline" to "__inline" before including mono-membar.h.
4070           
4071         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
4072           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
4073           MSVC builds.
4074
4075         Contributed under MIT/X11 license.
4076
4077 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
4078
4079         * verify.c (do_invoke_method): Remove return type validation.
4080
4081         * verify.c (do_ret): Do return type validation at return site instead of
4082         call site.
4083
4084 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
4085
4086         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
4087
4088         * verify.c: Some todos cleaned and improved a few error messages.
4089
4090 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
4091
4092         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
4093
4094 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
4095
4096         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
4097         system types correctly.
4098
4099         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
4100         function.
4101
4102 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
4103
4104         * assembly.c (build_assembly_name): Fix a warning.
4105
4106 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
4107
4108         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
4109         the called function takes an object type argument. Fixes storing or
4110         valuetypes across remoting as well as reducing memory usage.
4111         * image.c, metadata-internals.h: remove now unused ldfld_remote and
4112         stfld_remote wrapper caches.
4113
4114 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
4115
4116         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
4117         is not found.
4118
4119         * reflection.c (mono_image_register_token): New helper function to save
4120         a token->object mapping.        
4121
4122         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
4123         managed code.
4124
4125         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
4126         one dimension arrays. Fixes #367670.
4127         (mono_reflection_get_type_internal): Ditto.
4128
4129 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
4130
4131         * marshal.c: mono_load_remote_field_new() always returns object.
4132         so use the proper signature (fixes bug #366445).
4133
4134 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
4135         
4136         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
4137         add an 'inline_failure' flag instead.
4138
4139 2008-03-04  Mark Probst  <mark.probst@gmail.com>
4140
4141         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
4142         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
4143         contains the location of "this", used for exception handling.
4144
4145 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
4146
4147         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
4148         their size on all platforms for perf reasons.
4149
4150 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4151
4152         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
4153         object-internal.h
4154
4155         * object-internal.h: Same.
4156
4157 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4158
4159         * reflection.h: Fix the build I just broke.
4160
4161 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4162
4163         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
4164         Test if a token is valid, this remove explicit usage of 
4165         MonoDynamicImage::tokens from the verifier code.
4166
4167         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
4168
4169         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
4170         instead of direct access to MonoDynamicImage::tokens.
4171
4172 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4173
4174         * verify.c (token_bounds_check): Fix the build I just broke.
4175
4176 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4177
4178         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
4179
4180         * verify.c (verifier_load_method): Fixed the errors message.
4181
4182         * verify.c (mono_method_verify): Fixed a debug message.
4183
4184 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
4185
4186         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
4187         mono-perfcounters.h, class-internals.h: support for predefined
4188         writable counters, query of categories and counters, bugfixes.
4189
4190 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
4191
4192         * verify.c (do_refanytype): Verify the refanytype opcode.
4193
4194         * verify.c (mono_method_verify): Use do_refanytype.
4195
4196 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
4197
4198         * verify.c (do_mkrefany): Verify the mkrefany opcode.
4199
4200         * verify.c (mono_method_verify): Use do_mkrefany.
4201
4202 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
4203
4204         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
4205         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
4206         implementation.
4207
4208 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
4209
4210         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
4211         the type load exception.
4212
4213 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
4214
4215         * verify.c: Added a few FIXME for method signatures
4216
4217         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
4218         of mono_method_get_signature and get vararg call working. Removed unused
4219         checks for return value.
4220
4221         * verify.c (do_refanyval): Verify the refanyval opcode.
4222
4223         * verify.c (mono_method_verify): Implemented verification of arglist and
4224         use do_refanyval.
4225
4226 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
4227
4228         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
4229         vtypes to marshal.c.
4230
4231         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
4232         it works for AOT as well.
4233
4234 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
4235
4236         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
4237         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
4238         the system time is adjusted.
4239
4240 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
4241
4242         * icall.c, icall-def.h: use the new time functions (fixes the
4243         non-monotonic behaviour of TickCount).
4244
4245 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
4246
4247         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
4248         it breaks the build.
4249         
4250         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
4251         cattr is not finished yet.
4252
4253 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
4254
4255         * verify.c: Proper token validation for field, method and type.
4256
4257 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
4258
4259         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
4260
4261         * loader.c (method_from_memberref): Generate type load error instead of method missing
4262         if the type is not found.
4263
4264 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
4265
4266         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
4267         some of the conversions caused the generation of a marshal directive exception.
4268
4269 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
4270
4271         verify.c: Report which exception should be thrown by the JIT.
4272         Added a lot of FIXME notes.
4273
4274 2008-02-22  Mark Probst  <mark.probst@gmail.com>
4275
4276         * generic-sharing.c: Runtime generic context slots are not
4277         instantiated on init anymore.  Instead, provide function to do the
4278         instantiating on demand.
4279
4280         * class-internals.h: Added vtable to runtime generic context.
4281         Macros for encoding direct and indirect slot offsets in one
4282         guint32.
4283
4284 2008-02-21  Mark Probst  <mark.probst@gmail.com>
4285
4286         * object.c, generic-sharing.c: Moved some generic sharing code
4287         from object.c to generic-sharing.c.
4288
4289         * generic-sharing.c: Added support for extensible runtime generic
4290         context.
4291
4292         * metadata-internals.h: Two new hash tables in MonoImage for
4293         extensible runtime generic context support.
4294
4295         * domain.c: Unregister generic vtables upon domain unloading.
4296
4297         * image.c: Destroy new hash tables upon image unloading.
4298
4299         * metadata.c: Unregister generic subclasses upon image unloading.
4300
4301         * class-internals.h: New data structure for runtime generic
4302         context template.  New fields in the runtime generic context for
4303         extensible part.
4304
4305         * Makefile.am: Added generic-sharing.c.
4306
4307 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
4308
4309         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
4310         there is a pending loader exception, raise it.
4311
4312         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
4313         same.
4314
4315         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
4316         same.
4317
4318         Fixes #363450.
4319
4320 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
4321
4322         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
4323
4324         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
4325         
4326         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
4327         ref-only requests for compatibility with MS.
4328
4329 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
4330
4331         * reflection.c (mono_custom_attrs_from_method): Don't silently
4332         return an empty list for generic method instances.
4333         (mono_custom_attrs_from_param): Likewise.
4334
4335 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
4336             Raja R Harinath  <harinath@hurrynot.org>
4337
4338         Fix #354757
4339         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
4340         * class.c (mono_class_inflate_generic_method_full): Initialize it
4341         when a fully-open method is instantiated.
4342         * metadata.c (inflated_method_equal, inflated_method_hash): Update
4343         to new field.
4344         * reflection.c (inflate_mono_method): Don't create a temporary context.
4345
4346 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
4347
4348         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
4349         Compute correct value, to prepare for imethod->reflection_info going away.
4350
4351 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
4352
4353         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
4354
4355 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
4356
4357         * verify.c: Implement skip visibility flag.
4358
4359 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
4360
4361         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
4362         which contains an extra field to tell the kind of exception that should be thrown.
4363
4364         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
4365
4366 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
4367
4368         * loader.c (mono_method_get_param_names): Initialize 'klass' after
4369         'method' is updated.
4370
4371 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
4372
4373         * class.c (mono_class_layout_fields): Set class->min_align for classes using
4374         explicit layout as well. Fixes #360375.
4375
4376 2008-02-11  Geoff Norton  <gnorton@novell.com>
4377
4378         * loader.c: Guard and dereference against inflated generic methods
4379
4380 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
4381
4382         * class.c: Include Retargetable spec in assembly name.
4383         * assembly.c: Always include PublicKeyToken spec in assembly name
4384         (with value "null" if assembly is not signed), and include
4385         Retargetable spec.
4386         * icall-def.h: Added icall for Assembly.get_fullname.
4387         * icall.c: Added icall returning the fullname of an assembly.
4388
4389 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
4390
4391         * class.c (mono_class_setup_vtable_general): Add a missing call to
4392         mono_class_setup_methods () which is needed in the AOT case.
4393
4394 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
4395
4396         * verify.c (mono_type_get_stack_name): Added. Return the name for the
4397         stack type of the given MonoType.
4398
4399         * verify.c (verify_type_compatibility_full): Handle the void type.
4400
4401         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
4402         way stack merging works.
4403
4404         * verify.c (store_local): Improved verification message.
4405
4406         * verify.c (do_branch_op): If the merging is invalid, the method
4407         is unverifiable and not invalid. Improved error message.
4408
4409         * verify.c (merge_stacks): Properly merge a boxed valuetype and
4410         a reference type diferent than System.Object. Improved error
4411         message.
4412
4413 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
4414
4415         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
4416
4417         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
4418         type of an enum even if the argument is byref.
4419
4420         * verify.c: Replace all explicit uses of enumtype and enum_basetype
4421         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
4422
4423         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
4424
4425         *verify.c (verify_type_compatibility_full): Make enum types
4426         compatible with their base types.
4427
4428         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
4429         types are compatible for the special case of a boxed valuetype and
4430         System.Object.
4431
4432         * verify.c (verify_stack_type_compatibility): The function
4433         is_compatible_boxed_valuetype was extracted from here.
4434
4435         * verify.c (push_arg): Only set ctx->has_this_store if the method
4436         is not static.
4437
4438         * verify.c (do_ldelem): Fixed a typo in an error message and added
4439         strict check for mixing int32 and native int as the array type
4440         and ldelem type.
4441
4442         * verify.c (merge_stacks): Consider boxed valuetypes in the
4443         compatibility checks.
4444
4445 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
4446         * profiler.h: (MonoGCEvent): Added start-stop the world events.
4447
4448 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
4449         *class.c: use_new_interface_vtable_code: renamed the env var to have
4450         a "MONO_" prefix, and fix the logic to enable it by default.
4451
4452 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
4453         *class.c:
4454         mono_class_setup_vtable_general: rewrote the way in which interface
4455         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
4456         makes the code more maintainable.
4457         For now the old code is still there, and can be activated setting
4458         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
4459
4460 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
4461
4462         * verify.c: guarded some debug functions around and #ifdef.
4463
4464         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
4465
4466 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
4467
4468         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
4469         changes for now since they seem to break too many things.
4470
4471 2008-02-05  Mark Probst  <mark.probst@gmail.com>
4472
4473         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
4474         mono_marshal_find_nonzero_bit_offset): Added macro and function
4475         for finding the byte- and bit-offset of a bitfield within a
4476         struct.
4477
4478 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
4479
4480         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
4481         (mono_marshal_get_struct_to_ptr): Ditto.
4482
4483         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
4484         cctor_signature.
4485
4486 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
4487
4488         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
4489         between methods for non-corlib types.
4490
4491 2008-02-02  Geoff Norton  <gnorton@novell.com>
4492
4493         * loader.c (mono_method_get_param_names): Populate the parameter name for 
4494         generic parameters as well. (Fixes #342536)
4495
4496 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
4497
4498         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
4499
4500         * verify.c (do_invoke_method): Fix for calling with byref structs.
4501
4502         * verify.c (do_cast): push a boxed value type based on the type token and not
4503         the type of stack.
4504
4505 2008-01-31  William Holmes  <billholmes54@gmail.com>
4506
4507         * process.c (process_module_string_read): Check the size returned form 
4508           VerQueryValue to avoid out of memory exception. 
4509
4510 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
4511
4512         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
4513         Handle properly modules which are not in the moduleref table. Fixes
4514         #356938.
4515
4516 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
4517
4518         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
4519         the dynamic case which is now in managed code.
4520         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
4521
4522         * marshal.c (mono_string_to_bstr): Fix a warning.
4523         (init_com_provider_ms): Ditto.
4524
4525         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
4526
4527         * exception.c (mono_get_exception_out_of_memory): New helper function.
4528
4529 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
4530
4531         * marshal.c: Add support for BSTR marshalling
4532         using other COM systems.
4533
4534         Code is contributed under MIT/X11 license.
4535
4536 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
4537
4538         * object.c (mono_runtime_invoke_array): reverted previous
4539         commit as it breaks the build.
4540
4541 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
4542
4543         * object.c (mono_runtime_invoke_array): Verify arguments for
4544         invalid types. Fixes #348522.
4545
4546 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
4547
4548         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
4549         non-final virtual calls using call. 
4550
4551         * verify.c (do_invoke): fixed some TODOs.
4552
4553         * verify.c (push_arg): set has_this_store for "ldarga 0".
4554
4555 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
4556
4557         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
4558         which belong to an inflated class. Fixes #356531.
4559
4560 2008-01-26  Robert Jordan  <robertj@gmx.net>
4561
4562         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
4563         which resort to FindFirstFile when a certain error condition
4564         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
4565         Code is contributed under MIT/X11 license.
4566
4567 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
4568
4569         * marshal.c (emit_marshal_string): Fix out string marshalling
4570         to use specified encoding. Fixes #323900.
4571
4572         Code is contributed under MIT/X11 license.
4573
4574 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
4575
4576         * class.c (mono_class_inflate_generic_method_full): Don't modify
4577         iresult->context after cache check.
4578
4579 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
4580
4581         * class.c (mono_class_inflate_generic_method_full): Change the
4582         struct assignments to memcpy for better visibility and add some comments.
4583
4584 2008-01-23  Dick Porter  <dick@ximian.com>
4585
4586         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
4587         procedure, and make it work on windows.
4588
4589 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
4590
4591         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
4592         a MonoReflectionTypeBuilder since it is always of that type.
4593
4594         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
4595
4596         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
4597
4598         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
4599         
4600         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
4601
4602         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
4603
4604         * reflection.c (mono_reflection_create_runtime_class): Remove already created
4605         instantiations from the type cache.
4606
4607 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4608
4609         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
4610
4611         * verify.c (do_unbox_value): push a controled mutability managed pointer.
4612
4613 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4614
4615         * verify.c (do_ldstr): added, verifies if the #US token is valid.
4616
4617         * verify.c (mono_method_verify): removed old TODO
4618
4619 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4620
4621         * verify.c (do_newobj): add visibility check.
4622
4623 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
4624
4625         * verify.c (do_load_function_ptr): add visibility check.
4626
4627 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
4628         *class.c:
4629         mono_generic_class_get_class: hook profiler events.
4630         mono_field_get_offset: added to support heap-shot in the new profiler.
4631         *class.h: exported mono_field_get_offset.
4632         * reflection.c:
4633         mono_reflection_setup_internal_class: hook profiler events.
4634
4635 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
4636
4637         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
4638         argument here too and use it to avoid checking for pending exceptions if 
4639         possible.
4640
4641 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
4642
4643         * assembly.c (build_assembly_name): add arg for passing the assembly
4644         flags. Do not consider a PublicKey with value "null" valid.
4645         (mono_assembly_name_parse_full): added boolean argument that will be
4646         set if the assembly name contains a PublicKeyToken spec. Added support
4647         for the Retargetable spec for which only Yes or No are allowed as valid
4648         value. Consider assembly name invalid if Retargetable spec is set, but
4649         either version, culture or public key (token) are not specified.
4650         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
4651         with implementation in assembly.c.
4652         * icall.c (fill_reflection_assembly_name): also copy assembly flags
4653         from MonoAssemblyName.
4654         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
4655         introduced argument for mono_assembly_name_parse_full to know if the
4656         assembly name has a PublicKeyToken spec, and if it has instruct
4657         fill_reflection_assembly_name to use default value for keyToken (if
4658         PublicKeyToken is null).
4659
4660 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
4661
4662         * verify.c (mono_method_verify): fixed ovf ops with
4663         float values. They are unverifiable now.
4664
4665 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
4666
4667         * class.c (set_failure_from_loader_error): add BadImageException to the
4668         list of exceptions that can cause a type to fail to load.
4669
4670         * class.c (mono_class_get_exception_for_failure): same.
4671
4672 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
4673
4674         * verify.c (in_any_exception_block): added, check if offset
4675         is part of any exception handling clause.
4676
4677         * verify.c (get_stack_type): added VAR and MVAR types.
4678
4679         * verify.c (do_stobj): better error messages.
4680
4681         * verify.c (do_cpobj): added, check cpobj.
4682
4683         * verify.c (do_initobj): added, check initobj.
4684
4685         * verify.c (do_sizeof): added, check sizeof.
4686
4687         * verify.c (do_localloc): added, check localloc.
4688
4689         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
4690
4691 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
4692
4693         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
4694         save_lmf/restore_lmf opcodes.
4695
4696         * threads.c (mono_threads_install_notify_pending_exc): New function to
4697         install a callback notifying the JIT there is a pending exception on a thread.
4698         (mono_thread_request_interruption): Call the new callback.
4699         (mono_thread_get_and_clear_pending_exception): New function to return the
4700         exception pending on a thread.
4701
4702         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
4703         to turn off checking for pending exceptions.
4704         (mono_marshal_get_native_wrapper): Ditto.
4705
4706 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4707
4708         * threads-types.h: Get rid of the unnecessary extern declarations.
4709
4710 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
4711
4712         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
4713         return field from parent class if not private.
4714         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
4715         returns fields from parent class if they are not private.
4716         (method_nonpublic): added function to determine if a given method
4717         should be considered non-public. Returns false for private methods
4718         on parent class, and internal methods from parent on the 1.0 profile.
4719         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
4720         use method_nonpublic function to determine whether method should be
4721         returned.
4722         (property_accessor_public): use newly introduced method_nonpublic
4723         function to determine whether accessor is non-public. 
4724         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
4725         event from parent class if not private. Only return static event if
4726         Static flag is set, and only return static event from parent class if
4727         FlattenHierarchy flag is set.
4728         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
4729         include non-private events from parent class.
4730
4731 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
4732
4733         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
4734         warning.
4735
4736 2008-01-16  Wade Berrier <wberrier@novell.com>
4737
4738         * security.c: Add assembly.h header to appease some warnings
4739
4740 2008-01-16  Dick Porter  <dick@ximian.com>
4741
4742         * process.c (process_module_string_read): Remove trailing null
4743         when saving string.
4744
4745 2008-01-16  Mark Probst  <mark.probst@gmail.com>
4746
4747         * class-internals.h: A new data structure describing the layout of
4748         a runtime generic context (MonoRuntimeGenericContextTemplate).
4749
4750         * metadata-internals.h: Added a hash table to MonoDomain that maps
4751         from open generic classes to their runtime generic context
4752         templates.
4753
4754         * object.c: Building of the runtime generic context, including
4755         proper handling of generic type arguments of superclasses.
4756         Building of the runtime generic context according to the template.
4757
4758 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
4759
4760         * class.c (mono_class_setup_fields): Set field.count for generic instances.
4761         Fixes #350856.
4762
4763         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
4764         mono_portability_find_file (). Fixes #325466.
4765         (mono_image_get_public_key): Fix a warning.
4766
4767 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
4768
4769         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
4770         Fixes #353550.
4771         (mono_class_from_name_case): Ditto.
4772
4773 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
4774
4775         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
4776           common storage for the tables used in the System/NumberFormatter class.
4777
4778 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
4779
4780         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
4781
4782 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
4783
4784         * verify.c (get_boxable_mono_type): check if the token is valid.
4785
4786         * verify.c (set_stack_value): changed to add an error if an
4787         invalid type is set on stack. Changed all callers due to signature change.
4788
4789         * verify.c (do_stobj): implement stobj validation.
4790
4791 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
4792
4793         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
4794         set container->is_method, it was set earlier.
4795
4796         * metadata.c (type_in_image): Handle MVARs which belong to not finished
4797         generic methods.
4798
4799         * reflection.c (mono_reflection_initialize_generic_parameter): Set
4800         is_method of the generic container to TRUE for methods.
4801
4802 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
4803
4804         * metadata.c (type_in_image): Handle type parameters properly.
4805
4806         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
4807         memory ownership of this structure.
4808
4809 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
4810
4811         * verify.c (get_boxable_mono_type): make typedref types been just
4812         unverifiable. check for void type.
4813
4814         * verify.c (do_unbox_any): added, verify opcode unbox.any.
4815
4816         * verify.c (do_load_function_ptr): accept method spec tokens.
4817
4818 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
4819
4820         * marshal.c (mono_class_native_size): Always set *align even if this is called
4821         recursively.
4822
4823 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
4824
4825         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
4826         out-of-date.
4827
4828 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
4829
4830         * verify.c: removed some old unused tables. A huge bunch of small fixes
4831         to things found while testing the verifier with mono basic.
4832
4833         * verify.c (dump_stack_value): dump null literal flag to.
4834
4835         * verify.c (verify_type_compatibility_full): fix comparison
4836         for types that have a generic super type.
4837
4838         * verify.c (verify_stack_type_compatibility): fix compatibility
4839         between null literals and reference types. fix compatibility between
4840         boxed valuetypes and object. fix corner case test for enums.
4841
4842         * verify.c (do_cmp_op): proper verification of cgt.un in case
4843         of reference types.
4844
4845         * verify.c (do_invoke_method): fix error message.
4846
4847         * verify.c (do_store_indirect
4848
4849         * verify.c (check_is_valid_type_for_field_ops): proper verification
4850         of managed pointers to valuetypes and boxed valuetypes. proper verification
4851         of null literals.
4852
4853         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
4854         allow token to be a reference type.
4855
4856         * verify.c (do_cast): proper handling of boxes valuetypes.
4857
4858         * verify.c (do_stelem): proper handling of storing a boxed valuetype
4859         in object[].
4860
4861         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
4862         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
4863         fixed the decoding of unbox_any
4864
4865 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
4866
4867         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
4868
4869 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
4870
4871         * verify.c (do_newobj): do delegate verification.
4872
4873         * verify.c (verify_delegate_compatibility): perform delegate
4874         verification.
4875
4876         * verify.c (verify_ldftn_delegate): perform tests related to
4877         ldftn delegates.
4878
4879         * verify.c (mono_delegate_signature_equal): perform the
4880         slightly diferent signature comparison required by delegates.
4881
4882         * metadata.c (mono_metadata_type_equal_full): added and exported
4883         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
4884         allows signature only comparison.
4885
4886         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
4887         as MONO_INTERNAL.
4888
4889 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
4890
4891         * verify.c: added a bunch of stack_slot_* functions to
4892         make access to stack slot type easier. This is required to
4893         allow optional flags, like null literal, boxed value and
4894         this pointer.
4895         All access paths to IlStackDesc::stype have been changed 
4896         to use these new funcions.
4897         Removed a bunch of unused functions and cleared all warnings.
4898         This patch introduces the usage of the this pointer and 
4899         boxed value flags.
4900
4901 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
4902
4903         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
4904
4905 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
4906
4907         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
4908         match managed version.
4909
4910         * appdomain.c: Bump corlib version.
4911         
4912         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
4913         argument.
4914
4915 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
4916
4917         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
4918         Set public key token to zero-length byte array if assembly is not
4919         strongnamed.
4920
4921 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
4922
4923         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
4924         writing a vtype array elem.
4925
4926 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
4927
4928         * assembly.c (build_assembly_name): return FALSE if length of token is
4929         not 16 (if not "null").
4930         (mono_assembly_name_parse_full): return FALSE if value of version,
4931         culture, token or key is 0.
4932         * icall.c (fill_reflection_assembly_name): add boolean arguments to
4933         specify whether public key and public key token must be set to default
4934         value (zero-length byte array) if not available. Set versioncompat to
4935         SameMachine. If public key is available or the default is set, then
4936         set PublicKey flag.
4937         (ves_icall_System_Reflection_Assembly_FillName): if no public key
4938         is available, use empty byte array as default value. On the 2.0
4939         profile, use default value for public key token if not set.
4940         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
4941         profile, use default value for public key if not set. On the 2.0
4942         profile, use default value for public key token if not set.
4943         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
4944         default values for public key and public key token.
4945
4946 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
4947
4948         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
4949         field to keep it in synch with the managed object.
4950
4951         * marshal.c (emit_marshal_object): Add support for byref marshalling of
4952         delegates. Fixes #351520.
4953
4954         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
4955         contains defined memory.
4956         
4957         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
4958
4959         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
4960         
4961         * sgen-gc.c (check_consistency): New helper function to do a consistency check
4962         of the GC data structures.
4963
4964         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
4965
4966         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
4967         
4968         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
4969         barrier.
4970         (mono_array_clone_in_domain): Ditto.
4971         (mono_array_clone_in_domain): Ditto.
4972
4973         * threads.c (start_wrapper): Register the thread start argument as a GC root.
4974         (cache_culture): Use a write barrier.
4975
4976         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
4977         (ves_icall_get_property_info): Ditto.
4978
4979         * object.h (MONO_STRUCT_SETREF): New macro.
4980
4981         * class-internals.h (MonoStats): Add some GC statistics.
4982
4983         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
4984
4985 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
4986
4987         * exception.c (mono_exception_from_name_two_strings):
4988         Break from loop after method is found.
4989
4990 2008-01-04  Dick Porter  <dick@ximian.com>
4991
4992         * process.c (process_module_string_read): Rename variable to
4993         reflect correct usage, after fixing bug 345972.
4994
4995 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
4996
4997         * verify.c (mono_type_create_fnptr_from_mono_method): 
4998         created a MonoType function pointer instance to be used during
4999         verification. The verifier releases this memory at end.
5000
5001         * verify.c (mono_method_is_constructor): extracted repeated
5002         checks for constructor into a single class.
5003
5004         * verify.c (do_push_field): use new extracted method
5005         for constructor check.
5006
5007         * verify.c (do_newobj): same.
5008
5009         * verify.c (do_ldftn): renamed to do_load_function_ptr
5010         and make it verify ldvirtftn too.
5011
5012         * verify.c (mono_method_verify: proper verification
5013         of ldvirtftn. release created MonoMethod instances.
5014
5015 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5016
5017         * verify.c (token_bounds_check): added.
5018
5019         * verify.c (do_ldftn): added.
5020
5021         * verify.c (mono_method_verify): proper verificartion of ldftn.
5022
5023 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
5024
5025         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
5026         than the table row count. It's the resposibility of the caller to
5027         make the bounds check and raise the correct error.
5028
5029         * metadata.c (mono_metadata_decode_row_col): Same.
5030
5031         * loader.c (mono_get_method_from_token): perform bounds check
5032         on token for methoddef table.
5033
5034 2007-12-29  Miguel de Icaza  <miguel@novell.com>
5035
5036         * icall.c
5037         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
5038         assert into a negative result, the managed code already coped with
5039         that.
5040
5041         Some folks on Windows reported this error. 
5042
5043 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
5044
5045         * appdomain.c: Bump corlib version.
5046         * icall.c:
5047         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
5048         CultureInfo.CreateCulture to create CultureInfo for name.
5049         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
5050         create CultureInfo for name. Fixes bug #347174.
5051
5052 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
5053
5054         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
5055         flags.
5056
5057         * verify.c (is_valid_branch_instruction): allow branching to the
5058         first instruction of the protected block.
5059
5060         * verify.c (is_valid_cmp_branch_instruction): same.
5061
5062         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
5063         avoid double initialization.
5064
5065         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
5066         detect which cases the eval stack should just be copied.
5067
5068         * verify.c (mono_method_verify): check if the eval stack
5069         is empty when entering a protected block.
5070
5071 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
5072
5073         * verify.c: added is_clause_in_range, is_clause_inside_range,
5074         is_clause_nested and verify_clause_relationship. They perform
5075         the verifications stated in P1 12.4.2.7.
5076
5077         * verify.c (mono_method_verify): remove some unused variables,
5078         add the new exception clause checks, add instruction border
5079         checks for protected block start/end, improved some error 
5080         messages and fixed a bug in the way invalid instruction access
5081         is detected.
5082
5083 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
5084
5085         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
5086         from GC 7.0 if available.
5087
5088         * object.c: Remove an unused define.
5089         
5090         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
5091
5092         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
5093
5094         * null-gc.c (mono_gc_make_descr_for_array): Implement.
5095
5096         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
5097
5098         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
5099         to take the same arguments as the other make_descr functions.
5100
5101         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
5102
5103         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
5104         directly.
5105
5106         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
5107         mini.c.
5108
5109         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
5110         call to boehm-gc.c.
5111
5112         * boehm-gc.c (mono_gc_register_root): Fix a warning.
5113
5114         * null-gc.c (mono_gc_register_root): Fix a warning.
5115
5116         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
5117
5118         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
5119         (mono_gc_base_init): Call GC_init ().
5120
5121         * null-gc.c: Define mono_gc_register_root () as a no-op.
5122
5123         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
5124
5125 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
5126
5127         * verify.c: add prototype for merge_stacks at top
5128
5129         * verify.c (do_switch): added.
5130
5131         * verify.c (merge_stacks): on some cases the stack merging
5132         was not happening properly. Unequal stack sizes at merge
5133         points should be invalid.
5134
5135         * verify.c (mono_method_verify): added more debug info on stack state.
5136         verify switch properly.
5137
5138 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
5139
5140         * method-builder.h: New file, moved the mono_mb_ declarations here from 
5141         marshal.h.
5142
5143         * boehm-gc.c marshal.c: Include method-builder.h.
5144
5145         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
5146
5147         * marshal.c: Remove some code which is now in method-builder.c.
5148
5149 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
5150
5151         * method-builder.c: New file, extraction of the method builder functionality 
5152         from marshal.c.
5153
5154         * marshal.c: Move the mb functions into method-builder.c.
5155
5156         * marshal.h marshal.c: Export some mono_mb_... functions.
5157
5158         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
5159
5160         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
5161         the caller.
5162
5163         * class.c (mono_class_get_full): Check the token type in the dynamic case.
5164
5165         * loader.c (mono_field_from_token): Ditto.      
5166
5167         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
5168         type as well.
5169         
5170         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
5171         Fixes #342565.
5172
5173         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
5174         a helper function for setting it.
5175
5176         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
5177
5178         
5179         * assembly.c: Significally simplify code now that referenced assemblies are 
5180         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
5181
5182         * threads.h: Don't include  the internal threads-types.h header file. Fixes
5183         #349952.
5184
5185 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
5186
5187         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
5188         instructions that were target of branches or are at protected block boundaries.
5189
5190         * verify.c (in_same_block): handle filter clauses.
5191
5192         * verify.c (is_valid_branch_instruction): added. checks the target of
5193         instructions br or brtrue/false.
5194
5195         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
5196         binary branch instructions such as beq and bge.
5197
5198         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
5199         and made it pin the instruction as been part of the exception block.
5200
5201         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
5202         of in_same_block.
5203
5204         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
5205         of in_same_block.
5206
5207         * verify.c (do_ret): ret from a protected block is unverifiable and
5208         not invalid.
5209
5210         * verify.c (do_static_branch): verify br and br.s instructions.
5211
5212         * verify.c (merge_stacks): add extra param to support detection
5213         of branches in the middle of instructions.
5214         
5215         * verify.c (mono_method_verify): verify branches and exception blocks
5216         that target the middle of instructions. Proper verification of br and br.s.
5217
5218 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
5219
5220         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
5221         skip_visibility field.
5222         (reflection_methodbuilder_from_dynamic_method): Ditto.
5223
5224         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
5225         registrations. Fixes #348193.
5226
5227         * threads.h: Move the internal mono_thread_get_pending_exception () to
5228         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
5229
5230 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
5231
5232         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
5233         icall registration. Fixes #348193.
5234
5235         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
5236         for corlib classes into object. Fixes #349621.
5237
5238 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
5239
5240         * icall.c (property_accessor_nonpublic): new function to determine
5241         whether an accessor allows a property to be considered non-public.
5242         Returns false for private accessor(s) from parent class, and internal
5243         accessor(s) from parent on 2.0 profile (and higher).
5244         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
5245         to determine whether property should be included if NonPublic flag
5246         is set. Fixes bug #349078.
5247
5248 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
5249
5250         * verify.c (init_stack_with_value): added.
5251
5252         * verify.c (mono_method_verify): extracted common
5253         code for exception initialization into init_stack_with_value.
5254
5255         * verify.c (mono_method_verify): initialize the exception
5256         for handler clauses as well.
5257
5258         * verify.c (mono_method_verify): fix the exception clause
5259         ordering rules, it should use handler end offset and not
5260         start offset.
5261
5262 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
5263
5264         * rawbuffer.c: remove useless warning.
5265
5266 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
5267
5268         * threads.h, threads-types.h: move functions to the correct header
5269         (fixes bug#349952).
5270
5271 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5272
5273         * verify.c (mono_method_verify): proper verification
5274         of exception handling clauses ranges and fallthru in
5275         and out of protected blocks.
5276
5277 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5278
5279         * verify.c (mono_method_verify): fixed compilation issue.
5280
5281 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
5282
5283         * verify.c (mono_method_verify): a printf slipped in, changed
5284         to use verifier debug macro.
5285
5286 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
5287
5288         * verify.c (is_correct_leave): check for filter clauses.
5289
5290         * verify.c (do_filter): added.
5291
5292         * verify.c (mono_method_verify): property verification of leave.
5293
5294
5295 2007-12-18  Mark Probst  <mark.probst@gmail.com>
5296
5297         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
5298         Win32 build, until we figure out how to do the proper thing on
5299         Win32.
5300
5301 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
5302
5303         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
5304         by the previous patch.
5305         
5306         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
5307         the assembly resolve handler for refonly assemblies.
5308
5309 2007-12-17  Mark Probst  <mark.probst@gmail.com>
5310
5311         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
5312         Make sure only one thread is allowed to commence shutdown, and
5313         don't allow new threads to be started once shutdown is in
5314         progress.
5315
5316 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
5317
5318         * verify.c (is_correct_endfilter): added.
5319
5320         * verify.c (is_unverifiable_endfilter): added.
5321
5322         * verify.c (do_endfilter): added.
5323
5324         * verify.c (mono_method_verify): property verification of endfilter
5325         and fixed a corner case or endfinally.
5326
5327 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
5328
5329         * verify.h: new flags to support fail fast of unverifiable code and
5330         do non-strict verification. Non-strict verification is required to
5331         have MS runtime compatibility. There are a huge amount of unverifiable
5332         code that it accepts as verifiable. The strict mode verifies the code
5333         as the specs says.
5334         Non-strict mode will be required in cases where code needs to be
5335         accepted as verifiable but fails under strict mode.
5336
5337         * pedump.c: added support to fail fast and non-strict verification.
5338
5339         * verify.c: added support for both fail fast and non-strict verification.
5340
5341 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
5342
5343         * verify.c (is_correct_endfinally): added.
5344
5345         * verify.c (mono_method_verify): property verification of endfinally.
5346
5347 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
5348
5349         * verify.c (in_any_block): check for filter clauses.
5350
5351         * verify.c (is_correct_rethrow): added.
5352
5353         * verify.c (mono_method_verify): property verification of rethrow.
5354
5355         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
5356
5357 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
5358
5359         * verify.c (do_throw): added.
5360
5361         * verify.c (mono_method_verify): property verification of throw
5362
5363 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
5364
5365         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
5366         assemblies. Fixes #346425.
5367
5368 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
5369
5370         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
5371         FieldBuilders.
5372
5373         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
5374
5375         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
5376         prevent asserts when this is called with a token which might not be valid.
5377
5378         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
5379         lookup_dynamic_token_class with valid_token == FALSE.
5380
5381         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
5382
5383         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
5384
5385         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
5386         
5387 2007-12-10  Mark Probst  <mark.probst@gmail.com>
5388
5389         * gc.c: Don't delay threadpool thread finalization unless Mono is
5390         shutting down.
5391
5392 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
5393
5394         * threads.c: turn an assert into a non-fatal warning.
5395
5396 2007-12-09  Robert Jordan  <robertj@gmx.net>
5397
5398         * icall.c (GetVirtualMethod): Add missing argument validation.
5399
5400 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
5401
5402         * verify.c (do_cast): added.
5403
5404         * verify.c (mono_method_verify): property verification of castclass and isinst.
5405
5406
5407 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
5408
5409         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
5410
5411         * verify.c (do_stelem): added.
5412
5413         * verify.c (mono_method_verify): property verification of stelem.X.
5414
5415 2007-12-07  Mark Probst  <mark.probst@gmail.com>
5416
5417         * class.c, class-internals.h: Introduce an environment variable
5418         (MONO_GENERIC_SHARING) through which the extent of generic code
5419         sharing can be controlled (share all classes, share only corlib
5420         classes, or share nothing).
5421
5422         * object.c: Only create runtime generic context for classes for
5423         which sharing is enabled.
5424
5425 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
5426
5427         * verify.c (do_ldelem): refactor it to work with ldelem.any.
5428
5429         * verify.c (mono_method_verify): property verification of ldelem.any.
5430
5431 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
5432
5433         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
5434         added ldelem.X opcodes.
5435
5436         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
5437
5438         * verify.c: proper verification of ldelem.X 
5439
5440 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
5441
5442         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
5443
5444 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
5445
5446         * verify.c (mono_method_verify): null literal requires special handling,
5447         the value pushed on stack need to be flagged as so.
5448
5449         * verify.c (do_ldelema): Verify ldelema properly.
5450
5451 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
5452
5453         * verify.c: Verify ldlen properly.
5454
5455 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
5456
5457         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
5458         to the target object's type. Fixes #346160.
5459
5460 2007-12-05  Dick Porter  <dick@ximian.com>
5461
5462         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
5463         Solaris needs the same workaround as BSD-derived systems.  Fixes
5464         bug 323524, patch by Burkhard Linke
5465         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
5466
5467 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
5468
5469         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
5470         handle to use when error dialog is shown; otherwise, update mask
5471         to show no error dialog when an error occurs.
5472
5473 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
5474
5475         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
5476
5477         * class.c (mono_class_get_field_default_value): New helper function to initialize
5478         field->def_type and field->data.
5479
5480 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
5481
5482         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
5483         the general one.
5484
5485         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
5486
5487         * marshal.c: Avoid depending on delegate->method_info being set.
5488
5489         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
5490         
5491         * object.c (mono_delegate_ctor): Set delegate->method.
5492
5493         * object-internals.h (struct _MonoDelegate): Add 'method' field.
5494
5495         * appdomain.c: Bump corlib version.
5496
5497 2007-11-27  Raja R Harinath  <harinath@gmail.com>
5498
5499         * metadata.c (mono_generic_inst_equal_full): Short-circuit
5500         equality check if we're comparing canonicalized MonoGenericInsts.
5501
5502 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
5503
5504         * class.c (generic_array_methods): Call mono_class_setup_methods () before
5505         accessing class->methods.
5506
5507 2007-11-22  Dick Porter  <dick@ximian.com>
5508
5509         * threads.c: Ensure that the synch_cs is set before trying to use
5510         it.
5511
5512 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
5513
5514         * profiler.c: r89126 broke the statistial profiler, unbreak.
5515
5516 2007-11-22  Martin Baulig  <martin@ximian.com>
5517
5518         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
5519
5520         * mono-debug.c
5521         (mono_debug_debugger_version): Bump to 3.
5522         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
5523         -> mono_debugger_class_initialized().
5524
5525         * mono-debug-debugger.c
5526         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
5527
5528         * class.c
5529         (mono_debugger_start_class_init_func): Removed.
5530         (mono_debugger_class_loaded_methods_func): Added.
5531         (mono_class_setup_methods): Call it here.
5532
5533 2007-11-22  Martin Baulig  <martin@ximian.com>
5534
5535         * mono-debug.c
5536         (mono_debug_add_delegate_trampoline): New public method.
5537         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
5538
5539         * mono-debug.h
5540         (MonoSymbolTable): Added `global_data_table'.
5541         (MonoDebuggerTypeKind): Removed.
5542
5543 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
5544
5545         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
5546         these methods.
5547
5548         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
5549         
5550 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
5551
5552         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
5553
5554 2007-11-20  Martin Baulig  <martin@ximian.com>
5555
5556         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
5557
5558         * mono-debug-debugger.c
5559         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
5560         (mono_debugger_remove_breakpoint): Likewise.
5561         (mono_debugger_check_breakpoints): Likewise.
5562         (mono_debugger_register_class_init_callback): New public method.
5563         (mono_debugger_remove_class_init_callback): Likewise.
5564         (mono_debugger_add_type): Likewise.
5565
5566         * mono-debug-debugger.h
5567         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
5568
5569 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
5570
5571         * class.c: more interface implementations needed for the
5572         array enumerator (fixes bug #341112).
5573
5574 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
5575
5576         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
5577         fix ParamName of ArgumentNullExceptions.
5578
5579 2007-11-17  Miguel de Icaza  <miguel@novell.com>
5580
5581         * reflection.c (mono_reflection_encode_sighelper): Generate the
5582         modopts and modreqs.   I have a useless test that crashes monodis,
5583         but that shows the code working.
5584
5585 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
5586
5587         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
5588         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
5589
5590 2007-11-15  Dick Porter  <dick@ximian.com>
5591
5592         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
5593         When joining a thread, it's the thread that's calling Join that
5594         gets WaitSleepJoin state not the target.  Fixes the standalone
5595         test case in bug 334740, and hopefully the whole bug too.
5596
5597 2007-11-15  Dick Porter  <dick@ximian.com>
5598
5599         * process.c: Read file version info from the files pointed at by
5600         process modules, not the current process.  Fixes bug 315969.
5601
5602         Use windows typedef names in some places to fix warnings on the
5603         windows build.
5604
5605 2007-11-15  Mark Probst  <mark.probst@gmail.com>
5606
5607         * image.c, metadata-internals.h: Added a generic_class_cache hash
5608         to MonoImage for looking up generic classes when sharing generics.
5609
5610 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
5611
5612         * sgen-gc.c: warning cleanups.
5613
5614 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
5615
5616         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
5617         inherited properties.
5618
5619 2007-11-14  Mark Probst  <mark.probst@gmail.com>
5620
5621         * object.c, class-internals.h: Added more information to the
5622         runtime generic context.
5623
5624 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
5625
5626         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
5627         instead of just the target method. Generalize the abstract method handling to
5628         handle any non-static method.
5629
5630         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
5631         mono_marshal_get_delegate_invoke () signature change.
5632
5633 2007-11-13  Mark Probst  <mark.probst@gmail.com>
5634
5635         * class.c, class-internals.h: Made
5636         mono_type_get_basic_type_from_generic () public.  Fixed member
5637         access check for shared generics.
5638
5639         * loader.c: Don't insert field into field cache if it's part of a
5640         non-inflated generic class.
5641
5642         * domain.c, domain-internals.h: The generic sharing context is now
5643         part of the jit info data structure.  Added two accessor
5644         functions.
5645
5646 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
5647
5648         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
5649         the array Get/Set/Address methods, since the JIT inlines them.
5650
5651         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
5652
5653         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
5654         (mono_image_init): Initialize runtime_invoke_direct_cache.      
5655
5656         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
5657         mono_marshal_get_delegate_invoke signature change.
5658
5659         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
5660         an additional argument. Add support for invoking abstract methods.
5661
5662         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
5663
5664         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
5665
5666 2007-11-09  Mark Probst  <mark.probst@gmail.com>
5667
5668         * class.c: Do field layout for open generic classes as well.
5669
5670 2007-11-09  Mark Probst  <mark.probst@gmail.com>
5671
5672         * gc.c, gc-internal.h: Don't finalize threadpool threads with
5673         other objects, because the threadpool is still around.  Put them
5674         in a list instead and after finalizing all other objects in the
5675         root domain shut down the thread pool and then finalize the
5676         threads.  Fixes bug #337383.
5677
5678         * threads.c, thread-types.h: New mono_thread_create_internal()
5679         function for marking a thread with the threadpool flag before it
5680         started.  Set synch_cs to NULL after freeing it.
5681
5682         * threadpool.c: Mark threadpool threads before they start.
5683
5684 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
5685
5686         * reflection.h, reflection.c: don't export random functions
5687         and lazy load dbnull and missing objects.
5688
5689 2007-11-07  Jonathan Chambers <joncham@gmail.com>
5690
5691         * class.c: Initialize COM types if COM interfaces
5692         are present (not just COM classes).
5693         
5694         Code is contributed under MIT/X11 license.
5695
5696 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
5697         * reflection.c:
5698         create_dynamic_mono_image: hook module profiler events (dynamic case).
5699         mono_image_basic_init: hook assembly profiler events (dynamic case).
5700
5701 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
5702         * profiler.c:
5703         simple_appdomain_unload: completely terminate the profiler
5704         instead of only processing the statistical samples.
5705         simple_shutdown: make sure this is really called exactly once,
5706         even in multithreaded applications, and always listen to
5707         appdomain events.
5708         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
5709         here, the "[un]load" functions will do it.
5710         Fixes bugs #333791 and #325261.
5711
5712 2007-11-07  Geoff Norton  <gnorton@novell.com>
5713
5714         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
5715         rather than depend on __APPLE__.
5716
5717 2007-11-07  Mark Probst  <mark.probst@gmail.com>
5718
5719         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
5720
5721 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
5722
5723         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
5724         UTF16 MonoString. Fix the crash from bug #335488
5725
5726 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
5727
5728         * marshal.c: Correct (for non-Win32 OS) length != size in 
5729         mono_string_from_bstr. Fix #339530.
5730
5731 2007-11-06  Geoff Norton  <gnorton@novell.com>
5732
5733         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
5734         to succeed
5735
5736 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
5737
5738         * process.c: Added run-time GetProcessId API detection for Windows.
5739
5740 2007-11-04  Miguel de Icaza  <miguel@novell.com>
5741
5742         * reflection.c  (mono_param_get_objects): If a parameter has the
5743         attribute [System.Runtime.InteropServices.Optional] we should
5744         set the DefaultValue of the ParameterInfo to be
5745         System.Reflection.Missing instead of DBNull.
5746
5747         See bug #339013.
5748
5749         (mono_get_reflection_missing_object): New method,
5750         returns the System.Reflection.Missing.Value singleton instance.
5751
5752 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
5753
5754         * culture-info-table.h : regenerated.
5755
5756 2007-11-02  Jonathan Chambers <joncham@gmail.com>
5757
5758         * icall.c: Use GetEnvironmentStrings on windows
5759         so we are using the same environment block as 
5760         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
5761         #333740.
5762         
5763         Code is contributed under MIT/X11 license.
5764
5765 2007-10-31  Martin Baulig  <martin@ximian.com>
5766
5767         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
5768
5769         * mono-debug-debugger.h
5770         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
5771
5772 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
5773
5774         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
5775         classes.
5776
5777 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
5778
5779         * culture-info-table.h : regenerated.
5780
5781 2007-10-30  Robert Jordan  <robertj@gmx.net>
5782
5783         * icall-def.h, icall.c:
5784         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
5785
5786         Code is contributed under MIT/X11 license.
5787
5788 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
5789
5790         * class.c (mono_class_setup_vtable): Find the inflated methods in the
5791         inflated class instead of inflating them again.
5792         
5793         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
5794         dynamic case.
5795
5796         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
5797         Call setup_supertypes () after klass->parent is set.
5798         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
5799
5800         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
5801         for inflated instances of not yet created dynamic generic classes.
5802         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
5803         times from inflated_method.
5804         (methodbuilder_to_mono_method): Ditto.
5805
5806 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
5807
5808         * gc.c: code cleanup and removed old untested option of not creating the
5809         finalizer thread.
5810
5811 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
5812
5813         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
5814         creating a jump trampoline for dynamic methods.
5815
5816 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
5817
5818         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
5819         generic TypeBuilders when called from another method of the same type (bug #335131).
5820
5821
5822 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
5823
5824         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
5825         doesn't seem to work perfectly.
5826         
5827         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
5828         called multiple times.
5829         (methodbuilder_to_mono_method): Ditto.
5830         (resolve_object): Inflate FieldBuilder's.
5831
5832 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
5833
5834         * string-icalls.c, string-icalls.h, appdomain.c: patch from
5835         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
5836         RemoveEmptyEntries in the string.Split implementation (bug #322375).
5837
5838 2007-10-26  Dick Porter  <dick@ximian.com>
5839
5840         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
5841         Thread initialisation changes
5842
5843 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
5844
5845         * verify.c: fix compatibility check between arrays and System.Array
5846
5847 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
5848
5849         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
5850         too. Fixes #336999.
5851
5852 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
5853
5854         * object.c (mono_value_box): Use typed allocation here.
5855
5856 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
5857
5858         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
5859         trampoline instead of compiling the method right away.
5860
5861         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
5862
5863 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
5864
5865         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
5866         related fields for dynamic classes. Fixes #334493.
5867
5868 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
5869
5870         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
5871         
5872         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
5873
5874         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
5875         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
5876
5877         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
5878
5879         * reflection.c (create_generic_typespec): Initialize klass->generic_container
5880         if needed.
5881         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
5882
5883 2007-10-18  Jonathan Chambers <joncham@gmail.com>
5884
5885         * marshal.c: Use correct key when removing item
5886         from ccw_hash.
5887         
5888         Code is contributed under MIT/X11 license.
5889
5890 2007-10-17  William Holmes  <billholmes54@gmail.com>
5891
5892         *marshal.c: Adding a case to marshal booleans to U1
5893
5894         Code is contributed under MIT/X11 license.
5895
5896 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
5897
5898         * class.c (mono_class_from_name): Search the modules compromising dynamic
5899         assemblies. Fixes #331601.
5900
5901 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
5902
5903         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
5904         exception if the type name contains an assembly component. Fixes #334203.
5905
5906         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
5907         modules inside dynamic assemblies. Fixes #334200.
5908         
5909         * reflection.c: Set image->public_key and image->public_key_length;
5910
5911         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
5912         fields.
5913
5914         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
5915         
5916 2007-10-16  Mark Probst  <mark.probst@gmail.com>
5917
5918         * metadata.c: Implemented correct comparing of generic classes.
5919         An inflated generic class can be equal to a non-inflated one if it
5920         is inflated with generic type variables as type arguments.  Fixes
5921         bug #333798.
5922
5923 2007-10-15  Dick Porter  <dick@ximian.com>
5924
5925         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
5926         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
5927         81646.
5928
5929         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
5930         instead of a monitor lock.  This means that monitor_try_enter and
5931         co can set the thread state safely.
5932         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
5933         thread_interrupt_requested, so interrupt actually works.
5934
5935         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
5936         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
5937         state accessor function
5938
5939 2007-10-15  Martin Baulig  <martin@ximian.com>
5940
5941         * mono-debug.h
5942         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
5943         the debugger with the current runtime.
5944
5945 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
5946
5947         * object.c, object-internals.h: added the ability to set a single
5948         trampoline for all the slots in a vtable.
5949
5950 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
5951
5952         * marshal.c: deal with a possible race condition during multicast
5953         delegate invocation.
5954
5955 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
5956
5957         * class.c: ensure value type methods don't have the synchronized
5958         flag set.
5959
5960 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
5961
5962         * string-icalls.c, string-icalls.h: reverted unapproved patch that
5963         breaks the build.
5964
5965 2007-10-11  Joel Reed  <joelwreed@comcast.com>
5966
5967         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
5968         to take an options parameter so that empty entries can be removed during
5969         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
5970
5971 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
5972
5973         * marshal.c: make sure we don't store the signature from a dynamic
5974         method into the runtime invoke cache (bug #327189).
5975
5976 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
5977
5978         * marshal.c: make sure the wrapper methods are properly initialized.
5979
5980 2007-10-11  Mark Probst  <mark.probst@gmail.com>
5981
5982         * metadata.c, metadata-internals.h: Generalized
5983         mono_type_stack_size() to mono_type_stack_size_internal() which
5984         takes an additional argument specifying whether it allows open
5985         types.
5986
5987 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
5988
5989         * verify.c (do_invoke_method): handle typedbyref params
5990         correctly and check for unverifiable return values.
5991
5992         * verify.c (do_newobj): fix a warning.
5993
5994 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
5995
5996         * verify.c: don't tread typedbyref as allways unverifable,
5997         so uses, like (ld/st)loc.0 are valid. verify for the cases
5998         that it matters, like boxing related operations.
5999
6000 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6001
6002         * verify.c: add verification of the newobj opcode. verification
6003         of delegate instantation still missing due ldftn and virldftn not
6004         pushing the function type on stack
6005
6006 2007-10-08  Mark Probst  <mark.probst@gmail.com>
6007
6008         * class-internals.h: Runtime generic context data structure
6009         definition.
6010
6011         * object.c: Initialization of runtime generic context at runtime
6012         vtable creation time.
6013
6014 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
6015         * class.c (mono_class_create_from_typedef,
6016         mono_class_from_generic_parameter, mono_ptr_class_get,
6017         mono_fnptr_class_get, mono_bounded_array_class_get)
6018         * domain.c (mono_domain_create, mono_domain_free)
6019         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
6020         * image.c (do_mono_image_load, mono_image_close):
6021         Hooked up load-unload profiler events.
6022
6023 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
6024
6025         * domain.c: track statistics about the actual amount of native code
6026         allocated.
6027
6028 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
6029
6030         * class.c: the valuetype enumerators don't have the additional
6031         supertypes interfaces.
6032
6033 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6034
6035         * class.c: need more interfaces setup for the IEnumerator<T>
6036         object created for arrays (tests/ienumerator-interfaces.2.cs).
6037
6038 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
6039
6040         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
6041
6042 2007-10-05  Alp Toker  <alp@atoker.com>
6043
6044         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
6045         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
6046         #315863.
6047
6048 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
6049
6050         * verify.c (verify_type_compatibility_full): verification of
6051         compatibility improved, validates correctly non-strict checks between
6052         native int and I4 types different than (unsigned)int32.
6053
6054         * verify.c (do_store_indirect): added, do all verification of
6055         ldind.X opcodes. 
6056
6057         * verify.c (get_load_indirect_mono_type): renamed to
6058         get_indirect_op_mono_type, as it now returns the MonoType for 
6059         ldind.X and stind.X opcodes.
6060
6061 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
6062
6063         * reflection.c: Fix the encoding of generic type definition for
6064         TypeBuilders.
6065
6066         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
6067         mono_image_typedef_or_ref but allows to specify if typespec lookups should
6068         be made. Typespec check is done prior to typeref cache lookup.
6069
6070         * reflection.c (mono_image_typedef_or_ref): now just delegate to
6071         mono_image_typedef_or_ref_full.
6072
6073         * reflection.c (encode_generic_class): encode the generic class
6074         directly instead of calling encode_type.
6075
6076         * reflection.c (encode_type): encode the generic type definition
6077         MonoClass as a generic instantiation.
6078
6079         * reflection.c (create_typespec): cache typespec tokens in
6080         the assembly->typespec cache. Don't create typespec for a generic
6081         instance MonoClass. Create typespec for the generic type defintion.
6082
6083         * reflection.c (create_generic_typespec): encode the generic
6084         class directly instead of calling encode_type.
6085
6086         * reflection.c (mono_image_create_token): encode the generic
6087         type definition not using a typespec for MonoType instances.
6088
6089
6090 2007-10-04  Raja R Harinath  <rharinath@novell.com>
6091
6092         Fix #328812
6093         * class.c (mono_image_init_name_cache): Don't return nested
6094         'protected internal' classes.
6095         (mono_class_from_name_case): Likewise.
6096
6097 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
6098
6099         * icall-def.h, icall.c : get_bundled_machine_config() is now the
6100           common function used by both DefaultConfig in System.dll and
6101           InternalConfigurationHost in System.Configuration.dll.
6102
6103 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6104
6105         * class.c: automatically add to vectors only a few essential explicit
6106         generic interfaces. The rest of the interfaces that arrays should
6107         provide are currently implicitly added (but still not lazily, see the
6108         design in the discussion of bug#325495 for the details of what is
6109         needed for that). Additionally, implicit interfaces are assigned the
6110         same vtable slot as the explicit interfaces (as they are compatible):
6111         this enables huge memory savings since we don't need to instantiate
6112         as many memthods and as large vtables anymore. Also, Since
6113         GetEnumerator<T> returns an instance of a type that is required to
6114         support a similarly large set of interfaces as arrays, we add
6115         implicit interfaces and interface offset sharing support to those
6116         types, too. This change adds all the required interfaces so that
6117         the anonarray.cs test case in the bug report works (we don't add
6118         all the interfaces to arrays of arrays 3-level deep and more because
6119         of the memory requirements explained in the bug and since they are much
6120         less common: the lazy-loading support will enabled them to work, too).
6121
6122 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
6123
6124         * verify.c (merge_stacks): major clean up, all type compatibility
6125         checks are done by verify_type_compatibility. This fix my earlier lack
6126         of understanding of the CLR type system and merge_stacks no longer looks
6127         scary.
6128
6129         * verify.c: fixed some bad spelling.
6130
6131 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
6132
6133         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
6134         a given stack slock.
6135         
6136         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
6137         verify_type_compatibility_full. This removed a near indentical function and fixed
6138         handling of Int32 and IntPtr across all opcodes.
6139
6140 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6141
6142         * class.c: only vectors have the additional generic interfaces.
6143
6144 2007-10-01  Jonathan Chambers <joncham@gmail.com>
6145
6146         * mono-config.c: Use g_strcasecmp instead of
6147         strcasecmp like everywhere else to fix
6148         compilation with MSVC.
6149         
6150         Code is contributed under MIT/X11 license.
6151
6152 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6153
6154         * object.c, object-internals.h: refactored the IMT code to enable
6155         building a single slot at a time and lazily creating the IMT trampolines
6156         and thunks.
6157
6158 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
6159
6160         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
6161
6162         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
6163         Fixes #328501.
6164         
6165 2007-09-29  Raja R Harinath  <harinath@gmail.com>
6166
6167         * loader.c (method_from_methodspec): Rearrange to avoid
6168         un-necessary exposition.  Don't assert out if the method's
6169         declaring type is a generic type definition.
6170
6171 2007-09-28  Martin Baulig  <martin@ximian.com>
6172
6173         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
6174
6175 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
6176
6177         * class-internals.h: optimize field layout of MonoClass to
6178         requires less cachelines at runtime and save a few bytes on 64 bit
6179         systems.
6180
6181 2007-09-28  Jb Evain  <jbevain@novell.com>
6182
6183         * reflection.c: when encoding type names in custom attributes,
6184         if the type is a closed generic type, its generic arguments
6185         have to be serialized as AssemblyQualifiedName, so that when
6186         they are deserialized, it's possible to re-create them properly.
6187         Fixes #329450.
6188
6189
6190 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
6191
6192         * object.c, class-internals.h: added delegate-creation counter.
6193
6194 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
6195
6196         * class.c: cleanup of the code that synthetizes interfaces for
6197         arrays in 2.0: saves quit a bit of corlib mempool memory.
6198         Code to fix bug #325495 ifdeffed out for now until the issues
6199         with memory usage and O(n^2) behaviour are fixed.
6200
6201 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
6202
6203         * marshal.c: when possible, do not duplicate the name of the methods
6204         in the method builder and in the generated MonoMethod.
6205
6206 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
6207         * verify.c: added support for type checking ldind_* opcodes.
6208
6209 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
6210
6211         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
6212         which is used to distinguish the fully open instantiation of a TypeBuilder
6213         with the rest. This temporary hack is required to restore the property that
6214         the fully open instantiation is the same type of the generic type definition.
6215
6216         * class-internals.h (mono_generic_class_is_generic_type_definition):
6217         new function as part of the internal API.
6218
6219         * class.c (inflate_generic_type): return NULL when the generic inst is
6220         fully open. The fully open generic type is now the same as the generic type
6221         definition for non TypeBuilder types.
6222
6223         * class.c (mono_generic_class_get_class): removed assert since it is
6224         no longer valid, gklass->cached_class can point to the generic type definition.
6225
6226         * class.c (mono_generic_class_is_generic_type_definition): new.
6227
6228         * metadata.c (mono_generic_class_hash): added is_tb_open field
6229         to the hash calculation.
6230
6231         * metadata.c (free_generic_class): if the generic class is associated
6232         with the generic type definition, its field will come from the mempool and
6233         must not be freed.
6234
6235         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
6236         new, this function identifies the corner case of a TypeBuilder fully open
6237         instantiation.
6238
6239         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
6240         for lookup. Set gclass->cached_class to be the container class in case of
6241         the fully open instantiation of non TypeBuilder types.
6242
6243         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
6244         to compare generic classes.
6245
6246         * reflection.c (method_encode_methodspec): remove assert that
6247         no longer is valid.
6248
6249         * reflection.c (mono_reflection_generic_class_initialize): add
6250         an aditional assert to ensure the proper type is used.
6251
6252 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
6253
6254         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
6255         to enjoy it.
6256
6257 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
6258
6259         * verify.c (push_arg): Fixed support for ldarga
6260         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
6261         MonoType used as first arg in case of instance calls.
6262
6263 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
6264
6265         * verify.c: Support for verifying VAR and MVAR types, 
6266
6267 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
6268
6269         * icall.c (ves_icall_get_property_info): Set the reflected type of the
6270         accessors correctly.
6271
6272 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
6273
6274         * threads.c: support OSX and other systems in
6275         mono_thread_get_stack_bounds (bug #328026).
6276
6277 2007-09-25  Martin Baulig  <martin@ximian.com>
6278
6279         * mono-debug.h
6280         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
6281
6282 2007-09-24  Martin Baulig  <martin@ximian.com>
6283
6284         * mono-debug.h
6285         (MonoDebugClassEntry): Moved the definition of this struct into
6286         mono-debug.c to make it private.
6287
6288         * mono-debug.c
6289         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
6290         type table per symbol file, we don't need to store the symfile id
6291         any longer.
6292
6293 2007-09-24  Martin Baulig  <martin@ximian.com>
6294
6295         Create one type table per symbol file, since a `MonoClass *' gets
6296         invalid when its image is unloaded.
6297
6298         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
6299         (MonoDebugHandle): Added `type_table'.
6300
6301 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
6302
6303         * mempool.c, mempool.h: added mono_mempool_new_size () API
6304         to be able to specify a smaller initial size for the pool.
6305         Adjusted the code to slowly increase pool size before using
6306         the previous default size.
6307         * image.c: use a small initial size for image mempools.
6308
6309 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
6310
6311         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
6312         Fixes ##320990.
6313
6314         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
6315         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
6316
6317 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
6318
6319         * metadata.c (mono_type_create_from_typespec): Remove an invalid
6320         free. Fixes #327438.
6321
6322 2007-09-21  Raja R Harinath  <harinath@gmail.com>
6323
6324         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
6325         generic instantiations, etc.
6326         <MONO_TYPE_ARRAY>: Likewise.
6327
6328 2007-09-21  Martin Baulig  <martin@ximian.com>
6329
6330         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
6331         these structs were never defined.
6332         (MonoDebugHandle): Removed the `_priv' field, it was never used.
6333
6334 2007-09-21  Martin Baulig  <martin@ximian.com>
6335
6336         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
6337
6338 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
6339
6340         * image.c: removed the guid hash tables: we can get the same info
6341         without the additional memory usage hit (partially fixes also bug #327052).
6342
6343 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
6344
6345         * profiler.h, profiler-private.h, profiler.c: add a new profiler
6346         event to handle unloading methods. After the event is called, the
6347         corresponding MonoMethod* must be considered invalid.
6348         * loader.c (mono_free_method): call the new mono_profiler_method_free
6349         event.
6350
6351 2007-09-20  Mark Probst  <mark.probst@gmail.com>
6352
6353         * domain-internals.h: New flag in MonoJitInfo which marks shared
6354         generic methods.  New hash table (shared_generics_hash) in
6355         MonoDomain to keep track of shared generic methods.  Prototypes
6356         for functions to register and lookup shared generic methods.
6357
6358         * domain.c: Support for registering and looking up shared generic
6359         methods via a hash table (shared_generics_hash) in MonoDomain.
6360
6361         * class-internals.h: New exception to signal failure of shared
6362         compilation of a generic method.  New counters for generics
6363         sharing in MonoStats.
6364
6365 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
6366
6367         * image.c, metadata-internals.h: don't keep a file descriptor open
6368         for loaded assemblies (bug#325988).
6369
6370 2007-09-19  Raja R Harinath  <rharinath@novell.com>
6371
6372         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
6373         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
6374         use the corresponding datatypes.
6375         (type_in_image): Update to changes.
6376         (CleanForImageUserData): Simplify.
6377         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
6378         Avoid quadratic behaviour in handling the "stolen" list by
6379         separating the filter predicate out, and by prepending the stolen
6380         items rather than appending them.
6381         (steal_ginst_in_image): Likewise.
6382         (mono_metadata_clean_for_image): Update to changes.
6383
6384 2007-09-19  Martin Baulig  <martin@ximian.com>
6385
6386         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
6387
6388 2007-09-19  Martin Baulig  <martin@ximian.com>
6389
6390         * mono-debug.c (mono_debug_cleanup): Don't call
6391         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
6392
6393 2007-09-19  Raja R Harinath  <harinath@gmail.com>
6394
6395         Fix crash on 'make run-test' in mcs/errors
6396         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
6397         Avoid more potential allocations in mono_class_from_mono_type.
6398         (ginst_in_image): Update to changes.
6399         (gclass_in_image): Rearrange slightly.
6400
6401 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
6402
6403         * class.c (mono_class_init): Move the code that sets up class->methods to 
6404         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
6405
6406         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
6407         canonical instance of an inflated generic signature.
6408         (mono_type_create_from_typespec): Remove an invalid free.
6409
6410         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
6411
6412 2007-09-18  Marek Habersack  <mhabersack@novell.com>
6413
6414         * domain-internals.h: added a declaration of the
6415         mono_assembly_load_full_nosearch internal function.
6416
6417         * assembly.c (mono_assembly_load_with_partial_name): use
6418         mono_try_assembly_resolve return value properly.
6419         (mono_assembly_load_full_nosearch): copied the function body from
6420         mono_assembly_load_full, without the code to invoke assembly
6421         search hooks.
6422         (mono_assembly_load_full): calls the above new function and if the
6423         assembly is not resolved, invokes the search hooks.
6424
6425         * appdomain.c (mono_runtime_init): restore the global postload
6426         assembly search handlers.
6427
6428 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
6429
6430         * class.c (mono_class_init): Make sure class->methods and class->properties
6431         are never NULL in the generics case.
6432
6433         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
6434
6435 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
6436
6437         * metadata.c (free_generic_class): Disable some code to fix the build.
6438
6439         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
6440
6441         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
6442         from the image mempool.
6443
6444         * metadata.c (free_generic_class): Free more data from the inflated class.
6445
6446         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
6447
6448         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
6449         mempool.
6450         (mono_type_create_from_typespec): Ditto.
6451
6452         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
6453         MonoImage to the caller.
6454         (mono_init_internal): Save the opened image in a global variable.
6455         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
6456
6457         * reflection.c (resolve_object): Fix a leak.
6458
6459         * metadata.c: Fix the freeing of data in the generics caches.
6460         
6461         * metadata.c (free_generic_inst): Comment this out to fix the build.
6462         (free_generic_class): Ditto.
6463
6464         * metadata.c: Free cached generic methods, instantinations and classes when
6465         they are removed from the caches.
6466         (mono_metadata_free_type): Free the type itself.
6467
6468         * class.c: Free the result of mono_class_inflate_generic_type () in a few
6469         places.
6470
6471 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
6472
6473         * boehm-gc.c: restrict managed allocs to __thread supporting
6474         architectures.
6475
6476 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
6477
6478         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
6479         (mono_generic_class_get_class): Fix a leak.
6480
6481         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
6482         mono_metadata_free_type ().
6483         (mono_metadata_inflate_generic_inst): Fix a leak.
6484
6485 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
6486
6487         * mono-debug.c (free_header_data): Fix a leak missed earlier.
6488
6489         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
6490         mempool.
6491
6492         * mono-debug.c (mono_debug_close_image): Fix call to 
6493         g_hash_table_remove ().
6494
6495 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
6496
6497         * icall-def.h: redirect all the string ctor to the managed
6498         CreateString () methods.
6499         * string-icalls.c, string-icalls.h: removed dead code for string
6500         ctors and icalls.
6501
6502 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
6503
6504         * mono-debug.c: Fix memory leaks.
6505
6506 2007-09-14  Jonathan Chambers <joncham@gmail.com>
6507
6508         * threads-types.h: Implement mono_hazard_pointer_set and 
6509         mono_hazard_pointer_clear macros using do/while(0) to fix
6510         compilation with MSVC.
6511         
6512         Code is contributed under MIT/X11 license.
6513
6514 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
6515
6516         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
6517         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
6518
6519 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6520
6521         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
6522         icalls.
6523
6524 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
6525
6526         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
6527         managed-code allocated as well.
6528
6529 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
6530
6531         * class.c (mono_class_is_assignable_from): Add support for generic variance.
6532
6533 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
6534
6535         * boehm-gc.c: fixed the build after the AOT changes.
6536
6537 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
6538
6539         * wrapper-types.h: Add an ALLOC wrapper type.
6540
6541         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
6542         reference managed allocator methods.
6543
6544 2007-09-12  Marek Safar  <marek.safar@gmail.com>
6545
6546         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
6547         of Type array and not MonoType, a fix suggested by Hari.
6548         
6549 2007-09-12  Jonathan Chambers <joncham@gmail.com>
6550
6551         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
6552         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
6553         
6554         Code is contributed under MIT/X11 license.
6555
6556 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
6557
6558         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
6559
6560 2007-09-12  Marek Habersack  <mhabersack@novell.com>
6561
6562         * image.c (do_mono_image_open): if assembly file fails to open and
6563         MONO_IOMAP is in effect, try to find the path in a
6564         case-insensitive way.
6565
6566         * appdomain.c (mono_runtime_init): do not install postload hooks -
6567         tests show that MS.NET doesn't use anything of that sort to
6568         trigger the AppDomain.AssemblyResolve event.
6569         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
6570         made non-static.
6571         (mono_runtime_init): init portability helpers here.
6572
6573         * assembly.c (mono_assembly_load_with_partial_name): if other   
6574         attempts fail, trigger the AppDomain.AssemblyResolve event handler
6575         to resolve the assembly.
6576
6577         * domain-internals.h: added mono_try_assembly_resolve and marked
6578         it as internal.
6579
6580 2007-09-11  Jb Evain  <jbevain@novell.com>
6581
6582         * object-internals.h (MonoReflectionDynamicMethod): add
6583         a `MonoReflectionType *owner` field. The owner is used
6584         * reflection.c:
6585         (mono_reflection_create_dynamic_method): use the owner of the dynamic
6586         method as the class declaring the dynamic method.
6587         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
6588         dynamic method to the declaring type of the methodbuilder.
6589
6590 2007-09-11  Mark Probst  <mark.probst@gmail.com>
6591
6592         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
6593         rules for calling methods via reflection.
6594
6595 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
6596
6597         * reflection.c (resolve_object): Add support for MonoGenericClass. 
6598         Inflate MonoType's.
6599
6600 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
6601
6602         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
6603         provide a managed method that does fast allocations without needing
6604         a managed->unmanaged transition. Boehm GC implementation currently
6605         enabled for ptrfree objects on sane architectures.
6606
6607 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
6608
6609         * marshal.c, marshal.h: exported a couple of useful functions and
6610         added mono_mb_get_label () to easily handle backward branches.
6611
6612 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
6613
6614         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
6615
6616 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
6617
6618         * loader.c (find_method): Fixed the regression introduced while
6619         fixing bug #81466.
6620
6621 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
6622
6623         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
6624         well.
6625         
6626         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
6627         icall.c reflection.c: Pass a MonoGenericContext argument to 
6628         mono_lookup_dynamic_token ().
6629
6630         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
6631         #82744.
6632         
6633 2007-09-09  Robert Jordan  <robertj@gmx.net>
6634
6635         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
6636         for generic methods.
6637
6638         * object.c (mono_object_get_virtual_method): Handle generic methods.
6639         Fixes bug #78882.
6640
6641         Code is contributed under MIT/X11 license.
6642
6643 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
6644
6645         * image.c: fix locking in mono_image_load_file_for_image ().
6646
6647 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
6648
6649         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
6650         used only as a cache: added an icall to fill it.
6651
6652 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
6653
6654         * reflection.h: exposed mono_reflection_free_type_info
6655         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
6656         since mono_reflection_bind_generic_parameters makes a copy of it.
6657         * reflection.c (free_type_info): subinfos should be freed.
6658         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
6659         made non static.
6660         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
6661         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
6662         this fixes #82695 and #81726.
6663    
6664
6665 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
6666
6667         * process.h, process.c:  added support for user profile/info in
6668           ProcessStartInfo. For now only Windows works.
6669
6670 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
6671
6672         * metadata.c: consider the generic arguments when comparing
6673         signatures (bug #82614).
6674
6675 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6676
6677         * cil-coff.h, image.c: updated assembly loader to cope with the
6678         PE32+ 64 bit file format.
6679
6680 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
6681
6682         * assembly.c, class.c, domain.c, loader.c: remove useless
6683         inclusion of cil-coff.h.
6684
6685 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
6686
6687         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
6688         if interface is marked with CoClassAttribute. 
6689    
6690         Code is contributed under MIT/X11 license.
6691
6692 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
6693
6694         * sgen-gc.c: ensure no object from the to space is copied again or finalized
6695         if it's seen twice in major collections.
6696
6697 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
6698
6699         * sgen-gc.c: big objects are not copied to the gray area, but they
6700         need to be considered for scanning, too, if they are brought alive
6701         by an object ready for finalizations or a survived one.
6702
6703 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
6704
6705         * sgen-gc.c: properly account the number of disappearing links when
6706         they are nullified.
6707
6708 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
6709
6710         * sgen-gc.c: share the code to scan the registered roots between the
6711         different types of collections.
6712
6713 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
6714
6715         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
6716
6717 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
6718
6719         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
6720         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
6721
6722 2007-08-28  Mark Probst  <mark.probst@gmail.com>
6723
6724         * security-manager.c (mono_security_manager_get_methods):
6725         LinkDemandSecurityException now has 2 arguments instead of 3.
6726
6727 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
6728
6729         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
6730         platforms which need it.
6731
6732 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
6733
6734         * sgen-gc.c: unregister thread data structures with a pthread_key_t
6735         dtor.
6736
6737 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
6738
6739         * threads.c: free the thread static data on thread exit.
6740
6741 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
6742
6743         * class.c: walk the hierarchy to find the generic definition for
6744         a class (fixes runtime part of bug #82498).
6745
6746 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
6747
6748         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
6749         ...
6750
6751         * image.c (mono_image_close): Here. Hopefully fixes #82510.
6752
6753 2007-08-24  Mark Probst  <mark.probst@gmail.com>
6754
6755         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
6756
6757 2007-08-24  Robert Jordan  <robertj@gmx.net>
6758
6759         * appdomain.c: don't perform the ':'->';' substitution on Win32.
6760
6761 2007-08-24  Jb Evain  <jbevain@novell.com>
6762
6763         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
6764         for byref types.
6765
6766 2007-08-24  Mark Probst  <mark.probst@gmail.com>
6767
6768         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
6769         #82286.
6770
6771 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
6772
6773         * assembly.c: Fix a warning.
6774         
6775 2007-08-23  Marek Habersack  <mhabersack@novell.com>
6776
6777         * appdomain.c: parse the <runtime> section looking for the probing
6778         element with the 'privatePath' attribute, which sets additional
6779         directories in which the runtime should look for assemblies.
6780
6781 2007-08-23  Robert Jordan  <robertj@gmx.net>
6782
6783         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
6784         Fixes #82499.
6785
6786 2007-08-23  Martin Baulig  <martin@ximian.com>
6787
6788         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
6789         _mono_debug_init_corlib() and remove it from the header file.
6790
6791 2007-08-23  Martin Baulig  <martin@ximian.com>
6792
6793         * mono-debug-debugger.c
6794         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
6795         don't notify the debugger about it.
6796
6797         * mono-debug-debugger.h
6798         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
6799
6800 2007-08-23  Robert Jordan  <robertj@gmx.net>
6801
6802         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
6803         Code is contributed under MIT/X11 license.
6804
6805 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
6806
6807         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
6808
6809 2007-08-22  Martin Baulig  <martin@ximian.com>
6810
6811         * mono-debug.c: Store debugging info on a per-domain basis and
6812         free it on domain unload.  Add support for unloading symbol files.
6813
6814         * mono-debug.h
6815         (MonoDebugList): New typedef.
6816         (MonoSymbolTable):
6817         - add `data_tables and `type_table'.
6818         - replace 'symbol_files' and `num_symbol_files' with a
6819           `MonoDebugList *'.
6820         (mono_debug_data_table): Removed.
6821         (mono_debug_list_add): New public function.
6822         (mono_debug_list_remove): New public function.
6823         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
6824         (mono_debug_init_2_memory): Renamed into
6825         mono_debug_open_image_from_memory().
6826         (mono_debug_close_image): New public function.
6827         (mono_debug_domain_create): Likewise.
6828         (mono_debug_domain_unload): Likewise.
6829         (MONO_DEBUGGER_VERSION): Bump to 60.
6830
6831         * mono-debug-debugger.h
6832         (MonoDebuggerEvent):
6833         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
6834         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
6835         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
6836         - rename `THREAD_CREATED' and `THREAD_EXITED' into
6837           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
6838         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
6839           meaning.
6840         (mono_debugger_add_symbol_file): Removed.
6841         (mono_debugger_add_type): Removed.
6842         (mono_debugger_lookup_type): Removed.
6843         (mono_debugger_lookup_assembly): Removed.
6844
6845         * domain.c
6846         (mono_domain_create): Call mono_debug_domain_create().
6847         (mono_init_internal): Call mono_debug_init_corlib().
6848
6849         * assembly.c
6850         (mono_assembly_close): Call mono_debug_close_image().
6851
6852 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
6853
6854         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
6855         mmap call.
6856
6857 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
6858
6859         * sgen-gc.c: ensure section->pin_queue_end is initialized
6860         correctly when non pinning objects in the section have been found.
6861
6862 2007-08-22  Marek Habersack  <mhabersack@novell.com>
6863
6864         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
6865         containing a list of directories separated by ':'. MSDN docs say
6866         the directories should be separated with ';'. Part of a bugfix for
6867         bug #81446
6868
6869 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
6870
6871         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
6872         it should MonoType and not MonoClass.
6873
6874 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
6875
6876         * culture-info-table.h : regenerated.
6877
6878 2007-08-20  William Holmes  <billholmes54@gmail.com>
6879
6880         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
6881          to call ReplaceFile Kernel32 on windows or in io-layer.
6882         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
6883         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
6884          as an internal call.
6885
6886         Code is contributed under MIT/X11 license.
6887
6888 2007-08-20  Jb Evain  <jbevain@novell.com>
6889
6890         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
6891         and MONO_EXCEPTION_FIELD_ACCESS.
6892
6893         * debug-helpers.[c|h]: new mono_field_full_name function.
6894
6895 2007-08-20  Mark Probst  <mark.probst@gmail.com>
6896
6897         * class.c: Removed class_security_level() and moved it to
6898         security-core-clr.c.
6899
6900         * security-core-clr.c, security-core-clr.h: class_security_level()
6901         is now public and renamed to mono_security_core_clr_class_level().
6902         It also looks for security attributes in the classes a class is
6903         nested in.
6904
6905 2007-08-20  Mark Probst  <mark.probst@gmail.com>
6906
6907         * security-core-clr.c, security-core-clr.h: CoreCLR security
6908         utility functions.
6909
6910         * Makefile.am: Added security-core-clr.[ch].
6911
6912         * security-manager.c, security-manager.h: Functions and enum for
6913         setting and getting the security mode.
6914
6915         * class.c: CoreCLR security checks.
6916
6917 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
6918
6919         * icall-def.h, process.c, process.h: implemented icall to get
6920         user/system processor times.
6921
6922 2007-08-17  Mark Probst  <mark.probst@gmail.com>
6923
6924         * domain.c, threads.c, class-internals.h, domain-internals.h: New
6925         reader-lock-free jit_info_table.
6926
6927 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
6928
6929         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
6930
6931         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
6932
6933         * object-internals.h (MonoException): Add missing _data member.
6934
6935 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
6936
6937         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
6938         checking that only methods with matching qname or fqname are picked
6939         from implemented interfaces.
6940
6941 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6942
6943         * verify.c (do_newarr):added, do type verification of
6944         newarr ops, push the right value on the eval stack.
6945         * verify.c (mono_method_verify): use do_newarr
6946
6947
6948 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6949
6950         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
6951         factored the common code into get_boxable_mono_type, which
6952         is now using mono_type_get_full, this fixed byref related tests.
6953
6954 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
6955
6956         * class.c: added mono_type_get_full, this function has the same
6957         behavior of mono_class_get_full but the returned MonoType has
6958         all metadata of the associated token in case of a typespec token.
6959         * class.c: added mono_type_retrieve_from_typespec, used by 
6960         mono_type_get_full to retrieve the token type.
6961         * class.c (mono_class_create_from_typespec): changed to use
6962         mono_type_retrieve_from_typespec.
6963         * class.c (mono_ldtoken): changed to use mono_type_get_full
6964         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
6965         * class-internals.h: exported mono_type_get_full for internal use.
6966
6967 2007-08-16  Jb Evain  <jbevain@novell.com>
6968
6969         * domain.c (supported_runtimes): add entry for
6970         the 'moonlight' runtime version.
6971
6972 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6973
6974         * verify.c (mono_method_verify): small typo sliped in.  
6975
6976 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6977
6978         * verify.c (do_unbox_value): added, do type verification of
6979         unboxing ops
6980         * verify.c (mono_method_verify): use do_unbox_value
6981
6982
6983 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
6984
6985         * verify.c (dump_stack_value): fixed typo, was printing string
6986         instead of object on stack.
6987         * verify.c (do_box_value): moved the byref check up as it leads
6988         to invalid code and should be done earlier.
6989         * verify.c: improved error messages for and ldobj
6990
6991 2007-08-15  William Holmes  <billholmes54@gmail.com>
6992
6993         * marshal.c (emit_marshal_custom): Omit the call to 
6994           marshal_native_to_managed when calling native to managed 
6995           and the argument is specified as an out argument.
6996
6997         Code is contributed under MIT/X11 license.
6998
6999 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
7000
7001         * verify.c: fixed the type checks for generics, function pointers and vectors.
7002         Added type verification for ldobj and ldtoken. The verifier
7003         would segfault if header or signature of a method contained references
7004         to non-existant types.
7005
7006 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7007
7008         * marshal.c (cominterop_get_ccw): Patch from
7009         Bill Holmes to no walk up interface hierarchy. 
7010         All parent methods should be present in the interface for COM.
7011    
7012         Code is contributed under MIT/X11 license.
7013
7014 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
7015
7016         * marshal.c (emit_marshal_com_interface): Patch from
7017         Bill Holmes to handle COM Interfaces as return values
7018         for native->managed calls.
7019    
7020         Code is contributed under MIT/X11 license.
7021
7022 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
7023
7024         * marshal.c (cominterop_get_idispatch_for_object): Implement
7025         for runtime callable wrappers.
7026    
7027         Code is contributed under MIT/X11 license.
7028
7029 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
7030
7031         * pedump.c (main): changed from mono_init to mono_init_from_assembly
7032         so 2.0 types are accessible
7033
7034
7035 2007-08-13  Miguel de Icaza  <miguel@novell.com>
7036
7037         * domain.c (mono_init_internal): Call mono_assembly_load_friends
7038         once we load mscorlib.   Due to the order in which we initialize,
7039         the mono_assembly_load_full routine that loads mscorlib did not
7040         load friends.   We now load it once we load the
7041         mono_defaults.internals_visible_class class. 
7042
7043         * assembly.c: Expose the mono_load_friend_assemblies method.
7044
7045 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
7046
7047         * verify.c: improved the handling of boxing, better
7048         type checking for unary ops and conversion. Fix bug
7049         regarding managed pointer compatibility checking
7050
7051 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
7052
7053         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
7054
7055         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
7056
7057 2007-08-09  Raja R Harinath  <rharinath@novell.com>
7058
7059         * reflection.c (dup_type): Remove.
7060         * class.c (dup_type): Remove.
7061         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
7062         instead of the dodgy 'dup_type'.
7063         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
7064         handle the case where 'dup_type' needed the second argument.
7065
7066 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
7067
7068         * domain.c: Fix a warning.
7069
7070 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
7071
7072         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
7073         checking that methods with the same fqname are not overridden
7074         with a method from an ancestor.
7075
7076 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
7077
7078         * threads.c (free_thread_static_data_helper): Avoid a crash if
7079         thread->static_data is not yet set.
7080
7081 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
7082
7083         * marshal.c: Use correct image when emitting
7084         native wrapper for COM calls.
7085    
7086         Code is contributed under MIT/X11 license.
7087
7088 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
7089
7090         * icall-def.h, security.c, security.h :
7091           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
7092
7093 2007-08-07  Martin Baulig  <martin@ximian.com>
7094
7095         * mono-debug-debugger.h
7096         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
7097
7098         * domain.c (mono_domain_free): Call
7099         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
7100
7101 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
7102
7103         * verify.c (check_underflow, check_overflow): error message now returns IL offset
7104         * verify.c (in_same_block): code should test if either offset is inside the clauses
7105         * verify.c (mono_method_verify): push the exception into the eval stack of exception
7106         and filter blocks
7107
7108 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
7109
7110         * image.c (mono_image_close): Fix a leak.
7111
7112         * object.c (mono_runtime_invoke_array): Avoid using alloca.
7113
7114         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
7115
7116 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
7117
7118         * domain.c, threads.c, threads-types.h: fix memory retention issue
7119         with thread static variables not being cleared on domain unload.
7120         Reuse thread static slots after domain unload.
7121
7122 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
7123
7124         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
7125         nullable type.
7126
7127         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
7128         now done in mono_runtime_invoke_array.
7129
7130         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
7131         receiver is a nullable type.
7132
7133         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
7134         generic parameter.
7135
7136 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
7137
7138         * marshal.c: Implement COM Objects as return type for 
7139         managed->unmanaged calls. Added Release calls for COM Object
7140         out/return values in managed->unmanaged calls.
7141
7142         Code is contributed under MIT/X11 license.
7143
7144 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
7145
7146         * threads.h, threads-type.h: move the hazard pointer declarations
7147         to the private header.
7148
7149 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
7150
7151         * file-io.c, appdomain.c: memory leak fixes.
7152
7153 2007-08-02  Dick Porter  <dick@ximian.com>
7154
7155         * socket-io.c
7156         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
7157         SO_REUSEADDR setting into io-layer/sockets.c.
7158
7159 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
7160
7161         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
7162         from Object when called on a generic parameter. Fixes #82211.
7163
7164 2007-08-01  Dick Porter  <dick@ximian.com>
7165
7166         * file-io.c (convert_share): Test FileShare values bit-by-bit.
7167         Fixes bug 79250 yet again.
7168
7169 2007-07-30  Martin Baulig  <martin@ximian.com>
7170
7171         Merged the `debugger-dublin' branch.
7172
7173         * mono-debug.h
7174         (MonoDebugDataTable): New typedef.
7175         (MonoDebugMethodAddressList): New typedef.
7176         (MonoDebugWrapperData): Removed.
7177         (MonoDebugSymbolTable): Removed `current_data_table',
7178         `current_data_table_size', `current_data_table_offset'.
7179         (MonoDebugDataItemType): Moved into mono-debug.c.
7180         (MonoDebugMethodJitInfo): Remove `address'.
7181         (mono_debug_data_table): New global variable.
7182         (mono_debug_lookup_method_addresses): New public function.
7183         (mono_debug_find_method): Take a `MonoMethod *', not a
7184         `MonoDebugMethodInfo *'.
7185
7186         * mono-debug.c: Drop support for the old symbol tables.
7187
7188 2007-06-28  Martin Baulig  <martin@ximian.com>
7189
7190         * mono-debug.c (mono_debug_debugger_version): New public variable.
7191
7192 2007-07-31  William Holmes  <billholmes54@gmail.com>
7193
7194         * metadata.c Changed mono_type_create_from_typespec to not insert
7195           the type into the hash map until after
7196           do_mono_metadata_parse_type has completed.
7197         Fixes Bug #82194
7198         Code is contributed under MIT/X11 license.
7199
7200 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
7201
7202         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
7203         generic parameter. Fixes #82211.
7204
7205 2007-07-27  Jb Evain  <jbevain@novell.com>
7206
7207         * pedump.c (dump_metadata, dump_metadata_header): dump
7208         versions contained in the metadata header.
7209
7210 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
7211
7212         * threads.c: register small_id_table with the GC.
7213
7214 2007-07-27  Mark Probst  <mark.probst@gmail.com>
7215
7216         * threads.c, threads.h, class-internals.h, object-internals.h:
7217         Hazard pointers, to be used by lock-free parallel algorithms.
7218
7219 2007-07-26  Dick Porter  <dick@ximian.com>
7220
7221         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
7222         routine on non-windows platforms, as I've not managed to think of
7223         a non-kludgy way of doing this.  Finishes off bug 78739.
7224
7225 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
7226
7227         * object.c: properly setup interface_bitmap in proxy vtables.
7228
7229 2007-07-25  Marek Habersack  <mhabersack@novell.com>
7230
7231         * appdomain.c (get_shadow_assembly_location): do not use TickCount
7232         to create unique shadow copy target directories, use the domain's
7233         serial number instead. Each domain gets a unique target directory
7234         that way.
7235
7236         * domain.c (mono_domain_create): added code to increment domain
7237         shadow copy serial number and cache the value in the current
7238         domain structure.
7239
7240         * domain-internals.h (struct _MonoDomain): added a new field -
7241         shadow_serial to hold the serial number used in generation of
7242         shadow-copy directories. This is to make sure that the directory
7243         name is unique for each and every domain created. We avoid a race
7244         condition with overriding assemblies already in use by other app
7245         domains.
7246
7247 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
7248
7249         * class.c (mono_bounded_array_class_get): fixed memory leak when 
7250         binding generic parameters.
7251
7252 2007-07-24  Raja R Harinath  <rharinath@novell.com>
7253
7254         * metadata.c (do_mono_metadata_parse_generic_class): Use
7255         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
7256         error.
7257
7258 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
7259
7260         * loader.c, class-internals.h, reflection.c: removed the per-method
7261         generics hashtable: we use the global one through the call of
7262         mono_class_inflate_generic_method ().
7263
7264 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
7265
7266         * class.c, metadata.c, class-internals.h: introduce yet another
7267         generics global cache for inflated methods (fixes 98% of the perf
7268         issue in bug #81806).
7269
7270 2007-07-23  Raja R Harinath  <rharinath@novell.com>
7271
7272         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
7273         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
7274         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
7275         return a MonoGenericInst containing (a copy) of those types.
7276         (mono_metadata_inflate_generic_inst): Update to changes.
7277         (mono_metadata_parse_generic_inst): Likewise.
7278         (mono_get_shared_generic_inst): Likewise.
7279         * reflection.c (mono_class_bind_generic_parameters): Likewise.
7280         (mono_reflection_bind_generic_method_parameters): Likewise.
7281         * metadata-internals.h: Likewise.
7282         * icall.c (free_generic_context): Kill.
7283         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
7284
7285         * reflection.c (reflection_methodbuilder_to_mono_method): Use
7286         mono_metadata_type_dup.
7287         * marshal.c (mono_mb_create_method): Likewise.
7288
7289         * metadata.c (mono_metadata_type_dup): Rename from
7290         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
7291         MonoImage.  Handle a few more cases, esp. when no mempool is given.
7292         * marshal.c, metadata-internals.h: Update to changes.
7293
7294 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
7295
7296         * class.c: fixed a small leak for array classes and removed warning.
7297
7298 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
7299
7300         * loader.c (mono_method_get_param_token): Make this work on generic methods.
7301         Return 0x8000000 for return parameters. Fixes #82161.
7302
7303 2007-07-21  Marek Habersack  <grendello@gmail.com>
7304
7305         * appdomain.c (get_shadow_assembly_location): append the current
7306         ticks value to the path. Avoids overwriting the same assemblies by
7307         several threads at the same time.
7308
7309 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
7310         and Raja R Harinath  <rharinath@novell.com>
7311
7312         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
7313         Simplify slightly.
7314         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
7315         property for testing if a method is a generic method definition.
7316
7317 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
7318
7319         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
7320
7321 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
7322
7323         * verify.c: used function from private branch, reverted to the one in class.h 
7324
7325 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
7326
7327         * verify.c: a typo slipped in and the code wont compile
7328
7329 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
7330
7331         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
7332         disabled box instruction as it is doing the wrong thing
7333         improved stack dump messages, now it is easier to debug type related issues
7334
7335
7336 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
7337
7338         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
7339
7340 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
7341
7342         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
7343         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
7344         grouped with class and valuetype. This change will simply 
7345         the code as it should be handled just like unmanaged pointers.
7346
7347 2007-07-19  Mark Probst  <mark.probst@gmail.com>
7348
7349         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
7350
7351 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
7352
7353         * verify.c: several stack merge issues fixed, reference comparisons now
7354         check the type size. strict type check now works correctly.
7355         added more uses of IS_MANAGED_POINTER macro.
7356         fixed issues pointed by running the test suite against .net.
7357         
7358
7359 2007-07-19  Mark Probst  <mark.probst@gmail.com>
7360
7361         * class.c, loader.c, class-internals.h: Removed the
7362         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
7363         defines.
7364
7365         * icall.c: Better error checking in some internal reflection
7366         methods.
7367
7368 2007-07-18  William Holmes  <billholmes54@gmail.com>
7369
7370         * filewatcher.c : removed unused variable 'filename' in 
7371           ves_icall_System_IO_FSW_SupportsFSW
7372
7373 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
7374
7375         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
7376         obsolete, removed.
7377
7378 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
7379
7380         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
7381         
7382         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
7383
7384 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
7385
7386         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
7387         Implement generics support.
7388         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
7389
7390         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
7391         type_args and method_args arguments.
7392         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
7393         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
7394         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
7395
7396 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
7397
7398         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
7399           It adds a rootimage parameter to mono_reflection_get_type_internal,
7400           adds new function mono_reflection_get_type_with_rootimage and use
7401           the rootimage to resolve the types instead of the current image
7402
7403 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
7404
7405         * culture-info-table.h: Forgot to update after r78304.
7406
7407 2007-07-13  Raja R Harinath  <rharinath@novell.com>
7408
7409         * class.c (mono_class_is_open_constructed_type)
7410         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
7411
7412 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
7413
7414         * class.c (mono_bounded_array_class_get):  method fails if used with
7415         an incomplete TypeBuilder enum (no basetype field), fixed it by 
7416         avoiding calculating the size for such array as it cannot be instantiated.
7417         Fix bug #82015
7418
7419 2007-07-12  Raja R Harinath  <rharinath@novell.com>
7420
7421         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
7422         field.
7423         * metadata.c, reflection.c: Update to changes.
7424
7425 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
7426
7427         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
7428         mono_class_is_valid_enum, they are used to valide a enum when loading.
7429         * reflection.c: used new functions to throw TypeLoadException when and
7430         invalid enum is build with TypeBuilder. Fixes #82018
7431   
7432 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
7433
7434         * object.c: forgot commit of mono_class_setup_methods () to access
7435         iface->methods.
7436         * object-internals.h: added a few more handy fields to
7437         MonoIMTCheckItem.
7438
7439 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
7440
7441         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
7442         iface->methods.
7443
7444 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
7445
7446         * class-internals.h, object-internals.h, object.c: IMT-based
7447         interface invocation core from Massimiliano Mantione
7448         (massi@ximian.com) with a reworked arch-specific interface,
7449         bsearch implementation and a few bugfixes and memory savings by me.
7450
7451 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
7452
7453         * class.c (mono_class_create_from_typedef): mono would segfault if 
7454         an enum did not have a __value field. It now throws a TypeLoadException
7455         for such cases. Fix bug #82022
7456
7457 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
7458
7459         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
7460
7461 2007-07-09  Mark Probst  <mark.probst@gmail.com>
7462
7463         * class.c (mono_class_init): If a class is already inited but has
7464         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
7465
7466 2007-07-09  Mark Probst  <mark.probst@gmail.com>
7467
7468         * class.c: Properly handle the case of an unimplemented interface
7469         method.  Fixes: 81673.
7470
7471 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
7472
7473         * class-internals.h, object.c: cleanup patch from massi: use
7474         MonoVTable->interface_bitmap since the vtable interfaces offset array
7475         is going away.
7476
7477 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
7478
7479         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
7480         GetMDStreamVersion icall instead.
7481
7482 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
7483
7484         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
7485         not use mono_dl_build_path() with a full library name: makes
7486         fallbacks to libgaim and libfam work.
7487
7488 2007-07-06  William Holmes  <billholmes54@gmail.com>
7489
7490         * assembly.c: Added a continue statement in probe_for_partial_name when
7491          parse_assembly_directory_name fails.  Fixes : 82002
7492
7493 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
7494
7495         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
7496         and added a verification  for TYPEDBYREF.
7497         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
7498         make native int interchangeable with int32 and some small cleanup and formating.
7499         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
7500         handle byref of byref.
7501         * verify.c (push_local): handle byref of byref.
7502         * verify.c (do_binop): invalid mix of values is unverifiable
7503         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
7504         added visibility checks
7505         * verify.c (field related method): added visibility checks
7506         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
7507
7508 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
7509
7510         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
7511         string.
7512
7513 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
7514
7515         * profiler.c (mono_profiler_load): Fix an off-by-one error.
7516
7517         * marshal.c (emit_marshal_string): When returning a string from managed code,
7518         allways make a copy even for unicode strings. Fixes #81990.
7519
7520 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
7521
7522         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
7523         of byref generic inst types (bug #81997).
7524
7525 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
7526
7527         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
7528         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
7529
7530 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
7531
7532         * marshal.c (emit_marshal_string): Add support for unicode strings in
7533         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
7534
7535 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
7536
7537         * verify.c: field load/store are now verified, missing only access checks now
7538
7539 2007-06-28  Martin Baulig  <martin@ximian.com>
7540
7541         * mono-debug.c (mono_debug_debugger_version): New public variable.
7542
7543 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
7544
7545         * locales.c: When constructing DateTimeFormat or NumberFormat for
7546         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
7547         MonoCultureInfo contructed from the current locale is always
7548         read-only and has UseUserOverride set to true. All MonoCultureInfo
7549         instances returned for GetCultures have both IsReadOnly and
7550         UseUserOverride set to true. Fixes part of bug #81930.
7551
7552 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
7553
7554        * icall-def.h: Update System.__ComObject icalls
7555        * marshal.c: Avoid managed transition (and object creation)
7556        when looking up COM interface in RCW.
7557        * marshal.h: Ditto.
7558        
7559        Code is contributed under MIT/X11 license.
7560
7561 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
7562
7563         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
7564         to avoid crashes during assembly unloading.
7565
7566 2007-06-22  Raja R Harinath  <rharinath@novell.com>
7567
7568         Fix MethodInfo.IsGenericMethodDefinition
7569         * reflection.c (mono_reflection_bind_generic_method_parameters):
7570         Rearrange code to ensure we always uses a generic method definition.
7571         * class.c (mono_class_inflate_generic_method_full): Set
7572         'generic_container' field only for generic method definitions.
7573         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
7574         Use presense of 'generic_container' field as indication of being a
7575         generic method definition.
7576
7577 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
7578
7579         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7580
7581         * object-internals.h: Reflect changes in the layout of the managed Delegate
7582         class.
7583         
7584         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
7585         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
7586         runtime memory used by the dynamic method. Fixes #77146.
7587
7588 2007-06-21  Dick Porter  <dick@ximian.com>
7589
7590         * file-io.h: 
7591         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
7592         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
7593         81767.
7594
7595 2007-06-21  Raja R Harinath  <rharinath@novell.com>
7596
7597         * reflection.c (method_encode_methodspec): Add a tripwire.
7598         * class.c (inflate_generic_type): The fully open generic type is
7599         not the same as the generic type definition.
7600
7601 2007-06-21  Martin Baulig  <martin@ximian.com>
7602
7603         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
7604
7605         * mono-debug-debugger.h
7606         (MonoDebuggerBreakpointInfo): Removed.
7607         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
7608         (mono_debugger_remove_breakpoint): Likewise.
7609         (mono_debugger_breakpoint_callback): Likewise.
7610         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
7611
7612 2007-06-21  Raja R Harinath  <rharinath@novell.com>
7613
7614         * metadata.c (mono_metadata_lookup_generic_class): The fully open
7615         generic type is not the same as the generic type definition.
7616         * class.c (mono_generic_class_get_class): Likewise.
7617
7618 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
7619
7620         * icall.c: The second argument to 
7621         System.Reflection.MethodBase.GetMethodFromHandleInternalType
7622         is a MonoType not a MonoClass.
7623
7624 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
7625
7626         * verify.c: support for function pointers in the verifier
7627
7628 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
7629
7630         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
7631
7632 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
7633
7634         * assembly.c: removed Mono.Data.SqliteClient from the list of
7635         forward-compatible assemblies as it breaks the ABI (bug #81899).
7636
7637 2007-06-19  Raja R Harinath  <rharinath@novell.com>
7638
7639         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
7640         lookup/update with the loader lock.
7641         * reflection.c (mono_class_bind_generic_parameters): No need to
7642         protect mono_metadata_lookup_* with the loader lock.
7643         * class.c (inflate_generic_type): Likewise.
7644         
7645         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
7646         on a generic instantiated type.
7647
7648 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
7649
7650         *verify.c: produce meanfull error messages on verification error
7651         *verify.c: fixed some cases of verification errors reported as validation errors
7652         *pedump.c: fixed the error name array, now it shows validation errors properly
7653         *verify.h: fixed the contant that should be used for verification errors
7654
7655 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
7656
7657         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
7658         for bug #77596, 81858 and 80743 (generics data structures on domain
7659         unload).
7660
7661 2007-06-15  Raja R Harinath  <rharinath@novell.com>
7662
7663         Avoid allocating 'MonoGenericContext' on the heap.
7664         * class-internals (_MonoMethodInflated::context): Make field
7665         inline, not a pointer.
7666         * loader.c (method_from_methodspec): Allocate 'new_context' on the
7667         stack.  Use the context embedded within the inflated method as the
7668         hash key, rather than 'new_context'.
7669         * class.c (inflate_generic_context): Simplify.  Return a struct
7670         rather than allocating on the heap.
7671         (mono_class_inflate_generic_method_full): Update to changes.  Now,
7672         doesn't salt away a copy of the context -- simplifying the
7673         lifetime rules of a 'MonoGenericContext *'.
7674         (mono_method_get_context): Return pointer to embedded context.
7675         (setup_generic_array_ifaces): Allocate temporary context on stack.
7676         * reflection.c (inflate_mono_method): Likewise.
7677         (mono_reflection_bind_generic_method_parameters): Likewise.
7678         Use the context embedded within the inflated method as the hash key.
7679
7680         Avoid a source of allocation of 'MonoGenericContext'.
7681         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
7682         and 'cached_context' fields into embedded 'MonoGenericContext' field.
7683         * class.c: Update to changes.
7684         (mono_generic_class_get_context): Simplify drastically.  Now just
7685         returns a pointer to the field.
7686         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
7687         argument as a const pointer.
7688         (mono_metadata_generic_context_equal): Likewise.
7689         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
7690         Update to changes.
7691
7692 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
7693
7694         * verify.c improved the handling of brtrue/brfalse, factored out common code
7695
7696 2007-06-14  Raja R Harinath  <rharinath@novell.com>
7697
7698         Kill MonoGenericMethod.
7699         * class-internals.h (MonoGenericContext::method_inst): Rename from
7700         'gmethod' and convert to a MonoGenericInst.
7701         (MonoGenericMethod): Remove.
7702         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
7703         * loader.c (method_from_methodspec): Update to changes.  Use a
7704         MonoGenericContext as the key to the hashtable.
7705         * metadata.c (mono_metadata_generic_context_equal): Rename from 
7706         'mono_metadata_generic_method_equal' and take MonoGenericContext.
7707         (mono_metadata_generic_context_hash): Likewise from
7708         'mono_metadata_generic_method_hash'.  Change hash function.
7709         (mono_metadata_load_generic_params): Update to changes.
7710         (mono_get_shared_generic_method): Remove.
7711         * metadata-internals.h (mono_get_shared_generic_method): Remove.
7712         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
7713         (inflate_generic_context): Likewise.
7714         (mono_class_inflate_generic_method_full): Likewise.
7715         (setup_generic_array_ifaces): Likewise.
7716         (mono_class_create_from_typespec): Likewise.
7717         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
7718         (method_encode_methodspec): Update callsite.
7719         (reflection_methodbuilder_to_mono_method): Update to changes.
7720         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
7721         MonoGenericContext as the key to the hashtable.
7722         (inflate_mono_method): Update to changes.
7723
7724         * class-internals.h (MonoGenericMethod::container): Remove.
7725         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
7726
7727 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
7728
7729         * profiler-private.h, profiler.c, profiler.h: added API to profile
7730         exception events.
7731
7732 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
7733
7734         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
7735
7736 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
7737
7738         * verify.c: method invocation is now validated, now we verify parameter types on stack.
7739         Fixed overflow and underflow not aborting the verification process.
7740
7741 2007-06-13  Mark Probst  <mark.probst@gmail.com>
7742
7743         * class-internals.h (MonoStats): Added stats entries for dynamic
7744         code allocations.
7745
7746 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
7747
7748         * loader.c (mono_free_method): Free header->locals and header->clauses.
7749
7750         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
7751         dynamic case.
7752
7753         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
7754
7755         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
7756
7757 2007-06-12  Raja R Harinath  <rharinath@novell.com>
7758
7759         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
7760         the tables.
7761
7762 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7763
7764         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
7765
7766 2007-06-11  Raja R Harinath  <harinath@gmail.com>
7767
7768         MonoGenericMethod on a diet
7769         * class-internals.h (_MonoMethodInflated::reflection_info): Move
7770         here ...
7771         (_MonoGenericMethod::reflection_info): ... from here.
7772         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
7773         Update to changes.
7774         * reflection.c (inflate_mono_method): Likewise.
7775         (mono_reflection_bind_generic_method_parameters): Likewise.
7776
7777 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7778
7779         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
7780         *verify.c: factored long ldarg forms to share code with short forms
7781
7782 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
7783
7784         *verify.c: fixed code formating factored some duplicate code
7785         into a new function
7786
7787         *verify.h: fixed binary incompatibility introduced earlier
7788
7789         *pedump.c: fixed formating
7790
7791 2007-06-11  Raja R Harinath  <harinath@gmail.com>
7792
7793         Fix assertion when disassembling Mono.C5.dll
7794         * loader.c (method_from_methodspec): Avoid inflating a method
7795         twice with the same context.  If the methodref is inflated, use
7796         the declaring method instead.
7797
7798         * class.c (mono_class_from_generic_parameter): Fix case similar to
7799         bug #81830 handled below, but for method containers.
7800
7801 2007-06-10  Raja R Harinath  <harinath@gmail.com>
7802
7803         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
7804         get_shared_generic_class.  Directly inflate the instance.
7805         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
7806         (inflate_generic_class): Delete.
7807         (get_shared_generic_class): Delete.  Move setting of
7808         'cached_class' and 'cached_context' ...
7809         * metadata.c (mono_metadata_lookup_generic_class): ... here.
7810
7811         * metadata.c (mono_metadata_lookup_generic_class): Change
7812         signature to take the components of a MonoGenericClass rather than
7813         an allocated MonoGenericClass.  Change semantics to be intern-like.
7814         * reflection.c (mono_class_bind_generic_parameters): Update to
7815         changes.  Make locking region tighter.
7816         * class.c (inflate_generic_class): Update to changes.
7817         (get_shared_generic_class): Likewise.
7818         * metadata-internals.h: Likewise.
7819
7820         * reflection.c (mono_class_bind_generic_parameters): Take and
7821         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
7822         (mono_reflection_bind_generic_parameters): Use
7823         'mono_class_bind_generic_parameters' rather than duplicate the code.
7824         * class.c (mono_bounded_array_class_get): Update to changes.
7825         * object-internals.h: Likewise.
7826
7827         * reflection.c (mono_class_bind_generic_parameters): Only support
7828         parameterizing generic type definitions.  Remove support for other
7829         open types.
7830
7831 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
7832
7833         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
7834
7835         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
7836         in the dynamic case.
7837
7838 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
7839
7840         * threads.c: When cleaning up thread, reset the Background bit.
7841         Fixes bug #81720.
7842
7843 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
7844
7845        * metadata.c: Move variable declarations to top of scope.
7846        * verify.c: Move variable declarations to top of scope.
7847
7848        Code is contributed under MIT/X11 license.
7849
7850 2007-06-08  Raja R Harinath  <rharinath@novell.com>
7851
7852         * reflection.c (mono_class_bind_generic_parameters): Replace
7853         open-coded loop with mono_metadata_inflate_generic_inst.
7854
7855         * class.c (get_shared_generic_class): Don't call
7856         mono_get_shared_generic_inst.  Use the container's own
7857         'class_inst'.
7858
7859         * metadata.c (mono_metadata_load_generic_params): Move
7860         initialization of 'context' field here from ...
7861         * class.c (mono_class_create_from_typedef): ... here, and ...
7862         * loader.c (mono_get_method_from_token): ... here.
7863
7864         * class.c (get_shared_generic_class): Rename from
7865         mono_get_shared_generic_class and make static.
7866         (mono_get_shared_generic_inst): Move to metadata.c.
7867         * loader.c (mono_get_shared_generic_method): Likewise.
7868         * class-internals.h, metadata-internals.h: Update to changes.
7869
7870         Fix #81830
7871         * class.c (mono_class_from_generic_parameter): Don't assume a
7872         generic container owner exists.  Generic containers from monodis
7873         don't have any.
7874
7875 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
7876
7877         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
7878         * verify.h: new typedefs to returns the non-verifiable status
7879         * verify.c: initial implementation of generics, stack merging and object compatibility check
7880
7881 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7882
7883         * class.c, image.c, class-internals.h (MonoImage): class_cache is
7884         a MonoInternalHashTable again (fixed bug in internal hash table
7885         code).
7886
7887 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7888
7889         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
7890         MonoInternalHashTable again (fixed bug in internal hash table
7891         code).
7892
7893 2007-06-06  Mark Probst  <mark.probst@gmail.com>
7894
7895         * class.c, image.c, class-internals.h, domain.c,
7896         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
7897         changes.  Have to figure out what makes them break the SWF
7898         regression.
7899
7900 2007-06-04  Mark Probst  <mark.probst@gmail.com>
7901
7902         * class.c, image.c, class-internals.h (MonoImage): class_cache is
7903         a MonoInternalHashTable now.
7904
7905 2007-06-04  Mark Probst  <mark.probst@gmail.com>
7906
7907         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
7908         MonoInternalHashTable now.
7909
7910 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
7911
7912         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
7913         invoke_impl code.
7914
7915         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
7916
7917         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
7918         dependent trampoline.
7919
7920         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7921
7922         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
7923
7924 2007-05-29  Robert Jordan  <robertj@gmx.net>
7925
7926         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
7927
7928 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
7929
7930         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
7931
7932 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
7933
7934        * marshal.c: Fix interface lookup loops for
7935        cominterop_get_com_slot_for_method and 
7936        cominterop_get_method_interface. Only need to lookup
7937        if type is a class, else use interface type method is on.
7938
7939        Code is contributed under MIT/X11 license.
7940
7941 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
7942
7943         * reflection.c: HasSecurity can be present even if no specially 
7944         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
7945         SecurityAttribute). Fix CAS regression tests on buildbot.
7946
7947 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
7948
7949        * appdomain.c: Add configure checks for header files.
7950        * image.c: Add configure checks for header files.
7951        * file-io.c: Add configure checks for header files.
7952        * debug-mono-symfile.c: Add configure checks for header files.
7953        * threadpool.c: Add configure checks for header files.
7954        * console-io.c: Add configure checks for header files.
7955        * profiler.c: Add configure checks for header files.
7956        * rawbuffer.c: Add configure checks for header files.
7957        * icall.c: Add configure checks for header files.
7958        * rand.c: Add configure checks for header files.
7959        * socket-io.c: Add configure checks for header files.
7960
7961        Code is contributed under MIT/X11 license.
7962
7963 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
7964
7965         * reflection.c (mono_custom_attrs_from_builders): Remove the 
7966         assertion as it breaks the build.
7967         
7968         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
7969
7970         * reflection.c (lookup_custom_attr): Make a copy here too.
7971
7972         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
7973         dynamic images.
7974
7975         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
7976         images.
7977
7978         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
7979         info.
7980
7981 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
7982
7983         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
7984         (load_cattr_value): Ditto.
7985
7986 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
7987
7988         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
7989
7990 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
7991
7992         * threads.c: In "start_wrapper", set apartment_state to MTA if
7993         apartment_state is Unknown and we're running on 2.0 profile or
7994         higher.
7995         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
7996         to main method, then set apartment_state to Unknown on 1.0 profile,
7997         and MTA on 2.0 profile.
7998
7999 2007-05-16  Jb Evain  <jb@nurv.fr>
8000
8001         * class-internals.h (MonoDefaults): Add an attribute_class and
8002           customattribute_data_class.
8003         * domain.c (mono_init_internal): Populate them.
8004         * reflection.c: Use them to remove duplicates. Make a vew
8005         MonoClass variables `static'.
8006
8007 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
8008
8009         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
8010         step in implementing IMT, so that all isinst checks now can go
8011         through the bitmap.
8012         This was needed because vtables for TransparentProxy need to look
8013         like the vtable of the "target" class, so they need to point to
8014         its interface bitmap directly.
8015
8016         * object.c: inside "mono_class_create_runtime_vtable" and
8017         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
8018
8019 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
8020
8021         * object-internals.h
8022           culture-info.h : added territory field in MonoCulture and
8023           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
8024         * locales.c : fill territory field above too.
8025         * culture-info-table.h : regenerated.
8026
8027 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
8028
8029         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
8030         Fixes #81599.
8031
8032 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
8033
8034         * object.c: Always initialize apartment, even if 
8035         there is no custom attributes on entry point.
8036         
8037         Code is contributed under MIT/X11 license.
8038
8039 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
8040
8041         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
8042         * metadata.c: If no encoding is set, check for unicode
8043         on class.
8044         
8045         Code is contributed under MIT/X11 license.
8046
8047 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
8048
8049         * threads.c: Handle if mono_thread_current returns NULL 
8050         
8051         Code is contributed under MIT/X11 license.
8052
8053 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
8054
8055         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
8056         in start_wrapper. Added mono_thread_init_apartment_state and
8057         mono_thread_cleanup_apartment_state.
8058         * object.c: Initialize thread apartment state on main thread
8059         by checking for STAThreadAttribute on entry point.
8060         * object-internals.h: Add apartment_state field to MonoThread.
8061         * threads-types.h: Add unmanaged definition of 
8062         System.Threading.ApartmentState, MonoThreadApartmentState.
8063         
8064         Code is contributed under MIT/X11 license.
8065         
8066 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
8067
8068         * class.c: Fix windows build.
8069         * class-internals.h: Fix windows build.
8070         
8071         Code is contributed under MIT/X11 license.
8072
8073 2007-05-08  Robert Jordan  <robertj@gmx.net>
8074
8075         * process.c (CreateProcess_internal):
8076         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
8077         .CreateNoWindow was specified. Fixes #81496.
8078
8079 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
8080
8081         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
8082         step in implementing IMT, replaced it with two compact arrays
8083         (interfaces_packed and interface_offsets_packed) and a bitmap that
8084         is used for isinst checks (interface_bitmap).
8085
8086         * class.c: (compare_interface_ids): compare function to pass to
8087         bsearch when looking for an interface with a given id.
8088         (mono_class_interface_offset): reimplemented using bsearch on
8089         interfaces_packed, getting the offset from interface_offsets_packed.
8090         (print_implemented_interfaces): utility debugging function.
8091         (setup_interface_offsets): reworked to initialize interfaces_packed,
8092         interface_offsets_packed and interface_bitmap.
8093
8094         * object.c: replaced all accesses to "MonoClass.interface_offsets"
8095         with uses of interfaces_packed and interface_offsets_packed.
8096
8097 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
8098
8099         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
8100         mono_class_interface_offset prototype to wrap all accesses to
8101         "MonoClass.interface_offsets".
8102
8103         * class.c: Implemented mono_class_interface_offset, and wrapped all
8104         accesses to "MonoClass.interface_offsets".
8105
8106         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
8107         "MonoClass.interface_offsets".
8108
8109 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
8110
8111         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
8112         GetMethodFromHandle overloads (bug #78637).
8113
8114 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
8115
8116         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
8117         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
8118
8119 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
8120
8121         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
8122         #81498.
8123
8124         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
8125         gracefully.
8126         (mono_custom_attrs_from_index): Ditto.
8127
8128         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
8129         Fixes #81501.
8130
8131 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
8132
8133         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
8134         is now allocated from a mempool.
8135
8136 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
8137
8138         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
8139         caller holds threads_lock, leading to deadlocks. Fixes #81476.
8140
8141 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
8142
8143         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
8144         mono_loader_clear_error () too late. Fixes #81463.
8145
8146 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
8147
8148         * culture-info-table.h : regenerated.
8149
8150 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
8151
8152         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
8153         is missing.
8154
8155 2007-04-25  Dick Porter  <dick@ximian.com>
8156
8157         * Makefile.am: Put the mingw enforced-optimisation back into the
8158         PLATFORM_WIN32 section.
8159
8160 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
8161
8162         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
8163         patch.
8164
8165         * image.c (mono_image_load_module): New API function to load a module reference.
8166
8167         * image.c (load_modules): Load modules lazily. Fixes #80812.
8168
8169         * class.c (mono_class_from_typeref): Use mono_image_load_module.
8170         
8171         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
8172
8173         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
8174         to mono_image_load_module_dynamic.
8175
8176 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
8177
8178         * marshal.c: Fix calling convention for CCW on non-windows
8179         platforms. STDCALL on windows, CDECL everywhere else to work 
8180         with XPCOM and MainWin COM.
8181         
8182         Code is contributed under MIT/X11 license.
8183
8184 2007-04-23  Martin Baulig  <martin@ximian.com>
8185
8186         Fix #80969.
8187
8188         * loader.c
8189         (method_from_memberref): Added `gboolean *used_context' argument.
8190         (mono_get_method_from_token): Likewise.
8191         (mono_get_method_full): Don't insert the method in the cache when
8192         `used_context' is true.
8193
8194 2007-04-23  Raja R Harinath  <rharinath@novell.com>
8195
8196         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
8197
8198         * reflection.c (mono_reflection_bind_generic_parameters): Don't
8199         create new MonoTypes for returned types.
8200         * class.c (mono_generic_class_get_class): Export mono-internal.
8201         * class-internals.h: Update to changes.
8202
8203 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
8204
8205         * threadpool.c, threadpool.h, icall-def.h: patch from
8206         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
8207
8208 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
8209
8210         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
8211         
8212         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
8213
8214         * threads.c (mono_thread_get_stack_bounds): New helper function.
8215
8216         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
8217         Correctly compute stack bounds when attaching. Fixes #81394.
8218
8219 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
8220
8221         * reflection.c: fix handling of doubles in custom attributes
8222         for the arm-fpa format (bug #81368).
8223
8224 2007-04-18  Raja R Harinath  <rharinath@novell.com>
8225
8226         * reflection.c (assembly_add_win32_resources): Mildly relax an
8227         bounds check to let the end pointer point just past the end of the
8228         allocated buffer.  (may fix #81384)
8229
8230 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8231
8232         * culture-info-table.h : regenerated.
8233
8234 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
8235
8236         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
8237         the thread is aborted early.
8238
8239 2007-04-05  Dick Porter  <dick@ximian.com>
8240
8241         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
8242         FindFirstFile()/FindNextFile() to find entries.  This lets the
8243         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
8244         81038.
8245
8246         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
8247         the parameters of
8248         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
8249
8250 2007-04-04  Martin Baulig  <martin@ximian.com>
8251
8252         * debug-helpers.c
8253         (mono_method_desc_full_match): Add support for nested classes.
8254
8255 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
8256
8257         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
8258
8259 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
8260
8261         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
8262         waiting for too many threads.
8263
8264 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
8265
8266         * environment.c: Fix return value check on uname so we can get the 
8267         executing version on Solaris operating systems.
8268
8269 2007-03-28  Jb Evain  <jbevain@gmail.com>
8270
8271         * class.c (mono_type_get_name_recurse): Complete the
8272         fix for the creation of assembly qualified names for
8273         pointer types. Fixes #81208.
8274
8275 2007-03-27  Dick Porter  <dick@ximian.com>
8276
8277         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
8278         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
8279         changed.
8280
8281         * threads.c
8282         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
8283         the value of ReleaseMutex().
8284
8285 2007-03-27  Dick Porter  <dick@ximian.com>
8286
8287         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
8288         in little-endian order, not network endian, so must be converted
8289         to host endian here.  Fixes bug 80593.
8290
8291 2007-03-22  Jb Evain  <jbevain@gmail.com>
8292
8293         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
8294         qualified names for pointer types. Fixes #81208.
8295
8296 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
8297
8298         * marshal.c: Add support for PreserveSigAttribute. 
8299         
8300         Code is contributed under MIT/X11 license.
8301
8302 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
8303
8304         * process.c: Fix endianness issues. Fixes #81126.
8305
8306         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
8307         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
8308
8309         * image.c (mono_image_lookup_resource): Make this work on big-endian
8310         machines.Change API contract so the caller needs to free the return value.
8311         
8312         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
8313         API change.
8314         
8315 2007-03-14  Martin Baulig  <martin@ximian.com>
8316
8317         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
8318         mono_type_get_desc() as well.
8319
8320 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
8321
8322         * icall.c:  Fix environ access in VS.  
8323         
8324 2007-03-13  Alp Toker  <alp@atoker.com>
8325
8326         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
8327         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
8328         #63841.
8329
8330 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
8331
8332         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
8333         circular references among dynamic methods. Fixes #81091.
8334
8335         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
8336
8337 2007-03-09  Martin Baulig  <martin@ximian.com>
8338
8339         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
8340
8341 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
8342
8343         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
8344         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
8345         
8346         Code is contributed under MIT/X11 license.
8347         
8348 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
8349
8350         * loader.c: Reapply patch for bug #79424.
8351
8352 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
8353
8354         * metadata.c (mono_type_to_unmanaged): Only convert object to
8355         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
8356
8357 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
8358
8359         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
8360         (and incorrectly set) is_reference field from MonoGenericInst.
8361
8362 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
8363
8364         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
8365         a little earlier.
8366
8367         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
8368
8369         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
8370
8371 2007-03-05  Miguel de Icaza  <miguel@novell.com>
8372
8373         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
8374         FileOptions.1 value to mean "temporary", map that to
8375         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
8376
8377         Fixes 80688
8378
8379 2007-03-03  Marek Habersack  <mhabersack@novell.com>
8380
8381         * appdomain.c: implement MS .Net style shadow copying. Copies of
8382         the assemblies are made in a subdirectory of the dynamic base
8383         directory, the assembly names are preserved.
8384         Copy .mdb and .config files along with the assemblies being shadowed.
8385
8386 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
8387
8388         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
8389         (emit_marshal_handleref): Ditto.
8390
8391         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
8392         on Visual C++. Fixes #80671.
8393
8394 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
8395
8396         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
8397         for clone operations.
8398
8399 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
8400
8401         * marshal.c: Fix warnings.
8402
8403 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
8404
8405         * loader.c: allow case-insensitive matching of the dll name
8406         in dllmap handling when prefixed with "i:".
8407
8408 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
8409
8410         * threads.c: Fix #ifdef for dummy_apc function for VS.
8411
8412 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
8413
8414         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
8415
8416 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
8417         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
8418         giving precedence to the methods with a fully qualified name
8419         (InterfaceName.MethodName) when building the interface sections
8420         of the vtable.
8421
8422 2007-02-16  Dick Porter  <dick@ximian.com>
8423
8424         * threadpool.c (append_job): Fix fast-path array handling, so it's
8425         less likely the array will grow exponentially when the load is
8426         heavy.
8427
8428 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
8429
8430         * metadata-internals.h, loader.c: fix dllmap lookup order
8431         for non-function maps, too, and prepare for fallback code.
8432
8433 2007-02-12  Robert Jordan  <robertj@gmx.net>
8434
8435         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
8436         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
8437         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
8438         GlobalFree. Fixes a part of bug #77075.
8439
8440 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
8441
8442         * loader.c: implemented typedef parent in field memberref.
8443
8444 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
8445
8446         * marshal.c: Fix warnings and remember to call Release on
8447         IUnknown of RCW.
8448         
8449         Code is contributed under MIT/X11 license.
8450
8451 2007-02-10  Miguel de Icaza  <miguel@novell.com>
8452
8453         * class-internals.h: Add MonoHandleRef definition, and
8454         handleref_class to mono_defaults. 
8455
8456         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
8457         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
8458
8459         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
8460         (do nothing on this stage)
8461         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
8462         (emit_marshal_handleref): New method, used for argument handling
8463         of HandleRefs. 
8464
8465 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
8466
8467         * class.c (mono_class_setup_parent): Lazily init com types.
8468         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
8469         init com types.
8470         * object.c (mono_remote_class_vtable): Lazily init com types.
8471         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
8472         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
8473         * domain-internals.h: Expose mono_init_com_types.
8474         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
8475         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
8476         Add support for COM Callable Wrapper marshalling.
8477         * marshal.h: Add icall definitions.
8478         * gc.c: Handle freeing of CCWs in finalizer code.
8479         
8480         Code is contributed under MIT/X11 license.
8481
8482 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
8483
8484         * reflection.c: changed all the signature encoding code to use
8485         a variable-sized buffer.
8486
8487 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
8488
8489         * marshal.c: locking fixes: never take the loader lock
8490         or other runtime locks when holding the marshal lock
8491         (fixes bug#80664).
8492
8493 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
8494
8495         * marshal.c: make the delegate function pointer mapping
8496         work for the moving GC.
8497
8498 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
8499
8500         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
8501         for bug #80618.
8502
8503 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
8504
8505         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
8506         gmodule.
8507
8508 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
8509
8510         * threadpool.c: made the code moving-GC safe.
8511
8512 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
8513
8514         * assembly.c, boehm-gc.c, class-internals.h, class.c,
8515         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
8516         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
8517         warning cleanup.
8518         * reflection.c: warning cleanup, some threading and moving GC fixes.
8519
8520 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
8521
8522         * class.c, loader.c: create the needed Set/Get/Address array methods
8523         as well as the .ctors in mono_class_init (), fixes bug #80567.
8524
8525 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
8526
8527         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
8528         we doesn't decrease its alignment. Should fix the sparc build.
8529
8530 2007-01-24  Dick Porter  <dick@ximian.com>
8531
8532         * socket-io.c
8533         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
8534         Create the returned object if we need to ignore an unsupported
8535         socket option.  Fixes a segfault reported by Atsushi.
8536
8537 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
8538
8539         * class.c, object.c: restrict GC-tracked fields to
8540         UIntPtr fields used inside corlib, so we provide better
8541         type info to the GC and also allow broken packing as in
8542         bug #80580.
8543
8544 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
8545
8546         * sgen-gc.c: removed duplicated function.
8547
8548 2007-01-19  Miguel de Icaza  <miguel@novell.com>
8549
8550         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
8551         value that means that the value is not supported, but that we
8552         should not return a failure, but instead report this as a
8553         successful operation.
8554
8555 2007-01-19  Raja R Harinath  <rharinath@novell.com>
8556
8557         Fix tests/bug79956.2.il
8558         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
8559         (mono_generic_class_get_class): If the generic definition in an
8560         enum, copy over other fields related to it.
8561
8562 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
8563
8564         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
8565         genericinst enums (bug #79215).
8566
8567 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
8568         * class.c: Fix bug 80307.
8569
8570 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
8571
8572         * image.c: if the file table is not present, try to load
8573         all the modules, since we don't have info about them
8574         having or not metadata (bug #80517).
8575         * assembly.c: allow mono_assembly_load_references () to
8576         work for netmodules.
8577
8578 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
8579
8580         * image.c, metadata-internals.h, object.c: execute module
8581         cctors when running on the 2 runtime if present (bug #80487).
8582
8583 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
8584
8585         * icall.c: optimized InitializeArray() on bigendian.
8586
8587 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
8588
8589         * icall.c: fix for the broken ARM FPA double format.
8590
8591 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
8592
8593         * icall.c: handle endian issues for r4 and r8 types, too, in
8594         the InitializeArray() icall.
8595
8596 2007-01-15  Miguel de Icaza  <miguel@novell.com>
8597
8598         * loader.c (mono_loader_error_prepare_exception): Clear the error
8599         once we have extracted the information from it, do this before we
8600         call into the JIT's class loading mechanisms.
8601
8602         * object.c (mono_class_create_runtime_vtable): Do not clear the
8603         loader error before calling mono_class_get_exception_for_failure
8604         as the loader error is needed inside
8605         mono_class_get_exception_for_failure to throw the error (thinko).
8606
8607         Fixes #80521
8608         
8609 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
8610
8611         * reflection.c: align fields rva data so it's faster to load at
8612         runtime.
8613
8614 2007-01-12  Raja R Harinath  <rharinath@novell.com>
8615
8616         Prepare to simplify GenericMethod handling.
8617         * class-internals.h (mono_method_get_context): New accessor function.
8618         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
8619         rather than directly accessing '->context' field.
8620
8621         * class-internals.h (_MonoGenericParam.method): Move ...
8622         (_MonoGenericContainer): ... here.  Add into union with klass field.
8623         * class.c, icall.c, loader.c, metadata.c, reflection.c:
8624         Update to changes.
8625
8626 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
8627
8628         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
8629         the wrapper type enum and reduce relocations.
8630
8631 2007-01-12  Raja R Harinath  <rharinath@novell.com>
8632
8633         * reflection.c (inflate_mono_method): Reuse method instantiation
8634         from the generic method, if available.
8635
8636 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
8637
8638         * marshal.c (emit_marshal_variant): Fix conv_arg
8639         type in last commit, based on whether parameter is byref.
8640         
8641 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
8642
8643         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
8644         marshalling.
8645         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
8646         MONO_TYPE_OBJECT back for VARIANT support.
8647
8648 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
8649
8650         * marshal.c, marshal.h, icall-def.h: Implement 
8651         Marshal.ReAllocCoTaskMem.
8652
8653 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
8654
8655         * marshal.c: memory retention fixes: use the proper
8656         image cache for runtime_invoke method lookups.
8657
8658 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
8659
8660         * mempool.c: added code to help debug mempool allocations.
8661
8662 2007-01-11  Dick Porter  <dick@ximian.com>
8663
8664         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
8665         support (experimenting with faking it with IP_MTU_DISCOVER for
8666         systems that don't have IP_DONTFRAGMENT.)
8667         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
8668         icall.
8669
8670         * icall-def.h: new System.Net.Sockets.Disconnect icall.
8671
8672         * socket-io.h: Add new fields to MonoSocketAsyncResult
8673         corresponding to the new ones in Socket.cs.
8674
8675 2007-01-11  Raja R Harinath  <rharinath@novell.com>
8676
8677         Fix IronPython regression mentioned in #80249
8678         * metadata.c (do_mono_metadata_parse_generic_class): Clear
8679         'cached_context' field, since it may have been initialized as a
8680         side-effect of metadata parsing.
8681
8682         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
8683         (_MonoGenericClass.cached_class): Move here and rename from lone
8684         remaining field of ...
8685         (_MonoInflatedGenericClass): ... this.  Remove.
8686         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
8687         to changes.
8688
8689         Fix mcs/tests/test-128.cs regression.
8690         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
8691         2007-01-10 change below.
8692         [MONO_TYPE_OBJECT]: Recurse into array case.
8693
8694 2007-01-11  Raja R Harinath  <harinath@gmail.com>
8695
8696         * class-internals.h (mono_get_inflated_generic_class): Remove.
8697         * class.c (mono_get_inflated_generic_class): Remove.
8698         (mono_generic_class_get_class): Rename from
8699         mono_class_create_generic.
8700         (mono_class_from_mono_type) [GENERICINST]: Use it.
8701         * reflection.c, metadata.c: Update to changes.  Use
8702         'mono_class_from_mono_type'.
8703
8704 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
8705
8706         * reflection.c: use passed type when encoding an array element
8707         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
8708
8709 2007-01-09  Robert Jordan  <robertj@gmx.net>
8710
8711         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
8712         result arguments (someDelegate.EndInvoke (unrelatedAres)).
8713         Fixes bug #80392.
8714
8715 2007-01-09  Raja R Harinath  <rharinath@novell.com>
8716
8717         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
8718
8719         * object.c (set_value): Avoid aliasing between type->data.klass
8720         and type->data.generic_class.
8721
8722         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
8723
8724 2007-01-08  Raja R Harinath  <rharinath@novell.com>
8725
8726         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
8727         between type->data.klass and type->data.generic_class.
8728
8729 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
8730
8731         * marshal.c: In MS.NET, StringBuilder objects are not copied by
8732         value in out parameters.
8733
8734 2007-01-08  Raja R Harinath  <rharinath@novell.com>
8735
8736         Simplify invariant for MonoGenericClass::klass field.
8737         * class.c (mono_class_create_generic): Verify 'klass' is null.
8738         * metadata.c (do_mono_metadata_parse_generic_class): Don't
8739         initialize 'klass' field.
8740
8741 2007-01-05  Raja R Harinath  <rharinath@novell.com>
8742
8743         Ongoing work to avoid redundant data and simplify invariants.
8744         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
8745         'generic_class', and change type to a GenericInst.
8746         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
8747         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
8748
8749 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
8750
8751         * class.c : skip io-layer under PLATFORM_WIN32.
8752
8753 2007-01-03  Tor Lillqvist  <tml@novell.com>
8754
8755         Fix #80305: In a bundled executable, look in the bundled exe
8756         assembly to determine the runtime version. Add the possibility to
8757         bundle also the machine.config file.
8758         
8759         * assembly.c (mono_assembly_open_from_bundle): Make
8760         non-static. Allow being called even if we have no bundled
8761         assemblies, and return NULL right away in that case.
8762
8763         * domain-internals.h: Declare mono_assembly_open_from_bundle()
8764         here.
8765
8766         * domain.c (app_config_parse): Take an assembly exe file name as
8767         parameter instead of a config file name. Check for a bundled
8768         config file for that assembly by calling
8769         mono_config_string_for_assembly_file() (see below) before looking
8770         for one in the file system.
8771         (get_runtimes_from_exe): Corrsponding change to call of
8772         app_config_parse().
8773         (get_runtimes_from_exe): Check for bundled assembly exe file first
8774         by calling mono_assembly_open_from_bundle(). If no bundled
8775         assembly exe file is found, call mono_image_open() as before to
8776         look it up in the file system.
8777
8778         * mono-config.c: Add variable bundled_machinec_onfig.
8779         (mono_config_string_for_assembly_file): New function.
8780         (mono_config_for_assembly): Move code snippet that looks for a
8781         bundled assembly .config file into the above new function. Call
8782         it.
8783         (mono_register_machine_config, mono_get_machine_config): New
8784         functions to set and retrieve
8785
8786         * assembly.h: Declare mono_register_machine_config().
8787
8788         * mono-config.h: Declare mono_get_machine_config() and
8789         mono_config_string_for_assembly_file().
8790
8791         * icall.c: No declaration of environ necessary on Win32. It is
8792         declared (as a macro expanding to a function call) in stdlib.h.
8793         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
8794         New internal mono function. Returns the value of
8795         mono_get_machine_config() as a Mono string.
8796
8797         * icall-def.h: Add get_bundled_machine_config().
8798
8799 2007-01-04  Raja R Harinath  <rharinath@novell.com>
8800
8801         Remove redundant field
8802         * class-internals.h (_MonoGenericContext.container): Remove field.
8803         * loader.c (mono_method_get_signature_full): Don't parse a
8804         "container" for a signature parse when the signature is inflated
8805         immediately.
8806         (method_from_methodspec): Likewise, for a generic_inst.
8807         * class.c, metadata.c, reflection.c: Update to changes.
8808
8809 2006-01-04  Raja R Harinath  <rharinath@novell.com>
8810
8811         * class-internals.h (_MonoGenericClass): Rename 'context' field to
8812         'cached_context', and change semantics -- it starts off NULL, and
8813         is initialized on demand.
8814         * class.c (mono_generic_class_get_context): New accessor to
8815         replace 'context' field accesses.
8816         (mono_class_get_context): New helper.
8817         (*): Update to changes.
8818         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
8819
8820 2007-01-03  Miguel de Icaza  <miguel@novell.com>
8821
8822         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
8823         before the memcpy.   Fixes Marshal2 regression.
8824
8825 2007-01-02  Jb Evain  <jbevain@gmail.com>
8826
8827         * blob.h: add a MONO_TYPE_ENUM definition
8828         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
8829         fix the encoding of arrays of enums in custom attributes.
8830
8831         Fixes #79666.
8832
8833 2007-01-01  Miguel de Icaza  <miguel@novell.com>
8834
8835         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
8836         string is null terminated, but only cut the string short if it
8837         overflows the buffer.   
8838         
8839         (mono_string_to_byvalstr): Also fix this routine.   The code here
8840         was not properly terminating a string (it was only terminated
8841         because of the previous catch-all memset). 
8842
8843         I left the memset, because I do not know if applications expect
8844         the runtime to clear this region. 
8845
8846         Fixes #79944.
8847
8848         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
8849         Clear the error before returning to unmanaged code to prevent the
8850         runtime from being confused later on (fixes  80420).
8851         (ves_icall_type_from_name): Always call mono_loader_clear_error
8852         after parsing a type that could have failed.
8853         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
8854
8855         * loader.c (mono_loader_clear_error): Fix indentation.
8856
8857 2006-12-28  Martin Baulig  <martin@ximian.com>
8858
8859         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
8860
8861 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
8862
8863         * reflection.c: patch from Rolf Bjarne Kvinge to fix
8864         getting a token for an EnumBuilder.
8865
8866 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
8867
8868         * reflection.c: be more careful in case resource generation
8869         fails to create the data array.
8870
8871 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
8872
8873         * sgen-gc.c: write barrier for clone and fix unregister handles.
8874
8875 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
8876
8877         * reflection.c: some fixes needed in the generics code for the moving GC.
8878
8879 2006-12-22  Robert Jordan  <robertj@gmx.net>
8880
8881         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
8882         account. Fixes bug #80299.
8883
8884 2006-12-21  Raja R Harinath  <rharinath@novell.com>
8885
8886         Fix WaitHandle usage in delegates.
8887         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
8888         * object.c (mono_wait_handle_new): Use the property set method to
8889         initialize the handle.
8890         (mono_wait_handle_get_handle): New.
8891         * threadpool.c (mono_async_invoke): Use it.
8892         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
8893         Likewise.
8894         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
8895
8896 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
8897
8898         * marshal.c (emit_marshal): Call emit_marshal_variant and
8899         emit_marshal_com_interface when applicable.
8900         (emit_marshal_variant, emit_marshal_com_interface): Add
8901         methods for this case and remove if's from emit_marshal_object.
8902         
8903 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
8904
8905         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
8906
8907 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
8908
8909         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
8910         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
8911         and GlobalFree on Windows. Remove FIXME.
8912
8913 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
8914
8915         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
8916         implementation for managed objects.
8917
8918 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
8919
8920         * object.c: implemented code to be used for checking
8921         that no reference field overlaps with non-references.
8922
8923 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8924
8925         * threadpool.c: fix queue code to be compatible with the
8926         moving GC.
8927
8928 2006-12-18  Miguel de Icaza  <miguel@novell.com>
8929
8930         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
8931         in structures by throwing ArgumentNullException.
8932
8933         (emit_marshal_safehandle): Also when they are null parameters.
8934
8935         (emit_marshal_safehandle): Add support for ref
8936         SafeHandles parameters
8937
8938 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
8939
8940         * profiler.c: updated to use the mono-dl API instead of
8941         gmodule.
8942
8943 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
8944
8945         * profiler.c: updated to use the mono-dl dynamic loading
8946         API instead of gmodule.
8947
8948 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
8949
8950         * profiler.c: use readlink, older versions of glib don't have
8951         g_file_read_link ().
8952
8953 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
8954
8955         * profiler.c: try to detect the path to mono if libc fails to provide
8956         a useful name (bug #80286).
8957
8958 2006-12-16  Raja R Harinath  <rharinath@novell.com>
8959
8960         Fix #80242
8961         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
8962         instance, use the generic type definition instead.
8963         (ves_icall_Type_GetNestedTypes): Likewise.
8964         * class.c (mono_class_create_generic): Always set the
8965         nested_classes of a generic instance to NULL, even if the generic
8966         type definition has nested types.
8967
8968 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
8969
8970         * marshal.c (mono_string_from_bstr): Revert previous Windows change
8971         and fix on Linux.
8972         
8973 2006-12-15  Miguel de Icaza  <miguel@novell.com>
8974
8975         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
8976         my arguments were in the wrong order.   I also fixed the Windows
8977         version which seems to have had the same issue.
8978
8979         (mono_free_bstr): On Unix, this is g_free.
8980         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
8981         conversions (for the tests in corlib to pass).
8982
8983 2006-12-14  Miguel de Icaza  <miguel@novell.com>
8984
8985         * marshal.c (emit_ptr_to_object_conv): For now, ignore
8986         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
8987         exception if a ref SafeHandle in a struct has changed).
8988         
8989         (emit_struct_conv): Do not perform layout checks for classes
8990         derived from SafeHandle, as those are specially handled. 
8991
8992         (emit_object_to_ptr_conv): Add support for
8993         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
8994
8995         (emit_marshal_safehandle): Implement conversion of return values
8996         of safehandles (MARSHAL_ACTION_CONV_RESULT).
8997         
8998         * threads.c: WaitHandle now is compiled with two different handles
8999         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
9000         for 2.0.
9001         
9002         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
9003         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
9004         these routines to cope with both kinds of fields.
9005
9006 2006-12-12  Miguel de Icaza  <miguel@novell.com>
9007
9008         * metadata.c (mono_type_to_unmanaged): Handle the case where
9009         type->data.klass is a SafeHandle, and in that case, return the
9010         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
9011         MONO_MARSHAL_CONV_SAFEHANDLE. 
9012
9013 2006-12-11  Miguel de Icaza  <miguel@novell.com>
9014
9015         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
9016         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
9017         calling emit_marshal_object.
9018
9019         (emit_marshal_safehandle): Implement marshalling of
9020         SafeHandle parameters (no ref support yet).
9021
9022         (MarshalAction): Document the defines as I implement
9023         them for SafeHandle.
9024
9025         (emit_marshal_object): indentation police.
9026
9027         * class-internals.h: Define MonoSafeHandle.
9028         Add safehandle_class to MonoDefaults type.
9029
9030         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
9031         list of classes to check for fields. 
9032
9033         * domain.c (mono_init_internal): Add SafeHandle to the list of
9034         mono_defaults loaded.
9035
9036 2006-12-15  Raja R Harinath  <rharinath@novell.com>
9037
9038         Fix #80253
9039         * reflection.c (mono_reflection_bind_generic_parameters): If the
9040         generic type definition is a type builder, ensure that it is fully
9041         initialized before instantiating it.  Kill some dead code.
9042
9043 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
9044
9045         * object.c: clear the loader_error () before loading
9046         more metadata stuff (bug #80258).
9047
9048 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
9049
9050         * icall.c, icall-defs.h: type modifiers icalls for
9051         parameters and properties.
9052
9053 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
9054
9055         * object.c, icall.c: fixed warnings.
9056
9057 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
9058
9059         * marshal.c: fixed a couple of leaks and coding style in a few places.
9060
9061 2006-12-08  Dick Porter  <dick@ximian.com>
9062
9063         * process.c: Cope with NULL ProcessStartInfo arguments on windows
9064         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
9065         80173.
9066
9067 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
9068
9069         * process.c: ProcessStartInfo may have only filename set and
9070         arguments can be NULL.
9071
9072 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
9073
9074         * icall.c: fix leak found by Robert Jordan.
9075
9076 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
9077
9078         * marshal.c, marshal.h: generate managed method to access an element
9079         of a multi-dimensional array.
9080
9081 2006-11-30  Paolo Molaro (lupus@ximian.com)
9082
9083         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
9084
9085 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
9086
9087         * icall.c: back out GetFields () fix until the serialization code is
9088         fixed to not depend on the incorrect behaviour.
9089
9090 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
9091
9092         * profiler.c: provide defaults if none are set.
9093
9094 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
9095
9096         * Makefile.am, attrdefs.h: new public header file with
9097         constants for attributes for use by embedders.
9098
9099 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
9100
9101         * icall.c: GetFields () fix for bug #80064.
9102
9103 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
9104
9105         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
9106         removed long unused icalls.
9107
9108 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
9109   
9110         * marshal.c: 
9111                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
9112                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
9113                 can be generated without a delegate class.
9114                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
9115         
9116         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
9117
9118 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9119
9120         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
9121         #80069.
9122
9123 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
9124
9125         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
9126         icall-def.h: added icalls needed by System.GC.
9127
9128 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
9129
9130         * loader.c: ensure the class in catch clauses is handled
9131         correctly for generics methods (fixes bug#79980).
9132
9133 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
9134
9135         * monitor.h, monitor.c: added mono_locks_dump () function
9136         to help debug deadlocks involving managed locks.
9137
9138 2006-11-13  Dick Porter  <dick@ximian.com>
9139
9140         * file-io.c (get_file_attributes): If the file is a symlink try
9141         and get the stat data for the target, but also add the
9142         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
9143         the specs for the windows symlink support, but will probably have
9144         to be reworked when I have test data from a vista machine.  Fixes
9145         bug 79887.
9146
9147 2006-11-13  Dick Porter  <dick@ximian.com>
9148
9149         * gc.c (mono_domain_finalize): 
9150         * marshal.c (mono_delegate_begin_invoke): 
9151         * threadpool.c (socket_io_init, mono_thread_pool_init)
9152         (mono_thread_pool_finish): 
9153         * monitor.c (mono_monitor_try_enter_internal): 
9154         * threads.c (mono_thread_resume, mono_thread_init)
9155         (mono_thread_suspend_all_other_threads)
9156         (mono_thread_execute_interruption): 
9157         * appdomain.c (mono_domain_unload): Check for NULL error returns
9158         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
9159         75733.
9160
9161 2006-11-11  Miguel de Icaza  <miguel@novell.com>
9162
9163         * process.c
9164         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
9165         Only close the handle if the value of the handle is not
9166         INVALID_HANDLE_VALUE.  This just makes the process a bit more
9167         robust.
9168
9169         Improvement for #75733, so that we do not run into this problem. 
9170
9171         
9172         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
9173         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
9174         internal variables.  Fixes #79462 
9175         
9176
9177 2006-11-09  Dick Porter  <dick@ximian.com>
9178
9179         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
9180         Use poll() not select().  Fixes bug 79397.
9181
9182 2006-11-09  Raja R Harinath  <rharinath@novell.com>
9183
9184         Fix #79872
9185         * assembly.c (mono_assembly_load_from_full): Check that the given
9186         image has an assembly manifest.
9187
9188 2006-11-09  Ankit Jain  <jankit@novell.com>
9189
9190         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
9191         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
9192         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
9193
9194 2006-11-07  Dick Porter  <dick@ximian.com>
9195
9196         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
9197         Put the old resolver behaviour back for pre-2.0 profiles.
9198
9199 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
9200
9201         * threadpool.c: precise GC and locking fixes.
9202
9203 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
9204
9205         * class.c: don't load types that have an explicit unaligned
9206         managed reference. Provide better info in the TypeLoad exception.
9207         Part of the fix for bug #79744.
9208         * object.c: use the correct check for class type load issues.
9209
9210 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
9211
9212         * class.c: enforce alignment of fields with managed references
9213         even when Pack=1 is forced by the user (bug #77788).
9214
9215 2006-11-03  Dick Porter  <dick@ximian.com>
9216
9217         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
9218         If the address reverse lookup fails, return it as the hostname
9219         anyway.  Fixes bug 79721.
9220
9221 2006-11-03  Dick Porter  <dick@ximian.com>
9222
9223         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
9224         Fix build on Windows.
9225
9226 2006-11-02  Dick Porter  <dick@ximian.com>
9227
9228         * icall-def.h: 
9229         * object-internals.h: 
9230         * exception.c (mono_get_exception_thread_interrupted): 
9231         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
9232         Fixes bug 74525.
9233
9234         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
9235         Check for pending Thread.Interrupt.
9236
9237 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
9238         * loader.c: Fixed bug 79684.
9239
9240 2006-10-27  Dick Porter  <dick@ximian.com>
9241
9242         * file-io.c (get_file_attributes): Force symlinks to directories
9243         to be returned as a regular file.  Fixes bug 79733.
9244 2006-10-26  Dick Porter  <dick@ximian.com>
9245
9246         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
9247         CreateFile to open a directory then we need to set the
9248         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
9249
9250 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
9251
9252         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
9253         friends.
9254
9255 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
9256
9257         * sgengc.c: small cleanup of timer code.
9258
9259 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
9260
9261         * sgen-gc.c: fix some warnings and start adding support for
9262         complete object removal on domain unload.
9263
9264 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
9265
9266         * assembly.c: build_assembly_name should not consider a version
9267         number without build or revision number invalid. Fixes bug #79715.
9268
9269 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
9270
9271         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
9272         call kernel32 function OutputDebugString directly.
9273         
9274         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
9275         
9276 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
9277
9278         * reflection.c: small cleanup, using a function to insert a MonoString
9279         in the string heap.
9280
9281 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
9282
9283         * reflection.c: moving GC fixes.
9284
9285 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
9286
9287         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
9288         all the objects with finalizers belonging to an unloading appdomain.
9289
9290 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
9291
9292         * sgen-gc.c: added ability to allocate even when the nursery is fully
9293         pinned and fixed a couple of bugs.
9294
9295 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
9296
9297         * threads.h: Revert the last change for now.
9298
9299         * threads.h (mono_thread_get_pending_exception): Rename this to
9300         mono_thread_get_undeniable_exception ().
9301
9302 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
9303
9304         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
9305         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
9306         when fname does not refer to valid assembly. This result in a more
9307         meaningful error message.
9308         * exception.c: added mono_get_exception_bad_image_format2 which 
9309         constructs a BadImageFormatException using the ctor taking a custom
9310         message and the file name. Passing in a NULL msg results in a default
9311         message.
9312         * exception.h: define mono_get_exception_bad_image_format2 function.
9313         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
9314         when file name pointed to an invalid IL image. Use 
9315         mono_get_exception_file_not_found2 to construct FileNotFoundException,
9316         as this results in a more meaningful error message.
9317
9318 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
9319
9320         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
9321         #79465.
9322
9323 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
9324
9325         * metadata.c (mono_type_size): Change the align parameter to guint32 for
9326         consistency with the other _size functions.
9327         (mono_type_stack_size): Ditto.
9328
9329         * class.c object.c icall.c: Fix warnings caused by the above change.
9330
9331         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
9332
9333         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
9334
9335         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
9336
9337 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
9338
9339         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
9340         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
9341         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
9342         threadpool.h, threads-types.h: mark more internal functions.
9343
9344 2006-10-11  Dick Porter  <dick@ximian.com>
9345
9346         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
9347         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
9348         reproduce the bug even before applying the fix.)
9349
9350 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
9351
9352         * reflection.c: allow retrieving attributes for arguments in generic
9353         methods (bug #79241).
9354
9355 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
9356
9357         * debug-mono-symfile.c: properly check fopen () result (found by
9358         coverity).
9359
9360 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
9361
9362         * reflection.c: make error message clearer and fixed two
9363         issuelets found by Coverity.
9364
9365 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
9366
9367         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
9368
9369 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
9370
9371         * object-internals.h, gc-internal.h, profiler-private.h:
9372         mark internal functions.
9373
9374 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
9375
9376         * reflection.c: put data in the text section.
9377         * icall.c: recognize more types in type_from_typename ().
9378         * process.c, marshal.c: added some GC FIXMEs.
9379
9380 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
9381
9382         * loader.c: check for NULL before initializing.
9383
9384 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
9385
9386         * gc.c (finalizer_thread): Use a non-alertable wait here.
9387
9388         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
9389         until the correct solution is found.
9390
9391 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
9392
9393         * reflection.c (mono_module_get_object): Avoid an assert when operating on
9394         modules with no metadata. Fixes #79596.
9395
9396         * image.c (load_metadata_ptrs): Put back the error message when
9397         the #- heap is encountered since the support is not complete yet.
9398
9399 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
9400
9401         * gc.c: do not allow the user to SuppressFinalize () a
9402         delegate because it would leak the trampoline if present.
9403
9404 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
9405
9406         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
9407         PropertyPtr table.
9408
9409 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
9410
9411         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
9412
9413         * metadata.c (mono_metadata_get_param_attrs): Ditto.
9414
9415         * row-indexes.h: Add definitions for *Ptr tables.
9416
9417         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
9418
9419         * metadata.c (mono_metadata_translate_token_index): New helper function to
9420         translate table indexes used in uncompressed metadata.
9421         (mono_metadata_decode_table_row): Ditto.
9422         (mono_metadata_decode_table_row_col): Ditto.
9423
9424         * metadata.c: Add table schema for *Ptr tables.
9425
9426         * class.c loader.c: Use the new helper function to access the affected metadata
9427         tables.
9428         
9429         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
9430         #38532.
9431         
9432 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
9433
9434         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
9435         sequences which can be unbounded in size. Fixes #79583.
9436
9437 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
9438
9439         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
9440         static initialization.
9441
9442         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
9443
9444         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
9445
9446         * domain.c (mono_domain_free): Free up type_init_exception_hash.
9447
9448         * object.c (mono_runtime_class_init): Implement correct semantics when a static
9449         ctor fails, i.e. throw the same exception on subsequent accesses.
9450         
9451 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
9452
9453         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
9454         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
9455         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
9456         Handle marshalling of interfaces and VARIANTs contained in structs.
9457         
9458         Code is contributed under MIT/X11 license.
9459         
9460 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
9461
9462         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
9463         
9464         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
9465         mempool.
9466
9467 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9468
9469         * console-io.c: ignore previous SIGINT handler.
9470
9471 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
9472
9473         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
9474         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
9475         #79460, #79461, #79485.
9476
9477         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
9478
9479         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
9480         #79217.
9481
9482 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
9483
9484         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
9485         could be generated from it.
9486
9487 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
9488
9489         * rand.c: fix read loop to correctly handle EINTR.
9490
9491 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
9492
9493         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
9494         internal calls are defined to keep methods closer to the declaring
9495         type and allow a significant reduction in runtime relocations and
9496         memory usage.
9497
9498 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
9499
9500         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
9501         exception message to have FileNotFoundException use the default
9502         assembly load error message. Fixes bug #79426.
9503         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
9504
9505 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9506
9507         * threadpool.c: (start_thread_or_queue) use the root domain when
9508         creating the thread instead of the async object one.
9509
9510 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
9511
9512         * class.c, object.c, class-internals.h, reflection.c:
9513         for arrays, store element_size inside MonoClass (speedup
9514         for array object creation).
9515
9516 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
9517
9518         * icall.c: fixed CodeBase to use the file name and not the module
9519         name (bug #79365).
9520
9521 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
9522
9523         * mono-debug.c, mono-debug.h: export find_method as
9524         mono_debug_find_method ().
9525
9526 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
9527
9528         * debug-helpers.c, class-internals.h: added a few functions useful
9529         when debugging under gdb.
9530
9531 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9532
9533         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
9534         characters that need special handling.
9535
9536 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
9537
9538         * mono-config.c: make the os/cpu specification more flexible,
9539         allowing lists and negation.
9540
9541 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
9542
9543         * marshal.c: COM Interop fixes. Handle case where method->klass.
9544         is interface. Handle BSTR/MonoString when null. Use CDECL as 
9545         calling convention on non-windows platforms. This is for
9546         compatibility with XPCOM and MainWin COM.
9547         
9548         Code is contributed under MIT/X11 license.
9549         
9550
9551 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
9552
9553         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
9554         correctly. Fixes #79217.
9555
9556         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
9557
9558 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
9559
9560         * mono-config.c: allow both an os and cpu attribute for dllmap
9561         and dllentry elemnets to enable a single config file to be used
9562         for multiple architectures.
9563
9564 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
9565
9566         * loader.c: MonoLoaderError was cleared too soon on load failure.
9567         Fixes bug #79424.
9568
9569 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
9570
9571         * icall.c: use the defining class vtable when accessing a
9572         static field, not a pobblibly derived class.
9573
9574 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
9575
9576         * icall.c string-icalls.c: Remove references to unicode.h.
9577
9578         * unicode.h unicode.c Makefile.am: Remove these unused source files.
9579
9580         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
9581
9582         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
9583         indicating the image where custom marshaller types should be looked up.
9584         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
9585         custom marshallers, instead of corlib. Fixes #79425.
9586
9587 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
9588
9589         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
9590
9591 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
9592
9593         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
9594         Implement Environment.ProcessorCount.
9595         
9596         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
9597         Implement Environment.ProcessorCount.
9598         
9599         * icall.c: 
9600         Add Environment.ProcessorCount icall.
9601         
9602         Patch by Jason McFall.
9603
9604 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9605
9606         * assembly.c: don't append .exe/.dll when the filename already contains
9607         one of those extensions.
9608
9609 2006-09-12  Martin Baulig  <martin@ximian.com>
9610
9611         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
9612         to array interfaces.
9613
9614 2006-09-11  Martin Baulig  <martin@ximian.com>
9615
9616         * reflection.c (mono_image_build_metadata): Create the
9617         MethodImpl's after emitting all types and methods, so we don't
9618         need another fixup pass for them.
9619
9620 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
9621
9622         * class.c (mono_class_from_name_case): Fix regression introduced by the last
9623         change.
9624
9625 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
9626
9627         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
9628         unload.
9629
9630 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
9631
9632         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
9633         args is not set. Fixes #78926.
9634
9635 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
9636
9637         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
9638
9639         * image.c (load_class_names): Move this to class.c, and rename it to 
9640         'mono_image_init_name_cache'.
9641         (load_modules): Fix a warning.
9642
9643         * class.c icall.c image.c: Initialize image->name_cache lazily.
9644
9645         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
9646         on its name using information in the AOT file.
9647
9648         * class.c (mono_class_from_name): Use the new hook function.
9649
9650 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
9651
9652         * reflection.c (mono_param_get_objects): Handle enum default parameter values
9653         correctly.
9654
9655         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
9656         Fixes #79289.
9657         
9658 2006-09-06  Martin Baulig  <martin@ximian.com>
9659
9660         * icall.c (mono_lookup_internal_call): Small fix.
9661
9662 2006-09-05  Raja R Harinath  <rharinath@novell.com>
9663
9664         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
9665         double g_free.
9666
9667 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
9668
9669         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
9670         when --debug is specified.
9671
9672 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
9673
9674         * class.c (setup_generic_array_ifaces): Fix a warning.
9675
9676 2006-09-04  Miguel de Icaza  <miguel@novell.com>
9677
9678         * Temporarily remove the patch to assemly.c that checks the
9679         assembly versions as it breaks our gacutil.
9680
9681 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
9682
9683         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
9684
9685         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
9686         a net 1.0 runtime.
9687
9688         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
9689         created using the default ctor. Fixes #79152.
9690         (mono_string_builder_to_utf16): Ditto.
9691
9692 2006-09-01  Martin Baulig  <martin@ximian.com>
9693
9694         Fix handling of the generic array interfaces.
9695
9696         * class-internals.h
9697         (MonoDefaults): Removed `generic_array_class' and added
9698         `generic_ilist' class.
9699
9700         * class.c
9701         (mono_bounded_array_class_get): Add the new generic array interfaces.
9702         (setup_generic_array_ifaces): New static method; create vtable
9703         entries for each method in the generic array interfaces.
9704
9705         * metadata.c
9706         (select_container): Allow "parent-less" generic methods.
9707
9708         * marshal.c
9709         (mono_marshal_get_generic_array_helper): New public method.
9710
9711         * icall.c
9712         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
9713         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
9714         moved the interncall into System.Array.
9715
9716 2006-09-01  Raja R Harinath  <rharinath@novell.com>
9717
9718         A few more cases of avoiding work on types with ->byref set.
9719         Has the real fix for #79238
9720         * icall.c (is_generic_parameter): New helper.
9721         (ves_icall_Type_GetGenericParameterPosition): Use it.
9722         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
9723         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
9724         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
9725         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
9726         reference types.
9727         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
9728         reference types.
9729         (ves_icall_Type_get_IsGenericInstance): Likewise.
9730         (ves_icall_Type_get_IsGenericType): Likewise.
9731
9732 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
9733
9734         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
9735         class if possible.
9736
9737         * mempool.h (mono_mempool_get_allocated): New helper function.
9738
9739         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
9740         change.
9741
9742         * mempool.c: Fix warnings and the calculation of stats.
9743
9744         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
9745
9746         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
9747
9748         * loader.c (mono_get_method_from_token): Update method_count stat.
9749
9750         * class-internals.h (MonoStats): Add some stats.
9751
9752 2006-08-31 Robert Jordan  <robertj@gmx.net>
9753
9754         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
9755         with managed variants.
9756         All code is contributed under the MIT/X11 license.
9757         
9758 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
9759
9760         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
9761         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
9762
9763         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
9764
9765         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
9766         with cycles in classes.
9767
9768         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
9769
9770         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
9771         missing a [MarshalAs] directive. Fixes #79203.
9772
9773         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
9774         klass->marshal_info. Fixes #79217.
9775
9776 2006-08-30  Martin Baulig  <martin@ximian.com>
9777
9778         Committing a patch from Joachim Ante <joe@otee.dk>:
9779         Add support for binary data symbol stores.
9780
9781         * debug-mono-symfile.c
9782         (mono_debug_open_mono_symbol_file): Renamed into
9783         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
9784         arguments.
9785
9786         * mono-debug.c
9787         (mono_debug_open_image): Added `raw_contents' and `size' args.
9788         (mono_debug_init_2_memory): New public function.
9789
9790 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
9791
9792         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
9793
9794 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9795
9796         * appdomain.c: implement support for ShadowCopyFiles.
9797
9798 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
9799
9800         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
9801         when value is NULL (and should remove CID #51).
9802
9803 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9804
9805         * image.c: moved 2 functions to ../utils.
9806
9807 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
9808
9809         * gc.c: cope with the target object of a GC handle being NULL
9810         (bug #78877).
9811
9812 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
9813
9814         * class.c: recursively check parent's explicit implementations
9815         of interface methods (fixes bug #79125).
9816
9817 2006-08-19  Miguel de Icaza  <miguel@novell.com>
9818
9819         * filewatcher.c: Avoid warnings when building, do not redefine
9820         constants that are defined.
9821
9822         Remove warnings.
9823
9824 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9825
9826         * image.c: don't fail when the link points to an absolute path.
9827
9828 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
9829
9830         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
9831         Fix CID #3.
9832
9833 2006-08-17  Miguel de Icaza  <miguel@novell.com>
9834
9835         * image.c (full_path): A new method used to obtain the actual path
9836         of an assembly even in the presence of symbolic links.  
9837
9838         This is necessary for the case where we are running a binary that
9839         has been GACed, but we are using the "published" path name
9840         ($prefix/mono/1.0/blah.exe) which happens to point to the real
9841         file in the GAC.
9842
9843         This was the source of the failure for the `xsp' command with the
9844         recent AppDomain changes, as far as the runtime was concerned,
9845         there were two different assemblies: $prefix/mono/1.0/blah.exe and
9846         $prefix/mono/gac/blah/version/blah.exe.
9847
9848         (do_mono_image_open): use full path
9849
9850 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9851
9852         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
9853
9854 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
9855
9856         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
9857         domain_id is supplied. Fix CID #241 and corlib's unit tests.
9858
9859 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9860
9861         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
9862         small structures. Fixes #78990.
9863
9864 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
9865
9866         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
9867
9868         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
9869
9870 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9871
9872         * appdomain.c:
9873         * marshal.c: don't load all the assemblies from a domain into newly
9874         created ones. The new domains might have different rules and load
9875         assemblies from different locations. Fixes bug #76757.
9876
9877         Patch by Lluis. Conflicts resolved by Brian Crowell.
9878
9879 2006-08-16  Alp Toker  <alp@atoker.com>
9880
9881         * socket-io.c: First half of the fix for #79084.
9882         Set sa_size to the length of the content, not that of the struct.
9883         Don't add NULL suffix to the content, this should be done in
9884         managed code if needed.
9885
9886 2006-08-14  Raja R Harinath  <rharinath@novell.com>
9887
9888         Fix part of #79012
9889         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
9890         mono_metadata_parse_type returns NULL.
9891
9892 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
9893
9894         * normalization-tables.h : new file for string normalization data.
9895         * locales.c, locales.h, icall.c :
9896           added load_normalization_resource() for string normalization,
9897           and icall as well.
9898         * Makefile.am : added normalization-tables.h to the sources.
9899
9900 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
9901
9902         * marshal.c: Add more helper functions to reduce code duplication and use them
9903         everywhere.
9904
9905 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
9906
9907         * marshal.c: Fix non-x86 stdcall warnings.
9908         
9909         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
9910         them everywhere.
9911
9912 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
9913
9914         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
9915         type check on multi-dimensional arrays. Fixes #79000.
9916
9917 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
9918
9919         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
9920         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
9921         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
9922         * class-internals.h: add is_com_object to class structure.
9923         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
9924         null checks to COM object marshalling. Fix .ctor call on RCW.
9925         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
9926         
9927         All code is contributed under the MIT/X11 license.
9928
9929 2006-08-09  Dick Porter  <dick@ximian.com>
9930
9931         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
9932         racing mono_monitor_allocator_lock() somewhere, so don't delete
9933         the critical section for now.  Found by running and exiting
9934         monodevelop.
9935
9936 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
9937
9938         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
9939         (ves_icall_System_ComObject_FindInterface): Ditto.
9940         (ves_icall_System_ComObject_CacheInterface): Ditto.
9941
9942         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
9943         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
9944
9945 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9946
9947         * threadpool.c: treat pipes from process asynchronous reads as sockets
9948         when reading from them, so we get select/poll or epoll to wait for
9949         data.
9950
9951 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
9952
9953         * loader.c: Fix a typo (CID #233) in the null check.
9954
9955 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
9956
9957         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
9958         Hopefully fixes #78949.
9959         
9960         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
9961         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
9962         bytes. Fixes #78972.
9963
9964 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9965
9966         * filewatcher.c: we need to set errno here.
9967
9968 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9969
9970         * filewatcher.c: let Win32Exception get the error value.
9971
9972 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9973
9974         * filewatcher.c: translate errno into win32 errors for Win32Exception
9975         to know what happened.
9976
9977 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
9978
9979         * threadpool.c: Fix more warnings.
9980
9981         * assembly.c (search_loaded): Fix warnings.
9982
9983         * threadpool.c (mono_thread_pool_finish): Fix warnings.
9984         (mono_async_invoke): Ditto.
9985
9986 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
9987
9988         * object.c (mono_remote_class_vtable): Need to create proxy vtable
9989         entries for __ComObject type in addition to ComImport types.
9990         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
9991         about hash table.
9992         
9993         All code is contributed under the MIT/X11 license.
9994
9995 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
9996
9997         * image.c: avoid tentative loading of modulerefs that contain
9998         no metadata (P/Invoke library names).
9999
10000 2006-07-28  Dick Porter  <dick@ximian.com>
10001
10002         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
10003         mono_loader_lock() somewhere, so don't delete the critical section
10004         for now.  Found by running and exiting monodevelop.
10005
10006 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10007
10008         * filewatcher.c: define the inotify syscalls when we're building on
10009         linux and have sys/syscall.h. The build system might not have support
10010         for inotify but the target system might have it.
10011
10012 2006-07-26  Miguel de Icaza  <miguel@novell.com>
10013
10014         * domain.c: Documentation updates.
10015
10016         * loader.c (mono_free_method): Do not release the method
10017         information if we are being profiled, as profilers will use this
10018         information at shut down to present some data to the user.
10019
10020         This is needed so that the profiler does not crash, as the
10021         profiler tends to keep MonoMethods around, and they might become
10022         invalid if we free these.
10023
10024         (mono_get_method_constrained): Return the original CIL stream
10025         method as well, so verification can be performed against it.
10026
10027 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10028
10029         * filewatcher.[ch]: support for inotify file system watcher.
10030         * icall.c: add new internal calls for the inotify file system watcher.
10031
10032 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10033
10034         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
10035         #78888.
10036
10037 2006-07-20  Dick Porter  <dick@ximian.com>
10038
10039         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
10040         warning.
10041
10042 2006-07-20  Dick Porter  <dick@ximian.com>
10043
10044         * threads.c (start_wrapper): Do the thread cleanup while we still
10045         hold a reference to its object.  Fixes bug 78123.
10046
10047 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
10048
10049         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
10050         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
10051           "managed-to-managed".
10052         * icall.c: Redirect string constructors that take sbyte* to
10053           ves_icall_System_String_ctor_RedirectToCreateString.
10054         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
10055           to CreateString () methods with matching signature.
10056         * reflection.c: Use original security informations for
10057           MONO_WRAPPER_MANAGED_TO_MANAGED.
10058         * security-manager.c: Use original security informations for
10059           MONO_WRAPPER_MANAGED_TO_MANAGED.
10060         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
10061           that is a placeholder and only its address should be used.
10062         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
10063           that is a placeholder and only its address should be used.
10064
10065 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
10066
10067         Begin implementing COM Interop.
10068         * appdomain.c: Increment corlib version.
10069         * class.c: Set ComImport classes' parent to __ComObject.
10070         * loader.c: Mark cominterop methods as such.
10071         * domain.c: Add __ComObject class to MonoDefaults structure.
10072         * image.c: Add 2 hashtables to the image for COM Interop related methods
10073         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
10074         using the mempool allocator
10075         
10076         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
10077         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
10078         declaration for mono_metadata_type_dup_mp.
10079         
10080         * debug-helpers.c: Added strings for two additional wrapper types
10081         * object.c: Create proxy objects for ComImport classes
10082         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
10083         and added __ComObject class to MonoDefaults structure.
10084         
10085         * object-internals.h: Finish MonoRealProxy definition, and add definition of
10086         MonoComInteropProxy and MonoComObject.
10087         
10088         * marshal.c: Added support for COM Interop
10089         (signature_cominterop): Converts managed signature to corresponding
10090         unmanaged COM signature.
10091         (cominterop_get_function_pointer): gets unmanaged function pointer via
10092         COM object vtable
10093         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
10094         (cominterop_get_method_interface): returns interface type that method is defined on
10095         (mono_mb_emit_cominterop_call): emits native call to function pointer
10096         gotten from vtable
10097         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
10098         that matches signature of unmanaged function.
10099         (cominterop_get_native_wrapper): wrapper around adjusted method call.
10100         (cominterop_get_invoke): forwards call from proxy to __ComObject
10101         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
10102         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
10103         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
10104         
10105         * marshal.h: Added Marshal icall declarations.
10106         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
10107         so we can access them in finalizer
10108         
10109 2006-07-14  Dick Porter  <dick@ximian.com>
10110
10111         * object.c (mono_type_initialization_cleanup): Fix a race
10112         condition by temporarily commenting out the critical section
10113         deletion.
10114
10115 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
10116
10117         * reflection.c (create_custom_attr): Fix some warnings.
10118         (create_custom_attr_data): Ditto.
10119         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
10120         types. Fixes #78855.
10121
10122 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
10123
10124         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
10125
10126         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
10127
10128 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
10129
10130         * reflection.c (resolve_object): Add support for DynamicMethod.
10131
10132         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
10133         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
10134
10135 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
10136
10137         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
10138         don't leak GPtrArray's pdata has we have no use (nor free) for it.
10139
10140 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
10141
10142         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
10143         Fixes #77888.
10144
10145 2006-06-30  Raja R Harinath  <rharinath@novell.com>
10146
10147         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
10148         slightly: remove a shadow local variable.
10149
10150 2006-06-29  Raja R Harinath  <rharinath@novell.com>
10151
10152         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
10153         definition that introduces the virtual function slot.
10154         Also fix Coverity #105.
10155
10156 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
10157
10158         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
10159         for dynamic assemblies. Fixes #78724.
10160
10161 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
10162
10163         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
10164         Fixes #78722.
10165
10166 2006-06-21  Martin Baulig  <martin@ximian.com>
10167
10168         * reflection.c
10169         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
10170         fixes #76484.
10171
10172 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
10173
10174         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
10175
10176 2006-06-20  Raja R Harinath  <rharinath@novell.com>
10177
10178         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
10179         nor TYPEREFs.
10180         * class.c (mono_class_create_from_typespec): Add 'context' argument.
10181         Inflate result if necessary.
10182         (mono_class_get_full): Remove old version.  Rename from
10183         'mono_class_get' and add 'context' argument.  Pass it to
10184         ..._create_from_typespec.
10185         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
10186         (mono_ldtoken): Revert change below.
10187
10188 2006-06-20  Martin Baulig  <martin@ximian.com>
10189
10190         * class.c (mono_ldtoken): Don't pass the generic context to
10191         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
10192
10193 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
10194
10195         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
10196         and later freeing it. Fixes #78638.
10197
10198 2006-06-15  Miguel de Icaza  <miguel@novell.com>
10199
10200         * icall.c (mono_class_get_throw): Revert over-zealous error
10201         throwing, the caller for mono_class_get_throw will cope with
10202         errors when classes are not properly initialized already.
10203
10204         The code still copes with loader exceptions though.
10205
10206         Fixes the regression in reftype1 and reftype3 from the CAS tests.
10207         
10208 2006-06-14  Miguel de Icaza  <miguel@novell.com>
10209
10210         Fixes the `make run1' version of RuntimeAbort (to be commited,
10211         source is in Bugzilla).
10212         
10213         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
10214         FALSE on class loading failure instead of returning true.
10215
10216         * class.c (mono_class_create_from_typedef): It is possible for
10217         mono_metadata_interfaces_from_typedef_full to fail if a class is
10218         not found, cope with this.
10219         
10220
10221 2006-06-14  Dick Porter  <dick@ximian.com>
10222
10223         * socket-io.c: 
10224         * process.c: Fix a bunch of signed/unsigned warnings from gcc
10225         4.1.1
10226
10227 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
10228
10229         * culture-info-table.h : oops, forgot to make it nsync with r61548.
10230
10231 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
10232
10233         * icall.c: Another fix for building mono in Visual Studio.
10234
10235 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
10236
10237         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
10238         
10239 2006-06-09  Martin Baulig  <martin@ximian.com>
10240
10241         * debug-mono-symfile.c: Put this back and really fix it this
10242         time. Sorry for all the trouble.
10243
10244 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
10245
10246         * icall.c (mono_class_get_throw): Fix a warning.
10247         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
10248         ReflectionTypeLoadException if needed. Fixes #78606.
10249
10250         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
10251         (mono_class_init): Ditto.
10252
10253         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
10254         ref_only exceptions.
10255         (mono_loader_clear_error): Make this work even if there is no error.
10256
10257 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
10258
10259         * object-internals.h marshal.c marshal.h icall.c: Implement method 
10260         Marshal.GetComSlotForMethodInfo using internal call.
10261
10262 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
10263
10264         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
10265         a function for signalling it.
10266
10267         * class.c (mono_class_from_typeref): Use the new kind of loader error when
10268         a referenced assembly is not found.
10269
10270         * loader.c (mono_loader_error_prepare_exception): Add support for 
10271         LOADER_ERROR_ASSEMBLY. Fix formatting.
10272
10273 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
10274
10275         * domain.c appdomain.c class-internals.h marshal.c: Add support 
10276         for VARIANT marshalling on windows and increment corlib version
10277         since Variant struct was added.
10278
10279 2006-06-03  Miguel de Icaza  <miguel@novell.com>
10280
10281         * debug-mono-symfile.c: Revert Martin's previous patch which broke
10282         stack trace line information:
10283
10284         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
10285         (Martin) when looking up B which is between A and C, return A not C.
10286
10287         Bug is #78573.
10288
10289         Thanks to Alexander Olk for tracking this down.
10290
10291 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
10292
10293         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
10294         
10295         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
10296         avoid clobbering its value.
10297         (mono_string_to_lpstr): Fix a warning on windows.
10298
10299 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
10300
10301         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
10302
10303         * reflection.c loader.c: Removed references to 'dummy' flag.
10304
10305         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
10306
10307         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
10308         it gets GC tracking.
10309
10310         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
10311         GC tracking.
10312         
10313         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
10314
10315         * marshal.c threadpool.c: Update callers of mono_async_result_new.
10316
10317         * appdomain.c: Bump corlib version.
10318
10319 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
10320
10321         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
10322         CEE_STIND_REF when working with object references.
10323
10324 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
10325
10326         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
10327         Fixes #78539.
10328
10329 2006-05-30  Miguel de Icaza  <miguel@novell.com>
10330
10331         * loader.c (method_from_memberref): Fix argument value for
10332         mono_loader_set_error_method_load (I was passing the MonoClass
10333         instead of the class name char *).
10334
10335 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
10336
10337         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
10338         CEE_STIND_REF when working with object references.
10339
10340 2006-05-30  Martin Baulig  <martin@ximian.com>
10341
10342         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
10343         mono_method_full_name() change and replace the ':' with a '.'
10344         here.
10345
10346 2006-05-30  Martin Baulig  <martin@ximian.com>
10347
10348         * debug-mono-symfile.c
10349         (mono_debug_symfile_lookup_location): Fix the algorithm:
10350         when looking up B which is between A and C, return A not C.
10351
10352 2006-05-29  Martin Baulig  <martin@ximian.com>
10353
10354         * mono-debug.h
10355         (MonoDebugMethodInfo): Make the typedef public.
10356         (MonoDebugSourceLocation): New public struct.
10357
10358         * mono-debug.c
10359         (mono_debug_source_location_from_address): Removed.
10360         (mono_debug_source_location_from_il_offset): Removed.
10361         (mono_debug_il_offset_from_address): Removed.
10362         (mono_debug_address_from_il_offset): Removed.
10363         (mono_debug_lookup_method): New public function.
10364         (mono_debug_lookup_source_location): New public function; replaces
10365         the old mono_debug_source_location_from_*() functions; see the
10366         inline documentation.
10367         (mono_debug_free_source_location): New public function.
10368         (mono_debug_print_stack_frame): New public function; see the
10369         inline documentation.
10370
10371         * debug-mono-symfile.c
10372         (mono_debug_find_source_location): Renamed into
10373         mono_debug_symfile_lookup_location(); only take a
10374         `MonoDebugMethodInfo *' and an `offset' argument; added inline
10375         documentation.
10376         (mono_debug_find_method): Renamed into
10377         mono_debug_symfile_lookup_method().
10378
10379 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
10380
10381         * assembly.c (mono_assembly_open_full): Dont overwrite the status
10382         returned by mono_image_open_full ().
10383
10384         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
10385         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
10386         #78517.
10387
10388         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
10389         #78518.
10390
10391 2006-05-27  Miguel de Icaza  <miguel@novell.com>
10392
10393         * class.c (mono_class_from_typeref): handle missing images
10394         earlier, deals with bug #78418.   Refactor code; 
10395
10396         Fix a warning introduced in my previous commit (some stale code
10397         from before I revisited my patch).
10398
10399         * class.c (mono_class_create_from_typedef): On failure, remove the
10400         class from the MonoImage->class_cache as the class is not
10401         initialized;   Fixes the leak pointed out by Paolo.
10402
10403 2006-05-25  Dick Porter  <dick@ximian.com>
10404
10405         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
10406         DeleteCriticalSections until I figure out which one may still be
10407         sometimes locked when mono_thread_cleanup is called.
10408
10409 2006-05-24  Dick Porter  <dick@ximian.com>
10410
10411         * threads.c (mono_thread_cleanup): Move the threading cleanup out
10412         of mono_thread_manage and back into its own function, so it can be
10413         called after the finalizer thread has finished.
10414
10415         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
10416
10417 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
10418
10419         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
10420         Fixes #78495.
10421
10422         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
10423         with non-blittable elements.
10424         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
10425
10426 2006-05-24  Martin Baulig  <martin@ximian.com>
10427
10428         * mono-debug-debugger.h (MonoDebuggerEvent): Added
10429         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
10430
10431         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
10432         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
10433         `mono_debugger_event_handler' to NULL.
10434
10435 2006-05-24  Martin Baulig  <martin@ximian.com>
10436
10437         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
10438
10439 2006-05-24  Martin Baulig  <martin@ximian.com>
10440
10441         * mono-debug-debugger.h
10442         (mono_debugger_create_notification_function): Added
10443         `MonoCodeManager *' argument.
10444
10445 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
10446
10447         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
10448
10449 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
10450
10451         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
10452         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
10453         implementation.
10454
10455 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
10456
10457         * icall.c: precise GC support: objects can't be stored in unmanaged
10458         memory anymore, even if they are kept alive by other references: since
10459         they can move the GC needs to be able to always find them.
10460
10461 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
10462
10463         * object.c: precise GC support for static fields. Support
10464         for moving GCs: write barriers and pinned allocation for interned
10465         strings.
10466
10467 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
10468
10469         * domain.c, domain-internals.h: precise GC support for the MonoDomain
10470         structure.
10471
10472 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
10473
10474         * class.c, gc.c: sgen and precise GC updates.
10475
10476 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
10477
10478         * marshal.h, marshal.c: added write barrier wrapper and precise type
10479         fixes.
10480
10481 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
10482
10483         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
10484         support.
10485
10486 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
10487
10488         * reflection.c: precise and sgen GC updates.
10489
10490 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
10491
10492         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
10493
10494 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
10495
10496         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
10497
10498 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
10499
10500         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
10501         MONO_TYPE_OBJECT. Fixes #78462.
10502
10503 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
10504
10505         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
10506         and blittable types.
10507
10508 2006-05-17  Miguel de Icaza  <miguel@novell.com>
10509
10510         * class.c (mono_class_get_exception_for_failure): Implement parts
10511         of a TODO: if the loader error is set (instead of the class
10512         error), we return a Loader exception that can be properly thrown
10513         elsewhere.
10514
10515         This was exposed by some Winforms 2.0 code that I tried to run
10516         (Atsushi pointed me to it).
10517
10518 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
10519
10520         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
10521         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
10522         
10523         * marshal.c (emit_marshal_vtype): Add limited support for 
10524         UnmanagedType.LPStruct. Fixes #78427.
10525
10526         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
10527         Applied a patch from kangaroo to fix #77523.
10528
10529 2006-05-17  Martin Baulig  <martin@ximian.com>
10530
10531         * threads.c
10532         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
10533         (debugger_thread_created): Removed.
10534         (debugger_thread_exited): Removed.
10535
10536 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
10537
10538         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10539
10540         * object-internals.h (MonoReflectionResource): Sync with managed version.
10541
10542 2006-05-12  Wade Berrier <wberrier@novell.com>
10543
10544         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
10545
10546 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
10547
10548         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
10549         functions try to allocate from the image mempool.
10550
10551 2006-05-12  Dick Porter  <dick@ximian.com>
10552
10553         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
10554
10555 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
10556
10557         * object.c: The FieldGetter and FieldSetter methods require the full
10558         name of the class, not only the name. Fixes bug #78277.
10559
10560 2006-05-11  Miguel de Icaza  <miguel@novell.com>
10561
10562         * loader.c (method_from_memberref): Do not pass the NULL klass to
10563         mono_loader_set_error_() methods.  Pass the non-NULL value
10564         (class). 
10565
10566 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
10567
10568         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
10569         (mono_assembly_close): Null out assembly->image->references after freeing it.
10570
10571         * image.c (mono_image_close): Free image->references.
10572         
10573         * reflection.c (mono_image_basic_init): Fix a small memory leak.
10574
10575 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
10576
10577         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
10578         before checking if it's NULL (g_assert).
10579
10580 2006-05-10  Martin Baulig  <martin@ximian.com>
10581
10582         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
10583         I thought I already killed that two months ago, but now it somehow reappeared.
10584
10585 2006-05-10  Martin Baulig  <martin@ximian.com>
10586
10587         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
10588
10589 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
10590
10591         * reflection.c: Allocate memory for dynamically created methods in the image
10592         mempools.
10593
10594 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
10595
10596         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
10597         don't use the ad pointer before checking if it's NULL (g_assert).
10598
10599 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
10600
10601         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
10602         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
10603
10604         * marshal.c: Allocate all signatures from mempools.
10605
10606         * marshal.c: Allocate some more signatures from mempools.
10607
10608 2006-05-09  Miguel de Icaza  <miguel@novell.com>
10609
10610         * object.c (mono_load_remote_field): The code used to provide a
10611         temporary variable for returning results if the user did not
10612         provide a result pointer.  But our temporary variable was allocted
10613         on the satck.
10614
10615         Fix calling code to always pass a result area.   Coverity ID 103.
10616
10617 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
10618
10619         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
10620         value, not the old. Fixes #78312.
10621         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
10622
10623         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
10624         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
10625         per-image cache.
10626
10627         * assembly.c (mono_assembly_close): Free image->references.
10628
10629         * assembly.c (mono_assembly_names_equal): Fix a warning.
10630         (mono_assemblies_cleanup): Cleanup more global data.
10631
10632         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
10633
10634         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
10635         ptr_cache and image->modules.
10636
10637         * image.c (mono_image_init): Allocate array_cache lazily.
10638         
10639 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10640
10641         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
10642         behavior was changed recently and has bad side effects.
10643
10644 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
10645
10646         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
10647         
10648         * assembly.c (mono_assembly_close): Remove a debug printf.
10649
10650         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
10651
10652         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
10653         to also allow for temporary references between mono_image_open ()/close ().
10654
10655         * domain.c (get_runtimes_from_exe): Add a FIXME.        
10656
10657 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
10658
10659         * marshal.c: Fix support for dynamic methods.
10660
10661         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
10662
10663         * marshal.c (mono_marshal_cleanup): New cleanup function.
10664
10665         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
10666         image mempools.
10667
10668         * class.c (mono_class_init): Fix leaking class->nested_classes.
10669
10670         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
10671
10672         * image.c (mono_image_init): Initialize the new cashes.
10673
10674         * image.c (mono_image_close): Destroy the new cashes.
10675
10676         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
10677
10678         * mempool.c (mono_mempool_strdup): New helper function.
10679
10680         * class-internals.h: Add prototype for mono_loader_unlock ().
10681
10682         * domain.c (mono_jit_info_table_find): Fix a warning.
10683         (mono_debugger_check_runtime_version): Ditto.
10684
10685         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
10686         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
10687         functions to these modules.
10688
10689         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
10690         metadata modules.
10691         
10692         * marshal.c (mono_free_bstr): Fix a warning.
10693
10694         * assembly.c (mono_assembly_open_full): Fix another small leak.
10695
10696         * object.c: Fix some unload leaks in the remoting code.
10697
10698         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
10699         function.
10700
10701         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
10702
10703         * reflection.c: Fix some unload leaks in dynamic assemblies.
10704
10705 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
10706
10707         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
10708         * marshal.h: Add BSTR support on Win32
10709         * icall.c: Add BSTR icalls
10710         * metadata.h: Add BSTR enums
10711
10712 2006-04-28  Miguel de Icaza  <miguel@novell.com>
10713
10714         Work to catch the crash from #76795 and turn it into an
10715         exception.   As I stubbed out pieces of the VisualBasic support,
10716         I found a number of places where the code was failing and I added
10717         checks to those places. 
10718         
10719         * metadata.c (do_mono_metadata_parse_generic_class): Make this
10720         function return a status code.  If we fail to parse the signature
10721         from mono_metadata_parse_generic_inst, return FALSE.
10722
10723         * loader.c (mono_get_method_from_token): If we fail to load the
10724         method (mono_class_get) return NULL.   
10725
10726         * (method_from_memberref): Return NULL if we are unable to parse
10727         the method signature
10728
10729         (mono_loader_error_prepare_exception): Since we now use the
10730         loader_error flag internally to stop processing, and obtaining
10731         exceptions that might be thrown will walk this code path the
10732         proper way of going from a MonoLoaderError into a
10733         MonoException was convoluted.   This new routine encapsulates the
10734         process of turning the error into an exception and *clearing* the
10735         error afterwards.
10736         
10737 2006-04-27  Miguel de Icaza  <miguel@novell.com>
10738
10739         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
10740         with missing assemblies), and to cope with:
10741
10742                 * Missing fieldref from a non-existing assembly.
10743                 * Missing methodref from a non-existing assembly.
10744
10745         The first batch of work to address *some* of the issues from 76661.
10746         
10747         * object.c (mono_class_create_runtime_vtable): If we fail to
10748         initialize the class raise the exception here. 
10749
10750         * metadata.c (mono_class_get_overrides_full): If any methods fail
10751         to load return the failure to the caller.
10752
10753         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
10754         flagging assemblies that failed to load.   
10755
10756         Do not crash if we are unable to load the assembly.
10757
10758         (mono_assembly_close): Do nothing with REFERENCE_MISSING
10759         assemblies. 
10760
10761         * loader.c (mono_loader_set_error_type_load): Change the
10762         convention to always pass unallocated strings, so we make our own
10763         copies (I know our own code had duplicated strings before, but
10764         this keeps the normal conventions).
10765         (method_from_memberref): Call mono_loader_set_error_method_load
10766         for all possible failures of loading the class. 
10767         Remove assert, turn into a loader error.
10768
10769         (mono_loader_error_to_exception): Move this routine from mini
10770         (mini_loader_error_to_exception) there was no need to have that in
10771         mini. 
10772
10773         * class.c (mono_class_from_typeref): If we were not able to load
10774         the assembly with mono_assembly_load_reference, call the
10775         mono_loader_set_error_type_load to register the problem.
10776
10777         (mono_class_setup_fields): If we fail to load the type from
10778         mono_metadata_parse_type_full, call mono_class_set_failure and
10779         break from the loop.
10780
10781         If class->exception_type is set, we do not layout the fields as
10782         that might crash the runtime, and instead return (from breaking
10783         from the previous loop).
10784
10785         (mono_class_setup_vtable): This now returns a boolean indicating
10786         whether the table was properly setup.   The decision is driven by
10787         mono_class_get_overrides_full which might run into non-existing
10788         methods. 
10789         
10790         (mono_class_init): Returns TRUE on success or FALSE if there was a
10791         problem in loading the type (incorrect assemblies, missing
10792         assemblies, methods, etc).
10793
10794         When we call mono_class_setup_fields we also check for a potential
10795         error inside this call (either a class exception or a general
10796         loader exception).
10797
10798         (mono_class_create_from_typedef): If the parent fails to load
10799         (calling mono_class_get_full) return NULL.
10800         
10801         ** Important **
10802
10803         calls to mono_metadata_parse_type_full should be checked
10804         everywhere and set the mono_class_set_failure
10805         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
10806
10807         The current patch checks the places where my manually constructed
10808         tests show the errors are showing up, but we should do it
10809         everywhere. 
10810
10811         ** Important2 **
10812
10813         mono_class_init return values should be tested everywhere, like
10814         the previous case this is something that we should audit
10815         everywhere and not only on the cases exposed by the tests I
10816         created. 
10817
10818 2006-04-26  Miguel de Icaza  <miguel@novell.com>
10819
10820         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
10821         boolean parameter and instead pass the information on `options'
10822         parameter (FileOptions).
10823
10824         * icall.c: Register the new signature for MonoIO.Open.
10825
10826         * debug-helpers.c (dis_one): Trying to understand how coverity
10827         works.  Fix Run 5, item 78.
10828
10829 2006-04-26  Dick Porter  <dick@ximian.com>
10830
10831         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
10832         dereference.
10833
10834 2006-04-25  Martin Baulig  <martin@ximian.com>
10835
10836         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
10837
10838         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
10839         debugger_thread_created().
10840         (debugger_gc_push_all_stacks): Don't handle the main thread in any
10841         special way.
10842         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
10843         (mono_debugger_finalize_threads): New function; undo the effects
10844         of mono_debugger_init_threads().
10845         (mono_debugger_create_all_threads): Removed.
10846
10847 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
10848
10849         * image.c (mono_image_close): Tidy up trace messages.
10850
10851         * assembly.c (mono_assembly_close): Ditto.
10852
10853         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
10854         no longer references an already freed assembly. Fixes #78168.
10855
10856 2006-04-21  Dick Porter  <dick@ximian.com>
10857
10858         * threads.c (mono_thread_detach): Fix reference counting when
10859         detaching threads.
10860
10861 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
10862
10863         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
10864         #78155.
10865
10866 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
10867
10868         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
10869         (mono_type_to_stind): Ditto.
10870
10871         * marshal.c: Use the new helper functions to simplify code.
10872
10873         * image.c (mono_image_close): Add some code for help debug assembly unloading
10874         problems.
10875
10876         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
10877         image mempool.
10878
10879         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
10880         assembly was already loaded in another appdomain. Fixes #78083.
10881
10882 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
10883
10884         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
10885         referenced assemblies.
10886         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
10887
10888         * domain.c (mono_domain_free): Add a trace message.
10889
10890         * appdomain.c (add_assemblies_to_domain): Ditto.        
10891
10892         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
10893         field.  
10894
10895 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
10896
10897         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
10898
10899 2006-04-12  Martin Baulig  <martin@ximian.com>
10900
10901         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
10902         `USE_INCLUDED_LIBGC'.   
10903
10904 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
10905
10906         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
10907         the patch contains ../ and a small directory name later. Hopefully fixes
10908         #78035.
10909
10910 2006-04-10  Martin Baulig  <martin@ximian.com>
10911
10912         Clean up the debugger's thread-handling code.
10913
10914         The debugger's thread-handling code has been moved from
10915         ../mini/debug-debugger.c to threads.c.  We now iterate directly
10916         over the `threads' hash, keep track of exiting threads and also
10917         use proper locking.
10918
10919         We can now debug XSP and XSP based applications with the debugger.
10920
10921         * object-internals.h (MonoThread): Added `gpointer end_stack'.
10922
10923         * threads.h
10924         (MonoThreadCallbacks): Removed; this was only used by the debugger.
10925         (mono_install_thread_callbacks): Likewise.      
10926
10927         * threads.c (mono_thread_callbacks): Removed.
10928         (debugger_thread_created, debugger_thread_exited): New static functions.
10929         (start_wrapper): Call debugger_thread_created().
10930         (thread_cleanup): Call debugger_thread_exited().
10931         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
10932         (mono_debugger_init_threads): New public function.
10933         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
10934         iterate directly over the `threads' hash and also use proper locking.
10935
10936         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
10937
10938         * mono-debug-debugger.h
10939         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
10940
10941 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
10942
10943         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
10944         argument type=array. Fixes #78057.
10945
10946 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
10947
10948         * culture-info-table.h : regenerated. Fixed bug #69652.
10949
10950 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
10951
10952         * loader.c metadata.c: Reapply a variant r59116.
10953         
10954         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
10955
10956         * class.c (mono_class_setup_interface_offsets): New internal function.
10957
10958         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
10959         interfaces too. Fixes #77398.
10960
10961         * reflection.c (encode_cattr_value): Add support for 
10962         parameter type=object, argument type=array.
10963         (load_cattr_value): Ditto. Fixes #77916.
10964
10965         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
10966         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
10967
10968         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
10969         a byval char array and CharSet is Ansi.
10970
10971         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
10972
10973 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
10974
10975         * metadata.c: Add some locking comments.
10976         
10977         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
10978         mempool.
10979         (mono_metadata_free_method_signature): Don't free the signature itself.
10980
10981         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
10982
10983         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
10984         reference the same MonoImage.
10985         (mono_assembly_load_from_full): Add an assert.
10986
10987 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
10988
10989         * image.c (mono_image_close): Don't put the image we are about to free into the
10990         loaded_images_guid_hash.
10991
10992         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
10993         to reduce code duplication.
10994
10995         * marshal.c: Register the native functions called by this module as icalls, to
10996         somewhat centralize the creation of MonoMethodSignature's.
10997
10998         * loader.c (mono_method_signature): Add a cache for method signatures.
10999
11000         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
11001         the parameter attributes of a method.
11002         (mono_metadata_parse_method_signature_full): Refactored the computation of
11003         parameter attributes into a separate function. Also avoid one allocation in
11004         most cases.
11005
11006         * assembly.c (mono_assembly_close): Ditto.
11007
11008         * image.c (mono_image_close): Log trace messages with INFO level.
11009
11010         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
11011
11012         * image.c reflection.c: Correct reference counting of image modules.
11013         
11014         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
11015         of this function from the image mempool.
11016         
11017         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
11018         to allow more cached types to be used.
11019
11020         * mono-debug.c (mono_debug_add_method): Appled patch from
11021         David S. Miller  <davem@sunset.davemloft.net>: Access 
11022         minfo->lexical_blocks[] entry elements using read32().
11023
11024 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
11025
11026         * loader.c (mono_free_method): No longer free the method header for non-dynamic
11027         methods as it is allocated from the mempool.
11028
11029         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
11030         image mempool.
11031
11032         * metadata-internals.h: Add comments describing the reference counting scheme
11033         used for MonoImage and MonoAssembly.
11034
11035         * image.c assembly.c reflection.c: Rework reference counting of images and 
11036         assemblies so they are freed when the runtime is shut down. Free some 
11037         additional memory structures when an image is unloaded.
11038         
11039 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
11040
11041         * class.c loader.c reflection.c: Allocate more data structures in
11042         the image mempool.
11043
11044 2006-03-31  Miguel de Icaza  <miguel@novell.com>
11045
11046         * icall.c
11047         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
11048         build on pre glib 2.4 systems.
11049
11050 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
11051
11052         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
11053
11054         * icall.c: Fix some warnings.
11055
11056 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
11057
11058         * culture-info-table.h : regenerated.
11059
11060 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
11061
11062         * threads.c, object-internals.h, verify.c: changed the culture caching
11063         code to use a normal MonoArray for storage so the GC can keep track of
11064         them easily. Fixed bits of the cache logic, too and simplified the
11065         code.
11066
11067 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
11068
11069         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
11070         thread for non-Boehm GCs.
11071
11072 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
11073
11074         * domain.c, object.c, domain-internals.h: reduce the amount of memory
11075         needed to keep track of the data for static fields.
11076
11077 2006-03-29  Raja R Harinath  <rharinath@novell.com>
11078
11079         Fix #75172
11080         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
11081         for interface classes.  Use 'num_methods' instead.
11082         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
11083         before using '->vtable_size' field.
11084
11085 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
11086
11087         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
11088         doesn't contain managed pointers, so use a normal hashtable.
11089
11090 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
11091
11092         * reflection.c, class-internals.h, domain.c: fixed handling of types
11093         used as values for objects in custom attributes (bug #77915):
11094
11095 2006-03-24  Martin Baulig  <martin@ximian.com>
11096
11097         * class.c (mono_class_setup_fields): Added support for generic
11098         instances; fixes #77580.
11099
11100 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11101
11102         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
11103
11104 2006-03-24  Dick Porter  <dick@ximian.com>
11105
11106         * file-io.c (get_file_attributes): More stat macro breakage.
11107         Fixes bug 77759.
11108
11109 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
11110
11111         * profiler.c: added the file=filename option in the default profiler
11112         to output the profile data to filename.
11113
11114 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11115
11116         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
11117         bug #77877.
11118
11119 2006-03-22  Martin Baulig  <martin@ximian.com>
11120
11121         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
11122         allocated `MonoClassField *' in `fb->handle'.
11123
11124 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
11125
11126         * class.c, image.c, metadata-internals.h: implemented new mechanism to
11127         allocate interface ID to save memory and allow better ID reuse on
11128         appdomain unload. setup_generic_vtable () removal from Martin.
11129
11130 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
11131
11132         * object.h, appdomain.c, domain.c, exception.c, icall.c,
11133         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
11134         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
11135         write barriers for reference stores with managed objects accessed with
11136         C structures in the runtime and in embedding programs.
11137
11138 2006-03-20  Raja R Harinath  <rharinath@novell.com>
11139
11140         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
11141         'interface_id' and 'max_interface_id' fields of MonoClasses
11142         representing open generic types.
11143
11144 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
11145
11146         * object.h, object.c, icall.c: added functions to deal with
11147         storing valuetypes that contain references in managed objects.
11148         * reflection.c, string-icalls.c, threads.c, marshal.c: small
11149         fixes and comments around uses of mono_array_addr ().
11150
11151 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
11152
11153         * object.h, icall.c, monitor.c: object.GetHashCode ()
11154         implementation that supports the moving garbage collector.
11155
11156 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
11157
11158         * icall.c, threads-types.h, threads.c: implemented finalizer for
11159         LocalDataStoreSlot.
11160
11161 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
11162
11163         * metadata.c (mono_type_size): Add a fixme.
11164         (mono_type_stack_size): Ditto.
11165
11166         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
11167         'type_forwarders' field.
11168
11169         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
11170         attribute from net 2.0.
11171
11172         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
11173         from class.c.
11174
11175         * class.c (mono_class_setup_fields): Fix a warning.
11176         
11177         * class.c (mono_class_from_name): Add support for assemblyref entries
11178         in the EXPORTEDTYPE table.
11179
11180         * reflection.c: Add support for handling type forwarders under net 2.0.
11181
11182         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
11183         
11184 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
11185
11186         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
11187         overwriting entries in ModuleBuild->types, also clean up the code
11188         a little. Fixes #77774.
11189
11190 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
11191
11192         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
11193         load friend assembly info when present.
11194
11195 2006-03-14  Raja R Harinath  <rharinath@novell.com>
11196
11197         Fix crasher on gtest-158.cs.
11198         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
11199         the return value if the MonoClass we want is yet in an
11200         inconsistent state.
11201         * class.c (mono_class_create_from_typedef): Add an comment
11202         explaining an order dependency between mono_class_setup_parent and
11203         mono_class_setup_mono_type.
11204
11205 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
11206
11207         * class.c: documentation updates and events bug fix.
11208
11209 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
11210
11211         * class.c: some cleanup, locking fixes.
11212
11213 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
11214
11215         * class.c: fix the generics code to setup nested
11216         type info to the instantiated type (bug #77770).
11217
11218 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
11219
11220         * marshal.c: fixed a few type correctness issues.
11221
11222 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
11223
11224         * loader.c: the Set/Get/Addrtess array methods should be public.
11225
11226 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
11227
11228         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
11229         
11230         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
11231         info->wrapper.
11232
11233 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
11234
11235         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
11236
11237         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
11238
11239         * mempool.c (mono_mempool_alloc): Speed this up a bit.
11240         (mono_mempool_alloc0): Ditto.
11241
11242 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11243
11244         * socket-io.c:
11245         (create_object_from_sockaddr): it was allocating 4 extra bytes
11246         for the AF_UNIX data. Fixes bug #77747.
11247
11248 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
11249
11250         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
11251
11252 2006-03-09  Dick Porter  <dick@ximian.com>
11253
11254         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
11255         Fixes bug 76966 again.
11256
11257 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
11258
11259         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
11260         names from r57532
11261         * appdomain.c: Bumped corlib version to 48 (due to r57532)
11262
11263 2006-03-07  Martin Baulig  <martin@ximian.com>
11264
11265         * object.c
11266         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
11267
11268 2006-03-07  Martin Baulig  <martin@ximian.com>
11269
11270         * class.c
11271         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
11272         regression introduced in r56970; see gtest-252.cs.
11273
11274         * loader.c (mono_get_method_constrained): Correctly handle generic
11275         methods; see gtest-253.cs.
11276
11277 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
11278
11279         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
11280
11281 2006-03-04  Martin Baulig  <martin@ximian.com>
11282
11283         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
11284         compute the parent type at runtime, just like we're already doing
11285         it for interfaces.
11286
11287         * reflection.c
11288         (mono_reflection_bind_generic_parameters): Don't compute the
11289         parent type anymore.
11290
11291         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
11292
11293 2006-03-04  Martin Baulig  <martin@ximian.com>
11294
11295         * mono-debug-debugger.h
11296         (mono_debugger_create_notification_function): Allocate memory at
11297         runtime and return a pointer to it.
11298
11299 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
11300
11301         * assembly.c: Fix windows build.
11302         
11303         * assembly.c: Fix build.
11304
11305         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
11306
11307         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
11308         
11309 2006-03-03  Dick Porter  <dick@ximian.com>
11310
11311         * process.c
11312         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
11313         Check parameters before dereferencing them.  Fixes Aaron's part of
11314         bug 77393.
11315
11316 2006-03-03  Raja R Harinath  <rharinath@novell.com>
11317
11318         Fix performance regression.
11319         * loader.c (find_method_in_class): Add 'from_class' argument.
11320         Rename 'klass' argument to 'in_class'.  The signature is compared
11321         against the method in 'in_class', and the corresponding method is
11322         returned from 'from_class'.
11323         (find_method): Walk both 'in_class' and 'from_class' in parallel.
11324         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
11325         type definition and generic instantiation in parallel.
11326         (mono_get_method_constrained): Update to changes.
11327
11328 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
11329
11330         * threads.c: make sure the domain is correct, too when doing
11331         mono_thread_attach ().
11332
11333 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
11334
11335         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
11336         windows. Fixes #77683.
11337
11338 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
11339
11340         * object.h, *: introduced specific way to set elements of an array
11341         of references to be used as write barrier. Still need to audit the
11342         uses of mono_array_addr.
11343
11344 2006-03-01  Miguel de Icaza  <miguel@novell.com>
11345
11346         * object-internals.h: New field to cache the assmebly name, patch
11347         from Tambet Ingo (tambet@ximian.com)
11348
11349 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
11350
11351         * decimal.h, class-internals.h, metadata-internals.h,
11352         file-io.h: mark a few function declarations as internal, to
11353         reduce the number of PLT entries.
11354
11355 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11356
11357         * file-io.c: fix typo in warning message.
11358
11359 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
11360
11361         * loader.c: on unix, lookup the "*A" version of a function
11362         if charset is auto as a second option before failing.
11363
11364 2006-02-28  Raja R Harinath  <rharinath@novell.com>
11365
11366         * class.h (mono_class_inflate_generic_method): Revert to two
11367         argument version.
11368         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
11369         (mono_class_inflate_generic_method_full): Add.
11370         * class.c (mono_class_inflate_generic_method_full): Rename from
11371         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
11372         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
11373         * loader.c, reflection.c: Update to changes.
11374
11375 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
11376
11377         * icall.c: const fixes and small improvements.
11378
11379 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11380
11381         * threadpool.c: for asynchronous connect(), enable the same workaround
11382         for BSD 6 as for the Mac. Fixes bug #77637.
11383
11384 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
11385
11386         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
11387         formatted classes. Fixes #77524.
11388
11389 2006-02-24  Raja R Harinath  <rharinath@novell.com>
11390
11391         * class.c (inflate_generic_type): Add a couple more
11392         micro-optimizations.
11393         (inflate_generic_context): Don't use the 'gmethod' from
11394         'inflate_with'.
11395         (mono_class_inflate_generic_method): If the method has generic
11396         parameters, but the passed-in context doesn't have a 'gmethod',
11397         create one.  Use the possibly simplified generic instantiation
11398         from the declaring class instead of the one passed in.
11399
11400 2006-02-24  Raja R Harinath  <harinath@gmail.com>
11401
11402         Make generic method signature and method header handling lazy.
11403         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
11404         (inflate_generic_header): Likewise.
11405         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
11406         parameter to avoid inflating types.
11407         (mono_get_inflated_method): Empty out.
11408         * class.h (mono_class_inflate_generic_method): Update to changes.
11409         * loader.c (mono_get_method_from_token): Don't parse signature for
11410         generic methods, nor methods of generic classes.
11411         (mono_method_signature): Rename from 'mono_method_signature'.
11412         Inflate signature on demand.
11413         (mono_method_get_header): Inflate method header on demand.
11414         * reflection.c: Update to changes.
11415
11416 2006-02-23  Raja R Harinath  <rharinath@novell.com>
11417
11418         * metadata.c (mono_metadata_inflate_generic_inst): If the
11419         instantiation is closed, don't bother expanding it in the new
11420         context.
11421         * class.c (inflate_generic_class): If the generic instantiation
11422         doesn't change after inflation, return the argument itself.
11423         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
11424         Add bounds checks.
11425         (inflate_generic_context): If neither the generic class nor the
11426         generic method instantiations change, return the original context.
11427         * reflection.c (mono_method_get_object): Do
11428         'mono_get_inflated_method' before accessing the ->klass field.
11429         (inflate_mono_method): Don't create a MonoGenericMethod unless
11430         necessary.
11431         (inflate_method): Don't pass a constructed type as the declaring
11432         type of a methodbuilder.
11433
11434 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
11435
11436         * object.c: fix memory overwrite.
11437
11438 2006-02-22  Dick Porter  <dick@ximian.com>
11439
11440         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
11441         it doesn't work any more.
11442         (mono_threads_request_thread_dump): Fix unused variable warnings.
11443
11444 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
11445
11446         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
11447         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
11448         the public header file.
11449
11450 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
11451
11452         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
11453
11454 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
11455
11456         * class-internals.h, object.c: reduce the size of MonoVTable
11457         and store the interface_offsets array at negative offsets.
11458
11459 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
11460
11461         * metadata.c: tweak table descriptors data structures to reduce
11462         size and runtime relocations.
11463
11464 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
11465
11466         * marshal.c: fix some types and opcodes to be type-safe
11467         in marshaling wrappers.
11468
11469 2006-02-21  Ankit Jain  <jankit@novell.com>
11470
11471         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
11472
11473 2006-02-21  Raja R Harinath  <rharinath@novell.com>
11474
11475         * metadata.c (get_constraints): Relax debugging checks for monodis.
11476
11477 2006-02-21  Ankit Jain  <jankit@novell.com>
11478
11479         * metadata.c (mono_metadata_load_generic_params): Move the code
11480         checking for ambiguous generic params from here to mono/dis/get.c
11481         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
11482
11483 2006-02-21  Raja R Harinath  <harinath@gmail.com>
11484
11485         Fix assertion triggered when compiling nemerle.
11486         * class.c (mono_get_shared_generic_inst): Rename from
11487         get_shared_inst and make non-static.
11488         * loader.c (mono_get_shared_generic_method): New.  Used to create
11489         the MonoGenericContext-equivalent of a MonoGenericContainer.
11490         (mono_get_method_from_token): Initialize the 'context' field of
11491         the created MonoGenericContainer.
11492         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
11493         * metadata.c (get_constraints): Add sanity check.
11494         * class-internals.h: Add new internal methods.
11495
11496         * reflection.c (verify_safe_for_managed_space): New sanity check.
11497         Currently checks that owner-less generic parameters aren't allowed
11498         in managed space.
11499         (mono_type_get_object): Use it.
11500         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
11501         that are now in mono_type_get_object.
11502         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
11503
11504 2006-02-19  Raja R Harinath  <harinath@gmail.com>
11505
11506         * metadata.c (mono_type_create_from_typespec): Rename from
11507         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
11508         argument and caching of types in the generic container.
11509         (unwrap_arrays, find_generic_param): Remove.
11510         * metadata-internals.h: Update.
11511         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
11512
11513 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
11514
11515         * class.c (mono_class_get_exception_for_failure): Fix a warning.
11516
11517         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
11518         return values. Fixes #77581.
11519
11520         * class.c (mono_fnptr_class_get): Switch name and name_space.
11521
11522         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
11523         classes and add support for [In, Out] attributes.
11524         (mono_marshal_free_asany): Ditto. Fixes #77524.
11525
11526 2006-02-18  Raja R Harinath  <harinath@gmail.com>
11527
11528         * class.c (mono_class_from_generic_parameter): Make more robust to
11529         incomplete MonoGenericContainers from monodis.
11530
11531 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
11532
11533         * class-internals.h: added some more exception types.
11534         * class.c, metadata.c: added a few checks to handle missing
11535         types.
11536
11537 2006-02-17  Raja R Harinath  <rharinath@novell.com>
11538
11539         Use owner-less generic-params some more.
11540         * class.c (my_mono_class_from_generic_parameter): Remove.
11541         (mono_class_from_generic_parameter): Handle null image,
11542         param->name and param->owner.
11543         (mono_class_from_mono_type): Update.
11544         (mono_class_create_from_typespec): Remove 'container' parameter.
11545         If that parameter is non-null, the result is always inflated by
11546         'mono_class_get_full' anyway.
11547         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
11548         parameter.
11549         (mono_class_get_full): Update.
11550
11551         * class.c (inflate_generic_type) [GENERICINST]: If the generic
11552         instance is not open, don't bother inflating.
11553         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
11554         parse metadata for inflated classes.
11555         (_mono_class_get): Change GenericContext* parameter to
11556         GenericContainer*.
11557         (mono_class_create_from_typespec): Likewise.  Simplify, and
11558         implement trivially.  All the cases are handled in
11559         mono_class_from_mono_type.  Don't inflate returned class.
11560         (mono_class_get_full): Delegate GENERICINST optimization to
11561         inflate_generic_type.
11562         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
11563
11564 2006-02-16  Dick Porter  <dick@ximian.com>
11565
11566         * socket-io.c (create_object_from_sockaddr): Fix typo.
11567         (create_sockaddr_from_object): Check array lengths before
11568         potentially accessing items off the end.
11569         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
11570         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
11571         (ves_icall_System_Net_Sockets_Socket_Send_internal)
11572         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
11573         length checks to avoid wraparound overflows.
11574         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
11575         contents of the array of sockets
11576         (hostent_to_IPHostEntry2)
11577         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
11578         Check return value of inet_ntop ().
11579         (addrinfo_to_IPHostEntry): Fix typo
11580
11581 2006-02-16  Raja R Harinath  <rharinath@novell.com>
11582
11583         Type metadata parsing doesn't use generic-instantiation information.
11584         * metadata.c (mono_metadata_parse_array_full): Change
11585         MonoGenericContext* parameter to MonoGenericContainer*.
11586         (mono_metadata_parse_type_full): Likewise.
11587         (mono_type_create_from_typespec_full): Likewise.
11588         (mono_metadata_parse_mh_full): Likewise.
11589         (mono_metadata_parse_generic_inst): Likewise.
11590         (do_mono_metadata_parse_generic_class): Likewise.
11591         (do_mono_metadata_parse_type): Likewise.
11592         * metadata-internals.h: Update to changes.
11593         * class.c (mono_class_find_enum_basetype): Likewise.
11594         (mono_class_setup_fields): Likewise.
11595         (mono_class_create_from_typespec): Likewise.
11596         * loader.c (method_from_methodspec): Likewise.
11597         (mono_get_method_from_token): Likewise.
11598         (mono_method_get_header): Likewise.
11599
11600 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
11601
11602         * marshal.c: handle additional GENERICINST case (patch from
11603         Thong Nguyen <tum@veridicus.com>).
11604         Fix a few cases where LDIND_I/STIND_I was used for references.
11605
11606 2006-02-16  Raja R Harinath  <rharinath@novell.com>
11607
11608         * reflection.c (mono_reflection_get_token): Remove unused variable.
11609
11610 2006-02-16  Martin Baulig  <martin@ximian.com>
11611
11612         * reflection.c (mono_reflection_get_token): Add support for fields
11613         in instantiated generic types.
11614
11615         * icall.c
11616         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
11617
11618 2006-02-15  Martin Baulig  <martin@ximian.com>
11619
11620         * icall.c
11621         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
11622         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
11623         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
11624         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
11625
11626 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
11627
11628         * class.c, metadata.c, metadata.h, object.c, icall.c,
11629         marshal.c: changed mono_type_get_underlying_type () to do
11630         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
11631         Fixed handling of instantiated generic valuetypes (bug #75479).
11632
11633 2006-02-15  Raja R Harinath  <rharinath@novell.com>
11634
11635         * metadata.c (mono_metadata_decode_signed_value): Simplify.
11636         Delegate to mono_metadata_decode_value, and work on the returned value.
11637
11638         * icall.c (ves_icall_MonoType_GetGenericArguments):
11639         Add consistency check here too.
11640         
11641 2006-02-15  Ankit Jain  <jankit@novell.com>
11642
11643         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
11644         char/short etc.
11645
11646 2006-02-15  Ankit Jain  <jankit@novell.com>
11647
11648         * metadata.c (mono_metadata_decode_signed_value): New function to decode
11649         signed values, used only for representing lower bounds of arrays.
11650         (mono_metadata_parse_array_full): Use new
11651         mono_metadata_decode_signed_value to decode lower bounds.
11652
11653 2006-02-14  Martin Baulig  <martin@ximian.com>
11654
11655         * reflection.c
11656         (mono_reflection_get_token): Support "MonoGenericMethod" and
11657         "MonoGenericCMethod" and allow generic instances / methods.
11658
11659 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
11660
11661         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
11662         to obtain the terminal size using an ioctl.
11663
11664         * object.c (mono_nullable_init): Revert this as nullable reference
11665         types are not valid.
11666         (mono_nullable_box): Ditto.
11667
11668 2006-02-09  Dick Porter  <dick@ximian.com>
11669
11670         * threads.c (mono_thread_detach): Drop a reference to the thread
11671         we're detaching.
11672
11673 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
11674
11675         * object.c (mono_nullable_init): Handle nullable reference types.
11676         (mono_nullable_box): Ditto. Fixes #77446.
11677
11678 2006-02-07  Martin Baulig  <martin@ximian.com>
11679
11680         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
11681
11682 2006-02-07  Ankit Jain  <jankit@novell.com>
11683
11684         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
11685         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
11686         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
11687         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
11688         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
11689         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
11690
11691 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
11692
11693         * class.c (mono_class_create_generic): Set type_token as well.
11694
11695         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
11696         compatible with MS.
11697
11698 2006-02-02  Martin Baulig  <martin@ximian.com>
11699
11700         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
11701         has never been used so far.
11702
11703 2006-02-02  Martin Baulig  <martin@ximian.com>
11704
11705         * mono-debug-debugger.h: Changed comment at the top of this file;
11706         the header is not installed, but it's safe to #include it from
11707         within the JIT.
11708
11709         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
11710         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
11711
11712 2006-02-02  Martin Baulig  <martin@ximian.com>
11713
11714         * mono-debug.h
11715         (MonoSymbolTable): Removed the `metadata_info' field.
11716
11717         * mono-debug.c
11718         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
11719
11720         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
11721         (mono_debugger_add_builtin_types): Removed.
11722         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
11723         (mono_debugger_create_notification_function): We now operate on a
11724         pre-allocated area; take a `gpointer' and return `void'.
11725
11726         * mono-debug-debugger.c
11727         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
11728         (mono_debugger_add_builtin_types): Removed.
11729
11730 2006-02-02  Martin Baulig  <martin@ximian.com>
11731
11732         * threads.c (mono_debugger_create_all_threads): New public method.
11733
11734 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
11735
11736         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
11737         breaks on several platforms.
11738
11739 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
11740
11741         * assembly.c: the VS.NET build doesn't supply default values for
11742         MONO_ASSEMBLIES and MONO_CFG_DIR.
11743
11744 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
11745
11746         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
11747         helper function.
11748
11749         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
11750
11751         * loader.c (method_from_memberref): Fix a warning.
11752
11753         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
11754
11755         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
11756         with explicit layout. Fixes #77433.
11757
11758 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
11759
11760         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
11761         max_interface_id is initialized before using it. Fixes #77398.
11762         (ves_icall_Type_GetInterfaces): Ditto.
11763
11764 2006-01-30  Raja R Harinath  <rharinath@novell.com>
11765
11766         * metadata.c (mono_metadata_parse_method_signature_full): Don't
11767         allocate memory for parameter attributes when parsing memberref
11768         signatures.
11769         * loader.c (mono_loader_set_error_method_load): Don't warn.
11770         (method_from_memberref): Ensure MissingMethodException gets thrown
11771         if method is not found.  Make warning more informative.
11772
11773 2006-01-29  Raja R Harinath  <harinath@gmail.com>
11774
11775         Fix #77397
11776         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
11777         return true if is byref.
11778         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
11779         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
11780         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
11781
11782 2006-01-27  Raja R Harinath  <rharinath@novell.com>
11783
11784         Fix tests/find-method.2.il
11785         * loader.c (find_method, find_method_in_class): Remove is_inflated
11786         argument.  Revert 2006-01-18 change.
11787         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
11788         is generic, search for method in its generic definition.
11789         * class.c (mono_class_setup_vtable_general): Print generic
11790         arguments of generic types in debugging printf.
11791
11792 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
11793
11794         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
11795
11796         * threads.c (mono_threads_request_thread_dump): New helper function.
11797
11798 2006-01-25  Raja R Harinath  <rharinath@novell.com>
11799
11800         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
11801
11802 2006-01-25  Ankit Jain  <jankit@novell.com>
11803
11804         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
11805         move definition to ..
11806         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
11807         
11808 2006-01-25  Ankit Jain  <jankit@novell.com>
11809             Raja R Harinath  <rharinath@novell.com>
11810
11811         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
11812         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
11813         as necessary.
11814
11815 2006-01-25  Martin Baulig  <martin@ximian.com>
11816
11817         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
11818         `MonoDebuggerThread' into debug-debugger.c.
11819
11820 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
11821
11822         * profiler.c: fix printing of data.
11823
11824 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
11825
11826         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
11827           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
11828
11829 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
11830
11831         * object.c: fix deadlock related to string interning.
11832
11833 2006-01-23  Martin Baulig  <martin@ximian.com>
11834
11835         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
11836
11837         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
11838
11839 2006-01-23  Martin Baulig  <martin@ximian.com>
11840
11841         * mono-debug.h: Moved the prototypes of some functions which are
11842         used by the JIT here from mono-debug-debugger.h.
11843
11844 2006-01-21  Martin Baulig  <martin@ximian.com>
11845
11846         * Makefile.am: Don't install mono-debug-debugger.h.
11847
11848 2006-01-21  Martin Baulig  <martin@ximian.com>
11849
11850         * mono-debug-debugger.h: Enforce the private status of this header
11851         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
11852         Moved some stuff from mono-debugger-jit-wrapper.h here.
11853
11854 2006-01-20  Raja R Harinath  <rharinath@novell.com>
11855
11856         * class.c (mono_class_from_typeref): Add a sanity test to help
11857         catch lack of assembly load/search hooks.
11858
11859 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
11860
11861         * marshal.c (emit_struct_conv): Relax the fields with same offset
11862         check even more. Fixes #77230.
11863
11864 2006-01-18  Martin Baulig  <martin@ximian.com>
11865
11866         * loader.c (find_method_in_class): Added `gboolean is_inflated'
11867         argument; if false, we compare the uninstantiated signatures.
11868         (method_from_memberref): Compare the uninstantiated signatures;
11869         fixes #76417.
11870
11871 2006-01-18  Robert Jordan  <robertj@gmx.net>
11872
11873         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
11874         Clear the weak link. Fixes bug #77170.
11875
11876         * gc.c (mono_gchandle_free):
11877         Reflect *-gc.c changes (tiny optimization).
11878
11879 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
11880
11881         * metadata.c (mono_metadata_signature_dup): Applied patch from
11882         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
11883         Fixes #77288.
11884
11885 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
11886
11887         * marshal.c (emit_struct_conv): Allow fields with the same offset when
11888         marshalling from native to managed code. Fixes #77230.
11889
11890 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11891
11892         * threadpool.c: fix problem (Mac only) when more than one asynchronous
11893         connect. Fixes bug #77020.
11894
11895 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
11896
11897         * class.c: fixed id assignement for nested interfaces (bug #77275).
11898         Added also better info for --print-vtable debugging.
11899
11900 2006-01-12  Martin Baulig  <martin@ximian.com>
11901
11902         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
11903         interfaces on-the-fly; fixes #76625.
11904
11905         * class-internals.h
11906         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
11907         don't need that anymore.
11908
11909 2006-01-12  Miguel de Icaza  <miguel@novell.com>
11910
11911         * socket-io.c
11912         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
11913         To avoid initing the nested_classes when not needed I turned the
11914         PeerCredData as a toplevel internal class, as it has to be shared
11915         anyways. 
11916
11917         Fixes the CASA issue.
11918
11919 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
11920
11921         * domain.c: Accessors for MonoJitInfo
11922
11923         * profiler-private.h: Add jitinfo to the end jit hook
11924
11925         * profiler.[ch]: Define new hooks, called after jitting which give
11926         the MonoJitInfo that was compiled
11927
11928 2006-01-10  Martin Baulig  <martin@ximian.com>
11929
11930         * class.c (mono_class_setup_events): Add support for generic
11931         classes; fixes #76440.
11932
11933 2006-01-06  Raja R Harinath  <rharinath@novell.com>
11934
11935         Fix #77160.
11936         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
11937         on passed-in method.
11938
11939 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
11940
11941         * object.c (mono_runtime_invoke_array): Add Nullable support.
11942
11943         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
11944
11945 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
11946
11947         * file-io.c: Don't consider sockets as directory and avoid an endless
11948         loop. Fix bug #76966.
11949
11950 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
11951
11952         * object.c (mono_nullable_init): New helper function.
11953         (mono_nullable_box): Ditto.
11954
11955         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
11956
11957         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
11958
11959         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
11960         
11961 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
11962
11963         * class.c (mono_class_is_assignable_from): Make T assignable to 
11964         Nullable<T>.
11965
11966 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
11967
11968         * appdomain.c: Bump corlib version to 46.
11969         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
11970         serialization purpose) and changed ves_icall_System_Reflection_
11971         Assembly_get_code_base signature to accept a boolean (to escape, or 
11972         not, the assembly code base).
11973
11974 2005-12-23  Dick Porter  <dick@ximian.com>
11975
11976         * icall.c: 
11977         * threads-types.h: 
11978         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
11979         CreateEvent icall now returns "created" boolean parameter.
11980
11981 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
11982
11983         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
11984         #76967.
11985
11986         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
11987         when attr_klass is an interface. Fixes #77045.
11988
11989 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
11990
11991         * marshal.c (emit_struct_conv): Fix previous patch.
11992         
11993         * marshal.c (emit_struct_conv): Add a check for fields with the same
11994         offset.
11995
11996 2005-12-20  Raja R Harinath  <rharinath@novell.com>
11997
11998         Fix regression in Mono.C5.
11999         * class.c (mono_class_create_generic): If 'klass' is an interface
12000         set up the interface offsets.
12001         (mono_class_is_assignable_from): Don't throw away generic arguments.
12002
12003 2005-12-19  Raja R Harinath  <rharinath@novell.com>
12004
12005         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
12006         type parameters.
12007
12008 2005-12-15  Raja R Harinath  <rharinath@novell.com>
12009
12010         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
12011         dead store.
12012         (do_mono_metadata_parse_generic_class): Don't pass the current
12013         generic context when parsing the type being instantiated: it
12014         cannot use it, anyway.
12015
12016         * loader.c (method_from_memberref): Don't inflate a signature if
12017         it doesn't contain any type parameters.
12018
12019 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
12020
12021         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
12022
12023 2005-12-14  Martin Baulig  <martin@ximian.com>
12024
12025         * class.c
12026         (mono_type_get_name_recurse): Don't return null for type
12027         parameters and open generic classes.
12028         (mono_class_setup_methods): Don't exclude generic instances.
12029         (mono_get_unique_iid): Use different IDs for different
12030         instantiations of the same generic type.
12031         (mono_class_setup_vtable): Only use setup_generic_vtable() for
12032         open generic instances; create a normal vtable for closed generic
12033         instances.
12034         (mono_class_setup_vtable_general): We're now also called for
12035         closed generic instances.
12036
12037         * reflection.c
12038         (mono_reflection_bind_generic_parameters): Correctly use
12039         mono_metadata_lookup_generic_inst() everywhere.
12040
12041 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
12042
12043         * object.c (mono_class_create_runtime_vtable): Call 
12044         mono_class_setup_vtable ().
12045
12046         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
12047         function.
12048         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
12049         #76959.
12050
12051         * loader.c (mono_loader_set_error_type_load): Print the type load
12052         warnings to the console so they are more visible to the user.
12053         (mono_loader_set_error_method_load): Ditto.
12054
12055         * reflection.c (ensure_runtime_vtable): Revert the last change as it
12056         is still broken.
12057         
12058         * reflection.c (ensure_runtime_vtable): Fix build.
12059
12060         * reflection.c (ensure_runtime_vtable): Disable an optimization which
12061         doesn't work in all cases.
12062
12063 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
12064
12065         * object.c (mono_array_new_full): Treat a single dimensional array
12066         with 0 lower bounds as an szarray. Fixes #76973.
12067
12068         * reflection.c (custom_attr_visible): Really fix this.
12069
12070 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
12071
12072         * reflection.c (custom_attr_visible): Allow nested public attributes
12073         as well.
12074
12075         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
12076         interface check.
12077
12078 2005-12-12  Raja R Harinath  <harinath@gmail.com>
12079
12080         * class.c (set_generic_param_owner): Delete.
12081         (mono_class_create_from_typedef): Don't set ->owner field of
12082         generic parameters to "param containers" of enclosing classes.
12083         * reflection.c (mono_reflection_initialize_generic_parameter):
12084         Likewise.
12085
12086 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
12087
12088         * reflection.c (custom_attr_visible): Fix build.
12089
12090 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
12091
12092         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
12093         private attributes.
12094         
12095         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
12096         handling of null parameter defaults.
12097
12098 2005-12-09  Raja R Harinath  <rharinath@novell.com>
12099
12100         * class.c (mono_class_from_generic_parameter): Don't set
12101         klass->generic_container.
12102         (my_mono_class_from_generic_parameter): Likewise.
12103
12104 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
12105
12106         * reflection.c (load_public_key): Fix a warning.
12107         (method_encode_code): Fix unaligned accesses.
12108
12109 2005-12-07  Martin Baulig  <martin@ximian.com>
12110
12111         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
12112
12113         * reflection.c
12114         (write_generic_param_entry): Encode our custom attrs.
12115
12116         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
12117
12118 2005-12-07  Martin Baulig  <martin@ximian.com>
12119
12120         * reflection.c (encode_new_constraint): Removed; we don't use the
12121         `NewConstraintAttribute' anymore.
12122
12123 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
12124
12125         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
12126         not fire a TypeResolve event when Assembly.GetType () is called.
12127
12128 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
12129
12130         Beginning of support for nullable types in the runtime. Parts of
12131         this patch are from Martin.
12132
12133         * appdomain.c (MONO_CORLIB_VERSION): Bump
12134
12135         * domain.c (mono_init_internal): get the nullable type
12136
12137         * class.c (mono_class_is_nullable): New method
12138         (mono_class_get_nullable_param): New mehod
12139         (mono_class_create_generic): In types T? set cast_class to T
12140
12141         * class-internals.h (MonoDefaults): new nullable default class
12142         (mono_class_get_nullable_param, mono_class_get_nullable_param):
12143         new methods.
12144
12145 2005-12-05  Raja R Harinath  <rharinath@novell.com>
12146
12147         * metadata.c (select_container): New.  Refactor code to select the
12148         appropriate GenericContainer given the type of generic parameter
12149         we are looking for.
12150         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
12151         not a MonoGenericContext.  Use select_container.  Update parameters.
12152         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
12153         and MONO_TYPE_MVAR.
12154         (unwrap_arrays): Remove duplicate tests.
12155         (find_generic_param): Rename from 'has_same_context'.  Now walks a
12156         generic instantiated class to find any arguments that are generic
12157         parameters.
12158         (mono_type_create_from_typespec_full): Use find_generic_param to
12159         avoid evicting some generic instantiations from the typespec
12160         cache.
12161
12162 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
12163
12164         * reflection.c: fixed writing of doubles on ARM FPA.
12165
12166 2005-12-02  Robert Jordan  <robertj@gmx.net>
12167
12168         * icall.c: Fixed EventInfo.ReflectedType (#76829).
12169
12170 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12171
12172         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
12173         least on SUSE 10 they are not the same (on debian, they are just the
12174         same thing).
12175
12176 2005-12-01  Raja R Harinath  <rharinath@novell.com>
12177
12178         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
12179         DeclaringType for VARs and MVARs.
12180         * class.c (set_generic_param_owner): Fix initialization of owner
12181         fields.
12182
12183 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
12184
12185         * icall.c: fixed Enum.ToObject() to correctly convert the values.
12186
12187 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12188
12189         * threadpool.c: workaround for a bug that shows up on the Mac:
12190         select()+connect() on a blocking socket is not like it should
12191         be, so we proceed to connect() in that case, wasting the I/O
12192         threadpool thread until connect succeedes. Fixes bug #75436.
12193
12194 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12195
12196         * threadpool.c: fix typo when setting file descriptor states.
12197
12198 2005-11-28  Raja R Harinath  <rharinath@novell.com>
12199
12200         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
12201         * metadata.c (mono_metadata_parse_method_signature_full): Don't
12202         create a temporary signature container.
12203         (mono_metadata_parse_generic_param): Update to changes.
12204         (mono_type_create_from_typespec_full): Update to changes.
12205         * loader.c (method_from_memberref): Don't use a
12206         MonoGenericContainer while parsing a memberref signature.
12207         (method_from_methodspec): Remove dead-store of the 'container'
12208         variable.  It's overwritten before use.
12209
12210         * metadata.c (mono_type_create_from_typespec_full): Make debugging
12211         checks tighter.
12212         (mono_metadata_parse_generic_param): Likewise.
12213         * loader.c (find_method_in_class): Does not need a
12214         MonoGenericContainer.  Use 'mono_method_signature' rather than
12215         'mono_method_signature_full'.
12216         (find_method, mono_get_method_constrained, method_from_memberref):
12217         Update to changes.
12218
12219         * metadata.c (mono_type_create_from_typespec_full): Ensure that
12220         owner-less generic-parameters are never evicted from the typespec
12221         cache.
12222
12223         * loader.c (method_from_memberref): Don't use the current context
12224         when parsing signatures.
12225         (method_from_methodspec, mono_get_method_from_token): Update to changes.
12226
12227         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
12228         side-effects in g_assert.
12229         * loader.c (mono_get_method_from_token): Resolve klass earlier so
12230         that we don't potentially lose information.
12231
12232 2005-11-26  Dick Porter  <dick@ximian.com>
12233
12234         * icall.c:
12235         * threads.c: icalls to implement basic (ie, not named)
12236         System.Threading.Semaphore.
12237
12238 2005-11-24  Dick Porter  <dick@ximian.com>
12239
12240         * process.c
12241         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
12242         Use GetProcessId() if it's available.
12243
12244 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
12245
12246         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
12247
12248 2005-11-23  Raja R Harinath  <rharinath@novell.com>
12249             Ankit Jain  <jankit@novell.com>
12250
12251         * loader.c (mono_get_method_from_token): Initialize 'method' field
12252         of all generic parameters before parsing the signature.  Remove
12253         code that "fixed"-up MVAR references.
12254
12255 2005-11-23  Ankit Jain  <jankit@novell.com>
12256
12257         * metadata.c (mono_metadata_has_generic_params):
12258         (mono_metadata_load_generic_param_constraints):
12259         (mono_metadata_load_generic_params): Move duplicate code ...
12260         (mono_metadata_get_generic_param_row): ... here. Returns the
12261         first row-id in GenericParam table for a given owner (token).
12262         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
12263         prototype.
12264
12265 2005-11-23  Raja R Harinath  <rharinath@novell.com>
12266             Ankit Jain  <jankit@novell.com>
12267
12268         * metadata.c (mono_metadata_class_equal): Pass signature_only when
12269         comparing VARs too.
12270         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
12271         type->data.generic_param only if the type is an MVAR.
12272         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
12273         leak owner-less VARs and MVARs into managed space.
12274
12275 2005-11-21  Martin Baulig  <martin@ximian.com>
12276
12277         * class-internals.h
12278         (MonoMethod): Moved the `generic_container' here from
12279         `MonoMethodNormal' since we now also need it for
12280         `MonoMethodPInvoke';
12281         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
12282         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
12283         an union containing both `MonoMethodNormal' and
12284         `MonoMethodPInvoke'.
12285
12286         * loader.c
12287         (mono_get_method_from_token): Allow implementing generic methods
12288         as interncalls.
12289
12290         * threads.c
12291         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
12292         icall.
12293
12294 2005-11-17  Dick Porter  <dick@ximian.com>
12295
12296         * icall.c: 
12297         * process.h: 
12298         * process.c: Split the Process Start_internal icall into
12299         ShellExecuteEx_internal and CreateProcess_internal, which are
12300         called depending on whether UseShellExecute is true.  Fixes bug
12301         76670.
12302
12303         * appdomain.c (MONO_CORLIB_VERSION): Incremented
12304
12305 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
12306
12307         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
12308         'msize' parameters, use the information in 'mspec' instead.
12309         (emit_object_to_ptr_conv): Ditto.
12310
12311         * marshal.c (emit_struct_conv): Handle explicit layout structs with
12312         fields out of order. Fixes #76733.
12313
12314 2005-11-17  Ankit Jain  <jankit@novell.com>
12315
12316         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
12317
12318 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
12319
12320         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
12321           bug #76575.
12322
12323 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
12324
12325         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
12326         for types with non-auto layout. Fixes #76717.
12327
12328 2005-11-16  Ankit Jain  <jankit@novell.com>
12329
12330         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
12331         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
12332         if generic_context is null.
12333           (mono_metadata_generic_param_equal): param->owner can be null.
12334           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
12335         null.
12336
12337 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
12338
12339         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
12340         the correct value.
12341
12342 2005-11-15  Martin Baulig  <martin@ximian.com>
12343
12344         * object.c (set_value): Use mono_class_from_mono_type() instead of
12345         the hack for generic instances; fixes #76136.
12346
12347 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
12348
12349         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
12350         fields.
12351
12352         * image.c (load_metadata_ptrs): Initialize the new fields.
12353
12354         * reflection.c (create_dynamic_mono_image): Ditto.
12355
12356         * reflection.c (build_compressed_metadata): Use the new fields.
12357
12358         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
12359         icall.
12360
12361         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
12362         icall.
12363         
12364 2005-11-15  Ankit Jain  <jankit@novell.com>
12365             Raja R Harinath  <harinath@gmail.com>
12366
12367         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
12368         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
12369         new per-generic_container cache if the cached MonoType's context matches
12370         the current context.
12371           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
12372         to the expected context.
12373           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
12374
12375 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12376
12377         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
12378         we changed the signature of an icall.
12379         * icall.c: Modify to mono_double_ParseImpl return true/false 
12380         depending on the success, instead of throwing the exception. This will
12381         help us in Double.TryParse methods.
12382         
12383 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
12384
12385         * marshal.c (emit_marshal_object): Throw an exception when
12386         marshalling 'object' instead of crashing. Fixes #76696.
12387
12388 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
12389
12390         * class-internals.h: Add prototype for mono_type_get_full_name ().
12391
12392 2005-11-11  Dick Porter  <dick@ximian.com>
12393
12394         * threads.c (mono_thread_manage): Make sure the main thread has
12395         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
12396
12397 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
12398
12399         * loader.c (mono_loader_set_error_type_load): Log a warning to the
12400         console about the missing type.
12401         (mono_loader_set_error_method_load): Ditto.
12402
12403 2005-11-09  Miguel de Icaza  <miguel@novell.com>
12404
12405         * mono-config.c (mono_get_config_dir): Set the system defaults if
12406         none is specified.
12407
12408         * assembly.c (mono_set_dirs): New API entry point to set the
12409         assembly and the config directory in one call
12410
12411 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
12412
12413         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
12414         the ftnptr was created from a delegate in a domain other than the
12415         current domain. Fixes #75377.
12416
12417         * exception.h exception.c: Add mono_get_exception_not_supported ().
12418
12419 2005-11-08  Martin Baulig  <martin@ximian.com>
12420
12421         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
12422
12423 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
12424
12425         * security-manager.h: Added definitions to deal with strongname key 
12426         pairs bigger (and smaller) than 1024 bits.
12427         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
12428         adjust wrt the public key length being used.
12429
12430 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
12431
12432         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
12433           Windows build (r51396-51397).
12434
12435 2005-11-03  Martin Baulig  <martin@ximian.com>
12436
12437         * class.c (mono_class_setup_vtable_general): Also add generic
12438         methods to the vtable; fixes #76581.
12439
12440 2005-11-01  Miguel de Icaza  <miguel@novell.com>
12441
12442         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
12443         sure that we lookup GetString method from the System.Text.Encoding
12444         class, not the derived class or we get an empty method.
12445
12446         Fixed class #76612.
12447
12448 2005-10-25  Miguel de Icaza  <miguel@novell.com>
12449
12450         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
12451         if it has been previously set (embedders). 
12452
12453         Make mono_set_rootdir available also on Unix.
12454
12455 005-10-24  Robert Jordan  <robertj@gmx.net>
12456
12457         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
12458
12459 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
12460
12461         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
12462         only calls which are made to native code use this flag.
12463
12464         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
12465
12466 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
12467
12468         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
12469         Add support for FieldBuilders.
12470
12471 2005-10-29  Martin Baulig  <martin@ximian.com>
12472
12473         * mono-debug.c
12474         (mono_debug_using_mono_debugger): New public method; returns
12475         whether we're running inside the debugger.
12476
12477 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
12478
12479         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
12480         for Method/Constructor/FieldBuilders.
12481
12482 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
12483
12484         * reflection.c (module_add_cattrs): Save custom attributes for global methods
12485         and fields as well.
12486
12487 2005-10-26  Martin Baulig  <martin@ximian.com>
12488
12489         * mono-debug-debugger.c
12490         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
12491
12492 2005-10-24  Raja R Harinath  <harinath@gmail.com>
12493
12494         * icall.c (base64_to_byte_array): Don't pass an out-of-range
12495         integer to isspace.
12496
12497 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
12498
12499         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
12500         when passing valuetypes byref. Fixes #76502.
12501
12502 2005-10-19  Jackson Harper  <jackson@ximian.com>
12503
12504         * profiler.c: Don't put a . in front of types that are not in a
12505         namespace.
12506
12507 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
12508
12509         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
12510
12511 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
12512
12513         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
12514         #76436.
12515         (mono_marshal_get_ldflda_wrapper): Fix a warning.
12516
12517 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12518
12519         * assembly.c metadata-internals.h icall.c: Define an additional
12520         parameter for mono_assembly_name_parse_full, so we can avoid creating
12521         S.R.AssemblyName.Version when no version info wasn't passed.
12522         
12523 2005-10-09  Miguel de Icaza  <miguel@novell.com>
12524
12525         * class.c (mono_type_get_full_name): Reimplement method that was
12526         removed. 
12527
12528         * image.c: Some docs
12529
12530 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
12531
12532         * profiler.c (output_newobj_profile): Fix printing of Total memory
12533         on x86.
12534
12535 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
12536
12537         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
12538
12539 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
12540
12541         * threads.c: remove debug output.
12542
12543 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
12544
12545         * threads.c (mono_thread_manage): Fix crashes if more than 64
12546         threads need to be aborted. Hopefully fixes #75899.
12547
12548         * assembly.c (mono_stringify_assembly_name): New helper function.
12549
12550         * class.c: Use mono_stringify_assembly_name instead of the similar
12551         static function.
12552
12553         * assembly.h assembly.c: Add support for calling a postload search 
12554         hook if an assembly cannot be loaded.
12555
12556         * appdomain.c: Register new search hooks which call the AssemblyResolve
12557         events in AppDomain. Fixes #75231
12558
12559 2005-10-07  Martin Baulig  <martin@ximian.com>
12560
12561         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
12562         methods without debug info.
12563
12564 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
12565
12566         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
12567         wrappers.
12568
12569 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12570
12571         * file-io.c: now that we return symlinks, use lstat and, when the file
12572         is a symbolic link, stat, to get the file attributes. Also avoid the
12573         conversion to/from utf16/external.
12574
12575 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
12576
12577         * class.c (mono_class_layout_fields): Compute klass->has_references
12578         correctly if an embedded valuetype is not yet initialized. Fixes
12579         #76331.
12580
12581 2005-10-04  Martin Baulig  <martin@ximian.com>
12582
12583         * metadata.c
12584         (mono_metadata_load_generic_param_constraints): New public
12585         function; splitted the constraints loading out from
12586         mono_metadata_load_generic_params().
12587
12588         * class.c (mono_class_create_from_typedef): Call
12589         mono_metadata_load_generic_param_constraints() after setting up
12590         the type and creating our parent; fixes #75329.
12591
12592 2005-10-04  Martin Baulig  <martin@ximian.com>
12593
12594         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
12595         non-dynamic parent classes.
12596
12597 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
12598
12599         * file-io.c : win32 build fix (ETXTBSY seems not found).
12600
12601 2005-10-04  Martin Baulig  <martin@ximian.com>
12602
12603         * reflection.c
12604         (mono_image_get_methodspec_token): Make the cache actually work;
12605         fixes #75974.
12606
12607 2005-10-04  Martin Baulig  <martin@ximian.com>
12608
12609         * class.c (mono_class_name_from_token): Removed the unneccessary
12610         `MonoGenericContext *' argument.
12611
12612 2005-10-04  Martin Baulig  <martin@ximian.com>
12613
12614         * loader.c
12615         (method_from_methodspec): Make the caching work again; fixes the
12616         performance regression from #76262.
12617
12618 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12619
12620         * file-io.c:
12621         * file-io.h:
12622         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
12623         GetFileSystemEntries that performs the same work but without going
12624         into io-layer, locking, etc.
12625
12626 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
12627
12628         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
12629         ThreadState_Stopped as well. Fixes #76047.
12630
12631 2005-09-29  Martin Baulig  <martin@ximian.com>
12632
12633         * class.c
12634         (inflate_generic_context): If the new context has a `gmethod', set
12635         its `container' that that gmethod's `container'.
12636
12637         * metadata.c
12638         (mono_metadata_parse_generic_param): Simplify things;
12639         `generic_container = generic_context->container;' is just fine.
12640
12641         * loader.c (method_from_methodspec): Code cleanups.
12642
12643 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
12644
12645         * decimal.c: fix warning (and let gcc generate correct
12646         code on ARM with optimizations).
12647
12648 2005-09-28  Martin Baulig  <martin@ximian.com>
12649
12650         * loader.c
12651         (method_from_memberref): Added `MonoGenericContext *class_context'
12652         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
12653         (method_from_methodspec): If we're a memberref, use the enclosing
12654         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
12655
12656 2005-09-28  Martin Baulig  <martin@ximian.com>
12657
12658         * object.c (mono_runtime_invoke_array): Added support for
12659         MONO_TYPE_GENERICINST; fixes #75917.
12660
12661 2005-09-27  Martin Baulig  <martin@ximian.com>
12662
12663         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
12664         `k->byval_arg.type' to determine the actual type.
12665
12666         * loader.c (method_from_methodspec): Removed some hacks.
12667
12668 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
12669
12670         * class-internals.h (mono_field_is_deleted): Do the test for
12671         rtspecialname before we check the actual name of the field. This
12672         prevents us from dereferencing a pointer into the string table,
12673         saving us from accessing a few pages
12674
12675         * *.c: Replace the use of {Enter,Leave}CriticalSection with
12676         macros. This will allow a deadlock debugger to easily be plugged
12677         in.
12678
12679 2005-09-27  Martin Baulig  <martin@ximian.com>
12680
12681         * loader.c (method_from_methodspec): Create a "signature"
12682         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
12683
12684 2005-09-27  Martin Baulig  <martin@ximian.com>
12685
12686         * class.c
12687         (inflate_generic_class): Correctly set the new context's
12688         container.
12689
12690         * loader.c
12691         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
12692         instead of a `MonoGenericContext *'.
12693         (mono_method_signature_full): Take a `MonoGenericContainer *'
12694         instead of a `MonoGenericContext *'.
12695
12696         * metadata.c
12697         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
12698         instead of a `MonoGenericContext *'.
12699         (mono_metadata_parse_method_signature_full): Likewise.
12700
12701 2005-09-26  Martin Baulig  <martin@ximian.com>
12702
12703         * class.c
12704         (mono_class_from_generic_parameter): Set `klass->generic_container'
12705         (mono_class_from_generic_parameter): Likewise.
12706         (mono_bounded_array_class_get): We inherit the generic container
12707         from the element class.
12708
12709         * loader.c
12710         (find_method, find_method_in_class): Take a `MonoGenericContext *'
12711         argument rather than computing it here.
12712         (method_from_memberref): Correctly set the generic context before
12713         parsing the signature.  Fixes #75681.
12714
12715 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
12716
12717         * object.c (mono_class_has_special_static_fields): Fix warnings.
12718
12719 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12720
12721         * assembly.c: Add parse_public_key function, to
12722         par the public keys. Also added mono_assembly_name_parse_full,
12723         to define it the parsed key should be freed or not.
12724         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
12725         to parse a long format assembly name.
12726         * metadata-internals.h: Keep mono_assembly_name_parse_full as
12727         private, since calling it to preserve the key requires
12728         freeing it manually.
12729         
12730 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
12731
12732         * locales.c : removed HAVE_ICU part.
12733
12734 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
12735
12736         * object.c (mono_class_create_runtime_vtable): Avoid calling 
12737         field_is_special_static if the klass has no special static fields.
12738
12739         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
12740         (MonoCachedClassInfo): Likewise.
12741
12742         * object.c (mono_class_has_special_static_fields): New helper function.
12743
12744 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12745
12746         * class.c (mono_class_create_from_typedef): Don't call 
12747         interfaces_from_typedef_full for enums.
12748         (mono_class_create_from_typedef): Compute the base types of enums directly
12749         without calling mono_class_setup_fields ().
12750         (mono_class_find_enum_basetype): New helper function.
12751
12752         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
12753         one place inside the string heap.
12754         
12755 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
12756
12757         * class.c: locking fixes, code cleanups, some docs added.
12758         Allocate some data structures in the image mempool.
12759
12760 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12761
12762         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
12763         the example code.
12764         
12765 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
12766
12767         * class-internals.h, class.c, reflection.c: reduce memory taken by
12768         MonoClass.
12769
12770 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
12771
12772         * metadata.c, metadata.h, loader.h: documentation updates, code and
12773         API cleanups.
12774
12775 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
12776
12777         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
12778         the example code.
12779
12780         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
12781         page faults caused by the runtime while reading metadata.
12782
12783 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12784
12785         * socket-io.c: the field names were changed 3 months ago and no one
12786         realized until bug #76077 got filed!
12787
12788 2005-09-20  Martin Baulig  <martin@ximian.com>
12789
12790         * icall.c (assembly_icalls): Removed some unused debugger icalls.
12791
12792 2005-09-20  Martin Baulig  <martin@ximian.com>
12793
12794         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
12795         write the rank into the class entry.
12796
12797 2005-09-20  Martin Baulig  <martin@ximian.com>
12798
12799         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
12800
12801 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
12802
12803         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12804
12805         * icall.c (custom_attrs_defined_internal): New icall.
12806
12807         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
12808         function.
12809         (mono_custom_attrs_construct_by_type): New helper function.
12810
12811 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
12812
12813         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
12814         terminate the resulting string. Fixes #76123.
12815
12816 2005-09-16  Martin Baulig  <martin@ximian.com>
12817
12818         * mono-debug.c
12819         (mono_debug_add_method): Ignore inflated methods for the moment.
12820
12821 2005-09-14  Martin Baulig  <martin@ximian.com>
12822
12823         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
12824
12825 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
12826
12827         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
12828         return a success/failure indication.
12829         (mono_metadata_interfaces_from_typedef_full): Ditto.
12830         (get_constraints): Ditto.
12831
12832 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
12833
12834         * marshal.c (emit_marshal_array): Fix handling of null arrays.
12835         
12836         * marshal.c (emit_marshal_array): Add support for returning string
12837         arrays from delegates. Fixes #76063.
12838
12839         * marshal.c: Use the emit_ldloc/stloc macros where possible.
12840
12841 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
12842
12843         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
12844         icall.
12845
12846 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
12847
12848         * reflection.c icall.c: Fix after mono_get_exception_type_load
12849         signature change.
12850
12851         * assembly.c (mono_assembly_get_assemblyref): New helper function.
12852         (mono_assembly_load_reference): Use the new helper.
12853
12854         * class-internals.h (MonoLoaderError): New structure containing 
12855         information about type loading errors.
12856
12857         * class-internals.h loader.c: Add APIs to store per-thread loader
12858         error information.
12859
12860         * loader.c class.c: Set the loader error if needed.
12861
12862         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
12863
12864 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
12865
12866         * decimal.c: fixed to handle the broken ARM fp format.
12867
12868 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
12869
12870         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
12871         broken.
12872
12873 2005-09-06  Martin Baulig  <martin@ximian.com>
12874
12875         * domain.c (supported_runtimes): Added v2.0.50727.
12876
12877 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
12878
12879         * culture-info.h: reduce the size of some structures.
12880
12881 2005-09-05  Martin Baulig  <martin@ximian.com>
12882
12883         Reflect latest API changes in the August CTP.
12884
12885         * icall.c
12886         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
12887         ("MonoType.HasGenericArguments"): Removed.
12888         ("MonoMethod.BindGenericParameters"): Renamed to
12889         "MakeGenericMethod".
12890         ("MethodBuilder.BindGenericParameters"): Renamed to
12891         "MakeGenericMethod".    
12892
12893 2005-09-05  Martin Baulig  <martin@ximian.com>
12894
12895         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
12896
12897 2005-09-05  Martin Baulig  <martin@ximian.com>
12898
12899         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12900
12901         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
12902         generic_container is non-NULL.
12903
12904 2005-09-05  Martin Baulig  <martin@ximian.com>
12905
12906         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12907
12908         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
12909
12910 2005-08-29  Michal Moskal  <malekith@nemerle.org>
12911
12912         * reflection.c (encode_locals,
12913         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
12914         for large generic types.
12915
12916 2005-09-05  Martin Baulig  <martin@ximian.com>
12917
12918         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12919
12920         * class.c (mono_dup_array_type): New public method.
12921         (mono_metadata_signature_deep_dup): New public method.
12922         (dup_type): Correctly duplicate array and function types.
12923
12924 2005-09-05  Martin Baulig  <martin@ximian.com>
12925
12926         Applying a patch from Michal Moskal <malekith@nemerle.org>.
12927
12928         * reflection.c (get_default_param_value_blobs): Handle generic types
12929         and generic methods.
12930
12931 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
12932
12933         * class.c: Fixed error reporting (method/class were inversed) for 
12934         inheritance demands.
12935         * security-manager.c|h: Added the AppDomain when calling the managed
12936         System.Security.SecurityManager.InheritanceDemand method.
12937
12938 2005-09-01  Raja R Harinath  <rharinath@novell.com>
12939
12940         * reflection.c (encode_marshal_blob): 'marshaltype' and
12941         'marshaltyperef' are alternate sources for the custom marshaler
12942         name.
12943
12944 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
12945
12946         * class.c: fix creation of array classes with rank == 1
12947         (patch by Ankit Jain <jankit@novell.com>).
12948
12949 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
12950
12951         * object.c: fix check for creating the bound data for arrays vs
12952         szarrays.
12953
12954 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12955
12956         * object.c: configuration file name is now based on the executable name,
12957         not the image name. Fixes bug #75931.
12958
12959 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
12960
12961         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
12962         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
12963
12964 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
12965
12966         * rand.c: Use wincrypt.h instead of WinCrypt.h.
12967
12968 2005-08-24  Ankit Jain  <jankit@novell.com>
12969             Raja R Harinath  <rharinath@novell.com>
12970
12971         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
12972           called by it recursively.
12973           (mono_class_init): Remove special case in pending_init handling, since it's
12974           superseded by the fix to mono_class_from_typeref.
12975
12976 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
12977
12978         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
12979         BROKEN_THREAD_START stuff.
12980
12981 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
12982
12983         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
12984         trampoline.
12985
12986         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
12987         
12988         * object.c (mono_delegate_ctor): Replace the original function address with
12989         a delegate trampoline.
12990
12991 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
12992
12993         * icall.c: add boolean argument to base64_to_byte_array and 
12994         InternalFromBase64String to control whether a whitespace-only string
12995         is allowed (or should casue a FormatException to be thrown). We need
12996         this as the behavior has changed between MS.NET 1.x and 2.0, and we
12997         to match the MS behaviour in both profiles.
12998         * appdomain.c: Bump corlib version.
12999
13000 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13001
13002         This patch implements a big portion of publisher policy
13003         support, used to bind assembly versions and redirect
13004         one assembly from version A to version B.
13005
13006         * assembly.c:
13007         New GSList loaded_assembly_bindings, for storing the cached
13008         assembly bindings.
13009         (assembly_binding_maps_name): New static function for checking if a 
13010         assembly binding information maps an assembly name.
13011         (mono_assembly_binding_info_free): New function for freeing
13012         assembly binding information resources.
13013         (get_publisher_policy_info): New static function for retrieving 
13014         assembly binding information from a MonoImage.
13015         (compare_versions): New static function for comparing an assembly
13016         binding information data and the version of an assembly name.
13017         (check_policy_versions): New static function for checking if an
13018         assembly binding info mapping an assembly name is valid for it.
13019         (mono_assembly_load_publisher_policy): New static function for
13020         loading the 'policy.major.minor.MyAssembly' image for an assembly
13021         with an assembly name 'aname'.
13022         (mono_assembly_bind_version): New static function for updating
13023         assembly redirection.
13024         (mono_assembly_apply_binding): New static function for applying
13025         assembly binding.
13026         (search_binding_loaded): New static function for searching 
13027         loaded assembly binding infos in the cache domain.
13028         (mono_assembly_load_full): Don't apply assembly binding for
13029         reflection only assemblies.
13030
13031         * metadata-internals.h: Add MonoAssemblyBindingInfo,
13032         which contains information about assembly binding. Also
13033         declare signature for mono_config_parse_publisher_policy ()
13034         function, used to retrieve pub policy info.
13035         
13036         * mono-config.c:
13037         (publisher_policy_start): New static function used to parse publisher 
13038         policy config files.
13039         (publisher_policy_parser): New static MonoParseHandler containing 
13040         the functions used when parsing config files.
13041         (mono_config_parse_publisher_policy): New function for parsing
13042         publisher policy files.
13043         
13044 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
13045
13046         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
13047
13048         * marshal.c (mono_delegate_free_ftnptr): Ditto.
13049
13050         * object.c (mono_get_addr_from_ftnptr): New helper function.
13051
13052         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
13053
13054         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13055
13056 2005-08-19  Dick Porter  <dick@ximian.com>
13057
13058         * threads.c, threads.h, appdomain.c, appdomain.h,
13059         profiler-private.h, monitor.c, object.c, object-internals.h,
13060         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
13061         store the thread ID, so it can hold a 64 bit value if needed.
13062
13063 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
13064
13065         * reflection.c (mono_reflection_create_dynamic_method): Store the
13066         handle class into the method references as well so ldtoken works in
13067         dynamic methods.
13068
13069         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
13070         types.
13071
13072 2005-08-19  Ankit Jain <jankit@novell.com>
13073
13074         Fix #75847.
13075         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
13076           here rather than using the method signature of a arbitrary function
13077           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
13078           two arguments.
13079           Hack done with Harinath.
13080
13081 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13082
13083         * threadpool.c: disable printing stack traces when we get a exception
13084         in a threadpool thread. I need to do more testing to figure out which
13085         cases actually print this. Fixes bug #75828.
13086
13087 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13088
13089         * icall.c: there might be ignored whitespace after the last '='. This
13090         fixes length computation and bug #75840.
13091
13092 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
13093
13094         * assembly.c (mono_assembly_load_full): Consider .exe extension as
13095         well. Fixes #75809.
13096
13097         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
13098         #75784.
13099         
13100         * reflection.c (create_custom_attr_data): Ditto.
13101
13102 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
13103
13104         * locales.c, culture-info.h : removed RegionLCIDMap.
13105         * culture-info-tables.h : regenerated.
13106
13107 2005-08-16  Martin Baulig  <martin@ximian.com>
13108
13109         * class.c (mono_type_get_name_recurse): Small fix.
13110
13111 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
13112
13113         * locales.c : indentation fixie.
13114
13115 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
13116
13117         * object-internals.h,
13118           locales.h,
13119           locales.c,
13120           culture-info.h,
13121           icall.c : added RegionInfo table support.
13122         * culture-info-table.h : regenerated for region support.
13123
13124 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
13125
13126         * reflection.c (resolve_object): handle all kinds of MonoMethod
13127         including generic ones
13128
13129 2005-08-12  Ankit Jain <jankit@novell.com>
13130
13131         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
13132           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
13133
13134 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
13135
13136         * process.c: Don't close a thread handle when it's NULL. This is a
13137         workaround for bug #75733.
13138
13139 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
13140
13141         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
13142
13143 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
13144
13145         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
13146
13147 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13148
13149         * threadpool.c: if a work item in the thread pool has a callback that
13150         catches a exception, don't propagate it after invoking the callback.
13151         Fixes bug #75336.
13152
13153 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
13154
13155         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
13156
13157         * class-internals.h (MonoCachedClassInfo): Add some new fields.
13158
13159         * class.c (mono_class_init): Load field info lazily in the AOT case.    
13160
13161         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
13162
13163 2005-08-03  Ankit Jain  <jankit@novell.com>
13164
13165         Fix #75683.
13166         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
13167           PInvoke calling convention is 0.
13168
13169 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
13170
13171         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
13172         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
13173
13174 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
13175
13176         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
13177         to handle threads not started by the GC (patch by Michael Meeks
13178         <michael.meeks@novell.com>).
13179
13180 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
13181
13182         * reflection.c: Make buffer used in emitting types larger for some
13183         big generic types (patch by Michal Moskal).
13184
13185 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
13186
13187         * mono-debug.c: Fix some (not all) alignment problems.
13188
13189 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13190
13191         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
13192         Invoke mono_image_load_from_data_full passing the refonly
13193         parameter.
13194
13195         * assembly.c
13196         (mono_assembly_open_from_bundle): Add the refonly argument, 
13197         in order to pass it to other methods it calls to.
13198         (do_mono_assembly_open): Add the refonly argument, in order 
13199         to pass it to other methods it calls to.
13200         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
13201         the refonly parameter to it.
13202
13203         * image.c: Add loaded_images_refonly_hash and
13204         loaded_images_refonly_guid_hash to cache the reflection
13205         only loaded images.
13206         (mono_images_init): Initialize the hash tables used for
13207         caching the reflection only images.
13208         (load_modules): Invoke mono_image_open_full passing the refonly
13209         parameter to load the modules the correct way.
13210         (build_guid_table): Add the refonly argument, to re-build the 
13211         correct hash table.
13212         (do_mono_image_open): Added the refonly argument, in order to
13213         define it for the loaded image.
13214         (mono_image_loaded_full): New function, which receives an
13215         additional parameter to look for the image in the refonly or
13216         non-refonly section.
13217         (mono_image_loaded): Updated, using mono_image_loaded_full.
13218         (mono_image_loaded_by_guid_full): The same case that happens
13219         with mono_image_loaded_full.
13220         (mono_image_loaded_by_guid): Likewise.
13221         (register_image): Use the ref_only variable inside MonoImage
13222         to decide in which hash table store the current image.
13223         (mono_image_open_from_data_full): Rename
13224         mono_image_open_from_data to mono_image_open_from_data_full,
13225         adding the refonly argument, to define the ref_only variable 
13226         inside MonoImage.
13227         (mono_image_open_from_data): Return 
13228         mono_image_open_from_data_full.
13229         (mono_image_open_full): Rename mono_image_open to
13230         mono_image_open_full, receiving the new refonly argument,
13231         to pass it to inner methods.
13232         (mono_pe_file_open): Update this function, to open
13233         a MonoImage as a non-refonly image.
13234         (mono_image_close): Use the refonly variable inside
13235         MonoImage to remove the image from the correct caches.
13236
13237         * image.h: Add the signatures of mono_image_open_full,
13238         mono_image_open_from_data_full, mono_image_loaded_full,
13239         mono_image_loaded_by_guid_full.
13240
13241         * metadata-internals.h: Add the ref_only field to 
13242         MonoImage.
13243         
13244 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13245
13246         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
13247         Fix the last behavior, which used to load the assemblies and
13248         extract MonoReflectionAssemblyName information, instead of
13249         extract it from the metadata tables. Needed for Reflection
13250         Only assemblies.
13251         
13252 2005-07-29  Martin Baulig  <martin@ximian.com>
13253
13254         * mono-debug-debugger.c
13255         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
13256         not initialized.
13257
13258         * mono-debug.c
13259         (mono_debug_address_from_il_offset): Check whether we have
13260         debugging support before attempting to take the lock.
13261         (mono_debug_source_location_from_address): Likewise.
13262         (mono_debug_source_location_from_il_offset): Likewise.
13263         (mono_debug_il_offset_from_address): Likewise.
13264         (mono_debug_address_from_il_offset): Likewise.
13265
13266 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
13267
13268         * class.c (mono_class_from_name_case): Add support for dynamic images.
13269         Fixes #75650.
13270
13271         * object.c (mono_class_compute_gc_descriptor): Add a workaround
13272         for #75479.
13273
13274 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
13275         
13276         * reflection.c (mono_method_get_object): Fix warning.
13277
13278 2005-07-28  Martin Baulig  <martin@ximian.com>
13279
13280         * mono-debug.c
13281         (mono_debug_add_wrapper): Also write the wrapper type.
13282
13283 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
13284
13285         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
13286         
13287         * class.c (mono_class_init): Avoid reading nested classes if the AOT
13288         data indicates the class has none.
13289
13290 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
13291
13292         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
13293         loader lock with the debugger lock. Prevents deadlocks for beagle.
13294
13295         Beagle can now run on an smp box for a weekend without any
13296         issues. Woohoo!
13297
13298 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
13299
13300         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
13301         in a module. Fixes #75629.
13302
13303 2005-07-26  Martin Baulig  <martin@ximian.com>
13304
13305         * mono-debug.c (mono_debug_add_wrapper): New static method.
13306         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
13307         interncall or a wrapper.
13308
13309         * mono-debug.h (MonoDebugWrapperData): New public typedef.
13310         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
13311         (MONO_DEBUGGER_VERSION): Bump to 51.
13312
13313         * mono-debug-debugger.c
13314         (mono_debugger_add_type): Removed this empty function.
13315         (mono_debugger_add_method): Likewise.
13316
13317 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
13318
13319         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
13320         before accessing method->slot.
13321
13322 2005-07-21  Jb Evain  <jbevain@gmail.com>
13323
13324         * reflection.c (method_encode_clauses/class): Handle filters clauses.
13325         Fixes #75010.
13326
13327 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
13328
13329         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
13330         #75587.
13331
13332 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
13333
13334         * image.h image.c: Add mono_image_get_guid () API function.
13335
13336 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
13337
13338         There were issues when multiple threads tried to load
13339         assemblies. A deadlock was created between assemblies_mutex and
13340         mono_domain_assemblies_lock. This fixes the issue by making the
13341         assembly ref counting be lock free. See bug 75586.
13342         
13343         * image.c (mono_image_close): The add ref function here was using
13344         Interlocked operations while the unref was using a mutex and a
13345         --. I don't think this was ever a bug that would be exposed in a
13346         non-pendantic way (ie, by an embedder doing a ref on one thread
13347         and an unref on another), but for the sake of correctness, this is
13348         now Interlocked.
13349
13350         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
13351         (mono_assembly_load_reference): Call mono_assembly_addref rather
13352         than touching the refcount ourselves.
13353         (mono_assembly_close): Use InterlockedDecrement to unref the
13354         assembly. Don't acquire the lock unless it is actually needed.
13355
13356 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
13357
13358         * class.c (mono_class_layout_fields): Fix calculation of has_references
13359         for generic types.
13360
13361 2005-07-12  Martin Baulig  <martin@ximian.com>
13362
13363         Applying a patch from Michal Moskal <malekith@nemerle.org>.
13364
13365         * metadata.c
13366         (mono_type_hash): Provide better hashing for generic instances.
13367         (mono_generic_inst_hash): Improve hashing.
13368         (mono_generic_class_hash): Likewise.
13369
13370         * reflection.c (mymono_metadata_type_hash): Improve hashing for
13371         generic instances.
13372
13373 2005-07-12  Martin Baulig  <martin@ximian.com>
13374
13375         * reflection.c (mono_reflection_create_runtime_class): Remove the
13376         hack for generic type definitions and non-`Run' assemblies.
13377         (mono_reflection_bind_generic_parameters): Also use
13378         `klass->wastypebuilder' to check for TypeBuilders.
13379
13380 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
13381
13382         * class.c (mono_class_layout_fields): Fix calculation of has_references
13383         for generic types.
13384
13385         * class.c (inflate_generic_class): Fix a leak.
13386         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
13387         for generic types.
13388
13389 2005-07-11  Martin Baulig  <martin@ximian.com>
13390
13391         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
13392         on error.
13393
13394 2005-07-11  Martin Baulig  <martin@ximian.com>
13395
13396         * loader.c (find_method): Also lookup in
13397         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
13398
13399 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
13400
13401         * appdomain.c (mono_domain_unload): Don't free the error message
13402         before passing it to mono_get_exception_...
13403
13404         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
13405         
13406 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
13407
13408         * threads.c: try to better guess an available RT signal (bug #75387).
13409
13410 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
13411
13412         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
13413         and CACHE_OBJECT.
13414
13415 2005-07-07  Martin Baulig  <martin@ximian.com>
13416
13417         * class.c (mono_type_get_name_full): Return NULL for
13418         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
13419         fixes #75408.
13420
13421 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
13422
13423         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
13424         exit the appdomain as well being aborted.
13425
13426         * threadpool.c: Create all threadpool threads inside the root appdomain, and
13427         change back to the root domain after calling managed code. This enables
13428         appdomains using threadpools to be unloaded.
13429
13430 2005-07-07  Martin Baulig  <martin@ximian.com>
13431
13432         * class-internals.h
13433         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
13434         into `MonoDynamicGenericClass' since we only need it for dynamic
13435         types.
13436
13437         * reflection.c (mono_class_bind_generic_parameters): We don't need
13438         to compute the `parent' here.
13439
13440 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
13441
13442         * culture-info-table.h : regenerated.
13443
13444 2005-07-06  Martin Baulig  <martin@ximian.com>
13445
13446         * icall.c
13447         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
13448
13449         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
13450
13451 2005-07-06  Martin Baulig  <martin@ximian.com>
13452
13453         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
13454         we're doing a signature-only comparision; fixes #74945.
13455
13456 2005-07-06  Martin Baulig  <martin@ximian.com>
13457
13458         * class-internals.h (MonoGenericClass): Moved some things out into
13459         a new `MonoInflatedGenericClass' type.  
13460         (MonoInflatedGenericClass): New type; the `klass' of a
13461         `MonoGenericClass' is now computed lazyly in
13462         mono_get_inflated_generic_class().      
13463
13464         * class.c (mono_get_inflated_generic_class): New public function.
13465         (mono_class_inflate_generic_method): Removed the unused
13466         `MonoClass *' argument.
13467         (setup_generic_vtable): Don't call mono_get_inflated_method() on
13468         all the methods.
13469         (mono_class_create_generic): Make this static and merge it with
13470         mono_class_create_generic_2(); we're now called automatically from
13471         mono_get_inflated_generic_class().
13472
13473         * loader.c (mono_method_signature): Call
13474         mono_get_inflated_method() here.
13475
13476 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
13477
13478         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
13479         type of fields with RVA.
13480
13481         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
13482         for this pseudo class.
13483         (my_mono_class_from_generic_parameter): Likewise.
13484         (mono_class_init): Allow interfaces to have cctors.
13485
13486 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
13487
13488         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
13489         lazily for AOT methods.
13490
13491 2005-07-05  Martin Baulig  <martin@ximian.com>
13492
13493         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
13494         returns FALSE for a successful match, not TRUE.
13495
13496 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
13497
13498         * loader.c (mono_method_get_index): Optimize this a bit.
13499
13500 2005-07-04  Martin Baulig  <martin@ximian.com>
13501
13502         * class.c
13503         (class_compute_field_layout): Move the check for generic type
13504         definitions into mono_class_layout_fields().  Fixes #74684.
13505         (mono_class_from_generic_parameter): Correctly compute
13506         `klass->parent'; fixes #75457.
13507
13508         * reflection.c (register_assembly, register_module): Make sure
13509         `domain->rejobject_hash' is already created.
13510
13511 2005-07-02  Martin Baulig  <martin@ximian.com>
13512
13513         * class-internals.h
13514         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
13515         `MonoDynamicGenericClass'.      
13516
13517 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
13518
13519         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
13520         returned by a field getter is null, since null is a valid value.
13521
13522 2005-07-01  Martin Baulig  <martin@ximian.com>
13523
13524         * reflection.c (mono_reflection_generic_class_initialize): Update
13525         the `dgclass->fields [i].parent' to the correct class.
13526         (mono_image_get_fieldref_token): Use the declaring type, not the
13527         reflected type.
13528
13529 2005-07-01  Martin Baulig  <martin@ximian.com>
13530
13531         * loader.c (find_method): Also look in the interfaces; fixes #75429.
13532
13533 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
13534
13535         * threads.c (thread_cleanup): assert that thread != NULL
13536         (wait_for_tids_or_state_change): We were using the wrong variable
13537         when accessing wait->threads. `i' was always out of the bounds of
13538         the array.
13539
13540 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13541
13542         * loader.c: map user32 and kernel32 to libMonoSupportW
13543
13544 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
13545
13546         * appdomain.c (unload_thread_main): Mark this as WINAPI.
13547
13548 2005-06-28  Martin Baulig  <martin@ximian.com>
13549
13550         * loader.c (method_from_methodspec): Fix #75334.
13551
13552 2005-06-28  Martin Baulig  <martin@ximian.com>
13553
13554         Fix #74953 - Arrays now implement the generic IList<T> interface
13555         on the 2.0 platform.
13556
13557         * class-internals.h (MonoDefaults): Added `generic_array_class'.
13558
13559         * reflection.c (mono_class_bind_generic_parameters): New public
13560         function; similar to mono_reflection_bind_generic_parameters(),
13561         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
13562
13563         * domain.c (mono_init_internal): Try to initialize.
13564         `mono_defaults.generic_array_class' here; this'll only succeed if
13565         we're using the 2.0 corlib.
13566
13567         * icall.c
13568         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
13569         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
13570         (mono_lookup_internal_call): Added support for nested classes.
13571
13572         * loader.c
13573         (mono_get_method_from_token): Set `result->signature->pinvoke' if
13574         we're an interncall and have generic arguments.
13575
13576         * class.c
13577         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
13578         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
13579         instance of System.Array.InternalArray<T> for arrays, so they
13580         implement the generic IList<T> interface.
13581
13582 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
13583
13584         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
13585         (chastamar@yahoo.com). Fixes #75374.    
13586
13587 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
13588
13589         * culture-info-table.h: regenerated.
13590
13591 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13592
13593         * icall.c: handle spaces correctly for base64 strings.
13594
13595 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
13596
13597         * *.c: Kill some warnings.
13598
13599 2005-06-23  Duncan Mak  <duncan@novell.com>
13600
13601         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
13602         that this builds on Solaris 10 (x86).
13603
13604 2005-06-23  Martin Baulig  <martin@ximian.com>
13605
13606         * class.c
13607         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
13608         generic type definitions.
13609
13610 2005-06-23  Martin Baulig  <martin@ximian.com>
13611
13612         Fix #75331.
13613
13614         * metadata.c (mono_class_get_overrides): Renamed to
13615         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
13616         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
13617         pass it to mono_get_method_full().
13618
13619 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
13620
13621         * reflection.c (mono_reflection_create_runtime_class): take the
13622         mono_domain_lock in this method. Prevents deadlocks
13623
13624 2005-06-22  Martin Baulig  <martin@ximian.com>
13625
13626         * loader.c (method_from_methodspec): Fix #75330.
13627
13628 2005-06-22  Martin Baulig  <martin@ximian.com>
13629
13630         * reflection.c (type_get_qualified_name): Use
13631         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
13632         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
13633         argument; use it if we don't have an assembly name.
13634
13635 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
13636
13637         * object.c: In mono_message_init, set "copy out" flag for in
13638         parameters with the [Out] flag.
13639
13640 2005-06-21  Martin Baulig  <martin@ximian.com>
13641
13642         * class.c
13643         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
13644         and MONO_TYPE_PTR.
13645
13646 2005-06-21  Martin Baulig  <martin@ximian.com>
13647
13648         * class.c (mono_class_init): Don't initialize `class->fields' for
13649         generic instances since they're initialized again in
13650         compute_field_layout(). 
13651         (compute_field_layout): Set the field's `generic_info' here; fix
13652         #75320. 
13653
13654 2005-06-21  Martin Baulig  <martin@ximian.com>
13655
13656         * class-internals.h
13657         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
13658
13659         * metadata.c (mono_metadata_generic_method_equal): Also
13660         distinguish the `generic_class'; fixes #75334.
13661
13662 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13663
13664         * domain.c:
13665         * appdomain.c:
13666         * domain-internals.h:
13667         * reflection.c: 'domain_assemblies' field is now protected by its own
13668         lock. Don't call into managed code to run the AssemblyLoad event if we
13669         now there are no registered delegates for it.
13670
13671 2005-06-20  Martin Baulig  <martin@ximian.com>
13672
13673         * class.c (mono_class_is_assignable_from): Use a custom version of
13674         mono_class_has_parent() to make things work for generic instances;
13675         fix #75300.
13676
13677 2005-06-20  Martin Baulig  <martin@ximian.com>
13678
13679         * loader.c (method_from_methodspec): Apply a patch from
13680         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
13681
13682 2005-06-20  Martin Baulig  <martin@ximian.com>
13683
13684         * class.c (mono_class_init): Reverted Zoltan's last change; it
13685         breaks generics.
13686
13687 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
13688
13689         * threads.c (wait_for_tids_or_state_change): Add missing locking.
13690
13691 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13692
13693         * socket-io.c: fix the index in the socket array for writable/error
13694         sockets. Fixes bug #75306.
13695
13696 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
13697
13698         * class.c (mono_class_init): Allow interfaces to have static ctors.
13699
13700 2005-06-17  Martin Baulig  <martin@ximian.com>
13701
13702         * loader.c (method_from_methodspec): Use `context->container' when
13703         parsing the `gmethod->inst'.
13704
13705 2005-06-17  Martin Baulig  <martin@ximian.com>
13706
13707         * class.c (mono_type_get_name_recurse): Don't add the assembly
13708         name for type arguments.
13709
13710 2005-06-15  Martin Baulig  <martin@ximian.com>
13711
13712         * reflection.c (mono_image_get_inflated_method_token): Encode
13713         correct klass; fixes #75260.
13714
13715 2005-06-13 Michal Moskal <malekith@nemerle.org>
13716
13717         * icall.c: Make GetCorrespondingMethod/Constructor take
13718         MonoReflectionMethod method not MonoMethod. Removed
13719         MonoType.GetCorrespondingField, and make
13720         MonoGenericType.GetCorrespondingField take name not
13721         MonoClassField.
13722
13723 2005-06-13  Michal Moskal <malekith@nemerle.org>
13724
13725         * reflection.c (field_encode_signature, encode_locals):
13726          Make sizes of buffers for types larger (for big generic types).
13727          (create_generic_typespec,
13728          mono_reflection_sighelper_get_signature_local,
13729          mono_reflection_sighelper_get_signature_field):
13730          Add asserts for too small buffers.
13731
13732 2005-06-15  Martin Baulig  <martin@ximian.com>
13733
13734         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
13735         if our parent is not a dynamic type.
13736
13737 2005-06-15  Martin Baulig  <martin@ximian.com>
13738
13739         * class-internals.h (MonoTypeNameFormat): New enum.
13740
13741         * class.c
13742         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
13743         (mono_type_get_full_name): Removed.
13744         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
13745         argument instead of the boolean's.
13746
13747         * icall.c (ves_icall_System_MonoType_getFullName):
13748         Added `gboolean assembly_qualified'.    
13749
13750         * reflection.h
13751         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
13752
13753         * reflection.c (mono_reflection_parse_type): Parse the new type
13754         name format.
13755
13756 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13757
13758         * icall.c: no need to convert from utf16 to utf8 and then back again
13759         after the call to GetLogicalDrives.
13760
13761 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13762
13763         * icall.c: frombase64. Fix problems exposed by new tests.
13764
13765 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13766
13767         * icall.c: added internal calls for converting char [] and strings in
13768         base64 into byte [].
13769
13770 2005-06-10  Martin Baulig  <martin@ximian.com>
13771
13772         * class.c (mono_class_create_generic_2): Read the nested classes
13773         from the metadata rather than from `gklass->nested_classes' since
13774         `gklass' might not be initialized yet.
13775
13776 2005-06-09  Duncan Mak  <duncan@novell.com>
13777
13778         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
13779         all public headers. Fixes #74919.
13780
13781 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
13782
13783         * domain.c: The key for proxy_vtable_hash is now a pointer
13784         array. Added new GHashFunc and GCompareFunc functions for this.
13785
13786         * class.h: The list of interfaces in MonoRemoteClass is known in
13787         advance and can't grow (we create a new MonoRemoteClass if needed),
13788         so now the interface array can be allocated together with
13789         MonoRemoteClass.
13790         
13791         * object.c: Added a new method create_remote_class_key.
13792         Fixed mono_remote_class so it does not depend on
13793         mono_upgrade_remote_class.
13794         Removed extend_interface_array.
13795         Added new method clone_remote_class(), which makes a copy of a remote
13796         class and adds a new interface or class to it.
13797         mono_upgrade_remote_class() now creates a new remote class (or gets
13798         it from the cache) if an vtable upgrade is needed. In this way
13799         we make sure that other objects sharing the same remote class
13800         don't get the new vtable with unwanted interfaces.
13801         
13802         * object-internals.h:
13803         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
13804         
13805         * marshal.c: Track changes in mono_upgrade_remote_class().
13806
13807 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
13808         * icall.c: Add runtime methods for obtaining members of inflated
13809         class, which were created from supplied non-inflated members. It
13810         is used in internal Get{Method,Constructor,Field} methods in
13811         System.Type
13812
13813 2005-06-09  Martin Baulig  <martin@ximian.com>
13814
13815         * reflection.c
13816         (mono_reflection_bind_generic_method_parameters): Fix #75169.
13817
13818 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13819         * reflection.c (mono_image_basic_init): Define
13820         Version in MonoDynamicAssembly. 
13821         
13822 2005-06-08  Martin Baulig  <martin@ximian.com>
13823
13824         Fix #75136.
13825
13826         * loader.c
13827         (mono_method_signature_full): New public method; takes a
13828         `MonoGenericContext *'.
13829         (find_method): Use mono_method_signature_full() and pass the
13830         klass'es context to it.
13831
13832         * class.c (mono_class_is_inflated_method): Use
13833         mono_method_signature_full() and pass the context to it.
13834
13835 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
13836
13837         * object.c: add proper locking in mono_remote_class_vtable(),
13838         fixes possible memory corruption.
13839
13840 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
13841
13842         * marshal.c (mono_remoting_marshal_init): set
13843         initialized after initialization.
13844
13845 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
13846
13847         * locales.c : hush.
13848
13849 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
13850
13851         * object.c (extend_interface_array): fix really silly
13852         memory corrupting / comparison bug.
13853
13854 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13855
13856         * reflection.c: Functions added to support the creation
13857         of CustomAttributeData, which includes Attribute data
13858         used by ReflectionOnly methods.
13859
13860         * reflection.h:  mono_reflection_get_custom_attrs_data and
13861          mono_custom_attrs_data_construct added (functions exposed).
13862
13863          * icall.c: Added mono_reflection_get_custom_attrs_data
13864          as icall.
13865         
13866 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
13867
13868         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
13869         lupus's request.
13870
13871 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
13872
13873         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
13874
13875         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
13876         dynamic DllImportAttribute.
13877
13878         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
13879         dynamic DllImportAttribute.
13880
13881         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
13882         Fixes #75162.
13883
13884 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13885
13886         * threads.c: avoid segfault when an unstarted thread is aborted.
13887
13888 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
13889
13890         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
13891         Returns the name and version of the runtime for reporting.
13892
13893 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13894
13895         * appdomain.c: bump corlib version.
13896         * object-internals.h: new field in MonoReflectionAssembly.
13897
13898 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13899
13900         * object-internals.h: Carlos forgot to add this field.
13901
13902 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
13903
13904         * icall.c: Added create_version to create instances
13905         of Version of MonoReflectionAssemblyName. This change helps
13906         the AssemblyName tests to keep running fine.
13907         
13908 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
13909   
13910         * object.c (mono_method_return_message_restore): A somehow less
13911         intrusive fix for #75138.
13912
13913 2005-06-03  Raja R Harinath  <rharinath@novell.com>
13914
13915         * object.c (mono_method_return_message_restore): Fix computation
13916         of expected number of out args.
13917
13918 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
13919
13920         * reflection.c (mono_image_get_method_info): Fix the case when the
13921         charset is empty.
13922
13923 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
13924
13925         * object.c: Added missing null check in
13926           mono_method_return_message_restore.
13927
13928 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
13929
13930         * reflection.c (mono_image_get_method_info): Handle the case when
13931         dllentry is empty.
13932
13933 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
13934
13935         * object.c: When creating the vtable for a proxy, take into account
13936         all inherited interfaces, not only the ones registered in
13937         iclass->interfaces. This fixs bug #74996.
13938         Also, in mono_method_return_message_restore, verify that the array
13939         of out args has the expected lengh.
13940
13941 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13942
13943         * socket-io.c: update the timeout in Poll when the call is interrupte.
13944
13945 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13946
13947         * socket-io.c: support abort/suspend in Select_internal after last
13948         change.
13949
13950 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13951
13952         * threadpool.c: remove warning.
13953
13954 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13955
13956         * icall.c:
13957         * socket-io.[ch]: Select_internal uses poll() now when available, thus
13958         removing the 1024 limit from select(). Runtime part of the fix for
13959         bug #71203.
13960
13961 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13962
13963         * socket-io.c: when resolving the addresses for the same
13964         host returned by gethostname(), get the local IPs from the interface
13965         list. Loopback addresses are discarded if the are interfaces up with
13966         non-loopback ones. Fixes bug #63265.
13967
13968 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
13969
13970         * appdomain.c, verify.c, object-internals.h, reflection.c:
13971         bumped corlib number to 36, and added new extra_flags field
13972         to ReflectionMethodBuilder and friends.  Fixes #75060.
13973
13974 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
13975
13976         * gc.c: register a new weak link only if the object is non-null
13977         (fixes bug#75047).
13978
13979 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
13980
13981         * culture-info.h : short time pattern too.
13982
13983 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
13984
13985         * culture-info.h : expand long time pattern string length.
13986
13987 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
13988
13989         * culture-info-table.h : update (more French date format; #72788).
13990
13991 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
13992
13993         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
13994         the method is static. Fixes #75029.
13995
13996 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
13997
13998         * reflection.c: Update the table_idx field of method builders after
13999         saving the module, since it can change. This is a workaround for
14000         bug #74914. 
14001
14002 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
14003
14004         * culture-info-table.h : update (additional French date format).
14005
14006 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
14007
14008         * icall.c (ves_icall_type_Equals): Revert last change.
14009         
14010         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
14011
14012         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
14013
14014 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
14015
14016         * class-internals.h: Added executioncontext_class field to 
14017         MonoDefaults structure.
14018         * domain.c: Cache System.Threading.ExecutionContext class in 
14019         mono_defaults.
14020         * object.c: Capture the ExecutionContext for asynchroneous calls in
14021          mono_async_result_new.
14022         * object-internals.h: Added execution_context and original_context 
14023         fields to MonoAsyncResult. Added execution_context to MonoThread.
14024         * security-manager.c|.h: Added mono_get_context_capture_method to 
14025         return the capture method (if required by the security manager or by
14026         the framework version used).
14027         * threadpool.c: Apply capture (if present) ExecutionContext in 
14028         mono_async_invoke and revert to original context after it completes.
14029
14030 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
14031
14032         * culture-info-table.h : updated (real hacky solution for zh-CHT).
14033
14034 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
14035
14036         * culture-info-table.h : zh-CHT related workaround.
14037
14038 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
14039
14040         * marshal.c (emit_marshal_custom): Add some error checking and call the
14041         methods in the ICustomMarshaler interface. Fixes #74875.
14042         
14043         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
14044         native->managed wrappers.
14045
14046 2005-05-12  Martin Baulig  <martin@ximian.com>
14047
14048         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
14049         here and use the loader lock.
14050
14051         * mono-debug.c: Properly lock when the debugger is not attached.
14052         (mono_debug_init): Release the initial lock if we're not running
14053         in the debugger.
14054
14055 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
14056
14057         * marshal.c (emit_marshal_custom): Pass through NULL values without
14058         calling the custom marshalling routines.
14059
14060         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
14061         conversion in structures. Fixes #74882.
14062
14063 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
14064
14065         * culture-info-table.h : zh-* cultures were missing.
14066
14067 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
14068
14069         * threads.c: Added a new event background_change_event which is signaled
14070         when a thread changes its background mode.
14071         Moved here several checks previously done in managed code. The checks
14072         require the thread lock, and using the thread lock in managed code
14073         can result in deadlocks.
14074         Merged Start_internal and Thread_internal into a single method. Now 
14075         Thread_internal does all work of creating and starting a thread.
14076         Added icalls for setting and getting the state of the object. Moved from
14077         managed code to avoid locking there.
14078         Added wait_for_tids_or_state_change() which is called instad of
14079         wait_for_tids when waiting for non-backround threads to end. This method
14080         will return if one of the threads ends or the background_change_event
14081         is signaled.
14082         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
14083         the background mode. This method signals the background_change_event
14084         event.
14085         * icall.c:
14086         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
14087         removed Start_internal.
14088         
14089 2005-05-11  Martin Baulig  <martin@ximian.com>
14090
14091         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
14092         to order of some fields to get proper alignment on 64-bit machines.
14093
14094 2005-05-11  Martin Baulig  <martin@ximian.com>
14095
14096         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
14097         changes as they're broken and completely fuck up the debugger.
14098
14099         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
14100
14101 2005-05-10  Martin Baulig  <martin@ximian.com>
14102
14103         * reflection.c (mono_reflection_generic_class_initialize): Don't
14104         call mono_class_setup_parent() here.
14105
14106 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14107
14108         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
14109         send/receive timeout use an integer in milliseconds. We were using a
14110         struct timeval.
14111
14112 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14113
14114         * locales.c:
14115         (internal_get_cultures): reserve the first slot of the array for the
14116         InvariantCulture, which will be filled in managed code.
14117
14118 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
14119
14120         * reflection.c (mono_image_fill_module_table): Initialize the
14121         GENERATION field as well.
14122
14123 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14124
14125         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
14126         Monitor.Enter on the object.
14127
14128 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
14129
14130         * threads.c: Enable the wait for running threads when exiting.
14131         * icall.c: Suspend all threads before exiting.
14132
14133 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
14134
14135         * assembly.c (mono_assembly_load_reference): Fix warning.
14136
14137 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14138
14139         * threadpool.c: changed the default number of threads per cpu. From now
14140         on, the default will be 20 + (5 * number of cpus) instead of 50.
14141
14142 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
14143
14144         * loader.c (mono_method_get_signature_full): Add locking here.
14145
14146 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
14147
14148         * appdomain.c: Moved methods for parsing and freeing assembly
14149         names to assembly.c.
14150         * assembly.c, domain-internals.h: Created public methods for parsing
14151         assembly names. Fixed mono_assembly_load_with_partial_name:
14152         it now finds the best match, taking into account the version,
14153         token and culture specified in the partial name. Also return
14154         the latest version if no version information is specified.
14155
14156 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
14157
14158         * threadpool.c: replace check for SocketAsyncCall class.
14159
14160 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14161
14162         * threadpool-internals.h:
14163         * Makefile.am: added threadpool-internals.h
14164
14165         * threadpool.c: call mono_unhandled_exception on exceptions not handled
14166         that happen in threadpool threads (tested on MS).
14167         (mono_thread_pool_remove_socket): new function that dispatch any pending
14168         AIO call on a socket that is closing. By now only epoll really needs it,
14169         as select/poll wake up when the socket closes.
14170
14171
14172         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
14173
14174 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
14175
14176         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
14177
14178 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
14179
14180         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
14181
14182 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
14183
14184         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
14185         has an abort request, convert it into a suspend request.
14186
14187 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
14188
14189         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
14190         warning for the usage of `UnmanagedFunctionPointerAttribute' which
14191         is not supported yet.
14192
14193 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14194
14195         * image.c: register assemblies loaded from data (bundles) in the loaded
14196         assemblies hash. Fixes bug #74772.
14197
14198 2005-04-29  Martin Baulig  <martin@ximian.com>
14199
14200         * class.c (mono_type_get_name_recurse): Update to the new naming
14201         schema from the latest .NET 2.x beta2.
14202         (mono_class_setup_vtable_general): If we're a generic instance,
14203         copy the vtable from our generic type definition and inflate all
14204         the methods in it.
14205
14206         * loader.c (find_method): Update to the new naming schema from the
14207         latest .NET 2.x beta2.
14208
14209 2005-04-29  Raja R Harinath  <harinath@gmail.com>
14210
14211         * class.c (mono_class_init): Add a mono_loader_unlock to the
14212         #74734 fix.
14213
14214 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
14215
14216         * icall.c (ves_icall_System_Environment_Exit): Remove the 
14217         suspend_all_other_threads () call for the time being, since it can hang.
14218
14219         * threads.c (mono_thread_manage): Similarly, disable the waiting for
14220         the background threads to exit, since it can also hang.
14221
14222         * class.c (mono_class_init): Applied patch from Ankit Jain 
14223         (radical@gmail.com). Avoid pending init errors when a field refers
14224         to a nested class using a typeref. Fixes #74734.
14225
14226         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
14227         this for dynamic modules.
14228
14229 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14230
14231         * threads.c: don't wait for threads that are in the process of aborting
14232         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
14233         and waiting for background threads to finish. This makes xsp and
14234         mod-mono-server exit without random length delays and/or hangs.
14235
14236 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14237
14238         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
14239
14240 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
14241
14242         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
14243         dynamic types to prevent infinite loops. Fixes #74727.
14244
14245         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
14246         ..._is_assignable_to.
14247
14248 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
14249
14250         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
14251
14252 2005-04-25  Martin Baulig  <martin@ximian.com>
14253
14254         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
14255
14256         * domain.c
14257         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
14258
14259         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
14260
14261         * reflection.c (build_compressed_metadata): Set metadata header
14262         version to 2.0.
14263
14264 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
14265
14266         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
14267         number into an integral and a decimal part. Fixes #70473.
14268
14269         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
14270
14271 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
14272
14273         * culture-info-table.h : reflected the latest locale-builder output.
14274
14275 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14276
14277         * threadpool.c: check for SuspendRequested too when deciding if
14278         mono_thread_interruption_checkpoint should be called.
14279
14280 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14281
14282         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
14283         * threads.c: remove interruption_mutex and use Interlocked instead. When
14284         suspending all the threads, wait for all the suspended events at once.
14285         If we're shutting down and get an APC that is going to be queued,
14286         call mono_thread_execute_interruption immediately, as the thread might
14287         be sleeping on a pthread condition or mutex.
14288
14289         * icall.c: call mono_runtime_set_shutting_down before suspending the
14290         threads.
14291
14292         Fixes bug #74693. And now xsp is happier when exiting.
14293
14294 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
14295
14296         * loader.c (mono_stack_walk): Fix #74690.
14297
14298 2005-04-22  Martin Baulig  <martin@ximian.com>
14299
14300         * mono-debug.h (MonoDebugMethodJitInfo): Added
14301         `MonoDebugMethodJitInfo *jit'.
14302
14303         * mono-debug.c (mono_debug_read_method): Cache the
14304         MonoDebugMethodJitInfo in `address->jit'.
14305         (mono_debug_free_method_jit_info): New public method.
14306
14307 2005-04-22  Martin Baulig  <martin@ximian.com>
14308
14309         * class.c (mono_class_is_assignable_from): Disallow
14310         type parameter -> interface.
14311
14312 2005-04-21  Dick Porter  <dick@ximian.com>
14313
14314         * threads.c (mono_thread_create): Turn an assertion into an error.
14315
14316 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
14317
14318         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
14319         
14320         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
14321         Fix some gcc 4.0 warnings.
14322
14323 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
14324
14325         * file-io.c: fix alt dir separator char on unix systems
14326         and cleanup (fixes bug #71214).
14327
14328 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
14329
14330         * marshal.c: Use CALLVIRT instead of CALL when dispatching
14331         a call to a remote domain, since the method may be an
14332         interface method in the client domain. This fixes bug #74192.
14333
14334 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14335
14336         * threadpool.c: recv/send are now performed before going back to managed
14337         code to save one transition.
14338
14339 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14340
14341         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
14342
14343         * metadata/threadpool.c: removed hack to workaround the bug above.
14344
14345         Fixes bug #74618.
14346
14347 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
14348
14349         * reflection.c reflection.h: Fix handling of parameter defaults in
14350         dynamic methods. Also fixes handling of parameter attributes.
14351         Fixes #74609.
14352
14353         * mono-debug.c (mono_debug_close_image): Fix warning.
14354
14355 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14356
14357         * socket-io.h: replaced old unused field with new 'blocking'.
14358         * threadpool.c: restore socket blocking state on windows(tm).
14359
14360 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
14361
14362         * icall.c: don't return the codebase in the AssemblyName[] returned by
14363         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
14364         * object-internals.h: Removed FIXME (fields were presents) and fixed
14365         versioncompat declaration.
14366
14367 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14368
14369         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
14370         not closed, so don't cleanup when it happens.
14371
14372 2005-04-13  Chris Toshok  <toshok@ximian.com>
14373
14374         * mono-debug-debugger.h: change prototype for
14375         mono_debugger_lookup_type.
14376
14377         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
14378         this function, although it should probably be named
14379         mono_debugger_init_type.
14380
14381 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14382
14383         * threadpool.c: fix non-AIO case.
14384
14385 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
14386
14387         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
14388         the built-in profiler to measure just JIT compilation times.
14389
14390 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14391
14392         * threadpool.c: the epollfd might be closed by another thread at
14393         any time, so ignore EBADF at treat it as a "we're closing" sign.
14394
14395 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14396
14397         * threadpool.c: release the semaphores with a count equals to the number
14398         of working threads in both IO and regular pools. Fixed typo that messed
14399         up the count of IO pool threads. Don't initialize the pipe handles if
14400         we're using epoll.
14401
14402 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14403
14404         * threadpool.c: some systems don't like a NULL when deleting the socket
14405         from epoll.
14406
14407 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14408
14409         * threadpool.c: fix semaphore allocation.
14410
14411 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14412
14413         * threadpool.c: added epoll() based implementation for asynchronous IO
14414         that is used instead of the default poll() when available.
14415         It can be disabled by setting MONO_DISABLE_AIO.
14416
14417 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14418
14419         * threadpool.c: windows needs 'closesocket' and instead of returning
14420         0 when the stream is closed while in select, it returns -1. Fixes bug
14421         #74573.
14422
14423 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
14424
14425         * class.c (class_compute_field_layout): Fix the regression caused by
14426         the previous try.
14427
14428 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14429
14430         * threadpool.c: separate pool for socket async. IO.
14431         * threadpool.h: mono_max_worker_threads is not a global any more.
14432
14433 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
14434
14435         * class.c (class_compute_field_layout): Fix #74549.
14436
14437 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14438
14439         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
14440         use 2 connected sockets instead.
14441
14442 2005-04-08  Miguel de Icaza  <miguel@novell.com>
14443
14444         * mono-config.c: Add new entry point for mkbundle
14445         mono_config_parse_memory. 
14446
14447 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14448
14449         * threadpool.c: removed another unused function.
14450
14451 2005-04-08  Ankit Jain  <radical@corewars.org>
14452
14453         * reflection.c (get_default_param_value_blobs): Add 'types'
14454         parameter to get the types encoded in the constant table.
14455         (mono_param_get_objects): Use the type from the constant table,
14456         not the type of the parameter, when creating default values.
14457         Handle null default values correctly.
14458
14459 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14460
14461         * file-io.c:
14462         * file-io.h:
14463         * threadpool.c:
14464         * threadpool.h:
14465         * icall.c:
14466         * socket-io.c: removed dead code for async IO.
14467
14468 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14469
14470         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
14471
14472         * threadpool.c: intercept socket async. calls and pass them to a thread
14473         that is polling and dispatching the job items to the threadpool as
14474         socket become ready. Fixes bugs #71217, #71933.
14475
14476         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
14477         between char and short/ushort arrays.
14478
14479         * socket-io.c: remove dead code.
14480
14481 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
14482
14483         * locales.c,
14484           icall.c : removed InternalToUpper_Comp() and
14485           InternalToLower_Comp().
14486
14487 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
14488
14489         * char-conversions.h : The tables were incorrectly generated. Should
14490           be generated against invariant culture.
14491
14492 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
14493
14494         * object.c (mono_runtime_invoke_array): Fix return value when 
14495         passing pre-created valuetype objects to ctors.
14496
14497         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
14498         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
14499         Fixes #74338.
14500
14501 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
14502
14503         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
14504         only used with --security and hides the wrong corlib version error.
14505
14506 2005-03-30  Joshua Tauberer  <tauberer@for.net>
14507
14508         * class.c: Changed mono_class_name_from_token so that types
14509         outside of a namespace don't have an initial period.  Improved
14510         the g_warning message used in _mono_class_get when loading
14511         fails.
14512         * assembly.c: In mono_assembly_load_reference, when an assembly
14513         can't be found, "No such file or directory" is misleading and
14514         unhelpful because a few paths were checked for the presence of
14515         the assembly.  When that happens (ENOENT), display a nicer
14516         message indicating the directories that were searched.  In all
14517         cases, the warning is made easier to read for non-hackers.
14518
14519 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
14520
14521         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
14522         project/solution.
14523         * appdomain.h|domain.c: Removed inline from functions.
14524         * appdomain.c: Reduced warnings when compiling on windows.
14525         * icall.c: Fixed output_debug declaration to gunichar2*.
14526         * mono-config.c: Reduced warnings when compiling on windows.
14527         * rand.c: Added missing "windows.h". Added missing return value.
14528         * rawbuffer.c: Added missing winsock2.h for windows.
14529         * sysmath.h: Added mono-compiler.h header to allow/ease 
14530         compilation with non-GCC compilers.
14531         * threads.c: Fixed declarations to compile with VS.NET C compiler.
14532         Removed cast warnings.
14533
14534         Adapted from the work of J Lothian (for VC6).
14535
14536 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
14537
14538         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
14539         from default_path.
14540
14541 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
14542
14543         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
14544         the 2.0 profile.
14545
14546 2005-03-27  Raja R Harinath  <harinath@gmail.com>
14547
14548         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
14549         has to be in $(exec_prefix).  $(prefix) is for arch-independent
14550         stuff, and it would probably use $(prefix)/share rather than
14551         $(prefix)/lib.
14552
14553 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14554
14555         * console-io.c: added 2 includes that might be missing.
14556
14557 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
14558
14559         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
14560         profile.
14561
14562         * reflection.c (create_custom_attr): Allocate the params array using
14563         alloca so it gets GC tracking.
14564
14565 2005-03-23  Chris Toshok  <toshok@ximian.com>
14566
14567         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
14568         out some spew.
14569
14570 2005-03-24  Raja R Harinath  <rharinath@novell.com>
14571
14572         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
14573         changes to pick up any changes in prefix, etc.
14574
14575 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
14576
14577         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
14578         
14579         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
14580         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
14581
14582 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
14583
14584         * class-internals.h object-internals.h class.c reflection.c: Extend the
14585         mono_lookup_dynamic_token () function to return the class of the
14586         token as well. 
14587
14588         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
14589         well. Fixes #73848.
14590
14591 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
14592
14593         * security-manager.c: Skip inheritance checks for intra-corlib
14594         class inheritance and method overrides. This skips a lot of checks
14595         and (anyway) permissions cannot work until corlib is loaded.
14596
14597 2005-03-23  Martin Baulig  <martin@ximian.com>
14598
14599         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
14600         MONO_TYPE_GENERICINST.  
14601
14602 2005-03-23  Martin Baulig  <martin@ximian.com>
14603
14604         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
14605
14606 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
14607
14608         * class.c: added locking comments to some functions.
14609         Cache the interface offsets arrays (saves about 20 KB
14610         of runtime memory in a typical app).
14611         Reduce the time overhead in mono_class_setup_supertypes ().
14612
14613 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
14614
14615         * icall.c: speedup and fix leaks in GetMethodsByName and
14616         GetPropertiesByName.
14617
14618 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
14619
14620         * reflection.c: some locking fixes.
14621
14622 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
14623
14624         * metadata.c: added missing break in case statement.
14625
14626 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
14627
14628         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
14629         typedbyref return values. Fixes #73941.
14630
14631 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
14632
14633         * security-manager.c|h: Added demandunmanaged method and 
14634         suppressunmanagedcodesecurity class to MonoSecurityManager.
14635         Renamed aptc class to allowpartiallytrustedcallers.
14636
14637 2005-03-17  Martin Baulig  <martin@ximian.com>
14638
14639         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
14640
14641 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14642
14643         * file-io.c: disabled file async. IO using aio_*. It uses the
14644         threadpool now. Workaround for bug #73718.
14645
14646 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
14647
14648         * assembly.h, mono-config.c: added code to deal with bundled configs
14649         for bundled assemblies.
14650
14651 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
14652
14653         * *.c, private.h: cleanup, removing old private.h header file.
14654
14655 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
14656
14657         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
14658         and throw_on_unmappable_char attributes.
14659
14660 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
14661
14662         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
14663         _ProcessName_internal.
14664
14665 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
14666
14667         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
14668         #73631.
14669
14670         * icall.c threads.c threads-types.h: Remove slothash icalls as they
14671         are no longer used.
14672
14673 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
14674
14675         * object.c (compute_class_bitmap): Add support for generics. Fixes
14676         #73527.
14677
14678 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
14679
14680         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
14681
14682 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14683
14684         * filewatcher.c: commented out the code for windows watcher, as we don't
14685         use it (we use the managed implementation instead).
14686
14687 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
14688
14689         * object-internals.h (MonoThread): Remove 'unused1' field.
14690
14691         * appdomain.c: Bump corlib version.
14692
14693         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
14694
14695         * reflection.c (mono_reflection_create_runtime_class): Remove the
14696         AssemblyBuilder.Save optimization since it causes too many problems.
14697
14698 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
14699
14700         * exception.c|h: Added mono_get_exception_reflection_type_load to
14701         create a ReflectionTypeLoadException object.
14702         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
14703         to return NULL is a InheritanceDemand fails during reflection. Updated
14704         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
14705         ReflectionTypeLoadException if an InheritanceDemand fails during 
14706         reflection. Added icall mapping for GetLinkDemandSecurity.
14707         * security-manager.c|h: Added ves_icall_System_Security_
14708         SecurityManager_GetLinkDemandSecurity internal call to return the
14709         class and methods permissions set for a LinkDemand. Removed unused
14710         fields in MonoSecurityManager.
14711
14712 2005-03-10  Martin Baulig  <martin@ximian.com>
14713
14714         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
14715         it's a generic instance.
14716
14717 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
14718
14719         * reflection.c (mono_get_object_from_blob): Applied patch from
14720         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
14721
14722         * class.c (mono_class_is_assignable_from): Another try at fixing 
14723         #73469 without breaking anything.
14724
14725 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
14726
14727         * class.c: (mono_class_is_assignable_from): Revert the last changes
14728         since they don't work with generics.
14729         
14730         * class.c (mono_class_is_assignable_from): Fix build bustage.
14731
14732         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
14733         the managed IsAssignableFrom method. Fixes #73469.
14734
14735         * reflection.c (mono_reflection_call_is_assignable_from): New helper
14736         function.
14737
14738 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
14739
14740         * object.c (mono_load_remote_field_new): Fix returning uninitialized
14741         memory when the remoting callback does not sets the out arguments.
14742         Fixes #73007.
14743
14744         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
14745         by mistake.
14746
14747         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
14748
14749         * object-internals.h (MonoStackFrame): Sync with managed object layout.
14750
14751         * appdomain.c: Bump corlib version.
14752
14753 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
14754
14755         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
14756         function.
14757
14758         * threads.c (mono_thread_attach): Detect threads which are not started
14759         by the GC pthread wrappers.
14760
14761 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
14762
14763         * icall.c: Added new icall for RNG.
14764         * rand.c|h: Added new icall to open the RNG. This allows to share a 
14765         single handle on Linux to access /dev/urandom and fix #73183.
14766
14767 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
14768
14769         * object.c: setting the new vtable in a transparent proxy object must
14770         not change the GC descriptor.
14771
14772 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14773
14774         * object.c: fixed compilation without GCJ support.
14775         * reflection.c: for runtime-created types ensure klass->has_references
14776         is correct (bug #73215).
14777
14778 2005-03-02  Martin Baulig  <martin@ximian.com>
14779
14780         * class.c (mono_class_is_assignable_from): Make this work if
14781         `oklass' is a generic instance; fixes #72831.
14782
14783 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
14784
14785         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
14786         with hasthis set.
14787         
14788         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
14789
14790         * marshal.c: Reorganize native->managed marshalling code to also use
14791         the emit_marshal_... functions.
14792
14793 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
14794
14795         * object.c: typed allocs have issues with bitmap sizes > 30,
14796         so check for max_set >= 30.
14797
14798 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
14799
14800         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
14801         managed code. Fixes #73012.
14802
14803         * metadata.h (MonoMarshalSpec): Add elem_mult field.
14804
14805         * metadata.c reflection.c: Load/Emit elem_mult as well.
14806         
14807         * metadata.h (MonoMarshalSpec): Add comment.
14808
14809         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
14810
14811         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
14812         num_elem to -1 if not given.
14813
14814         * object-internals.h (MonoReflectionMarshal): Add has_size field.
14815
14816         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
14817         given values.
14818
14819 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
14820
14821         * null-gc.c (mono_gc_free_fixed): Was not compilable.
14822
14823 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
14824
14825         * reflection.c (encode_marshal_blob): Encode param_num field as well.
14826
14827         * object-internals.h (MonoReflectionMarshal): Add param_num field.
14828
14829 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
14830
14831         * object.c: generalized the reference bitmap creation
14832         and added hooks for the new GC.
14833         * class-internals.c: removed the gc_bitmap field from MonoClass.
14834
14835 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
14836
14837         * domain.c: help the compiler to produce better code
14838         in mono_jit_info_table_find ().
14839
14840 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
14841
14842         * object.c: make all allocations look typed.
14843
14844 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
14845
14846         * socket-io.c: load Mono.Posix if it's not loaded already
14847         (fixes bug#73033).
14848
14849 2005-02-24  Martin Baulig  <martin@ximian.com>
14850
14851         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
14852         * reflection.c (dup_type): Likewise.
14853
14854 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
14855
14856         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
14857         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
14858
14859 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
14860
14861         * domain.c, threads.c, object-internals.h: make the critical thread
14862         local vars use the fast access mode (even when we're compiled in
14863         a lib). Provide accessors to be used by the jit during codegen.
14864
14865 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
14866
14867         * appdomain.c: Changed hook functios behavior to include
14868         support for the reflection only assemblies. Some icalls were changed
14869         to support the mentioned assemblies too. Signatures of static methods
14870         try_assembly_resolve and real_load now have an additional parameter:
14871         refonly.
14872
14873         * assembly.c: General changes to mono_assembly_ methods to support
14874         reflection only api. Functions mono_assembly_open, mono_assembly_load,
14875         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
14876         suffix, to support an additional gbool parameter to specify whether
14877         the assembli is reflection only or not. Created some new hook functions 
14878         to add support for reflection only assemblies. Signatures of static 
14879         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
14880         have now an additional parameter: refonly.
14881
14882         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
14883         indicating whether the assembly is reflection only or not.
14884
14885         * exception.c: Add mono_get_exception_invalid_operation.
14886
14887         * icall.c: Throw an InvalidOperationException when trying to invoke
14888         a property/method/event, or trying to set/get the value of a field.
14889         Also add an icall to retrieve the ref_only flag to the
14890         MonoReflectionAssembly.
14891
14892 2005-02-23  Chris Toshok  <toshok@ximian.com>
14893
14894         Part of fix for #72827.
14895         * mono-debug.c (mono_debug_add_method): add lexical block data to
14896         the info we write.  Kind of a hack at the moment - we copy the
14897         lexical block info from the MonoDebugMethodInfo to the
14898         MonoDebugMethodJitInfo here, before writing it.
14899         (mono_debug_read_method): read the lexical block info.
14900
14901         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
14902
14903         * debug-mono-symfile.h: add lexical block support.
14904
14905         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
14906         support.
14907
14908 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
14909
14910         * loader.c (mono_lookup_pinvoke_call): Fix warning.
14911
14912         * object.c (mono_runtime_free_method): Call mono_free_method () and
14913         put the TODOs there.
14914
14915         * loader.c (mono_free_method): Free up most memory allocated for 
14916         dynamic methods.
14917
14918 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
14919
14920         * reflection.c: properly flag a Type argument to a
14921         named custom attr value (bug #72248).
14922
14923 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
14924
14925         * reflection.c: reduce code duplication in named custom
14926         attribute encoding.
14927
14928 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
14929
14930         * reflection.c: properly encode custom attrs of type object
14931         (bug #72649).
14932
14933 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
14934
14935         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
14936
14937 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
14938
14939         * socket-io.c: load System.dll if it's not loaded already
14940         (bug #72850 and #70477).
14941
14942 2005-02-21  Martin Baulig  <martin@ximian.com>
14943
14944         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
14945         generic instances.
14946
14947 2005-02-21  Martin Baulig  <martin@ximian.com>
14948
14949         * reflection.c (mono_image_build_metadata): We also need to
14950         "fixup" the MethodImpl table after we computed the final method
14951         indices.  Call fixup_methodimpl() to do that.
14952         (fixup_methodimpl): New private method.
14953
14954 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
14955
14956         * assembly.c: special case mscorlib.dll (bug#72536),
14957         patch from Carlos Alberto Cortez.
14958
14959 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
14960
14961         * threads-types.h threads.c: Fix build bustage.
14962
14963         * threads.c: Use a union for long<->double conversions.
14964
14965         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
14966         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
14967
14968         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
14969         containing the checkpoint call with NOT_TAKEN.
14970         
14971         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
14972         checkpoint before pushing the arguments, so they won't have to be
14973         spilled to stack.
14974
14975 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
14976
14977         * domain.c, assembly.c, domain-internals.h: make some data
14978         const and relocation-free.
14979
14980 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
14981
14982         * object.c, appdomain.c, class-internals.h: introduce the
14983         MonoClassRuntimeInfo structure to hold the info needed to
14984         use a class at runtime. Made mono_class_vtable() lock-free
14985         for all the appdomains.
14986
14987 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
14988
14989         * metadata-internals.h, image.c: introduce a per-image mempool to
14990         be used for memory that has the same lifetime as the image.
14991
14992 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
14993
14994         * domain.c: In mono_init_internal(), instead of selecting the first
14995         runtime version supported by an executable, get a list of all
14996         supported versions and select the one for which an mscorlib exists
14997         (since even if the runtime supports a given version, it doesn't mean
14998         that the framework for that version is installed).
14999         Modified get_runtimes_from_exe to support this behavior.
15000         In supported_runtimes, added information about additional system
15001         assembly versions.
15002         
15003         * assembly.c: Added support for more than one system assembly version
15004         per runtime version. Updated the assembly list.
15005         In mono_assembly_remap_version, removed the initial version check,
15006         since we don't know to which version we need to compare until we
15007         get the version set on which the assembly is based.
15008         Moved the code for loading corlib into the new method
15009         mono_assembly_load_corlib(), so it can be used by the initialization
15010         code.
15011         
15012         * domain-internals.h: Updated data structures and added declaration
15013         for mono_assembly_load_corlib.
15014
15015 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
15016
15017         * reflection.c (resolve_object): Fix the creation of the signature in 
15018         the SignatureHelper case.
15019
15020         * assembly.c (mono_assembly_remap_version): Fix binary search.
15021         
15022 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
15023  
15024         * class.c: Added inheritance check when a method is overloaded (from a
15025         virtual method or when implementing an interface) and when a class is
15026         inherited. Added functions to set a failure for a class and to 
15027         retreive the exception from a failure.
15028         * class-internals.h: Added fields to MonoClass to keep the exception
15029         information status for inheritance (or other exceptions) to be thrown
15030         later (i.e. not at load time).
15031         * object.c: Throw the inheritance SecurityException when a type is to 
15032         be created with either class or method inheritance violations.
15033         * reflection.c|h: Fix when getting declsec from a class. Removed 
15034         unrequired code for class. Improved sanity in parameter naming.
15035         * security-manager.c|h: Added functions to check for class and method
15036         inheritance.
15037
15038 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
15039
15040         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
15041         and has_finalize in dynamic types as well.
15042
15043 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
15044
15045         * culture-info-table.h : fixed currency format for en-GB (and so on).
15046
15047 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
15048
15049         * gc.c: ensure the GC handles never have 0 as a value.
15050
15051 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
15052
15053         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
15054         a pointer to a struct to unmanaged code. Fixes #72625.
15055
15056 2005-02-16  Martin Baulig  <martin@ximian.com>
15057
15058         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
15059
15060 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
15061
15062         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
15063
15064 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
15065
15066         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
15067
15068         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
15069         UnmanagedFunctionPointerAttribute, use it for determining calling convention
15070         etc. Fixes #71471.
15071
15072         * reflection.c (mono_custom_attrs_get_attr): New helper function.
15073
15074         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
15075
15076 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
15077
15078         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
15079         changes to make the current context a field in MonoThread.
15080
15081 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
15082
15083         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
15084         the last change.
15085         
15086         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
15087         extracted from mono_marshal_get_native_wrapper.
15088
15089         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
15090         to create wrappers around native functions.
15091
15092         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
15093         delegates for arbitrary function pointers. Fixes #71472.
15094
15095 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
15096
15097         * threads.c: cleaned up the code a little.
15098
15099 2005-02-15  Martin Baulig  <martin@ximian.com>
15100
15101         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
15102         the data table.
15103
15104         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
15105         allocate larger chunks if needed.
15106
15107 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
15108
15109         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
15110         in by mistake.
15111
15112 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
15113
15114         * domain.c: keep the domains in an array and ensure the domain ids
15115         are kept small, so they can be used as indexes to domain-specific data
15116         with a small memory overhead.
15117
15118 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
15119
15120         * icall.c: Handle byref types in Type icalls. Fixes #72544.
15121
15122 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
15123
15124         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
15125
15126 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
15127
15128         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
15129
15130         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
15131         values.
15132
15133         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
15134         
15135 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
15136
15137         * domain-internals.h: add the hashtable here.
15138
15139         * class-internals.h: Remove `info' from MonoMethod
15140
15141         * domain.c: Add a new hashtable, jit_trampoline_hash
15142
15143 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
15144
15145         * object.c: don't set the value of static fields
15146         (fixes bug#72494).
15147
15148 2005-02-11  Martin Baulig  <martin@ximian.com>
15149
15150         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
15151         (mono_debug_add_method): Silently ignore the method if it's too big.
15152         (mono_debug_add_type): Likewise.
15153
15154 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
15155
15156         * threads.c, appdomain.c: remove #ifdefs from the code.
15157
15158 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
15159
15160         * metadata-internals.h: Added flags to MonoAssembly to cache the most
15161         common security informations. This allows us to stay in unmanaged code
15162         when doing LinkDemand and it's special cases (except for the first 
15163         time for initialization). The flags a very much used with --security.
15164         * reflection.c|h: Added code to get declarative security attributes 
15165         for LinkDemand and InheritanceDemand. This required to refactor the
15166         existing code for Demand.
15167         * security-manager.c|h: Added new method fields for the special cases
15168         of LinkDemand.
15169
15170 2005-02-10  Martin Baulig  <martin@ximian.com>
15171
15172         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
15173         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
15174
15175 2005-02-10  Martin Baulig  <martin@ximian.com>
15176
15177         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
15178         debugging code; this is almost a complete rewrite.
15179
15180         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
15181
15182 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
15183
15184         * domain.c, object.h: expose mono_string_equal () and 
15185         mono_string_hash ().
15186         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
15187         it's implemented in managed code.
15188
15189 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15190
15191         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
15192         lo leak objects between appdomains.
15193
15194 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15195
15196         * assembly.c: old compilers compilation fix from 
15197         robertj@gmx.net (Robert Jordan).
15198
15199 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
15200
15201         * class-internals.h: Little reminder for the future.
15202
15203         * debug-helpers.c: Fix up wrapper_type_names
15204
15205 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15206
15207         * image.c, metadata-internals.h: when loading an image from a file,
15208         mmap all of it and use the same codepaths as when using a
15209         in-memory image: the code is simpler and we use less memory
15210         (both writable and readonly).
15211
15212 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
15213
15214         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
15215         API to alloc runtime data structures that need to be tracked by the
15216         GC and contain pointers.
15217         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
15218         make the code more readable and eventually use a different GC.
15219
15220 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
15221
15222         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
15223         for out arguments.
15224         
15225 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
15226
15227         * object.c: In release_type_locks(), don't release the cctor lock
15228         if it has already been released. This fixes a crash in the
15229         thread5 test.
15230
15231 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
15232
15233         * gc.c, marshal.c, icall.c: register a delegate for finalization
15234         only when the native function pointer has been allocated for it.
15235
15236 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
15237
15238         * object.c: cleaned up some code, allocate objects that are
15239         pointer free with the atomic malloc variant. Allocate memory
15240         for static data from the mempool if it's pointer-free.
15241         Allocate the bounds array at the end of the array data, when needed.
15242         * object-internals.h, object.h: move a private function in a private
15243         header.
15244         * class.c: handle missing case in tracking references in fields.
15245
15246 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
15247
15248         * class.c, class-internals.h: keep track if a type has
15249         reference fields in either the instance or static fields.
15250
15251 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
15252
15253         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
15254         and renamed to MonoRuntimeInfo. Added fields to store the expected
15255         framework assembly version. Changed mono_get_framework_version and
15256         mono_get_runtime_version for a single mono_get_runtime_info method.
15257         
15258         * assembly.c: Added method to remap system assembly versions to the
15259         current executing runtime version. Removed old mapping code.
15260         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
15261         
15262         * icall.c, reflection.c: Track api changes.
15263
15264 2005-02-06  Miguel de Icaza  <miguel@novell.com>
15265
15266         * loader.c (method_from_memberref): Improve error reporting,
15267         produce the class name instead of the typeref/typedef index. 
15268
15269 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
15270
15271         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
15272
15273 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15274
15275         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
15276         stdcall and charset name mangling.  Reorganize the code and add
15277         some tracing stuff.
15278
15279 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
15280
15281         * monodiet.c: More iters!
15282
15283         * marshal.c: Iter usage.
15284
15285         * icall.c: Iter usage.
15286
15287         * object.c: Use iters.
15288
15289         * debug-helpers.c: More iters
15290
15291 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15292
15293         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
15294         under win32.
15295
15296 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
15297
15298         * mono-debug-debugger.c: use iters
15299
15300         * class.c, class-internals.h: mono_class_setup_events is static
15301         now
15302
15303         * All callers: use iters
15304
15305 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
15306
15307         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
15308         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
15309
15310 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
15311
15312         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
15313
15314         * marshal.h: Add prototypes for ldfld/stfld_remote.
15315
15316         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
15317         this is called during startup.
15318         
15319 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
15320
15321         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
15322         MonoThreadsSync struct private in monitor.c. Changed the way
15323         MonoThreadsSync is allocated so it's faster and there is no
15324         need to keep track of it with a finalizer and it uses less memory.
15325         This also finally allows us to allocate mono objects as ptrfree when
15326         there are no reference fields.
15327
15328 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
15329
15330         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
15331         disappearing link to the GC interface and use them to simplify
15332         the gchandles code.
15333
15334 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
15335
15336         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
15337         stfld_remote which call mono_load/store_field_new. This allows methods
15338         calling ldfld/stfld wrappers to be AOTed.
15339
15340         * console-io.c: Include sys/filio.h under solaris.
15341         
15342         * console-io.c: Include curses.h if needed correctly.
15343
15344 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
15345         
15346         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
15347         method->klass as well.
15348
15349         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
15350
15351         * class.c (mono_class_init): Switch on lazy initialization of 
15352         methods.
15353
15354         * class.c (mono_class_get_finalizer): Handle the case when the 
15355         finalizer is inherited.
15356
15357 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15358
15359         * console-io.c: <curses.h> is needed by term.h on solaris.
15360
15361 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
15362
15363         * icall.c, class-internals.h, monodiet.c, class.c: Remove
15364         mono_class_setup_properties where possible. Remove this ftn from
15365         the header file, and make it static.
15366
15367 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
15368
15369         * loader.c: Add missing setup_... call.
15370
15371         * class.c: Add missing setup_... calls.
15372
15373         * class.c (mono_class_init): Switch on lazy initialization of 
15374         the generic vtable.
15375         
15376         * class.c (mono_class_init): Fix generics broken by the recent changes.
15377
15378         * monodiet.c (handle_type): Add missing setup_... calls.
15379
15380         * class.c: Back out garbage in previous patch.
15381         
15382         * class.c: Add missing setup_... calls.
15383
15384         * class.c (mono_class_get_method_from_name_flags): Avoid calling
15385         mono_class_setup_methods () if possible.
15386
15387         * class-internals.h (MonoClass): Add 'has_cctor' flag.
15388
15389         * class-internals.h (MonoCachedClassInfo): New structure.
15390
15391         * class.c: Initialize properties and events fields of MonoClass lazily.
15392
15393         * class.c: Add infrastructure for lazily initializing the methods and
15394         vtable fields of MonoClass. Not yet used.
15395
15396         * class.c (mono_class_get_finalizer): New helper function.
15397
15398         * class.c: Add infrastructure for loading some class related data from
15399         an AOT file.
15400
15401         * object.c: Add infrastructure for initializing the vtable from data
15402         in the AOT file.
15403
15404         * gc.c (run_finalize): Use mono_class_get_finalizer ().
15405
15406         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
15407         appropriate initialization function before accessing parts of the
15408         MonoClass structure.
15409
15410         * marshal.c: Fix warnings.
15411         
15412         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
15413
15414         * mono-debug-debugger.c (get_exception_message): Use 
15415         mono_class_get_method_from_name_flags ().
15416
15417 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
15418
15419         * reflection.c, appdomain.c: Replace a few manual searches that
15420         Zoltan missed. (Paolo approved this part of my initial patch).
15421
15422 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
15423
15424         * profiler.c: disable recording statistical events at report time.
15425
15426 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15427
15428         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
15429         to byteswap arrays of enum values, too (bug #72080).
15430
15431 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
15432
15433         * appdomain.c (set_domain_search_path): Allow this to be called if
15434         domain->setup is not yet set.
15435
15436         * loader.c (mono_method_get_index): New helper function.
15437
15438         * loader.c reflection.c: Use mono_method_get_index ().
15439
15440         * class.c (mono_class_get_method_from_name_flags): New helper method.
15441
15442         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
15443         this.
15444
15445         * class.c (mono_class_get_cctor): New helper method.
15446
15447         * string-icalls.c object.c class.c marshal.c reflection.c: Use
15448         mono_class_get_method () to look up methods.
15449
15450 2005-02-01  Miguel de Icaza  <miguel@novell.com>
15451
15452         * console-io.c: Fix the build, this should work on Windows.
15453
15454 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
15455
15456         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
15457         be set to null to keep things valid
15458
15459 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15460
15461         * icall.c: added Console 2.0 icalls.
15462         * Makefile.am: added console-io.[ch]
15463         * console-io.[ch]: internal calls for Console 2.0 API.
15464
15465 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15466
15467         * class.c: make sure we consider all the interfaces
15468         when calculating max_interface_id (bug found by
15469         Jeroen Frijters running ikvm).
15470
15471 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
15472
15473         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
15474         valuetype fields to null.
15475
15476         * object.c (set_value): Ditto. Fixes #71669.    
15477
15478 2005-01-31  Martin Baulig  <martin@ximian.com>
15479
15480         * metadata.c (mono_metadata_has_generic_params): New public
15481         function; checks whether something is a generic method.
15482
15483 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
15484
15485         * appdomain.c: fix infinite recursion when adding assemblies.
15486
15487 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
15488
15489         * object.c: Fix small typo to return all items for Environment.
15490         GetCommandLineArgs.
15491
15492 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
15493
15494         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
15495         reflection.c: more domain and assembly-unload related fixes
15496         and memory leaks plugs.
15497
15498 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
15499
15500         * 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.
15501
15502 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
15503
15504         * loader.c (mono_method_signature): Make this method lazy
15505         (mono_get_method_from_token): Don't computate the signature here.
15506
15507         Doing this saves quite a bit of memory. I got 90 kb on starting up
15508         monodoc. It should also save some disk reads on startup.
15509
15510         * *: MonoMethod->signature might be NULL now. You *MUST* use
15511         mono_method_signature.
15512
15513 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
15514
15515         * object.c (mono_runtime_get_main_args): Return an array from the
15516         current domain here. Fixes #71938.
15517
15518 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
15519
15520         * monitor.c: formatting changes to comply with the
15521         mono coding style and remove #ifdefs from the code.
15522
15523 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
15524
15525         * metadata.c, private.h: remove some unneeded data
15526         and use a more compact representation for table schemas.
15527
15528 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
15529
15530         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
15531         to get a better distribution in hash tables.
15532         * *.c: use mono_aligned_addr_hash() where appropriate.
15533         * assembly.c: make var static.
15534
15535 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
15536
15537         * domain-internals.h: Put MonoJitInfo on a diet.
15538
15539         * domain.c: Fix a warning.
15540
15541 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15542
15543         * gc.c: rework the gc handles code to reuse handles
15544         when freed.
15545
15546 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
15547
15548         * domain.c: fixed long standing bug in mono_string_equal() which
15549         was brought to light with the ldstr changes.
15550
15551 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
15552
15553         * reflection.c: Remove warning by adding missing include for marshal.h
15554
15555 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
15556
15557         * domain.c, object.c: change the ldstr_table to hold
15558         MonoString* as keys: makes the runtime isinterned lookup
15559         faster and simplifies memory management.
15560
15561 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
15562  
15563         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
15564         possible to add imperative security checks before calling the icall.
15565         * reflection.c: Return security attributes on the original MonoMethod
15566         (and not the wrapped one). This fix permissions on icalls.
15567
15568 2005-01-25  Dick Porter  <dick@ximian.com>
15569
15570         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
15571         the check for mktime() support actually test the mktime() return
15572         value.  "Fixes" bug 71682, though the output is still different to
15573         MS.
15574
15575 2005-01-25  Martin Baulig  <martin@ximian.com>
15576
15577         * class.c (mono_class_is_assignable_from): Make this work for
15578         generic instances.
15579
15580 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
15581
15582         * marshal.c (mono_string_utf8_to_builder)
15583         (mono_string_builder_to_utf16): We might not have ownership of the
15584         string. In thise case, we need to create a new buffer.
15585
15586         * object-internals.h (mono_stringbuilder_capacity): sb->str might
15587         be null, in which case, use the default capacity.
15588
15589 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
15590
15591         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
15592         GC events to the profiler.
15593
15594 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
15595
15596         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
15597         if you don't want the GC to run.
15598
15599 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
15600
15601         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
15602         start providing a GC API and keeping different implementations in
15603         their own file.
15604         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
15605
15606 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
15607
15608         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
15609         mmap rather than allocating a huge buffer.
15610         (mono_debug_close_mono_symbol_file): Free the buffer allocated
15611         above.
15612
15613 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
15614
15615         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
15616         and CheckExecutionRights.
15617         * reflection.c|h: Keep the index of the declarative security to be 
15618         used, instead of the pointer, when AOT compiler is used. Also add 
15619         class initialization when requesting demands.
15620         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
15621         CheckExecutionRights. Both properties are now FALSE by default, and
15622         unmodifiable, unless the --security option is used.
15623
15624 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
15625
15626         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
15627         reflection.c: properly refcount images and assemblies, many leaks fixed.
15628
15629 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15630
15631         * threadpool.c: increase the timeout for threads in the thread pool to
15632         10s.  Fixes bug #67159.
15633
15634 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
15635
15636         * class-internals.h: Sun's compiler insists on explicit
15637         signed on bit fields to handle then correctly.
15638
15639 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
15640
15641         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
15642         Make the size of the array fit only the number of invalid path
15643         chars that we have.
15644
15645         * class.c (_mono_class_get): Improve the error reporting when a
15646         class referenced is not found, to assist debugging. 
15647
15648 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
15649
15650         * threads.c: fix off-by-one error.
15651         * domain.c: free data allocated in the domain.
15652
15653 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
15654
15655         * reflection.c (mono_method_body_get_object): Fill out exception info
15656         as well.
15657
15658         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
15659         structure.
15660         
15661 2005-01-19  Martin Baulig  <martin@ximian.com>
15662
15663         * loader.c (mono_get_method_constrained): Make this work again.
15664
15665 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
15666
15667         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
15668         guint16 to match the managed side.
15669
15670         * reflection.c (mono_reflection_body_get_object): Fill out local
15671         variables array.
15672
15673         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
15674         as well.
15675
15676         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
15677         'local_var_sig_token'.
15678
15679 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
15680
15681         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
15682         System.Drawing.
15683
15684         * reflection.c (mono_method_body_get_object): Handle abstract and
15685         runtime methods.
15686
15687 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
15688
15689         * marshal.c, loader.c, class-internals.h, reflection.c:
15690         store the emthod data for a wrapper in an array instead of a list.
15691
15692 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
15693
15694         * marshal.c: change the code to allocate memory more
15695         conservatively for method wrappers.
15696
15697 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
15698
15699         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
15700         fields from MonoClass to the marshal info structure where they belong.
15701
15702 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
15703
15704         * class.c, object.c, class-internals.h, marshal.c: rearrange
15705         some fields and tweak some types to lower memory usage.
15706
15707 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
15708
15709         * threads.c (signal_thread_state_change): Handle the case when the
15710         target thread is the current thread.
15711
15712         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
15713
15714         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
15715         emit_ptr_to_object_conv. 
15716
15717         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
15718         marshalling. Fixes #71352.
15719
15720 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
15721
15722         * metadata.h, blob.h: move table enum to blob.h so it can be included
15723         in any header.
15724         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
15725         cut the size of MonoImage/MonoDynamicImage.
15726
15727 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
15728
15729         * profiler.c (mono_profiler_install_simple): Fix default arguments.
15730
15731 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
15732
15733         * reflection.c, reflection.h, icall.c: add a function to check
15734         if an attribute type is defined for a metadata object.
15735
15736 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
15737
15738         * object-internals.h: Added some needed fields from StringBuilder class.
15739         * marshal.c: Set the maxCapacity when creating a StringBuilder.
15740
15741 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
15742
15743         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
15744         threads before shutting down the runtime.
15745
15746         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
15747
15748 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
15749
15750         * object-internal.h, threads.c: implement stacksize and 
15751         parameterized thread start functionality (requires
15752         matching corlib). Marked broken code for later removal.
15753
15754 2005-01-12  Martin Baulig  <martin@ximian.com>
15755
15756         * class-internals.h (MonoGenericClass): Moved the `initialized'
15757         flag to MonoDynamicGenericClass, removed `init_pending'.
15758         (MonoGenericInst): Added `is_reference' flag.
15759
15760 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
15761
15762         * reflection.c (mono_image_create_pefile): Only set the pe_offset
15763         inside the MSDOS header. Fixes #71201.
15764
15765         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
15766         gc thread.
15767         (mono_domain_finalize): Ditto.
15768
15769 2005-01-12  Martin Baulig  <martin@ximian.com>
15770
15771         * class.c (mono_get_shared_generic_class): Use the cache for
15772         non-dynamic generic classes.
15773
15774         * class-internals.h (mono_class_create_generic_2): Removed
15775         function prototype, this function is now static inside class.c.
15776
15777         * class.c (mono_class_create_generic_2): Made this static, only
15778         call it from mono_class_init() and mono_class_setup_parent().
15779         (collect_implemented_interfaces_aux): Call mono_class_init() on
15780         the interfaces we collect.
15781         (mono_class_setup_vtable): Call mono_class_init (class->parent).
15782
15783 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
15784
15785         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
15786         it a real thread handle.
15787
15788         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
15789         MonoJitExceptionInfo, since each catch clause needs its own variable.
15790         
15791 2005-01-11  Dick Porter  <dick@ximian.com>
15792
15793         * image.c (mono_pe_file_open): New variant on mono_image_open()
15794         that does not set up the CLI metadata; used for FileVersionInfo so
15795         it can get the data for windows binaries too.
15796         
15797         * process.c (process_read_string_block): Don't read off the end of
15798         the StringTable block.
15799
15800         These both fix bug 70766.
15801
15802 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
15803
15804         * gc.c: set some fields to NULL at GC cleanup time.
15805         * threads.c: if we quit the main thread, call exit ().
15806
15807 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
15808
15809         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
15810
15811 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
15812
15813         * threads.h, threads.c, object.c: added accessor and settor for
15814         main_thread. Handle it specially when exiting from it: wait
15815         for other foreground threads to exit.
15816
15817 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
15818
15819         * process.c, verify.c: remove some bloat.
15820
15821 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
15822
15823         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
15824         the calling convention to cdecl under win32.
15825
15826 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
15827
15828         * object.c (mono_object_get_size): New function to get the size of
15829         an object instance.
15830
15831         * profiler.c (simple_allocation): Use above.
15832
15833 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
15834
15835         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
15836         ves_icall_System_AppDomain_getRootDomain (as it's not required to
15837         get an appdomain by it's id and we can't assume the root's id is 0).
15838         * domain-internals.h: Change the function prototype to match.
15839         * icall.c: Change the icall table for AppDomain.
15840
15841 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
15842
15843         * locales.c (string_invariant_compare_char): Only compute
15844         GUnicodeTypes in the case where we need them.  Test for ordinality
15845         first and return if so.
15846
15847         From the commit:
15848
15849                 /*
15850                  * FIXME: here we must use the information from c1type and c2type
15851                  * to find out the proper collation, even on the InvariantCulture, the
15852                  * sorting is not done by computing the unicode values, but their
15853                  * actual sort order.
15854                  */
15855
15856 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
15857
15858         * loader.c: for P/Invoke methods, allow the "Internal" shared
15859         library name to refer to the calling process symbol namespace.
15860
15861 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
15862
15863         * Makefile.am: Add the security manager to the build.
15864         * security-manager.c|h: New. Initialization of the security manager.
15865
15866 2005-01-07  Dick Porter  <dick@ximian.com>
15867
15868         * threads.c: 
15869         * monitor.c: Update thread state during Monitor and WaitHandle
15870         waits.  Fixes bug 71031.
15871
15872 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
15873
15874         * reflection.c (property_encode_signature): Correctly handle when the
15875         property has no methods.
15876
15877 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
15878
15879         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
15880         
15881         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
15882         fields from mb, not rmb. Fixes #71017.
15883
15884         * marshal.c (emit_ptr_to_str_conv): Add support for 
15885         ByValTStr -> string conversion. Fixes #71015.
15886
15887         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
15888
15889         * mempool.c (mono_mempool_contains_addr): New helper function.
15890
15891 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
15892
15893         * metadata.c (mono_metadata_compute_size): Fix size calculation of
15894         HasSematics encoded fields.
15895         
15896         * metadata.c (mono_type_to_unmanaged): Improve error message for 
15897         invalid string marshalling.
15898
15899         * metadata.c: Fix warnings.
15900         
15901 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
15902
15903         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
15904         profiler support.
15905
15906 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
15907
15908         * domain.c object.c domain-internals.h: Revert part of r38077 since the
15909         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
15910         tests.
15911
15912 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
15913
15914         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
15915         so methods containing these can be AOTed.
15916
15917 2005-01-03  Martin Baulig  <martin@ximian.com>
15918
15919         * loader.c (find_method): Removed the hack for generic instances.
15920         (method_from_memberref): If our parent is a generic instance, pass
15921         its generic type definition to find_method() and then inflate the
15922         method.
15923         (mono_get_method_constrained): Pass the generic type definition to
15924         find_method() and inflate the method later.
15925
15926         * class-internals.h (MonoStats): Added `generic_class_count'.
15927
15928         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
15929         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
15930
15931         * reflection.c (mono_custom_attrs_from_params): Don't ignore
15932         generic type definitions.
15933
15934 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
15935
15936         * loader.c icall.c: Fix warnings.
15937
15938 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
15939
15940         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
15941         blittable types. Fixes #70864.
15942
15943 2004-12-29  Martin Baulig  <martin@ximian.com>
15944
15945         * icall.c
15946         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
15947
15948         * reflection.c (mono_method_get_object): Create a
15949         "System.Reflection.MonoGenericMethod" for inflated methods; don't
15950         call mono_get_inflated_method().
15951
15952         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
15953
15954 2004-12-27  Martin Baulig  <martin@ximian.com>
15955
15956         * class-internals.h (MonoMethod): Added `is_inflated' flag.
15957         (MonoMethodInflated): Added `inflated' field.
15958
15959         * class.c (mono_class_inflate_generic_method): Don't really
15960         inflate the method here; just set the `is_inflated' flag in the
15961         MonoMethod.
15962         (mono_class_get_inflated_method): Actually inflate the method here
15963         if it's not already inflated; we use the MonoMethodInflated's new
15964         `inflated' field as a cache.
15965
15966 2004-12-26  Martin Baulig  <martin@ximian.com>
15967
15968         * class.c
15969         (inflate_generic_class): Moved some code out of inflate_generic_type().
15970         (mono_class_inflate_generic_method): If we're already inflated,
15971         inflate the context and use the declaring method; ie. make sure
15972         the declaring method of an inflated method is always the generic
15973         method definition.
15974         (mono_class_create_from_typedef): Create
15975         `class->generic_container->context->gclass'.
15976
15977 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
15978
15979         * metadata-internals.h, marshal.c, reflection.c: More
15980         MonoGHashTable->GHashTable.
15981
15982         * domain-internals.h, class.c: Change MonoGHashTable's into
15983         GHashTables for some cases where no gc stuff is used
15984
15985         All users: update apis
15986
15987 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
15988
15989         * metadata.c (builtin_types): Make this `const'. Makes this get
15990         put into the shareable section.
15991         (mono_metadata_init): Casts to make gcc happy.
15992
15993 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
15994
15995         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
15996
15997 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
15998
15999         * icall.c: Added an internal call to retrieve the position and length
16000         of assembly-level declarative security attributes (RequestMinimum, 
16001         RequestOptional and RequestRefuse). This is used by the Assembly class
16002         to re-create the corresponding permission sets.
16003
16004 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
16005
16006         * marshal.c: fix the stelemref wrapper to be type correct
16007         (and faster).
16008
16009 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
16010
16011         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
16012         to do key & 0x7fffffff. Hashtable already does this. It just
16013         results in longer code.
16014
16015 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
16016
16017         * appdomain.c: Bump corlib version.
16018         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
16019         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
16020         * reflection.c|h: Add functions to get declarative security infos
16021         (blob position and length) for assemblies, classes and methods.
16022
16023 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
16024
16025         * reflection.c: sort the constant table (bug #70693).
16026
16027 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
16028
16029         * object-internals.h, threads.c, domain.c: add accessors for
16030         the MonoThread and MonoDomain tls keys.
16031
16032 2004-12-18  Martin Baulig  <martin@ximian.com>
16033
16034         * class.c (inflate_generic_type): If we're inflating a generic
16035         instance, set `ngclass->context->container = context->container';
16036         ie. the container we inflated into.
16037
16038         * metadata.c (mono_metadata_parse_generic_param): Reflect above
16039         inflate_generic_type() changes.
16040
16041 2004-12-17  Martin Baulig  <martin@ximian.com>
16042
16043         * class-internals.h
16044         (MonoGenericClass): Replaced `MonoType *generic_type' with
16045         `MonoClass *generic_class'.  Removed `dynamic_info'; if
16046         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
16047         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
16048
16049 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
16050
16051         * exception.c (mono_exception_from_token): New helper function.
16052
16053 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
16054
16055         * assembly.c (mono_assembly_load_with_partial_name): Call 
16056         mono_assembly_loaded before invoking the preload hooks. Fixes
16057         #70564.
16058
16059         * object-internals.h (MonoThread): Change culture_info and 
16060         ui_culture_info into an array.
16061
16062         * threads.c: Cache culture info objects from more than one appdomain.
16063
16064         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
16065         current UI culture.
16066
16067 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
16068
16069         * threads.h threads.c appdomain.c: Clear the culture_info field of
16070         all threads during unloading if they point to an object in the dying
16071         appdomain.
16072
16073 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
16074
16075         * culture-info.h (TextInfoEntry): New struct
16076         * object-internals.h: sync with managed
16077         * locales.c: fill the `text_info_data' field
16078         * culture-info-tables.h: update
16079
16080 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
16081
16082         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
16083         collector.
16084
16085 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
16086
16087         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
16088         (ves_icall_ModuleBuilder_getMethodToken): Ditto
16089
16090 2004-12-12  Martin Baulig  <martin@ximian.com>
16091
16092         * mono-debug-debugger.c (write_type): If we're an enum and the
16093         builtin types have already been initialized, call mono_class_init().
16094
16095 2004-12-11  Martin Baulig  <martin@ximian.com>
16096
16097         * metadata.c (mono_metadata_load_generic_params): Added
16098         `MonoGenericContainer *parent_container' argument; automatically
16099         compute `container->is_method'; pass the correct owner to
16100         get_constraints().      
16101
16102         * reflection.c (compare_genericparam): Sort the GenericParam table
16103         according to increasing owners. 
16104
16105 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
16106
16107         * profiler.c: allow disabling the default profiler.
16108
16109 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
16110
16111         * decimal.c, icall.c: allow disabling System.Decimal support.
16112
16113 2004-12-09  Marek Safar <marek.safar@seznam.cz>
16114
16115         * reflection.c: Add support for null attribute arguments.
16116
16117 2004-12-09  Martin Baulig  <martin@ximian.com>
16118
16119         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
16120         names to get rid of compiler warnings.
16121
16122 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
16123
16124         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
16125         mono_marshal_load_type_info (). Fixes #69625.
16126         (mono_marshal_get_ptr_to_struct): Likewise.
16127
16128 2004-12-08  Martin Baulig  <martin@ximian.com>
16129
16130         * mono-debug.h: Bumped version number to 47.
16131
16132         * mono-debug-debugger.c
16133         (mono_debugger_event_handler, mono_debugger_event): Take two
16134         guint64 arguments insteed of a gpointer and a guint32.  
16135
16136 2004-12-08  Martin Baulig  <martin@ximian.com>
16137
16138         * debug-mono-symfile.h
16139         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
16140         `address' to `native_offset'.
16141
16142 2004-12-08  Martin Baulig  <martin@ximian.com>
16143
16144         * class.c (mono_class_create_from_typespec): Only inflate if we
16145         either have `context->gclass' or `context->gmethod'.
16146
16147 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
16148
16149         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
16150
16151         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
16152
16153         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
16154
16155         * reflection.c (mono_assembly_get_object): Remove the workaround put
16156         in for the release.
16157         
16158         * appdomain.c: Use the corlib_internal field from MonoAssembly.
16159
16160         * appdomain.c: Bump corlib version.
16161
16162         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
16163         be visible in other appdomains.
16164
16165 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
16166
16167         * threads.c: Interlocked inc and dec for longs were messed up,
16168         use a KISS based impl for this. Fixes 70234
16169
16170 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
16171
16172         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
16173
16174 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
16175
16176         * icall.c: fix to follow policy not to allow struct
16177         arguments in icalls.
16178
16179 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16180
16181         * process.c: make the patch that handles spaces in file paths work
16182         on mono/windows too.
16183
16184 2004-12-06  Martin Baulig  <martin@ximian.com>
16185
16186         * class.c (mono_class_create_generic): Call
16187         mono_class_setup_supertypes() if we're dynamic.
16188         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
16189
16190 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
16191
16192         * object-internals.h: Add new fields to MonoThread.
16193
16194         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
16195
16196         * icall.c threads-types.h threads.c: Add new icalls.
16197
16198         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
16199
16200         * object-internals.h (MonoReflectionAssembly): Sync object layout with
16201         managed side.
16202
16203         * appdomain.c: Bump corlib version.
16204
16205         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
16206         internal assemblies. Fixes #69181.
16207
16208 2004-12-05  Martin Baulig  <martin@ximian.com>
16209
16210         * class.c (mono_class_inflate_generic_signature): Make this a
16211         no-op if `context' is NULL or we don't have any type parameters;
16212         also copy `sentinelpos'.        
16213
16214 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
16215
16216         * image.c: Add unbox_wrapper_cache.
16217
16218         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
16219
16220         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
16221         function generator.
16222         
16223         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
16224         Fixes #70173.
16225
16226         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
16227         
16228 2004-12-04  Martin Baulig  <martin@ximian.com>
16229
16230         * loader.c (mono_method_get_signature_full): New public function;
16231         like mono_method_get_signature(), but with an additional
16232         `MonoGenericContext *' argument.
16233
16234         * class.c (mono_class_inflate_generic_signature): Formerly known
16235         as inflate_generic_signature(); make this public.
16236
16237 2004-12-04  Martin Baulig  <martin@ximian.com>
16238
16239         * metadata.c
16240         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
16241         instead of a `MonoGenericContainer *'.  
16242         (mono_metadata_parse_array_full): Likewise.
16243         (mono_metadata_parse_signature_full): Likewise.
16244         (mono_metadata_parse_method_signature_full): Likewise.
16245         (mono_metadata_parse_generic_inst): Likewise.
16246         (mono_metadata_parse_generic_param): Likewise.
16247         (mono_metadata_parse_mh_full): Likewise.
16248         (mono_type_create_from_typespec_full): Likewise.
16249
16250 2004-12-03  Martin Baulig  <martin@ximian.com>
16251
16252         * class-internals.h (MonoGenericContainer): Replaced the
16253         `MonoGenericContext * pointer with a `MonoGenericContext'
16254         structure and made it the first element.
16255
16256 2004-12-03  Martin Baulig  <martin@ximian.com>
16257
16258         * class.c
16259         (inflate_generic_type): Set the `context->container' when creating
16260         a new MonoGenericContext.
16261         (mono_class_inflate_generic_method): Likewise.
16262         (mono_class_create_from_typespec): Just use `context->container'
16263         to get the container.
16264
16265         * loader.c (method_from_methodspec): Set `context->parent' from
16266         `context->container' - and if that's a method container, use its
16267         parent.  Also set the `context->container' when creating a new
16268         MonoGenericContext.
16269         (mono_get_method_from_token): Use just `context->container' to get
16270         the container.
16271
16272         * metadata.c (do_mono_metadata_parse_generic_class): Also set
16273         `gclass->context->container'.
16274
16275         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
16276         the `context->container' when creating a new MonoGenericContext.
16277
16278 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
16279
16280         * reflection.c (compare_genericparam): Sort params with identical
16281         owner by their number. Fixes gen-111 on sparc.
16282
16283 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
16284
16285         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
16286         around the domain changes.
16287
16288         * appdomain.c (mono_domain_unload): Handle the case when the thread
16289         calling Unload is itself being aborted during unloading. Fixes #70022.
16290
16291         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
16292
16293         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
16294         checkpoint_func as an icall so it gets a wrapper.
16295         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
16296         in the cross-appdomain wrappers too.
16297
16298         * threads.c (mono_thread_has_appdomain_ref): Make this public.
16299
16300         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
16301
16302         * reflection.c: Fix some memory leaks.
16303         
16304 2004-12-02  Martin Baulig  <martin@ximian.com>
16305
16306         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
16307
16308         * metadata.c (generic_class_cache): New static hashtable.
16309         (mono_metadata_lookup_generic_class): New public method.
16310
16311 2004-12-02  Martin Baulig  <martin@ximian.com>
16312
16313         * class.c (mono_class_create_from_typedef): Call
16314         mono_class_setup_parent() and mono_class_create_mono_type() before
16315         parsing the interfaces.
16316
16317 2004-12-02  Martin Baulig  <martin@ximian.com>
16318
16319         * metadata.c (generic_inst_cache): New static hashtable.
16320         (mono_metadata_lookup_generic_inst): New public function.
16321         (mono_metadata_inflate_generic_inst): New public function.
16322         (mono_metadata_parse_generic_inst): New public function.
16323         (do_mono_metadata_parse_generic_class): Use the new
16324         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
16325         since this'll also use the cache.
16326
16327         * reflection.c (mono_reflection_bind_generic_method_parameters):
16328         Use mono_metadata_lookup_generic_inst() to use the new cache.
16329
16330         * class.c (inflate_mono_type): Use
16331         mono_metadata_inflate_generic_inst() to inflate a generic
16332         instance; this'll also use the new cache.
16333
16334         * loader.c (method_from_methodspec): Use
16335         mono_metadata_parse_generic_inst() and
16336         mono_metadata_inflate_generic_inst() rather than parsing it
16337         manually, so we can use the new cache.
16338
16339 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
16340
16341         * threads.c (wait_for_tids): Do not incorrectly free threads when 
16342         the wait times out.
16343
16344 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
16345
16346         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
16347         iter->args based on whether parameters are passed in registers (i.e.
16348         MONO_ARCH_REGPARMS is defined)
16349
16350 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
16351
16352         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
16353         the exception message. Fixes #70070.
16354         (method_from_methodspec): Fix warnings.
16355
16356 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16357
16358         * process.c: (complete_path) return the path quoted
16359
16360 2004-12-01  Martin Baulig  <martin@ximian.com>
16361
16362         * class-internals.h (MonoGenericInst): New structure.
16363         (MonoGenericClass): Replaced `type_argc', `type_argv' and
16364         `is_open' with `MonoGenericInst *inst'.
16365         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
16366         `is_open' with `MonoGenericInst *inst'.
16367
16368 2004-11-30  Martin Baulig  <martin@ximian.com>
16369
16370         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
16371
16372         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
16373         to `generic_class_cache'.
16374
16375         * metadata.c
16376         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
16377         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
16378         (mono_generic_inst_is_valuetype): Renamed to
16379         mono_generic_class_is_valuetype().
16380
16381         * class-internals.h
16382         (MonoGenericInst): Renamed to MonoGenericClass.
16383         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
16384         (MonoClass): Renamed `generic_inst' to `generic_class'.
16385         (MonoGenericContext): Renamed `ginst' to `gclass'.
16386
16387         * object-internals.h
16388         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
16389
16390         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
16391         mono_reflection_generic_class_initialize().
16392
16393         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
16394         now known as "System.Reflection.MonoGenericClass".
16395         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
16396
16397 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
16398
16399         * class-internals.h: Added a flag field to MonoClass to cache the
16400         declarative security attributes actions associated with the class.
16401         * domain-internals.h: Added booleans to MonoJitInfo to cache the
16402         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
16403         applicable to the JITted method.
16404         * reflection.c|h: Added functions to extract (as flags) which security
16405         actions are available (declaratively) for a method, class or assembly.
16406         * metadata.c|h: Added functions to search the declarative security
16407         table in the metadata.
16408         
16409 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
16410
16411         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
16412         EXPORTEDTYPES are already in the class name cache, so there is no
16413         need to add extra code here to look at them. Just removes a bit of
16414         cruft.
16415
16416         (ves_icall_System_Environment_get_TickCount): No need for #if
16417         WINDOWS. We already have the code in io-layer.
16418
16419 2004-11-28  Martin Baulig  <martin@ximian.com>
16420
16421         * loader.c
16422         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
16423         Fixes gen-112.cs.
16424
16425 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
16426
16427         * assembly.c (do_mono_assembly_open): Instead of having a
16428         conditional WITH_BUNDLE, incorporate support for bundles here, by
16429         having a global `bundles' variable holding a pointer to the actual
16430         bundles. 
16431
16432         (mono_register_bundled_assemblies): New API call used by the
16433         bundle code. 
16434
16435         See mkbundle.1 for details.
16436         
16437 2004-11-27  Martin Baulig  <martin@ximian.com>
16438
16439         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
16440         the vtable for generic methods.
16441
16442 2004-11-26  Martin Baulig  <martin@ximian.com>
16443
16444         * metadata.c
16445         (mono_metadata_generic_method_hash): New public function.
16446         (mono_metadata_generic_method_equal): Likewise.
16447
16448         * class-internals.h
16449         (MonoGenericContainer): Added `GHashTable *method_hash'.
16450
16451         * reflection.c (ReflectionMethodBuilder): Added
16452         `MonoGenericContainer *generic_container'.
16453         (reflection_methodbuilder_to_mono_method): Don't create a new
16454         MonoGenericContainer each time we're called.
16455         (mono_reflection_bind_generic_method_parameters): Use
16456         `container->method_hash' to cache the results so we don't create a
16457         different method if we're called several times with the same
16458         arguments.
16459
16460         * loader.c (method_from_methodspec): Use the new
16461         `container->method_hash' here, too.
16462
16463 2004-11-26  Martin Baulig  <martin@ximian.com>
16464
16465         * class.c (inflate_generic_signature): Correctly compute
16466         `res->has_type_parameters'.
16467         (mono_class_vtable): Use the `has_type_parameters' flag to
16468         determine whether we're a generic method.
16469
16470         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
16471
16472 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
16473
16474         * object.c (mono_runtime_run_main): Fix a small memory leak.
16475
16476 2004-11-25  Martin Baulig  <martin@ximian.com>
16477
16478         * class.c (set_generic_param_owner): Fixed the loop.
16479
16480 2004-11-25  Martin Baulig  <martin@ximian.com>
16481
16482         * object.c (mono_class_vtable): Don't create any JIT wrappers for
16483         generic methods.
16484
16485 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
16486
16487         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
16488         names. Fixes #69787.
16489
16490 2004-11-24  Martin Baulig  <martin@ximian.com>
16491
16492         * class.c (mono_class_create_generic_2): If we don't have a
16493         `ginst->parent', inflate `gklass->parent' to get our parent.
16494
16495 2004-11-24  Martin Baulig  <martin@ximian.com>
16496
16497         * reflection.c (compare_genericparam): Correctly sort the
16498         GenericParam table; fixes #69779.
16499
16500 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
16501
16502         * reflection.c: When writing a PE file, don't create a huge
16503         buffer in memory. Just write the arrays we have to the file.
16504         This reduces memory usage.
16505
16506         * metadata-internals.h: MonoDynamicStream pefile is no longer used
16507         globally.
16508
16509 2004-11-17  Martin Baulig  <martin@ximian.com>
16510
16511         * class.c (mono_class_init): Don't setup `class->parent' for
16512         dynamic instances; moved this to mono_class_generic_2().
16513         (mono_class_create_generic): Also set `klass->inited' for dynamic
16514         generic instances.
16515         (mono_class_create_generic_2): Don't do anything for dynamic
16516         generic instances.  Set `klass->parent' here and also call
16517         mono_class_setup_parent() here. 
16518
16519         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
16520         `MonoType *parent' argument; set `ginst->parent' before calling
16521         mono_class_create_generic_2(), so we set the correct parent.
16522
16523 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
16524
16525         * reflection.c: allow getting attributes from ModuleBuilder
16526         (used by ikvm).
16527
16528 2004-11-17  Martin Baulig  <martin@ximian.com>
16529
16530         * class.c (mono_class_create_from_typedef): If a type parameter is
16531         inherited from an outer class, set its owner to that class.
16532
16533 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
16534
16535         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
16536           for (int*) written size. This fixes bug #69592.
16537
16538 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
16539
16540         * icall.c: Added IsAuthenticodePresnet internal call.
16541         * image.c|h: New function that check a MonoImage for an Authenticode
16542         signature in the certificate PE data directory.
16543         * security.c|h: New internal call to ask the runtime if an 
16544         Authenticode signature seems referenced in the PE header.
16545
16546 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
16547
16548         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
16549
16550         * reflection.c (mono_image_create_pefile): Free the assembly streams
16551         after writing out the assembly file.
16552
16553         * object.c (mono_runtime_run_main): Fix small memory leak.
16554
16555         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
16556         property access modifiers. Fixes #69389.
16557
16558 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
16559
16560         * domain.c, object.c, object-internals.h, domain-internals.h,
16561         object.h, marshal.c: keep dynamic code info per domain.
16562
16563 2004-11-15  Martin Baulig  <martin@ximian.com>
16564
16565         * class.c (mono_type_get_name_recurse): Put type arguments in
16566         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
16567         see bug #68387.
16568
16569 2004-11-15  Martin Baulig  <martin@ximian.com>
16570
16571         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
16572         (mono_class_setup_vtable): When computing `the_cname' for a
16573         generic instance, don't include the namespace since we'd otherwise
16574         add it twice.
16575
16576 2004-11-15  Martin Baulig  <martin@ximian.com>
16577
16578         * class.c (mono_class_create_generic): Changed return type to void.
16579         (mono_class_create_generic_2): New public function; setup
16580         `class->method', `class->field' and `class->interfaces' here
16581         instead of in mono_class_init().
16582
16583         * class.h (mono_class_create_generic): Moved to class-internals.h.
16584
16585 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
16586
16587         * reflection.c (mono_image_create_pefile): take a file HANDLE.
16588         rather than writing to memory, write to this file. Right now,
16589         we are just writting into a buffer, and copying that. However
16590         we can avoid the buffer later.
16591
16592         (mono_dynamic_stream_reset): new function
16593
16594         * icall.c, object-internals.h: update for the above.
16595
16596 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
16597
16598         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
16599         have been using gc'd memory. First it is slower, unlikely
16600         the comment in the source code said, secondly, it increases
16601         our footprint to do it in the gc.
16602
16603         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
16604         the method so that it does not have to copy to managed code.
16605
16606 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
16607
16608         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
16609
16610 2004-11-12  Martin Baulig  <martin@localhost>
16611
16612         * reflection.c (mono_image_create_token): Allow generic method
16613         definitions here, since they may appear in an `.override'; see
16614         gen-98/gen-99 for an example.
16615
16616 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
16617
16618         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
16619         #69365.
16620
16621         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
16622         descriptive.
16623
16624 2004-11-11  Martin Baulig  <martin@ximian.com>
16625
16626         * class.c (mono_class_setup_vtable): In an explicit interface
16627         implementation, the method name now includes the arity.
16628
16629 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
16630
16631         * object.c (mono_array_full_copy): Fix warning.
16632
16633 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
16634
16635         * appdomain.c: Removed look_for_method_by_name(). Use the new method
16636         mono_class_get_method_from_name() instead.
16637         
16638         * class-internals.h: Added two new types of wrappers. 
16639         Added MonoRemotingTarget enum. Added new trampoline function type, which
16640         takes an additional MonoRemotingTarget value as parameter, so it is
16641         possible to request a trampoline for a specific target.
16642         
16643         * class.c: Added new mono_class_get_method_from_name() method.
16644         
16645         * class.h: In MonoRemoteClass, we can have now to vtables, one for
16646         general remoting sinks and one specific for cross domain calls.
16647         
16648         * debug-helpers.c: Added new wrapper names.
16649         
16650         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
16651         of a remote class.
16652         
16653         * image.c: Porperly delete value objects form the remoting invoke hashtable.
16654         
16655         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
16656         with several other methods (mono_marshal_get_xappdomain_dispatch,
16657         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
16658         and others) can generate a fast remoting wrapper for cross domain calls.
16659         More information can be found in docs/remoting.
16660         Other changes: Removed mono_find_method_by_name, and used
16661         mono_class_get_method_from_name instead.
16662         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
16663         is stored in the remoting invoke hashtable.
16664         
16665         * marshal.h: published the new method for getting the xdomain wrapper,
16666         and also added a method for getting the adequate wrapper for a given
16667         method and target.
16668         
16669         * object-internals.h, object.c: Added a couple of methods for capying and
16670         cloning arrays.
16671         Modified mono_install_remoting_trampoline, which takes the new remoting
16672         trampoline that has a remoting target as parameter.
16673         mono_class_proxy_vtable now also takes a remoting target as parameter, and
16674         will return the most suitable vtable for the target.
16675         Added mono_remote_class_vtable, which returns the vtable of a remote class
16676         (which can be the normal remoting vtable or the xdomain vtable).
16677         
16678         * threads.c: the xdomain invoke and dispatch wrappers must also be
16679         protected against interruptions.
16680
16681 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16682
16683         * icall.c: use memmove in BlockCopyInternal when the source and
16684         destination arrays are the same.
16685
16686 2004-11-09  Martin Baulig  <martin@ximian.com>
16687
16688         * class-internals.h (MonoGenericContainer): Removed `method' and
16689         `signature', replaced them with `is_method' and `is_signature'
16690         flags.  Added `context'.
16691
16692         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
16693         instead of a `MonoGenericContainer *'.
16694
16695         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
16696         for dynamic type parameters.
16697         (mono_metadata_load_generic_params): Setup `container->context'.
16698
16699         * reflection.c (mono_reflection_setup_generic_class): Setup
16700         `tb->generic_container->context'.
16701         (do_mono_reflection_bind_generic_parameters): Use
16702         mono_class_inflate_generic_type() to correctly inflate types,
16703         rather than using our own hack just for MONO_TYPE_VAR.
16704
16705 2004-11-09  Martin Baulig  <martin@ximian.com>
16706
16707         * class.c (mono_class_inflate_generic_method): Small fix; don't
16708         crash here.
16709
16710         * icall.c
16711         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
16712         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
16713         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
16714         (ves_icall_Type_BindGenericParameters): Likewise.
16715         (ves_icall_Type_get_IsGenericInstance): Likewise.
16716         (ves_icall_Type_GetGenericParameterPosition): Likewise.
16717         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
16718         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
16719         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
16720
16721 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
16722
16723         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
16724         assembly versions and public key tokens. Fixes #69113.
16725
16726 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
16727
16728         * metadata.c: fix bug introduced with the type cache changes
16729         on 2004-11-06.
16730
16731 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
16732
16733         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
16734         the MonoClass pointer instead of the token in exception clauses.
16735         * reflection.c: updates for the above and make the code not depend
16736         on the structure of MonoExceptionClause.
16737
16738 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
16739
16740         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
16741         Add support for dynamic assemblies. Fixes #69114.
16742
16743         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
16744
16745 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
16746
16747         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
16748         since most only those methods use it. the code member of
16749         MonoMethodPInvoke was dead, so that can be removed too. Also,
16750         remove inline_count (again, not used), and move slot so that it
16751         can share bits with some other flags. This saves 8 bytes in the
16752         structure and gives us about 50 kb back for mcs helloworld.cs
16753
16754         * *.[ch]: Do naming changes for the above.
16755
16756         * loader.c (mono_method_get_header): Lazily init the header
16757         on first access.
16758         (mono_get_method_from_token): don't init the header here
16759         (mono_free_method): the header may never be allocated
16760
16761         Overall, this saves 150 kb of unmanaged allocations
16762         for mcs helloworld.cs. That accounts for 10% of the unmanaged
16763         memory at runtime.
16764         
16765         * loader.c, loader.h (mono_method_get_header): new accessor.
16766
16767         * *.[ch]: use the above method. Prepares us to lazily load
16768         the header.
16769
16770         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
16771         three warnings, which are actual bugs (see 69206).
16772
16773         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
16774         unused. Saves a cool 4 bytes / method.
16775
16776 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
16777
16778         * metadata.c (builtin_types): Add types for System.Object here.
16779         (mono_metadata_parse_type_full): Cache MonoType*'s that are
16780         for a class or valuetype from klass->this_arg or klass->byval_arg.
16781
16782         On mcs for a hello world, this gets us down from 21836 MonoType's
16783         to 14560.
16784
16785         (mono_metadata_free_type): Account for the above change.
16786
16787 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
16788
16789         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
16790         exception instead of asserting if name is null.
16791         (ves_icall_System_AppDomain_GetData): Ditto.
16792
16793 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
16794
16795         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
16796         EnumBuilder.
16797
16798         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
16799         Return NULL when the domain does not have entry_assembly set.
16800
16801         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
16802         Add a 'resource_modules' argument.
16803         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
16804
16805         * reflection.c (mono_reflection_create_runtime_class): Move setting
16806         of wastypebuilder here, so mono_get_type_object () returns a MonoType
16807         for enums too.
16808
16809         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
16810         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
16811         Throw an ArgumentNullException if 'ptr' is null.
16812
16813         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
16814         assemblies here. Fixes #69020.
16815
16816 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
16817
16818         * reflection.c (build_compressed_metadata): Fix the previous patch for
16819         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
16820         the stack.
16821
16822 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
16823
16824         * assembly.c (mono_assembly_names_equal): Allow a match if one of
16825         the cultures is false. Fixes #69090.
16826
16827         * reflection.c (build_compressed_metadata): Fix invalid memory read 
16828         detected by valgrind.
16829         
16830         * reflection.c (mono_reflection_get_type): Avoid triggering a 
16831         TypeResolve multiple times for the same type. Fixes #65577.
16832
16833 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
16834
16835         * marshal.c: Avoid using ldftn to call managed functions. It is
16836         much slower than just a call.
16837
16838         * reflection.c (mono_module_get_object): free the basename we
16839         allocate here from glib.
16840         
16841         * reflection.c (ensure_runtime_vtable): make sure to free
16842         overrides.  Also, we were allocating an array of MonoMethod not an
16843         array of MonoMethod*.
16844
16845         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
16846
16847         * image.c (mono_image_close): free image->guid here.
16848
16849 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
16850
16851         * reflection.c: Fix some spec conformance issues with the PE file
16852         structures so mcs compiled apps run on the Net 2.0 beta.
16853
16854 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
16855
16856         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
16857         Implement this. Fixes #67264.
16858
16859         * debug-helpers.h debug-helpers.c marshal.c: Move 
16860         mono_find_method_by_name to debug-helpers.c.
16861
16862 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
16863
16864         * object.c (mono_release_type_locks): type_initialization_hash is
16865         a GHashTable.
16866
16867         * reflection.c object.c object-internals.h: Fix warnings.
16868
16869         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
16870         without accessors. Fixes #61561.
16871
16872         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
16873         application base from the root domain if not set. Fixes #65641.
16874         (mono_runtime_init): Fix warning.
16875
16876 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16877
16878         * appdomain.c: call mono_thread_pool_init.
16879         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
16880         of worker threads based on the number of CPUs and the environment
16881         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
16882         for non-windows (windows) systems.
16883
16884 2004-10-27  Chris Toshok  <toshok@ximian.com>
16885
16886         * mono-debug-debugger.c (write_class): don't call mono_class_init
16887         here, as even with the check for (!klass->init_pending), we get
16888         into a situation where we're hitting cycles in class
16889         initialization.  Fixes #68816.
16890
16891 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
16892
16893         * image.c: Avoid overwriting values in the loaded_images_hash when an
16894         assembly is loaded multiple times. Fixes #61152.
16895
16896         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
16897         so multiple satellite assemblies for the same name can be loaded.
16898         Fixes #68259.
16899
16900         * mono_domain_assembly_preload: Actually return the loaded assembly, 
16901         not NULL.
16902
16903         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
16904         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
16905
16906         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
16907         pending finalizers are not invoked after the appdomain has been 
16908         unloaded. Fixes #67862.
16909
16910 2004-10-22  Martin Baulig  <martin@ximian.com>
16911
16912         * mono-debug-debugger.c
16913         (mono_debugger_runtime_invoke): Don't box valuetypes.
16914
16915 2004-10-22  Chris Toshok  <toshok@ximian.com>
16916
16917         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
16918         don't hide private methods.
16919
16920 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
16921
16922         * icall.c: Allows the runtime to "share" (when known) the public key
16923         token of an assembly. This avoid the need to recalculate the token 
16924         (from the public key) in managed code.
16925
16926 2004-10-21  Chris Toshok  <toshok@ximian.com>
16927
16928         * debug-helpers.c (append_class_name): argh, revert last patch.
16929         
16930 2004-10-21  Chris Toshok  <toshok@ximian.com>
16931
16932         * debug-helpers.c (append_class_name): use '+' as the delimiter,
16933         not '/', so that it matches what the debugger uses to look up
16934         methods.
16935
16936 2004-10-21  Martin Baulig  <martin@ximian.com>
16937
16938         * mono-debug-debugger.c (mono_debugger_throw_exception): New
16939         public method; this is called each time an exception is thrown and
16940         allows the debugger to use exception catch points.
16941
16942 2004-10-21  Martin Baulig  <martin@ximian.com>
16943
16944         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
16945         the stack pointer and the exception object in some struct and pass
16946         that to the debugger.
16947
16948 2004-10-21  Chris Toshok  <toshok@ximian.com>
16949
16950         * mono-debug-debugger.c (do_write_class): add instance/static
16951         event support.  We don't expose "raise" or "other" yet.
16952         (event_is_static): new method.
16953
16954 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
16955
16956         * mono-debug-debugger.c
16957         (mono_debugger_handle_exception): Remove
16958         bogus return value for fussy compilers.
16959
16960 2004-10-20  Martin Baulig  <martin@ximian.com>
16961
16962         * mono-debug-debugger.c
16963         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
16964         (mono_debugger_handled_exception): Likewise.
16965
16966 2004-10-20  Martin Baulig  <martin@ximian.com>
16967
16968         * mono-debug-debugger.h (MonoDebuggerEvent): Added
16969         MONO_DEBUGGER_EVENT_EXCEPTION.
16970
16971         * mono-debug-debugger.c (mono_debugger_handle_exception): New
16972         public function to send the debugger a notification for an
16973         exception and inform it about a catch/finally clause.
16974
16975 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
16976
16977         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
16978         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
16979         fix 2.95 build. 
16980
16981         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
16982
16983 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
16984
16985         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
16986         marshalled as [In,Out]. Fixes #58325.
16987
16988 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
16989
16990         * reflection.c (mono_method_body_get_object): Implement some fields.
16991
16992 2004-10-12  Martin Baulig  <martin@ximian.com>
16993
16994         * reflection.c (mono_reflection_bind_generic_parameters): Small
16995         fix, correctly retrieve our parent from a generic instance.
16996
16997 2004-10-12  Martin Baulig  <martin@ximian.com>
16998
16999         * metadata.c (mono_metadata_generic_param_equal): We always have
17000         an owner.
17001
17002         * class.c
17003         (mono_class_from_generic_parameter): We need to have an owner.
17004         (my_mono_class_from_generic_parameter): Likewise.
17005
17006         * reflection.c (mono_reflection_setup_generic_class): Renamed to
17007         mono_reflection_create_generic_class() and added a new
17008         mono_reflection_setup_generic_class().  
17009         (mono_reflection_initialize_generic_param): If we're a nested
17010         generic type and inherited from the containing class, set our
17011         owner to the outer class.
17012
17013 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
17014
17015         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
17016
17017         * reflection.c (mono_method_body_get_object): New function to create
17018         a MethodBody object.
17019
17020         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
17021
17022 2004-10-11  Martin Baulig  <martin@ximian.com>
17023
17024         * metadata.c (_mono_metadata_type_equal): Renamed to
17025         do_mono_metadata_type_equal() and made static.
17026
17027 2004-10-11  Martin Baulig  <martin@ximian.com>
17028
17029         * appdomain.c: Bump corlib version number to 28.
17030
17031 2004-10-10  Martin Baulig  <martin@ximian.com>
17032
17033         * class-internals.h
17034         (MonoGenericInst): Added `MonoGenericContainer *container'.
17035         (MonoGenericMethod): Likewise.
17036         (MonoGenericContext): Likewise.
17037         (MonoGenericParam): Added `MonoGenericContainer *owner'.
17038
17039         * metadata.c
17040         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
17041         (do_mono_metadata_parse_generic_inst): Likewise.
17042         (mono_metadata_parse_type_full): New public method.  This is the actual
17043         mono_metadata_parse_type() implementation - with an additional
17044         `MonoGenericContainer *' argument.
17045         (mono_metadata_parse_array_full): Likewise.
17046         (mono_metadata_parse_signature_full): Likewise.
17047         (mono_metadata_parse_method_signature_full): Likewise.
17048         (mono_metadata_parse_mh_full): Likewise.
17049         (mono_type_create_from_typespec): Likewise.
17050         (mono_metadata_interfaces_from_typedef_full): New public method;
17051         this is similar to the other _full() methods, but we take a
17052         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
17053         (mono_metadata_parse_generic_param): Take an additional
17054         `MonoGenericContainer *' argument and lookup the MonoGenericParam
17055         from that container.
17056         (mono_metadata_generic_param_equal): New static method to compare
17057         two type parameters.
17058         (_mono_metadata_type_equal): New static method; takes an
17059         additional `gboolean signature_only' argument - if true, we don't
17060         compare the owners of generic parameters.
17061         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
17062         with a TRUE argument - do a signature-only comparision.
17063
17064         * loader.c: Use the new _full() methods and pass the
17065         MonoGenericContainer to them.
17066
17067         * object-internals.h (MonoReflectionTypeBuilder): Added
17068         `MonoGenericContainer *generic_container' field.
17069         (MonoReflectionMethodBuilder): Likewise.
17070
17071 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
17072
17073         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
17074         case initial images of dynamic assemblies.
17075
17076         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
17077
17078         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
17079
17080         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
17081         length of event->other array.
17082         (typebuilder_setup_events): Ditto.
17083
17084         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
17085         'assembly_by_name' and add an 'assemblies' list.
17086
17087         * assembly.h assembly.c: Add a new search hook for determining whenever
17088         an assembly is already loaded. Use this instead of searching in the
17089         loaded_assemblies list.
17090
17091         * domain.c appdomain.c: Implement the new search hook so loaded 
17092         assemblies are now scoped by appdomain. Fixes #67727.
17093
17094 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
17095
17096         * threads.c (mono_thread_attach): Initialize synch_lock field so
17097         mono_thread_detach works again.
17098
17099         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
17100         'lib' too. Fixes #63130.
17101
17102 2004-10-06  Jackson Harper  <jackson@ximian.com>
17103
17104         * culture-info-tables.h: regenerated.
17105
17106 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
17107
17108         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
17109         implemented by other interfaces in the result. Fixes #65764.
17110         
17111         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17112         Handle unloadable modules without crashing.
17113
17114         * image.c (load_modules): Revert the previous patch since modules must
17115         have a fixed index inside the array.
17116         
17117         * image.c (load_modules): Don't include native modules in the modules
17118         array.
17119
17120 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
17121
17122         * reflection.h: Add param_defaults field.
17123
17124         * reflection.c: Add support for parameter defaults in dynamic methods.
17125         Fixes #64595.
17126
17127         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
17128         an empty string when a type has no namespace. Fixes #64230.
17129
17130 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
17131
17132         * tabledefs.h: Added "internal" security actions to support non-CAS
17133         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
17134         Note: they do not seems to be used anymore in 2.0 (new metadata format)
17135
17136 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
17137
17138         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
17139         constructor of abstract class. Fixes #61689.
17140
17141 2004-10-04  Martin Baulig  <martin@ximian.com>
17142
17143         * class-internals.h (MonoGenericContainer): New type.
17144         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
17145         `MonoGenericContainer *generic_container'.
17146         (MonoClass): Replaced `gen_params' and `num_gen_params' with
17147         `MonoGenericContainer *generic_container'.
17148
17149         * metadata.c (mono_metadata_load_generic_params): Return a
17150         `MonoGenericContainer *' instead of a `MonoGenericParam *';
17151         removed the `num' argument.
17152
17153 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
17154
17155         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
17156         for dynamic images.
17157
17158         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
17159         machine fields.
17160
17161         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
17162
17163         * reflection.c: Save pe_kind and machine values into the generated
17164         image file.
17165
17166         * appdomain.c: Bump corlib version number.
17167
17168         * object-internals.h: Reorganize layout of LocalBuilder.
17169
17170         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
17171         New helper function.
17172
17173         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
17174         created MonoType for dynamic types. Fixes #66180.
17175
17176 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
17177
17178         * threadpool.c: the ares hashtable needs a critical section around it.
17179         this prevents some nasty segfaults
17180
17181 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
17182
17183         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
17184         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
17185         bug 67324).
17186         
17187 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
17188
17189         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
17190         
17191 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
17192
17193         * image.c: Always canonicalize image file names, to avoid loading
17194         the same assembly twice when referenced using a relative path.
17195
17196 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
17197
17198         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
17199
17200         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
17201
17202         * marshal.c: Fix warnings.
17203
17204 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
17205
17206         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
17207         attempting to marshal the delegate_trampoline as the method_addr.
17208         This patch has a static hashtable of marshalled delegates so that 
17209         we can map delegate_trampoline addresses back to delegates.  This
17210         allows a delegate passed to managed code to be passed back into native
17211         code.  Fixes #67039
17212
17213 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
17214
17215         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
17216
17217         * reflection.c (method_encode_code): Align method headers properly.
17218         Fixes #66025.
17219
17220 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
17221
17222         * marshal.c: In the runtime invoke wrapper, reset the abort
17223         exception if it is cached. This avoids the automatic rethrowal of 
17224         the exception after the catch of the wrapper. Also check for pending
17225         interruptions before calling the managed method. This is done using
17226         the new method emit_thread_force_interrupt_checkpoint, since the
17227         normal checkpoint method is ignored when running the invoke wrapper.
17228         * object.c: If the abort exception is rethrown, set the abort_exc
17229         field of the thread, so it will be rethrown aftere every catch.
17230         * threadpool.c: Only run an interruption checkpoint if what has been
17231         requested is a stop of the thread (aborts will be ignored).
17232         * threads.c: By default, a thread will now never be interrumped while
17233         running the runtime invoke wrapper (this ensures that runtime_invoke
17234         will always return to the caller if an exception pointer is provided).
17235         There is a new special method mono_thread_force_interruption_checkpoint()
17236         to force an interruption checkpoint even if running a protected
17237         wrapper, which is used by the same runtime invoke wrapper to do a check
17238         at a safe point.
17239
17240 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
17241
17242         * object.c, object-internals.h: Implemented mono_release_type_locks,
17243         which releases the cctor locks held by a thread.
17244         * threads.c, threads.h: In thread_cleanup, release cctor locks held
17245         by a thread. Added mono_thread_exit() method to be used to safely stop
17246         a thread.
17247
17248 2004-09-28  Raja R Harinath  <rharinath@novell.com>
17249
17250         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
17251         Move null check before dereference.  Avoid indexing beyond the end
17252         of the 'modules' array.
17253
17254 2004-09-28  Raja R Harinath  <rharinath@novell.com>
17255
17256         * metadata-internals.h (MonoImage): Add module_count field.
17257         * image.c (load_modules): Set image->module_count.
17258         (mono_image_load_file_for_image): Use image->module_count.
17259         * reflection.c (mono_image_load_module): Append to image->modules array 
17260         of dynamic assembly.
17261         (mono_module_get_object): Fix loop to actually increment index.
17262         Use image->module_count.
17263         * assembly.c (mono_assembly_load_references): Use image->module_count.
17264         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
17265         Likewise.
17266
17267 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
17268
17269         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
17270         Avoid assert on generic types.
17271
17272 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
17273
17274         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
17275
17276         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
17277
17278         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
17279         function to convert a MarshalSpec structure to its managed counterpart.
17280
17281         * reflection.c: Fix warnings.
17282         
17283         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
17284         field.
17285
17286         * icall.c (mono_create_icall_signature): Fix build.
17287
17288 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
17289
17290         * icall.c: Add MakePointType icall.
17291
17292         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
17293         warnings.
17294
17295 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17296
17297         * threadpool.c: reuse allocated slots in the queue.
17298
17299 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
17300
17301         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
17302
17303         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
17304
17305         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
17306         previous change.
17307
17308         * tabledefs.h: Add constants for pinvoke attributes BestFit and
17309         ThrowOnUnmappableChar.
17310
17311         * icall.c (ves_icall_Type_GetPacking): New icall.
17312
17313 2004-09-24  Martin Baulig  <martin@ximian.com>
17314
17315         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
17316
17317 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17318
17319         * appdomain.c:
17320         (mono_domain_set): allow setting a domain that is being unloaded.
17321         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
17322         being unloaded.
17323
17324 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
17325
17326         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
17327         the GetCustomAttributes icall.
17328
17329 2004-09-23  Martin Baulig  <martin@ximian.com>
17330
17331         * object-internals.h (MonoReflectionGenericParam): Replaced
17332         'has_ctor_constraint', `has_reference_type' and `has_value_type'
17333         with `guint32 attrs'.
17334
17335 2004-09-23  Martin Baulig  <martin@ximian.com>
17336
17337         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
17338
17339 2004-09-23  Martin Baulig  <martin@ximian.com>
17340
17341         * object-internals.h (GenericParameterAttributes): New enum.
17342
17343 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
17344
17345         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
17346         
17347         * class.c (init_events): Fill out event->other field.
17348
17349         * class.c: Fix warnings.
17350
17351         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
17352
17353 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
17354
17355         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
17356         walk which doesn't supply the IL offset.
17357
17358 2004-09-22  Martin Baulig  <martin@ximian.com>
17359
17360         * reflection.c (mono_reflection_setup_internal_class): If we're
17361         System.ValueType, System.Object or System.Enum, set
17362         `klass->instance_size' and create the vtable.
17363         (mono_reflection_create_internal_class): If we're an enum type,
17364         get the base class from our current corlib.
17365
17366 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
17367
17368         * reflection.h (MonoResolveTokenError): New type.
17369
17370         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
17371         icall.
17372
17373         * icall.c: Add an 'error' argument to the ResolveToken icalls.
17374
17375 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
17376
17377         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
17378         Support also calling constructors, but only for already allocated objects.
17379
17380 2004-09-17  Geoff Norton <gnorton@customerdna.com>
17381
17382         * reflection.c (type_get_qualified_name): If the klass is null
17383         return the typename to avoid a NullRefEx.
17384         (encode_cattr_value): Get the qualified name of the boxed type,
17385         not the underlying enumtype.  Fixes #62984.
17386
17387 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
17388
17389         * marshal.c: Fix problems with previous checkin.
17390
17391 2004-09-21    <vargaz@freemail.hu>
17392
17393         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
17394         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
17395
17396         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
17397
17398 2004-09-21  Geoff Norton <gnorton@customerdna.com>
17399
17400         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
17401         should only return a type for pointers, arrays, and passbyref types.
17402         Fixes bug #63841.
17403
17404 2004-09-21  Martin Baulig  <martin@ximian.com>
17405
17406         * domain.c (mono_debugger_check_runtime_version): New public
17407         function.
17408
17409         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
17410
17411 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
17412
17413         * reflection.c: Added missing sort to the declarative security 
17414         attributes table. MS implementation stops seeing the attributes if the
17415         token number regress in the table (as shown by ildasm and permview).
17416
17417 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
17418
17419         * object-internals.h (MonoReflectionModule): Add 'token' field.
17420         
17421         * reflection.c (mono_reflection_get_token): Add support for Module
17422         and Assembly.
17423         (mono_module_get_object): Set 'token' field.
17424         (mono_module_file_get_object): Set 'token' field.
17425
17426         * icall.c: Add new Assembly and Module icalls.
17427
17428         * appdomain.c: Bump corlib version.
17429
17430 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
17431
17432         * loader.h loader.c class.h class.c: Add helper functions for obtaining
17433         tokens of metadata objects.
17434
17435         * reflection.h reflection.c (mono_reflection_get_token): New function
17436         to obtain the token of a metadata object.
17437
17438         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
17439
17440 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
17441
17442         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
17443         
17444         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
17445
17446 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
17447
17448         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
17449         * object-internals.h: Added 3 MonoArray* members to MonoReflection
17450         AssemblyBuilder to access the permissions set in the class lib.
17451         * reflection.c: Added security attributes encoding step in 
17452         mono_image_build_metadata.
17453         * tabledefs.h: Added new security actions defined in 2.0:
17454         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
17455
17456 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
17457
17458         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
17459         macro parameter.
17460
17461 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
17462  
17463         * locales.c: nullify the ICU_collator member of CompareInfo when it is
17464           finalized. There where random SIGSEVs at program termination, when
17465           an object being finalized was trying to do a string comparison and
17466           the current culture was already finalized.
17467  
17468 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17469
17470         * threads.c: call thread_cleanup before finishing the thread if we get
17471         there.
17472
17473 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
17474
17475         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
17476         assemblies from the parent. Fixes #65665.
17477
17478 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
17479
17480         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
17481         modifiers.
17482
17483 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
17484
17485         * reflection.h: add prototype for mono_get_dbnull_object
17486         * reflection.c: add prototypes for get_default_param_value_blobs 
17487         and mono_get_object_from_blob for fussier compilers
17488
17489 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
17490  
17491         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
17492         false deadlock checks in class initialization.
17493  
17494 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
17495
17496         * image.c (mono_image_addref): Fix comment.
17497
17498         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
17499         possible.
17500
17501 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
17502
17503         * reflection.c (mono_param_get_objects): Modified to return
17504         ParameterInfo.DefaultValue object.
17505
17506         (get_default_param_value_blobs):
17507         (mono_get_object_from_blob):
17508         (mono_get_dbnull_object): New helper routines. 
17509
17510         * object.c (mono_get_constant_value_from_blob): New helper routine
17511         carved out from get_default_field_value ()
17512
17513         * object-internals.h (mono_get_constant_value_from_blob): Added
17514         function declaration.
17515
17516 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
17517
17518         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
17519         referenced assemblies. Fixes #62135.
17520
17521         * exception.h exception.c (mono_get_exception_file_not_found2): New
17522         helper function.
17523
17524 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
17525
17526         * class.h class.c: Add mono_type_get_underlying_type ().
17527
17528 2004-09-09  Geoff Norton <gnorton@customerndna.com>
17529
17530         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
17531         Fix GetTypes() to support dynamically created assemblies.
17532
17533 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
17534
17535         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
17536         
17537         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
17538         previous patch.
17539
17540         * reflection.h reflection.c loader.c: Allow dynamic construction of
17541         pinvoke methods. Fixes #65571.
17542         
17543         * reflection.c (mono_reflection_get_type): Revert previous change since
17544         it causes regressions.
17545
17546 2004-09-08  Martin Baulig  <martin@ximian.com>
17547
17548         * class.c (class_compute_field_layout): Don't call
17549         mono_class_layout_fields() for open generic instances.
17550
17551 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
17552         * threads.c appdomain.c: fix typo in GC macro
17553
17554 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17555
17556         * threads.c: don't call mono_thread_detach() in start_wrapper(),
17557         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
17558
17559 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
17560
17561         * image.c (mono_image_close): Applied patch from 
17562         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
17563         assembly is loaded multiple times from data.
17564         
17565         * image.c (mono_image_open): Fix warning.
17566
17567 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
17568
17569         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
17570         once. Fixes #58334.
17571         
17572         * reflection.c (mono_reflection_create_runtime_class): Initialize
17573         klass->nested_classes. Fixes #61224.
17574
17575 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
17576
17577         * threads.c: sched_yield() on exit, to allow threads to quit.
17578
17579 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
17580
17581         * object.c (mono_unhandled_exception): Remove leftover debug code.
17582
17583 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
17584
17585         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
17586
17587 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
17588
17589         * marshal.c (emit_marshal_array): Really null terminate string arrays.
17590         
17591         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
17592
17593 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
17594
17595         * marshal.c (emit_marshal_array): Null terminate string arrays.
17596         
17597         * marshal.c (raise_auto_layout_exception): Fix warning.
17598
17599         * reflection.c (mono_param_get_objects): Initialize the default value
17600         with DBNull.Value, not null. Fixes #62123.
17601
17602 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
17603
17604         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
17605         throw an exception with a cute explanation.
17606
17607 2004-09-06  Dick Porter  <dick@ximian.com>
17608
17609         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
17610         Close the new process's thread handle, as we don't use it.  The
17611         handle stays around forever otherwise.
17612
17613 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
17614
17615         * object.c (arith_overflow): Fix warning.
17616
17617         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
17618         calling conventions in method refs. Fixes #65352.
17619
17620         * reflection.c: Fix warnings.
17621
17622 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17623
17624         * icall.c: Add a new icall for Array.Clear
17625
17626 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
17627
17628         * object.c: When allocating an array, we have to throw
17629         an overflow exception if any of the lengths are < 0.
17630
17631 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
17632
17633         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
17634         properly. Also move implementation of string array marshalling to 
17635         managed code. Fixes #42316.
17636
17637 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17638
17639         * assembly.c: provide more information when loading an assembly fails.
17640
17641 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17642
17643         * filewatcher.c: don't expect the development fam package to be
17644         installed.
17645
17646 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
17647
17648         * marshal.c: Make a copy of the signature cookie since it will be
17649         freed by the caller.
17650         
17651         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
17652
17653         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
17654
17655         * metadata.c (mono_metadata_free_marshal_spec): New function to free
17656         marshal specs.
17657
17658         * marshal.c: More refactoring.
17659         
17660         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
17661         smaller functions.
17662
17663 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
17664
17665         * object.c: In mono_message_invoke, fill the output parameter array after
17666           calling the managed method (it was done before the call). This fixes
17667           bug #59299.
17668
17669 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
17670
17671         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
17672         as well.
17673
17674 2004-09-02  Martin Baulig  <martin@ximian.com>
17675
17676         * class.c (mono_class_instance_size): Don't allow generic type
17677         definitions or open generic instances.
17678         (mono_class_array_element_size): If we're a value type, call
17679         mono_class_instance_size() on the original class.
17680
17681         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
17682         handle generic instances.
17683
17684         * mono-debug-debugger.c (write_type): Handle generic instances
17685         like classes.
17686
17687 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
17688
17689         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
17690         the allocation request fails. Fixes #65089.
17691
17692         * object.c (mono_runtime_free_method): Do not call mono_free_method.
17693         
17694         * object.c (mono_runtime_free_method): New function to free a dynamic
17695         method.
17696
17697         * marshal.c (mono_delegate_free_ftnptr): New function to free the
17698         delegate trampoline.
17699
17700         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
17701         with hasthis as dynamic,
17702
17703         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
17704
17705         * domain.c (mono_jit_info_table_remove): New function to remove an
17706         entry from the jit info table.
17707
17708         * class-internals.h (MonoMethod): Add 'dynamic' field.
17709
17710         * loader.c: Fix warnings.
17711
17712 2004-09-01  Martin Baulig  <martin@ximian.com>
17713
17714         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
17715         instead of mono_debugger_lock() because the latter one is a no-op
17716         unless running in the debugger.
17717
17718 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
17719
17720         * class.c (class_compute_field_layout): Classes with auto-layout or
17721         reference fields are not blittable.
17722         
17723 2004-09-01  Dick Porter  <dick@ximian.com>
17724
17725         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
17726         mono_image_get_filename() to get the assembly location.
17727
17728         * icall.c:
17729         * metadata.h: Fix compile warnings
17730
17731 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
17732
17733         * class.c (class_compute_field_layout): System.Object is blittable.
17734
17735         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
17736         as in/out. Fixes #59909.
17737
17738 2004-09-01  Martin Baulig  <martin@ximian.com>
17739
17740         * metadata.h (MONO_TYPE_ISREFERENCE): Call
17741         mono_metadata_generic_inst_is_valuetype() if we're a generic
17742         instance to check whether our underlying type is a reference type.
17743
17744 2004-09-01  Martin Baulig  <martin@ximian.com>
17745
17746         * metadata.c (mono_type_size): If we're a generic instance, call
17747         mono_class_value_size() for value types.
17748
17749 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
17750
17751         * marshal.c: Implement more custom marshalling functionality. Fixes
17752         #64915.
17753
17754 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
17755
17756         * mono-debug.c, debug-mono-symfile.c: add some locking love.
17757
17758 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
17759
17760         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
17761
17762         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
17763
17764         * icall.c: Fix some warnings.
17765
17766         * threads.c (abort_appdomain_thread): Fix unref errors.
17767         (mono_thread_current): Fix THREAD_DEBUG define.
17768
17769 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
17770
17771         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
17772
17773         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
17774
17775 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
17776
17777         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
17778         string arrays.
17779
17780 2004-08-28  Martin Baulig  <martin@ximian.com>
17781
17782         * metadata.c
17783         (mono_metadata_generic_inst_is_valuetype): New public function.
17784
17785         * metadata.h (MONO_TYPE_ISSTRUCT): Call
17786         mono_metadata_generic_inst_is_valuetype() if we're a generic
17787         instance to check whether our underlying type is a valuetype.
17788
17789 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
17790
17791         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
17792         #63768.
17793
17794 2004-08-25  Martin Baulig  <martin@ximian.com>
17795
17796         * loader.c (mono_get_method_from_token): Abstract methods can also
17797         be generic and thus have type parameters.
17798
17799         * metadata-internals.h
17800         (MonoDynamicImage): Added `GPtrArray *gen_params'.
17801
17802         * reflection.c (mono_image_get_generic_param_info): Don't create a
17803         metadata row, just add an entry to the `gen_params' array.
17804         (build_compressed_metadata): Sort the `gen_params' array and then
17805         actually create the metadata.
17806
17807 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17808
17809         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
17810
17811 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
17812
17813         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
17814
17815 2004-08-24  Martin Baulig  <martin@ximian.com>
17816
17817         * class.cs (mono_class_is_subclass_of): Like an interface, a
17818         generic instance also derives from System.Object.
17819
17820 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
17821
17822         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
17823         custom modifiers to be in any order. Fixes #61990.
17824
17825 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
17826
17827         * object.c: Register mono_object_new_fast icall.
17828         
17829         * object.c (mono_class_get_allocation_ftn): Return to calling
17830         mono_object_new_fast, since it seems faster to compute the object 
17831         size in unmanaged code than passing it as a parameter.
17832
17833         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
17834
17835         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
17836         this function with Boehm as the oom handler, so we don't have to check
17837         the result of GC_malloc.
17838
17839         * object.c: Remove checks for oom.
17840
17841         * object.h object.c (mono_class_get_allocation_ftn): New function to
17842         return the icall which can be used to allocate an instance of a given
17843         class. 
17844
17845         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
17846
17847         * class-internals.h: Add 'enabled' field.
17848
17849 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
17850
17851         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
17852
17853 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
17854         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
17855         value 0x0010.
17856
17857 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
17858
17859         * appdomain.c: use the Tls function for appdomain too,
17860         at Zoltan's request. Actually return in mono_context_get
17861
17862         * appdomain.c, profiler.c, threads.c: use __thread
17863
17864 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
17865
17866         * appdomain.c threads.c: Call GC_CreateThread on windows.
17867
17868         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
17869         multiple libraries since this don't work on windows.
17870
17871 2004-08-18  Martin Baulig  <martin@ximian.com>
17872
17873         * class-internals.h
17874         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
17875         MonoMethodHeader.
17876
17877         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
17878         MonoMethodNormal since we also need it for abstract and interface
17879         methods.
17880
17881         * reflection.c
17882         (build_compressed_metadata): Sort the GenericParam table.
17883         (mono_image_create_token): Added `gboolean create_methodspec'
17884         argument; this is false when generating a MethodImpl token.
17885         (reflection_methodbuilder_to_mono_method): Abstract and interface
17886         methods may also have generic parameters.
17887
17888 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
17889
17890         * appdomain.c: thread local alloc
17891
17892 2004-08-17  Martin Baulig  <martin@ximian.com>
17893
17894         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
17895
17896         * icall.c
17897         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
17898         argument.
17899
17900         * class.c (mono_type_get_full_name): New public function.
17901         (mono_type_get_name): Don't include the type arguments.
17902
17903 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
17904
17905         * Makefile.am: Build static versions of libmetadata and libmonoruntime
17906         for inclusion into the mono executable.
17907
17908 2004-08-16  Martin Baulig  <martin@ximian.com>
17909
17910         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
17911         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
17912
17913 2004-08-14  Martin Baulig  <martin@ximian.com>
17914
17915         * class.c (dup_type): Also copy the `byref' field.
17916
17917 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
17918
17919         * reflection.c (create_dynamic_mono_image): Revert the last change 
17920         since it breaks bootstrap.
17921
17922 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
17923
17924         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
17925
17926         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
17927         not free them with g_free.
17928
17929 2004-08-11  Martin Baulig  <martin@ximian.com>
17930
17931         * reflection.c (mono_reflection_setup_internal_class): Also call
17932         mono_class_setup_mono_type() if we already have a `tb->type.type'.
17933
17934 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
17935
17936         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
17937         called during default (first) AppDomain creation. Keep track of
17938         Evidence when loading assemblies.
17939
17940 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
17941
17942         * opcodes.c, opcodes.h: reduce runtime relocations.
17943
17944 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
17945
17946         * culture-info.h, locales.c: fixes and chages to sue the new
17947         optimized format of the locale data.
17948         * culture-info-tables.h: regenerated.
17949
17950 2004-08-06  Geoff Norton <gnorton@customerdna.com>
17951         
17952         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
17953
17954 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
17955
17956         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
17957         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
17958         * domain-internals.h: icall declaration.
17959         * icall.c: icall registration.
17960         * object-internals.h: New fields in MonoAssembly for CAS.
17961
17962 2004-08-05  Duncan Mak  <duncan@ximian.com>
17963
17964         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
17965         CEE_LDELEM_ANY.
17966
17967 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
17968
17969         * reflection.c: fix to deal with object[] arrays in custom ctors
17970         (bug #62550).
17971
17972 2004-08-05  Martin Baulig  <martin@ximian.com>
17973
17974         * class.c (mono_class_array_element_size): Added support for
17975         generic instances and correctly handle "recursive" types.
17976
17977 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
17978
17979         * assembly.c: Fix warnings.
17980
17981 2004-08-04  Martin Baulig  <martin@ximian.com>
17982
17983         * class.c
17984         (mono_type_get_name_recurse): Added `gboolean include_arity'
17985         argument specifying whether or not we should include the generic
17986         arity in the type name.
17987         (_mono_type_get_name): New static function.
17988         (mono_class_setup_vtable): If we're a generic instance, don't
17989         include the generic arity in the names of explicit method
17990         implementations.        
17991
17992 2004-08-03  Martin Baulig  <martin@ximian.com>
17993
17994         * class.c (mono_type_get_name_recurse): Enclose the generic type
17995         arguments in `<', '>'.
17996
17997 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
17998
17999         * gc.c: make GC warning messages use the trace API, they are just
18000         noise to most of the users.
18001
18002 2004-08-03  Martin Baulig  <martin@ximian.com>
18003
18004         * debug-mono-symfile.c (read_string): Correctly read the string.
18005
18006 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
18007
18008         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
18009         
18010         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
18011         icalls.
18012         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
18013
18014 2004-07-30  Martin Baulig  <martin@ximian.com>
18015
18016         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
18017         Reflect latest symbol writer changes.   
18018
18019 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
18020
18021         * object.c: always create an object if null is passed
18022         to Invoke() where a valuetype is expected.
18023
18024 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
18025
18026         * marshal.c (mono_marshal_init): make managed
18027         signatures match native ones better for 64bits.
18028
18029 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18030
18031         * appdomain.c: hack to build correctly the private bin path on windows.
18032         Fixes bug #61991.
18033
18034 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
18035
18036         * assembly.c: Load mscorlib from the correct framework directory
18037           (mono/<version>/mscorlib.dll).
18038         * appdomain.h: Added prototypes for new functions.
18039         * internals.h: Added some prototypes.
18040         * domain.c: When initializing the runtime, get from the executable and
18041           the configuration files the runtime version that the app supports.
18042           Added support methods for reading app.exe.config. Added list of versions
18043           supported by the JIT. Added two new methods: mono_init_from_assembly,
18044           which initializes the runtime and determines the required version from
18045           the provided exe file, and mono_init_version, which initializes
18046           the runtime using the provided version.
18047         * icall.c: Get machine.config from version-specific directory.
18048         * reflection.c: When generating an image, embed the version number
18049           of the current runtime.
18050
18051 2004-07-28  Dick Porter  <dick@ximian.com>
18052
18053         * socket-io.c
18054         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
18055         returned sockaddr size before creating the remote address object.
18056         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
18057         61608.
18058
18059 2004-07-28  Dick Porter  <dick@ximian.com>
18060
18061         * locales.c (string_invariant_compare_char): Fix invariant char
18062         compares between upper and lower cases.  Fixes bug 61458.
18063
18064 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
18065         
18066         * marshal.c: actually cache stelem.ref wrappers.
18067         
18068 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
18069
18070         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
18071         sections and remove the mono_cli_rva_map () function.
18072
18073 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
18074
18075         * debug-mono-symfile.c: fix one more endianess issue, from a patch
18076         by Geoff Norton (<gnorton@customerdna.com>).
18077
18078 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
18079
18080         * class.c: fix class loads for pointer types (typeof(int) !=
18081         typeof(int*)).
18082
18083 2004-07-27  Martin Baulig  <martin@ximian.com>
18084
18085         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
18086         reading the debugging information from an external ".mdb" file.
18087
18088 2004-07-24  Martin Baulig  <martin@ximian.com>
18089
18090         * reflection.c (mono_image_get_type_info): Only write a class
18091         layout entry if we actually have a size or a packing size.
18092
18093 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
18094
18095         * reflection.c (type_get_fully_qualified_name): 
18096         insert cast to get type checking of ?: with non-gcc compilers
18097
18098 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
18099
18100         * rand.c: use g_getenv for both lookups of
18101         MONO_EGD_SOCKET
18102
18103 2004-07-17  Martin Baulig  <martin@ximian.com>
18104
18105         * reflection.c (mono_reflection_bind_generic_method_parameters):
18106         Set `gmethod->reflection_info'.
18107
18108 2004-07-17  Martin Baulig  <martin@ximian.com>
18109
18110         * class.c (mono_class_create_from_typedef): Insert the newly
18111         created class into the hash table before computing the interfaces
18112         since we could be called recursively.
18113
18114 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
18115
18116         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
18117         function to implement stelem.ref in managed code
18118         * class-internals.h, debug-helpers.c: a new wrapper type
18119         for the above.
18120
18121 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
18122
18123         * gc.c: allow GC handles to work even when no GC is compiled in.
18124         Fix part of bug #61134 (GetAddrOfPinnedObject).
18125
18126 2004-07-13  Peter Williams  <peter@newton.cx>
18127  
18128         * process.c (complete_path): Make sure we don't attempt to execute
18129         directories.
18130  
18131 2004-07-12  Geoff Norton <gnorton@customerdna.com>
18132
18133         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
18134           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
18135           and will add/subtract the hour if needed
18136
18137 2004-07-12  Martin Baulig  <martin@ximian.com>
18138
18139         * reflection.c (mono_field_get_object): If we have
18140         `field->generic_info', take the attributes from
18141         `field->generic_info->generic_type'.    
18142
18143 2004-07-12  Martin Baulig  <martin@ximian.com>
18144
18145         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
18146         This function must be called before initializing the runtime.
18147         (mono_debug_init_1): New function; call this after initializing
18148         the runtime, but before loading the assembly.  It tells the
18149         debugger to load corlib and the builtin types.
18150
18151         * mono-debug-debugger.c: Did some larger changes in the debugging
18152         code; support recursive class declarations, make sure we actually
18153         add all classes.
18154
18155 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18156
18157         * debug-helpers.c: undo my previous patch and fixed the real issue in
18158         ../mini/exceptions-x86.c
18159
18160 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18161
18162         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
18163         when no HOME env. variable was set and a NullRef was thrown in a .cctor
18164         called from other .cctors.
18165
18166 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
18167
18168         * loader.c: Removed the mono_loader_wine_init hack now that we are
18169         doing a managed version of Windows.Forms.
18170
18171 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
18172
18173         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
18174         threadpool.c, threads.c: remove static data from rootset.
18175
18176 2004-07-09  Dick Porter  <dick@ximian.com>
18177
18178         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
18179         Don't do any more processing if the matched length was 0.  It was
18180         increasing the size of the string before.  Fixes bug 61167.
18181
18182 2004-07-09  Dick Porter  <dick@ximian.com>
18183
18184         * socket-io.h:
18185         * socket-io.c
18186         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
18187         Add support for SO_PEERCRED if its available.
18188
18189 2004-07-09  Peter Bartok <pbartok@novell.com>
18190         * loader.c: winelib.exe.so error message is now only displayed if
18191         MONO_DEBUG is set. To help us avoid questions when people are trying
18192         out the new Managed.Windows.Forms.
18193
18194 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
18195
18196         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
18197         for isinst and castclass wrappers.
18198
18199         * class-internals.h icall.c: Move registration and lookup of JIT icalls
18200         to libmetadata from the JIT, so they could be used by the marshalling
18201         code and the interpreter.
18202
18203         * marshal.c: Register marshalling related JIT icalls here instead of
18204         in mini.c. Use CEE_MONO_ICALL instead of the family of 
18205         CEE_MONO_PROC<x> opcodes to call marshalling functions.
18206
18207         * metadata.h: Remove unneeded marshalling conversions.
18208
18209         * opcodes.c: Update for new opcodes.
18210         
18211 2004-07-08  Martin Baulig  <martin@ximian.com>
18212
18213         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
18214         (mono_debug_get_domain_data): Make this function static.
18215
18216 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
18217
18218         * gc.c, object.h: add nice GC handle API for embedders.
18219
18220 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
18221
18222         * reflection.c: more changes for the new api
18223
18224         * object.c: When we reflect on a field w/ a constant value, it
18225         will not have a memory location, so we must access metadata. Also,
18226         allow easier reading of strings so that we can read them from
18227         the constant data.
18228
18229         * class.c (mono_class_layout_fields): no need for literal fields here.
18230
18231         * class-internals.h: api changes for const fields
18232
18233         * icall.c (ves_icall_get_enum_info): use new apis for const fields
18234
18235 2004-07-06  Martin Baulig  <martin@ximian.com>
18236
18237         * mono-debug.h: Increment version number to 44.
18238
18239         * mono-debug.c (mono_debug_add_wrapper): The second argument is
18240         now a gpointer, rewrote this whole method.
18241
18242         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
18243         function.  Add information about the wrapper in a new "misc table".
18244
18245         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
18246         for the new misc table.
18247
18248 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
18249
18250         * metadata-internals.h image.c: Add a cache for helper signatures.
18251
18252         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
18253
18254 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
18255
18256         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
18257         delegates from a delegate. Fixes #61033.
18258         
18259         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
18260         marshalling of stringbuilder arrays. Fixes #59900.
18261
18262 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
18263
18264         * icall.c: Add EnumBuilder:setup_enum_type icall.
18265
18266 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
18267
18268         * icall.c: Added a new icall for the property version of
18269         OffsetOfStringData.
18270
18271 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
18272
18273         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
18274         it has a constant size across platforms.
18275
18276         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
18277         stack trace.
18278
18279 2004-06-29  Martin Baulig  <martin@ximian.com>
18280
18281         * mono-debug.c (mono_debug_add_method): Protect the whole function
18282         in mono_debugger_lock(), not just parts of it.
18283
18284 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
18285
18286         * reflection.c: make sure padding bytes in heaps are zeroed.
18287
18288 2004-06-24  David Waite  <mass@akuma.org>
18289
18290         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
18291         image.c, loader.c, locales.c, marshal.c, metadata.c,
18292         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
18293         string-icalls.c, threads.c: change to C90-style comments from C99 /
18294         C++ -style
18295
18296 2004-06-24  Dick Porter  <dick@ximian.com>
18297
18298         * threads.c
18299         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
18300         return createdNew.  Fixes bug 60412.
18301
18302         * threads-types.h: 
18303         * icall.c: Add createdNew parameter to CreateMutex icall
18304
18305 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
18306
18307         * reflection.c, object-internals.h: save default value in params.
18308
18309 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18310
18311         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
18312         no need to build a new path combining that with the application base.
18313         Fixes bug #60442.
18314
18315 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
18316
18317         * reflection.c: fixed minor standard compliance issues.
18318
18319 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
18320
18321         * reflection.c: fixed issue with encoding some custom attributes
18322         (arrays in properties and fields, bug #60411).
18323
18324 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18325
18326         * reflection.c: fix start address when copying the public key token.
18327
18328 2004-06-23  Martin Baulig  <martin@ximian.com>
18329
18330         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
18331         the `exc' object in a static object to put it into the GC's root set.
18332
18333 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
18334
18335         * reflection.c: make mono_reflection_setup_internal_class ()
18336         callable a second time to setup a new parent class.
18337
18338 2004-06-23  Dick Porter  <dick@ximian.com>
18339
18340         * threads.c: Check for WAIT_IO_COMPLETION return values.
18341
18342 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
18343
18344         * appdomain.c: Removed the g_free on the public key token. Now copy 
18345         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
18346         * assembly.c: Added public key token string value when loading 
18347         assemblies. Fix bug #60439.
18348         * icall.c: Added missing informations (like public key) in 
18349         GetReferencedAssemblies. Fix #60519.
18350         * image.h: Changed definition for public key token from const char*
18351         public_tok_value to guchar public_key_token [17];
18352         * reflection.c: Updated for changes to public key token.
18353
18354 2004-06-22  Lluis Sanchez Gual
18355
18356         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
18357         for the field in base classes.
18358
18359 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
18360
18361         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
18362         mark headers as not supported, they are installed only for use by the
18363         debugger.
18364
18365 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
18366
18367         * *.c, *.h: avoid namespace pollution in public headers.
18368
18369 2004-06-21  Martin Baulig  <martin@ximian.com>
18370
18371         * exception.c (mono_get_exception_security): It's in
18372         "System.Security", not in "System".
18373
18374         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
18375         the exception classes.
18376
18377 2004-06-21  Martin Baulig  <martin@ximian.com>
18378
18379         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
18380         Protect the exception object from being finalized.
18381
18382 2004-06-21  Martin Baulig  <martin@ximian.com>
18383
18384         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
18385         public function.
18386
18387 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
18388
18389         * reflection.c: Load the assembly in mono_reflection_type_from_name,
18390         if it was not loaded before. Fix parts of #60439.
18391
18392 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
18393
18394         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
18395         code that was broken since Ben's change: wrappers are now
18396         dependent on the method signature only again.
18397
18398 2004-06-21  Martin Baulig  <martin@ximian.com>
18399
18400         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
18401         added interface support.
18402
18403 2004-06-21  Martin Baulig  <martin@ximian.com>
18404
18405         * class.c (mono_vtable_get_static_field_data): New public method.
18406
18407 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
18408
18409         * filewatcher.c : Windows build fix to be compliant with API changes.
18410
18411 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
18412
18413         * class.h, class.c: more accessors.
18414         * metadata.h, metadata.c: prepare for hiding MonoType and
18415         MonoMethodSignature: people should use the accessors from now on
18416         outside of the tree.
18417
18418 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
18419
18420         * *.c, *.h: more API cleanups.
18421
18422 2004-06-18  Jackson Harper  <jackson@ximian.com>
18423
18424         * assembly.c: Trace loading assemblies.
18425         * loader.c: Trace loading native libraries.
18426         * mono-config.c: Trace loading config files.
18427         
18428 2004-06-18  Dick Porter  <dick@ximian.com>
18429
18430         * locales.c: Tell ICU the lengths of strings, it can cope with
18431         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
18432
18433 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
18434
18435         * image.c: swapped name/filename;
18436
18437 2004-06-18  Martin Baulig  <martin@ximian.com>
18438
18439         * mono-debug-debugger.c (write_class): Write the parent class at
18440         the end of the header.
18441
18442 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
18443
18444         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
18445
18446 2004-06-17  Raja R Harinath  <rharinath@novell.com>
18447
18448         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
18449         (bundle_obj): New conditional define.
18450         (BUILT_SOURCES): Remove.
18451         ($(bundle_srcs)): Make parallel-make safe.
18452         (libmonoruntime_la_LIBADD): Make unconditional.
18453         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
18454         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
18455
18456 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
18457
18458         * culture-info-tables.h: It was inconsistent with the latest
18459           supp info files.
18460
18461 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
18462
18463         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
18464         be loaded.
18465
18466         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
18467         with gcc 2.95.
18468
18469 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
18470
18471         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
18472         cleaned up public header threads.h.
18473
18474 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
18475
18476         * Makefile.am, *.c, *.h: more API cleanups.
18477
18478 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
18479
18480         * Makefile.am: removed monosn from compilation.
18481         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
18482         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
18483         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
18484         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
18485         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
18486         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
18487
18488 2004-06-15  Jackson Harper  <jackson@ximian.com>
18489
18490         * assembly.c: Make locales lower case when searching the GAC for
18491         assemblies. gacutil will always make locales lowercase when
18492         installing so this effectively makes them case insensitive.
18493         
18494 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
18495
18496         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
18497         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
18498           parameter which allows to choose whether the wait can be interrupted or 
18499           not. Also added the method mono_monitor_enter(), which locks the monitor
18500           using an infinite wait and without allowing interruption.
18501           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
18502           interrupted.
18503         * object.h: Added new fields in MonoThread. suspend_event holds the event
18504           used to susped/resume the thread. synch_lock is the lock object to use for
18505           modifying the thread state.
18506         * threads.c: Use the new synch_lock object for locking, instead of "this",
18507           which can generate deadlocks.
18508           Moved thread state change in Thread.Sleep and Thread.Join from managed
18509           to unmanaged code. This avoids a deadlock when the thread was suspended
18510           just after acquiring the thread lock.
18511           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
18512           Implemented Thread.Suspend using an event instead of ThreadSuspend,
18513           which is not fully implemented in the io-layer.
18514         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
18515
18516 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
18517
18518         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
18519         threads-types.h: more API cleanups.
18520
18521 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
18522
18523         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
18524         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
18525         threadpool.c, threads.c: first pass at the exported API cleanup.
18526
18527 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
18528
18529         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
18530
18531 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18532
18533         * icall.c: added internalGetHome.
18534
18535 2004-06-14  Dick Porter  <dick@ximian.com>
18536
18537         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
18538         possible to return successfully when '.' or '..' were the only
18539         entries in a directory, but were skipped.  The MonoIOStat was not
18540         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
18541         Fixes bug 59574.
18542
18543 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
18544
18545         * reflection.c: make binaries run on .Net 1.1 by default.
18546
18547 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
18548
18549         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
18550
18551 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
18552
18553         * marshal.c: keep track of struct size with explicit layout
18554         (bug #59979).
18555
18556 2004-06-12  Martin Baulig  <martin@ximian.com>
18557
18558         * mono-debug-debugger.c: Comment out a debugging g_message().
18559
18560 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
18561
18562         * reflection.c, reflection.h: do not free custom attrs that are cached.
18563         * icall.c: use braces to make code clearer.
18564
18565 2004-06-11  Martin Baulig  <martin@ximian.com>
18566
18567         * class.h (MonoInflatedField): New type.
18568         (MonoClassField): Replaced `MonoType *generic_type' with
18569         `MonoInflatedField *generic_info'.
18570
18571         * icall.c
18572         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
18573
18574 2004-06-11  Martin Baulig  <martin@ximian.com>
18575
18576         * reflection.c (mono_image_create_method_token): Correctly encode
18577         varargs methods.
18578
18579 2004-06-11  Martin Baulig  <martin@ximian.com>
18580
18581         * metadata.c (mono_metadata_parse_method_signature): When parsing
18582         a MethodDef which has VarArgs, also set sentinelpos if we don't
18583         have any parameters.
18584
18585 2004-06-11  Martin Baulig  <martin@ximian.com>
18586
18587         * verify.c (mono_method_verify): In CEE_CALL, use
18588         mono_method_get_signature() to get the method's signature, unless
18589         we're a PInvoke method.
18590
18591 2004-06-10  Jackson Harper  <jackson@ximian.com>
18592
18593         * assembly.c: Use <path>/lib/mono/gac for the extra paths
18594         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
18595         logical name as the supplied path is just a prefix to the gac not
18596         the direct path to it.
18597         
18598 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
18599
18600         * reflection.c: make the token for a created method match
18601         the token of the MethodBuilder it was created from
18602         (IKVM requires this behaviour now).
18603
18604 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
18605
18606         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
18607         reflection.c, socket-io.c: leak fixes.
18608
18609 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
18610
18611         * icall.c: handle sentinel pos in vararg methods in position different
18612         from 0.
18613
18614 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18615
18616         * culture-info-tables.h: freshly generated.
18617
18618 2004-06-09  Martin Baulig  <martin@ximian.com>
18619
18620         * loader.c (mono_get_method_constrained): Call `mono_class_init
18621         (constrained_class)'.   
18622
18623 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
18624
18625         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
18626         any methods. Fixes #59629.
18627
18628 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18629
18630         * culture-info-tables.h: reflecting locale-builder updates.
18631
18632 2004-06-08  Dick Porter  <dick@ximian.com>
18633
18634         * object.h:
18635         * locales.c: Fixed compile warnings, including a real bug in
18636         CompareInfo_internal_compare.
18637         
18638 2004-06-08  Dick Porter  <dick@ximian.com>
18639
18640         * locales.c
18641         (ves_icall_System_Globalization_CompareInfo_internal_index):
18642         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
18643         Double-check the resuls of usearches, because ICU currently
18644         ignores most of the collator settings here.  Fixes bug 59720.
18645         
18646 2004-06-08  Dick Porter  <dick@ximian.com>
18647
18648         * locales.c
18649         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
18650         Fix memory leak and segfault-causing typo.  No idea how this one
18651         lasted so long without being noticed.
18652
18653 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
18654
18655         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
18656         any methods. Fixes #59629.
18657
18658 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18659
18660         * assembly.c:
18661         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
18662         own the critical section before). Removed dead code (that's done
18663         in the preload hook).
18664
18665         (mono_assembly_load_with_partial_name): call the preload hook.
18666
18667 2004-06-08  Martin Baulig  <martin@ximian.com>
18668
18669         * metadata.c (mono_metadata_signature_alloc): Default
18670         `sentinelpos' to -1.
18671
18672         * reflection.c (mono_image_get_array_token): Likewise.
18673
18674 2004-06-08  Martin Baulig  <martin@ximian.com>
18675
18676         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
18677
18678         * metadata.c (mono_metadata_parse_method_signature): When parsing
18679         a MethodDef which has VarArgs, set sentinelpos.
18680
18681         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
18682         `gint16' since we're using -1 for non-varargs methods.
18683
18684         * reflection.c
18685         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
18686         (method_encode_signature): Added varargs support.
18687         (method_builder_encode_signature): Likewise.
18688         (mono_image_get_varargs_method_token): New static method.
18689         (mono_image_create_method_token): New public method; this is
18690         called via an icall instead of mono_image_create_token() when
18691         calling a varargs method.       
18692
18693 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
18694
18695         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
18696
18697 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18698
18699         * culture-info-tables.h : Reflecting the latest locale-builder that
18700           fixed empty array representation ({} to {0}).
18701
18702 2004-06-07  Jackson Harper  <jackson@ximian.com>
18703
18704         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
18705         looking up extra gac paths. This allows MONO_GAC_PATH to act
18706         exactly like a prefix.
18707         
18708 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
18709
18710         * reflection.c (mono_reflection_type_from_name): Make a copy of the
18711         type name before modifying it. Fixes #59405.
18712
18713 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
18714
18715         * culture-info.h: added fields for "all datetime patterns".
18716         * locales.c: (  ves_icall_System_Globalization_CultureInfo
18717           _construct_datetime_format ()): fill xxx_patterns fields.
18718         * object.h: added fields for "all datetime patterns" to
18719           MonoDateTimeFormatInfo.
18720         * culture-info-tables.h: reflecting locale-builder updates.
18721
18722 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
18723
18724         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
18725         the event has no add and remove methods. Fixes #59629.
18726
18727 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
18728
18729         * object.c: Fixed possible integer overflow when allocating large
18730         strings.
18731
18732 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
18733
18734         * culture-info-tables.h: reflecting locale-builder updates.
18735
18736 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
18737
18738         * culture-info-tables.h: reflecting locale-builder updates.
18739
18740 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
18741
18742         * culture-info-tables.h: reflecting locale-builder updates.
18743
18744 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
18745
18746         * threads.c: Made Thread.Sleep abortable.
18747
18748 2004-06-02  Martin Baulig  <martin@ximian.com>
18749
18750         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
18751
18752         * debug-mono-symfile.h: Bumped symbol file version number to 37.
18753
18754 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
18755
18756         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
18757
18758 2004-05-30  Jackson Harper  <jackson@ximian.com>
18759
18760         * reflection.c: Do not hardcode assembly versions or public key
18761         tokens anymore. All of this except the corlib section was dead
18762         code anyways.
18763         
18764 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
18765
18766         * object.c (mono_runtime_invoke_array): Automatically create boxed
18767         objects for byref valuetypes if needed. Fixes #59300.
18768         
18769         * object.c (mono_method_return_message_restore): Handle 
18770         MONO_TYPE_OBJECT as well.
18771
18772 2004-05-28  Jackson Harper  <jackson@ximian.com>
18773
18774         * reflection.c: The modified type encoding was causing build
18775         problems. Reverted for now.
18776         
18777 2004-05-28  Jackson Harper  <jackson@ximian.com>
18778
18779         * reflection.c/h: Take an assembly ref so that we dont create
18780         fully qualified names when encoding types in the same assembly as
18781         the custom attribute being emitted.
18782         * appdomain.c: Increment version number.
18783         
18784 2004-05-26  Duncan Mak  <duncan@ximian.com>
18785
18786         * icall.c
18787         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
18788         Set the full version number (major, minor, build, revision).
18789
18790 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
18791
18792         * marshal.c (emit_struct_conv): increment src/dst after blit
18793         (mono_marshal_get_managed_wrapper,
18794         mono_marshal_get_native_wrapper): make sure we have marshalling
18795         info before marshalling params (info computation affects
18796         blittable)
18797
18798         * class.c (class_compute_field_layout): correctly deal with
18799         blittable
18800         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
18801         value types (as per what windows dows by default)
18802         (mono_class_setup_mono_type): System.ValueType is blittable
18803         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
18804         blittable
18805
18806         * marshal.c (mono_marshal_load_type_info): flag types  as
18807         non-blittable if the native layout doesn't match the managed
18808         layout
18809
18810 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18811
18812         * appdomain.c: don't add stuff in the private search path that is
18813         above the application base. If application base is not set, there's
18814         no private search path.
18815
18816 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
18817
18818         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
18819         byref struct arguments in native->managed marshalling.
18820
18821 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
18822
18823         * marshal.c (mono_marshal_get_runtime_invoke): correctly
18824         cache methods using signature (special case for methods
18825         that are value type or string class)
18826         
18827         * image.c (mono_image_close): clean up allocated GSList's
18828         in runtime_invoke_cache.
18829
18830 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18831
18832         * mono-config.c: set the correct path for mono_cfg_dir on windows when
18833         there's no MONO_CFG_DIR environment variable defined.
18834
18835 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18836
18837         * threads.c: windows version must be >= 0x0500 to include OpenThread.
18838
18839 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
18840
18841         * threadpool.c: Really wait for 500ms after the async call, even if the wait
18842           is interrumped.
18843         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
18844           before waiting for it, and call CloseHandle after the wait to unref it.
18845           This will make sure that handles are not disposed too early.
18846
18847 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18848
18849         * appdomain.c:
18850         * appdomain.h:
18851         * icall.c: removed
18852         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
18853         needed now.
18854
18855         * object.c: se the application_base only for the domain that runs
18856         Main. Fixes bug #59216,
18857
18858 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18859
18860         * appdomain.c:
18861         * object.c: only the domain in which Main is run have
18862         SetupInformation.ConfigurationFile set, so moved a few lines from
18863         appdomain.c to object.c.
18864
18865 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18866
18867         * appdomain.c: we tried to load [name].(dll|exe), but according
18868         to bug #57710, we must also try [culture]/[name].(dll|exe) and
18869         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
18870         There's a test case attached to bug #58922.
18871
18872 2004-05-27  Dick Porter  <dick@ximian.com>
18873
18874         * icall.c:
18875         * file-io.c: Implemented icalls for locking and unlocking regions
18876         in a file.
18877         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
18878         FALSE on error (fixes both compiler warning and real bug.)
18879
18880 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
18881
18882         * culture-info-tables.h: reflecting locale-builder updates.
18883
18884           (Added missing ChangeLog entry for 05/26)
18885
18886 2004-05-27  Jackson Harper  <jackson@ximian.com>
18887
18888         * locales.c: Fix some cut and paste errors.
18889         
18890 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18891
18892         * mono-config.c: set the correct path for config. directory on windows.
18893
18894 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
18895
18896         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
18897           on win32.
18898
18899 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
18900
18901         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
18902         from pinvoke functions.
18903         
18904         * marshal.c (mono_ftnptr_to_delegate): Implement this.
18905
18906 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
18907
18908         * culture-info-tables.h: reflecting locale-builder updates.
18909
18910 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
18911
18912         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
18913         #59086.
18914
18915 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
18916
18917         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
18918         * icall.c: Modified icalls for RNG.
18919         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
18920         Windows (CryptoAPI).
18921
18922 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
18923
18924         * locales.c: Fix build.
18925
18926 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
18927
18928         * culture-info-tables.h: reflecting locale-builder updates.
18929
18930 2004-05-25  Jackson Harper  <jackson@ximian.com>
18931
18932         * locales.c: When creating the current culture use the $LANGs
18933         specific culture. So DateTimeFormat and NumberFormat entries are created.
18934         
18935 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
18936
18937         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
18938         a char array as parameter.
18939
18940 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
18941
18942         * image.c: In mono_image_open(), always use an absolute path name to
18943           look for already loaded images.
18944
18945 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
18946
18947         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
18948         missing in the windows build (like older cygwin include files).
18949
18950 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
18951
18952         * icall.c: Fixed check for possible integer overflow in Buffer_
18953         BlockCopy icall. Replaced comments style // by /* */.
18954
18955 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
18956
18957         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
18958         
18959         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
18960         check after MONO_VTADDR. Fixes pinvoke2.exe.
18961
18962         * marshal.h marshal.c metadata.h: Add beginnings of support for
18963         ftnptr -> delegate marshalling.
18964
18965 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
18966
18967         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
18968         * threads.c: Fix warnings.
18969
18970 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
18971
18972         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
18973         * icall.c: Registered icalls for Suspend and Resume.
18974         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
18975           Thread.Abort.
18976         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
18977         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
18978         * process.c: Use WaitForSingleObjectEx.
18979         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
18980           checkpoints.
18981         * threads.c, threads.h: Make use of new Ex wait methods. Improved
18982           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
18983           for Suspend and Resume. Added new mono_thread_stop, used for stoping
18984           background threads. Added basic support for Abort in Windows.
18985           Start new threads using a managed delegate invoke wrapper. This wrapper
18986           has an interruption checkpoint that is needed since an interruption
18987           can be requested before the thread leaves the unmanaged code that starts 
18988           the thread.
18989         * marshal.c: Added interruption checkpoint after every native call, and
18990           also before managed calls for wrappers called from unmanaged code to
18991           go into managed code.
18992         * object.h: Added new field in MonoThread to keep track of interruption
18993           requests.
18994
18995 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
18996
18997         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
18998         calls.
18999
19000 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19001
19002         * appdomain.c:
19003         * assembly.c:
19004         * gc.c:
19005         * locales.c:
19006         * mono-config.c:
19007         * rand.c: getenv -> g_getenv (windows!)
19008
19009         * process.c: complete_path is also used on non-windows platforms.
19010
19011 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19012
19013         * icall.c: new signature for Process_Start.
19014
19015         * process.[ch]: new signature for Process_Start. If we're on windows
19016         and UseShellExecute is false, we have to search for the program by
19017         ourselves if we don't get a full path.
19018
19019 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
19020
19021         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
19022         marshalling and call CleanUpNativeData if needed. Fixes #58646.
19023
19024 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19025
19026         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
19027         Fixes bug #58373.
19028
19029 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19030
19031         * process.c: use double quotes to quote program name and arguments on
19032         windows. Fixes bug #58575.
19033
19034 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19035
19036         * file-io.c: don't return "." and ".." when using windows Find*File.
19037
19038 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
19039
19040         * marshal.c: Don't pass wrappers to message init because method 
19041         addressed used to lookup metadata. part of remoting[2|3] fix.
19042
19043 2004-05-15  Jackson Harper  <jackson@ximian.com>
19044
19045         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
19046         path is essentially the same as MONO_PATH except that it points to
19047         GACs instead of lib directories.
19048         * loader.h: The user gac is gone so we dont need function to
19049         enable/disable it.
19050         * mono-config.c: user gac option is now gone.
19051         
19052 2004-05-15  Jackson Harper  <jackson@ximian.com>
19053
19054         * culture-info.h: Make defines more consistent, add calendar data
19055         to the culture info table.
19056         * culture-info-tables.h: Add basic calendar data. Basically
19057         everyone gets default gregorian until all the data is
19058         updated.
19059         * locales.c: Use the new consistent defines. Set calendar data for
19060         culture info objects.
19061         * object.h: add a field for calendar data to CultureInfo
19062         
19063 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
19064
19065         * image.c: image->runtime_invoke_cache is keyed on signatures now.
19066         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
19067         a signature.
19068         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
19069         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
19070         an extra param that is the pointer of the method to invoke. The IL for
19071         the invoke method is no longer specific to the method, but to the
19072         signature of the method. Thus, we can share the same code for multiple
19073         methods. This reduces the number of methods that have to be compiled.
19074
19075 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
19076
19077         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
19078
19079         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
19080
19081         * icall.c: Optimize Buffer.BlockCopy.
19082
19083 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19084
19085         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
19086         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
19087         quote). Changed them to "MMMM yyyy".
19088
19089 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
19090
19091         * rand.c
19092         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
19093
19094 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
19095
19096         * reflection.h: Updated after changes to managed structures.
19097
19098         * appdomain.c: Bump corlib version.
19099
19100 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19101
19102         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
19103         windows.
19104
19105 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19106
19107         * Makefile.am: link to ../os/libmonoos.la on windows.
19108
19109         * assembly.c:
19110                 -If MONO_DEBUG, warn about non-existing directories in
19111                 MONO_PATH.
19112                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
19113                 compile time variable.
19114                 -Removed init_default_path and call mono_set_rootdir from
19115                 libmonoos.a instead (windows only).
19116
19117         * assembly.h: declare mono_assembly_getrootdir().
19118
19119         * domain.c:
19120         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
19121
19122         * loader.c: s/getenv/g_getenv/
19123
19124 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
19125
19126         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
19127
19128         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
19129
19130         * metadata.h: Add new marshalling conversions.
19131
19132         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
19133         function.
19134
19135         * reflection.c (mono_reflection_get_type): Lookup the type in all
19136         modules of a multi-module assembly. Fixes #58291.
19137
19138 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
19139
19140         * threads.c: Before aborting a background, set the StopRequested
19141         state.  This avoids throwing the Abort exception.
19142         In mono_thread_manage, don't continue with the shutdown until all
19143         aborted threads have actually stopped.
19144
19145 2004-05-10  Jackson Harper  <jackson@ximian.com>
19146
19147         * locales.c: Remove the modifier from culture names.
19148         
19149 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19150
19151         * Makefile.am: monosn is not installed any more. It has been deprecated
19152         in favor of sn.
19153
19154 2004-05-07  Jackson Harper  <jackson@ximian.com>
19155
19156         * locales.c
19157         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
19158         Fix array construction, add bailout if the length is 0.
19159
19160 2004-05-07  Dick Porter  <dick@ximian.com>
19161
19162         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
19163         machine doesn't have a DNS entry.  Patch by Urs Muff
19164         (umuff@quark.com), fixes bug 57928.
19165
19166 2004-05-06  Jackson Harper  <jackson@ximian.com>
19167
19168         * reflection.c: Handle null PublicTokens properly. alloc mem for
19169         assembly names culture so we dont crash when freeing it.
19170         
19171 2004-05-06  Jackson Harper  <jackson@ximian.com>
19172
19173         * assembly.c: Check the usergac when loading with partial names.
19174         
19175 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
19176
19177         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
19178         does nothing for now (not required for Linux/Windows) but the class
19179         library can call it (and a newer or modified runtime could need it).
19180         * icall.c: Registred icall.
19181
19182 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19183
19184         * loader.c: prints a message on module loading error we set MONO_DEBUG
19185         environment variable.
19186
19187 2004-05-05  Jackson Harper  <jackson@ximian.com>
19188
19189         * appdomain.c: Handle PublicKeyToken=null properly.
19190         
19191 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
19192
19193         * environment.c|h: Added icall ves_icall_System_Environment_
19194         GetOSVersionString to get the current OS version as a string.
19195         * icall.c: Registred icall.
19196
19197 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
19198
19199         * object.c: in mono_object_get_virtual_method(), take into account that
19200         non-virtual methods don't have a slot in the vtable. Check needed when
19201         the object is a proxy.
19202
19203 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
19204
19205         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
19206         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
19207
19208         * object.c (mono_class_compute_gc_descriptor): Fix warning.
19209
19210         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
19211         passed when a valuetype is expected.
19212
19213         * object.c (mono_unhandled_exception): Only set the exit code if the
19214         exception happens in the main thread. Fixes thread5.exe.
19215
19216         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
19217         invalid names. Fixes #58047.
19218
19219 2004-05-03  Jackson Harper  <jackson@ximian.com>
19220
19221         * assembly.c: This line was committed accidently and is unneeded.
19222         
19223 2004-05-03  Jackson Harper  <jackson@ximian.com>
19224
19225         * icall.c: Add new icall for Assembly::LoadWithPartialName
19226         * assembly.c/.h: new function that probes the GAC to load partial
19227         assembly names by Paolo Molaro.
19228         
19229 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19230
19231         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
19232         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
19233         (type_get_fully_qualified_name): Added PublicKeyToken when building a
19234         full type name.
19235
19236 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19237
19238         * appdomain.c: fixed check for 'neutral' culture and removed warning.
19239         * reflection.c: fix bug when parsing a full type name and Version is not
19240         the last thing in the string.
19241
19242 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
19243
19244         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
19245         crashes when it is freed.
19246
19247 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19248
19249         * assembly.c: print the compat warning to stderr.
19250
19251 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
19252
19253         * assembly.c (mono_assembly_load_references): Add a compatibility
19254         hack to run old applications that might be still referencing the
19255         3300-based assemblies, only do this for System.xxx.
19256
19257 2004-05-01  Jackson Harper  <jackson@ximian.com>
19258
19259         * appdomain.c: If the culture is neutral we set it to "".
19260         
19261 2004-04-29  Jackson Harper  <jackson@ximian.com>
19262
19263         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
19264
19265 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
19266  
19267         * string-icalls.c: added low overhead function for copying chars
19268         * icall.c: added needed icall for the above function
19269  
19270 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19271
19272         * icall.c: fix return value of get_global_assembly_cache.  Implemented
19273         Environment.GetLogicalDrives.
19274
19275 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
19276
19277         * rand.c: try and talk to egd or prngd
19278         for random bytes if opening devices fail.
19279
19280 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
19281
19282         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
19283         alignment for the type using the native alignment of its members 
19284         instead of using klass->min_align.
19285
19286         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
19287
19288 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19289
19290         * file-io.c:
19291         * socket-io.c: added check for sys/aio.h.
19292
19293 2004-04-28  Dick Porter  <dick@ximian.com>
19294
19295         * threads.c: Don't abort a thread thats already aborting, when
19296         terminating everything.
19297
19298 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19299
19300         * icall.c: added 2 new async calls for Socket.
19301
19302         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
19303         IO on *nix systems.
19304
19305         * threadpool.c: removed unused variable.
19306
19307 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
19308
19309         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
19310
19311 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
19312
19313         * locales.c: put back string_invariant_tolower () and
19314         string_invariant_toupper ().
19315
19316 2004-04-26 David Waite <mass@akuma.org>
19317
19318         * file-io.h:
19319         * socket-io.h:
19320         * threads.h:
19321         * unicode.h: remove comma from end of enumeration declarations
19322
19323 2004-04-26 David Waite <mass@akuma.org>
19324
19325         * debug-mono-symfile.h:
19326         * decimal.c:
19327         * mono_debug.h:
19328         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
19329
19330
19331 2004-04-26  Jackson Harper  <jackson@ximian.com>
19332
19333         * appdomain.c: Increment version number.
19334         
19335 2004-04-26  Jackson Harper  <jackson@ximian.com>
19336
19337         * appdomain.c: Set assembly references public token value when
19338         PublicKeyToken is specified, not the hash_value. Free public token
19339         values when free assembly name data. Previously the public key
19340         token was hex decoded, however we are using hex encoded public key
19341         tokens, so this is not neccasary.
19342         * assembly.c: Lookup assemblies in the gac if their public token
19343         value is set. Add function to allow enabling user gac
19344         lookups. Specify whether or not the assembly was loaded from the
19345         GAC. Compare full assembly names when checking the cache for
19346         assemblies (Temporarily disabled see comment in code). Remove
19347         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
19348         specifies trace-loader they get extra info to stdout on the
19349         loading of assemblies.
19350         * image.h: Add a field for an assembly references public token
19351         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
19352         whether an assembly has been loaded from the GAC.
19353         * image.c: Remove a corlib -> mscorlib name mapping.
19354         * loader.h: Add function to enable/disable the user gac.
19355         * mono-config.c: Check if the usergac is enabled in the config
19356         file.
19357         * icall.c: New icall to determine whether or not an assembly has
19358         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
19359         * tabldefs.h: Add constant for assemblyref flag that specifies a
19360         full public key is used instead of a public token.
19361         * reflection.c: Remove mscorlib -> corlib mappings. Set
19362         PublicTokenValue instead of hash value. This value is a hex
19363         string so it does not need to be expanded.
19364
19365 2004-04-26  Martin Baulig  <martin@ximian.com>
19366
19367         * mono-debug-debugger.c (mono_debugger_initialize): Set
19368         `mono_debugger_initialized' before calling mono_debug_lock().
19369
19370 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
19371
19372         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
19373           InternalToUpper/InternalToLower.
19374         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
19375           removed invariant culture shortcut.  This is now done in managed code.
19376         * locales.c: (string_invariant_toupper/tolower) removed.
19377
19378 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19379
19380         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
19381         Added Poll internal call.
19382
19383         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
19384         call for Poll. Select was too heavy for polling a single socket.
19385
19386         * threadpool.[ch]: added mono_threadpool_cleanup.
19387         * threads.c: use it. Don't use Thread_Abort on windows.
19388
19389 2004-04-23  Martin Baulig  <martin@ximian.com>
19390
19391         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
19392
19393 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
19394
19395         * icall.c: Registred new icalls for key pair protection and added an
19396         icall for Environment.GetFolderPath on Windows.
19397         * security.c|h: Added new icalls for key pair protection.
19398
19399 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19400
19401         * socket-io.c: don't display the non-supported family warning for known
19402         families. Now this is not displayed on windows when checking support
19403         for IPv4/IPv6.
19404
19405 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19406
19407         * class.c: don't display the layout warning for static fields.
19408
19409 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
19410
19411         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
19412         * locales.c, locales.h: Added new icalls for culture-specific
19413         Char.ToLower and Char.ToUpper.
19414
19415 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19416
19417         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
19418         by David Waite.
19419
19420 2004-04-20  Martin Baulig  <martin@ximian.com>
19421
19422         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
19423         of the type name before passing it to mono_reflection_type_from_name().
19424
19425 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
19426
19427         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
19428         encodings here. Fixes #56965.
19429
19430 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
19431
19432         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
19433         fix test on strstr result not that I can see anything that
19434         relies on the result.
19435
19436 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
19437
19438         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
19439         Fixes #57081.
19440
19441         * marshal.c (mono_marshal_get_string_encoding): New helper function.
19442
19443         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
19444         function to determine which marshalling to use for strings. Fixes
19445         #56965.
19446
19447         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
19448
19449         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
19450
19451 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
19452
19453         * icall.c: #include mono-config.h
19454
19455 2004-04-15  Jackson Harper  <jackson@ximian.com>
19456
19457         * culture-info-tables.h: Fix date formats for en-US culture.
19458         
19459 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
19460
19461         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
19462         ThreadPool.SetMinThreads.
19463         * threadpool.c: Implemented ThreadPool.GetMinThreads and
19464         ThreadPool.SetMinThreads.
19465
19466 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
19467
19468         * mono-config.c: also load the .config file in the directory
19469         where the assembly was found.
19470
19471 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
19472
19473         * assembly.c: load per-assembly config files.
19474         * icall.c: decrapified code to get the config dir and moved to
19475         mono-config.c.
19476         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
19477         per-assembly config files. When doing a dll map lookup give precedence
19478         to the per-assembly data.
19479
19480 2004-04-14  Martin Baulig  <martin@ximian.com>
19481
19482         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
19483         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
19484         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
19485
19486         * mono-debugger-debugger.c: While the debugger is locked, remember
19487         whether the symbol tables have changes and send one single
19488         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
19489
19490 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
19491
19492         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
19493
19494         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
19495         function.
19496
19497         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
19498         account when marshalling string arrays. Fixes #56965.
19499
19500 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
19501
19502         * icall.c: Add new icalls mapping for security.
19503         * security.c|h: Add internal calls for WindowsIdentity,
19504         WindowsImpersonationContext and WindowsPrincipal.
19505
19506 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
19507
19508         * class.c: Added comment to ensure the System.MonoDummy class
19509         is removed when no longer necessary
19510
19511 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
19512
19513         * appdomain.c: Pass arguments to the bootstraping exceptions to
19514         minimize JITed methods at boot
19515
19516         * metadata.c (mono_exception_from_name_two_strings): Allow for the
19517         second string to be null.
19518
19519         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
19520         Change the protocol to minimize the JIT methods at startup.  Now
19521         it Returns the internal codepage, if the value of "int_code_page"
19522         is 1 at entry, and we can not compute a suitable code page
19523         number, returns the code page as a string.
19524
19525 2004-04-13  Jackson Harper  <jackson@ximian.com>
19526
19527         * culture-info-tables.h: Fix number of decimal digits for all
19528         english locales.
19529
19530 2004-04-13  Jackson Harper  <jackson@ximian.com>
19531
19532         * icall.c: Clairfy out of sync error message. It is not always
19533         your corlib that is out of sync.
19534
19535 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
19536
19537         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
19538         properties when only the set accessor is overriden. Fixes #55874.
19539
19540 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
19541
19542         * assembly.c (mono_assembly_load_references): Make this thread safe.
19543         Fixes #56327.
19544
19545 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
19546
19547         * monosn.c: Add missing initialization calls.
19548
19549 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
19550
19551         * locales.c:
19552         ves_icall_System_Globalization_CultureInfo_construct_number_format
19553         Fix g_assert so it compiles on fussier compilers re int/ptr
19554         mismatch
19555
19556 2004-04-08  Dick Porter  <dick@ximian.com>
19557
19558         * socket-io.h:
19559         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
19560         53992.  Also rearrange the code so that the internal calls return
19561         an error value and exceptions are thrown from managed code.
19562
19563         * icall.c: Add type info to the socket icalls.
19564
19565 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19566
19567         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
19568         owes me a beer.
19569
19570 2004-04-07  Martin Baulig  <martin@ximian.com>
19571
19572         * class.c (mono_class_from_generic_parameter): Don't default
19573         `klass->parent' to `mono_defaults.object_type'.
19574
19575 2004-04-07  Martin Baulig  <martin@ximian.com>
19576
19577         * reflection.c (mono_reflection_initialize_generic_parameter): Set
19578         `param->pklass->reflection_info'.       
19579
19580 2004-04-07  Jackson Harper  <jackson@ximian.com>
19581
19582         * culture-info-tables.h: Fix date separator symbol.
19583         
19584 2004-04-07  Martin Baulig  <martin@ximian.com>
19585
19586         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
19587         from System.Type to System.MonoType.
19588
19589 2004-04-07  Martin Baulig  <martin@ximian.com>
19590
19591         * reflection.h
19592         (MonoReflectionGenericParam): Added `has_reference_type' and
19593         `has_value_type' fields.
19594
19595         * reflection.c (mono_image_get_generic_param_info): Encode the
19596         correct flags if we have the `class' or `struct' constraint.
19597
19598 2004-04-07  Martin Baulig  <martin@ximian.com>
19599
19600         * reflection.h
19601         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
19602
19603 2004-04-07  Jackson Harper  <jackson@ximian.com>
19604
19605         * appdomain.c: Revert extra patches, just wanted to bump the
19606         version number.
19607         
19608 2004-04-07  Jackson Harper  <jackson@ximian.com>
19609
19610         * Makefile.am: Add culture-info private headers.
19611         * icall.c: Add new icalls for contructing locales.
19612         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
19613         * locales.h: Declare new culture info construction methods.
19614         * object.h: Add new fields used to avoid the CultureMap to
19615         MonoCultureInfo.
19616         * culture-info.h: Definition of structs used in the culture info
19617         tables.
19618         * culture-info-tables.h: Autogenerated tables that contain culture
19619         info data. This file was generated with the locale-builder tool.
19620         * appdomain.c: Incement corlib version number.
19621         
19622 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
19623
19624         * appdomain.c: (mono_runtime_init) move mono_thread_init
19625         to before mono_object_new calls so critical sections
19626         are initialized before use.
19627
19628 2004-04-07  Martin Baulig  <martin@ximian.com>
19629
19630         * icall.c
19631         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
19632         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
19633         (ves_icall_MonoGenericParam_initialize): Removed.
19634         (monogenericparam_icalls): Removed.
19635         (generictypeparambuilder_icalls): Added new table for
19636         System.Reflection.Emit.GenericTypeParameterBuilder.
19637
19638         * reflection.c
19639         (mono_reflection_define_generic_parameter): Removed.
19640         (mono_reflection_initialize_generic_parameter): This is now called
19641         from GenericTypeParameterBuilder's .ctor.
19642
19643 2004-04-06  Martin Baulig  <martin@ximian.com>
19644
19645         * class.c (mono_class_init): Don't inflate nested classes in a
19646         generic instance.
19647         (mono_type_get_name_recurse): Include the generic arguments for
19648         generic instances and generic type declarations.
19649         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
19650         (_mono_class_get_instantiation_name): Removed.
19651         (mono_class_create_generic): Always use `gklass->name' as our name.
19652
19653         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
19654
19655         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
19656         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
19657         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
19658         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
19659         closed generic methods here.
19660
19661         * reflection.c
19662         (mono_reflection_generic_inst_get_nested_types): Removed.
19663         (inflate_mono_method): Copy the generic parameters from the
19664         MonoMethodHeader into out MonoGenericMethod.
19665
19666 2004-04-06  Martin Baulig  <martin@ximian.com>
19667
19668         * row-indexes.h
19669         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
19670
19671         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
19672
19673         * reflection.c (build_compressed_metadata): If we have any entries
19674         in the GenericParam, MethodSpec or GenericParamConstraint tables,
19675         set the header version to 1.1.
19676
19677 2004-04-06  Martin Baulig  <martin@ximian.com>
19678
19679         * class.c (mono_class_init): If we're a generic instance,
19680         initialize our nested classes, too.
19681         (_mono_class_get_instantiation_name): Deal with the new `!%d'
19682         suffix. 
19683
19684 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19685
19686         * process.c: quote the argument passed to the shell on windows.
19687
19688 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
19689
19690         * threads.c (mono_alloc_special_static_data): Allow this to be
19691         called during startup.
19692
19693 2004-04-02  Martin Baulig  <martin@ximian.com>
19694
19695         * icall.c
19696         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
19697
19698 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
19699
19700         * icall.c: Fix build.
19701
19702 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
19703
19704         * Makefile.am: Added security.c|h.
19705         * icall.c: Added icall for get_UserName;
19706         * security.c: New file for security related icalls. Added function
19707         get_UserName for System.Environment (fix #56144).
19708         * security.h: New. Header file for security.c
19709
19710 2004-04-02  Dick Porter  <dick@ximian.com>
19711
19712         * icall.c: Deleted the icalls that were obsoleted some time ago
19713         by the ICU string code, and which were mixed into the icall
19714         rearranging.  Fixes bug 55969.
19715
19716         * string-icalls.h: 
19717         * string-icalls.c: Deleted the code that those icalls reference.
19718
19719 2004-04-01  Martin Baulig  <martin@ximian.com>
19720
19721         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
19722
19723         * class.c (mono_class_from_generic_parameter): Don't set 
19724         TYPE_ATTRIBUTE_INTERFACE.
19725         (my_mono_class_from_generic_parameter): Likewise.
19726
19727 2004-04-01  Martin Baulig  <martin@ximian.com>
19728
19729         * loader.c (find_method): Added an optional `MonoClass *ic'
19730         argument to search in a specific interface.
19731         (mono_get_method_constrained): New public function.
19732
19733 2004-04-01  Martin Baulig  <martin@ximian.com>
19734
19735         * reflection.c (mono_image_get_generic_field_token): Use the
19736         `handleref' cache here.
19737
19738 2004-04-01  Martin Baulig  <martin@ximian.com>
19739
19740         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
19741
19742         * reflection.c (create_generic_typespec): Use the `typespec' hash
19743         here, not the `typeref' one.    
19744
19745 2004-04-01  Martin Baulig  <martin@ximian.com>
19746
19747         * class.c (mono_class_inflate_generic_type): Moved the
19748         functionality into a new static inflate_generic_type() which
19749         returns NULL if it didn't do anything.  Only increment the
19750         `mono_stats.inflated_type_count' if we actually inflated
19751         something.
19752         (mono_class_get_full): Check the classes type to see whether we
19753         need to inflate it; also inflate MONO_TYPE_(M)VAR.
19754
19755 2004-04-01  Jackson Harper  <jackson@ximian.com>
19756
19757         * reflection.c: Set culture for assembly references.
19758         
19759 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
19760
19761         * reflection.[ch], icall.[ch], Fix support for pinning variables.
19762
19763 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19764
19765         * assembly.c:
19766         (do_mono_assembly_open): the critical section also covers
19767         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
19768
19769 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19770
19771         * threads.c:
19772         (mono_manage_threads): abort the background threads when finishing.
19773         Fixes bug #47232.
19774
19775 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19776
19777         * gc.c: only close the done_event handle if there was no timeout.
19778         C-ified comments.
19779
19780 2004-03-30  Martin Baulig  <martin@ximian.com>
19781
19782         * icall.c (icall_entries): It's called "System.Activator", not
19783         "System.Activation".    
19784
19785 2004-03-30  Martin Baulig  <martin@ximian.com>
19786
19787         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
19788         (mono_class_create_from_typespec): Likewise.
19789
19790 2004-03-30  Martin Baulig  <martin@ximian.com>
19791
19792         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
19793         `has_ctor_constraint' and `initialized'.
19794
19795 2004-03-30  Martin Baulig  <martin@ximian.com>
19796
19797         * reflection.c (encode_new_constraint): New static function to add
19798         the constructor constraint attribute to a type parameter.
19799         (encode_constraints): Call encode_new_constraint() if necessary.
19800
19801         * reflection.h
19802         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
19803
19804         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
19805         
19806 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
19807
19808         * reflection.c, icall.c: add support for pinning variables. 
19809
19810 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
19811
19812         * marshal.c (mono_marshal_get_managed_wrapper):
19813         init bool local with zero rather than null.
19814
19815 2004-03-29  Martin Baulig  <martin@ximian.com>
19816
19817         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
19818         the "official" behavior here.
19819         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
19820
19821 2004-03-29  Martin Baulig  <martin@ximian.com>
19822
19823         * icall.c: Reflect latest API changes.
19824
19825 2004-03-29  Martin Baulig  <martin@ximian.com>
19826
19827         * loader.c (mono_get_method_from_token): Also call
19828         mono_metadata_load_generic_params () for abstract and interface
19829         methods; replace the type arguments in the method signature with
19830         the ones which are loaded from the metadata.
19831
19832 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
19833
19834         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
19835         of the lock is not the current thread. MS.NET don't do it, in spite of
19836         what the documentation says. See bug #56157.
19837
19838 2004-03-28  Martin Baulig  <martin@ximian.com>
19839
19840         * class.c (mono_class_init): Don't call init_properties() and
19841         init_events() for generic instances; set `prop->parent' when
19842         inflating properties.
19843
19844         * reflection.c (mono_generic_inst_get_object): Call
19845         `mono_class_init (ginst->klass)'.
19846         (mono_type_get_object): Only create a MonoGenericInst if your
19847         generic type is a TypeBuilder.
19848         (do_mono_reflection_bind_generic_parameters): Only set
19849         `ginst->is_dynamic' if our generic type is a TypeBuilder.
19850
19851 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
19852
19853         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
19854         Fixes #56091.
19855
19856 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19857
19858         * icall.c: added Kill_internal icall.
19859         * process.[ch]: added Kill_internal icall.
19860
19861 2004-03-25  Martin Baulig  <martin@ximian.com>
19862
19863         * class.h (MonoStats): Added `generic_instance_count',
19864         `inflated_method_count', `inflated_type_count' and
19865         `generics_metadata_size'.       
19866
19867 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19868
19869         * reflection.c: no warnings now.
19870
19871 2004-03-25  Martin Baulig  <martin@ximian.com>
19872
19873         * class.c (mono_class_get_full): New public function; does a
19874         mono_class_get(), but also takes a `MonoGenericContext *'.
19875
19876         * loader.c (mono_field_from_memberref): Renamed to
19877         `field_from_memberref', made static and added `MonoGenericContext *'
19878         argument.
19879         (mono_field_from_token): Added `MonoGenericInst *' argument.
19880         (method_from_memberef): Likewise.
19881         (mono_get_method_from_token): Likewise.
19882         (mono_get_method_full): New public function; does a
19883         mono_get_method(), but also takes a `MonoGenericContext *'.
19884
19885         * verify.c (mono_method_verify): Get the method's generic context
19886         and pass it to mono_field_from_token(), mono_get_method_full() and
19887         mono_class_get_full().
19888
19889 2004-03-25  Martin Baulig  <martin@ximian.com>
19890
19891         * class.c (mono_class_inflate_generic_type): Take a
19892         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
19893         `MonoGenericMethod *'.
19894
19895 2004-03-25  Martin Baulig  <martin@ximian.com>
19896
19897         * loader.h (MonoMethodInflated): Store the MonoGenericContext
19898         instead of the MonoGenericMethod here.
19899
19900 2004-03-25  Martin Baulig  <martin@ximian.com>
19901
19902         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
19903         each time we create a new MonoGenericInst, we also create a new
19904         context which points back to us.
19905
19906         * class.c (inflate_method): Use `ginst->context' instead of
19907         creating a new context.
19908
19909         * loader.c (method_from_memberref): Use
19910         `klass->generic_inst->context' instead of creating a new context.
19911
19912 2004-03-25  Martin Baulig  <martin@ximian.com>
19913
19914         * class.h (MonoGenericContext): New struct.
19915         (MonoGenericMethod): Removed `generic_inst'.
19916
19917         * class.c (mono_class_inflate_generic_method): Take a
19918         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
19919
19920 2004-03-25  Martin Baulig  <martin@ximian.com>
19921
19922         * loader.h (MonoMethodInflated): New typedef.
19923
19924         * metadata.h (MonoMethodSignature): Removed `gen_method', make
19925         `generic_param_count' consume just 30 bits, added `is_inflated'
19926         and `has_type_parameters' flags (one bit each).
19927
19928         * class.c (mono_class_inflate_generic_method): Create a
19929         MonoMethodInflated instead of a MonoMethodNormal and set
19930         `is_inflated' in the method signature.
19931
19932         * class.h (MonoGenericMethod): Removed `generic_method'.
19933
19934 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
19935
19936         * image.c: Make sure the name of a MonoImage is always an absolute path.
19937           This fixes bug #54415.
19938
19939 2004-03-24  Martin Baulig  <martin@ximian.com>
19940
19941         * class.c (mono_class_setup_vtable): If we're a generic instance,
19942         use our generic type's vtable size.
19943
19944 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
19945
19946         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
19947         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
19948         problems.
19949
19950 2004-03-23  Martin Baulig  <martin@ximian.com>
19951
19952         * class.h (MonoDynamicGenericInst): Added `int count_events' and
19953         `MonoEvent *events'.
19954
19955         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
19956         (typebuilder_icalls): Added "get_event_info"; calls
19957         mono_reflection_event_builder_get_event_info(). 
19958
19959         * reflection.c (mono_reflection_generic_inst_initialize): Added
19960         `MonoArray *events'.
19961         (mono_reflection_event_builder_get_event_info): New function.
19962
19963 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
19964
19965         * object.h: add mono_type_initialization_init
19966
19967         * object.c (mono_runtime_class_init): 
19968         implement class constructor synchronization rules
19969         to cope with threading issues.  
19970         add mono_type_initialization_init
19971
19972         * appdomain.c (mono_runtime_init): call 
19973         mono_type_initialization_init
19974
19975         * class.h: removing initializing field from MonoVTable
19976
19977 2004-03-23  Martin Baulig  <martin@ximian.com>
19978
19979         * class.c (my_mono_class_from_generic_parameter): Use
19980         `param->name' if it's not NULL. 
19981
19982 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
19983
19984         * class.c: do not insert non-virtual methods in the vtable.
19985         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
19986         that means the method is non-virtual. This never would have
19987         happened before.
19988
19989 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
19990
19991         * profiler.c: Added lock for accessing coverage_hash.
19992
19993 2004-03-22  Martin Baulig  <martin@ximian.com>
19994
19995         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
19996         `method->method->signature->generic_param_count != 0' to make it
19997         work for interface methods.
19998
19999 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20000
20001         * process.c: quote the string passed to the shell using g_shell_quote.
20002
20003 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20004
20005         * threads.c:
20006         (mono_threads_manage): don't remove the finalizer thread and self
20007         from the threads hash table so that mono_thread_manage can be called
20008         more than once.
20009
20010 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20011
20012         * process.c: quote the arguments when UseShellExecute is true. Fixes
20013         bug #55790.
20014
20015 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20016
20017         * threads.c: set mono_thread_detach as a cleanup routine for every
20018         thread. This way it's always executed upon thread termination, either
20019         aborted or finished normally. No more xsp hangs!
20020
20021 2004-03-17  Martin Baulig  <martin@ximian.com>
20022
20023         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
20024         `int count_nested' and a `MonoType **nested'.
20025
20026         * reflection.c (mono_reflection_bind_generic_parameters): Moved
20027         most of the functionality into a new static
20028         do_mono_reflection_bind_generic_parameters() and don't take a
20029         `MonoType *nested_in' argument any more.  Don't compute nested
20030         types here.
20031         (mono_reflection_generic_inst_get_nested_types): New public method
20032         to get nested types.
20033
20034         * class.c (mono_class_create_generic): Set `klass->nested_in' if
20035         we're a nested class.
20036
20037         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
20038         mono_reflection_generic_inst_get_nested_types() to compute the
20039         nested types.
20040
20041 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
20042
20043         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
20044         descriptive error message under windows.
20045         
20046 2004-03-17  Martin Baulig  <martin@ximian.com>
20047
20048         * class.c (dup_type): Added `const MonoType *original' argument;
20049         copy the attrs from the original type.
20050
20051 2004-03-17  Martin Baulig  <martin@ximian.com>
20052
20053         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
20054         `m->generic_inst_cache' here.
20055
20056 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
20057
20058         * exception.h exception.c: Add stack_overflow_exception.
20059
20060 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20061
20062         * threadpool.c:
20063         (overlapped_callback): call SetEvent *after* invoking the callback.
20064         No need to call CloseHandle.
20065
20066 2004-03-16  Martin Baulig  <martin@ximian.com>
20067
20068         * reflection.c (mono_image_get_fieldref_token): Take a
20069         `MonoReflectionField *' instead of a `MonoClassField *' and a
20070         `MonoClass *'; store the `MonoReflectionField *' in the hash.
20071
20072 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20073
20074         * appdomain.c: don't add the culture to the filename we're looking for
20075         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
20076
20077 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20078
20079         * locales.c: don't ignore symbols when doing case insensitive compares.
20080         Thanks Dick! Fixes bug #54046.
20081
20082         * threads.c: surround 'threads' usage with enter/leave in
20083         mono_thread_manage.
20084
20085 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
20086
20087         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
20088         implicitly marshalled as [Out]. Fixes #55450.
20089
20090         (mono_marshal_get_runtime_invoke): Zero out the result if there is
20091         an exception.
20092
20093 2004-03-16  Martin Baulig  <martin@ximian.com>
20094
20095         * class.c (mono_class_from_generic_parameter): Use the actual
20096         parameter name. 
20097
20098 2004-03-16  Martin Baulig  <martin@ximian.com>
20099
20100         * reflection.c (type_get_signature_size): New static function.
20101         Compues the size of the type in a method signature.
20102         (method_get_signature_size): New static function; calls
20103         type_get_signature_size() to compute the actual size of the
20104         method's signature.
20105         (method_encode_signature): Use method_get_signature_size() to get
20106         the signature's size rather than using `nparams * 10'.
20107
20108 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20109
20110         * file-io.h: define here WapiOverlapped on windows. I don't want the
20111         regular OVERLAPPED one.
20112
20113         * file-io.c:
20114         * threadpool.c: somehow, BindIoCompletionCallback is not found.
20115         Disabling AIO on windows.
20116
20117 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20118
20119         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
20120         bug #55385.
20121
20122 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20123
20124         * appdomain.c: upgraded corlib version.
20125
20126         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
20127         and BeginWrite. Allow opening files for asynchrnous operations.
20128
20129         * file-io.h: new struct that maps FileStreamAsyncResult.
20130         * icall.c: added new icalls.
20131         * process.[ch]: support setting child process environment variables
20132         and use the SHELL or COMSPEC when UseShellExecute is true.
20133
20134         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
20135         callback for async. IO is here and also BindHandle.
20136
20137         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
20138         from here.
20139
20140 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
20141
20142         * reflection.c (create_custom_attr): Allow len == 0.
20143
20144         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
20145         computation on big-endian machines.
20146
20147 2004-03-13  Martin Baulig  <martin@ximian.com>
20148
20149         * class.h (MonoGenericInst): Added `int count_ifaces'.
20150
20151         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
20152         `ginst->count_ifaces' instead `klass->interface_count' since we
20153         may get called before the vtable is created.
20154
20155         * loader.c (mono_method_get_param_names): If we're a generic
20156         instance, return and don't initialize the class.
20157
20158         * reflection.c (mono_reflection_setup_generic_class): Don't call
20159         ensure_runtime_vtable().
20160         (mono_reflection_bind_generic_parameters): Set
20161         `ginst->count_ifaces'.
20162
20163 2004-03-11  Jackson Harper <jackson@ximian.com>
20164
20165         * icall.c:
20166         * unicode.c:
20167         * unicode.h: Remove unused System.Char icalls.
20168         
20169 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
20170
20171         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
20172         code when we P/Invoke the first library in Windows.Forms, instead
20173         of when we first open the assembly.
20174
20175         * assembly.c: Drop the lookup from here.
20176
20177 2004-03-10  Martin Baulig  <martin@ximian.com>
20178
20179         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
20180         class for properties, fields and events.  Finally fixes #54945.
20181
20182 2004-03-10  Martin Baulig  <martin@ximian.com>
20183
20184         * metadata.c (mono_metadata_class_equal): New static function;
20185         checks whether two generic instances or two generic parameters are
20186         equal.
20187         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
20188         compare classes.        
20189
20190 2004-03-10  Martin Baulig  <martin@ximian.com>
20191
20192         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
20193
20194         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
20195         argument and write it into the `reflection_info' field.
20196
20197         * icall.c
20198         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
20199         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
20200
20201 2004-03-09  Jackson Harper  <jackson@ximian.com>
20202
20203         * char-conversions.h: use 8 bits for numeric data its all we need
20204         * icall.c: numeric data is only 8 bits now.
20205
20206 2004-03-09  Martin Baulig  <martin@ximian.com>
20207
20208         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
20209
20210         * class.c (init_properties, init_events): Initialize the new
20211         `parent' field.
20212
20213         * reflection.c (typebuilder_setup_properties): Likewise.
20214         (typebuilder_setup_events): Likewise.
20215
20216         * reflection.h (MonoEventInfo): Replaced `parent with
20217         `declaring_type' and `reflected_type'.
20218
20219         * icall.c (ves_icall_get_property_info): Distinguish between
20220         declaring and reflected type.
20221         (ves_icall_get_event_info): Likewise.
20222
20223 2004-03-09  Martin Baulig  <martin@ximian.com>
20224
20225         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
20226         (ves_icall_Type_GetField): Correctly set field->klass.
20227
20228 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
20229
20230         * loader.h: Fix warning.
20231
20232 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
20233
20234         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
20235         library routine if present.  Notice that it will still continue
20236         executing even if its missing, for those working on the Gtk#
20237         edition of Windows.Forms.
20238
20239         * assembly.c (do_mono_assembly_open): If loading the
20240         System.Windows.Forms call mono_loader_wini_init.
20241
20242 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
20243
20244         * class.h: Added MonoRemoteClass struct.
20245         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
20246         function for MonoStrings.
20247         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
20248         Added internal call for getting the proxy type.
20249         * marshal.c: Get the type of transparent proxies from its remote_class.
20250         Added methods that generate the IL for type checks and casts:
20251         mono_marshal_get_isinst, mono_marshal_get_castclass, 
20252         mono_marshal_get_proxy_cancast.
20253         * marshal.h: Declaration of the previous new methods.
20254         * object.c: Added new moethods for creating and updating MonoRemoteClass
20255         instances: mono_remote_class, mono_upgrade_remote_class, 
20256         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
20257         * verify.c: FIx transparent_proxy_fields layout.
20258         * appdomain.c: Bump corlib version.
20259
20260 2004-03-04  Jackson Harper  <jackson@ximian.com>
20261
20262         * icall.c: Add icall to access char conversion tables.
20263         * char-conversions.h: Character conversion tables.
20264         * Makefile.am: Add char-conversions.h private header file.
20265         
20266 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
20267
20268         * appdomain.c (unload_thread_main): Increase unloading timeout to
20269         10 sec as a temporary workaround for Nant problems.
20270
20271 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
20272
20273         * gc.c: Add checks for GC_enable and GC_disable.
20274
20275         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
20276         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
20277         (bug #54988).
20278         
20279 2004-02-27  Martin Baulig  <martin@ximian.com>
20280
20281         * reflection.c (mono_reflection_bind_generic_parameters): Take a
20282         `MonoReflectionType *' instead of a `MonoType *'.
20283
20284 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
20285
20286         * gc.c (run_finalize): Avoid finalizing the object representing the
20287         finalizer thread.
20288         (finalizer_thread): Fix warning.
20289
20290 2004-02-25  Martin Baulig  <martin@ximian.com>
20291
20292         * class.c (_mono_class_get_instantiation_name): Added `int offset'
20293         argument for nested types.
20294         (mono_class_create_generic): Added support for nested generictypes.
20295
20296         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
20297         `GList *nested'.
20298
20299         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
20300
20301         * reflection.c (method_encode_signature): Increase the minimum
20302         value of `size' from 10 to 11.
20303         (mono_reflection_bind_generic_parameters): Take `int type_argc'
20304         and `MonoType **types' arguments instead of the `MonoArray
20305         *types'; added `MonoType *nested_in'.  Recursively instantiate
20306         nested classes. 
20307
20308 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
20309
20310         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
20311         stack_overflow_ex members which are used by exception handling.
20312
20313         * appdomain.c (mono_runtime_init): Initialize the new members.
20314
20315         * gc.c (mono_gc_enable): New helper function.
20316         * gc.c (mono_gc_disable): New helper function.
20317
20318 2004-02-23  Martin Baulig  <martin@ximian.com>
20319
20320         * icall.c: I must have been really stupid - make it actually work
20321         this time ;-)
20322
20323 2004-02-23  Martin Baulig  <martin@ximian.com>
20324
20325         * loader.c (method_from_memberref): Only inflate the method if
20326         it's in another klass.
20327
20328 2004-02-23  Martin Baulig  <martin@ximian.com>
20329
20330         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
20331         (mono_class_init): If we're a generic instance and an interface,
20332         compute `class->interface_id'; also create `class->interfaces'
20333         here and inflate them.
20334
20335         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
20336         `ginst->is_open'.
20337         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
20338
20339         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
20340
20341 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
20342
20343         * reflection.c (method_encode_code): Improved the error message
20344         generated by the exception.
20345
20346 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20347
20348         * icall.c: Martin did not do what he said in the ChangeLog for
20349         2004-02-18, but put back the changes for properties and events.
20350         Commenting those changes out again and adding comment to bug #54518.
20351         
20352         * process.c: removed warning.
20353
20354 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
20355
20356         * marshal.c (emit_struct_conv): Print an error message instead of
20357         asserting when a type does not have the StructLayout attribute.
20358
20359 2004-02-20  Martin Baulig  <martin@ximian.com>
20360
20361         * reflection.c (mono_type_get_object): Also use the cache for
20362         generic instances.
20363         (mono_reflection_bind_generic_parameters): Always compute
20364         `ginst->ifaces'.        
20365
20366 2004-02-20  Martin Baulig  <martin@ximian.com>
20367
20368         * class.h (MonoGenericMethod): Removed `klass'.
20369
20370         * class.c (mono_class_inflate_generic_method): Added `MonoClass
20371         *klass' argument.
20372
20373 2004-02-20  Martin Baulig  <martin@ximian.com>
20374
20375         * reflection.c (method_encode_methodspec): Actually use the
20376         uninflated signature for the memberref.
20377
20378 2004-02-20  Martin Baulig  <martin@ximian.com>
20379
20380         * class.h (MonoGenericMethod): Removed `declaring'.
20381
20382         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
20383         is NULL, compute it here.
20384
20385 2004-02-20  Martin Baulig  <martin@ximian.com>
20386
20387         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
20388
20389         * metadata.c (mono_metadata_generic_inst_hash): New method.
20390         (mono_metadata_generic_inst_equal): New method.
20391
20392         * reflection.c (mono_reflection_bind_generic_parameters): Use the
20393         `klass->image->generic_inst_cache' cache to avoid creating
20394         duplicate MonoGenericInst's.
20395
20396         * class.c (mono_class_inflate_generic_type): Use the cache.
20397
20398 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
20399
20400         * object.c: fixed gc descriptor calculation for embedded valuetypes.
20401
20402 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20403
20404         * icall.c: added Socket.WSAIoctl icall.
20405
20406         * socket-io.[ch]: implemented
20407         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
20408
20409 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
20410
20411         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
20412
20413 2004-02-18  Urs C Muff  <umuff@quark.com>
20414
20415         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
20416         this work on PPC and other big-endian architectures.
20417
20418         * debug-mono-symfile.h: Prepended the names of all the `guint32'
20419         fields with an underscore to make sure they're only accessed by
20420         the read32() macro.
20421
20422 2004-02-18  Martin Baulig  <martin@ximian.com>
20423
20424         * icall.c: Put the klass->refclass changes back for methods and
20425         fields, but not for properties and events.  We're currently not
20426         distinguishing between DeclaringType and ReflectedType for
20427         properties and events, that's what caused the regressions.
20428
20429 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20430
20431         * object.c:
20432         (mono_async_result_new): the handle can be NULL.
20433
20434         * threadpool.c: Use an event instead of a semaphore, don't initialize
20435         it until needed. This saves quite a few semaphores from being created
20436         when using the threadpool.
20437
20438 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
20439
20440         * object.c (mono_string_is_interned_lookup): Fix interning of long
20441         strings. Fixes #54473.
20442
20443         * domain.c (ldstr_equal): Optimize if the two strings are equal.
20444
20445         * icall.c: Revert the klass->refclass changes since they introduce
20446         regressions (bug #54518).
20447
20448 2004-02-18  Martin Baulig  <martin@ximian.com>
20449
20450         * class.c (mono_class_init): If we're a generic instance and don't
20451         come from a TypeBuilder, inflate our members here.
20452         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
20453         (mono_class_create_generic): New public method.
20454         (mono_class_initialize_generic): Removed.
20455         (get_instantiation_name): Renamed to
20456         _mono_class_get_instantiation_name() and made it public.
20457
20458 2004-02-18  Martin Baulig  <martin@ximian.com>
20459
20460         * class.c (mono_class_inflate_generic_type): Clear the new
20461         instance's `nginst->klass' when inflating a generic instance.
20462         (mono_class_is_subclass_of): Added (basic) support for generic
20463         instances.
20464
20465 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
20466
20467         * appdomain.h, domain.c: use a MonoCodeManager instead of a
20468         MonoMempool to hold compiled native code.
20469
20470 2004-02-17  Martin Baulig  <martin@ximian.com>
20471
20472         * class.h (MonoDynamicGenericInst): Added `count_properties' and
20473         `properties'.
20474
20475         * reflection.c (mono_reflection_generic_inst_initialize): Added
20476         `MonoArray *properties' argument.
20477
20478         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
20479
20480 2004-02-17  Martin Baulig  <martin@ximian.com>
20481
20482         * icall.c (ves_icall_Type_GetFields): Renamed to
20483         ves_icall_Type_GetFields_internal() and added a
20484         `MonoReflectionType *rtype' argument; pass it to
20485         mono_field_get_object() to set the field's "reflected" type.
20486         (ves_icall_Type_GetConstructors): Likewise.
20487         (ves_icall_Type_GetEvents): Likewise.
20488         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
20489         argument; pass it to mono_method_get_object() to set the method's
20490         "reflected" type.       
20491
20492 2004-02-17  Martin Baulig  <martin@ximian.com>
20493
20494         * class.h (MonoDynamicGenericInst): New type.
20495         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
20496
20497         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
20498         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
20499         (ves_icall_MonoGenericInst_GetFields): New interncall.
20500
20501         * class.c (mono_class_from_generic): Don't call
20502         mono_class_initialize_generic() if this is a dynamic instance;
20503         ie. it's being created from a TypeBuilder.
20504         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
20505         `class->byval_arg.type'.
20506
20507         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
20508         to `inflate_method' and made static.
20509         (mono_reflection_inflate_field): Removed.
20510         (mono_reflection_generic_inst_initialize): New public method.
20511
20512         * reflection.h (MonoReflectionGenericInst): Removed `methods',
20513         `ctors' and `fields'; added `initialized'.
20514
20515 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
20516
20517         * debug-helpers.c (mono_method_full_name): Fix output for empty
20518         namespaces.
20519
20520 2004-02-12  Martin Baulig  <martin@ximian.com>
20521
20522         * class.h (MonoClassField): Added `MonoType *generic_type'.
20523
20524         * reflection.c (mono_image_get_fieldref_token): Added support for
20525         instantiated generic types.
20526         (field_encode_inflated_field): Removed.
20527         (mono_image_get_inflated_field_token): Removed.
20528         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
20529
20530         * reflection.h (MonoReflectionInflatedField): Removed.
20531
20532 2004-02-12  Martin Baulig  <martin@ximian.com>
20533
20534         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
20535         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
20536
20537         * reflection.c (mono_image_get_methodspec_token): Take a
20538         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
20539         (mono_image_create_token): Check whether we have a
20540         `method->signature->gen_method' and call
20541         mono_image_get_methodspec_token() if appropriate.
20542         (inflated_method_get_object): Removed.
20543         (mono_reflection_bind_generic_method_parameters): Return a
20544         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
20545         (mono_reflection_inflate_method_or_ctor): Likewise.
20546
20547         * reflection.h (MonoReflectionInflatedMethod): Removed.
20548
20549 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
20550
20551         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
20552         for custom valuetype marshalling.
20553
20554         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
20555
20556 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20557
20558         * icall.c: fixed WSAGetLastError_internal name.
20559
20560 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
20561
20562         * threads.c (mono_thread_attach): Allow this to be called multiple
20563         times for a thread.
20564         
20565         * threads.c (build_wait_tids): Do not wait for ourselves.
20566
20567         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
20568         appdomain list is empty.
20569
20570         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
20571         memory returned by mono_string_builder_to_utf16, since it points into
20572         managed memory. Thanks to Bernie Solomon for noticing this.
20573
20574         * icall.c: Add AppDomainSetup icalls.
20575
20576         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
20577
20578         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
20579         types.
20580
20581         * reflection.c (reflection_methodbuilder_to_mono_method): Save
20582         custom attributes to the method_aux struct. Also fix array indexes etc.
20583
20584         * loader.c (mono_method_get_param_names): Make dynamic case work again.
20585         
20586 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
20587
20588         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
20589         (both static and runtime) and reduce startup time.
20590
20591 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
20592
20593         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
20594         AsAny marshalling conversion instead of crashing.
20595
20596         * marshal.c: Fix warnings.
20597
20598 2004-02-09  Martin Baulig  <martin@ximian.com>
20599
20600         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
20601
20602         * reflection.h (MonoReflectionInflatedMethod): Removed the
20603         `declaring' field, it's now in the unmanaged MonoGenericMethod.
20604
20605         * reflection.c (method_encode_methodspec): Removed the `method'
20606         argument; we get it from `gmethod->declaring'.
20607         (inflated_method_get_object): Removed the `declaring' argument.
20608
20609 2004-02-09  Martin Baulig  <martin@ximian.com>
20610
20611         * class.h (MonoGenericMethod): New type.
20612         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
20613         `generic_method'.
20614
20615         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
20616         a `MonoGenericMethod *gen_method' one.
20617
20618         * class.c (mono_class_inflate_generic_type): Take an additional
20619         `MonoGenericMethod * argument.  This is only non-NULL if we're
20620         inflating types for a generic method.   
20621         (mono_class_inflate_generic_signature): Renamed to
20622         inflate_generic_signature() and made static; take a
20623         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
20624         (inflate_generic_header): Take a `MonoGenericMethod *' argument
20625         instead of a `MonoGenericInst *' one.
20626         (mono_class_inflate_generic_method): Likewise.
20627
20628         * reflection.c (encode_generic_method_sig): Take a
20629         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
20630         (method_encode_methodspec): Likewise.
20631         (inflated_method_get_object): Likewise. 
20632
20633         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
20634         field with a `MonoGenericMethod *gmethod' one.  
20635
20636 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
20637
20638         * class.h (mono_class_has_parent): add parens to expansion
20639         so you can ! this.
20640
20641 2004-02-08  Martin Baulig  <martin@ximian.com>
20642
20643         * image.h (MonoImage): Removed `generics_cache'.
20644
20645         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
20646         instead of a `MonoType *' argument; removed the `inflate_methods'
20647         argument.  Don't inflate methods here.
20648
20649         * loader.c (find_method): If it's a generic instance, call
20650         mono_class_init() on the `sclass->generic_inst->generic_type'.
20651
20652         * metadata.c (mono_type_size): Make this work on uninitialized
20653         generic instances; call it on the `ginst->generic_type's class.
20654
20655         * reflection.c (mono_reflection_bind_generic_parameters): Call
20656         mono_class_from_generic() to create the `ginst->klass'.
20657
20658 2004-02-08  Martin Baulig  <martin@ximian.com>
20659
20660         * class.h (MonoClass): Changed type of `generic_inst' from
20661         `MonoType *' to `MonoGenericInst *'.
20662
20663 2004-02-08  Martin Baulig  <martin@ximian.com>
20664
20665         * icall.c (ves_icall_Type_BindGenericParameters): Just call
20666         mono_type_get_object(), this is now creating a `MonoGenericInst'
20667         for MONO_TYPE_GENERICINST.
20668         (ves_icall_MonoGenericInst_GetParentType): Likewise.
20669         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
20670
20671         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
20672         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
20673         (inflated_method_get_object): Added `MonoClass *refclass' argument.
20674         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
20675         and reflected type.
20676
20677         * reflection.h (MonoReflectionInflatedMethod): Removed
20678         `declaring_type' and `reflected_type'.
20679
20680 2004-02-08  Martin Baulig  <martin@ximian.com>
20681
20682         * class.h (MonoGenericInst): Added `MonoType *parent' and
20683         `MonoType **ifaces'.
20684
20685         * reflection.h (MonoReflectionGenericInst): Removed `klass',
20686         `parent' and `interfaces'.
20687
20688         * reflection.c (mono_reflection_bind_generic_parameters): Take a
20689         `MonoType *' argument and return a `MonoType *'.
20690
20691         * icall.c
20692         (ves_icall_MonoGenericInst_GetParentType): New interncall.
20693         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
20694
20695 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
20696
20697         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
20698         valuetype marshalling.
20699
20700 2004-02-06  Martin Baulig  <martin@ximian.com>
20701
20702         * class.c
20703         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
20704         (my_mono_class_from_generic_parameter): Likewise.
20705
20706 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
20707
20708         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
20709         contents of the symbol files lazily.
20710
20711         * object.h (MonoThread): Add 'name' and 'name_len' fields.
20712
20713         * threads.h threads.c icall.c: New icalls for getting and setting the
20714         threads name.
20715
20716 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
20717
20718         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
20719         Raise an exception when the domain is not found.
20720
20721 2004-02-03  Martin Baulig  <martin@ximian.com>
20722
20723         * reflection.c (mono_image_get_methodspec_token): Use the
20724         uninflated signature; fixes gen-33.
20725
20726 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
20727
20728         * gc.c threads.c: Make the finalizer thread a normal managed thread so
20729         the finalizer code can use thread functionality.
20730
20731         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
20732         the finalizer thread.
20733
20734         * threads.c: Make some functions more robust.
20735
20736         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
20737
20738         * metadata.h: Add new marshalling conventions.
20739
20740         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
20741         stringbuilder marshalling. Fixes #53700.
20742
20743         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
20744
20745         * reflection.c (mono_image_get_type_info): Save declarative security
20746         info.
20747
20748         * reflection.c (mono_image_get_field_info): Handle uninitialized 
20749         unmanaged fields as well.
20750
20751         * appdomain.c: Bump corlib version.
20752
20753 2004-02-01  Martin Baulig  <martin@ximian.com>
20754
20755         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
20756         method type arguments.  
20757
20758 2004-01-30  Duncan Mak  <duncan@ximian.com>
20759
20760         * marshal.h: Add prototype for
20761         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
20762         and
20763         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
20764         fix the build.
20765
20766 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
20767
20768         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
20769         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
20770
20771 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
20772
20773         * marshal.c (mono_marshal_get_native_wrapper): Add support for
20774         custom marshalling of valuetypes.
20775
20776         * marshal.c: Fix some warnings.
20777
20778 2004-01-29  Martin Baulig  <martin@ximian.com>
20779
20780         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
20781         for generic method parameters.
20782
20783         * reflection.c (method_encode_methodspec): Write the uninflated
20784         signature into the methodspec table.
20785         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
20786         is always the uninflated method.
20787         (reflection_methodbuilder_to_mono_method): Copy the generic
20788         parameters from the MethodBuilder into `header->gen_params'.
20789
20790 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
20791
20792         * class.c (mono_class_from_generic_parameter): Fix warning.
20793
20794 2004-01-27  Martin Baulig  <martin@ximian.com>
20795
20796         * class.c (mono_class_from_generic_parameter): Don't create
20797         `klass->methods' here.  
20798
20799 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
20800
20801         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
20802         extension since it does not work with libraries named lib<FOO>.dll.so.
20803
20804 2004-01-25  Martin Baulig  <martin@ximian.com>
20805
20806         * class.c (mono_class_inflate_generic_type): Added support for
20807         MONO_TYPE_GENERICINST.
20808
20809         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
20810         inflate methods on open constructed types.      
20811
20812 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20813
20814         * object.c: fire ProcessExit event in the root AppDomain after running
20815         Main. Fixes bug #53299.
20816
20817 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
20818
20819         * socket-io.c: include the new socket-wrappers.h header.
20820         Use the wrappers instead of the unix socket functions to make the code
20821         more clear.
20822
20823 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
20824
20825         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
20826
20827         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
20828         Fixes #22532.
20829
20830 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
20831
20832         * reflection.c (mono_image_create_pefile): Handle the case when the
20833         entry point is not a MethodBuilder.
20834
20835         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
20836         field to ReflectionMethod since it is not allways a builder.
20837
20838         * reflection.c (type_get_fully_qualified_name): New helper function to
20839         return the fully qualified name of a type.
20840
20841         * reflection.c (encode_marshal_blob): Always emit the fully qualified
20842         type name for custom marshallers.
20843
20844         * reflection.c (mono_marshal_spec_from_builder): Ditto.
20845
20846         * class.c (mono_class_setup_vtable): If a parent class already 
20847         implements an interface, use the implementing methods from that class.
20848         Fixes #53148.
20849
20850 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20851
20852         * threadpool.c: just return instead of ExitThread to allow for thread
20853         clean up earlier.
20854
20855 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
20856
20857         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
20858         when closing resource modules.
20859
20860         * reflection.c (mono_image_create_pefile): Handle the case when the
20861         entry point is not a MethodBuilder.
20862
20863         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
20864         field to ReflectionMethod since it is not allways a builder.
20865
20866 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
20867
20868         * marshal.c (mono_marshal_get_managed_wrapper): 
20869         mono_marshal_alloc takes native int so CONV_I
20870         the arg for 64bits.
20871
20872 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
20873
20874         * reflection.c (fixup_cattrs): New function to fixup the methoddef
20875         tokens in the cattr table. Fixes #53108.
20876
20877 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20878
20879         * loader.c: don't trim ".dll" before looking up in the config file.
20880         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
20881
20882 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
20883
20884         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
20885         Return the module which contains the resource as well.
20886         (ves_icall_System_Reflection_Module_Close): New icall.
20887
20888         * appdomain.c: Bump corlib version number.
20889
20890         * image.c (mono_image_addref): New public function.
20891
20892         * assembly.c: Call mono_image_addref.
20893
20894         * reflection.c (mono_module_get_object): Increase reference count of 
20895         the image.
20896
20897         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
20898         Fixes #22532.
20899
20900         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
20901         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
20902         proper exceptions on DllImport problems.
20903
20904 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
20905
20906         * class.c, metadata.c: eliminate CSIZE macro.
20907
20908 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
20909
20910         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
20911         * object.h: Added async_callback field in MonoAsyncResult.
20912         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
20913         * verify.c: Added async_callback in MonoAsyncResult layout.
20914
20915 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
20916
20917         * reflection.c (mono_reflection_get_custom_attrs): Add support
20918         for Modules.
20919
20920 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
20921
20922         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
20923         marshalling.
20924         (mono_marshal_method_from_wrapper): Add null pointer check.
20925
20926 2004-01-16  Martin Baulig  <martin@ximian.com>
20927
20928         * debug-mono-symfile.h: Set version number to 36 and reflect
20929         latest symbol writer changes.
20930
20931 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
20932
20933         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
20934         multi-dimensional arrays.
20935         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
20936         (mono_class_from_mono_type): Use bounded_array_class_get.
20937         
20938         * class.c (mono_bounded_array_class_get): New function which takes
20939         a 'bounded' bool argument to distinguish vectors from one dimensional
20940         arrays.
20941
20942         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
20943         bounded_array_class_get if the array has bounds.
20944
20945         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
20946         Search modules loaded using AssemblyBuilder:AddModule as well.
20947
20948 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20949
20950         * appdomain.c: increased corlib version.
20951         * filewatcher.c: removed g_print.
20952         * icall.c:
20953         (get_property_info): only allocate what is actually requested.
20954         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
20955
20956 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20957
20958         * Makefile.am: added filewatcher.[ch]
20959         * filewatcher.[ch]: FileSystemWatcher runtime support.
20960         * icall.c: added new FSW icalls.
20961
20962 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
20963
20964         * string-icalls.c: fix stringbuilder regression as suggested by
20965         Iain McCoy <iain@mccoy.id.au>.
20966
20967 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
20968
20969         * process.c (process_read_stringtable_block): Recognize '007f' as
20970         a language neutral stringtable block.
20971
20972 2004-01-12  Patrik Torstensson
20973
20974         * object.h (MonoStringBuilder) : Changed layout to support our
20975         new stringbuilder class.
20976         * marshal.c: Change marshalling to support the new layout of 
20977         string builder.
20978         * appdomain.c: increased version number because new layout of
20979         string builder.
20980
20981 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
20982
20983         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
20984         assembly name as an string instead of an AssemblyName, since it is
20985         easier to extract info from it.
20986
20987         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
20988         the culture subdirectories too. Fixes #52231.
20989
20990 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20991
20992         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
20993         It takes 2 new parameters with an optional name for the method to look
20994         for and case ignoring info.
20995
20996         * threadpool.c: removed unused variable.
20997
20998 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20999
21000         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
21001         It takes 2 new parameters with an optional name for the property to look
21002         for and case ignoring info.
21003         Fixes bug #52753.
21004
21005 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
21006
21007         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
21008         Fix #52451.
21009
21010 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21011
21012         * appdomain.c:
21013         * assembly.c: escape the uri before passing it to g_filename_from_uri.
21014         Fixes bug #52630.
21015
21016 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
21017
21018         * reflection.c: Add support for more than one unmanaged resource.
21019
21020         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
21021         in field->def_value, as done in all other cases.
21022
21023         * reflection.c (mono_reflection_get_custom_attrs): Add support for
21024         TypeBuilders.
21025
21026         * reflection.c (mono_reflection_create_runtime_class): Remove 
21027         errorneous assignment to klass->element_class, since it is already
21028         done in mono_reflection_setup_internal_class.
21029
21030 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21031
21032         * gc.c: added missing LeaveCriticalSection.
21033         * icall.c: indented a couple of lines.
21034         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
21035         if we call EndInvoke inside a callback. Fixes bug #52601.
21036
21037 2004-01-07  Martin Baulig  <martin@ximian.com>
21038
21039         * mono-debug-debugger.h
21040         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
21041
21042 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
21043
21044         * appdomain.c: Use messages in NotImplementedException.
21045
21046         * exception.c (mono_get_exception_not_implemented): Now this takes
21047         a message argument.
21048
21049         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
21050         exception instead of g_asserting an aborting when something is not
21051         implemented.
21052
21053         Add some inline docs.
21054
21055 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
21056
21057         * reflection.h: Update after changes to object layout.
21058
21059         * reflection.c: Implement saving of unmanaged aka win32 resources.
21060
21061         * appdomain.c: Bump version number.
21062
21063         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
21064         Handle missing domains gracefully.
21065
21066 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
21067
21068         * file-io.c : On Windows, there are much more invalid_path_chars.
21069
21070 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
21071
21072         * class.h, object.c: prepare for GetType () speedup.
21073
21074 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
21075
21076         * profiler.c: workaround for --profile null reference exception on
21077           cygwin. Patch by Patrik Torstensson.
21078
21079 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
21080
21081         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
21082         make work for unaligned access.
21083
21084 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
21085
21086         * class.c: small cleanup (class->fields [i] -> field).
21087         * image.c: check address of metadata is valid.
21088
21089 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
21090
21091         * assembly.h assembly.c (mono_assembly_loaded): New public function to
21092         search the list of loaded assemblies.
21093
21094         * reflection.c (mono_reflection_type_from_name): Use 
21095         mono_assembly_loaded instead of mono_image_loaded.
21096
21097         * reflection.c: Fix warnings.
21098
21099 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
21100
21101         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
21102         is dynamic. This is needed since an assembly can contain both dynamic and
21103         non-dynamic images.
21104
21105         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
21106         assembly->dynamic.
21107
21108         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
21109
21110         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
21111         to store modules loaded using AddModule.
21112
21113         * reflection.c (mono_image_fill_file_table): Generalize this so it works
21114         on Modules.
21115
21116         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
21117
21118         * reflection.c (mono_image_fill_export_table_from_module): New function to
21119         fill out the EXPORTEDTYPES table from a module.
21120
21121         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
21122         into a separate function. Also handle loaded non-dynamic modules.
21123
21124         * reflection.c (mono_image_basic_init): Fix memory allocation.
21125
21126         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21127
21128         * assembly.c (mono_assembly_load_references): Make this public.
21129
21130 2003-12-19  Martin Baulig  <martin@ximian.com>
21131
21132         * class.c (mono_class_initialize_generic): Made this static, take
21133         a `MonoGenericInst *' instead of a `MonoClass *'.
21134         (mono_class_from_generic): Call mono_class_initialize_generic()
21135         unless we're already initialized or being called from
21136         do_mono_metadata_parse_generic_inst().
21137
21138         * class.h (MonoGenericInst): Added `initialized' and
21139         `init_pending' flags.
21140
21141         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
21142         `mono_class_init (gklass)' or mono_class_initialize_generic()
21143         here; set `generic_inst->init_pending' while parsing the
21144         `type_argv'.
21145
21146 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
21147
21148         * locales.c: include string.h for memxxx prototypes
21149
21150 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
21151
21152         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
21153         constructor when accessing literal fields.
21154
21155 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
21156
21157         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21158
21159         * reflection.c (assembly_add_resource_manifest): New function to fill
21160         the MANIFESTRESOURCE table.
21161
21162         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
21163
21164         * reflection.h: Update to changes in class layout.
21165
21166         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
21167         Reenable call to mono_runtime_is_shutting_down ().
21168
21169         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
21170         determine if the runtime is shutting down.
21171
21172 2003-12-16  Jackson Harper <jackson@ximian.com>
21173
21174         * icall.c: comment out call to mono_runtime_is_shutting_down to
21175         fix build.
21176         
21177 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
21178
21179         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
21180         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
21181
21182 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
21183
21184         * reflection.c: move definition of swap_with_size
21185         to before its first call
21186
21187 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
21188
21189         * appdomain.c (mono_runtime_is_shutting_down): New public function.
21190
21191         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
21192         icall.
21193
21194         * object.c: Fix warnings.
21195
21196         * icall.c (ves_icall_Type_Get...): Only consider inherited static
21197         members if FlattenHierarchy is set.
21198
21199         * reflection.c (mono_image_add_decl_security): New function to emit
21200         declarative security.
21201
21202         * reflection.h reflection.c: Add support for declarative security.
21203
21204         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
21205         
21206 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
21207
21208         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
21209         
21210         * appdomain.c verify.c: Moved corlib version checking into its own
21211         function in appdomain.c since it needs to create vtables etc.
21212
21213 2003-12-13  Patrik Torstensson <p@rxc.se>
21214
21215         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
21216         instead of unwrapped server.
21217
21218 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
21219
21220         * verify.c (check_corlib): Fix field index.
21221
21222 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
21223
21224         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
21225         GetGacPath icall.
21226
21227 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
21228
21229         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
21230         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
21231         cope with sizeof(size_t) != sizeof(guint32).
21232
21233 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21234
21235         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
21236         in case of failure.
21237
21238 2003-12-10  Mark Crichton <crichton@gimp.org>
21239
21240         * icall.c: removed the GetNonZeroBytes.  We now handle this case
21241         in managed code.
21242
21243         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
21244
21245 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
21246
21247         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
21248         marked as deleted.
21249
21250 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
21251
21252         * verify.c (check_corlib): Handle the case when the version field is 
21253         initialized by a static constructor.
21254
21255 2003-12-08  Patrik Torstensson  <p@rxc.se>
21256
21257     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
21258
21259 2003-12-08  Martin Baulig  <martin@ximian.com>
21260
21261         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
21262         a MonoReflectionGenericParameter, also take the parameter index
21263         and name as arguments.
21264         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
21265         (ves_icall_MonoGenericParam_initialize): New interncall.
21266         (ves_icall_Type_make_byref_type): New interncall.
21267
21268         * reflection.h (MonoReflectionGenericParam): Derive from
21269         MonoReflectionType, not just from MonoObject.  Added `refobj' and
21270         `index' fields.
21271
21272         * reflection.c (mono_reflection_define_generic_parameter): Create
21273         and return a new MonoReflectionGenericParam; don't initialize the
21274         constraints here.
21275         (mono_reflection_initialize_generic_parameter): New public method;
21276         initializes the constraints and creates the `param->pklass'.
21277
21278 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
21279
21280         * reflection.h reflection.c: Use the new fields 'num_types', 
21281         'num_fields' and 'num_methods' to track the number of types etc.
21282
21283         * verify.c (check_corlib): Check corlib version number.
21284
21285 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
21286
21287         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
21288         function works on all methods.
21289
21290 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
21291
21292         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
21293         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
21294         the custom_type_info flag of the transparent proxy.
21295         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
21296         objects that supports IRemotingTypeInfo.
21297         * object.h: Added custom_type_info field in transparent proxy.
21298
21299 2003-12-06  Martin Baulig  <martin@ximian.com>
21300
21301         * class.c (mono_class_create_from_generic): Removed.
21302         (mono_class_from_generic): Check `ginst->klass' before doing
21303         anything else.  This is important to fully support "recursive"
21304         generic types.
21305
21306         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
21307         empty `generic_inst->klass' before doing anything else.
21308
21309 2003-12-06  Dick Porter  <dick@ximian.com>
21310
21311         * verify.c: 
21312         * object.h:
21313         * icall.c:
21314         * locales.c: Use C structs to access class fields.  Don't do a
21315         conversion between MonoString and UChar because both are
21316         platform-endian UTF-16.  Compare now takes startindex and count
21317         parameters.  Add a char overload for IndexOf.  Speed up the
21318         invariant string IndexOf.
21319
21320 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
21321
21322         * Makefile.am (monosn_LDADD): Fix parallel build.
21323
21324 2003-12-04  Martin Baulig  <martin@ximian.com>
21325
21326         * icall.c
21327         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
21328         (ves_icall_Type_make_array_type): New interncall.       
21329
21330 2003-12-04  Martin Baulig  <martin@ximian.com>
21331
21332         * locales.c: also change it in the !HAVE_ICU case.
21333
21334 2003-12-04  Dick Porter  <dick@ximian.com>
21335
21336         * icall.c:
21337         * locales.c: construct_compareinfo is now in CompareInfo, not
21338         CultureInfo.
21339
21340 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
21341
21342         * image.c (mono_image_load_file_for_image): Cache loaded images in the
21343         image->files array.
21344
21345         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
21346         table as well.
21347
21348         * assembly.c (mono_assembly_load_references): Only load references
21349         once.
21350
21351         * class.c (mono_class_from_name): Avoid linear search of the 
21352         EXPORTEDTYPE table.
21353
21354         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
21355
21356 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
21357
21358         * image.h (MonoImage): Add 'field_cache' field.
21359
21360         * loader.c (mono_field_from_token): Cache field lookups.
21361         
21362         * reflection.c (mono_module_get_object): Fix name property.
21363
21364         * icall.c (ves_icall_get_enum_info): Update after changes to 
21365         mono_metadata_get_constant_index ().
21366
21367         * icall.c: Get rid of get_type_info icall, use a separate icall for
21368         each type property to avoid needless memory allocations. Fixes #51514.
21369
21370         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
21371         to avoid needless binary searches.
21372
21373         * class.c (class_compute_field_layout): Move the initialization of
21374         field->def_value to mono_class_vtable ().
21375
21376         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
21377         non-corlib types.
21378
21379         * object.c (mono_object_allocate): Make it inline.
21380
21381         * object.c (mono_object_allocate_spec): Make it inline.
21382         
21383 2003-12-02  Dick Porter  <dick@ximian.com>
21384
21385         * locales.c (create_NumberFormat): NumberFormatInfo construction.
21386         Patch by Mohammad DAMT (mdamt@cdl2000.com).
21387
21388 2003-12-01  Dick Porter  <dick@ximian.com>
21389
21390         * threads.c: Fix signature and call in CreateMutex and
21391         CreateEvent.
21392
21393 2003-12-01  Dick Porter  <dick@ximian.com>
21394
21395         * icall.c: 
21396         * locales.c: Implement string compares and searching
21397
21398         * object.h: Add extra Thread field
21399
21400 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
21401
21402         * reflection.c (fixup_method): Add support for MonoCMethod.
21403
21404 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
21405
21406         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
21407
21408         * reflection.c (assembly_name_to_aname): Allow extra characters in
21409         assembly names. Fixes #51468.
21410
21411 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
21412
21413         * exception.c (mono_exception_from_name_domain): New helper function.
21414
21415         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
21416         exception object in the correct domain.
21417
21418         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
21419         formatting + make a copy a the input data.
21420
21421         * loader.c (mono_get_method_from_token): Methods which contain
21422         native code do not have entries in the ImplMap.
21423
21424         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
21425         Thanks to Gonzalo for spotting this.
21426         
21427         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
21428         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
21429
21430         * assembly.h (mono_assembly_load_from): Split the second part of 
21431         assembly loading into a new public function.
21432
21433         * exception.h (mono_get_exception_bad_image_format): New function.
21434
21435 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
21436
21437         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
21438         Enumerate all modules inside a dynamic assembly. Fixes #51293.
21439         
21440         * icall.c: Add new icall for creating dynamic methods.
21441
21442         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
21443
21444         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
21445
21446         * reflection.c (mono_reflection_create_dynamic_method): New icall to
21447         create a dynamic method.
21448
21449         * reflection.c (resolve_object): New helper function.
21450
21451         * reflection.c: Generalize ReflectionMethodBuilder and the functions
21452         which manipulate it so they can also work on dynamic methods.
21453
21454         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
21455         creating the MonoReflectionMethodAux structure if it is not needed.
21456         
21457         * reflection.h verify.c: Update after changes to object layout.
21458
21459         * reflection.c (method_builder_encode_signature): Fix compilation on
21460         gcc 2.95.x.
21461
21462 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
21463
21464         * appdomain.h: Added support for context static fields. Added static_data
21465           field to MonoAppContext and renamed thread_static_fields to a more
21466           generic special_static_fields in MonoAppDomain, since it can now contain
21467           context static fields.
21468         * domain.c: Updated hashtable name.
21469         * object.c: Replaced field_is_thread_static() for a more generic
21470           field_is_special_static() which also checks for context static attribute.
21471           In mono_class_vtable(), added support for static context fields.
21472         * threads.c: Changed methods that manage thread static fields to more
21473           generic methods so they can be reused both for thread and context static
21474           data.
21475         * threads.h: Declared some new methods.
21476
21477 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
21478
21479         * reflection.h: Update after changes to the managed types.
21480
21481         * reflection.c (encode_custom_modifiers): New helper function.
21482
21483         * reflection.c (method_encode_signature): Emit custom modifiers.
21484
21485         * reflection.c (field_encode_signature): Emit custom modifiers.
21486
21487 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
21488
21489         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
21490
21491         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
21492         implementation.
21493
21494         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
21495         icall.
21496
21497         * object.c (mono_field_get_value_object): New function.
21498
21499         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
21500         specific.
21501
21502 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
21503
21504         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
21505         return a preallocated out-of-memory exception instance.
21506
21507         * object.c (out_of_memory): Use the new function.
21508
21509         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
21510         flag is before the custom modifiers. Fixes #49802.
21511
21512 2003-11-16  Martin Baulig  <martin@ximian.com>
21513
21514         * class.c (mono_class_is_open_constructed_type): Implemented the
21515         MONO_TYPE_GENERICINST case.
21516
21517 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
21518
21519         * assembly.c (mono_assembly_fill_assembly_name): New function to
21520         fill out the MonoAssemblyName structure.
21521         (mono_assembly_open): Use the new function.
21522
21523         * icall.c (fill_reflection_assembly_name): New helper function.
21524
21525         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
21526         new function.
21527
21528         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
21529
21530 2003-11-15  Martin Baulig  <martin@ximian.com>
21531
21532         * class.c (mono_class_is_open_constructed_type): New public
21533         function; checks whether a type is an open constructed type,
21534         ie. whether it still contains type parameters.
21535         (mono_class_inflate_generic_type): If we're a type parameter and
21536         the inflated type is also a MONO_TYPE_(M)VAR, return the original
21537         type.
21538
21539         * class.h (MonoGenericInst): Added `guint32 is_open'.
21540
21541         * loader.c (method_from_methodspec): Check whether we're an open
21542         or closed constructed type and set `ginst->is_open'.
21543
21544         * reflection.c (mono_reflection_bind_generic_parameters): Check
21545         whether we're an open or closed constructed type and set
21546         `ginst->is_open'.
21547         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
21548         from open constructed types.
21549
21550 2003-11-15  Martin Baulig  <martin@ximian.com>
21551
21552         * reflection.c (mono_reflection_bind_generic_parameters): If we're
21553         a generic instance (instead of a generic type declaration) with
21554         unbound generic parameters, bind them to our actual types.
21555
21556 2003-11-14  Martin Baulig  <martin@ximian.com>
21557
21558         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
21559
21560         * reflection.c (mono_reflection_bind_generic_parameters): If we're
21561         an interface type, populate `res->interfaces' with instantiated
21562         versions of all the interfaces we inherit.
21563
21564 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
21565
21566         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
21567         when MONO_PATH is set but doesn't contain the install dir.
21568
21569 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21570
21571         * icall.c:
21572         (ves_icall_Type_GetInterfaces): don't return an interface twice when
21573         it's also implemented in base classes. Fixes bug #50927.
21574
21575 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
21576
21577         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
21578         if this method is called from a finalizer. Fixes #50913.
21579
21580 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
21581
21582         * threads.c: Implement VolatileRead/VolatileWrite
21583
21584         * icall.c: Add new icalls for VolatileRead/VolatileWrite
21585
21586 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
21587
21588         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
21589         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
21590         2.95.3.
21591
21592         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
21593         from Peter Ross (pro@missioncriticalit.com).
21594         
21595 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
21596
21597         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
21598
21599 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
21600
21601         * assembly.c (mono_assembly_load_references): Disable check because it
21602         triggers on older corlibs which lots of people have.
21603
21604 2003-11-12  Jackson Harper  <jackson@ximian.com>
21605
21606         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
21607         load corlib.dll if mscorlib.dll is not found.
21608         * assembly.h: Remove corlib name define.
21609         * class.c:
21610         * domain.c:
21611         * image.c: Change corlib name to mscorlib.
21612         
21613 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
21614
21615         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
21616
21617 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
21618
21619         * appdomain.h: Added loader_optimization here to sync with the C#
21620         code, and add disallow_binding_redirects field.
21621
21622 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
21623
21624         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
21625
21626         * reflection.c (mono_image_build_metadata): Fix crash on modules
21627         with no types.
21628
21629         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
21630
21631         * icall.c (ves_icall_get_method_info): Return callingConvention as
21632         well.
21633
21634         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
21635         namespaces from the EXPORTEDTYPE table as well.
21636
21637         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
21638         from all modules inside the assembly.
21639         
21640 2003-11-11  Martin Baulig  <martin@ximian.com>
21641
21642         * reflection.c (mono_reflection_bind_generic_parameters): Make
21643         this work for interfaces.
21644
21645 2003-11-11  Martin Baulig  <martin@ximian.com>
21646
21647         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
21648
21649 2003-11-11  Martin Baulig  <martin@ximian.com>
21650
21651         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
21652         "MonoInflatedMethod" and "MonoInflatedCtor".
21653
21654 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
21655
21656         * reflection.c (resolution_scope_from_image): Use the assembly table
21657         from the manifest module, since other modules don't have it.
21658
21659         * debug-helpers.c (mono_type_full_name): New helper function.
21660
21661         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
21662
21663         * image.c (mono_image_load_file_for_image): New public function which
21664         is a replacement for the load_file_for_image in class.c.
21665
21666         * assembly.c (mono_assembly_load_module): A wrapper for the function
21667         above which does assembly association and reference loading too.
21668
21669         * class.c (mono_class_from_name): Call mono_assembly_load_module.
21670
21671 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21672
21673         * appdomain.c: not all of the attributes for the full assembly name
21674         are required and the order doesn't matter. Fixes bug #50787.
21675
21676 2003-11-10  Dick Porter  <dick@ximian.com>
21677
21678         * locales.c: Use platform-endian UTF16
21679
21680 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
21681
21682         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
21683         
21684 2003-11-10  Martin Baulig  <martin@ximian.com>
21685
21686         * metadata.c
21687         (mono_metadata_load_generic_params): Make this actually work.
21688
21689         * reflection.c (mono_reflection_bind_generic_parameters): If our
21690         parent is a generic instance, pass all the `types' to it, no
21691         matter whether it has the same number of type parameters or not.
21692
21693 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
21694
21695         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
21696
21697         * assembly.c (mono_assembly_load_references): Move the image<->assembly
21698         assignment code to this function so it gets called recursively for all
21699         modules.
21700
21701         * image.c (load_modules): Remove the assembly assignment since it is
21702         now done by mono_assembly_load_references.
21703         
21704         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
21705         Add 'module' argument.
21706         (mono_module_get_types): New helper function.
21707         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
21708
21709 2003-11-08  Martin Baulig  <martin@ximian.com>
21710
21711         * class.c (mono_class_inflate_generic_method): Interface method
21712         don't have a header.
21713
21714         * reflection.c (mono_image_get_methodspec_token): Take an
21715         additional `MonoGenericInst *' argument instead of reading it from
21716         the header; this is necessary to support interfaces.
21717         (mono_image_create_token): Pass the `MonoGenericInst *' from the
21718         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
21719         (inflated_method_get_object): Take an additional `MonoGenericInst *'
21720         argument.
21721
21722         * reflection.h (MonoReflectionInflatedMethod): Added
21723         `MonoGenericInst *ginst'.
21724
21725 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
21726
21727         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
21728
21729 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
21730
21731         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
21732
21733 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
21734
21735         * reflection.c 
21736         (reflection_methodbuilder_from_method_builder):
21737         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
21738         initialize a ReflectionMethodBuilder structure.
21739         (mono_image_get_methodbuilder_token):
21740         (mono_image_get_ctorbuilder_token): New functions to emit memberref
21741         tokens which point to types in another module inside the same assembly.
21742
21743         * reflection.c: Use the new helper functions.
21744         
21745         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
21746
21747         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
21748         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
21749
21750         * reflection.c (resolution_scope_from_image): Emit a moduleref if
21751         neccesary.
21752
21753         * reflection.c (mono_image_build_metadata): Emit metadata only for the
21754         current module. Emit the manifest only for the main module.
21755
21756         * reflection.c (mono_image_create_token): Add assertion when a 
21757         memberref needs to be created.
21758
21759         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
21760
21761         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
21762         larger buffer for the custom attribute blob. Fixes #50637.
21763         
21764 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21765
21766         * threadpool.c: notify listener on async processing handles after
21767         invoking the async callback. Thanks to Zoltan.
21768
21769 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21770
21771         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
21772         avoid code duplication.
21773
21774         * reflection.h (MonoDynamicImage): New type which is currently unused,
21775         but will be used through the ref.emit code in place of 
21776         MonoDynamicAssembly.
21777
21778         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
21779         object layout.
21780
21781         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
21782         a MonoDynamicImage instead of just a MonoImage.
21783         
21784         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
21785         icalls to ModuleBuilder but keep their semantics, so they will work
21786         with moduleb->assemblyb. This will change later.
21787         
21788 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21789
21790         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
21791         object layout.
21792
21793         * reflection.c (mono_image_build_metadata): Avoid creation of a default
21794         main module, since it is now done by the managed code.
21795
21796 2003-11-03  Martin Baulig  <martin@ximian.com>
21797
21798         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
21799         `ginst->klass' here.
21800         (method_encode_methodspec): Don't use the `ginst->generic_method's
21801         klass if it's a generic instance, use `ginst->klass' in this case.
21802
21803 2003-11-03  Martin Baulig  <martin@ximian.com>
21804
21805         * reflection.c (mono_image_get_generic_method_param_info):
21806         Removed, use mono_image_get_generic_param_info() instead.
21807         (mono_image_get_type_info): Write the GenericParam table before
21808         the Method table.  This is neccessary because in the GenericParam
21809         table, type parameters of the class (ie. '!0' etc.) must come
21810         before the ones from its generic methods (ie. '!!0' etc).
21811
21812 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
21813
21814         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
21815
21816 2003-11-02  Martin Baulig  <martin@ximian.com>
21817
21818         * reflection.c (create_generic_typespec): Take a
21819         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
21820         the generic parameters from it.
21821
21822 2003-11-02  Martin Baulig  <martin@ximian.com>
21823
21824         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
21825         instead of a `MonoClassField *' since we just need the type.
21826         (create_generic_typespec): New static function.  Creates a
21827         TypeSpec token for a generic type declaration.
21828         (mono_image_get_generic_field_token): New static function.
21829         (mono_image_create_token): If we're a FieldBuilder in a generic
21830         type declaration, call mono_image_get_generic_field_token() to get
21831         the token.
21832
21833 2003-11-02  Martin Baulig  <martin@ximian.com>
21834
21835         * reflection.h
21836         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
21837         `MonoReflectionGenericInst *declaring_type' and
21838         `MonoReflectionGenericInst *reflected_type' fields.
21839
21840         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
21841         `MonoReflectionGenericInst *declaring_type' and a
21842         `MonoReflectionGenericInst *reflected_type' argument instead of a
21843         single `MonoReflectionGenericInst *type' one.  Set
21844         `res->declaring_type' and `res->reflected_type' from them.
21845         (mono_reflection_inflate_field): Likewise.      
21846
21847 2003-11-02  Martin Baulig  <martin@ximian.com>
21848
21849         * class.c (mono_class_setup_vtable): Don't store generic methods
21850         in the vtable.  
21851
21852 2003-11-02  Martin Baulig  <martin@ximian.com>
21853
21854         * reflection.h (MonoReflectionGenericInst): Added
21855         `MonoReflectionType *declaring_type'.
21856
21857         * reflection.c (mono_reflection_bind_generic_parameters): Use
21858         `if (tb->parent)' instead of `klass->parent'.
21859
21860 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
21861
21862         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
21863         with an empty ASSEMBLY table.
21864
21865         * reflection.c (mono_image_build_metadata): Avoid using the same loop
21866         variable in the inner and outer loops.
21867
21868 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
21869
21870         * metadata.h (mono_metadata_make_token): Put parentheses around macro
21871         argument.
21872
21873         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
21874         
21875         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
21876         icalls. Instead, do everything in managed code. This is needed since
21877         it is hard to restore the original domain etc. in unmanaged code in the
21878         presence of undeniable exceptions.
21879
21880         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
21881         New icalls to push and pop appdomain refs.
21882
21883 2003-10-31  Martin Baulig  <martin@ximian.com>
21884
21885         * class.c (inflate_generic_type): Renamed to
21886         mono_class_inflate_generic_type() and made it public.
21887
21888         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
21889         New interncall.
21890
21891         * loader.c (mono_field_from_memberref): Also set the retklass for
21892         typespecs.
21893
21894         * fielder.c (mono_image_get_inflated_field_token): New static
21895         method; creates a metadata token for an inflated field.
21896         (mono_image_create_token, fixup_method): Added support for
21897         "MonoInflatedField".
21898         (fieldbuilder_to_mono_class_field): New static function.
21899         (mono_reflection_inflate_field): New public function.
21900
21901         * reflection.h
21902         (MonoReflectionGenericInst): Added `MonoArray *fields'.
21903         (MonoReflectionInflatedField): New typedef.     
21904
21905 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
21906
21907         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
21908         for Solaris and other platforms without s6_addr16
21909
21910 2003-10-30  Martin Baulig  <martin@ximian.com>
21911
21912         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
21913         argument instead of two.
21914         (mono_class_inflate_generic_signature): Likewise.
21915         (inflate_generic_header): Likewise.
21916         (mono_class_inflate_generic_method): Likewise.  In addition, if
21917         `ginst->klass' is set, it becomes the new `method->klass'.
21918
21919         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
21920         field.
21921
21922         * reflection.c (encode_generic_method_sig): Write a 0xa as the
21923         first byte. [FIXME]
21924         (method_encode_methodspec): If we have generic parameters, create
21925         a MethodSpec instead of a MethodRef.
21926         (fixup_method): Added support for "MonoInflatedMethod" and
21927         "MonoInflatedCtor".
21928         (mono_image_create_token): Added support for "MonoInflatedMethod"
21929         and "MonoInflatedCtor".
21930         (inflated_method_get_object): New static function; returns a
21931         managed "System.Reflection.MonoInflatedMethod" object.
21932         (mono_reflection_bind_generic_method_parameters): Return a
21933         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
21934         (mono_reflection_inflate_method_or_ctor): Likewise.
21935         (mono_image_get_generic_method_param_info): Initialize unused
21936         fields to zero.
21937         (mono_image_get_generic_param_info): Likewise.
21938
21939         * reflection.h (MonoReflectionInflatedMethod): New public
21940         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
21941         "S.R.MonoInflatedCtor" classes.
21942
21943         * loader.c (method_from_memberref): If we're a TypeSpec and it
21944         resolves to a generic instance, inflate the method.
21945
21946 2003-10-28  Dick Porter  <dick@ximian.com>
21947
21948         * object.c (mono_runtime_run_main): Convert command-line arguments
21949         into utf8, falling back to the user's locale encoding to do so.
21950
21951 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
21952
21953         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
21954         at this time.
21955
21956         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
21957
21958         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
21959         up icalls at method definition time. Partially fixes #33569.
21960
21961 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
21962
21963         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
21964         marshalling of arrays. Fixes #50116.
21965
21966         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
21967
21968         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
21969         points to a vtable in the dying appdomain.
21970
21971         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
21972         listeners into unmanaged code inside the lock.
21973
21974         * object.c (mono_class_vtable): Turn off typed allocation in non-root
21975         domains and add some comments.
21976
21977 2003-10-25  Martin Baulig  <martin@ximian.com>
21978
21979         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
21980
21981         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
21982
21983         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
21984         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
21985         currently parsing.  Create the generic class and store it in
21986         `generic_inst->klass' before parsing the type arguments.  This is
21987         required to support "recursive" definitions; see mcs/tests/gen-23.cs
21988         for an example.
21989         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
21990         to support recursive typespec entries.
21991
21992         * class.c (mono_class_setup_parent): If our parent is a generic
21993         instance, we may get called before it has its name set.
21994         (mono_class_from_generic): Splitted into
21995         mono_class_create_from_generic() and mono_class_initialize_generic().
21996
21997 2003-10-25  Martin Baulig  <martin@ximian.com>
21998
21999         * icall.c (ves_icall_Type_BindGenericParameters): Return a
22000         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
22001         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
22002         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
22003
22004         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
22005         (create_typespec): Likewise.
22006         (mono_reflection_bind_generic_parameters): Return a
22007         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
22008         (mono_reflection_inflate_method_or_ctor): New public function.
22009
22010         * reflection.h (MonoReflectionGenericInst): New typedef.        
22011
22012 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
22013
22014         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
22015         inside the domain lock. Fixes #49993.
22016         
22017         * object.c (mono_class_vtable): When typed allocation is used, 
22018         allocate vtables in the GC heap instead of in the mempool, since the
22019         vtables contain GC descriptors which are used by the collector even
22020         after the domain owning the mempool is unloaded.
22021
22022         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
22023
22024         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
22025         reflect what it does. Also invalidate mempools instead of freeing
22026         them if a define is set.
22027
22028         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
22029         of the appdomain.
22030         
22031         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
22032         hold the finalizable objects in this domain.
22033
22034         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
22035         appdomain.
22036
22037         * appdomain.c (mono_domain_set): New function to set the current
22038         appdomain, but only if it is not being unloaded.
22039
22040         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
22041         appdomain which is being unloaded.
22042         
22043         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
22044         unloading of the root appdomain.
22045
22046         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
22047         icall to execute a method in another appdomain. Intended as a 
22048         replacement for InternalSetDomain, which can confuse the code 
22049         generation in the JIT.
22050
22051         * appdomain.c (mono_domain_is_unloading): New function to determine
22052         whenever an appdomain is unloading.
22053
22054         * appdomain.c (mono_domain_unload): New function to correctly unload
22055         an appdomain.
22056
22057         * assembly.c (mono_assembly_load_references): Check that an assembly
22058         does not references itself.
22059
22060         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
22061         domain manually, it asks the finalizer thread to do it, then waits for
22062         the result. Also added a timeout.
22063
22064         * icall.c: Register the new icalls.
22065
22066         * threads.h threads.c: Export the mono_gc_stop_world and 
22067         mono_gc_start_world functions.
22068         
22069         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
22070         function to fill out the mempool with 0x2a.
22071
22072 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
22073
22074         * reflection.h (MonoReflectionMethodAux): New structure to store
22075         information which is rarely used, thus is not in the MonoMethod
22076         structure.
22077
22078         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
22079         store the aux info.
22080
22081         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
22082         and marshalling info into the aux structure.
22083
22084         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
22085         from the aux structure.
22086
22087         * loader.c (mono_method_get_param_names): Retrieve the param names from
22088         the aux structure.
22089         
22090 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
22091
22092         * exception.h exception.c: Add AppDomainUnloadedException && fix 
22093         warning.
22094
22095 2003-10-21  Dick Porter  <dick@ximian.com>
22096
22097         * socket-io.c
22098         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
22099         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
22100
22101 2003-10-21  Martin Baulig  <martin@ximian.com>
22102
22103         * reflection.c (mono_reflection_bind_generic_parameters):
22104         `klass->parent' is NULL for interfaces.
22105
22106 2003-10-21  Martin Baulig  <martin@ximian.com>
22107
22108         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22109
22110 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
22111
22112         * exception.c (mono_exception_from_name_msg): New helper function for
22113         creating exceptions and initializing their message field.
22114
22115         * exception.c: Simplify functions using the new helper.
22116
22117         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
22118         New function.
22119
22120         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
22121         mono_raise_exception, since otherwise gcc doesn't generate the function
22122         epilog for raise_exception, confusing the stack unwinding in the JIT.
22123         Fixes #45043.
22124
22125         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
22126         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
22127         Fixes #49499.
22128
22129 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22130
22131         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
22132         utf8.
22133
22134 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
22135
22136         * icall.c: Removed GetUninitializedObject method because
22137           AllocateUninitializedClassInstance does the same.
22138
22139 2003-10-18  Martin Baulig  <martin@ximian.com>
22140
22141         * class.c (inflate_generic_signature): Renamed to
22142         mono_class_inflate_generic_signature() and made it public.
22143         (my_mono_class_from_generic_parameter): New static function; if we
22144         don't already have the generic parameter's MonoClass, create a
22145         very simple one which is just used internally in the runtime and
22146         not passed back to managed code.
22147
22148         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
22149
22150         * metadata.h (MonoMethodSignature): Moved the
22151         `MonoGenericParam *gen_params' to the MonoMethodHeader.
22152         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
22153
22154         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
22155         ves_icall_MonoMethod_GetGenericArguments(); this is now an
22156         interncall on the MonoMethod class, not on MethodInfo.
22157         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
22158         calling mono_reflection_bind_generic_method_parameters() directly.
22159
22160         * loader.c (mono_method_get_signature): If this is a MethodSpec;
22161         return the already computed `method->signature'.
22162         (method_from_methodspec): New static function to load a method
22163         from a MethodSpec entry.
22164         (mono_get_method_from_token): Call the new method_from_methodspec()
22165         for MethodSpec tokens.  
22166         (mono_get_method_from_token): If we're a generic method, load the
22167         type parameters.
22168
22169         * reflection.c (mono_image_get_memberref_token): Allow
22170         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
22171         table.
22172         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
22173         (mono_image_create_token): First check whether it's a generic
22174         method (so we'd need to create a MethodSpec), then do the other
22175         two alternatives.
22176         (mono_reflection_bind_generic_method_parameters): Return a
22177         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
22178         called directly from the interncall.
22179
22180 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
22181
22182         * reflection.c (load_public_key): Move loading of the public key
22183         into managed code.
22184
22185         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
22186
22187         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
22188         fields.
22189
22190         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
22191         culture, hash_alg and public_key. Fixes #49555.
22192
22193 2003-10-17  Martin Baulig  <martin@ximian.com>
22194
22195         * class.h (MonoGenericInst): Moved this declaration here and added
22196         `MonoMethod *generic_method'.
22197
22198         * icall.c
22199         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
22200         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
22201
22202         * metadata.c (mono_metadata_type_equal): Two types of
22203         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
22204         index; ie. don't compare the address of the `MonoGenericParam'
22205         structure.
22206         (mono_metadata_load_generic_params): Removed the `MonoMethod
22207         *method' argument.
22208
22209         * metadata.h (MonoGenericInst): Moved declaration to class.h.
22210         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
22211
22212         * reflection.c (method_encode_signature): Encode the number of
22213         generic parameters.
22214         (encode_generic_method_sig): New static function.
22215         (method_encode_methodspec): New static function; creates an entry
22216         in the MethodSpec table for a generic method.
22217         (mono_image_get_methodspec_token): New static function.
22218         (mono_image_create_token): Call mono_image_get_methodspec_token()
22219         for generic methods.
22220         (mono_reflection_bind_generic_method_parameters): New public
22221         function.  Instantiates a generic method.
22222
22223 2003-10-16  Martin Baulig  <martin@ximian.com>
22224
22225         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
22226         *gen_params' here from MonoMethodHeader.
22227
22228         * metadata.c (mono_metadata_parse_method_signature): If we have
22229         generic parameters, initialize `method->gen_params' and then set
22230         the correct `type->data.generic_param' in all the parameters.
22231
22232 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
22233
22234         * threads.c (mono_threads_get_default_stacksize): New function to 
22235         return the default stacksize.
22236
22237         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
22238         termination of the finalizer thread, since the previous method had
22239         race conditions. Fixes #49628.
22240
22241         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
22242         as for the other managed threads.
22243
22244 2003-10-16  Martin Baulig  <martin@ximian.com>
22245
22246         * class.c (inflate_generic_signature): Copy `generic_param_count'
22247         and `gen_params'.
22248
22249         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
22250         New interncall.
22251
22252         * metadata.c (mono_metadata_parse_method_signature): Actually set
22253         the `method->generic_param_count' here.
22254         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
22255
22256 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
22257
22258         * object.h: Add a new field to TypedRef to simplify the implementation
22259         of the REFANY opcodes in the JIT.
22260
22261         * icall.c: Make use of the new field.
22262
22263         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
22264         dynamically.
22265
22266 2003-10-15  Martin Baulig  <martin@ximian.com>
22267
22268         * class.c (mono_class_from_gen_param): Renamed to
22269         mono_class_from_generic_parameter() and moved most of the
22270         functionality from mono_reflection_define_generic_parameter()
22271         here; ie. we create a "real" class here.
22272         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
22273         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
22274         previously been called.
22275
22276         * class.h (MonoGenericParam): Moved the declaration of this struct
22277         here from metadata.h and added `MonoMethod *method'.
22278
22279         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
22280         interncall.
22281
22282         * loader.c (mono_get_method_from_token): If we have any generic
22283         parameters, call mono_metadata_load_generic_params() to read them
22284         from the MONO_TABLE_GENERICPAR.
22285
22286         * metadata.c (mono_metadata_load_generic_params): Added
22287         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
22288
22289         * metadata.h (MonoMethodSignature): Replaced
22290         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
22291         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
22292
22293         * reflection.c (mono_reflection_define_generic_parameter): Moved
22294         most of the functionality into the new
22295         mono_class_from_generic_parameter(); set the `method' field if
22296         we're a method parameter.       
22297
22298 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
22299
22300         * marshal.c (emit_struct_conv): if native size is 0
22301         emit no code.
22302
22303 2003-10-14  Martin Baulig  <martin@ximian.com>
22304
22305         * icall.c: The generics API has changed in the spec since it was
22306         added to System.Type; these modifications make it match the spec
22307         again.
22308         (ves_icall_Type_GetGenericParameters): Renamed to
22309         `ves_icall_Type_GetGenericArguments'.
22310         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
22311         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
22312         `ves_icall_MonoType_get_HasGenericArguments'.
22313         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
22314         `ves_icall_MonoType_get_IsGenericParameter'.
22315         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
22316         this is no interncall anymore.
22317         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
22318         `ves_icall_TypeBuilder_get_IsGenericParameter'.
22319
22320 2003-10-14  Martin Baulig  <martin@ximian.com>
22321
22322         * reflection.c (mono_reflection_bind_generic_parameters): Also
22323         inflate generic methods if we're reading the class from IL.
22324
22325 2003-10-13  Martin Baulig  <martin@ximian.com>
22326
22327         * reflection.c (mono_reflection_define_generic_parameter): This
22328         method isn't called directly from the icall anymore; take a
22329         `MonoReflectionAssemblyBuilder *' so we can use this for type and
22330         method generic parameters.
22331         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
22332         (method_builder_encode_signature): Encode generic parameters.
22333         (mono_image_get_method_info): Write generic params to the
22334         MONO_TABLE_GENERICPARAM table.
22335
22336         * reflection.h (MonoReflectionMethodBuilder): Added
22337         `MonoArray *generic_params'.
22338
22339         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
22340
22341         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
22342         wrapper for mono_reflection_define_generic_parameter().
22343         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
22344
22345 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
22346
22347         * marshal.h: Add missing function to fix build.
22348
22349         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
22350         the SetLastError pinvoke attribute.
22351
22352         * marshal.c (mono_marshal_set_last_error): New helper function called
22353         by the generated code.
22354         
22355         * marshal.c (mono_mb_emit_branch): New helper function.
22356
22357         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
22358
22359         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
22360         classes as parameters and return values of delegates. Fixes #29256. 
22361
22362 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
22363
22364         * locales.c: use gint32 in non HAVE_ICU case
22365
22366 2003-10-11  Martin Baulig  <martin@ximian.com>
22367
22368         * mono-debug.c (mono_debug_add_method): Added a workaround for
22369         bug #48591.
22370
22371 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
22372
22373         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
22374         delegates passed to native code must use the STDCALL calling 
22375         convention. Fixes #35987.
22376
22377 2003-10-10  Martin Baulig  <martin@ximian.com>
22378
22379         * class.c (inflate_generic_type): If we're inflating for a generic
22380         type instance (and not for a generic method), return
22381         MONO_TYPE_MVAR unchanged.
22382
22383 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22384
22385         * string-icalls.c: Join ignores null strings in the source array.
22386         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
22387         * threads.c: GetAvailableTheads is slightly more accurate.
22388
22389 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
22390
22391         * threads.h threads.c : add mono_threads_set_default_stacksize
22392         and pass default to CreateThread calls.
22393
22394 2003-10-09  Dick Porter  <dick@ximian.com>
22395
22396         * icall.c:
22397         * locales.h:
22398         * locales.c: Internal calls for constructing CultureInfo and
22399         related objects from libicu (if its available.)
22400
22401 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
22402
22403         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
22404
22405 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22406
22407         * threadpool.c: added an argument to async_invoke_thread that is the
22408         item to process, pass the MonoAsyncResult to the thread start function
22409         when creating a new thread. This way we don't need to acquire any lock
22410         when we're creating a new thread. Readded a semaphore for faster
22411         response times (instead of that Sleep i added).
22412
22413 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
22414
22415         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
22416         get daylight change dates better on Windows, fix handling
22417         of platforms without tm_gmtoff.
22418
22419 2003-10-06  Martin Baulig  <martin@ximian.com>
22420
22421         * class.c (inflate_generic_method): Renamed to
22422         mono_class_inflate_generic_method() and made public.
22423         (mono_class_init): Don't inflate the generic methods here.
22424         (mono_class_from_generic): Added `gboolean inflate_methods'
22425         argument.  Inflate the methods here.
22426
22427         * loader.c (mono_method_get_param_names): Ignore instances of
22428         generic types for the moment.
22429
22430         * reflection.c (fixup_method): Added support for inflated methods.
22431         (mono_image_create_token): Use mono_image_get_methodref_token()
22432         for inflated methods.
22433         (mono_custom_attrs_from_param): Ignore instances of generic types
22434         for the moment.
22435         (mono_reflection_bind_generic_parameters): New public function.
22436         Moved all the functionality from
22437         ves_icall_Type_BindGenericParameters() here and added support for
22438         dynamic types.
22439         (mono_reflection_define_generic_parameter): Initialize
22440         `klass->methods' here.
22441
22442         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
22443         functionality into mono_reflection_define_generic_parameter().
22444         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
22445         TypeBuilder, return that TypeBuilder.
22446
22447 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22448
22449         * appdomain.c: removed mono_delegate_semaphore.
22450
22451         * threadpool.c:
22452         (mono_thread_pool_add): moved hash table creation inside and the thread 
22453         creation outside of the critical region.
22454         (mono_thread_pool_finish): removed obsolete code.
22455         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
22456         continue or exit the thread depending on the queue.
22457
22458 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
22459
22460         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
22461         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
22462         handle more bool marshalling options
22463
22464 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
22465
22466         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
22467         arrays of structs. Also add a more descriptive error message when
22468         a structure member is marshalled as LPArray.
22469
22470 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
22471
22472         * marshal.c (mono_marshal_get_native_wrapper): Add support for
22473         marshalling arrays of complex types. Fixes #29098. Also remove an
22474         usused and incomplete function.
22475
22476 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
22477
22478         * gc.c: report heap_size - free_bytes as total memory allocated
22479         (bug#49362).
22480
22481 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
22482
22483         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
22484         fix timezone handling problems on Windows.
22485         
22486         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
22487         asserts when the year is outside the range handled by ms the functions.
22488
22489         * class.c (setup_interface_offsets): If the class is an interface,
22490         fill out its interface_offsets slot.
22491
22492 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22493
22494         * threadpool.c: mark threadpool threads as background.
22495
22496 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
22497
22498         * decimal.c - define DECINLINE to nothing if not using GCC
22499
22500 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
22501
22502         * assembly.c: More refcount fixes.
22503
22504 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22505
22506         * string-icalls.c: if we're not trimming, return the same string.
22507         When not splitting, don't create a new string.
22508
22509 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22510
22511         * image.c:
22512         (mono_image_open): increment the ref_count inside the critical section.
22513
22514 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
22515
22516         * image.c (mono_image_open): Fix reference counting bug.
22517
22518 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
22519
22520         * marshal.c (mono_marshal_type_size) struct alignment changed for 
22521         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
22522         64bits. Avoid leak in mono_marshal_get_native_wrapper when
22523         mono_lookup_pinvoke_call throws.        
22524
22525 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
22526
22527         * reflection.c (mono_reflection_parse_type): Fix #49114.
22528
22529         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
22530         temporary workaround for cygwin header problem.
22531
22532         * object.c (mono_object_isinst): Synchronize this with the code
22533         generated by the JIT for casts.
22534
22535 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
22536
22537         * reflection.c (encode_type): Fix #38332.
22538
22539 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
22540
22541         * marshal.c (mono_marshal_method_from_wrapper): New function to return
22542         the original method from the wrapper method.
22543
22544 2003-09-25  Martin Baulig  <martin@ximian.com>
22545
22546         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
22547         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
22548         (ves_icall_Type_get_IsGenericInstance): New interncall.
22549
22550 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
22551
22552         * object.c: fix cast warning in big endian code.
22553
22554 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
22555
22556         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
22557         
22558 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22559
22560         * assembly.c: don't call check_env from mono_assembly_load. It's
22561         already done once in mono_assemblies_init and may cause headaches when
22562         multiple threads are loading assemblies.
22563
22564 2003-09-19  Martin Baulig  <martin@ximian.com>
22565
22566         * reflection.c (mono_reflection_define_generic_parameter): Don't
22567         allocate `klass->methods', set `klass->flags' to
22568         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
22569
22570 2003-09-18  Martin Baulig  <martin@ximian.com>
22571
22572         * class.c (mono_class_init): Don't create `class->methods' if it's
22573         already initialized.
22574
22575         * metadata.c (mono_metadata_load_generic_params): Make this
22576         actually work.
22577
22578         * reflection.c (mono_reflection_define_generic_parameter): Set
22579         parent class and interfaces from the constraints.
22580
22581         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
22582         to keep this struct in sync with the declaration in TypeBuilder.cs.
22583
22584 2003-09-17  Martin Baulig  <martin@ximian.com>
22585
22586         * metadata.h (MonoType): Replaced the data's `int type_param'
22587         field with `MonoGenericParam *generic_param'.
22588         (MonoGenericParam): Added `MonoClass *klass'.
22589
22590         * class.c (mono_class_from_gen_param): Removed the
22591         `MonoImage *image' and `int type_num' arguments.
22592
22593         * metadata.c (mono_metadata_parse_generic_param): New static
22594         method; creates a MonoGenericParam which just contains the index.
22595         (do_mono_metadata_parse_type): Call
22596         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
22597         MONO_TYPE_MVAR.
22598
22599         * reflection.c (mono_image_typedef_or_ref): Generic type
22600         parameters may be in the same assembly, but never use a typedef
22601         for them.
22602         (mono_reflection_define_generic_parameter): We're now creating a
22603         "real" class for the type parameter; it's now safe to call
22604         mono_class_from_mono_type() on the class'es type, it'll do the
22605         right thing.
22606
22607 2003-09-16  Martin Baulig  <martin@ximian.com>
22608
22609         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
22610         `symfile->range_entry_size' and `symfile->class_entry_size' here;
22611         the `symfile' data structure must be fully initialized before it
22612         gets added to the table.
22613
22614 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
22615
22616         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
22617
22618         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
22619         class init trampolines.
22620
22621 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
22622
22623         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
22624         to the built-in profiler to turn off time and allocation profiling
22625         respectively.
22626
22627 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
22628
22629         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
22630         g_direct_equal.
22631
22632         * debug-helpers.c (mono_method_full_name): Print the wrapper type
22633         in human readable form.
22634
22635 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
22636
22637         * reflection.c icall.c: Fixed warnings.
22638
22639         * image.c (load_class_names): Use a temporary hash table to hold the
22640         namespaces in order to avoid doing many string comparisons.
22641
22642         * image.h: Fix typo.
22643
22644         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
22645         Pass NULL instead of g_direct_equal to the GHashTable constructor 
22646         since the NULL case is short-circuited inside g_hash_table_lookup, 
22647         leading to better performance.  
22648
22649         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
22650         obtain the first custom attribute for a given index. Depends on the
22651         CustomAttribute table being sorted by the parent field.
22652
22653         * reflection.c (mono_custom_attrs_from_index): Use the new function 
22654         for better performance.
22655
22656 2003-09-07  Martin Baulig  <martin@ximian.com>
22657
22658         * class.c (mono_class_init): If we're a generic instance, inflate
22659         all our methods instead of loading them from the image.
22660         (mono_class_from_generic): Set `class->methods = gklass->methods'.
22661
22662 2003-09-07  Martin Baulig  <martin@ximian.com>
22663
22664         * mono-debug-debugger.c: Added support for constructors.
22665
22666 2003-09-06  Martin Baulig  <martin@ximian.com>
22667
22668         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
22669         New interncall.
22670
22671         * reflection.c (mono_reflection_setup_generic_class): Call
22672         ensure_runtime_vtable() to create the vtable.
22673
22674 2003-09-05  Martin Baulig  <martin@ximian.com>
22675
22676         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
22677         MONO_TYPE_MVAR.
22678
22679 2003-09-04  Martin Baulig  <martin@ximian.com>
22680
22681         * reflection.c (mono_reflection_define_generic_parameter): Generic
22682         parameters start with zero.
22683
22684 2003-09-04  Martin Baulig  <martin@ximian.com>
22685
22686         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
22687
22688         * reflection.h (MonoReflectionGenericParam): New typedef.
22689         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
22690         the generic parameters from the managed TypeBuilder.
22691
22692         * reflection.c (mono_reflection_define_generic_parameter): New function.
22693         (mono_reflection_create_runtime_class): Encode generic parameters.
22694         (mono_reflection_setup_generic_class): New function; this is
22695         called after adding adding all generic params to the TypeBuilder.
22696         (encode_type): Added MONO_TYPE_VAR.
22697
22698 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
22699
22700         * class.h class.c (mono_class_needs_cctor_run): Moved this method
22701         here from the JIT.
22702
22703         * assembly.h assembly.c: Moved the AOT loading code into an assembly
22704         load hook.
22705
22706 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
22707
22708         * reflection.h reflection.c class.h class.c: Delete duplicate 
22709         definition of mono_type_get_name () from reflection.c and export the
22710         one in class.c.
22711
22712         * class.c: Class loading fixes from Bernie Solomon 
22713         (bernard@ugsolutions.com).
22714
22715         * reflection.c: Endianness fixes from Bernie Solomon 
22716         (bernard@ugsolutions.com).
22717         
22718 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
22719
22720         * assembly.h assembly.c: Define a file format version for AOT
22721         libraries.
22722         
22723         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
22724
22725         * appdomain.h (MonoJitInfo): New field to determine whenever the
22726         code is domain neutral.
22727         
22728 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
22729
22730         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
22731
22732 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
22733
22734         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
22735         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
22736         Avoid caching the result since strings must be domain specific. Fixes
22737         #48050.
22738
22739 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
22740
22741         * marshal.c (mono_marshal_init): Make this callable multiple times
22742         since it is hard to find a correct place to call it.
22743
22744         * object.c (mono_runtime_class_init): Execute static constructors in
22745         the correct appdomain.
22746
22747         * image.c (build_guid_table): Handle the case when multiple images have
22748         the same GUID.
22749
22750 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22751
22752         * icall.c: added a couple of icalls for System.Web.
22753
22754 2003-08-28  Martin Baulig  <martin@ximian.com>
22755
22756         * icall.c (ves_icall_Type_BindGenericParameters): Use
22757         `klass->generic_inst' instead of `&klass->byval_arg' in the
22758         mono_type_get_object() call.  The returned type must be
22759         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
22760
22761 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
22762
22763         * NOTES: New file.
22764
22765         * object.c (mono_class_proxy_vtable): Make it thread safe.
22766
22767         * pedump.c: Fix warning.
22768
22769         * object.c appdomain.h: Get rid of metadata_section. 
22770         It is no longer needed and it was causing deadlocks with domain->lock.
22771
22772         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
22773
22774 2003-08-26  Martin Baulig  <martin@ximian.com>
22775
22776         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
22777
22778 2003-08-26  Martin Baulig  <martin@ximian.com>
22779
22780         * pedump.c (main): Call mono_metadata_init(),
22781         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
22782         and mono_loader_init().
22783
22784 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
22785
22786         * loader.h: Add missing include to fix build.
22787
22788         * image.h: mono_image_load_references is no more.
22789
22790         * assembly.c: Reworked assembly loading to make it really thread safe.
22791         After these changes, the assembly returned by mono_assembly_open is
22792         fully initialized, i.e. all its references assemblies are loaded.
22793
22794         * assembly.c (mono_image_load_references): Renamed to 
22795         mono_assembly_load_references, and made private, since clients no
22796         longer need to call it.
22797
22798         * class.c: Removed calls to mono_assembly_load_references, since it was
22799         a source of deadlocks.
22800
22801         * loader.h loader.c class.h class.c: Protect data structures using a 
22802         new lock, the loader lock.
22803
22804         * class.c (mono_class_setup_vtable): Create temporary hash tables and
22805         GPtrArrays only when needed.
22806
22807         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
22808         into empty structures by mcs. Fixes pinvoke7.cs.
22809         
22810         * domain.c (mono_init): Call a new initialization function.
22811
22812         * appdomain.c (mono_runtime_init): Call the new initializer function
22813         of the marshal module.
22814
22815         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
22816         inserted into empty structures by mcs. Fixes pinvoke7.cs.
22817
22818         * marshal.h marshal.c: Added locks around the wrapper caches to make
22819         this module thread safe.
22820
22821         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
22822         this argument. Fixes pinvoke1.exe.
22823
22824 2003-08-25  Lluis Sanchez <lluis@ximian.com>
22825
22826         * object.h: Added call_type field to MonoMethodMessage and the corresponding
22827         enumeration of values. Removed fields to store remote call output values in
22828         MonoAsyncResult. Not needed any more.
22829         * object.c: Initialize call_type and async_result fields in mono_message_init.
22830         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
22831         dispatching the message.
22832         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
22833         async call to finish. To do it use a message with EndInvoke call type.
22834
22835 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
22836
22837         * loader.h loader.c (mono_method_hash_marhal_info): New function which
22838         determines whenever a method has marshalling info.
22839
22840 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22841
22842         * assembly.c: fix the build on windows.
22843
22844 2003-08-22 Lluis Sanchez <lluis@ximian.com>
22845
22846         * object.cs: Fixed bug #47785.
22847
22848 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
22849
22850         * string-icalls.c (StringReplace): If their are no occurances of
22851         the old string found return a reference to the supplied
22852         string. This saves some memory and matches MS behavoir.
22853         
22854 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22855
22856         * socket-io.c: fixed compilation for systems that define AF_INET6
22857         and don't define SOL_IP/SOL_IPV6.
22858
22859 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
22860
22861         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
22862         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
22863
22864         * rawbuffer.c rawbuffer.h: Make this module thread safe.
22865
22866         * domain.c: Make this module thread safe.
22867
22868         * domain.c (mono_init): Call new initialization function.
22869
22870         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
22871         reference types too. Fixes #38812.
22872
22873         * image.c (mono_image_init): Fixed warnings.
22874
22875         * class.c (mono_class_from_typeref): Handle assembly load failure
22876         correctly.
22877
22878         * appdomain.c (add_assemblies_to_domain): Handle the case when
22879         the references of an assembly are not yet loaded.
22880
22881         * metadata.c image.c assembly.c: Moved initialization of global
22882         variables to a separate function called at startup since lazy 
22883         initialization of these variables is not thread safe.
22884         
22885         * image.c assembly.c: Made this module thread safe by adding locks in 
22886         the appropriate places.
22887
22888         * domain.c (mono_init): Call the new initialization functions of the
22889         three modules.
22890
22891 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
22892
22893         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
22894           make a direct call. It is proxy's work to make the call asynchronous.
22895           mono_delegate_end_invoke(): If the targe is a proxy, just collect
22896           the return values.
22897         * object.cs: mono_method_call_message_new(): read AsyncResult and
22898           state object from parameters list, if this info is requested.
22899         * object.h: Added fields to store remote call output values in
22900           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
22901
22902 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
22903
22904         * object.h: add needed fields to MonoThread.
22905         * threads.c, threads.h: allow registering a function to cleanup data
22906         allocated per thread by the JIT.
22907
22908 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22909
22910         * loader.h: portability fix by Bernie Solomon
22911         * <bernard@ugsolutions.com>.
22912
22913 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
22914
22915         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
22916         return a MonoArray. This simplifies the code and also ensures that
22917         the cache allways contains an object reference as a value.
22918
22919         * icall.c (ves_icall_get_parameter_info): Simplified using the new
22920         function.
22921
22922 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22923
22924         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
22925         fixes a problem with byte ordering when getting the address family for
22926         a socket.
22927
22928 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
22929
22930         * .cvsignore: Added monosn.
22931
22932         * reflection.h reflection.c loader.c: Added support for parameter
22933         marshalling to dynamically created types. Fixes #47295.
22934
22935 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
22936
22937         * rand.c: remove useless warnings.
22938
22939 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
22940
22941         * class.c: implemented ldtoken for methods and fieldrefs.
22942
22943 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22944
22945         * threadpool.c: when mono_async_invoke was called, no one took care of
22946         monitoring the queue. So if the method invoked took some time and we
22947         got new async invoke requests after 500 ms (the thread created waited
22948         that long in WaitForSingleObject), the new async invoke was not called
22949         until the previous one finished.
22950
22951         This is fixed now. Thanks to Totte for helping with it.
22952
22953 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22954
22955         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
22956
22957 2003-08-11  Martin Baulig  <martin@ximian.com>
22958
22959         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
22960
22961 2003-08-06  Martin Baulig  <martin@ximian.com>
22962
22963         * mono-debug-debugger.c: Added support for static fields,
22964         properties and methods.
22965
22966 2003-08-06  Martin Baulig  <martin@ximian.com>
22967
22968         * mono-debug-debugger.c: Don't store the MonoString's vtable to
22969         make this work for applications with multiple application domains.
22970
22971 2003-08-04  Martin Baulig  <martin@ximian.com>
22972
22973         * mono-debug-debugger.c: Completely reworked the type support; the
22974         most important thing is that we're now just using one single
22975         `MonoType' instance per type.
22976
22977 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
22978
22979         * mono-endian.h, mono-endian.c, icall.c: Added icall
22980         ves_icall_System_Double_AssertEndianity to assert double word endianity
22981         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
22982
22983 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
22984
22985         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
22986         support, icalls and fixes.
22987
22988 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
22989
22990         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
22991         classes that are a punctuation character in .NET is not the same a
22992         g_unichar_ispunct.
22993
22994 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
22995
22996         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
22997
22998 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
22999
23000         * icall.c: Add new MemCopy internalcall.
23001         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
23002         Simplified code; It is not necessary to handle all the cases here,
23003         as the C# code takes care of it.  Only handle the case of the name
23004         resource embedded into the assembly.
23005
23006         Changed signature to return the data pointer and the size of the
23007         data. 
23008
23009 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
23010
23011         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
23012         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
23013
23014 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23015
23016         * socket-io.c: ignore EINTR error in select.
23017
23018 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
23019
23020         * class.h, class.c: removed unused subclasses field in MonoClass.
23021
23022 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
23023
23024         * icall.c: improve fix of get_base_definition(). If the parent class
23025           doesn't have the mehod, look at the parent of the parent.
23026         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
23027           to check if a parameter is an in or out parameter
23028           (PARAM_ATTRIBUTE_IN is not set by default).
23029           mono_method_return_message_restore(): Use mono_class_value_size to
23030           get the size of a value type. mono_type_stack_size (parameterType)
23031           does not return the correct value if parameterType is byRef.
23032           mono_load_remote_field(), mono_load_remote_field_new(),
23033           mono_store_remote_field(), mono_store_remote_field_new():
23034           raise exception if the remote call returns an exception.
23035
23036 2003-07-28  Martin Baulig  <martin@ximian.com>
23037
23038         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
23039         method.  This is a wrapper around mono_runtime_invoke() which
23040         boxes the instance object if neccessary.
23041
23042 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
23043
23044         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
23045         metadata.h, row-indexes.h, verify.c: first cut of generics support.
23046
23047 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
23048
23049         * icall.c: disable mcs bug workaround.
23050
23051 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
23052
23053         * object.c (mono_runtime_class_init): Take the metadata_section
23054         mutex before obtaining the domain mutex.
23055
23056         * appdomain.h: Added definition of metadata_section mutex here. 
23057
23058         * object.c: define metadata_mutex here.
23059
23060 2003-07-24  Ravi Pratap  <ravi@ximian.com>
23061
23062         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
23063         fixed.
23064
23065 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
23066
23067         * reflection.c: Fix bug #46669
23068
23069 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23070
23071         * exception.c:
23072         * exception.h:
23073         * icall.c:
23074         * object.h: fill in the type name for TypeLoadException.
23075
23076 2003-07-23  Ravi Pratap  <ravi@ximian.com>
23077
23078         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
23079         relationship between TypeBuilders while compiling corlib) and bug
23080         45993 (Array types returned from the runtime while compiling
23081         corlib were from the loaded corlib).
23082
23083 2003-07-22  Martin Baulig  <martin@ximian.com>
23084
23085         * mono-debug-debugger.c: Reworked the type support a bit more;
23086         distinguish between types and classes.
23087
23088 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
23089
23090         * icall.c: add IsArrayImpl icall.
23091
23092 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
23093
23094         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
23095         initializing real_size only once. Also fix bug #46602.
23096
23097 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
23098
23099         * object.c: Renamed mono_metadata_section to metadata_section.
23100
23101 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
23102
23103         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
23104           empty array if the type is an array. Fixed.
23105           ves_icall_MonoMethod_get_base_definition: if the base method
23106           is abstract, get the MethodInfo from the list of methods of
23107           the class.
23108         * reflection.c: ParameterInfo.PositionImpl should be zero-based
23109           and it was 1-based. Fixed in mono_param_get_objects.
23110
23111 2003-07-20  Martin Baulig  <martin@ximian.com>
23112
23113         * mono-debug.h: Set version number to 31.
23114         (mono_debug_init): Added `MonoDomain *' argument.
23115
23116         * mono-debug-debugger.c: Reworked the type support; explicitly
23117         tell the debugger about builtin types; pass the `klass' address to
23118         the debugger.
23119
23120 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
23121
23122         * image.c: Allow new metadata tables to be loaded without a
23123         warning. Also update the warning message to give the new constant value.
23124                 
23125 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
23126
23127         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
23128         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
23129         array type representation changes.
23130
23131 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
23132
23133         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
23134         on Environment.Exit () call.
23135
23136 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
23137
23138         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
23139         requires a matching corlib.
23140
23141 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
23142
23143         * Changelog: My editor decided to add a CR to each line. Sorry about that.
23144           Committed again without the CRs.
23145         
23146 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
23147
23148         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
23149           getting it from the "this" socket instance. Did not work
23150           if the socket is a subclass of Socket.
23151           Also fixed bug #35371.
23152
23153 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
23154
23155         * metadata.c: fixed size for TypedByRef.
23156         * loader.c: when searching for a method, consider the vararg amrker.
23157         * unicode.c, decimal.c: constify some arrays.
23158
23159 2003-07-15  Dick Porter  <dick@ximian.com>
23160
23161         * socket-io.c: Fixed compilation for gcc < 3.2.
23162
23163         Fixed compilation for machines that don't have AF_INET6 (thanks to
23164         Bernie Solomon <bernard@ugsolutions.com> for that part.)
23165
23166         Fixed compile warnings.
23167         
23168         Fixed formatting and line endings.
23169
23170 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
23171
23172         * socket-io.h:
23173         * socket-io.c: Added IPv6 support.
23174
23175 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
23176
23177         * class.c (mono_class_is_assignable_from): New function to implement
23178         the is_assignable_from logic. Used by mono_object_isinst, 
23179         Type::IsAssignableFrom () and the interpreter.
23180
23181         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
23182         Object, even interfaces.
23183         
23184         * object.c (mono_object_isinst): Implement in terms of 
23185         is_assignable_from.
23186
23187         * icall.c (ves_icall_type_is_assignable_from): New icall.
23188
23189 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
23190
23191         * domain.c (foreach_domain): fix compiler warning.
23192
23193 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
23194
23195         * image.c (load_metadata_ptrs): use g_strndup because strndup is
23196         not available on all plattforms
23197
23198 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
23199
23200         * image.h image.c: Store the metadata version string in MonoImage.
23201         * icall.c: New icall to retrieve the image version.
23202         * reflection.c (create_dynamic_image): Fill in the image version field
23203         * reflection.c (build_compressed_metadata): Use the image version
23204         from the image structure.
23205
23206 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23207
23208         * appdomain.c: modified comment.
23209         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
23210         That will be its last iteration when mono_gc_cleanup is called from
23211         mono_runtime_cleanup and before the domain is unloaded.
23212
23213         Fixes bug #45962.
23214
23215 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
23216
23217         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
23218         attributes.
23219
23220 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
23221
23222         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
23223         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
23224         Bernie Solomon <bernard@ugsolutions.com>.
23225
23226 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
23227
23228         * object.c, object.h: provide mono_object_new_fast() for faster
23229         allocation in some special cases.
23230
23231 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
23232
23233         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
23234         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
23235
23236 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
23237
23238         * threadpool.c: fix leaks.
23239
23240 2003-07-01  Dick Porter  <dick@ximian.com>
23241
23242         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
23243         using MonoGHashTables.  Fixes threadpool bug posted to list.
23244
23245 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
23246
23247         * image.h, image.c: added support to load an assembly from a byte array.
23248         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
23249         assembly bundle support.
23250
23251 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
23252
23253         * threadpool.c (mono_thread_pool_add): keep a reference to the
23254         AsyncResult to prevent GC
23255
23256 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
23257
23258         * class.c: leak fix.
23259
23260 2003-06-25  Dick Porter  <dick@ximian.com>
23261
23262         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
23263         for the async object, the WaitHandle object will close the handle.
23264         Fixes bug 45321.
23265
23266 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
23267
23268         * class.c: in mono_array_class_get (), lookup from the hash with the
23269         same type we insert: this works around a bug in
23270         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
23271         lluis. The real fix will have to wait for after the release.
23272
23273 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
23274
23275         * icall.c: fix memory leak when getting type members.
23276
23277 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
23278
23279         * reflection.c: added more pubtoken special cases.
23280
23281 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
23282
23283         * class.c: handle field offset correctly when class size
23284         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
23285
23286 2003-06-20  Martin Baulig  <martin@ximian.com>
23287
23288         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
23289         *image' field.
23290
23291 2003-06-20  Martin Baulig  <martin@ximian.com>
23292
23293         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
23294
23295 2003-06-20  Martin Baulig  <martin@ximian.com>
23296
23297         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
23298         just distinguish between variables in registers and variables at
23299         an offset relative to a register.
23300
23301 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23302
23303         * icall.c: #ifdef out latest changes until mcs is fixed.
23304
23305 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
23306
23307         * icall.c: return members in metadata order.
23308
23309 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
23310
23311         * icall.c: avoid infinite loop in GetTimeZoneData.
23312
23313 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
23314
23315         * icall.c: added Marshal.Prelink/All icalls.
23316
23317 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
23318
23319         * object.c, object.h: fix warnings and do some overflow checking
23320         when creating arrays.
23321
23322 2003-06-17  Dick Porter  <dick@ximian.com>
23323
23324         * file-io.h:
23325         * file-io.c: File attributes need to be tweaked slightly when
23326         passed from the managed to the w32 world.
23327
23328 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
23329         * profiler.h profiler-private.h profiler.c: Rework last patch
23330         based on suggestion by Paolo.
23331         
23332 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
23333
23334         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
23335         instruction level coverage data collection.
23336         * profiler.h profiler.c (: Added new callback function which can be
23337         used by the profiler to limit which functions should have coverage
23338         instrumentation.
23339         * profiler.c (mono_profiler_load): Call g_module_build_path to
23340         generate the file name of the profiler library.
23341
23342 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
23343
23344         * profiler.c, profiler.h, profiler-private.h: added basic block 
23345         coverage profiling API.
23346
23347 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
23348
23349         * reflection.c (mono_reflection_create_runtime_class): Add support
23350         for events in dynamically generated code.
23351
23352         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
23353         not allocated.
23354
23355 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
23356
23357         * icall.c: when getting timezone info, return reasonable values if we
23358         can't get the actual data.
23359
23360 2003-06-14  Dick Porter  <dick@ximian.com>
23361
23362         * threads.c (start_wrapper): Remove the reference to the thread
23363         object in the TLS data, so the thread object can be finalized.
23364         This won't be reached if the thread threw an uncaught exception,
23365         so those thread handles will stay referenced :-( (This is due to
23366         missing support for scanning thread-specific data in the Boehm GC
23367         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
23368
23369 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
23370
23371         * reflection.c: ensure streams and tables are first allocated with
23372         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
23373
23374 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
23375
23376         * icall.c: fixed GetElementType for byrefs (bug# 44792).
23377
23378 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
23379
23380         * reflection.c (mono_reflection_create_runtime_class): Add support for
23381         properties to dynamically created classes.
23382         * reflection.c: Fix a few places where non-MonoObjects were inserted
23383         into the tokens hashtable.
23384
23385 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
23386
23387         * object.c: some support to handle out of memory exceptions.
23388
23389 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
23390
23391         * marshal.c (mono_marshal_get_native_wrapper): support reference
23392         return types
23393
23394 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
23395
23396         * object.h, object.c: more portability stuff from Bernie Solomon.
23397         Unexport mono_object_allocate(). Added mono_object_unbox ().
23398         Set exitcode when an unhandled exception is thrown.
23399
23400 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
23401
23402         * marshal.c (mono_marshal_get_native_wrapper): use custom
23403         marshaler for return types.
23404
23405 2003-06-10  Dick Porter  <dick@ximian.com>
23406
23407         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
23408         ip_mreq is available
23409
23410 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
23411
23412         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
23413         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
23414         by Bernie Solomon <bernard@ugsolutions.com>.
23415
23416 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
23417
23418         * gc.c (mono_gc_init): Avoid error message on shutdown when
23419         GC_DONT_GC=1 is used.
23420
23421         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
23422         New icall to return the GUID of a module.
23423
23424 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
23425
23426         * class.c: ensure instance size always includes the parent's size
23427         even whem class size is set explicitly (fixes bug#44294).
23428
23429 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
23430
23431         * profiler.h, profiler.c: made the simple profiler thread-safe,
23432         get more accurate timing info. Allow the loading of an
23433         externally-developed profiler module.
23434
23435 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
23436
23437         * marshal.c (mono_marshal_get_native_wrapper): improved
23438         class/byref arguments.
23439         (mono_marshal_get_native_wrapper): better string marshaling support.
23440
23441 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
23442
23443         * class.c: ensure .pack and .size are handled correctly and
23444         simplified layout of static fields.
23445
23446 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
23447
23448         * appdomain.c
23449         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
23450
23451         * loader.c (mono_lookup_pinvoke_call): look for modules in the
23452         current directory (fix bug 44008)
23453
23454 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
23455
23456         * marshal.c (mono_marshal_get_native_wrapper): started support for
23457         custom marshalers.
23458         (mono_delegate_to_ftnptr): consider marshalling specifications
23459
23460 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
23461
23462         * reflection.c, reflection.h: emit custom marshal info.
23463
23464 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23465
23466         * object.c: free the GError.
23467         * icall.c: added CloseEvent_internal.
23468         * threads.[ch]:
23469         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
23470         call.
23471
23472 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
23473
23474         * loader.c (mono_method_get_signature): Add support for dynamic
23475         assemblies.
23476
23477 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
23478
23479         * reflection.c: fixed bug #43905.
23480
23481 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
23482
23483         * class.c, domain.c, icall.c, metadata.h, object.h: support for
23484         handling TypedReference and ArgIterator.
23485         * loader.c, loader.h: added function to get signature at call site.
23486
23487 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
23488
23489         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
23490         data readonly. Buglets and warning fixes. Some MethodSpec support.
23491
23492 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
23493
23494         * class.h, class.c, object.c: remove relative numbering support.
23495
23496 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
23497
23498         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
23499         free the string, until we get a chance to fix Gtk#
23500
23501 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23502
23503         * marshal.c: revert last patch.
23504
23505 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
23506
23507         * icall.c: updates for new mono_class_vtable() not calling
23508         the type constructor anymore.
23509
23510 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
23511
23512         * object.h, object.c: separate vtable creation from type
23513         initialization. Make running the .cctor thread safe.
23514
23515 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
23516
23517         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
23518
23519 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
23520
23521         * loader.c (mono_get_method): consider calling convention
23522
23523 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
23524
23525         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
23526         to return the invisible global type for a module.
23527
23528         * reflection.c (mono_image_build_metadata): Emit global fields too.
23529
23530 2003-05-20  Peter Williams  <peterw@ximian.com>
23531
23532         * loader.c (mono_lookup_internal_call): Add a few newlines.
23533
23534 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
23535
23536         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
23537         literal strings.
23538
23539         * appdomain.c (set_domain_search_path): Recalculate search path when
23540         AppDomainSetup.PrivateBinPath changes.
23541
23542         * object.c (mono_class_compute_gc_descriptor): It turns out some
23543         parts of the class libs (like System.Thread) holds pointers to
23544         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
23545         to treat native int a pointer type here.
23546         
23547 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
23548
23549         * appdomain.h, domain.c: add hashtable for jump target resolution.
23550
23551 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
23552
23553         * reflection.h reflection.c icall.c: Added new icalls 
23554         GetManifestResourceInfoInternal, GetModulesInternal and support
23555         infrastructure.
23556
23557 2003-05-16  Dick Porter  <dick@ximian.com>
23558
23559         * icall.c:
23560         * file-io.h:
23561         * file-io.c: Implement System.IO.MonoIO::GetTempPath
23562
23563 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
23564
23565         * object.c: mono_store_remote_field: little fix to previous patch.
23566
23567 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
23568
23569         * class.c: add constructors to array classes.
23570         * icall.c: special case array construction for InternalInvoke (),
23571
23572 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
23573
23574         * class.h class.c reflection.c object.c: Added support for field
23575         defaults in dynamically generated classes.
23576
23577 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
23578
23579         * reflection.c: properly encode charset for ddlimport.
23580
23581 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
23582
23583         * threads.c: allow compiling without GC.
23584
23585 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
23586
23587         * appdomain.h, object.c, object.h, threads.c, threads.h: added
23588         handling of thread static data.
23589
23590 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
23591
23592         * reflection.h, reflection.c: added mono_custom_attrs_free ().
23593
23594 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
23595
23596         * class.c (mono_array_class_get): always set the serializable flags
23597         (mono_array_class_get): always set the SEALED attribute for array types
23598
23599 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
23600
23601         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
23602         attributes (fix for bug 42021).
23603
23604 2003-05-12  Dick Porter  <dick@ximian.com>
23605
23606         * gc.c: Don't run finalizers when the finalizer thread is
23607         finishing up, because the default domain has already been
23608         destroyed.
23609
23610 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
23611
23612         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
23613         value is null, we should throw an exception.   This is slightly
23614         different than the other conventions used for the constructor.
23615
23616 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23617
23618         * socket-io.c: fixed windows build.
23619
23620 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23621
23622         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
23623
23624 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
23625
23626         * object.c (mono_string_new_wrapper): Compatibility fix for MS
23627         compilers.
23628
23629 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
23630
23631         * class.c (mono_class_layout_fields): Add experimental GC aware
23632         auto layout facility. Requires class library changes to work correctly.
23633
23634         (mono_class_setup_vtable): Avoid overriding explicit interface
23635         method implementations. Fixes iface3.exe test.
23636
23637         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
23638         object reference.
23639         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
23640         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
23641
23642         * metadata.h: Add new type classification macro which determines
23643         whenever the type holds an object reference.
23644
23645 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
23646
23647         * marshal.c (mono_marshal_get_native_wrapper): cleanups
23648
23649 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
23650
23651         * gc.c (finalizer_thread): Work around a GC bug.
23652
23653 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
23654
23655         * marshal.c (emit_struct_conv): allow unions
23656
23657         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
23658
23659 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
23660
23661         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
23662
23663 2003-05-06  Martin Baulig  <martin@ximian.com>
23664
23665         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
23666
23667 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23668
23669         * socket-io.c:
23670         (Select_internal): allow NULLs, don't create arrays if not needed.
23671         Coupled with Socket.cs changes.
23672
23673         * threadpool.c:
23674         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
23675         register a finalizer for it that will close the semaphore handle. This
23676         fixes the leak and make Lupus' test run with > 4080 loops.
23677
23678 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
23679
23680         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
23681         Jerome Laban (bug #42287)
23682
23683 2003-05-02  Martin Baulig  <martin@ximian.com>
23684
23685         * debug-mono-symfile.h
23686         (MonoSymbolFile): Moved declaration into mono-debug.h.
23687         (MonoDebugMethodJitInfo): Likewise.
23688         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
23689         argument.
23690         (_mono_debug_address_from_il_offset): Take a
23691         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
23692
23693         * mono-debug.h
23694         (MonoDebugDomainData): New struct.
23695         (mono_debug_get_domain_data): New function.
23696         (mono_debug_add_method): Take an additional `MonoDomain *'
23697         argument.
23698         (mono_debug_source_location_from_address): Likewise.
23699         (mono_debug_il_offset_from_address): Likewise.
23700         (mono_debug_address_from_il_offset): Likewise.
23701
23702 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
23703
23704         * reflection.c: one more check for null type in custom attrs.
23705
23706 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23707
23708         * reflection.c: avoid warning (comparison is always false due to limited
23709         range of data type).
23710
23711 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23712
23713         * icall.c: throw an exception in Type.GetField if the argument 'name'
23714         is NULL.
23715
23716 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
23717
23718         * reflection.c: fixed handling of enums in named arguments to custom
23719         attributes (bug #42123).
23720
23721 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
23722
23723         * reflection.c: use the right array element type and handle
23724         a null for a Type argument, too.
23725
23726 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
23727
23728         * reflection.c: handle arrays as arguments to custom attributes.
23729
23730 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
23731
23732         * reflection.c: handle a string value in a custom attr
23733         ctor that takes an object.
23734
23735 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
23736
23737         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
23738         (fix bug #42063)
23739
23740 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
23741
23742         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
23743
23744 2003-04-27  Martin Baulig  <martin@ximian.com>
23745
23746         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
23747         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
23748         MONO_DEBUGGER_EVENT_BREAKPOINT.
23749         (mono_breakpoint_trampoline_code): Removed.
23750         (mono_debugger_event_handler): The last argument is now a
23751         `guint32'.
23752         (mono_debugger_insert_breakpoint_full): Removed the
23753         `use_trampoline' argument.
23754         (mono_debugger_method_has_breakpoint): Likewise.
23755         (mono_debugger_trampoline_breakpoint_callback): Renamed to
23756         mono_debugger_breakpoint_callback(); take the method and
23757         breakpoint number as arguments.
23758
23759 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
23760
23761         * metadata.c: fix off by one when loading parameters attributes.
23762
23763 2003-04-24  Martin Baulig  <martin@ximian.com>
23764
23765         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
23766
23767 2003-04-24  Martin Baulig  <martin@ximian.com>
23768
23769         * mono-debug-debugger.c: Moved all code which interacts with the
23770         Mono Debugger here.
23771
23772         * debug-mono-symfile.c: This code now just deals with the symbol
23773         file itself, the debugger code is now in mono-debug-debugger.c.
23774
23775 2003-04-23  Martin Baulig  <martin@ximian.com>
23776
23777         * mono-debug.c (mono_debug_source_location_from_il_offset):
23778         New method; like mono_debug_source_location_from_address(), but
23779         takes an IL offset instead of a machine address.
23780
23781 2003-04-23  Martin Baulig  <martin@ximian.com>
23782
23783         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
23784         `line' field; this is now computed by the debugger.
23785
23786 2003-04-23  Martin Baulig  <martin@ximian.com>
23787
23788         * mono-debug.[ch]: New files.  This is the new debugging interface.
23789
23790         * mono-debug-debugger.[ch]: New files.  Moved all code which
23791         interacts with the Mono Debugger here.
23792
23793 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
23794
23795         * domain.c (mono_init): initialize mono_defaults.monitor_class
23796
23797 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
23798
23799         * reflection.c (method_encode_code): Add a spicy exception to help
23800         future compiler authors.
23801
23802 2003-04-21  Martin Baulig  <martin@ximian.com>
23803
23804         * icall.c
23805         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
23806         Make this work with relative pathnames; g_filename_to_uri() needs
23807         an absolute filename.
23808
23809 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
23810
23811         * icall.c: Track name changes in Object and ValueType.
23812
23813 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
23814
23815         * metadata.c (mono_type_stack_size): size should be a multiple of
23816         sizeof (gpointer)
23817
23818 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23819
23820         * gc.c:
23821         (internal_domain_finalize): moved into mono_domain_finalize. No need
23822         to create another thread because the finalizers will be run in the
23823         finalizer thread.
23824         
23825         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
23826         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
23827         to be run (MS does this too).
23828
23829 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
23830
23831         * object.c (mono_class_compute_gc_descriptor): Update comment.
23832
23833         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
23834
23835         * image.h: Add synchronized wrapper cache.
23836
23837         * image.c (do_mono_image_open): Initialize cache.
23838
23839         * reflection.c (create_dynamic_mono_image): Initialize cache.
23840
23841 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23842
23843         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
23844         ves_icall_System_Buffer_ByteLengthInternal.
23845
23846 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
23847
23848         * reflection.c: setup klass->nested_in earlier. Allow
23849         a dash in the assembly name.
23850
23851 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
23852
23853         * metadata.c (mono_type_to_unmanaged): dont access
23854         type->data.klass for MONO_TYPE_OBJECT
23855         (mono_type_to_unmanaged): consider System.Delegate class
23856
23857 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
23858
23859         * class.c: just setup supertypes in the proper place instead of
23860         initializing the full element class for arrays.
23861
23862 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
23863
23864         * class.c: ensure the element class of arrays is initialized.
23865         Setup the supertype info for array classes, too.
23866
23867 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
23868
23869         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
23870
23871 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23872
23873         * Makefile.am: re-added -m option when running cygpath. This way,
23874         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
23875         separator.
23876         * mono-config.c: same codepath for locating mono config file for WIN32
23877         and the rest.
23878         * assembly.c: if mono_assembly_setrootdir is called, don't override
23879         the value set.
23880
23881 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23882
23883         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
23884         MONO_ASSEMBLIES variable.
23885
23886 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
23887
23888         * icall.c: added Assembly::GetNamespaces() icall.
23889
23890 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23891
23892         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
23893
23894 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
23895
23896         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
23897         * object.c: fixed bug in the construction of vtable for proxies
23898
23899 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
23900
23901         * object.c (mono_array_new): Mark mono_array_new as an icall.
23902
23903 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23904
23905         * class.c: fixed test for public method when overriding interfaces.
23906         Closes bug #40970.
23907
23908 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
23909
23910         * appdomain.h, domain.c: added mono_domain_foreach() to
23911         be able to access the currently loaded appdomains.
23912         * object.c: make string interning work across sppdomains.
23913         Mark some functions for use as icalls.
23914
23915 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
23916
23917         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
23918
23919         * reflection.h reflection.c: Allocate long living data using 
23920         GC_MALLOC_ATOMIC so the collector does not need to scan it.
23921
23922         * reflection.c: Double the allocation size in streams instead of
23923         increasing it, to prevent unneccesary copying on large assemblies.
23924         
23925         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
23926         creation if the assembly does not have the Run flag set.
23927
23928 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
23929
23930         * class.h: avoid the C++ keywords in header files (Jerome Laban
23931         spotted and fixed this).
23932
23933 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23934
23935         * object.c:
23936         (mono_unhandled_exception): fill in the arguments for the
23937         UnhandledException event. Only trigger that event for the default
23938         domain (as MS does).
23939
23940 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
23941
23942         * object.c: Improve typed allocation stuff based on suggestions from
23943         Paolo. Also turn it on if the GC library supports it.
23944
23945 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
23946
23947         * object.c object.h class.h: Added experimental typed allocation
23948         facility using the interfaces in gc_gcj.h.
23949
23950         * os/gc_wrapper.h: Added new include files.
23951         
23952 2003-04-03  Martin Baulig  <martin@ximian.com>
23953
23954         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
23955         which is not yet enabled by default.
23956
23957         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
23958         functions.
23959         (mono_gc_lock, mono_gc_unlock): New static functions.
23960
23961         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
23962         functions; stop/start the world for the garbage collector.  This
23963         is using the windows API; we need to complete the SuspendThread()/
23964         ResumeThread() implementation in the io-layer to make this work on Unix.
23965         (mono_gc_push_all_stacks): New public function; tells the garbage
23966         collector about the stack pointers from all managed threads.
23967
23968 2003-04-03  Martin Baulig  <martin@ximian.com>
23969
23970         * object.h (MonoThread): Added `gpointer stack_ptr'.
23971
23972         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
23973
23974 2003-04-03  Martin Baulig  <martin@ximian.com>
23975
23976         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
23977
23978 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
23979
23980         * reflection.c (typebuilder_setup_fields): Initialize field.first and
23981         field.last.
23982
23983 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
23984
23985         * loader.c (mono_lookup_internal_call): Report the corlib that is
23986         out of sync.
23987
23988 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
23989
23990         * icall.c (ves_icall_type_GetTypeCode): fixed check for
23991         System.DBNull (it's class not valuetype).
23992
23993 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
23994
23995         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
23996         if the array method was already assigned a token (fixes bug#40646).
23997
23998 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
23999
24000         * reflection.c (mono_reflection_get_type): Attempt type resolve even
24001         if no assembly is given.
24002
24003 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
24004
24005         * metadata.h: Added the new tables.
24006
24007         * row-indexes.h: Added definitions for new tables.
24008
24009         * metadata.c: Add schemas for new tables, and add support for
24010         computing the sizes of them.
24011
24012         * class.c: Update for handling the new type cases.
24013
24014 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
24015
24016         * metadata.h (MONO_TYPE_IS_VOID): new macro
24017
24018 2003-03-31  Martin Baulig  <martin@ximian.com>
24019
24020         * threads.h (MonoThreadCallbacks): Added `thread_created'.
24021
24022         * threads.c (mono_thread_new_init): Call `thread_created' in the
24023         mono_thread_callbacks.
24024
24025 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
24026
24027         * loader.h: added marshalbyrefobject_class to mono_defaults
24028         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
24029         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
24030           generation of output parameters.
24031           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
24032         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
24033           contextbound and the target object belongs to the context of the caller.
24034         * object.h: added context and unwrapped_server variables in MonoRealProxy.
24035         * object.c: Implemented support for interfaces and abstract classes
24036           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
24037           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
24038
24039 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
24040
24041         * class.h class.c (mono_class_is_subclass_of): New function.
24042         
24043         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
24044         routines for most common case (calls from ArrayList::ToArray).
24045
24046         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
24047         routine so programs which call Environment::Exit() can be profiled.
24048
24049         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
24050         Added MONO_ARCH_SAVE_REGS.
24051
24052         * icall.c (ves_icall_type_is_subtype_of): Use new function.
24053
24054 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
24055
24056         * blob.h: Add a couple of new MonoType types definitions.
24057
24058         * tabledefs.h: Add a couple of new call convs.
24059
24060 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
24061
24062         * reflection.h (MonoReflectionDynamicAssembly): track changes in
24063         the layout of the class.
24064
24065         * reflection.c (alloc_table): double the size on overflow to avoid
24066         unnecessary copying.
24067
24068         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
24069         avoid filling out metadata tables and blobs. Also set mb->ilgen to
24070         null so it can be garbage collected.
24071         
24072 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
24073
24074         * reflection.c (mono_reflection_get_type): Return the resolved type
24075         only if it is in the assembly we searched.
24076
24077         * reflection.c (ensure_runtime_vtable): Initialize method slots.
24078
24079         * class.c (mono_class_setup_vtable): Set the slot of the overriding
24080         method.
24081
24082 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24083
24084         * appdomain.c:
24085         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
24086         the right one is 'file:///blah', but MS allows it.
24087         * assembly.c:
24088         (mono_assembly_open): allow 'file://blah'
24089
24090         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
24091
24092 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
24093
24094         * socket-io.c: fixes bug #40310.
24095
24096 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
24097
24098         * reflection.c (mono_reflection_parse_type): handle deeply nested
24099         types correctly.
24100
24101         * reflection.c (mono_image_create_token): Use unique token values
24102         since they will be put into a hash table.
24103
24104         * class.c (mono_class_setup_vtable): If a method occurs in more than
24105         one place in the vtable, and it gets overriden, then change the
24106         other occurances too.
24107
24108         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
24109         object as return type.
24110
24111 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
24112
24113         * icall.c: Deleted "ToString" implementation for double and float
24114         because they are full implemented in managed code.
24115
24116 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
24117
24118         * reflection.c, reflection.h: implemented and exported functions
24119         to retrieve info about custom attributes.
24120
24121 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24122
24123         * appdomain.c: moved Uri handling to assembly.c
24124         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
24125         work when using a file Uri in *nix and windows.
24126
24127         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
24128         GetReferencedAssemblies.
24129
24130 2003-03-18  Dick Porter  <dick@ximian.com>
24131
24132         * icall.c: Rename a couple of internal calls
24133
24134         * threads.c: Set the thread state to Stopped when a thread exits.
24135         Fixes bug 39377.
24136
24137 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
24138
24139         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
24140         New icall.
24141
24142         * object.c (mono_class_vtable): fix warning.
24143
24144 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
24145
24146         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
24147
24148         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
24149         memory.
24150         (method_encode_clauses): Create exception info structures in the right
24151         order.
24152         (mono_reflection_setup_internal_class): Initialize supertypes field.
24153
24154         * class.c object.c: Handle interfaces which implement other interfaces 
24155         correctly.
24156
24157         * class.h class.c: Move the supertypes array initialization code into 
24158         a separate function so it can be used for dynamic types too. Also call
24159         it earlier, in mono_class_init(), since it can be used before the
24160         type is initialized.
24161
24162 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24163
24164         * Makefile.am:
24165         * assembly.c:
24166         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
24167
24168         * appdomain.c:
24169         * appdomain.h:
24170         * marshal.c:
24171         * object.c: remove warnings.
24172
24173 2003-03-13  Martin Baulig  <martin@ximian.com>
24174
24175         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
24176         (MonoDebugLexicalBlockEntry): New types.
24177
24178         * debug-mono-symfile.c
24179         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
24180
24181 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24182
24183         * process.c: ret can be any non-zero value accroding to MS doc.
24184
24185 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
24186
24187         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
24188         fixing a warning for a miss-used prototype, would have cause
24189         random memory corruption.
24190
24191 2003-03-07  Martin Baulig  <martin@ximian.com>
24192
24193         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
24194         getting really annoying ....
24195
24196 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
24197
24198         * reflection.c (fixup_method): added support for array methods.
24199
24200 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
24201
24202         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
24203         (pointed out by Michael Adams).
24204
24205 2003-03-04  Dick Porter  <dick@ximian.com>
24206
24207         * icall.c: Temporarily reverted the Double and Single ToString()
24208         change, because it broke nunit.
24209
24210 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
24211
24212         * object.h, threads.h: make include files compatible with C++
24213         (patch by Jerome Laban <jlaban@wanadoo.fr>).
24214
24215 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
24216
24217         * icall.c: Erased ToString helper functions for Double and Single.
24218         Now, that implementations ar all in managed code (Double and Single
24219         Formatters).
24220
24221 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
24222
24223         * appdomain.c: Added method for initializing the default context of
24224         a domain. Added internal call for getting the default context.
24225         * appdomain.h: Added context variable in MonoDomain struct.
24226         * domain.c: mono_domain_set also sets the default context of the domain
24227         * icall.c: Mapped internal method InternalGetDefaultContext.
24228         * object.c: mono_object_get_virtual_method returns always a remoting
24229         wrapper if the object is a transparent proxy.
24230         mono_runtime_invoke_array: when creating an object by calling the
24231         constructor, if the created object is a proxy, then the constructor should
24232         be called using the a remoting wrapper.
24233
24234 2003-03-03  Dick Porter  <dick@ximian.com>
24235
24236         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
24237         variable so it compiles on solaris.  Problem spotted by
24238         Christopher Taylor <ct@cs.clemson.edu>
24239
24240 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24241
24242         * appdomain.c:
24243         (get_info_from_assembly_name): don't leak value.
24244
24245         * icall.c:
24246         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
24247         result.
24248
24249 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
24250
24251         * assembly.c: export mono_image_load_references ().
24252         * class.c: handle function pointers. mono_class_from_name() now
24253         supports nested type names directly.
24254
24255 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
24256
24257         * reflection.h reflection.c: Encode already created dynamic methods 
24258         and fields correctly as a DEF instead of a REF.
24259
24260         * reflection.c: Get rid of the force_ref argument to 
24261         mono_image_typedef_or_ref since it was wrong in the first place.
24262
24263         * string-icalls.c: add error checking to string constructors according
24264         to the MSDN docs.
24265
24266         * reflection.c: Emit types in the order their TypeBuilders were 
24267         created. Previously, a new table index was assigned to each type before
24268         the tables were emitted. This was wrong because the signature blob
24269         might already refer to a type by its original table index.
24270
24271 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
24272
24273         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
24274         change.
24275         
24276 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24277
24278         * Makefile.am: make assemblies dir have \ instead of / on windows.
24279
24280 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
24281
24282         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
24283         iterate over the NESTEDCLASS table using a linear search since the
24284         table is not guaranteed to be sorted by the secondary key.
24285
24286         * class.c (mono_class_create_from_typedef): fixed up call to
24287         mono_metadata_nesting_typedef.
24288         
24289 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
24290
24291         * marshal.c (mono_string_to_byvalstr): clear the memory as
24292         suggested by Jerome Laban <jlaban@wanadoo.fr>
24293
24294 2003-02-26  Dick Porter  <dick@ximian.com>
24295
24296         * process.c: Cope with padding in .rsrc blocks
24297
24298 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
24299
24300         * metadata.h: reverted the filter_len change, it breaks reflection
24301         
24302 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
24303
24304         * metadata.h: added a new field to store the filter_len
24305         
24306
24307 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
24308
24309         * reflection.c: handle custom attributes for types and members
24310         created with Reflection.Emit (bug#38422).
24311
24312 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
24313
24314         * reflection.c: define RTSpecialName automatically for constructors for
24315         compatibility with MS.NET.
24316
24317         * reflection.c (mono_reflection_create_runtime_class): initialize
24318         nested_in field of dynamically created classes.
24319
24320 2003-02-22  Martin Baulig  <martin@ximian.com>
24321
24322         * debug-mono-symfile.h: Incremented version number.
24323
24324 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
24325
24326         * object.h icall.c process.c: fix warnings.
24327
24328 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
24329
24330         * appdomain.h appdomain.c:
24331         (mono_domain_try_type_resolve): split the 
24332         name_or_tb argument into a name and a tb argument.
24333         (mono_domain_has_type_resolve): new function to check whenever the
24334         application has registered a TypeResolve event handler.
24335         
24336         * icall.c reflection.h reflection.c: move the type resolve logic into
24337         mono_reflection_get_type () so it will be invoked when 
24338         Assembly::GetType () is called.
24339
24340         * reflection.c:
24341         (mono_reflection_get_type): renamed to get_type_internal.
24342         (mono_reflection_get_type): fixed type name generation so it works 
24343         for nested types too.
24344         (mono_reflection_get_type): call has_type_resolve () to avoid the 
24345         costly type name generation if there is no resolve event handler.
24346
24347 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
24348
24349         * class.c, image.c: load exported types from file references.
24350
24351 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
24352
24353         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
24354           used to cache the managed methods used to create proxies and make 
24355           remote invocation of methods.
24356         * class.h: Added in MonoVTable a flag to indicate that a class needs 
24357           to be remotely created.
24358         * object.c: Modified the method mono_class_vtable(). It now initializes 
24359           the remote flag of the vtable. Modified mono_object_new_specific(), 
24360           so now it checks the remote flag.
24361         * icall.c: Added a couple of internal methods, one for enabling instance 
24362           creation interception for a type, and one for creating objects bypassing
24363           the remote check.
24364
24365 2003-02-18  Martin Baulig  <martin@ximian.com>
24366
24367         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
24368         New interncall to get a method's metadata token.
24369
24370         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
24371         New interncall for the debugger.
24372
24373 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
24374
24375         * class.c (mono_class_setup_vtable): allocate supertype array
24376
24377 2003-02-18  Martin Baulig  <martin@ximian.com>
24378
24379         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
24380
24381 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24382
24383         * reflection.c:
24384         (assembly_name_to_aname): jump over unknown properties (i've found
24385         something like: 'type, assembly, version=xxx, custom=null, public...',
24386         so now will ignore custom=null and still get the rest of the values).
24387
24388 2003-02-17  Dick Porter  <dick@ximian.com>
24389
24390         * threads.c: Have Thread.Start() wait for a semaphore to signal
24391         that the thread has set up all its local data.  This fixes bug
24392         34323, where Abort() raced the new thread's TLS data.
24393
24394         Also removes the handle_store() call from start_wrapper, because
24395         threads are now always created suspended and there is no longer a
24396         race between the parent and child threads to store the info.
24397
24398 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
24399
24400         * image.c: explain the #- heap issue in a message, hopefully
24401         avoiding FAQs on mono-list.
24402
24403 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24404
24405         * icall.c:
24406         (GetEntryAssembly): if the domain has not invoked
24407         AppDomain.ExecuteAssembly yet, return the assembly of the default
24408         AppDomain.
24409
24410 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
24411
24412         * class.c (mono_ldtoken): make it work in dynamic assemblies.
24413
24414 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
24415
24416         * metadata.c, reflection.c: simple speedup to type hash
24417         and equals code.
24418
24419 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
24420
24421         * image.c, image.h, class.c, assembly.c: move module loading
24422         to MonoImage. When loading metadata, consider alignemnet from
24423         the start of metadata, not from the metadata address in memory.
24424
24425 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
24426
24427         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
24428         AssemblyBuilder objects. Factored out custom attribute creation into
24429         a separate function.
24430         (create_custom_attr): new function to create custom attributes.
24431
24432 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
24433
24434         * Makefile.am: Got tired of typing the full pathname to pedump.
24435         Until there is another option, am installing this.
24436
24437 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
24438
24439         * class.c (class_compute_field_layout): always set field->parent 
24440         (mono_ldtoken): use mono_defaults.fieldhandle_class;
24441
24442 2003-02-11  Dick Porter  <dick@ximian.com>
24443
24444         * threads-types.h:
24445         * monitor.c: Rewrote Monitor, making lock much faster and
24446         Pulse/Wait work as specified.  Also uses much fewer handles, and only
24447         creates them as needed.
24448
24449         * exception.c: Added SynchronizationLockException
24450
24451         * threads.c: Deleted old Monitor implementation.  The new one is
24452         in a new file.
24453
24454 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
24455
24456         * class.c: handled TypedReference type code. Set the correct size for
24457         class data. Setup interface_offsets for interface classes, too.
24458
24459 2003-02-09  Martin Baulig  <martin@ximian.com>
24460
24461         * debug-mono-symfile.h: Reflect latest symbol writer changes.
24462
24463 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
24464
24465         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
24466         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
24467         * object.c: fixed mono_object_get_virtual_method () for interfaces.
24468         * verify.c: check for code that runs after the end of the method.
24469
24470 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
24471
24472         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
24473         "System.Math::Round2".
24474         * sysmath.h: Added Floor, Round and Round2 definitions.
24475         * sysmath.c: Modified certain functions that were not 100% compliant
24476         with MS.NET (math precision) and added the implementation of Floor,
24477         Round and Round2.
24478
24479 2003-02-07  Martin Baulig  <martin@ximian.com>
24480
24481         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
24482
24483 2003-02-07  Martin Baulig  <martin@ximian.com>
24484
24485         * debug-mono-symfile.c: Reflected latest symwriter changes.
24486         (mono_debug_create_mono_symbol_file): Removed.
24487         (mono_debug_open_mono_symbol_file): Take an argument which
24488         specifies whether to create a dynamic symbol file.
24489
24490 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
24491
24492         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
24493
24494 2003-02-05  Martin Baulig  <martin@ximian.com>
24495
24496         * reflection.c (mono_image_build_metadata): Make this public,
24497         protect it against being called multiple times, don't create
24498         resources and don't build the compressed metadata here.
24499         (mono_image_create_pefile): Do this here.
24500
24501         * icall.c
24502         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
24503
24504 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24505
24506         * socket-io.c: fixed bug #36322.
24507
24508 2003-02-06  Piers Haken <piersh@friskit.com>
24509
24510         * appdomain.[ch]:
24511         * class.h:
24512         * debug-mono-symfile.c:
24513         * icall.c:
24514         * loader.c:
24515         * mono-config.c:
24516         * monosn.c:
24517         * reflection.c:
24518         * socket-io.c: warning cleanups
24519
24520 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
24521
24522         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
24523         function. works like remoting invoke, but does a check for the Proxy first.
24524
24525 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
24526
24527         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
24528
24529 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
24530
24531         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
24532         array of pointers.
24533         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
24534         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
24535
24536         * object.c (mono_store_remote_field_new): used by the new jit
24537         instead of mono_store_remote_field
24538         (mono_load_remote_field_new): used by the new jit
24539         instead of mono_load_remote_field
24540
24541 2003-02-05  Patrik Torstensson
24542
24543         * appdomain.c: changed unload to take the domain id instead
24544         of domain
24545         
24546         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
24547
24548
24549 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24550
24551         * appdomain.c: don't look for assemblies in ApplicationBase if
24552         PrivateBinPathProbe is set.
24553
24554 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24555
24556         * object.c: make the first argument in main_args contain the absolute
24557         path to the assembly. Fixes bug #37511.
24558
24559 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24560
24561         * icall.c: get correct UTC offset for countries not using daylight
24562         time saving. Fixes bug #30030.
24563
24564 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24565
24566         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
24567         and 1 are the family).
24568
24569 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
24570
24571         * icall.c (ves_icall_InternalExecute): removed wrong assertion
24572
24573         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
24574
24575 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
24576
24577         * reflection.c: added support for SignatureHelper tokens, which is
24578         needed by the Calli opcode.
24579
24580         * reflection.h: track changes to SignatureHelper class.
24581
24582         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
24583
24584 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24585
24586         * appdomain.c: fixed loading assemblies from PrivateBinPath.
24587
24588 2003-02-03  Patrik Torstensson
24589         * appdomain.[c|h], domain.c : 
24590          - Added support for getting a domain via domain id
24591          - Support for setting and getting domain from System.AppDomain 
24592            (used in cross appdomain channel)
24593          - Added support for get/set for a MonoAppContext on a thread 
24594            (Context class in System.Runtime.Remoting.Contexts),
24595          - Removed hack in Get/SetData and ExecuteAssembly.
24596         
24597         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
24598         the managed world to get control when a proxy is created.
24599
24600         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
24601         
24602 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
24603
24604         * icall.c
24605         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24606         Populate the codebase field as well.
24607
24608 2003-02-02  Martin Baulig  <martin@ximian.com>
24609
24610         * debug-mono-symfile.c
24611         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
24612         (mono_debug_symfile_add_method): Allow interncalls.
24613
24614 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24615
24616         * icall.c: throw parse exception if strtod fails or the string is empty.
24617
24618 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
24619
24620         * marshal.c: handle object type separately from defined
24621         class types.
24622
24623 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
24624
24625         * marshal.c: handle NATIVE_LPSTR for strings when it's
24626         explicitly specified.
24627
24628 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
24629
24630         * reflection.c, reflection.h, icall.c: setup the reflection
24631         handle cache for ModuleBuilders and AssemblyBuilders.
24632
24633 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
24634
24635         * reflection.c (reflection_methodbuilder_to_mono_method): set
24636         pinvoke flag
24637
24638 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24639
24640         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
24641
24642 2003-01-29  Dick Porter  <dick@ximian.com>
24643
24644         * threads.c: No need for the fake_thread kludge now that Thread
24645         doesn't run a class constructor
24646         
24647 2003-01-29  Dick Porter  <dick@ximian.com>
24648
24649         * threads.c: Use g_direct_hash instead of the rather bogus
24650         g_int_hash
24651
24652 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
24653
24654         * marshal.c (mono_marshal_get_native_wrapper): add check for null
24655         (fix pinvoke12.exe)
24656         (mono_marshal_get_struct_to_ptr): generate valid IL code
24657         (mono_marshal_get_ptr_to_struct): generate valid IL code
24658         (*): correctly set sig->pinvoke, we need to memdup the signature
24659         to do that
24660
24661 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
24662
24663         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
24664         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
24665
24666 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
24667
24668         * profiler.c: provide more callers information.
24669
24670 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
24671
24672         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
24673
24674         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
24675
24676         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
24677
24678 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24679
24680         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
24681         exception instead of going into an infinite loop on dates which it 
24682         can't yet handle.
24683
24684         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
24685         out-of-range exception if needed.
24686
24687         * class.c (mono_class_setup_vtable): allow a virtual method to provide
24688         an implementation for an interface method and to override an inherited
24689         method at the same time. 
24690         Imagine a scenario when a virtual method is used to override a
24691         virtual abstract method in a parent class, and this same method 
24692         provides an implementation for an method inherited from an interface. 
24693         In this case, the interface resolution code will set im->slot, which 
24694         means that the virtual method override pass will skip this method 
24695         which means a pointer to the abstract method inherited from the parent
24696         will remain in the vtable of this non-abstract class.
24697
24698         * class.c: (mono_class_setup_vtable): continue search for a real 
24699         method if only an abstract method is found.     
24700
24701 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
24702
24703         * reflection.c: add size to encoding for ByValStr and ByValArray
24704         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
24705
24706 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24707
24708         * class.c (mono_class_setup_vtable): pass the override info as an
24709         argument.
24710
24711         * class.c (mono_class_setup_vtable): set the slot of overriding methods
24712         correctly.
24713         
24714         * reflection.c (ensure_runtime_vtable); add support for method 
24715         overrides.
24716         
24717 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24718
24719         * reflection.c (resolution_scope_from_image): Hack to work to work with
24720         dynamic assemblies.
24721
24722         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
24723         added a 'force_ref' argument to force this function to allways return 
24724         a TypeRef. This is needed by mono_image_get_memberref_token ().
24725         
24726 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24727
24728         * reflection.c (mono_image_get_type_info): interfaces really don't have
24729         a parent.
24730
24731         * reflection.c (mono_image_basic_init): fill out missing fields of
24732         image structure.
24733
24734         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
24735         dynamic assemblies. This is required so dynamic assemblies show up in
24736         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
24737         Type::GetType() etc. This is consistent with MS behaviour.
24738
24739         * image.c image.h reflection.c: add newly created classes to the name 
24740         cache so mono_class_get () will find them.      
24741
24742 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
24743
24744         First part of changes to get IKVM.NET running under mono.
24745         
24746         * appdomain.h, appdomain.c: added new function 
24747         mono_domain_try_type_resolve() which will emit TypeResolve events. 
24748         This function will call AppDomain::DoTypeResolve to do the actual work.
24749
24750         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
24751         moved existing code dealing with dynamic tokens to a new function 
24752         called mono_reflection_lookup_dynamic_token (). This function will 
24753         raise TypeResolve events when appropriate. Since reflection.c is not 
24754         part of libmetadata, a new hook function called 
24755         mono_lookup_dynamic_token() is added to class.c which will call this.
24756
24757         * assembly.h assembly.c: make the invoke_load_hook function public,
24758         so it can be called for dynamic assemblies.
24759
24760         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
24761
24762         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
24763         type isn't found.
24764
24765         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
24766         MonoGHashTable, since it contains pointers to objects which the GC 
24767         needs to track.
24768
24769         * assembly.c (search_loaded): remove unused variable.
24770         
24771 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
24772
24773         * object.c: fixed issue exposed by gcc-generated IL programs
24774         that use RVA data for pointers.
24775
24776 2003-01-25  Martin Baulig  <martin@ximian.com>
24777
24778         * threads.c (start_wrapper): Moved the initialization of
24779         `start_func' above the mono_new_thread_init() call to which we
24780         pass it as argument.
24781
24782 2003-01-24  Martin Baulig  <martin@ximian.com>
24783
24784         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
24785         the MonoThread pointer.
24786
24787 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
24788
24789         * icall.c: Rename `PowImpl' to Pow.
24790
24791 2003-01-23  Dick Porter  <dick@ximian.com>
24792
24793         * threads.c (start_wrapper): Create a Thread object if needed, so
24794         the Main() thread can do the class initialisation in a subthread
24795         that has been set up to allow managed code execution.
24796
24797         Pass the thread ID instead of the MonoThread pointer to the thread
24798         start and attach callbacks.  This change is required, because the
24799         jit thread start callback must be called _before_ the Thread
24800         object can be created.
24801         
24802         (mono_thread_init): Removed much object creation code that is no
24803         longer needed.  No managed code is called from here now.
24804
24805         * object.c (mono_runtime_exec_managed_code): Create a subthread
24806         for Main, and call back to the runtime to use it.
24807         Set the exit code when Main exits.
24808
24809         * gc.c: Make sure domain finalisation happens in a subthread.
24810         Re-enable threaded GC, fixing bug 31333 (again).
24811
24812         * environment.c: System.Environment internall calls (so far just
24813         ExitCode is here, the others are still in icall.c)
24814
24815         * appdomain.c (mono_runtime_cleanup): All threads running managed
24816         code should have finished before mono_runtime_cleanup() is
24817         reached, so no need to clean up threads.
24818
24819 2003-01-22  Martin Baulig  <martin@ximian.com>
24820
24821         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
24822         `gpointer func' arguments.      
24823         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
24824         but added `MonoThread *thread' argument.
24825         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
24826
24827         * threads.c (mono_new_thread_init): Added `gpointer func' argument
24828         and pass it to the mono_thread_start_cb callback.
24829         (mono_install_thread_callbacks): New public function to install a
24830         set of callbacks which are set by the debugger.
24831         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
24832
24833 2003-01-22  Martin Baulig  <martin@ximian.com>
24834
24835         * Makefile.am: Install debug-mono-symfile.h.
24836
24837 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
24838
24839         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
24840
24841 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
24842
24843         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
24844         * class.c (mono_ptr_class_get): correctly set access levels of pointers
24845         (mono_array_class_get): correctly set access levels of arrays
24846
24847 2003-01-20      Patrik Torstensson
24848         * image.h (MonoAssemblyName): changed major, minor, build, revision
24849         from signed to unsigned.
24850
24851 2003-01-20  sean kasun <skasun@azstarnet.com>
24852
24853         * reflection.c (load_cattr_value): Now this handles
24854         MONO_TYPE_SZARRAY.  Fixes bug #35629
24855
24856 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
24859         integer value
24860
24861 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24862
24863         * decimal.c: fixed bug #26056.
24864
24865 2003-01-17  Martin Baulig  <martin@ximian.com>
24866
24867         * gc.c: Raise an ExecutionEngineException instead of using g_error().
24868
24869 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24870
24871         * exception.[ch]:
24872         (mono_get_exception_type_initialization): new function.
24873
24874         * object.c: throw a TypeInitializationException when an exception is
24875         thrown invoking the class constructor.
24876
24877 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24878
24879         * reflection.c: fixed attribute reading.
24880
24881 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24882
24883         * icall.c:
24884         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
24885         provided, look for the type in the calling assembly and then in
24886         mscorlib; if the assembly name is provided, only try that one.
24887
24888 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
24889
24890         * object.c: register the vtable before there is a chance it's
24891         queried again recursively.
24892
24893 2003-01-13  Duncan Mak  <duncan@ximian.com>
24894
24895         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
24896         gc-internal.h. 
24897         
24898 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
24899
24900         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
24901
24902 2003-01-11  Martin Baulig  <martin@ximian.com>
24903
24904         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
24905         this to 20 for the release.
24906
24907 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
24908
24909         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
24910
24911         * loader.c (mono_method_get_marshal_info): bug fix
24912
24913         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
24914         structures with explicit layout
24915
24916 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
24917
24918         * profiler.c: made the output more readable (and sorted). 
24919         Added caller information for the allocation profiler.
24920
24921 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
24922
24923         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
24924
24925 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24926
24927         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
24928         to get value types.
24929         
24930 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
24931
24932         * object.c, profiler.h, profiler.c, profiler-private.h:
24933         Added object allocation profiler.
24934
24935 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
24936
24937         * reflection.h, reflection.c: handle global methods.
24938         Compress blob entries.
24939
24940 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
24941
24942         * marshal.c: fix compilation.
24943
24944 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
24945
24946         * loader.c (mono_method_get_marshal_info): impl.
24947
24948         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
24949
24950 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24951
24952         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
24953         for reference types.
24954
24955 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
24956
24957         * loader.c: fixed off by one error in loaded parameter names.
24958
24959 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
24960
24961         * marshal.c (mono_marshal_get_icall_wrapper): like
24962         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
24963         instead of a MonoMethod.
24964
24965 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24966
24967         * decimal.c: fixed bug #36537.
24968
24969 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
24970
24971         * marshal.c: throw a missing method exception if a
24972         P/Invoke method is not found.
24973
24974 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
24975
24976         * icall.c: allow a null this for constructors.
24977
24978 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
24979
24980         * icall.c: raise the proper exceptions if the arguments to the
24981         internal Invoke are incorrect.
24982
24983 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
24984
24985         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
24986
24987 2003-01-03  Martin Baulig  <martin@ximian.com>
24988
24989         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
24990
24991 2002-12-31  Martin Baulig  <martin@ximian.com>
24992
24993         * debug-mono-symfile.c: Completely rewrote the type section.
24994         Instead of using individual malloc()ed fields, we use one big
24995         continuous memory area and offsets into this area.
24996         See the comments in the source code for details.
24997
24998 2002-12-30  Martin Baulig  <martin@ximian.com>
24999
25000         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
25001
25002 2002-12-30  Martin Baulig  <martin@ximian.com>
25003
25004         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
25005         line number table in this data blob instead of using an external
25006         pointer.
25007
25008 2002-12-28  Martin Baulig  <martin@ximian.com>
25009
25010         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
25011
25012 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
25013
25014         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
25015         as a boxed return type.
25016
25017 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
25018
25019         * appdomain.c
25020         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
25021         g_build_filename to properly get separators on the filename created.
25022
25023         * object.h: Small change, introduce MonoMarshalByRefObject to
25024         track the layout of that structure in the C# universe as we make
25025         changes there.
25026
25027 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
25028
25029         * object.c: removed assert to allow static fields on interfaces.
25030         * loader.c: a TypeSpec may be used for any type, not just arrays.
25031
25032 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
25033
25034         * class.c, class.h: added mono_class_array_element_size ().
25035         Ignore static methods in interfaces.
25036
25037 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25038
25039         * threads.c: fixed the build under cygwin.
25040
25041 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
25042
25043         * reflection.c: handle nullref constants. Allocate keys for
25044         reflection handles with the GC.
25045
25046 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
25047
25048         * threads.c, threads.h: added mono_thread_get_abort_signal()
25049         to get a suitable signal for thread abort.
25050
25051 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
25052
25053         * metadata.c: fix handling of ExportedType table.
25054
25055 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25056
25057         * icall.c: added WriteWindowsDebugString internal call.
25058
25059 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25060
25061         * reflection.h: added fields to match C# implementation.
25062
25063 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25064
25065         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
25066
25067 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
25068
25069         * gc.h, gc-internal.h: Rename header for GC internal calls to
25070         gc-internal.h from gc.h as to not clash with Boehm GC having its
25071         header installed as <gc.h> in outside include paths.
25072         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
25073         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
25074
25075 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25076
25077         * icall.c: assign minor, build and revision in FillName.
25078
25079 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
25080
25081         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
25082         Added support for running code generated by Reflection.Emit.
25083
25084 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25085
25086         * appdomain.c: check for NULL argument in LoadFrom.
25087
25088 2002-12-10  Dick Porter  <dick@ximian.com>
25089
25090         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
25091
25092 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25093
25094         * appdomain.c: fix buglet when building exe file name.  Handle full
25095         assembly name (needed after latest changes to AssemblyName).
25096         * image.c:
25097         (mono_image_close): free some hashtables.
25098
25099 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
25100
25101         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
25102         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
25103         on some systems (redhat 7.3) 
25104
25105 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
25106
25107         * threads.c: delete the critical section of a sync block,
25108         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
25109
25110 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
25111
25112         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
25113
25114 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25115
25116         * appdomain.[ch]: handle the assembly preload event to try loading the
25117         assemblies using the paths we have in the current domain.
25118
25119         * assembly.[ch]: created an assembly preload hook that is called to try
25120         loading the assembly by other means that the ones provided here.
25121
25122         * domain.c: initialize the domain search path.
25123
25124         From now on, assemblies (TODO: except corlib and System) are loaded
25125         according to these rules when using mono_assembly_load ():
25126
25127                 1. It tries to load the assembly from the ApplicationBase
25128                 of the current domain appending .dll and .exe (TODO: have to
25129                 try loading from name/name.dll and name/name.exe).
25130
25131                 2. It tries the search path specified in PrivateBinPath for the
25132                 current domain (if any).
25133
25134                 3. Previous behavior.
25135
25136 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
25137
25138         * icall.c: implemented GetInterfaceMap() related icall.
25139         * domain.c, loader.h: load MethodInfo in mono_defaults.
25140
25141 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
25142
25143         * gc.c: disable the finalizer thread for now, untill all the issues
25144         with it are resolved.
25145
25146 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
25147
25148         * string-icalls.c: handle embedded nulls in string ctor when the
25149         length is specified.
25150
25151 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
25152
25153         * class.c: look for explicit interface implementation in parent
25154         classes, too.
25155
25156 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
25157
25158         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
25159
25160 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
25161
25162         * gc.c: protect handles with a critical section.
25163
25164 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25165
25166         * icall.c:
25167         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
25168         parameters. If no assembly specified, try getting the type from all
25169         the assemblies in the current domain, else, load the assembly and get
25170         the type from it.
25171
25172 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25173
25174         * marshal.c: applied patch from Aleksey Demakov that fixes
25175         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
25176
25177 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25178
25179         * icall.c: fixed get_location.
25180
25181 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
25182
25183         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
25184         declarations to make it work with older gcc. 
25185
25186         * loader.c (mono_get_method): set signature->pinvoke for native calls
25187
25188 2002-11-20  Dick Porter  <dick@ximian.com>
25189
25190         * threads.c (mono_thread_init): Set the main thread's handle
25191
25192 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
25193
25194         * gc.c: allow compilation without GC support. Changed to match the
25195         mono coding style.
25196
25197 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
25198
25199         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
25200
25201 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
25202
25203         * reflection.c: set a public key token on the core assemblies.
25204
25205 2002-11-18  Dick Porter  <dick@ximian.com>
25206
25207         * threads.c: Split out some thread initialisation so that other
25208         files can set the start callback function.
25209
25210         * gc.c: Run finalisers in a separate thread, to avoid stack
25211         overflow.  Fixes bug 31333.
25212
25213         * appdomain.c: Set up GC finalisation thread.
25214
25215         * reflection.c: 
25216         * object.c: 
25217         * domain.c: Use gc.h macros for GC_malloc
25218         
25219 2002-11-15  Dick Porter  <dick@ximian.com>
25220
25221         * threadpool.c: 
25222         * threads.c:
25223         * appdomain.c: Removed mono_runtime_init_with_attach(),
25224         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
25225         merging the extra parameter with the existing function.  Removed
25226         unneeded code in mono_thread_attach().
25227
25228 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
25229
25230         * image.c (mono_image_loaded_by_guid): a method to get loaded
25231         images by guid. 
25232         (load_metadata_ptrs): we store the guid as string.
25233
25234 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
25235
25236         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
25237
25238         * metadata.c (mono_guid_to_string): imported method form Zoltan
25239         Varga (slightly modified)
25240
25241         * assembly.c (mono_assembly_open): load precompiled code
25242
25243         * loader.h (MonoMethod): we store the method token for use in the
25244         aot compiler. 
25245
25246 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25247
25248         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
25249         the hook function called when an assembly is loaded.
25250         
25251         * domain.c: Modified file.
25252         (mono_domain_assembly_load): removed hash table insertion of assemblies.
25253
25254         Fixes bug #33196.
25255
25256 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
25257
25258         * reflection.c: Map PEFileKind to the value expected by the WinNT
25259         image loader. 
25260
25261 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25262
25263         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
25264         Read until the buffer is filled completely.
25265
25266 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25267
25268         * icall.c: implemented MonoType.InternalGetEvent ().
25269
25270 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25271
25272         * appdomain.c: implemented InitAppDomainSetup. Delayed
25273         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
25274         the entry_assembly.
25275
25276         * assembly.c: base_dir is now an absolute path ending with
25277         G_DIR_SEPARATOR.
25278
25279         * icall.c: modified get_location according to the above changes.
25280
25281         * object.c: init AppDomain.SetupInformation for the default domain after
25282         we have the entry assembly.
25283
25284         * domain.c: when unloading a domain, setup = NULL.
25285
25286 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
25287
25288         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
25289
25290 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
25291
25292         * object.h, object.c: introduced mono_object_get_virtual_method ()
25293         to lookup the method invoked on an object when a callvirt is done on
25294         a method.
25295         * icall.c: make MethodInfo::Invoke() always do a virtual call.
25296
25297 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25298
25299         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
25300         current domain when loaded an assembly and failed to load it.
25301
25302         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
25303
25304 2002-10-31  Dick Porter  <dick@ximian.com>
25305
25306         * icall.c: 
25307         * file-io.h: 
25308         * file-io.c: Return the error status in a parameter, as the
25309         GetLastError() value has long since been blown away if we try and
25310         look it up in a subsequent internal call invocation.  Delete the
25311         GetLastError() internal call, because it's useless.
25312
25313 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
25314
25315         * class.[ch]: added cast_class to fix bug 29517
25316
25317 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
25318
25319         * marshal.c: create valid IL code in the filter clause:
25320         the new JIT is less forgiving:-)
25321
25322 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25323
25324         * icall.c: removed get_property internal call.
25325
25326 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
25327
25328         * appdomain.h domain.c: Added an ID to appdomains.
25329         
25330         * threads.c threads.h icall.c: Implement icall
25331         Thread:GetDomainID(), and remove unused icall 
25332         CurrentThreadDomain_internal.
25333
25334 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25335
25336         * icall.c: Don't recurse through the base types in GetConstructor.
25337         Fixes bug #32063. 
25338
25339 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
25340
25341         * mempool.h, mempool.c: added mono_mempool_empty() and
25342         mono_mempool_stats().
25343
25344 2002-10-23  Dick Porter  <dick@ximian.com>
25345
25346         * file-io.c: 
25347         * file-io.h: 
25348         * icall.c: Added MonoIO.GetFileType internal call
25349
25350 2002-10-17  Dick Porter  <dick@ximian.com>
25351
25352         * appdomain.c (mono_runtime_cleanup): Don't signal the async
25353         delegate semaphore before waiting for all threads to finish,
25354         because new threads can also call async delegates.  Fixes bug
25355         32004.
25356
25357         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
25358         of 3 seconds, in case another async job is queued.  (This part is
25359         needed because the bug fix reintroduced the 3s exit lag.)  This
25360         makes the mono_runtime_shutdown flag superfluous.
25361
25362 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
25363
25364         * reflection.c: include ehader size in method section headers.
25365         Really check for suplicated modules entries.
25366
25367 2002-10-17  Martin Baulig  <martin@gnome.org>
25368
25369         * debug-mono-symfile.c: Added back support for locals.
25370
25371 2002-10-14  Martin Baulig  <martin@gnome.org>
25372
25373         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
25374         MONO_TYPE_VOID.
25375
25376 2002-10-14  Martin Baulig  <martin@gnome.org>
25377
25378         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
25379         mono_class_get() instead of looking in the class cache. 
25380
25381 2002-10-13  Martin Baulig  <martin@gnome.org>
25382
25383         * debug-mono-symfile.c: Set version number to 28, include the
25384         signature in method names.
25385
25386 2002-10-13  Martin Baulig  <martin@gnome.org>
25387
25388         * debug-mono-symfile.h: Set version number to 27.
25389
25390 2002-10-11  Martin Baulig  <martin@gnome.org>
25391
25392         * gc.c: Don't register/unregister NULL pointers as disappearing links.
25393
25394 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
25395
25396         * metadata.c, metadata.h: added helper function to allocate signatures.
25397
25398 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25399
25400         * icall.c: added internal call to get the location of machine.config.
25401
25402 2002-10-08  Martin Baulig  <martin@gnome.org>
25403
25404         * debug-mono-symfile.c: Ignore classes with a pending init for the
25405         moment.
25406
25407 2002-10-03  Dick Porter  <dick@ximian.com>
25408
25409         * threads.c: Freebsd pthread_t is a pointer
25410
25411 2002-10-03  Dick Porter  <dick@ximian.com>
25412
25413         * socket-io.c: Implemented GetHostName_internal
25414
25415 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25416
25417         * mono-config.c:
25418         (mono_config_parse_file): don't leak the text.
25419
25420 2002-10-02  Martin Baulig  <martin@gnome.org>
25421
25422         * debug-mono-symfile.c: Added support for methods.
25423
25424 2002-10-01  Martin Baulig  <martin@gnome.org>
25425
25426         * debug-mono-symfile.c: Don't emit methods and line numbers for
25427         the dynamic symbol file, just write the type table.  We can easily
25428         have an external helper program which creates a symbol file for an
25429         IL file.        
25430
25431 2002-10-01  Dick Porter  <dick@ximian.com>
25432
25433         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
25434         Only add the handle to the cleanup array when we're about to
25435         launch the thread.  Bug 31425 deadlocked when the test was run on
25436         mono under w32.
25437
25438 2002-10-01  Martin Baulig  <martin@gnome.org>
25439
25440         * debug-mono-symfile.c: Added support for properties.
25441
25442 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
25443
25444         * reflection.c: unaligned store fix from Mark Crichton
25445         <crichton@gimp.org>.
25446
25447 2002-09-27  Martin Baulig  <martin@gnome.org>
25448
25449         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
25450         New interncall.
25451
25452 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
25453
25454         * assembly.h, assembly.c: use a sane API to hook into the assembly
25455         loading process instead of a useless special-purpouse hack
25456         (ngen needs a hook, too, for example).
25457
25458 2002-09-27  Dick Porter  <dick@ximian.com>
25459
25460         * threads.c (mono_thread_init): Call GetCurrentProcess() so
25461         io-layer can set up some process handle info.  Not needed on w32,
25462         but doesn't hurt either.
25463
25464         * process.c: Pass the program name in the second parameter to
25465         CreateProcess, so the path is searched.  Include the working
25466         directory. Implemented process name, process enumeration, and some
25467         process detail internal calls.
25468         
25469         * icall.c: Added internal calls for process lookup, and some
25470         process details
25471
25472 2002-09-26  Martin Baulig  <martin@gnome.org>
25473
25474         * assembly.c (mono_install_open_assembly_hook): New global
25475         function to install a function to be invoked each time a new
25476         assembly is loaded.
25477         (mono_assembly_open): Run this callback function if set.
25478
25479         * debug-mono-symfile.c: Put back line numbers for the dynamic
25480         symbol file and also record the .il file as source file.  This
25481         allows us to install the temporary symbol file as `file.dbg' just
25482         like a compiler-generated one.
25483
25484 2002-09-26  Nick Zigarovich <nick@chemlab.org>
25485
25486         * Corrected typo in gc.c (BOHEM vs BOEHM).
25487
25488 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25489
25490         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
25491         GetProperties. Also avoid calling g_slist_length in GetProperties and
25492         GetMethods.
25493
25494 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
25495
25496         * reflection.c: avoid unaligned stores (bug spotted by
25497         Mark Crichton  <crichton@gimp.org>).
25498
25499 2002-09-25  Martin Baulig  <martin@gnome.org>
25500
25501         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
25502         instead of guint64 for addresses and added prologue/epilogue info.
25503
25504 2002-09-25  Martin Baulig  <martin@gnome.org>
25505
25506         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
25507         store line number info.  For the dynamic symbol file, we only need
25508         to provide the JIT generated dynamic line number info for the dynamic
25509         symbol file.
25510
25511 2002-09-25  Martin Baulig  <martin@gnome.org>
25512
25513         * debug-mono-symfile.h: Incremented version number.
25514
25515 2002-09-24  Martin Baulig  <martin@gnome.org>
25516
25517         * class.c (mono_debugger_class_init_func): New global function
25518         pointer variable.
25519         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
25520         call it.
25521
25522         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
25523         function.  This is called via the mono_debugger_class_init_func
25524         hook to add all types to the dynamic type table.
25525         (ves_icall_MonoDebugger_GetType): New interncall to get a class
25526         from its metadata token.
25527
25528         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
25529         New interncall for the debugger.
25530
25531 2002-09-24  Nick Drochak <ndrochak@gol.com>
25532
25533         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
25534         before using it in case it is null.
25535         
25536 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
25537
25538         * metadata.c: allow custom modifiers in local var signatures
25539         (bug spotted by Zoltan Varga).
25540
25541 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
25542
25543         * class.c: deal with the <Module> class that may have a NULL vtable.
25544         Eliminate warnings.
25545
25546 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
25547
25548         * image.c, image.h: more strong name helpers.
25549         * monosn.c: more work: convert pem keys to cryptoapi format.
25550
25551 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
25552
25553         * string-icalls.c: speedup IndexOf.
25554
25555 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
25556
25557         * icall.c: updates from Zoltan.2.Varga@nokia.com.
25558
25559 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
25560
25561         * icall.c: cleanup: use mono_object_domain ().
25562
25563 2002-09-23  Martin Baulig  <martin@gnome.org>
25564
25565         * debug-mono-symfile.c: Improved type support.
25566
25567 2002-09-22  Martin Baulig  <martin@gnome.org>
25568
25569         * debug-mono-symfile.c: Added support for reference types and strings.
25570
25571 2002-09-22  Martin Baulig  <martin@gnome.org>
25572
25573         * debug-mono-symfile.c: Started to work on the type table.
25574
25575 2002-09-21  Martin Baulig  <martin@gnome.org>
25576
25577         * debug-mono-symfile.c: Largely reworked the symbol table format.
25578         The symbol table is now incrementally updated each time a new
25579         method is added.  We're now also using our own magic and version
25580         so that you don't need to recompile all your classes if the
25581         dynamic table changes.
25582         (mono_debug_update_mono_symbol_file): Removed.
25583         (mono_debug_symfile_add_method): New function to add a method.
25584
25585 2002-09-21  Martin Baulig  <martin@gnome.org>
25586
25587         * icall.c
25588         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
25589         New interncall.
25590
25591         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
25592         New interncall to get a method from its metadata token.
25593
25594 2002-09-21  Martin Baulig  <martin@gnome.org>
25595
25596         * debug-mono-symfile.c: Create type table.
25597
25598 2002-09-20  Martin Baulig  <martin@gnome.org>
25599
25600         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
25601
25602 2002-09-20  Martin Baulig  <martin@gnome.org>
25603
25604         * debug-mono-symfile.c: Provide information about params and locals.
25605
25606 2002-09-20  Martin Baulig  <martin@gnome.org>
25607
25608         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
25609         New interncall.
25610
25611         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
25612         interncall to get a method from its metadata token.
25613
25614 2002-09-20  Martin Baulig  <martin@gnome.org>
25615
25616         * debug-mono-symfile.c: Added a few checks for method->header
25617         being non-NULL.  This should never happen, but for the moment
25618         let's use a g_warning() rather than a g_assert().
25619
25620 2002-09-19  Mark Crichton  <crichton@gimp.org>
25621
25622         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
25623         even if support for it isn't present.  Added an #ifdef to fix this.
25624
25625         * socket-io.c: Added checks back for Solaris support.
25626
25627 2002-09-19  Martin Baulig  <martin@gnome.org>
25628
25629         * debug-mono-symfile.c (read_string, write_string): Reflect latest
25630         changes in the symbol file format.
25631
25632 2002-09-18  Martin Baulig  <martin@gnome.org>
25633
25634         * debug-mono-symfile.c: Set version number to 21.
25635
25636 2002-09-18  Dick Porter  <dick@ximian.com>
25637
25638         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
25639         on netbsd.  Fixes bug 30051.
25640
25641 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25642
25643         * reflection.c:
25644         (set_version_from_string): little fix.
25645
25646 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
25647
25648         * monosn.c, Makefile.am: added strong name utility.
25649         * reflection.h, reflection.c: implemented delayed signing,
25650         locale, version and hash id assembly attributes.
25651
25652 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
25653
25654         * loader.c, metadata.c: load param attributes in signatures.
25655
25656 2002-09-16  Martin Baulig  <martin@gnome.org>
25657
25658         * debug-mono-symfile.c: Added string table with all method names.
25659
25660 2002-09-14  Martin Baulig  <martin@gnome.org>
25661
25662         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
25663         fast method lookup.
25664
25665 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
25666
25667         * reflection.c: record the public key token of referenced assemblies.
25668
25669 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
25670
25671         * image.c, image.h: added functions to get the strong name and the
25672         public key of an assembly.
25673         * pedump.c: use them.
25674
25675 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
25676
25677         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
25678
25679 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
25680
25681         * marshal.c (mono_marshal_get_managed_wrapper): Added
25682         MONO_TYPE_BOOLEAN 
25683
25684 2002-09-11  Martin Baulig  <martin@gnome.org>
25685
25686         * gc.c: Call GC_unregister_disappearing_link() on all links when
25687         finalizing them, this is necessary to aviod a crash in boehm's
25688         finalize handler.
25689
25690 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
25691
25692         * gc.c: handle GetTarget for finalized objects spotted and fixed by
25693         nick@chemlab.org.
25694
25695 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
25696
25697         * icall.c: implemented MonoType::Module.
25698         * reflection.c, reflection.h: mono_module_get_object () from
25699         Tomi Pakarinen <tomi.pakarinen@welho.com>.
25700
25701 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
25702
25703         * icall.c: ignore overridden methods in GetMethods ().
25704         Fix for FieldInfo::SetValue().
25705         * object.c: handle float/double in runtime invoke.
25706
25707 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
25708
25709         * object.c: allow a constructor to be called again on an object.
25710
25711 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
25712
25713         * class.h, class.c: move field layout code to it's own function and
25714         export it. Get an interface id earlier. Move fields in MonoClass
25715         so they are more cache friendly and align the bitfields.
25716         * loader.c: temporary handle get_param_names() for a runtime method.
25717         * reflection.c, reflection.h: more code to handle runtime creation of
25718         types.
25719
25720 2002-09-09  Martin Baulig  <martin@gnome.org>
25721
25722         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
25723         signature with the pinvoke field being set for the actual call.
25724
25725 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
25726
25727         * icall.c: removed some unused icalls. Start of map of glib charsets
25728         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
25729
25730 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
25731
25732         * debug-helpers.c: break infinite loop (found and fixed by
25733         Holger Arnold <harnold@gmx.de>).
25734
25735 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
25736
25737         * icall.c: target may be null in create_delegate.
25738
25739 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
25740
25741         * marshal.c: handle a boolean return type.
25742
25743 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
25744
25745         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
25746
25747 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
25748
25749         * gc.c: fix weakreferences.
25750
25751 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
25752
25753         * icall.c: added icall to get default codepage.
25754
25755 2002-09-03  Dick Porter  <dick@ximian.com>
25756
25757         * threads.h: 
25758         * threads.c: Use MonoThread instead of MonoObject where
25759         apropriate.
25760
25761         Store running thread objects in a hash table, so that we have all
25762         the info to hand when waiting for them to finish
25763         (means we don't need OpenThread() any more, so mingw builds should
25764         be fully functional again.)
25765
25766         * verify.c:
25767         * object.h: Added thread ID to MonoThread
25768
25769 2002-09-03  Martin Baulig  <martin@gnome.org>
25770
25771         * icall.c (System.Reflection.Assembly::get_location): New interncall.
25772
25773 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25774
25775         * icall.c: fixed leak in get_temp_path. Thanks lupus.
25776
25777 2002-09-03  Martin Baulig  <martin@gnome.org>
25778
25779         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
25780         argument to store the end address of the disassembled instruction.
25781
25782         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
25783         here from debug-symfile.h.
25784         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
25785         JIT into this struct.
25786         (MonoSymbolFile): Added `char *image_file' field.
25787         (MonoDebugGetMethodFunc): Removed.
25788         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
25789         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
25790         (mono_debug_find_method): New method.
25791
25792         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
25793         create a full symbol file.
25794         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
25795         and static symbol files.
25796         (mono_debug_find_method): The symbol file keeps an internal method hash,
25797         call this to get a MonoDebugMethodInfo from a MonoMethod.
25798
25799         * debug-symfile.[ch]: Removed.
25800
25801 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
25802
25803         * image.c (do_mono_image_open): Remove linker version check.
25804
25805 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
25806
25807         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
25808         wrappers for instance methods.
25809         
25810 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25811
25812         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
25813
25814 2002-08-28  Dick Porter  <dick@ximian.com>
25815
25816         * Makefile.am: Export HOST_CC for w32 builds
25817
25818 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
25819
25820         * file-io.c process.c: MonoString are null terminated, no
25821         need for mono_string_to_utf16() anymore.
25822
25823 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
25824
25825         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
25826
25827 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
25828
25829         * icall.c, reflection.h: speedup System.MonoType.
25830
25831 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
25832
25833         * reflection.c: allow null as the value of a string argument in
25834         custom attributes constructors.
25835
25836 2002-08-27  Martin Baulig  <martin@gnome.org>
25837
25838         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
25839         `trampoline_address' field.
25840
25841 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
25842
25843         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
25844         check (fixes bug #29486) 
25845
25846 2002-08-27  Martin Baulig  <martin@gnome.org>
25847
25848         * debug-mono-symfile.c: Changed the file format in a way that allows us
25849         open it read-only and to use a specially malloced area for all the
25850         dynamic data.  We can now also generate a symbol file on-the-fly if we're
25851         debugging IL code and there is no MCS generated symbol file for it.
25852
25853 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
25854
25855         * object.c: added a define for a good string and array
25856         creation speedup (not enabled by default because we need to deal with
25857         the synch stuff).
25858
25859 2002-08-26  Martin Baulig  <martin@gnome.org>
25860
25861         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
25862         function to create a dynamic symbol file.  This is used by the
25863         debugger to create a symbol file for IL code on-the-fly.
25864
25865 2002-08-26  Martin Baulig  <martin@gnome.org>
25866
25867         * loader.c (mono_lookup_pinvoke_call): Include the error message
25868         from g_module_error() in the error message.
25869
25870 2002-08-24  Martin Baulig  <martin@gnome.org>
25871
25872         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
25873         function to update the symbol file.  The symbol file is mmap()ed
25874         writable, but private.  This allows us to install the symbol file
25875         together with the assembly.
25876
25877 2002-08-24  Martin Baulig  <martin@gnome.org>
25878
25879         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
25880         but they can read the new symbol file format which mcs is now creating.
25881
25882         * debug-symfile.c (mono_debug_find_source_location): Moved to
25883         debug-mono-symfile.c; this is now operating on the new symbol file.
25884
25885 2002-08-23  Martin Baulig  <martin@gnome.org>
25886
25887         * debug-helpers.c (mono_method_desc_from_method): New function to get
25888         a MonoMethodDesc from a MonoMethod.
25889
25890 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
25891
25892         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
25893         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
25894
25895 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
25896
25897         * string-icalls.[ch]: make helper methods static.
25898
25899 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25900
25901         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
25902         types to it and to SetValueInternal.
25903
25904         * object.c: Moved handle_enum label to its proper place. This was the
25905         f... bug! ;-)
25906
25907         This time i compiled mcs and gtk-sharp and they both work.
25908
25909 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25910
25911         * icall.c: reverted partially my previous patch until 
25912         object.c:set_value handles enums correcly.
25913
25914 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25915
25916         * icall.c:
25917         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
25918         (ves_icall_System_Environment_get_MachineName): removed warning when
25919         compiling under cygwin.
25920
25921 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
25922
25923         * object.c: fixed field_get_value() for reference types.
25924
25925 2002-08-22  Dick Porter  <dick@ximian.com>
25926
25927         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
25928         Don't free a buffer while it's still needed.  Patch from Jonathan
25929         Liger <Jonathan.liger@wanadoo.fr>
25930
25931 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
25932
25933         * icall.c (ves_icall_System_Environment_get_Platform): Add new
25934         internal call.
25935
25936 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
25937
25938         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
25939         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
25940
25941         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
25942         we call unmanaged code which throws exceptions.
25943
25944 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
25945
25946         * appdomain.h: added per-domain entry_assembly.
25947         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
25948         arguments.
25949         * icall.c: Assembly::GetEntryAssembly icall.
25950         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
25951         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
25952
25953 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
25954
25955         * appdomain.h, gc.c: added mono_domain_finalize ().
25956
25957 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25958
25959         * object.c:
25960         (mono_print_unhandled_exception): changed g_warning by g_printerr
25961         because g_log has a 1024 characters limit (yeah, i got a big stack
25962         trace). Don't print exception name, that should be in ToString 
25963         returned string.
25964
25965 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25966
25967         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
25968         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
25969
25970 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25971
25972         * object.c:
25973         (mono_print_unhandled_exception): after previous commit, i realized
25974         that MS calls ToString on the exception. I changed this function to
25975         do that. This way we get stack_trace for free.
25976
25977 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25978
25979         * object.c:
25980         (mono_print_unhandled_exception): invoke Message property instead of
25981         getting 'message' field from Exception. Don't allocate memory for
25982         'trace' and 'message' if not needed.
25983
25984 2002-08-18  Dick Porter  <dick@ximian.com>
25985
25986         * unicode.c: Fix asserts to match Encoder.cs checks
25987
25988 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
25989
25990         * marshal.c: fix unaligned store issue and a few wrong
25991         opcode argument types.
25992
25993 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25994
25995         * icall.c: added GetUninitializedObjectInternal internal call.
25996
25997 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
25998
25999         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
26000         to the right domain.
26001
26002 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
26003
26004         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
26005
26006         * class.c (class_compute_field_layout): set blittable to false for Strings
26007
26008         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
26009
26010 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26011
26012         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
26013         first chunk of code to create types at runtime. Code to
26014         handle ReflectedType/DeclaringType. Make reflection handles
26015         domain specific.
26016
26017 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
26018
26019         * class.c: set correct name in arrays.
26020
26021 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
26022
26023         * appdomain.c (mono_domain_transfer_object): make it work with
26024         valuetypes. bug fixes.
26025
26026 2002-08-12  Dick Porter  <dick@ximian.com>
26027
26028         * object.h: Rename some parameters to avoid c++ keywords (Patch
26029         from Joseph Wenninger <kde@jowenn.at>)
26030
26031 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
26032
26033         * icall.c: added icall to implement Assembly.GetFile*.
26034
26035 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26036
26037         * reflection.h, reflection.c: code to embed managed resources.
26038
26039 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26040
26041         * class.c: move all the type size stuff into
26042         class_compute_field_layout().
26043
26044 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26045
26046         * class.c: ensure enums have always the correct instance size.
26047         * unicode.c: remove wrong assert.
26048
26049 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
26050
26051         * assembly.c: fix mem corruption issue.
26052         * image.h, image.c: added mono_image_get_resource () to access
26053         managed resources.
26054         * icall.c: implemented Assembly.EntryPoint property and some
26055         Managed Resources related internalcalls.
26056
26057
26058 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26059
26060         * image.c, image.h: impemented mono_image_get_entry_point ().
26061         * appdomain.c: use mono_image_get_entry_point.
26062
26063 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26064
26065         * reflection.c: support the object type argument when loading
26066         custom attributes.
26067
26068 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
26069
26070         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
26071         String as return type.
26072
26073 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
26074
26075         * reflection.c: fix encoding of named args for custom attrs to match
26076         the ms implementation. Read them back when instantiating custom
26077         attributes.
26078
26079 2002-08-02  Radek Doulik  <rodo@ximian.com>
26080
26081         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
26082         by Dietmar as quick fix
26083         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
26084         16 as stack size, used on more places as quick fix before Dietmar
26085         will fix it properly
26086
26087 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
26088
26089         * object.h, object.c: added accessors for fields and properties.
26090
26091 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
26092
26093         * class.c, class.h: made mono_class_get_field_from_name ()
26094         loop on parent types.
26095         Added mono_class_get_property_from_name ().
26096
26097 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26098
26099         * class.c, class.h: move the code to setup the type vtable in its own
26100         function so that it can be reused also for types created at runtime.
26101         Eliminate the "class" identifier from the header file.
26102         * reflection.c: setup the vtable for enums so that we can create
26103         objects for use in SetConstant ().
26104
26105 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
26106
26107         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
26108         instead of the delegate itself as this pointer (bug #28383)
26109
26110 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
26111
26112         * marshal.c (mono_marshal_get_managed_wrapper): added return type
26113         conversions.
26114
26115 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26116
26117         * loader.c: don't set the pinvoke bit on icalls.
26118
26119 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
26120
26121         * debug-helpers.c (mono_method_full_name): only print a number to
26122         indicate wrapper type (so that the output is more readable in traces).
26123
26124 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
26125
26126         * class.c (mono_class_init): include method override patch from Paolo
26127
26128 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
26129
26130         * icall.c: fixed GetTypeCode().
26131
26132 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
26133
26134         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
26135         use real delegate invoke function to make it work with multicast
26136         delegates (fix bug# 28291).
26137
26138 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26139
26140         * object.c: load constant strings.
26141
26142 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26143
26144         * reflection.c: no magic numbers.
26145         * tabledefs.h: security action enum.
26146
26147 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26148
26149         * assembly.c: fix possible memory corruption.
26150
26151 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26152
26153         * reflection.h, reflection.c: added support for linking resources.
26154         * verify.c: check we have an updated corlib.
26155
26156 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
26157
26158         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
26159         string arrays.
26160         (mono_marshal_string_array): null terminate unmanaged string arrays.
26161         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
26162
26163 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26164
26165         * icall.c: Type.GetType () can now return also types from the
26166         calling assembly.
26167
26168 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26169
26170         * loader.h, loader.c: stack walking support.
26171         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
26172         GetCallingAssembly.
26173
26174 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
26175
26176         * marshal.c: added optimisations for blittable types 
26177
26178         * class.c (mono_array_class_get): do not set blittable attribute on arrays
26179         (mono_class_setup_mono_type): set blittable attribute for single
26180         and double.
26181
26182         * marshal.c (mono_string_utf8_to_builder): impl.
26183         (mono_string_builder_to_utf8): impl.
26184         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
26185
26186 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
26187
26188         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
26189         (mono_marshal_get_managed_wrapper): impl. byref types
26190
26191 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26192
26193         * icall.c:
26194         (search_method): don't display debug message. 
26195
26196 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
26197
26198         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
26199
26200 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
26201
26202         * appdomain.c: set the missing filename when throwing exception.
26203
26204 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
26205
26206         * metadata.c (mono_type_size): code cleanup
26207         (mono_type_stack_size): removed some test code
26208
26209 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
26210
26211         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
26212         mono_get_exception_file_not_found now.
26213
26214         * exception.c (mono_exception_from_name_two_strings): New version
26215         that will call a constructor with two string arguments. 
26216         (mono_get_exception_file_not_found): New helper routine, used to
26217         report file-not-found errors.
26218
26219 2002-07-20  Dick Porter  <dick@ximian.com>
26220
26221         * process.h:
26222         * process.c: Pass file handles to CreateProcess
26223         
26224         * icall.c:
26225         * file-io.h:
26226         * file-io.c: Implemented CreatePipe
26227
26228 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
26229
26230         * metadata.c (mono_get_param_info): set alignment for value types
26231
26232 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26233
26234         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
26235         Constify mono_domain_assembly_open().
26236         * loader.c: handle null namespace in icalls.
26237
26238 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
26239
26240         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
26241         (emit_str_to_ptr_conv): marshal object as structs
26242
26243         * metadata.c (mono_type_to_unmanaged): marshal object as structs
26244
26245         * marshal.c (mono_marshal_get_runtime_invoke): support value types
26246
26247 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
26248
26249         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
26250         (mono_marshal_get_native_wrapper): we an now return value types
26251
26252 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26253
26254         * verify.c: more checks implemented.
26255
26256 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
26257
26258         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
26259         (fix bug #27695)
26260         (mono_marshal_get_native_wrapper): allow byref arguments
26261         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
26262         impl. PtrToStringXXX methods
26263         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
26264         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
26265         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
26266         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
26267         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
26268
26269 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26270
26271         * reflection.c: fix buglet in parsing an assembly name.
26272
26273 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
26274
26275         * marshal.c (emit_ptr_to_str_conv): first impl.
26276
26277 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
26278
26279         * object.c, class.h: cache the vtable in the class as suggested by
26280         vargaz@freemail.hu (Zoltan Varga).
26281
26282 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26283
26284         * class.h, loader.c: added mono_field_from_token().
26285         * verify.c: first cut of type checking code.
26286
26287 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
26288
26289         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
26290
26291 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
26292
26293         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
26294         (fix bug #27782)
26295         (mono_marshal_get_remoting_invoke): impl.
26296         (mono_delegate_begin_invoke): impl.
26297         (mono_mb_emit_save_args): impl.
26298         (mono_delegate_end_invoke): impl.
26299         (mono_marshal_get_delegate_begin_invoke):
26300         (mono_marshal_get_delegate_end_invoke):
26301         (mono_marshal_get_delegate_invoke): generate a special name for
26302         those methods (including the signature) and associate them whith
26303         the delegate class. 
26304
26305 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
26306
26307         * reflection.[ch]: 
26308         (mono_reflection_type_from_name): now it has a MonoImage parameter
26309         which is used as the default image to search the type in. If the image
26310         is NULL or getting the type from it fails, it defaults to corlib.
26311
26312         * icall.c: changed 1 call to mono_reflection_type_from_name to match
26313         new parameter.
26314
26315 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26316
26317         * reflection.c: update the parameter table index.
26318
26319 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
26320
26321         * domain.c: don't include the mark byte in the string hash.
26322
26323 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
26324
26325         * icall.cs: icall for Type.GetTypeCode ().
26326         * verify: a couple of fixes and disabled local initialization checks.
26327
26328 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
26329
26330         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
26331
26332         * debug-helpers.c (mono_method_full_name): print the type of the
26333         runtime wrapper
26334
26335         * metadata.c (mono_signature_hash): a hash function for signatures
26336         (mono_signature_hash): better hash algorithm
26337
26338         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
26339
26340         * debug-helpers.c (mono_method_full_name): this can now generate
26341         method names with signatures
26342
26343         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
26344         method dont have this pointers.
26345
26346 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
26347
26348         * reflection.c: fixup typebuilder tokens.
26349         * image.c: fix buglet.
26350         * marshal.h: remove whitespace.
26351         * metadata.h, metadata.c: reinstate code that was removed.
26352         * verify.c: handle catch directives and fix another couple of bugs.
26353
26354 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
26355
26356         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
26357         (mono_marshal_get_native_wrapper): make it comp. with the old code
26358         (mono_marshal_get_native_wrapper): support boolean
26359         (mono_marshal_get_managed_wrapper): support more types
26360
26361 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
26362
26363         * class.c (class_compute_field_layout): compute class->blittable attribute.
26364
26365 2002-07-09  Dick Porter  <dick@ximian.com>
26366
26367         * threads.c: Make the thread cleaning up cope with threads that
26368         call ExitThread()
26369
26370 2002-07-08  Radek Doulik  <rodo@ximian.com>
26371
26372         * reflection.c (method_encode_code): use non-translated values to
26373         compute finally_start, this fixes exception handling on ppc, yay!
26374
26375         * decimal.h (struct signscale): fix endianess
26376
26377 2002-07-07  Radek Doulik  <rodo@ximian.com>
26378
26379         * reflection.c: swap box_val and not val
26380
26381 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26382
26383         * reflection.c, reflection.h: handle full assembly info in type name.
26384         Handle Type arguments when loading custom attributes.
26385         * icall.c: updated to use new mono_reflection_type_from_name () method.
26386
26387 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26388
26389         * loader.c:
26390         (method_from_memberref): also print assembly name when method not found.
26391
26392 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26393
26394         * icall.c:
26395         (ves_icall_TypeGetProperties): fixed bug #27473. 
26396
26397 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26398
26399         * reflection.c: display image name and token when cannot find the
26400         .ctor for an attribute.
26401
26402 2002-07-05  Martin Baulig  <martin@gnome.org>
26403
26404         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
26405
26406 2002-07-04  Dick Porter  <dick@ximian.com>
26407
26408         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
26409         compile on mingw.  This will cause mingw builds to not wait for
26410         subthreads to terminate after the main thread does.  I've lodged a
26411         bug with the mingw developers for them to wrap OpenThread().
26412
26413 2002-07-03  Dick Porter  <dick@ximian.com>
26414
26415         * threads.c: Store thread IDs instead of handles, because
26416         GetCurrentThread() returns a pseudohandle and therefore stores
26417         useless values.  mono_thread_cleanup() continues checking the
26418         array of threads until it is empty, to cope with subthreads
26419         spawning new threads after the main thread has finished.
26420
26421         * profiler.h:
26422         * profiler.c:
26423         * profiler-private.h: Pass the thread ID to thread profiler
26424         functions, instead of a handle
26425
26426 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26427
26428         * verify.c: fixes to make it more usable.
26429         * pedump.c: added --verify code to verify IL code in an assembly.
26430
26431 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26432
26433         * reflection.c: turn errors into warnings to allow compiling corlib.
26434
26435 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
26436
26437         * reflection.c: add special cases to compile corlib.
26438
26439 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26440
26441         * reflection.c: handle properties with only a set method.
26442
26443 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26444
26445         * opcodes.h: add enum with opcodes in opval order.
26446
26447 2002-07-01  Dick Porter  <dick@ximian.com>
26448         
26449         * object.h:
26450         * object.c (mono_runtime_run_main): Removed unneeded argument
26451
26452 2002-06-28  Martin Baulig  <martin@gnome.org>
26453
26454         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
26455
26456 2002-06-27  Dick Porter  <dick@ximian.com>
26457
26458         * threads.c: Store the handle in both the parent thread and in the
26459         subthread, to minimise the time between starting a new thread and
26460         storing its ID.
26461
26462 2002-06-26  Dick Porter  <dick@ximian.com>
26463
26464         * appdomain.c (mono_runtime_cleanup): Close the socket library
26465         after all the threads have finished, not before
26466
26467 2002-06-26  Martin Baulig  <martin@gnome.org>
26468
26469         * debug-symfile.c (mono_debug_find_source_location): Added
26470         `guint32 *line_number' argument.  If it's not NULL, store the line number
26471         there and return the file name without the line number.
26472
26473 2002-06-25  Dick Porter  <dick@ximian.com>
26474
26475         * icall.c:
26476         * process.h:
26477         * process.c: Process forking and other support functions
26478
26479 2002-06-25  Dick Porter  <dick@ximian.com>
26480
26481         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
26482         things dont happen when the image is closed.
26483         (mono_image_lookup_resource): Walk the resource section looking
26484         for a particular entry
26485
26486         * cil-coff.h: PE resource section decoding
26487
26488 2002-06-25  Dick Porter  <dick@ximian.com>
26489         
26490         * assembly.h:
26491         * assembly.c: 
26492         (mono_assembly_foreach): Accessor functions to walk the list of
26493         loaded assemblies
26494         (mono_assembly_set_main):
26495         (mono_assembly_get_main): Process methods need to know which
26496         assembly is the "main" one
26497
26498         * object.c (mono_runtime_run_main): Record the main assembly
26499
26500         * debug-helpers.c: Fix typo
26501
26502 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
26503
26504         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
26505         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
26506
26507 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
26508
26509         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
26510
26511 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
26512
26513         * image.c (do_mono_image_open): Initialize reference count,
26514         otherwise we leak the MonoImage.
26515
26516 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26517
26518         * reflection.c: small tweak to handle self-hosting.
26519
26520 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
26521
26522         * reflection.c: fix type name parse code.
26523
26524 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26525
26526         * reflection.c: break out of the loop.
26527         * image.c: special case corlib.
26528
26529 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26530
26531         * reflection.c: add all the custom attrs at the end to ensure the
26532         ctors have been properly initialized when the attributes are defined
26533         in the current assembly.
26534
26535 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26536
26537         * reflection.c: handle correctly multiple-nested types.
26538
26539 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
26540
26541         * row-indexes.h: fix typos.
26542         * reflection.c: adjust for typos and fix method_def_or_ref
26543         encoding in MethodImpl table.
26544
26545 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
26546
26547         * reflection.c: fix entry point patching (thanks Serge!).
26548
26549 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
26550
26551         * verify.c: add check for System.Exception
26552
26553 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
26554
26555         * image.c, class.c: minifix for code just c&p'ed.
26556         * reflection.c: warning fix.
26557         * object.h, loader.h, domain.c: load also StringBuilder.
26558
26559 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
26560
26561         * marshal.h, marshal.c: some support code to handle complex marshaling.
26562
26563 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26564
26565         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
26566         Better signatures with vtable error dump.
26567
26568 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
26569
26570         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
26571
26572 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
26573
26574         * icall.c (ves_icall_Type_GetField): impl.
26575
26576 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26577
26578         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
26579         to retrieve a marshal description blob for a field or param.
26580
26581 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
26582
26583         * reflection.h, reflection.c: change order of nested type emission
26584         to avoid table corruption. The NestedTypes table is sorted.
26585         * icall.c: change order of GetConstructor results to workaround mcs bug.
26586
26587 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
26588
26589         * reflection.h, reflection.c: handle field and param marshal
26590         information.
26591
26592 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26593
26594         * icall.c, marshal.c marshal.h: more Marshal class implementation.
26595
26596 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26597
26598         * reflection.c: fix call convention.
26599
26600 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26601
26602         * reflection.h, reflection.c: mono_image_get_memberref_token()
26603         takes a type instead of a class, now. Added
26604         mono_image_get_array_token() to create tokens for the special
26605         multi-dim array methods.
26606
26607 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26608
26609         * assembly.c: handle modules (no assembly table). Split
26610         loading references in its own function.
26611         * class.c: handle moduleref resolution scope.
26612         * image.c, image.h: cache module name in image.
26613
26614 2002-06-07  Martin Baulig  <martin@gnome.org>
26615
26616         * reflection.c (mono_image_get_type_info): Only add a class layout entry
26617         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
26618
26619 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
26620
26621         * icall.c: more signature fixes that used uint instead of int.
26622
26623 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26624
26625         * reflection.c: fixed signature of field refs.
26626
26627 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26628
26629         * class.c, reflection.c: handle typerefs of nested types
26630         (both on read and when writing files).
26631
26632 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
26633
26634         * icall.c: fix method signatures that tried to workaround the previous
26635         typo, d'oh!
26636
26637 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
26638
26639         * debug-helpers.c: fix typo.
26640
26641 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
26642
26643         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
26644         rewrote the PE/COFF writing code (our programs are understood by the
26645         ms runtime, now).
26646
26647 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
26648
26649         * gc.c, gc.h, icall.c: weakreference support.
26650
26651 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
26652
26653         * Makefile.am, mono-config.c: use $(sysconfdir).
26654
26655 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
26656
26657         * icall.c: changed default precision of Double.ToString() to 15.
26658         Fixed memory leak. Unified with Single.ToString.
26659
26660 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
26661
26662         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
26663
26664 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
26665
26666         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
26667         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
26668         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
26669         and myself.
26670
26671 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26672
26673         * debug-symfile.c, sysmath.c: yet more compilation fixes.
26674
26675 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
26676
26677         * reflection.c, socket-io.c: more compilation fixes.
26678
26679 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26680
26681         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
26682         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
26683         unicode.c: warning and compiler compatibility fixes.
26684
26685 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26686
26687         * class.h, metadata.c: fixed warnings/compilation errors.
26688
26689 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
26690
26691         * Makefile.am, mono-config.c, mono-config.h: configuration file
26692         support routines.
26693         * loader.c, loader.h: make Dll mapping configurable at runtime in the
26694         config file. Export methods to insert and lookup mappings.
26695
26696 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
26697
26698         * reflection.c: handle types and boxed objects in custom attr
26699         constructors.
26700
26701 2002-05-30  Martin Baulig  <martin@gnome.org>
26702
26703         * debug-symfile.c
26704         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
26705
26706 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
26707
26708         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
26709         to lookup the implmap row for a P/Invoke method.
26710         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
26711         P/Invoke method from the runtime on an as needed basis.
26712
26713 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
26714
26715         * metadata.c (mono_metadata_parse_signature): impl.
26716
26717 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
26718
26719         * class.c: handle .pack directive.
26720
26721 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
26722
26723         * object.c: initialize static fields with RVA data.
26724
26725 2002-05-25  Martin Baulig  <martin@gnome.org>
26726
26727         * debug-symfile.c
26728         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
26729
26730 2002-05-24  Martin Baulig  <martin@gnome.org>
26731
26732         * debug-symfile.c
26733         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
26734         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
26735         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
26736
26737 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
26738
26739         * object.c: special case string ctros in invoke.
26740         * gc.c: silly whitespace changes.
26741
26742 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
26743
26744         * threadpool.[ch]: impl. a threadpool that can
26745         be used by mint and mono.
26746
26747 2002-05-22  Martin Baulig  <martin@gnome.org>
26748
26749         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
26750         The first argument is now a `MonoReflectionModuleBuilder *', the return
26751         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
26752         `methods' field to get the method builder.  The `token' argument is the
26753         unfixed token.
26754
26755         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
26756         invalid characters instead of g_assert_not_reached()ing.  This seems
26757         to be the behaviour of mscorlib.
26758
26759 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
26760
26761         * object.c (mono_runtime_invoke_array): applied patch from Rachel
26762         Hestilow to fix bug #25104
26763
26764 2002-05-21  Martin Baulig  <martin@gnome.org>
26765
26766         * debug-symfile.c (mono_debug_find_source_location): New function.
26767         Looks up an IL offset in the line number table and returns the source
26768         location as a string.
26769
26770 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26771
26772         * icall.c:
26773         (mono_double_ToStringImpl): changed %f by %g until we have something
26774         better.
26775
26776 2002-05-21  Nick Drochak  <ndrochak@gol.com>
26777
26778         * icall.c : Use different name for Math.Pow's icall.  Needed to check
26779         parameters first in C#.
26780
26781 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26782
26783         * icall.c, reflection.h: added icall to get info about an event.
26784
26785 2002-05-20  Radek Doulik  <rodo@ximian.com>
26786
26787         * object.c (mono_value_box): don't use memcpy for boxing on BIG
26788         endian
26789         (mono_value_box): don't use memcpy for small sizes on
26790         architectures with unaligned access
26791
26792 2002-05-20  Martin Baulig  <martin@gnome.org>
26793
26794         * reflection.c (mono_reflection_setup_internal_class): Don't crash
26795         if `tb->parent == NULL'.
26796         (mono_reflection_create_internal_class): New function.  This is
26797         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
26798         for enum types.
26799
26800         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
26801         New interncall.
26802
26803 2002-05-19  Martin Baulig  <martin@gnome.org>
26804
26805         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
26806         argument to get the length, don't default to the array length.
26807
26808 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
26809
26810         * assembly.c (mono_assembly_setrootdir): New function used to
26811         override the MONO_ASSEMBLIES directory.
26812
26813 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
26814
26815         * icall.c: ValueType_GetHashCode() initialize local var.
26816
26817 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
26818
26819         * reflection.c: sort custom attributes table.
26820
26821 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
26822
26823         * reflection.c: support named args in custom attributes (write support).
26824
26825 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
26826
26827         * reflection.c: fix finally position calculation.
26828
26829 2002-05-15  Radek Doulik  <rodo@ximian.com>
26830
26831         * reflection.c: fixed endianess at many places
26832
26833         * icall.c (ves_icall_InitializeArray): comment out debug msg
26834
26835 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
26836
26837         * object.c (mono_unhandled_exception): new function to handle
26838         unhandled exceptions.
26839         (mono_unhandled_exception): call the UnhandledException event.
26840         (mono_runtime_delegate_invoke): impl.
26841
26842 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
26843
26844         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
26845         returns the RVA, not the direct pointer to the data. Handle the case
26846         when the class size is fixed.
26847
26848 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
26849
26850         * reflection.c: fix some endianess issues.
26851
26852 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
26853
26854         * object.c (mono_runtime_invoke): is now able to catch exceptions.
26855
26856         * threads.c (mono_thread_init): added a callback which is invoked
26857         at thread start.
26858
26859 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
26860         
26861         * icall.c: make GetHashCode return non-negative values.
26862
26863 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
26864
26865         * object.c, icall.c, gc.c: revert to address-based hashcode.
26866
26867 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
26868
26869         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
26870
26871 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
26872
26873         * icall.c, class.c: special case <Module>.
26874
26875 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
26876
26877         * icall.c: fix bug in GetNow().
26878
26879 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
26880
26881         * object.c (mono_runtime_class_init): make sure that we call all
26882         static class constructors.
26883
26884 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
26885
26886         * reflection.c: sort methodsemantics table.
26887
26888 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
26889
26890         * reflection.h, reflection.c: honour init locals setting.
26891
26892 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
26893
26894         * icall.c: copied Double ToStringImpl for Single ToStringImpl
26895
26896 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
26897
26898         * reflection.c: support ContructorBuilders in attribute blob creation.
26899
26900 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
26901
26902         * reflection.c: some changes to build a binary that can be run
26903         directly in windows.
26904
26905 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
26906
26907         * loader.c: print a big message when an icall can't be found.
26908
26909 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26910
26911         * string-icalls.c: fix bug 24248.
26912
26913 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
26914
26915         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
26916         icall.c, reflection.h: separate assembly loading by pathname and by
26917         assembly name. Use the MONO_PATH env var to search for assemblies.
26918
26919 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
26920
26921         * assembly.c, image.h: add some support for assemblies
26922         with multiple modules.
26923         * class.c, class.h: export mono_class_from_typeref().
26924         * loader.c: remove duplicated code and use mono_class_from_typeref(),
26925         instead.
26926
26927 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26928
26929         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
26930         documentation says (the ECMA one is correct).
26931
26932 2002-05-02  Dick Porter  <dick@ximian.com>
26933
26934         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
26935         Don't name the synchronisation mutex.
26936
26937 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
26938
26939         * rand.c
26940         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
26941         Make the prototypes match.
26942         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
26943         Same.
26944
26945         * icall.c
26946         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
26947         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
26948         all systems have tm.tm_zone, so use strftime() with %Z to print
26949         the timezone abreviation into a temp string.
26950
26951         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
26952         rather than mono_array_addr() on a MonoString on Big Endian
26953         machines.
26954
26955 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
26956
26957         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
26958         fix bug 24041
26959
26960 2002-04-30  Dick Porter  <dick@ximian.com>
26961
26962         * socket-io.c: Cope with SOCKET being an integer rather than a
26963         pointer now.
26964
26965         * threads.c: Added Thread_free_internal, to deal with thread
26966         handle cleanup.  Moved calls to handle_store() and handle_remove()
26967         to start_wrapper(), so each can only be called once.  Allocate
26968         synchronisation blocks with GC_malloc(), and use GC finalisation
26969         to close the handles.
26970
26971         * icall.c: added System.Threading.Thread::Thread_free_internal
26972
26973 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
26974
26975         * icall.c: support Environment.Exit, CommandLineArgs().
26976
26977 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
26978
26979         * object.c, object.h: added mono_runtime_run_main () and
26980         mono_runtime_get_main_args () for use in System.Environment.
26981
26982 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
26983
26984         * gc.c: fix thinko, enable actual finalization since the jit is now
26985         fixed.
26986
26987 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
26988
26989         * gc.c, object.c: take into account that an object may be offset wrt the address
26990         returned by GC_malloc().
26991
26992 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
26993
26994         * image.c: handle files without entries in the assembly table (modules).
26995
26996 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
26997
26998         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
26999         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
27000         allowed to be null when it's System.Object class setup.
27001
27002 2002-04-27  Martin Baulig  <martin@gnome.org>
27003
27004         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
27005         if `tb->parent == NULL' rather than crashing.
27006
27007 2002-04-28  Nick Drochak  <ndrochak@gol.com>
27008
27009         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
27010         calling acos() where asin() should have been called.
27011
27012 2002-04-26  Martin Baulig  <martin@gnome.org>
27013
27014         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
27015         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
27016         there's a subdirectory called `System', but we don't want to read that
27017         subdirectory as an assembly.
27018
27019 2002-04-25  Martin Baulig  <martin@gnome.org>
27020
27021         * debug-symfile.c: Reflect latest MonoString changes.
27022
27023 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
27024
27025         * rand.c, rand.h: instance method icalls need to have an explicit
27026         this pointer as first argument in the C implementation.
27027
27028 2002-04-25  Nick Drochak <ndrochak@gol.com>
27029
27030         * icall.c: Fix typo in map for GetNonZeroBytes
27031
27032 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27033
27034         * string-icalls.c : String does now passes unit tests without any 
27035         errors, the following changes has been made:
27036         
27037         Implemented replace methods.
27038         Renaming of methods to (try) follow the standard.
27039         Fixed compare ordinal
27040         Made all memory allocated directly to function instead of via icall function.
27041         Small performance fix in is_in_array function
27042                         
27043  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
27044
27045         c (mono_string_Internal_ctor_charp_int_int):
27046         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
27047         sindex < 0, throw ArgumentOutOfRangeException instead of
27048         ArgumentNullException.
27049
27050         Added new check for length == 0, however
27051         I need to make it return String.Empty from the C code.
27052         
27053         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
27054         that calculate the length for us here.
27055         
27056         (mono_string_Internal_ctor_sbytep_int_int): Replaced
27057         mono_string_new_utf16 with mono_string_new, since value is utf8.
27058
27059 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27060
27061         * object.c: register the object for finalization if needed.
27062         Allocate one more char in the string for the terminating 0 char.
27063
27064 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
27065
27066         * class.c, class.h, image.c: check if a type implemenst a destructor.
27067         Use the proper key for array class lookups.
27068         * icall.c: register the icalls in the System.GC class.
27069         * gc.c, gc.h: GC-related functions and icalls.
27070
27071 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27072
27073         * icall.c:
27074         * socket-io.c:
27075         * unicode.c: free some strings gotten from mono_string_to_utf8 and
27076         changed a couple of free () by g_free ().
27077
27078         * decimal.c: one-liner in the comments for decimal2string ().
27079
27080 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27081
27082         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
27083
27084 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
27085
27086         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
27087         * object.c (mono_runtime_invoke_array) : handle null in params
27088
27089 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27090
27091         * string-icalls.c: fixed bug in split (one off bug)
27092
27093 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27094
27095         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
27096         * icalls.c: added String::Equals as internal method
27097
27098 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
27099
27100         * threads.c: fixed bug in the double interlocked functions
27101
27102 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
27103
27104         * threads.c: implemented all of the new interlocked icalls.
27105         * string-icalls.c: fix a bug in insert.
27106         * icalls.c: added the icalls for interlocked, removed old string functions.
27107         
27108 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
27109
27110         * loader.c: fix off-by-one error when reading argument names.
27111
27112 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27113
27114         * profiler.c: win32 counter implementation (untested).
27115         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
27116         (the latter needs testing and more complete impl. from win32 folks).
27117
27118 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
27119
27120         * object.c: mono_array_new_full workaround mono_array_class_get
27121         problem.
27122
27123 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27124
27125         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
27126         * object.h (mono_string_chars): Changed casting type.
27127
27128 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27129
27130         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
27131                            method signatures to use gunichar2 instead of gint16.
27132
27133 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
27134
27135         * object.h, object.c: domain-specific versions of mono_object_new and
27136         mono_array_new.
27137
27138 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
27139
27140         * object.c: changed String layout
27141
27142         * string-icalls.c (mono_string_Internal_ctor_chara): added
27143         internal string constructors.
27144
27145 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
27146
27147         * threads.c: pass 'this' to the thread start routine.
27148
27149 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27150
27151         * string-icalls.c: fix IndexOf and LastIndexOf. Now
27152         InternalCompareStr don't call twice mono_string_cmp_char for the last
27153         character. Improved performance in mono_string_cmp_char.
27154
27155 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
27156
27157         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
27158         code into its own library: libmonoruntime.
27159
27160 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
27161
27162         * object.h, object.c: changed array format so that szarrays do not
27163         require a bounds structure.
27164         * icall.c, appdomain.c: support for new szarray format.
27165
27166 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
27167
27168         * metadata.c: compare also the retuns type when comparing signatures:
27169         we didn't do this as an optimization since really overloaded methods
27170         must differ also in the arguments, but this doesn't work with
27171         low-level IL code (or when using explicit conversion operators: see
27172         bug#23498 for an example).
27173
27174 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
27175
27176         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
27177
27178 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
27179
27180         * icall.c: make MonoType::GetElementType its own icall.
27181
27182 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
27183
27184         * icall.c: remove MonoMethod_get_Name().
27185         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
27186         object.
27187
27188 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27189
27190         * string-icalls.c: optimized a few methods.
27191
27192 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
27193
27194         * icall.c: added all new string internal calls
27195         * string-icalls.c: added, new string internal call implementation.
27196         * object.c: added mono_string_new_size for allocating a string a size
27197
27198 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
27199
27200         * object.c (mono_object_isinst): use the same code as in the
27201         optimized x86 version.
27202
27203 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
27204
27205         * profiler.c: TSC-based timer code (faster and more accurate).
27206         Not hooked up in configure, yet (set USE_X86TSC to 1).
27207
27208 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
27209
27210         * profiler.c, profiler.h: track time spent compiling methods.
27211         * threads.c: track thread creation/destruction.
27212
27213 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
27214
27215         * profiler.c, profiler.h, profiler-private.h: profiling interface
27216         and sample implementation. Moved here so that it can be used also by
27217         the jit.
27218
27219 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
27220
27221         * reflection.c, reflection.h: keep types and other handles separate in
27222         the hash tables for referred tokens. Add guid for modules.
27223
27224 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
27225
27226         * assembly.c: fix bugs found with valgrind.
27227         * metadata.h, metadata.c: added mono_metadata_guid_heap().
27228
27229 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
27230
27231         * threads: added icall support for getting current domain for
27232                    the thread.
27233  
27234 2002-04-13  Martin Baulig  <martin@gnome.org>
27235
27236         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
27237         (MonoDebugVarInfo): Added `index' field for register based addresses.
27238         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
27239         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
27240         `MonoDebugVarInfo *params' and `guint32 this_offset' with
27241         `MonoDebugVarInfo *this_var'.
27242
27243         * debug-symfile.c (relocate_variable): New static function to write
27244         a location description for a local variable or method parameter.
27245
27246 2002-04-12  Martin Baulig  <martin@gnome.org>
27247
27248         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
27249         stack offset and begin/end scope address of a local variable.
27250         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
27251         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
27252         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
27253
27254         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
27255         Added new relocation types for start/end scope of a local variable.
27256
27257 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
27258
27259         * object.h: add mono_object_domain() macro.
27260         * reflection.c: handle typespecs.
27261         * icall.c: MonoMethod::get_Name() implementation.
27262
27263 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27264
27265         * icall.c: String::GetHashCode() icall implementation.
27266
27267 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27268
27269         * icall.c: String::IndexOfAny icall.
27270         * object.c, object.h: make array->max_length more useful.
27271         Intrduced mono_object_class() and mono_string_length() macros.
27272
27273 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27274
27275         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
27276         instead of g_unichar_isdigit.
27277
27278 2002-04-11  Nick Drochak  <ndrochak@gol.com>
27279
27280         * icall.c: Implement a simple Double.ToString().
27281
27282 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
27283
27284         * appdomain.h: only io-layer.h is supposed to be included.
27285         * icall.c: explicitly import environ. Fix warning.
27286
27287 2002-04-10  Nick Drochak  <ndrochak@gol.com>
27288
27289         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
27290                 return true even if it's not Daylight Savings time.
27291                 Only return false for the case where the function isn't
27292                 implemented for a plaform (read Windows).
27293
27294 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
27295
27296         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
27297         data with a mutex.
27298
27299 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
27300
27301         * mempool.c (mono_mempool_alloc): only use g_malloc when
27302         absolutely necessary.
27303
27304 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
27305
27306         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
27307
27308         * class.c (mono_class_vtable): use domain mempool to allocate vtable
27309         (mono_class_proxy_vtable): use domain mempool
27310
27311 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
27312
27313         * appdomain.h, appdomain.c: split initialization that requires the
27314         execution engine support into mono_runtime_init().
27315
27316 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
27317
27318         * class.c (mono_class_init): don't include vtable inside MonoClass
27319         to save some memory, gather some statistics.
27320         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
27321
27322 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
27323
27324         * icall.c: internalcall implementation for ValueType.Equals().
27325
27326 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
27327
27328         * object.c (mono_message_init): moved 
27329         (mono_runtime_exec_main): new arch. independent impl.
27330         (mono_runtime_invoke_array): new method - like
27331         mono_runtime_invoke, but you can pass an array of objects.
27332         (mono_remoting_invoke): new arch. independent impl.
27333         (mono_message_invoke): new arch. independent impl.
27334         (mono_runtime_class_init): new arch. independent impl.
27335         (mono_runtime_object_init): new arch. independent impl.
27336
27337 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
27338
27339         * metadata.c, object.c, reflection.c: documented the exported
27340         functions.
27341
27342 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
27343
27344         * icall.c: simpler code to pass the assembly builder data to corlib.
27345         Implement GetNestedTypes() internalcall.
27346
27347 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
27348
27349         * class.c: warn if a type can't be loaded.
27350
27351 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
27352
27353         * image.h: typedef MonoImageOpenStatus
27354         * types.h: removed unused file
27355         
27356 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
27357
27358         * icall.c: Enum_ToObject accepts enum value arguments.
27359
27360 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
27361
27362         * class.c: move initialization of properties, events and nested
27363         classes, so that they happen for interfaces, too.
27364
27365 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
27366
27367         * icall.c: cleanup some ugly casts in Array_SetValue*.
27368
27369 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
27370
27371         * icall.c: the values array fro enums is of the correct type, now.
27372         Implement (correctly) getFullName instead of assQualifiedName for
27373         MonoType.
27374         * reflection.h, reflection.c: added mono_type_get_name ().
27375
27376 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
27377
27378         * assembly.c, image.h: for each MonoImage, record from wich assembly
27379         it was loaded.
27380         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
27381         Make Type.Assembly work.
27382
27383 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
27384
27385         * debug-symfile.h: use char* instead of gpointer to avoid
27386         unnecessary casts.
27387
27388         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
27389
27390         * icall.c (ves_icall_InternalExecute): impl. FielSetter
27391         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
27392
27393 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
27394
27395         * icall.c (mono_message_init): impl. (code cleanup)
27396         (ves_icall_InternalExecute): impl. FieldGetter
27397
27398         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
27399         defined we call all (non-static)methods through the vtable. 
27400
27401 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
27402
27403         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
27404         finalizer even though the memory is still referenced (and the chunk of
27405         memory is not freed).
27406
27407 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
27408
27409         * assembly.c: fix brokeness.
27410
27411 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
27412
27413         * class.c: kill some warnings. Check explicit interface method
27414         implementation also without considering the namespace.
27415         Load also literal strings in static class data.
27416
27417 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
27418
27419         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
27420         (default_assembly_name_resolver): Make the resolver take the
27421         "base" directory where the assembly was originally defined, so we
27422         can load DLLs that are in the same directory as the assembly that
27423         is being referenced.
27424
27425 2002-03-28  Dick Porter  <dick@ximian.com>
27426
27427         * file-io.h: 
27428         * file-io.c:
27429         * socket-io.c: 
27430         * unicode.h: 
27431         * unicode.c: Warning cleanups
27432
27433 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
27434
27435         * object.h, reflection.h: use the correct type instead of MonoObject.
27436
27437 2002-03-28  Martin Baulig  <martin@gnome.org>
27438
27439         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
27440         (mono_debug_update_symbol_file): Initialize classes if necessary.
27441
27442 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
27443
27444         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
27445         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
27446
27447 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
27448
27449         * assembly.h: fix function prototype.
27450         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
27451         * mono-endian.h: use const cast.
27452
27453 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
27454
27455         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
27456
27457 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
27458
27459         * loader.c: don't assert when a typeref can't be loaded, give
27460         a chance to the runtime to trow an exception instead.
27461         * loader.h: fix warning.
27462
27463 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
27464
27465         * class.c (mono_class_proxy_vtable): added proxy support
27466
27467 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
27468
27469         * icall.c: removed last of PAL calls, added System.Environment
27470         * file-io.h, file-io.c: MonoIO implementation
27471         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
27472
27473 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
27474
27475         * appdomain.c: do not use the byte marker in ldstr table lookup.
27476         * debug-helpers.c: allow two ':' to separate class and method name.
27477         * object.c: allocate arrays bounds with the GC, too.
27478         * verify: add a few more checks.
27479
27480 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
27481
27482         * reflection.c: output also literal strings. Allocate parameter data
27483         with GC_malloc() (thanks, Martin, for catching this!).
27484
27485 2002-03-26  Martin Baulig  <martin@gnome.org>
27486
27487         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
27488         include the `this' offset in the `param_offsets'.
27489
27490 2002-03-25  Martin Baulig  <martin@gnome.org>
27491
27492         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
27493         mono_debug_get_class() function to get the classes. Added new
27494         relocation types for arrays and strings.
27495         (mono_debug_get_class): New static function to search in all
27496         referenced assemblies for a metadata token.
27497
27498         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
27499
27500 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
27501
27502         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
27503         hold gc-allocated objects. Make the string heap a stream like the
27504         others. Removed duplicated code when writing stream info.
27505         Added asserts to catch possible buffer overflows. Set the sorted map
27506         for tables that need sorting. Added some documentation.
27507
27508 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
27509
27510         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
27511         for interned strings and vtables.
27512
27513 2002-03-24  Martin Baulig  <martin@gnome.org>
27514
27515         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
27516         it in the array since it was created with g_slist_prepend().
27517
27518 2002-03-24  Martin Baulig  <martin@gnome.org>
27519
27520         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
27521         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
27522         (mono_debug_method_from_token): Renamed to
27523         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
27524         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
27525
27526         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
27527         relocation types.
27528
27529         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
27530
27531 2002-03-24  Martin Baulig  <martin@gnome.org>
27532
27533         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
27534         (mono_debug_method_from_token): New func.
27535
27536         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
27537         New interncall, calls mono_debug_local_type_from_signature().
27538         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
27539         calls mono_debug_method_from_token().
27540
27541 2002-03-23  Martin Baulig  <martin@gnome.org>
27542
27543         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
27544         specifies the number of bytes to be converted, not the array size.
27545         Return the number of chars, not the number of bytes.
27546         (ves_icall_iconv_get_chars): The `byteCount' argument
27547         specifies the number of bytes to be converted, not the array size.
27548
27549 2002-03-23  Martin Baulig  <martin@gnome.org>
27550
27551         * reflection.h (MonoReflectionSigHelper): New type.
27552
27553         * reflection.c (mono_reflection_sighelper_get_signature_local),
27554         (mono_reflection_sighelper_get_signature_local): New functions.
27555
27556         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
27557         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
27558         interncalls.
27559
27560 2002-03-23  Martin Baulig  <martin@gnome.org>
27561
27562         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
27563         is_writeable is set.
27564         (mono_raw_buffer_update): New function to write the modified map
27565         back to disk.
27566
27567         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
27568
27569         * debug-symfile.c (mono_debug_update_symbol_file): Call
27570         mono_raw_buffer_update() when done writing.
27571
27572 2002-03-23  Martin Baulig  <martin@gnome.org>
27573
27574         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
27575
27576         * debug-symfile.c: Added support for arguments and local variables.
27577
27578 2002-03-23  Dick Porter  <dick@ximian.com>
27579
27580         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
27581         protected by ifdefs, hence breaking the w32 build.
27582
27583 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27584
27585         * object.c: implement is_interned() the right way.
27586
27587 2002-03-21  Martin Baulig  <martin@gnome.org>
27588
27589         * debug-symfile.[ch]: New files to handle debugging information
27590         files. There's also support to dynamically update these symbol
27591         files to include machine dependent information.
27592
27593 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
27594
27595         * threads.c (mono_thread_create): new function to create thread
27596         from C
27597
27598 2002-03-20  Martin Baulig  <martin@gnome.org>
27599
27600         * icall.c (ves_icall_InternalInvoke): Create a new object if the
27601         method is a constructor.
27602         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
27603         points to ves_icall_InternalInvoke().
27604
27605 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
27606
27607         * file-io.c: Flush shouldn't throw exceptions.
27608
27609 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
27610
27611         * file-io.c: FileStream flush support; FileSetLength now
27612         restores file pointer.
27613
27614 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
27615
27616         * class.c: set image for pointer classes.
27617
27618 2002/03/19  Nick Drochak <ndrochak@gol.com>
27619
27620         * sysmath.c: Forgot one.
27621
27622 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
27623
27624         * sysmath.c: Avoid redefining existing names.
27625
27626 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
27627
27628         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
27629         handled by runtime as icall rather than dllimport from libm.so
27630         * file-io.c, file-io.h: fixed handle argument type.
27631
27632 2002-03-18  Dick Porter  <dick@ximian.com>
27633
27634         * reflection.c (mono_image_get_type_info): rename interface to
27635         iface, because of "#define interface struct" on windows.
27636
27637 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
27638
27639         * class.c, class.h: rename and export mono_ptr_class_get().
27640         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
27641         * reflection.c, reflection.h, icall.c: better/saner type name
27642         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
27643         method signatures.
27644
27645 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
27646
27647         * class.c (mono_class_init): removed hardcoded GHC_SLOT
27648
27649         * icall.c (ves_icall_InternalInvoke): impl.
27650
27651 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
27652
27653         * reflection.c: output the interface map table, too.
27654
27655 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
27656
27657         * class.c (class_compute_field_layout): separate computation of 
27658         static field layout
27659
27660 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
27661
27662         * icall.c: added System.Buffer support.
27663         * file-io.c: moved file icalls from PAL to FileStream.
27664
27665 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
27666
27667         * icall.c (ves_icall_System_Object_GetHashCode): impl.
27668
27669 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
27670
27671         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
27672
27673 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
27674
27675         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
27676
27677 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
27678
27679         * debug-helpers.{c,h}: moved here from monograph some useful functions
27680         to locate a method by name/signature in a class or image. Included
27681         also a small and flexible IL disassembler.
27682
27683 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27684
27685         * reflection.c: fixup tokens in methods with small header size, too.
27686
27687 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
27688
27689         * object.c (mono_string_to_utf8): remove assert(!error), instead
27690         print a warning. 
27691
27692 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
27693
27694         * icall.c: update to the new mono_Array_class_get interface.
27695
27696 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
27697
27698         * appdomain.c, object.c: Boehm-GC enable.
27699         * icall.c: make get_data_chunk() support split data requests.
27700         Ensure a class is initialized in more cases. Return only the first
27701         property found in GetProperties() or the compiler gets confused. 
27702         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
27703         * reflection.h, reflection.c: add fixup mechanism for field and method
27704         tokens. Initialize assembly->typeref in a single place. Output
27705         properties after events. Support custom attributes for events, too.
27706         Typo fix for paramter custom attrs.
27707
27708 2002-03-07  Martin Baulig  <martin@gnome.org>
27709
27710         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
27711
27712 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
27713
27714         * class.c (mono_array_class_get): fix. for multi. dim. arrays
27715
27716 2002-03-06  Martin Baulig  <martin@gnome.org>
27717
27718         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
27719         non-zero lower bounds. See testcases #F10-#F13.
27720
27721 2002-03-05  Martin Baulig  <martin@gnome.org>
27722
27723         * exception.c (mono_get_exception_argument_out_of_range): New exception.
27724
27725         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
27726         ves_icall_System_Array_GetValue(), only calculate the absolute array position
27727         here.
27728         (ves_icall_System_Array_SetValue): Likewise.
27729         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
27730         as argument and does the actual work. This function is used when copying a
27731         multi-dimensional array.
27732         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
27733         now do all the widening conversions of value types.
27734         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
27735
27736 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
27737
27738         * class.c: remove some magic numbers and use the smbolic names,
27739         instead. Added init_events() to load event info at class init time.
27740         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
27741         and mono_metadata_methods_from_event().
27742         * reflection.h, reflection.c: added support for writing out the evnets
27743         related information.
27744
27745 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
27746
27747         * reflection.h, icall.c: use a different method (GetInterfaces)
27748         to gather interface info and add isbyref, isprimitive and
27749         ispointer to the ves_icall_get_type_info() return value.
27750
27751 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
27752
27753         * class.h: stared adding support for events.
27754         * icall.c: split find_members implementation. Added debug icall to get
27755         the address of an object.
27756         * reflection.c: handle TypeBuilders in mono_type_get_object().
27757
27758 2002-03-01  Martin Baulig  <martin@gnome.org>
27759
27760         * icall.c (ves_icall_System_Array_GetLength): This must throw an
27761         ArgumentOutOfRangeException(), not an ArgumentException().
27762         (ves_icall_System_Array_GetLowerBound): Likewise.
27763         (ves_icall_System_Array_GetValue): Improved argument checking.
27764         (ves_icall_System_Array_SetValue): Improved argument checking.
27765
27766 2002-03-01  Martin Baulig  <martin@gnome.org>
27767
27768         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
27769         called with invalid arguments rather than just dying with g_assert().
27770         (ves_icall_System_Array_SetValue): Likewise.
27771         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
27772         raise a NotImplementedException instead.
27773         (ves_icall_System_Array_GetLength): Added argument checking.
27774         (ves_icall_System_Array_GetLowerBound): Added argument checking.
27775
27776 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
27777
27778         * object.h (mono_assert): new macros mono_assert and
27779         mono_assert_not_reached
27780
27781 2002-02-28  Martin Baulig  <martin@gnome.org>
27782
27783         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
27784         and "System::String::IsInterned" to "System::String::_IsInterned".
27785
27786 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
27787
27788         * icall.c: remove hacks for typebuilder. Added icall to create a
27789         modified type from a tybebuilder.
27790         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
27791         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
27792         to create a backing MonoClass for a TypeBuilder.
27793
27794 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27795
27796         * class.c, class.h: more refactoring of class init.
27797         Export mono_class_setup_mono_type() and mono_class_setup_parent().
27798
27799 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
27800
27801         * marshal.c, marshal.h: start of marshaling interface.
27802
27803 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
27804
27805         * icall.c: fix order in assembly qualified name icall.
27806
27807 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
27808
27809         * class.c: do not free str, since we store it in the hash table.
27810         * reflection.h: add label field to MonoILExceptionInfo.
27811         * reflection.c: handle references to more than one assembly. Handle
27812         case when there isn't a module created in the assembly.
27813
27814 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
27815
27816         * class.c: Fix typo. Start refactoring of class init code.
27817
27818 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
27819
27820         * appdomain.c: exit with 1 on error.
27821         * class.c: we already have the name in MonoClassField.
27822         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
27823         MonoStreamHeader instead of an offset of image->raw_metadata.
27824
27825 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
27826
27827         * appdomain.c (mono_init): Be even more descriptive about the error.
27828
27829 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
27830
27831         * appdomain.c: give the user an informative message when corlib can't
27832         be loaded.
27833
27834 2002-02-26  Martin Baulig  <martin@gnome.org>
27835
27836         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
27837         New icall to get the time zone data.
27838
27839 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
27840
27841         * reflection.c: set virtual and raw size of section correctly.
27842         * threads.c: transfer domain information to newly created threads.
27843
27844 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
27845
27846         * class.c: when instancing a class in a domain, load the default
27847         vaules for static fields from the constant table. Fix System.Enum to
27848         not be an enum.
27849         * icall.c: implement Object::GetType() internalcall. Implemented
27850         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
27851         Fixed checking of binding flags in find_members().
27852         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
27853         * reflection.c: handle enumerations when writing to the constant
27854         table. Use a different object cache for types.
27855
27856
27857 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
27858
27859         * object.c (mono_object_isinst): fix for arrays
27860
27861         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
27862
27863 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
27864
27865         * object.c: don't use mprotect ()  and fix intern pool hash table
27866         lookup for big endian systems.
27867
27868 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27869
27870         * icall.c: change type_is_subtype_of () signature.
27871
27872 2002-02-21  Mark Crichton  <crichton@gimp.org>
27873
27874         * rand.c, rand.h: Added random number generator for
27875         System.Security.Cryptography classes.
27876
27877         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
27878
27879         * icall.c: Added System.Security.Cryptography calls.
27880
27881 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
27882
27883         * class.c, icall.c, metadata.c: better support for pointer types.
27884         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
27885         * reflection.c: Add support for getting custom attrs for properties
27886         and simplify some code.
27887
27888 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
27889
27890         * icall.c: change getToken () and add custom attribute GetBlob()helper
27891         method.
27892         * reflection.h: add custom attrs array to the reflection builder structures.
27893         * reflection.c: encode and emit custom attributes for all the relevant
27894         reflection objects. Cache fieldref and methodref tokens. Change
27895         mono_image_create_token() interface to take a MonoDynamicAssembly.
27896         More complete custom attributes decoder. Load custom attributes for
27897         Assembly, Field, Method and Constructor objects, too. Make the
27898         returned array an Attribute[] one, not object[]. Added
27899         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
27900         custom attribute constructor.
27901
27902 2002-02-20  Dick Porter  <dick@ximian.com>
27903
27904         * icall.c:
27905         * rawbuffer.c:
27906         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
27907         problem code out for now).
27908
27909 2002-02-19  Radek Doulik  <rodo@ximian.com>
27910
27911         * object.c (mono_ldstr): use hash table to avoid multiple swapping
27912
27913 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
27914
27915         * icall.c: register the GetCustomAttributes method.
27916         * object.c, object.h: add mono_string_new_len ().
27917         * reflection.h, reflection.c: added mono_runtime_invoke(),
27918         mono_install_runtime_invoke(). Added
27919         mono_reflection_get_custom_attrs () to load custom attributes and
27920         create the attribute objects.
27921
27922 2002-02-19  Dick Porter  <dick@ximian.com>
27923         * threads-dummy-types.c:
27924         * threads-dummy-types.h:
27925         * threads-dummy.c:
27926         * threads-dummy.h:
27927         * threads-pthread-types.c:
27928         * threads-pthread-types.h:
27929         * threads-pthread.c:
27930         * threads-pthread.h:  Deleted obsolete files
27931
27932 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
27933
27934         * class.c (mono_class_vtable): runtime init the class when we
27935         allocate static class data.
27936
27937         * icall.c (ves_icall_System_Array_SetValue): check for null values.
27938
27939         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
27940         and String - but we will need generic marshalling support in the
27941         future. 
27942         (mono_init): set the domain name in a ms compatible way
27943
27944         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
27945         String[].
27946
27947 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
27948
27949         * object.c (mono_array_clone): use alloca() instead of g_malloc  
27950         for sizes
27951
27952         * appdomain.c (mono_domain_unload): impl.
27953
27954 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
27955
27956         * appdomain.c, object.c: fix intern pool implementation.
27957         * class.c: fix alignment code.
27958
27959 2002-02-16  Radek Doulik  <rodo@ximian.com>
27960
27961         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
27962         and s2 > s1, just copy lower bytes to be compatible with little
27963         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
27964         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
27965
27966         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
27967         force big_endian to be 1 for big endian machines 
27968         (ves_icall_iconv_new_decoder): ditto
27969
27970 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
27971
27972         * socket-io.c (convert_sockopt_level_and_name): If the system
27973         doesn't define SOL_IP or SOL_TCP, get them by hand using
27974         getprotobyname() and caching the values (because this could be a
27975         slow operation).
27976         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
27977         Use the appropriate struct when the system does support it. Ie,
27978         not all systems have struct ip_mreqn so use struct ip_mreq when
27979         appropriate.
27980
27981 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
27982
27983         * reflection.c: handle finally clauses.
27984
27985 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
27986
27987         * socket-io.c: use g_snprintf() instead of snprintf.
27988
27989 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
27990
27991         * reflection.c (mono_param_get_objects): Cast second argument to
27992         mono_method_get_param_names to a const char** to silence the
27993         compiler warning.
27994
27995         * appdomain.c (mono_domain_assembly_open): Put parens around the
27996         truth statement in the for-loop.
27997
27998         * unicode.c (iconv_convert): Got rid of a compiler warning about
27999         int i being unused when the system has a new iconv.
28000         (iconv_get_length): Same.
28001
28002         * image.c (load_class_names): Cast the second argument to
28003         g_hash_table_insert() to char* to hush compiler warnings about the
28004         arg being a const.
28005         (mono_image_open): Same here.
28006
28007         * socket-io.c: Don't conditionally include sys/filio.h or
28008         sys/sockio.h here anymore since we now get them from
28009         io-layer/io-layer.h
28010         (inet_pton): If the system doesn't support inet_aton, implement
28011         using inet_addr and also #define INADDR_NONE if it isn't defined
28012         by the system.
28013
28014 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
28015
28016         * metadata.c, metadata.h: added function to get packing and size info
28017         of a typedef.
28018         * reflection.h, reflection.c: handle field RVA data. Save info about
28019         the table layout if needed. Assign typedef indexes to all the types
28020         before dumping the info about them to avoid forward reference problems.
28021
28022 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
28023
28024         * socket-io.c (convert_sockopt_level_and_name): ifdef
28025         SO_ACCEPTCONN because it is not defined on my system (old debian)
28026
28027 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
28028
28029         * opcode.c: use stddef.h to get NULL.
28030
28031 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
28032
28033         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
28034         for FIONBIO, FIONREAD and SIOCATMARK.
28035         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
28036         define INADDR_NONE and besides, inet_addr() is deprecated and
28037         should not be used. Use inet_pton() instead - it also has the
28038         added bonus that it can easily handle IPv6 addresses as well.
28039         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
28040
28041 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
28042
28043         * decimal.c: remove _MSC_VER conditional.
28044
28045 2002-02-13  Dick Porter  <dick@ximian.com>
28046
28047         * socket-io.c: 
28048         * icall.c: Internal calls for Blocking, Select, Shutdown,
28049         GetSocketOption and SetSocketOption
28050
28051 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28052
28053         * assembly.cs: better resolver: use it instead of some kludgy
28054         code.
28055
28056 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
28057
28058         * reflection.c: the best way to speed-up the compiler is to avoid
28059         infinite loops.
28060
28061 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
28062
28063         * class.c (mono_class_vtable): changed the object layout
28064         (obj->vtable->class). 
28065         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
28066
28067 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
28068
28069         * assembly.c: look for assemblies in the assembly dir, too.
28070
28071 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28072
28073         * class.c: fix thinko in mono_class_from_type().
28074
28075 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
28076
28077         * exception.h, exception.c: added TypeLoadException.
28078         * object.h, object.c: added mono_array_clone ().
28079         * icall.c: handle throwOnError in AssemblyGetType().
28080         Added Array.Clone().
28081         * opcode.h, opcode.c: use a single value for the opcode val.
28082         Compile fix for non-gcc compilers.
28083
28084 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
28085
28086         * opcodes.c, opcodes.h: export interesting info about opcodes.
28087
28088 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
28089
28090         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
28091         icalls. 
28092
28093         * class.c (class_compute_field_layout): set element_class for enums
28094         (mono_class_create_from_typedef): set element_class for normal classes
28095
28096         * icall.c (ves_icall_System_Enum_get_value): impl.
28097
28098         * class.c (mono_class_create_from_typedef): do not set valuetype
28099         flag for System.ValueType and System.Enum
28100
28101 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
28102
28103         * unicode.c (iconv_convert): fix big endian problem.
28104
28105 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
28106
28107         * class.c: add asserts if we are ever going to scribble over memory.
28108         * socket-io.c: not all systems have AF_IRDA defined.
28109
28110 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
28111
28112         * class.c (class_compute_field_layout): do not consider static
28113         fields to compute alignment
28114
28115 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
28116
28117         * appdomain.c (mono_appdomain_get): impl.
28118         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
28119
28120 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
28121
28122         * icall.c: ignore "file://" prefix when loading an assembly.
28123
28124 2002-01-23  Dick Porter  <dick@ximian.com>
28125
28126         * socket-io.c:
28127         * icall.c:
28128         * Makefile.am: Added socket support
28129
28130 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
28131
28132         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
28133         code back.  This should return the assemblies that are loaded by
28134         the runtime on behalf of an application domain. 
28135
28136         The current implementation is still broken, it just returns every
28137         assembly loaded, but until we get real applications domain this
28138         will do.
28139
28140 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
28141
28142         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
28143         AppDomain object.
28144
28145 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
28146
28147         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
28148         the mono_class_from_name lookup.
28149         (ves_icall_get_parameter_info): ditto.
28150         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
28151         method.
28152         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
28153
28154 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
28155
28156         * class.c: load also nested classes on class init.
28157         System.ValueType instance methods gets passed boxed
28158         values, unless methods in derived classed that get a pointer to the
28159         data.
28160         * icall.c: use better name parsing code in GetType().
28161         * image.c, image.h: add mono_image_loaded ().
28162         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
28163         * reflection.c, reflection.h: added mono_reflection_parse_type().
28164
28165 2002-01-22  Veronica De Santis <veron78@interfree.it>
28166
28167         * icall.c : Added mapping of internal calls for Manual and Auto reset events
28168         * threads.c : Added the implementation of internal calls for events
28169         * threads.h : Added prototypes of internal calls for events
28170         
28171 2002-01-21  Radek Doulik  <rodo@ximian.com>
28172
28173         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
28174
28175 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
28176
28177         * class.c (mono_class_init): set min_align to 1 (instead of 0)
28178         (mono_class_value_size): use min_align
28179
28180 2002-01-20  Dick Porter  <dick@ximian.com>
28181
28182         * threads.h:
28183         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
28184         so it compiles on w32.
28185
28186 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
28187
28188         * metadata.c (mono_type_stack_size): impl.
28189
28190         * class.c (mono_class_get_field): impl. memberref token
28191
28192 2002-01-16 Veronica De Santis <veron78@@interfree.it>
28193
28194         * icall.h : Added the internal calls mapping for CreateMutex_internal
28195                     and ReleaseMutex_internal.
28196         * threads.h : Added the prototype of mutexes internal calls.
28197         * threads.c : Added the implementations of mutexes internal calls.
28198
28199 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
28200
28201         * metaparse.h: removed unused file.
28202         * reflection.c, reflection.h: added stream_data_align () function 
28203         to align data in streams and keep stream aligned. Add support for
28204         exception support in method headers.
28205
28206 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
28207
28208         * unicode.c: make iconv_convert () return the number of bytess written
28209         in the output buffer.
28210
28211 2002-01-15  Dick Porter  <dick@ximian.com>
28212         * threads.c: Make the runtime's idea of infinite timeouts coincide
28213         with the class library's
28214
28215         Fix a particularly egregious bug in mono_thread_cleanup(). That
28216         code was so utterly bogus it must have been written on a Monday.
28217
28218 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
28219
28220         * reflection.h: add subtypes field to TypeBuilder.
28221         * reflection.c: encode constants for literal fields.
28222         Handle subtypes. Fix user string token (and add a zero byte)
28223         at the end.
28224         
28225 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
28226
28227         * class.c (mono_class_init): bug fix: assign slot numbers for
28228         abstract methods.
28229
28230 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
28231
28232         * reflection.c: don't try to output a code RVA for abstract methods.
28233         Small fixes for method header format. Output parameter info to the
28234         ParamDef table. Save method overriding info to MethodImpl table.
28235         Fix property support. Allow typedef.extends to be a type in the
28236         building assembly.
28237         * verify.c: fix off-by-one error.
28238
28239 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
28240
28241         * class.c: fix mono_class_from_mono_type () for szarray types.
28242         Remove unused cache check in mono_class_from_type_spec().
28243         * icall.c: *type_from_name () functions handle simple arrays and byref.
28244         * reflection.c: handle byref and szarray types. Handle methods without
28245         body (gets P/Invoke compilation working). Handle types and fields in
28246         get_token ().
28247         * reflection.h: add rank to MonoTypeInfo.
28248
28249 2002-01-10  Dick Porter  <dick@ximian.com>
28250
28251         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
28252         internal calls
28253
28254 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
28255
28256         * icall.c: initialize class in type_from_handle ().
28257         Loop also in parent classes for get_method ().
28258         * reflection.c: properly encode class and valuetype types.
28259         Start on encoding TypeBuilder types. Handle fieldrefs.
28260         Use correct length when registering a user string.
28261         Handle ConstructorBuilder and MonoMethod in get_token ().
28262         Make mono_type_get_object () aware of cached types.
28263         * object.c: back out change to mono_string_new ().
28264
28265 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
28266         * object.c: mono_string_new should return a NULL when the string 
28267         passed in is NULL -- not try to deference it.
28268         
28269 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
28270
28271         * icall.c: hack to make IsSubType work for TypeBuilders.
28272         * reflection.c: emit constructors before methods.
28273         Retrieve param names in mono_param_get_objects().
28274
28275 2002/01/05  Nick Drochak  <ndrochak@gol.com>
28276
28277         * Makefile.am: fix list of headers and sources so automake 1.5
28278         doesn't complain. Removed \# at end of list.
28279
28280 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
28281
28282         * reflection.c: get token for a method ref. Set return type of
28283         constructor to void.
28284         * loader.c: debug message.
28285         * class.c: typo fix.
28286
28287 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
28288
28289         * icall.c: fix array init with rank > 1. FindMembers
28290         loops in parent class as well.
28291         * image.c: do not insert nested types in name cache.
28292         * reflection.c: warning fix.
28293         * reflection.h: add override method (for interface impl).
28294
28295 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
28296
28297         * metadata.c: fix customattr decoding.
28298
28299 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
28300
28301         * rawbuffer.cs: Added native Win32 implementation, avoids using
28302         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
28303
28304 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
28305
28306         * class.c: make the low-level routines handle the cache.
28307
28308 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
28309
28310         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
28311
28312 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
28313
28314         * class.c: fix mono_array_element_size() for objects.
28315         * class.h, class.c: add properties to MonoClass and load them
28316         at init time.
28317         * icall.c: check with isinst() when assigning a value to an array
28318         instead of requiring the classes to match exactly.
28319         Implemented icall for System.Type::GetType().
28320         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
28321         enums. Handle bindingflags when looking for methods and fields.
28322         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
28323         and mono_metadata_methods_from_property().
28324         * reflection.h, reflection.c: added structures for propreties,
28325         parameters and enums. Implemented mono_property_get_object() and
28326         mono_param_get_objects().
28327
28328 2001-12-18  Dick Porter  <dick@ximian.com>
28329
28330         * file-io.c: Use mono_string_to_utf16() instead of
28331         mono_string_chars()
28332
28333         * object.c: Added mono_string_to_utf16(), which copies the non
28334         NULL-terminated MonoString into a new double-null-terminated
28335         buffer.
28336
28337 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
28338
28339         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
28340
28341 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
28342
28343         * file-io.c: raise exceptions if handle is invalid.
28344
28345 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
28346
28347         * assembly.c: yet another check for mscorlib.
28348         * class.c, class.h: load nesting info for classes.
28349         * icall.c: many new functions to support the Reflection classes.
28350         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
28351         * reflection.h, reflection.c: mono_image_create_token(),
28352         mono_assembly_get_object(), mono_type_get_object(),
28353         mono_method_get_object(), mono_field_get_object(): methods to return
28354         objects that parallel the C representation of assemblies, types,
28355         methods, fields.
28356
28357 2001-12-11  Dick Porter  <dick@ximian.com>
28358
28359         * icall.c:
28360         * file-io.c: Internal calls for file IO.
28361
28362 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
28363
28364         * tabledefs.h: missing FileAttributes.
28365         * verify.h, verify.c: use is_valid_string () to simplify and check for
28366         valid strings more correctly. Fix warnings and speeling.
28367         Check more tables: Filed, File, ModuleRef, StandAloneSig.
28368         Check code: branches, maxstack, method calls.
28369
28370 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
28371
28372         * object.c (mono_object_allocate): removed static, so that the jit
28373         can allocate value types.
28374
28375         * icall.c (ves_icall_System_DateTime_GetNow): impl.
28376
28377 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
28378
28379         * class.c: init enum types right away and register the
28380         token->MonoClass map in mono_class_create_from_typedef ().
28381         * verify.h, verify.c: first cut of the verifier.
28382         * pedump.c: add --verify switch to verify metadata tables.
28383         * tabledefs.h: add some missing enums.
28384
28385 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
28386
28387         * class.c (mono_install_runtime_class_init): impl.
28388         (mono_class_init): renamed mono_class_metadata_init to
28389         mono_class_init, also removed the metadata_inited flag
28390
28391         * object.c (mono_object_isinst): use faster algorithm
28392
28393 2001-11-30  Radek Doulik  <rodo@ximian.com>
28394
28395         * mono-endian.h: reverted last change
28396         added function prototypes
28397
28398         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
28399         add mono-endian.c back
28400
28401         * mono-endian.c: returned back, as Paolo pointed out, it's needed
28402         for unaligned access, I've mistaked it with endianess. I am
28403         sorry.
28404         (mono_read16): fix reverted endianess
28405         (mono_read64): ditto
28406         (mono_read32): ditto
28407
28408 2001-11-30  Dick Porter  <dick@ximian.com>
28409
28410         * exception.c: Implement mono_exception_from_name()
28411
28412 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
28413
28414         * metadata.h, metadata.c: remove params_size and locals_size and their
28415         calculation from the metadata code: they are only usefult to the
28416         interp.
28417
28418 2001-11-29  Radek Doulik  <rodo@ximian.com>
28419
28420         * object.c (mono_ldstr): swap bytes here, it's probably not the
28421         best place, but works for me now, I'll redo it once I know mono
28422         better, also note that I add PROT_WRITE and don't reset back, also
28423         note that it's only affects big endians, so x86 should be OK
28424
28425         * mono-endian.h (read16): use just glib macros for both endians
28426
28427         * mono-endian.c: removed as glib macros are used in in
28428         mono-endian.h so we don't need to care about endianess for read
28429         macros as glib does that for us already
28430
28431 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
28432
28433         * class.h, class.h: take minimum alignment into consideration so
28434         that the fields of a class remain aligned also when in an array.
28435
28436 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
28437
28438         * loader.h, loader.c: add mono_method_get_param_names().
28439         * class.c: 0-init class fields.
28440
28441 2001-11-26  Dick Porter  <dick@ximian.com>
28442
28443         * icall.c:
28444         * threads-types.h:
28445         * threads.c: New file that handles System.Threading on all platforms
28446
28447         * object.c: 
28448         * object.h: Remove the synchronisation struct from MonoObject,
28449         replace it with a pointer that gets initialised on demand
28450
28451         * Makefile.am: Replace all the system-specific threading code with
28452         a single file that uses the new wrapper library
28453
28454 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
28455
28456         * class.c, class.h: add mono_install_trampoline() so that the runtime
28457         can register a function to create a trampoline: removes the ugly
28458         requirement that a runtime needed to export arch_create_jit_trampoline.
28459         * object.h, object.c: added mono_install_handler() so that the runtime
28460         can install an handler for exceptions generated in C code (with
28461         mono_raise_exception()). Added C struct for System.Delegate.
28462         * pedump.c: removed arch_create_jit_trampoline.
28463         * reflection.c: some cleanups to allow registering user strings and
28464         later getting a token for methodrefs and fieldrefs before the assembly
28465         is built.
28466         * row-indexes.h: updates and fixes from the new ECMA specs.
28467
28468 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
28469
28470         * class.h, class.c: add enum_basetype field to MonoClass.
28471         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
28472         to get index in the constant table reated to a field, param or
28473         property.
28474         * reflection.h, reflection.c: handle constructors. Set public-key and
28475         version number of the built assembly to 0.
28476         * row-indexes.h: update from new ECMA spec.
28477
28478 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
28479
28480         * class.h, class.c: add a max_interface_id to MonoClass.
28481         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
28482         since it's used to do that. Added mono_type_type_from_obj().
28483         Make GetType() return NULL instead of segfaulting if the type was not
28484         found. Handle simple arrays in assQualifiedName.
28485         * object.h: add a struct to represent an Exception.
28486         * reflection.c: output call convention in method signature.
28487         Add code to support P/Invoke methods and fixed offsets for fields.
28488
28489 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
28490
28491         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
28492         the value.
28493         * icall.c: use mono_array_addr instead of array->vector: fixes the
28494         reflection image writing.
28495         * reflection.c: init call convention byte to 0 in method signature.
28496         Encode the property signature. Don't output property-related methods
28497         twice. Really process the properties for a type (don't cast a field to
28498         a property, my mom always told me that).
28499         Fix 64 bit issues in pointer alignment in a different and more
28500         readable way.
28501
28502 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
28503
28504         * loader.h: Removed type class from MonoDefaults, added monotype
28505
28506         * loader.c: Loaded MonoType, removed loading of Type
28507
28508         * icall.c (my_mono_new_object): Now returns a System.MonoType,
28509         and fills in System.Type._impl with a RuntimeTypeHandle rather
28510         than the actual MonoClass *
28511
28512         (ves_icall_type_from_handle): change from type_class to
28513         monotype_class
28514
28515         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
28516         implemented
28517
28518         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
28519         implemented
28520
28521         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
28522
28523         (ves_icall_System_Reflection_Assembly_GetType): implemented
28524
28525         (ves_icall_System_MonoType_assQualifiedName): implemented
28526
28527         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
28528
28529 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
28530
28531         * assembly.c (mono_assembly_open): Implement a cache for the
28532         assemblies. 
28533
28534         (mono_assembly_close): only destroy the assembly when the last
28535         reference is gone.
28536         
28537 2001-11-09  Dick Porter  <dick@ximian.com>
28538
28539         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
28540
28541 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
28542
28543         * class.c (mono_class_metadata_init): bug fix: compute the right slot
28544
28545 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
28546
28547         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
28548         from Martin Weindel.
28549         * object.h: add mono_string_chars ().
28550
28551 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
28552
28553         * reflection.c (build_compressed_metadata): Eliminates warnings
28554         and uses 64-bit clean code.
28555
28556         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
28557         (mono_type_equal): Change signature to eliminate warnings.
28558
28559 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
28560
28561         * icall.c, loader.c: remove the internalcall array constructors.
28562         Changes to match the new MonoArray structure.
28563         * object.h, object.c: an array object doesn't allocate an extra
28564         vector. Add mono_array_new_full () to create jagged arrays easily.
28565
28566 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
28567
28568         * metadata.h, metadata.c: add mono_metadata_field_info () to
28569         retreive all the info about a field from vairous tables.
28570         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
28571         * class.h, class.c: augment MonoClassField with more info.
28572         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
28573         policy and load a field's RVA if needed.
28574
28575 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
28576
28577         * class.c (mono_class_metadata_init): create a trampoline for all
28578         virtual functions instead of actually compiling them.
28579
28580 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
28581
28582         * class.h, class.c: include name in MonoClassField.
28583         * class.c: fix fundamental type of System.Object and System.String.
28584         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
28585         tokens in ldtoken.
28586         * icall.c: remove internalcalls for the Reflection stuff that is now
28587         done in C# code.
28588         * loader.c: mono_field_from_memberref () implementation.
28589         * mono-endian.c: thinko (s/struct/union/g).
28590         * object.c, object.h: make the mono_string_* prototypes actually use
28591         MonoString instead of MonoObject.
28592         * reflection.c, reflection.h: updates for changes in the reflection
28593         code in corlib: we use C structures that map to the actual C# classes.
28594         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
28595         fat method header if needed and use the info from the ILGenerator for
28596         methods. Handle fields in types. Misc fixes.
28597
28598 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
28599
28600         * class.c (mono_class_metadata_init): bug fix: always allocate
28601         space for static class data
28602
28603 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
28604
28605         * class.c (mono_compute_relative_numbering): use relative
28606         numbering to support fast runtime type checks.
28607
28608 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
28609
28610         * class.c (mono_class_create_from_typeref): added debugging output
28611         to print class name when MonoDummy is returned instead of real class
28612
28613 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
28614
28615         * class.c (mono_class_metadata_init): interface offset table now
28616         contains pointers into the vtable - this is more efficient for the jit
28617
28618 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
28619
28620         * class.c (mono_class_metadata_init): use a temporary vtable (the
28621         old algorithm only worked for the interpreter, but not for the jit)
28622
28623 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
28624
28625         * loader.c (method_from_memberref): use mono_class_get to get the
28626         class of an array instead of using System.Array directly.
28627         (mono_get_method): also add MEMBERREF methods to the method cache
28628         which usefull for arrays.
28629
28630 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
28631
28632         * pedump.c (arch_compile_method): added to compute vtable entry
28633
28634         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
28635         number of interfaces.
28636         
28637         * class.h: merged MonoArrayClass into MonoClass
28638
28639         * class.c (mono_class_create_from_typedef): compute the vtable size and
28640         allocate space to include the vtable inside MonoClass
28641         (mono_class_metadata_init): initialize the vtable
28642
28643 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
28644
28645         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
28646         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
28647         * image.c: endian fixes by Laurent Rioux.
28648         * object.h, object.c: rename MonoStringObject to MonoString and
28649         MonoArrayObject to MonoArray. Change some function names to conform to
28650         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
28651         guint16* as first argument, so don't use char*.
28652         Provide macros to do the interesting things on arrays in a portable way.
28653         * threads-pthread.c: updates for the API changes and #include <sched.h>
28654         (required for sched_yield()).
28655         * icall.c: updates for the API changes above.
28656         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
28657         platforms that need them.
28658
28659 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
28660
28661         * class.c: set the correct type for all the fundamental
28662         type when loading the class.
28663
28664 2001-10-05  Dick Porter  <dick@ximian.com>
28665
28666         * threads-pthread.c (pthread_mutex_timedlock): Simple
28667         compatibility version for C libraries that lack this call.
28668
28669 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28670
28671         * class.c: MonoTypes stored in MonoClass are stored as
28672         fundamental MonoTypes when the class represents a
28673         fundamental type (System.Int32, ...).
28674         The TypeHandle return by ldtoken is a MonoType*.
28675         * icall.c: ves_icall_get_data_chunk () write out all the
28676         PE/COFF stuff. Implement ves_icall_define_method (),
28677         ves_icall_set_method_body (), ves_icall_type_from_handle ().
28678         * image.c: properly skip unknown streams.
28679         * loader.h, loader.c: add type_class to mono_defaults.
28680         * metadata.c, metadata.h: export compute_size () as
28681         mono_metadata_compute_size () with a better interface.
28682         Typo and C&P fixes.
28683         * pedump.c: don't try to print the entry point RVA if there is no entry point.
28684         * reflection.c, reflection.h: many cleanups, fixes, output method
28685         signatures and headers, typedef and typeref info, compress the metadata
28686         tables, output all the heap streams, cli header etc.
28687         * row-indexes.h: typo fixes.
28688
28689 2001-10-04  Dick Porter  <dick@ximian.com>
28690
28691         * object.h: Add a synchronisation mutex struct to MonoObject
28692
28693         * object.c (mono_new_object): Initialise the object
28694         synchronisation mutexes
28695
28696         * icall.c: System.Threading.Monitor internal calls
28697         
28698         * threads-pthread.h:
28699         * threads-pthread.c: System.Threading.Monitor internal calls
28700
28701         * threads-types.h: New file, includes the system-specific thread
28702         structures
28703         
28704         * threads-pthread-types.h:
28705         * threads-pthread-types.c: New files, handle pthread-specific
28706         synchronisation types
28707
28708         * threads-dummy-types.h: 
28709         * threads-dummy-types.c: New files of dummy support for
28710         thread-specific types
28711
28712         * metadata.c:
28713         * image.c:
28714         * pedump.c: include mono-endian.h not endian.h
28715         
28716         * Makefile.am: More threads files.
28717         Name mono-endian.h not endian.h
28718
28719 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
28720
28721         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
28722         stuff and implement a few more bits.
28723         * icall.c: a field needs to be dereferenced twice. Do not use the same
28724         name for two variables in the same scope.
28725         * image.c, image.h: cleanups.
28726
28727 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
28728
28729         * class.c (mono_class_metadata_init): bug fix: compute the right size
28730
28731 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
28732
28733         * icall.c: implemented some of the Reflection internalcalls.
28734         * image.c, image.h: start writing out the PE/COFF image.
28735         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
28736         that does the reverse than decode_blob_size ().
28737         * object.c: use mono_metadata_encode_value (). Move here
28738         temporary implementation of mono_string_to_utf8 ().
28739         * rawbuffer.c: make malloc_map static.
28740
28741 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28742
28743         * metadata.c: fix type comparison for arrays.
28744         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
28745         Added a couple of new classes to monodefaults.
28746         * icall.c: added a couple of Reflection-related internalcalls.
28747         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
28748         Added a byval_arg MonoType to MonoClass.
28749
28750 2001-09-28  Dick Porter  <dick@ximian.com>
28751
28752         * icall.c:
28753         * threads-pthread.h: 
28754         * threads-pthread.c: Implemented internal calls for
28755         LocalDataStoreSlot operations.  Applied mutexes around all shared
28756         data.  Reworked the thread creation and Start() operations to
28757         avoid a race condition.
28758         
28759         * threads-dummy.h:
28760         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
28761
28762 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
28763
28764         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
28765
28766 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
28767
28768         * class.c, loader.c: warn and return NULL instead of erroring out.
28769         * icall.c: added System.AppDomain::getCurDomain().
28770         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
28771
28772 2001-09-25  Dick Porter  <dick@ximian.com>
28773
28774         * threads-pthread.h:
28775         * threads-pthread.c: Implemented timed thread joining and added
28776         System.Threading.Thread::Join_internal internal call
28777
28778         * icall.c: Added System.Threading.Thread::Join_internal internal call
28779
28780         * threads-dummy.h:
28781         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
28782
28783 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
28784
28785         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
28786         mono_string_intern () to implement the semantics of the ldstr opcode
28787         and the interning of System.Strings.
28788         * icall.c: provide hooks to make String::IsIntern and String::Intern
28789         internalcalls.
28790
28791 2001-09-23  Dick Porter  <dick@ximian.com>
28792
28793         * threads-dummy.c: 
28794         * threads-dummy.h: New files of dummy threading routines
28795
28796         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
28797         support code based on system specifics
28798
28799         Rename PTHREAD_LIBS to THREAD_LIBS
28800         
28801 2001-09-23  Dick Porter  <dick@ximian.com>
28802
28803         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
28804         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
28805         internal calls.
28806         (mono_thread_init): Set up a Thread object instance to return when
28807         the main thread calls Thread.CurrentThread
28808         (mono_thread_cleanup): Wait for all subthreads to exit
28809
28810         * icall.c: New internal calls for System.Threading.Thread::Sleep
28811         (including Schedule) and CurrentThread
28812
28813         * threads.h: New file, to insulate thread-specific stuff from the
28814         rest of the code
28815
28816 2001-09-21  Dick Porter  <dick@ximian.com>
28817
28818         * threads-pthread.h: 
28819         * threads-pthread.c: New file, for handling pthreads-style
28820         threading support.  Start() now starts a new thread and executes
28821         the ThreadStart delegate instance.
28822
28823         * icall.c: Added the internalcall for
28824         System.Threading.Thread::Start_internal
28825
28826         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
28827
28828 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
28829
28830         * loader.c: work around the different signatures for delegates
28831         constructors csc generates in compiled code vs the ones compiled in mscorlib.
28832
28833 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
28834
28835         * class.h, class.c: add mono_class_get_field_from_name ().
28836         * *: Fix C comments and other ANSI C issues.
28837
28838 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
28839
28840         * endian.h, assembly.c: fix some endianness issues.
28841
28842 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
28843
28844         * loader.h, load.c: add delegate_class to mono_defaults.
28845         Handle runtime provided methods in mono_get_method ().
28846
28847 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
28848
28849         * loader.c (mono_get_method): use pinvoke for internal call
28850
28851         * icall.c: use pinvoke for internal call
28852
28853         * loader.c (method_from_memberref): set the method name
28854
28855 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
28856
28857         * metadata.c: help the compiler generate better code for
28858         mono_class_from_mono_type ().
28859
28860 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
28861
28862         * class.c (mono_class_metadata_init): delayed computing of the
28863         class size to mono_class_metadata_init ()
28864
28865 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
28866
28867         * class.c, class.h: add an interfaces member to MonoClass.
28868         * image.c, image.h: add assembly_name field to MonoImage
28869         from the assembly table.
28870         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
28871
28872 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
28873
28874         * class.c: Handle Array in mono_class_from_mono_type ().
28875         * metadata.c, pedump.c: some endian fixes.
28876
28877 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
28878
28879         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
28880         * metadata.c: fix small problem introduced with the latest commit.
28881
28882 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
28883
28884         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
28885         We don't need a MonoMetadata pointer anymore to compare signatures in
28886         mono_metadata_signature_equal (), update callers.
28887         Reduced memory usage an number of allocations for MonoMethodHeader and
28888         MonoMethodSignature.
28889
28890 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
28891
28892         * metadata.c: added compare for szarray.
28893
28894 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
28895
28896         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
28897         and add a couple more types to it and mono_defaults. Give an hint on
28898         classes that need implementing in our corlib and are referenced
28899         in mscorlib.
28900
28901 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
28902
28903         * class.h, class.c: keep track if a class is also an Enum.
28904         * loader.c: Implement a couple more types for use in libffi
28905         marshalling. Gives better diagnostics when failing to dlopen
28906         a library. Set method->klass for P/Invoke methods, too.
28907
28908 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
28909
28910         * class.c, class.h: add a MonoType this_arg to MonoClass that
28911         represents a pointer to an object of the class' type that
28912         can be used by the interpreter and later the type cache.
28913         Add best guess alignment info for valuetype objects.
28914
28915 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
28916
28917         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
28918         into MonoType: one less level of indirection and allocation and
28919         simplifies quite a bit of code. Added cache for MonoTypes that are
28920         used frequently, so that we don't need to allocate them all the time.
28921
28922 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
28923
28924         * class.c (mono_class_create_from_typedef): System.Enum is also a
28925         value type, although it does not derive from System.ValueType
28926         (maybe a bug in the ms compiler?)
28927
28928         * metadata.c (mono_type_size): return the right size for value types
28929
28930         * loader.c (mono_get_method): only initialize method header if not abstract
28931
28932         * class.c (mono_class_from_mono_type): use mono_default values. 
28933
28934 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
28935
28936         * *: use MonoClass pointers instead of <type_tokens>
28937         
28938         * class.h: new flag: metadata_inited.
28939
28940         * class.c (mono_class_metadata_init): impl.
28941         (mono_class_instance_size): impl.
28942         (mono_class_data_size): impl.
28943
28944 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
28945
28946         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
28947         MonoClass now has the name and name_space fields. 
28948         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
28949         mono_get_method () takes and optional MonoClass as argument.
28950         Removed mono_typedef_from_name() and added mono_class_token_from_name()
28951         instead that takes advantage of a map from class names to typedef
28952         tokens in MonoImage.
28953
28954 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
28955
28956         * metadata.c: zero is not a valid alignment boundary.
28957         Merge MONO_TYPE_VOID in default decoding code.
28958
28959 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
28960
28961         * image.h: merged MonoMetadata into MonoImage
28962
28963         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
28964         identify the type of elements.
28965
28966 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
28967
28968         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
28969         * cil-coff.h: split MonoMSDOSHeader and add size info.
28970         * image.c: add some consistency checks.
28971         * metadata.c: fix row size computation: one programmer
28972         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
28973         add explanation for the locator routine.
28974         Fix decoding of size in method header.
28975         
28976 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
28977
28978         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
28979         (g_concat_dir_and_file): Bring g_concat_dir_and_file
28980         function from gnome-libs.  This uses the right path separator
28981         based on the OS, and also works around a bug in some systems where
28982         a double slash is not allowed. 
28983         (default_assembly_name_resolver): Use g_concat_dir_and_file
28984         (mono_assembly_open): ditto.
28985
28986 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
28987
28988         * metadata.c (mono_metadata_signature_equal): impl.
28989
28990         * *: void is now a realy MonoType (instead of using NULL)
28991         
28992         * metadata.c (do_mono_metadata_parse_type): use
28993         mono_metadata_parse_type to parse void value.
28994
28995 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
28996
28997         * metadata.c, metadata.h: in the signature and method header store
28998         only the space required for holding the loca vars and incoming arguments.
28999
29000 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
29001
29002         * metadata.c (do_mono_metadata_parse_type): treat void like any
29003         other type (instead of assigning NULL);
29004
29005 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
29006
29007         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
29008
29009 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
29010
29011         * image.c (do_mono_image_open): added a cache for arrays.
29012
29013 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
29014
29015         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
29016         decode a single column from a row in a metadata table and changes
29017         to take advantage of it in the typedef locator (gives a nice speed up).
29018         Store offset info for function params.
29019
29020 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
29021
29022         * image.h (MONO_IMAGE_IS_CORLIB): removed 
29023
29024 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
29025
29026         * assembly.c: how could mono_assembly_close () had ever worked?
29027         * metadata.c, metadata.h: provide offset info for local vars.
29028         Implement mono_type_size () to take care of alignment as well
29029         as size (it was mono_field_type_size in cli/class.c before).
29030
29031 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
29032
29033         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
29034
29035         * assembly.h (CORLIB_NAME): set to corlib.dll
29036
29037         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
29038
29039 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
29040
29041         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
29042         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
29043         tokentype.h: massive namespace cleanup.
29044
29045 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
29046
29047         * metadata.h, metadata.c: decode exception clauses when parsing method header.
29048
29049 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
29050
29051         * metadata.c (mono_metadata_free_type): added check for type !=
29052         NULL (void) before calling mono_metadata_free_type()
29053
29054 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
29055
29056         * metadata.h, row_indexes.h: added header with enumerations to use
29057         to index in the columns from tables in metadata and to decode coded
29058         tokens: we should start using this instead of embedding magic numbers
29059         all over the code.
29060
29061 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
29062
29063         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
29064         Move metadata_t info from cli_image_info_t to MonoImage, where
29065         it's easily accessible. Changed all the uses accordingly.
29066         Added the method and class caches to MonoImage.
29067         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
29068         and mono_metadata_decode_value () signature to be more consistent
29069         with the other parse functions (and simplify code). Taken advantage
29070         of zero-length array allocation with GCC. Removed reduntant (and
29071         wrong) MonoFieldType struct and use MonoParam instead. Changed
29072         mono_metadata_parse_field_type () to use common code for parsing.
29073         Added mono_metadata_typedef_from_field () and
29074         mono_metadata_typedef_from_method () to lookup a typedef index from a
29075         field or method token.
29076         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
29077
29078 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
29079
29080         * metadata.c (mono_metadata_parse_field_type): Implement. 
29081         (do_mono_metadata_parse_type): Split engine from
29082         mono_metadata_parse_type, so that we can create smaller structures
29083         for things that just have one pointer to the MonoType (look at
29084         the MonoFieldType)
29085
29086 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
29087
29088         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
29089         as Jan Gray found out, it is incorrect. 
29090
29091 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
29092
29093         * assembly.c: Implement asssembly loading.  This loads an image
29094         and loads all the referenced assemblies.  Come to think of it, we
29095         could always do lazy loading of the assemblies. 
29096
29097         * image.c (mono_image_open): Keep loaded images in a hashtable.
29098
29099         * image.h (MonoImage): Add reference count.
29100
29101 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29102
29103         * assembly.c (mono_assembly_open): Keep track of the file name in
29104         case the assembly has no ASSEMBLY table.
29105
29106         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
29107         from get.c here.
29108
29109 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
29110
29111         * metadata.c, metadata.h: decode local vars in method header
29112         parse function. Change callers accordingly.
29113
29114 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
29115
29116         * metadata.h, cil-coff.h: protect against multiple inclusion.
29117         Added some new structures to hold information decoded from metadata:
29118         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
29119         and relevant decoding/free functions.
29120         * metadata.c: implement decoding functions. Add warning for out of bounds
29121         index in mono_metadata_locate(). Implement mono_get_method () to retreive
29122         all the info about a method signature and invocation. Remove check on
29123         uninitialized local var in parse_mh() and fix memory leak.
29124
29125 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
29126
29127         * metadata.h: More macros.
29128
29129         * tokentype.h: New file.
29130
29131 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
29132
29133         * assembly.c: added a consistency check and initialize
29134         some structures with g_new0().
29135         * metadata.c: fixed a couple more bugs in table size computation
29136         and add other checks for out-of bound access to metadata.
29137
29138 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
29139
29140         * metatada.c: fix bugs computing table sizes. Spew a
29141         warning when index in string heap is out of bounds.
29142
29143 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
29144
29145         * metadata.h: Add a couple of macros to manipulate tokens. 
29146
29147 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
29148
29149         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
29150         cli_section_tables).
29151
29152 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
29153
29154         * metadata.c (mono_metadata_user_string): New function, provides
29155         access to the UserString heap. 
29156
29157 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
29158
29159         * metadata.c: Add inline documentation.
29160
29161 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
29162
29163         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
29164         files. 
29165
29166 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
29167
29168         * typeattr.h: New file, TypeAttribute flags. 
29169
29170 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
29171
29172         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
29173         mono_assembly_ensure_section): Section loading code.
29174         (load_section_tables): Load the sections.
29175
29176         * mono/metadata/metadata.c (mono_metadata_locate_token,
29177         mono_metadata_locate): Functions to locate the information
29178         definition given a token or a table and an index.
29179         (mono_metadata_compute_table_bases): New.
29180         (compute_size): New function to compute the sizes of the various
29181         tables.
29182
29183         * mono/metadata/metadata.h: Finish listing the different index
29184         types. 
29185
29186         * mono/metadata/pedump.c: Improve to dump new information.
29187
29188 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29189
29190         * mono/metadata/metadata.c: Entered all the tables matching
29191         Beta2. 
29192
29193         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
29194
29195
29196
29197