2009-11-05 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / metadata / ChangeLog
1 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2
3         * class.c: Add missing check for load errors after every
4         call to mono_class_setup_fields
5
6         Fixes #552282.
7
8 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
9
10         metadata-verify.c (verify_tables_schema): Fix the error message.
11
12 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
13
14         * metadata.c: Change event table schema to use TDOR for event type
15         as this is what it's meant to be.
16
17         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
18         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
19         entry.
20
21         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
22         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
23         rows in MONO_TABLE_GENERICPARAM.
24
25         Fixes #552289.
26
27 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
28
29         * class.c (mono_image_add_to_name_cache): Assert on duplicate
30         insertion.
31
32         * reflection.c (mono_reflection_setup_internal_class): Avoid
33         registering a gc root the same MonoClass multiple times.
34         Don't register nested types on the global scope as they should
35         not be available there.
36
37 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
38
39         * culture-info-tables.h: regenerated.
40
41 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
42
43         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
44
45 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
46
47         * string-icalls.c|h: Remove string internal calls that are not 
48         used anymore by the class libraries.
49         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
50         which is not used in the class librairies.
51         * icall-def.h: Update tables.
52
53 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
54
55         * class.h: Move mono_class_inflate_generic_type_checked...
56
57         * class-internals.h: to here and make it internal. We don't want to
58         further expose MonoGenericContext. 
59
60 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
61
62         * verify.c (mono_method_verify): Improve error message.
63
64 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
65
66         * reflection.c (fieldref_encode_signature): If field_image is NULL then
67         the token is already properly encoded. Fixs 4.0 build.
68
69 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
70
71         * locales.c (construct_number_format): Check if the number index is
72         valid before trying to use it, if not, just return.
73         
74 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
75
76         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
77         since that loses the abort state. Fixes #539394.
78
79 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
80
81         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
82         explicit this argument to the call signature.
83         (mono_marshal_get_icall_wrapper): Ditto.
84
85 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
86
87         * reflection.c (fieldref_encode_signature): Add new field_image parameter
88         to indicate which assembly to use when resolving a custom-mod.
89
90         Fixes handling of volatile fields used across assemblies as reported in #551513.
91
92 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
93
94         * loader.c: Improve error messages.
95
96 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
97
98         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
99         of interfaces. Fixes IKVM.
100
101         * class.c (mono_class_setup_vtable_general): Improve debug spew.
102
103 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
104
105         * verify.c (verifier_inflate_type): Return the inflated type on success.
106
107 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
108
109         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
110
111         * threads.c (mono_thread_attach): Call the profiler thread start callback.
112
113         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
114
115         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
116         flag set.
117
118         * profiler.c: Add new profiler callbacks for runtime invoke.
119
120         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
121
122 2009-11-01  Mark Probst  <mark.probst@gmail.com>
123
124         * sgen-gc.c: Keep track of the reason for a major collection and
125         write it to the heap-dump file.
126
127 2009-10-31  Miguel de Icaza  <miguel@novell.com>
128
129         * threads.c: refactor the code that initializes the
130         thread_start_args into a reusable function and use this in the two
131         methods that start up threads.
132
133 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
134
135         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
136         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
137
138 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
139
140         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
141         Until now, we only had the per-cpu(core) counters.
142
143 2009-10-28  Mark Probst  <mark.probst@gmail.com>
144
145         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
146         mono_gc_get_suspend_signal(), which returns the suspend signal
147         number used by the GC.
148
149 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
150
151         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
152
153         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
154         signalling start_notify.
155
156 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
157
158         * appdomain.c: do not test the st_mode field for shadow-copies.
159         Fixes bug #545276.
160
161 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
162
163         * threadpool.[ch]: added hooks for thread start/finish and item
164         processing begin/end. For monotouch use only.
165
166 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
167
168         * threads.c (mono_thread_get_name): New helper function.
169
170         * reflection.c (resolve_object): Set handle_class for strings too.
171         (mono_reflection_create_custom_attr_data_args): New helper function to decode
172         a cattr blob into a set of arrays and structures without creating the custom
173         attributes themselves.
174         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
175
176         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
177
178         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
179         function.
180
181 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
182
183         * verify.c: Replace calls to mono_class_inflate_generic_type with
184         mono_class_inflate_generic_type_checked. Fixes #480005.
185
186 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
187
188         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
189         object since not all paths lead to callees initing it.
190
191 2009-10-23  Alp Toker  <alp@nuanti.com>
192
193         Fix embedding API breakage from r144688. mono-compiler.h is an internal
194         header and should not be shipped:
195
196         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
197         which is specific to the mono build. Not going to work.
198
199 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
200
201         * security-manager.c: Report if core-clr is active from
202         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
203         to allow Moonlight BCL to behave appropriately (both in browser
204         and outside, e.g. smcs)
205
206 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
207
208         * mono-config.c: ignore UTF-8 BOM and report parser errors.
209         Fixes bug #549108.
210
211 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
212
213         * class.c: fix typo.
214
215 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
216
217         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
218         a MonoError parameter.
219
220         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
221         version that can does proper error handling.
222
223         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
224
225         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
226
227         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
228
229 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
230
231         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
232         NO_UNALIGNED_ACCESS is defined.
233
234 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
235
236         * marshal.c (mono_string_builder_to_utf16): Applied patch from
237         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
238         Fixes #549173.
239
240 2009-10-22  Mark Probst  <mark.probst@gmail.com>
241
242         * sgen-gc.c: Shorten sections whenever possible.
243
244 2009-10-22  Mark Probst  <mark.probst@gmail.com>
245
246         * sgen-gc.c: Use our portable semaphore #defines.
247
248 2009-10-22  Mark Probst  <mark.probst@gmail.com>
249
250         * sgen-gc.c: A debug option for dumping the heap layout to a file
251         after each collection.
252
253 2009-10-21  Mark Probst  <mark.probst@gmail.com>
254
255         * sgen-gc.c: Make managed write barriers atomic via
256         thread-restarts.
257
258 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
259
260         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
261         methods. Fixes #543021.
262
263 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
264
265         * socket-io.[ch]: fix VS build.
266
267 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
268
269         * icall-def.h:
270         * socket-io.[ch]: implemented SendFile.
271
272 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
273
274         * class.c (mono_class_create_from_typedef): Initialize class->element_class
275         before the interfaces to avoid crashes later if class initialization fails.
276         Fixes #548417.
277
278         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
279         Fixes #548276.
280
281 2009-10-20  Marek Safar  <marek.safar@gmail.com>
282
283         * domain.c: Bump 4.0 version.
284
285 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
286
287         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
288         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
289         check since 'pubkey' can't be NULL at this stage
290         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
291         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
292         initialization of 'iter'
293
294 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
295
296         * cominterop.c : Search the interface parts of vtable to find 
297           method matches.  Fixes 547030.
298
299         Code is contributed under MIT/X11 license.
300
301 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
302
303         * marshal.c: BeginInvoke cannot be called on multicast delegates with
304         multiple targets. Fixes bug #574426.
305
306 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
307
308         * profiler.h: Put here the definition of
309         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
310         (and fix the build...).
311
312 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
313
314         * profiler.c, profiler.h, profiler-private.h:
315         Added support for different ways of getting call chains in stat mode.
316
317 2009-10-12  Mark Probst  <mark.probst@gmail.com>
318
319         * object.c, object-internals.h: New function for computing the
320         size of an array, factored out of mono_array_new_full().  Use
321         SGen's functions for allocating arrays and vectors.
322
323         * sgen-gc.c, gc-internal.h: Special functions for allocating
324         arrays and vectors without race conditions.  A managed array
325         allocator method.
326
327         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
328
329 2009-10-12  Mark Probst  <mark.probst@gmail.com>
330
331         * object.c, object.h, icall.c: Write barriers do the copying now,
332         as well, so no need for an additional memcpy.
333
334         * sgen-gc.c: Lock when storing remsets.  Do the memory
335         copying/moving in the write barriers.
336
337         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
338
339         * reflection.c: Added an assert.
340
341 2009-10-12  Mark Probst  <mark.probst@gmail.com>
342
343         * threads.c, process.c: A few missing write barriers.
344
345 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
346
347         * mono-perfcounters.c, mono-perfcounters-def.h: Add
348         network performance counters for bytes sent per second, bytes
349         received per second, and bytes total per second.
350
351         Code is contributed under MIT/X11 license.
352
353 2009-10-09  Mark Probst  <mark.probst@gmail.com>
354
355         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
356         Fix warning.
357
358 2009-10-09  Mark Probst  <mark.probst@gmail.com>
359
360         * threads.c, object-internals.h, object.c: Move code for
361         transferring an object to a different domain (via
362         serialization/remoting) to object.c.
363
364         * object.c (call_unhandled_exception_delegate): If the exception
365         is in a different domain than the delegate, transfer the exception
366         to that domain.
367
368 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
369
370         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
371         Fixes #322934.
372
373 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
374
375         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
376
377 2009-10-06  Mark Probst  <mark.probst@gmail.com>
378
379         * object.c (mono_method_return_message_restore): Handle the case
380         where the argument is an instance of a generic type.  Fixes
381         #544446.
382
383 2009-10-06  Mark Probst  <mark.probst@gmail.com>
384
385         * object.c (set_value): Write barrier fix - we must pass the
386         count, not the size.
387
388 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
389
390         * domain.c (mono_init_internal): Print a useful error message when encountering
391         an old mscorlib, instead of crashing. Fixes #544307.
392
393 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
394
395         * appdomain.c (copy_app_domain_setup): Fix a warning.
396
397         * debug-helpers.c (dis_one): Ditto.
398
399 2009-10-04  Mark Probst  <mark.probst@gmail.com>
400
401         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
402         into the new domain, instead of referencing the original one.
403
404         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
405         non-static.
406
407         * appdomain.c: Corlib version bump.
408
409 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
410
411         * threadpool.c: one more...
412
413 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
414
415         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
416         threads to die because we're shutting down. delgate5.exe works again.
417
418 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
419
420         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
421           ccw_interface_hash table when a ccw is finalized.
422
423         Code is contributed under MIT/X11 license.
424
425 2009-09-30  Mark Probst  <mark.probst@gmail.com>
426
427         * assembly.c, domain.c, image.c, metadata-internals.h: Split
428         domain and image unloading into two steps.  We must do this
429         because clearing the domain in SGen requires the class metadata to
430         be intact, but we need to free the mono_g_hash_tables in case a
431         collection occurs during domain unloading and the roots would trip
432         up the GC.
433
434 2009-09-30  Mark Probst  <mark.probst@gmail.com>
435
436         * object-internals.h: Remove serialized culture fields from
437         MonoInternalThread.
438
439         * icall-def.h, thread-types.h, threads.c: Remove serialized
440         culture icalls.
441
442         * appdomain.c: Corlib version bump.
443
444 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
445
446         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
447         Fixes #543133.
448
449 2009-09-30  Mark Probst  <mark.probst@gmail.com>
450
451         * sgen-gc.c: Try to shorten the new section after a major
452         allocation to avoid ever-growing sections.
453
454 2009-10-13  Martin Baulig  <martin@ximian.com>
455
456         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
457         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
458         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
459         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
460
461         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
462
463 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
464
465         * threadpool.c: fixed the order in which 'completed' and the wait
466         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
467         No need to use the wait_handle field of ASyncCall. Make sure the
468         threadpool is active when adding a job or queueing an idle thread.
469
470 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
471
472         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
473
474         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
475         when using --compile-all.
476
477 2009-09-27  Mark Probst  <mark.probst@gmail.com>
478
479         * metadata.c (free_generic_class): Unregister the field_objects
480         roots if we're using SGen.
481
482 2009-09-27  Mark Probst  <mark.probst@gmail.com>
483
484         * reflection.c (mono_dynamic_image_free): Deregister the GC root
485         for GenericParamTableEntry.gparam.
486
487 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
488
489         * marshal.c: don't create the handle when calling. It is created later
490         if needed.
491
492 2009-09-26  Mark Probst  <mark.probst@gmail.com>
493
494         * sgen-gc.c: Warning fixes.
495
496 2009-09-26  Mark Probst  <mark.probst@gmail.com>
497
498         * sgen-gc.c: New debug option "xdomain-checks", which scans the
499         whole heap for cross-domain references before each collection.
500
501         * sgen-scan-object.h: The scan action can now use SCAN to scan the
502         object.
503
504         * threadpool-internals.h, threadpool.c: New function
505         mono_thread_pool_is_queue_array() for checking whether a given
506         array is used as a (cross-domain) queue by the thread pool code.
507
508 2009-09-26  Mark Probst  <mark.probst@gmail.com>
509
510         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
511         searches the whole heap for objects containing a specific
512         reference.  Only for debugging.
513
514 2009-09-26  Mark Probst  <mark.probst@gmail.com>
515
516         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
517
518         * icall-def.h, threads.c, threads-types.h: New icalls for copying
519         byte arrays between domains.
520
521 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
522
523         * threadpool.c:
524         * class-internals.h:
525         * mono-perfcounters-def.h:
526         * mono-perfcounters.c:
527         -There is a list of idle threads
528         -Each of those idle threads wait on their own WaitHandle instead
529         of all of them using the same semaphore. When a new work item is
530         added, the job is assigned directly to an idle thread or a newly
531         created one if possible and then the handle for that thread is
532         signaled. Compare that to the current approach where all the
533         threads in the pool compete to dequeue a job from the same
534         queue.
535         -New struct ThreadPool that brings together the bunch of static
536         variable for each threadpool (IO and regular).
537         -New performance counters: # of items added and its rate per
538         threadpool. The rate will be used later, perhaps together with
539         other perf. counters, to decide when idle threads should exit.
540
541 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
542
543         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
544         Fix typo on Windows build.      
545         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
546         
547         Code is contributed under MIT/X11 license.
548
549 2009-09-25  Mark Probst  <mark.probst@gmail.com>
550
551         * object-internals.h: The Thread class is split up into Thread and
552         InternalThread now.  We have exactly one InternalThread per
553         thread, and at most one Thread per appdomain per thread.  Most
554         data is stored in InternalThread.  All InternalThread objects live
555         in the root domain.
556
557         * class-internals.h: Add internal_thread_class to MonoDefaults.
558
559         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
560         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
561         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
562         resulting from the split of the Thread class.
563
564         * gc-internal.h: Prototype for new function for checking whether a
565         thread is the finalizer thread.
566
567         * appdomain.c: Corlib version bump.
568
569 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
570
571         * appdomain.c|h: Add a mono_domain_try_unload method which is
572         equivalent to mono_domain_unload, except that it returns an exception
573         instead of throwing it. Make mono_domain_unload use the
574         mono_domain_try_unload method to avoid code-duplication.
575
576 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
577
578         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
579         a problem.
580
581 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
582
583         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
584         aborting when a conversion is not implemented.
585
586 2009-09-23  Miguel de Icaza  <miguel@novell.com>
587
588         * verify.c: when comparing culture strings, use g_ascii_strcmp
589
590         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
591         when comparing public key tokens to use memcmp on 16 bytes.   I do
592         not believe this ever worked as advertised in the past.
593
594         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
595         which would have always failed earlier.
596
597 2009-06-25  Miguel de Icaza  <miguel@novell.com>
598
599         * gc.c: Raise a NullArgumentException if the object passed is
600         null.
601
602 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
603
604         * image.c (mono_image_close): Atomically decrement the reference count and
605         remove the image from the hash tables, to prevent another thread from seeing a
606         dying MonoImage. Fixes #541194.
607
608 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
609
610         * threadpool.c: actually use the minimum number of 'completion ports'
611         (for us is just a potential worker thread).
612
613 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
614
615         * threadpool.c: remove ares_htable. It does not make sense any more
616         since the same objects are now stored in GC-tracked arrays while they are
617         in the queue.
618
619 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
620
621         * threadpool.c: increase the minimum length of the queues to 128.
622         Remove warning.
623
624 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
625
626         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
627         return the modified signature used by string ctors.
628
629 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
630
631         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
632         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
633         method, to be used by full-aot.
634
635 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
636
637         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
638         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
639         be known to be good.
640
641         * class.c (mono_class_init): Fail array types if their element type fails initialization
642         as well.
643
644         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
645         initialization, additionally we request the element_type vtable to be initialized as well.
646
647         This is fine and should not increase the working set in any meaningful way since it's reasonable
648         to assume       that most code will create an array and eventually populate it, which will require the
649         type's vtable to be initialized.
650
651         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
652
653 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
654
655         * normalization-tables.h : regenerated.
656
657 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
658
659         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
660         a leb128 encoding can take up to 5 bytes.
661
662 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
663
664         * class.c (verify_class_overrides): Remove useless argument.
665
666         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
667         before interface enumeration as this is no longer required.
668
669 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
670
671         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
672         used under mono_class_init context. This functions avoid any code path that
673         calls mono_class_init, which leads it to be slow as some things like the interface
674         bitmap are not available.
675
676         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
677         of it's own broken version. Fixes the verifier part of #538588.
678
679         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
680         API.
681
682 2009-09-15  Mark Probst  <mark.probst@gmail.com>
683
684         * class.c (mono_class_init): Always set an exception in a class if
685         vtable setup fails.  Fixes #538577.
686
687         * generic-sharing.c: Raise an exception if mono_class_vtable()
688         returns NULL.
689
690 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
691
692         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
693         methods of vtypes, as they could be incorrectly shared with static methods
694         taking an IntPtr argument.
695
696 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
697
698         * domain.c:
699         * object.c:
700         * class-internals.h: renamed waithandle_class to
701         manualresetevent_class.
702         * marshal.c: propagate the exception if a remoting BeginInvoke call
703         fails.
704
705 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
706
707         * object.c: Properly handle vtable failures.
708
709 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
710
711         * socket-io.c: Assert on vtable failure.
712
713         * mono-mlist.c: Assert on vtable failure.
714
715 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
716
717         * marshal.c: Assert on vtable failure.
718
719 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
720
721         * icall.c: Properly handle vtable failures.
722
723 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
724
725         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
726
727 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
728
729         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
730
731         * console-unix.c (do_console_cancel_event): Same.
732
733 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
734
735         * class-internals.h: Add mono_class_vtable_full function that allows control
736         if an exception should be raised or not.
737
738         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
739         to do what its documentation say, that is to return NULL and set exception_type on
740         failure.
741
742         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
743         and change the code to honor it.
744
745 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
746
747         * verify.c: Fix typo in error message.
748
749 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
750
751         * security-core-clr.c: Fix default_platform_check so it can run
752         the runtime coreclr tests (without an infinite recursion when
753         throwing an exception).
754
755 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
756
757         object.c (mono_delegate_ctor_with_method): Guard against null method.
758
759 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
760
761         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
762         that should be replaced with error handling later.
763
764 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
765
766         * marshal.c (mono_delegate_end_invoke): Fix warning.
767
768 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
769
770         * loader.c (mono_field_from_token): Properly handle invalid
771         dynamic tokens.
772
773 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
774
775         * pedump.c (verify_image_file): Skip types that can't be
776         decoded.
777
778 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
779
780         * verify.c: Look for recursive valuetypes only against the
781         type been initialized as this is a lot simpler and works.
782
783 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
784
785         * verify.c: Ensure that fields are properly loaded before
786         checking them.
787
788 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
789
790         * object.c (mono_object_get_virtual_method) : Call 
791           mono_cominterop_get_invoke if the object is a COM object.
792
793         Code is contributed under MIT/X11 license.
794
795 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
796
797         * verify.c: Check for recursive valuetype definitions.
798
799 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
800
801         Use inheritance-aware interface offsets. Inherited types use the same offsets
802         of their parents. This reduce offset duplication in case more than one type in
803         the inheritance tree explicitly implements the same interface.
804
805         This also removes a source of vtable bubbles found in #532409. An abstract type
806         isn't required to provide abstract methods to all interfaces it implements, which
807         resulted in a bubble with the previous scheme as the child would get a non-full
808         vtable from its parent. We fail all concrete types with vtable bubbles, so this
809         should be fixed.
810
811         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
812         it's expected to not cause any significant increase beyond that.
813
814         * class.c (setup_interface_offsets): Compute super class iface offsets
815         first to force sharing.
816
817         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
818         dumping only the relevant ones.
819
820         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
821         methods a new slot regardless if they belong to an interface or not. This allows
822         an inherited type to override the iface method separately from the class one.
823
824 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
825
826         * threadpool.c: make the Sleep() alertable to prevent delays exiting
827         applications that take less than 2s to execute.
828         Bug #524984 fixed.
829
830 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
831
832         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
833
834         * object.c (mono_get_runtime_callbacks): New helper function to return
835         the runtime callbacks.
836
837         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
838         mono_get_runtime_build_info () as the display name.
839         
840 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
841
842         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
843         argument, since NEWARR expects a native int. Fixes #481559.
844
845 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
846
847         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
848         against broken SRE methods.
849
850 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
851
852         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
853         a NULL variable. Abort early on failure.
854
855 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
856
857         * class.c (can_access_type): Fail visibility test for non nested
858         types with nested visibility.
859
860 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
861
862         * assembly.c (parse_public_key): Avoid allocating (and not 
863         freeing) the public key array when it's not requested by the 
864         caller.
865         * threads.c (mono_thread_manage, mono_thread_create_internal, 
866         ves_icall_System_Threading_Thread_Thread_internal): Free 
867         allocated memory on error.
868
869 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
870
871         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
872
873 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
874
875         * class.c (mono_class_setup_fields): Remove duplicated local variable
876         named gklass.
877         Rename gklass to gtd to reflect the fact that it points to the generic
878         type definition.
879         Remove the duplicated call to mono_class_setup_fields on gtd and move
880         the error check to the beginning.
881
882 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
883
884         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
885         Remove cruft of the previous patch.
886
887 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
888
889         * metadata-verify.c (verify_method_table): Check for abstract + final.
890         Fixes #534175.
891
892 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
893
894         * verify.c (verify_class_fields): Check for duplicate fields.
895
896 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
897
898         * metadata-verify.c: Verify the typeref table for duplicates.
899
900 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
901
902         This reverts r140936 and properly handles interfaces with static methods. The
903         right fix is to ensure vtables without bubles which is an easier to verify
904         constraint. We should avoid such special cases as of the reverted patch as those
905         only make the runtime more brittle.
906
907         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
908         static methods on interfaces.
909
910         * class.c (setup_interface_offsets): Use the number of virtual methods when
911         calculating interface offsets instead of the number of methods. This way we
912         avoid bubles on the layout.
913
914 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
915
916         * metadata-verify.c (verify_metadata_header): Some very smart
917         obfuscators like to add extra stream headers. Ignore them.
918
919 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
920
921         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
922         methods correctly.
923
924 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
925
926         * metadata-verify.c: Verify for duplicated types.
927
928 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
929
930         * metadata-verify.c (verify_typedef_table): Verify for nested types
931         without an entry on the nested class table.
932
933 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
934
935         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
936         <tom_hindle@sil.org>. Add locking around hash table accesses.
937
938 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
939
940         * verify.c (mono_verifier_verify_class): Verify all interface if
941         really are interfaces. Fixes #534184.
942
943 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
944
945         * pedump.c: Initialize all types during metadata validation so we report
946         errors only detected as part of class initialization.
947
948 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
949
950         * metadata-verify.c (verify_method_table): PInvoke requires method to
951         be static. Fixes #534189
952
953 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
954
955         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
956         being NULL.
957
958 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
959
960         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
961         for holes or bad methods. Fixes #525314.
962
963 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
964
965         * class.c (setup_interface_offsets): Don't allocate slot
966         for the same interface multiple times. This creates bubbles
967         that waster space and make vtable verification harder.
968
969         The same interface get a slot multiple times since we need
970         to get the closure of all implemented interfaces, which means
971         the same interface is reported multiple times.
972
973 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
974
975         * verify.c (mono_verifier_verify_class): Don't check the fields
976         of generic instances since the context on which they got expanded
977         might lead to false positives.
978
979         Such thing happens when a generic type is inflated in the context
980         of a generic method and the inflated type of a field turns into a
981         generic method argument, which causes the checking code to think
982         it's an invalid class when it's not.
983
984 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
985
986         * verify.c (mono_type_is_valid_in_context): Verify if type
987         is NULL and remove duplicate test.
988
989 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
990
991         * verify.c (mono_verifier_verify_class): Check fields for
992         invalid generic arguments.
993
994 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
995
996         * class.c (verify_class_overrides): Verify if for static
997         and non virtual methods.
998
999 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1000
1001         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
1002         Check for errors after retrieving the vtable.
1003
1004 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1005
1006         * class.c (mono_class_setup_vtable_general): Verify
1007         if method overrides are valid before processing them.
1008
1009 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
1010
1011         * marshal.c (mono_array_to_lparray): Fix minimal build with
1012         cominterop disabled.
1013
1014         * marshal.c (mono_free_lparray): Same.
1015
1016 2009-08-21  Mark Probst  <mark.probst@gmail.com>
1017
1018         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
1019         the hash function for the ares_htable.
1020
1021 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
1022
1023         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
1024         bit for assembly flags. MS is ok with it but there is no spec anywhere
1025         on its mean
1026
1027 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1028
1029         * class.c (mono_class_create_from_typedef): Emit profiler events
1030         in all cases.
1031
1032 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1033
1034         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
1035         Release memory on failure.
1036
1037 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1038
1039         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
1040         to the internal API.
1041
1042         * metadata.c (get_constraints): Use a single-linked table as we don't
1043         traverse it backward. Fail and return FALSE if only of the contraint types
1044         is not found.
1045
1046         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
1047         to mono_metadata_load_generic_param_constraints except for having a return value.
1048         This has to be done since the later is part of the public API.
1049
1050         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
1051         and fail the type.
1052
1053         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
1054         and fail the method.
1055
1056 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1057
1058         * metadata-verify.c (is_valid_method_header): Add work-around to deal
1059         with MS broken behavior of emmitting EH section sizes without the
1060         header size added.
1061
1062 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1063
1064         * metadata.c (mono_type_create_from_typespec): Don't allocate image
1065         memory until we're sure that we'll need it. This avoids leaking for
1066         broken types or duplicated instantiation.
1067
1068 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1069
1070         * metadata-verify.c (is_valid_method_header): Fix stupid formating
1071         mistake.
1072
1073 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
1074
1075         * metadata-verify.c (is_valid_method_header): Fix number of clauses
1076         and expected size calculation.
1077
1078 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1079
1080         * class.c (mono_class_get_field_idx): Add fixme for broken
1081         behavior for types with multiple fields with the same name.
1082         I would rather fix it, but have no idea on how to generate
1083         such artifact for testing.
1084
1085 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1086
1087         * verify.c (verifier_load_field): We should allow references to
1088         fields to be made using the generic type definition. It's up to
1089         the loader system to fail invalid ops.
1090
1091         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
1092         are invalid.
1093
1094 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1095
1096         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
1097
1098         * metadata-internals.h: Fix declaration of 
1099         mono_metadata_interfaces_from_typedef_full.
1100
1101         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
1102         heap_alloc_result parameter that controls if the result should be
1103         g_malloc'd.
1104
1105         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
1106         array be g_malloc'd and properly document this public API function.
1107
1108 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1109
1110         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
1111         remove METHOD_HEADER_TINY_FORMAT1.
1112
1113         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
1114
1115         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
1116
1117         Both spec and MS uses only 2 bits to enumerate the kind of header.
1118         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
1119         is superfluous, only used for tiny headers with odd code lengths.
1120
1121         This change also make sure that mono doesn't wronly interpret bit 2
1122         of fat header flags, which is currently reserved.
1123
1124 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1125
1126         * metadata.c (do_mono_metadata_parse_type): Do error
1127         checking for element types. Don't abort if presented
1128         with a broken type kind.
1129
1130 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
1131
1132         * metadata.c (mono_metadata_parse_method_signature_full):
1133         Gracefully fail bad vararg signatures.
1134
1135 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1136
1137         * profiler.c:
1138         * class.c: Fix warnings for uninitialized variables.
1139
1140 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1141
1142         * icall.c: Fix _NSGetEnviron method declaration warning.
1143
1144 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1145
1146         * icall.c:
1147         * reflection.c: Make bitwise checks explicit.
1148
1149 2009-08-18  Christian Hergert  <chris@dronelabs.com>
1150
1151         * debug-helpers.c:
1152         * marshal.c: Fix printf warnings.
1153
1154 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
1155
1156         * reflection.c (encode_cattr_value): Fix a warning.
1157
1158 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1159
1160         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
1161         of array bounds.
1162
1163 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1164
1165         * loader.c (mono_method_signature): Don't assert on broken
1166         signature. Print a more useful error message.
1167
1168 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1169
1170         * loader.c (mono_method_get_marshal_info): Assert if
1171         signature is invalid. Bounds check stores to the
1172         mspecs array;
1173
1174 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1175
1176         * loader.c (field_from_memberref): Fix warning.
1177
1178 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1179
1180         * loader.c (mono_method_get_param_names): Check if signature
1181         is null. Don't store beyond the size of the name array.
1182
1183 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1184
1185         * loader.c (mono_get_method_constrained): Check if signature
1186         is null.
1187
1188 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1189
1190         * loader.c (mono_loader_set_error_bad_image): Improve
1191         error messages.
1192
1193 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1194
1195         * loader.c (mono_get_method_full): Convert an assertion
1196         into a loader error.
1197
1198 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
1199
1200         * class-internals.h, class.c: Better naming and documentation.
1201
1202 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
1203
1204         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
1205         obj is NULL.
1206
1207 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1208
1209         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
1210         parsing fails.
1211
1212 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1213
1214         * loader.c (mono_loader_error_prepare_exception): Handle missing field
1215         errors with no class set.
1216
1217         * loader.c (field_from_memberref): If the field signature is of the wrong
1218         type fail with a MissingFieldException instead of a BadImageException as
1219         this is the behavior observed on MS. 
1220
1221 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1222
1223         * loader.c (field_from_memberref): Don't crash if either the field
1224         signature or the typespec class are invalid.
1225
1226 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1227
1228         * verify.c (verifier_load_field): Don't allow field related
1229         ops to reference fields on generic type definition.
1230
1231 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1232
1233         * metadata-verify.c: Add new warning level for errors specified
1234         by ECMA 335 but that MS ignores.
1235
1236         * metadata-verify.c (verify_method_table): Make compiler controled
1237         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
1238         this check is safe because the end result will only be some visibility
1239         exceptions been thrown.
1240
1241 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
1242
1243         * verify.c (get_boxable_mono_type): Don't allow the
1244         use of the generic type definition on boxed type positions.
1245
1246         Fixes #531237.
1247
1248 2009-08-14  Mark Probst  <mark.probst@gmail.com>
1249
1250         * threadpool.c: Make sure no cross-domain references remain in
1251         ares_htable or the arrays that are thrown away when resizing.
1252
1253 2009-08-14  Mark Probst  <mark.probst@gmail.com>
1254
1255         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
1256         list of classes for which we have to unregister reflection_info
1257         with the GC and which are not in the namespace cache.
1258
1259         * reflection.c (mono_reflection_initialize_generic_parameter): Add
1260         the class to the list.
1261
1262 2009-08-14  Mark Probst  <mark.probst@gmail.com>
1263
1264         * domain.c (mono_domain_free): Unregister the GC roots in
1265         MonoDomain.
1266
1267 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
1268
1269         * reflection.c (mono_reflection_type_get_handle): Fix typo.
1270
1271 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
1272
1273         * class.c: Add mono_class_get_field_from_name_full which does
1274         the same as mono_class_get_field_from_name but does check field
1275         signature as well.
1276
1277         * class-internals.h: Export mono_class_get_field_from_name_full as
1278         part of the internal API.
1279
1280         * loader.c (field_from_memberref): Search fields by name and signature
1281         as it's valid to have two fields with same name but different types.
1282
1283         Fixes #528055.
1284
1285 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
1286
1287         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
1288
1289         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
1290
1291         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
1292         System.Type.
1293
1294 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
1295
1296         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
1297
1298         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
1299
1300 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1301
1302         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
1303         to sgen-scan-object.h, which can be included and parameterized via
1304         macros.
1305
1306         * Makefile.am: sgen-scan-object.h added.
1307
1308 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1309
1310         * gc.c: #define GC_dont_gc if we're compiling with SGen.
1311
1312 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1313
1314         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
1315         before clearing a domain in the GC.
1316
1317 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1318
1319         * exception.c (mono_exception_from_name_domain): Actually create
1320         the exception in the specified domain.
1321
1322         * appdomain.c (mono_domain_create_appdomain_internal): Create the
1323         OutOfMemoryException a bit later so that the domain is inialized
1324         "enough" that it works.
1325
1326 2009-08-12  Mark Probst  <mark.probst@gmail.com>
1327
1328         * threads.c (thread_cleanup): Clean up the cached_culture_info
1329         array to prevent cross-domain references.
1330
1331 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
1332
1333         * metadata.c: more documentation for MonoType accessors.
1334
1335 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
1336
1337         Fix incorrect size definitions where the tail array isn't a list
1338         of pointers
1339         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
1340         define size.
1341         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
1342         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
1343         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
1344
1345 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1346
1347         * reflection.h:
1348         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
1349
1350 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1351
1352         * metadata.c:
1353         * loader.c:
1354         * metadata-internals.h:
1355         * method-builder.c:
1356         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
1357
1358 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1359
1360         * cominterop.c:
1361         * metadata.c:
1362         * metadata.h:
1363         * loader.c:
1364         * marshal.c:
1365         * reflection.c: #define for sizeof in MonoType and
1366         MonoMethodSignature.
1367
1368 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1369
1370         * domain.c:
1371         * domain-internals.h: add and use #define's instead of sizeof()
1372         for MonoJitInfo and MonoJitInfoTable.
1373
1374 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
1375
1376         * object.c:
1377         * class.h: use #define instead of sizeof() for MonoRemoteClass.
1378
1379 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
1380
1381         * metadata.c:
1382         * metadata.h:
1383         * object.c:
1384         * class-internals.h:
1385         * generic-sharing.c:
1386         * marshal.c: use a #define instead of sizeof() for a few
1387         structures that use a zero-length array.
1388
1389 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
1390
1391         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
1392         to handle inflated generic methods.
1393
1394         * appdomain.c: Bump corlib version.
1395
1396         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
1397         instances.
1398
1399         * reflection.c (fixup_method): Same
1400
1401         * reflection.c (resolve_object): Same.
1402
1403         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
1404         g_error and a decent message.
1405
1406 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
1407
1408         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
1409         from the object because it could not yet be available globally
1410         (it happens if the profiler tries to create a gchandle on the
1411         MonoThread object of a thread that is still registering itself
1412         with the runtime).
1413
1414 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
1415
1416         * reflection.c (mono_generic_class_get_object): Initialized the
1417         managed type arguments array.
1418
1419         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
1420
1421         * appdomain.c: Bump corlib version.
1422
1423 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
1424
1425         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
1426         #527902.
1427
1428 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
1429
1430         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
1431         Avoid a crash if synch_cs is not set.
1432         
1433         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
1434         Handle the case when the handle is 0.
1435
1436         * appdomain.c: Bump corlib version.
1437
1438 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
1439
1440         * reflection.c (mono_type_get_object): Fix a warning.
1441
1442 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1443
1444         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
1445         descriptor here.  We assume it's already been computed.
1446
1447         * generic-sharing.c (instantiate_other_info): Compute the GC
1448         descriptor for info type MONO_RGCTX_INFO_KLASS.
1449
1450 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1451
1452         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
1453         type, so don't use MONO_OBJECT_SETREF to set a field.
1454
1455 2009-08-01  Mark Probst  <mark.probst@gmail.com>
1456
1457         * gc.c: We were missing one case where invoking a finalizer would
1458         not reset the domain.  Also, in the finalizer thread loop, assert
1459         that we're in the root domain.
1460
1461 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1462
1463         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
1464         if the type is not an array.
1465
1466 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1467
1468         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
1469         method bound to the declaring type of the method. Raise an exception
1470         if the type is not a generic param.
1471
1472 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
1473
1474         * class.c (print_unimplemented_interface_method_info): Print the
1475         full type name.
1476
1477         * class.c (mono_class_setup_vtable_general): When dealing with a
1478         generic instance first check if the generic type definition is
1479         not broken.
1480
1481 2009-02-11 Tom Hindke <tom_hindle@sil.org>
1482
1483         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
1484
1485         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
1486
1487         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
1488
1489         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
1490
1491         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
1492
1493         Code is contributed under MIT/X11 license
1494
1495 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
1496
1497         * verify.c: Fix naming of stelem and ldelem.
1498
1499 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1500
1501         * generic-sharing.c: Replace the templates lock with the loader
1502         lock because of very hard to resolve deadlock issues.
1503
1504 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
1505
1506         * icall.c (ves_icall_Type_GetMethodsByName): Use 
1507         mono_class_get_vtable_size () instead of accessing klass->vtable_size
1508         directly. Fixes #525338.
1509
1510         * class.c (mono_class_get_vtable_size): New helper function.
1511
1512         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
1513         the field belongs to the type. Fixes #525733.
1514
1515 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1516
1517         * sgen-gc.c: When we stop a thread and its stack top is not within
1518         its allocated stack (because it's in an altstack signal handler),
1519         restart it and stop it again, until it is.
1520
1521 2009-07-30  Mark Probst  <mark.probst@gmail.com>
1522
1523         * sgen-gc.c: Take a thread's stack top and registers from the
1524         sigcontext in the suspend signal handler.
1525
1526         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
1527         stuff to sgen-archdep.h.
1528
1529         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
1530         caller, because have code in sgen-archdep.h to acquire that data.
1531
1532 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
1533
1534         * profiler.c, profiler.h, profiler-private.h:
1535         Added support for keeping track of code chunks and buffers.
1536
1537 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
1538
1539         * metadata-verify.c: Fix endianness problems on decoding functions.
1540         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
1541
1542 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1543
1544         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
1545         schema for vectors and one dimension SZARRAY.
1546
1547 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
1548
1549         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
1550         schema for vectors and one dimension SZARRAY.
1551
1552 2009-07-27  Mark Probst  <mark.probst@gmail.com>
1553
1554         * icall-def.h, thread-types.h, threads.c: New separate icalls for
1555         Interlocked.(Compare)Exchange with object arguments, which invoke
1556         write barriers.
1557
1558 2009-07-26  Miguel de Icaza  <miguel@novell.com>
1559
1560         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
1561         passed invalid arguments.   Fixes another crasher in the
1562         Silverlight test suite.
1563
1564         * class.c (mono_class_array_element_size): Return 0 for the size
1565         of the class;  This fixes the crasher exposed by :
1566
1567         typeof (void).MakeArrayType ();
1568
1569         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
1570         if there is no method to dereference.    Put all the code that
1571         depends on this inside the if (method) block.
1572
1573         This fixes the crasher exposed by Microsoft's Silvelright CLR test
1574         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
1575
1576         With this change, we pass the test.
1577         
1578         * reflection.c (mono_reflection_sighelper_get_signature_local):
1579         Only dereference the assembly if it has been set.    Fixes a
1580         crasher exposed by #525328
1581
1582 2009-07-25  Mark Probst  <mark.probst@gmail.com>
1583
1584         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
1585         don't perform the store in mono_gc_wbarrier_generic_nostore().
1586         Remove the second argument (value), which is not needed.
1587
1588 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
1589
1590         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
1591         the build.
1592
1593         * boehm-gc.c: Ditto.
1594         
1595 2009-07-24  Mark Probst  <mark.probst@gmail.com>
1596
1597         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
1598         not perform the store itself.  Introduce
1599         mono_gc_wbarrier_generic_nostore(), which is the same as
1600         mono_gc_wbarrier_generic_store(), except it doesn't perform the
1601         store.
1602
1603 2009-07-24  Mark Probst  <mark.probst@gmail.com>
1604
1605         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
1606         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
1607         we still need the memcpy().
1608
1609 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1610
1611         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
1612         so that big arrays are handled correctly.  Always use
1613         safe_object_get_size() to calculate array object sizes, which
1614         takes bounds into account.
1615
1616 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1617
1618         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
1619         GC descriptor is computed before we use it.
1620
1621 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1622
1623         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
1624         write barrier if necessary.
1625
1626 2009-07-22  Mark Probst  <mark.probst@gmail.com>
1627
1628         * icall-def.h, icall.c, thread-types.h: New separate icall for
1629         VolatileWrite(object&,object) that uses a write barrier.
1630
1631         * console-unix.c, file-io.c, icall.c, threads.c: Use write
1632         barriers in icalls which write to "ref" or "out" arguments.
1633
1634 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
1635
1636         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
1637         handler in a separate icall, to reduce the size of the wrappers.
1638
1639 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1640
1641         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
1642
1643 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1644
1645         * metadata-verify.c (parse_field): Allow byref field.
1646
1647         * metadata-verify.c (parse_locals_signature): Allow byref locals.
1648
1649         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
1650
1651 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
1652
1653         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
1654         Fixes #522784.
1655
1656 2009-07-20  Robert Jordan  <robertj@gmx.net>
1657
1658         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
1659         Fix invalid IL in valuetype handling (STOBJ must push the
1660         corresponding class). Fixes bug #523149.
1661
1662         Code is contributed under MIT/X11 license.
1663
1664 2009-07-20  Geoff Norton  <gnorton@novell.com>
1665
1666         * gc.c: Use proper semaphores where available on posix and darwin.
1667
1668 2009-07-19  Geoff Norton  <gnorton@novell.com>
1669
1670         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
1671
1672 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
1673
1674         * refletion.c (is_sre_usertype): Change name to is_usertype and
1675         invert it's result so it returns true if the type is an user type
1676         and not the opposite.
1677
1678         * reflection.c (is_*_type): Change all of those to use new macro
1679         check_corlib_type_cached that cached the type lookup so we don't
1680         need to do string comparisons all the type. Changed the signature
1681         to take a MonoClass instead.
1682
1683         * reflection.c: Change mono_image_create_token and resolve_object
1684         to use is_sre_* functions.
1685
1686 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1687
1688         * sgen-gc.c: Check for writes to the stack in the managed
1689         wbarrier as well.
1690
1691 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1692
1693         * sgen-gc.c: When a thread is unregistered, don't free its remsets
1694         but put them on a list which is processed with the other thread's
1695         remsets.
1696
1697 2009-07-18  Mark Probst  <mark.probst@gmail.com>
1698
1699         * sgen-gc.c: Fix and enable the internal allocator instead of
1700         using malloc/free (which causes deadlocks).
1701
1702 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
1703
1704         * refletion.c: Fix builds with SRE disabled by adding a minimal
1705         implementation of mono_reflection_type_get_handle.
1706
1707 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1708
1709         * refletion.c: Make mono_reflection_type_get_handle non static.
1710
1711         * object-internals.h: Export mono_reflection_type_get_handle.
1712
1713         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
1714         unmanaged handle using mono_reflection_type_get_handle.
1715
1716 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
1717
1718         * refletion.c: Replace all reads of MonoReflectionType::type with
1719         calls to mono_reflection_type_get_handle. Only the functions that
1720         deal with constructing TypeBuilder::type have not been changed
1721         because they have to deal with NULL values.
1722
1723         This is a first step into supporting reflection types that don't
1724         map directly into their unmanaged counterpart.
1725
1726 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
1727
1728         * metadata-verify.c (parse_locals_signature): Don't complain
1729         on signature with zero locals since MS generates it and doesn't
1730         bother with.
1731
1732 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
1733
1734         * reflection.c (mono_image_get_array_token): Resolve return
1735         type using mono_reflection_type_get_handle.
1736
1737         * reflection.c (mono_image_get_array_token): Resolve array method
1738         parent type using mono_reflection_type_get_handle.
1739
1740 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
1741
1742         * reflection.c (mono_image_basic_init): Applied patch from
1743         <Dax@daxxfiles.net>. Set the public key token from the assembly
1744         builder. Fixes #518909.
1745
1746         * appdomain.c: Bump corlib version.
1747
1748 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
1749
1750         * class.c (mono_class_needs_cctor_run): Make this return false if
1751         the class has no cctor.
1752
1753 2009-07-13  Mark Probst  <mark.probst@gmail.com>
1754
1755         * sgen-gc.c: When the minor GC needs to allocate a new section,
1756         invoke the major GC afterwards.
1757
1758 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
1759
1760         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
1761           Applying the window_style field to the SHELLEXECUTEINFO struct.
1762
1763         Code is contributed under MIT/X11 license.
1764
1765 2009-07-13  Mark Probst  <mark.probst@gmail.com>
1766
1767         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
1768         locking earlier.  Fix it in the managed allocator by making sure
1769         that no thread is stopped there before the GC runs.  If we do stop
1770         a thread there, we restart it and let it run a but, until it stops
1771         somewhere else.
1772
1773         * gc-internal.h, gc.c: Function for getting the IP from a signal
1774         context via a function registered by mini.
1775
1776 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
1777
1778         * object-internals.h (MonoIntPtr): New structure describing a boxed
1779         IntPtr.
1780
1781         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
1782         returns. Fixes #519953.
1783
1784         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
1785
1786 2009-07-09  Mark Probst  <mark.probst@gmail.com>
1787
1788         * class-internals.h, generic-sharing.c: New RGCTX info type for
1789         getting a remoting invoke with check wrapper.
1790
1791 2009-07-07  Geoff Norton  <gnorton@novell.com>
1792
1793         * icall-def.h: Fix the enable-minimal build.
1794
1795 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1796
1797         * object-internals.h: Add MonoReflectionDerivedType.
1798
1799         * reflection.c: Implement support for PointerType.
1800         Fixed tons of warnings.
1801
1802 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1803
1804         * object-internals.h: Add MonoReflectionByRefType.
1805
1806         * reflection.c: Implement support for ByRefType.
1807
1808 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1809
1810         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
1811
1812         * object-internals.h: Add MonoReflectionArrayType and
1813         mono_reflection_create_unmanaged_type.
1814
1815         * reflection.c: Implement support for ArrayType.
1816
1817 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
1818
1819         * metadata-verify.c (is_valid_method_header): Parse EH block
1820         flags correctly.
1821
1822 2009-07-03  Mark Probst  <mark.probst@gmail.com>
1823
1824         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
1825         processing the disappearing links, and process disappearing links
1826         in a loop until no new objects are copied.
1827
1828 2009-07-03  Mark Probst  <mark.probst@gmail.com>
1829
1830         * object.c (handle_enum): Invoke the write barrier when copying
1831         value type instances.
1832
1833         * sgen-gc.c: Register remsets for unmanaged write barriers only
1834         when the address written to is actually on the heap.  This makes
1835         set_value() in object.c work without requiring that the result be
1836         on the heap.
1837
1838 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
1839
1840         The runtime wrappers are all bound to a given type that must
1841         exist in the same image. For regular images we use the <Module>
1842         type, which is required to exist for all images.
1843
1844         The <Module> type can't be used for dynamic images because it
1845         might not exist at the time the wrapper is required, so we create
1846         a synthetic type to use instead.
1847
1848         The current code works because of the 2 stage setup of MonoClass,
1849         but once this is gone it will no longer work.
1850
1851         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
1852
1853         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
1854
1855         * object-internals.h: Export mono_image_set_wrappers_type icall
1856         as part of the internal API.
1857
1858         * marshal.c (get_wrapper_target_class): If the image is dynamic,
1859         use MonoDynamicImage::wrappers_type instead of the <Module> type.
1860
1861         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
1862         image wrappers_type to the provided value.
1863
1864 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
1865
1866         * appdomain.c (deregister_reflection_info_roots): No need
1867         to use the image lock here.
1868
1869 2009-07-02  Mark Probst  <mark.probst@gmail.com>
1870
1871         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
1872
1873 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
1874
1875         * threads.c: Store the thread start argument in a hash table instead of
1876         registering it as a root, as libgc doesn't support unregistering roots
1877         under windows, leading to 'too many root sets' errors when many threads
1878         are created.
1879
1880         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
1881         shutdown, they can still be referenced by the other dying objects.
1882         Fixes #514506.
1883
1884 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
1885
1886         * socket-io.c: DontLinger does not allow LingerOptions.
1887
1888 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1889
1890         * metadata-verify.c: The spec doesn't mention that it's possible to add
1891         custom attribute to a generic parameter. Fixed.
1892
1893 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1894
1895         * class.c (inflate_generic_type): Don't crash while trying to output a message
1896         on why we're aborting.
1897
1898 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
1899
1900         * socket-io.c: DontLinger can take an int or a boolean too.
1901
1902 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
1903
1904         * gc.c: check for a null argument to SuppressFinalize () and
1905         ReRegisterForFinalize ().
1906
1907 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
1908
1909         * loader.c (method_from_methodspec): Call into the verifier to check
1910         the signature.
1911
1912         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
1913
1914         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
1915         part of the internal API.
1916
1917 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1918
1919         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
1920         the signature.
1921
1922         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
1923
1924         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
1925         part of the internal API.
1926
1927 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1928
1929         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
1930         the signature.
1931
1932         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
1933         blob verification.
1934
1935         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
1936         part of the internal API.
1937
1938 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1939
1940         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
1941         when doing basic verification. 
1942
1943         This check must be done since the runtime peeks into signatures in much
1944         more places than it does decoding so it makes sense to ensure that all
1945         pointers to blob objects are well formed.
1946
1947 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1948
1949         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
1950         Use proper overflow dectection. Fix usage of it.
1951
1952 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
1953
1954         * loader.c (field_from_memberref): Call into the verifier to check
1955         the signature.
1956
1957         * loader.c (mono_method_get_signature_full): Same.
1958
1959         * loader.c (method_from_memberref): Same.
1960
1961         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
1962
1963         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
1964         part of the internal API.
1965
1966 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1967
1968         * threadpool.c (mono_thread_pool_add): If the domain is unloading
1969         or unloaded, still return an AsyncResult, but don't add it to the
1970         threadpool.
1971
1972 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
1973
1974         * threads.c: fix missing colon when DEBUG is defined.
1975
1976 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1977
1978         * threadpool.c: Don't add new calls to a threadpool if the domain
1979         of the call is unloading or unloaded.  When dequeuing a job, null
1980         the reference in the queue.
1981
1982 2009-06-25  Mark Probst  <mark.probst@gmail.com>
1983
1984         * sgen-gc.c (null_link_in_range): Add the dislink for the old
1985         generation if an object was moved.
1986
1987 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
1988
1989         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
1990           parameters of type SAFEARRAY[VARIANT].
1991
1992         * reflection.c (encode_marshal_blob): Properly generate element type
1993           (SafeArraySubType marshal attribute option).
1994
1995         Code is contributed under MIT/X11 license.
1996
1997 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
1998
1999         * reflection.c: in mono_method_clear_object () really ensure all the
2000         objects are removed.
2001
2002 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2003
2004         * loader.c (mono_method_signature): Call into the verifier to check
2005         the method signature.
2006
2007         * metadata-verify.c (verify_method_table): Move signature verification
2008         to verify_method_table_full.
2009
2010         * metadata-verify.c: Add mono_verifier_verify_method_signature.
2011
2012         * verify-internals.h: Export mono_verifier_verify_method_signature as
2013         part of the internal API.
2014
2015 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2016
2017         * loader.c (mono_method_get_header): Call into the verifier to
2018         check the method header.
2019
2020         * metadata-verify.c: Add mono_verifier_verify_method_header.
2021
2022         * verify-internals.h: Export mono_verifier_verify_method_header as
2023         part of the internal API.
2024
2025 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2026
2027         * class.c (mono_class_find_enum_basetype): Call into the verifier to
2028         check the field signature. Replace an assert with an explicit check.
2029
2030         * class.c (mono_class_setup_fields): Call into the verifier to check
2031         the field signature.
2032
2033         * metadata-verify.c: Add mono_verifier_verify_field_signature.
2034
2035         * verify-internals.h: Export mono_verifier_verify_field_signature as
2036         part of the internal API.
2037
2038 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2039
2040         * class.c (mono_class_find_enum_basetype): Simplify this function
2041         by moving code outside of the loop and not decoding static fields.
2042
2043 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
2044
2045         * metadata-verify.c (verify_typedef_table): Check the extends
2046         token here. Move to here a flags check from verify_typedef_table_full.
2047
2048 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
2049
2050         * metadata-verify.c (is_valid_method_header): Fix a warning.
2051
2052         * metadata-internals.h (MonoImage): Remove the unused 
2053         static_rgctx_invoke_wrapper_cache.
2054
2055         * image.c marshal.c: Ditto.
2056
2057 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2058
2059         * image.c (do_mono_image_load): Enable table data verification.
2060
2061 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2062
2063         * metadata-verify.c (is_valid_constant): Fix nullref check.
2064
2065 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
2066
2067         * metadata-verify.c (is_valid_constant): Fix string bounds check.
2068
2069 2009-06-22  Mark Probst  <mark.probst@gmail.com>
2070
2071         * sgen-gc.c: Managed allocation with pthreads TLS.
2072
2073         * threads.c, threads-types.h: Functions for the JIT to tell the
2074         runtime whether it supports the MONO_TLS opcode.
2075
2076 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2077
2078         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
2079         without methods.
2080
2081 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2082
2083         * metadata-verify.c (is_valid_constant): Fix the string length check.
2084         Use safe overflow checking. Add decent error messages.
2085
2086 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2087
2088         * metadata-verify.c: Move remaininh blob checks to the offline
2089         verification path.
2090
2091 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
2092
2093         * metadata-verify.c: Move more blob checks to the offline verification
2094         path.
2095
2096 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
2097
2098         * object-internals.h : Adding interrupt_on_stop field.
2099
2100         * threads.c (mono_thread_request_interruption) : On Windows exit the
2101           thread if interrupt_on_stop is set.
2102
2103         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
2104          Removing old interrupt logic and setting the interrupt_on_stop for the
2105          thread when calling accept.
2106
2107         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
2108          setting the interrupt_on_stop for the thread when calling accept.
2109
2110         Contributed under MIT/X11 license.
2111
2112 2009-06-20  Martin Baulig  <martin@ximian.com>
2113
2114         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
2115
2116 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
2117
2118         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
2119         running in no-exec mode.
2120
2121 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2122
2123         * metadata-verify.c (verify_method_table): Move header
2124         checking to verify_method_table_full.
2125
2126         * metata-verify.c (mono_verifier_verify_full_table_data):
2127         Call verify_method_table_full.
2128
2129 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2130
2131         * metadata-verify.c (verify_field_table): Move signature
2132         checking to verify_field_table_full.
2133
2134         * metata-verify.c (mono_verifier_verify_full_table_data):
2135         Call verify_field_table_full.
2136
2137 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2138
2139         * metadata-verify.c (verify_typedef_table): Move remaining
2140         stuff to verify_typedef_table_full.
2141
2142 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2143
2144         * metadata-verify.c: Kill is_corlib from VerifyContext.
2145         It is only used by the offline mode.
2146         So we better remove it from the runtime path.
2147
2148 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2149
2150         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
2151         function that perform the offline metadata verification steps.
2152
2153         * metadata-verify.c (verify_typedef_table): Move some checks to
2154         verify_typedef_table_full and make it been called by new function
2155         mono_verifier_verify_full_table_data.
2156
2157         * pedump.c: Call mono_verifier_verify_full_table_data.
2158
2159         * verify-internals.h: Export mono_verifier_verify_full_table_data as
2160         part of the internal API.
2161
2162 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2163
2164         * metadata-verify.c (typedef_is_system_object): Fix System.Object
2165         check.
2166
2167         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
2168         flags bits. SupportLastError was confused as bit 7 instead of 6.
2169
2170         * metadata-verify.c (verify_implmap_table): Fix import scope verification
2171         to check against the module ref table instead of module.
2172
2173         * metadata-verify.c (verify_implmap_table): Fix corlib check.
2174
2175         * pedump.c: Call mono_image_load_names.
2176
2177 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
2178
2179         * image.c: Extract mono_image_load_names from do_mono_image_load.
2180
2181         * metadata-internals.h: Export mono_image_load_names as part of
2182         the internal API.
2183         
2184 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
2185
2186         * metadata.c (mono_metadata_cleanup): Free the generic method cache
2187         first, as it could reference data in the other caches.
2188
2189 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
2190
2191         * metadata-verify.c: Finished with method header verification.
2192
2193 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
2194
2195         * metadata-verify.c: Added more header verification code.
2196         Now only EH clauses are missing.
2197
2198 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
2199
2200         * marshal.c (get_runtime_invoke_type): Don't share primitive types
2201         for return values.
2202
2203 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
2204
2205         * metadata-verify.c: Initial method header verification.
2206
2207 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
2208
2209         * metadata-verify.c (verify_import_table): The IAT contents
2210         might end been patched by the windows DL when running with
2211         coree enabled.
2212
2213 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
2214
2215         * class.c (mono_class_from_typeref): If the enclosing type is not
2216         found return null instead of crashing. Fixes #508487.
2217
2218 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
2219
2220         * normalization-tables.h : updated to the latest unicode charcter
2221           data.
2222         * appdomain.c : bump corlib version.
2223
2224 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
2225
2226         * class.c (mono_class_from_name): Fix support for assembly references
2227         in the EXPORTEDTYPE table. Fixes #511704.
2228
2229 2009-06-13  Geoff Norton  <gnorton@novell.com>
2230
2231         * domain.c: Ensure that mono_domain_assembly_open actually opens the
2232         assembly in the target domain.
2233
2234 2009-06-12  Robert Jordan  <robertj@gmx.net>
2235
2236         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
2237         because "this" of the managed signature has become an
2238         ordinary parameter in the unmanaged signature.
2239
2240 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
2241
2242         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
2243         field for owner-less generic containers.
2244
2245         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
2246         image field of the owner-less generic containers created here.
2247
2248         * metadata.c (mono_metadata_load_generic_params): Ditto, the
2249         contain is ownerless until the caller sets its owner.
2250
2251         * metadata.c (type_in_image): Handle owner-less generic containers
2252         correctly.
2253         
2254 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
2255
2256         * image.c (mono_image_close): Support debug_assembly_unload for
2257         dynamic images too.
2258
2259 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
2260
2261         * class.c: Fix some typos in comments.
2262
2263 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
2264
2265         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
2266
2267         * threads.c (mono_thread_execute_interruption): Avoid creating the
2268         abort exception object while holding the synch_cs lock.
2269
2270 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
2271
2272         * metadata-verify.c: Verify basic cattr content.
2273
2274 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
2275
2276         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
2277         nested types.
2278         
2279         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
2280         support for nested types. Fixes #511704.
2281
2282 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2283
2284         * metadata-verify.c: Verify methodspec signatures.
2285
2286 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
2287
2288         * metadata-verify.c: Verify typespec signatures.
2289
2290 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
2291
2292         * metadata.c (free_inflated_method): Call 
2293         mono_marshal_free_inflated_wrappers (), which was missed earlier.
2294
2295 2009-06-08  Miguel de Icaza  <miguel@novell.com>
2296
2297         * mono-config.c: Small change to report the PPC64/ILP32 model.
2298
2299 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2300
2301         * metadata-verify.c (parse_type): Check szarray.
2302
2303 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2304
2305         * metadata-verify.c (parse_type): Check fnptr.
2306
2307 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2308
2309         * metadata-verify.c (parse_type): Check generic instances.
2310
2311 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
2312
2313         * metadata-verify.c (parse_type): Check array shape.
2314
2315 2009-06-05  Robert Jordan  <robertj@gmx.net>
2316
2317         * class.c (mono_class_create_from_typedef): Check only for
2318         mscorlib's System.Array.
2319
2320 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2321
2322         * metadata-verify.c (parse_type): Check pointer, class/valuetype
2323         and generic params. 
2324
2325         * metadata-verify.c (parse_field): Check the signature.
2326
2327 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
2328
2329         * metadata-verify.c: Implement locals signature check.
2330
2331 2009-06-04  Marek Safar  <marek.safar@gmail.com>
2332
2333         * domain.c: Add .NET 4.0 Beta 1 version.
2334
2335 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
2336
2337         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
2338           For QueryInterface on CCWs consider the base class
2339           interfaces as well.
2340
2341         Code is contributed under MIT/X11 license.
2342
2343 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
2344
2345         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
2346
2347         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
2348         used.
2349
2350         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
2351         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
2352
2353         * generic-sharing.c (inflate_other_data): Ditto.
2354         
2355 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
2356
2357         * metadata-verify.c: Implement property signature check.
2358
2359 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2360
2361         * sgen-gc.h: Register saving support for PPC.
2362
2363 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2364
2365         * sgen-gc.c: Fixed a pthread TLS screwup.
2366
2367 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2368
2369         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
2370         supported.
2371
2372 2009-06-04  Mark Probst  <mark.probst@gmail.com>
2373
2374         * sgen-gc.c: Disable TLA and managed allocation if the __thread
2375         keyword is not supported.
2376
2377 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
2378
2379         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
2380         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
2381         the inflated method is freed. Fixes #508389.
2382
2383         The code is contributed under the MIT/X11 license.
2384         
2385 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
2386
2387         * marshal.c (get_wrapper_target_class): New helper function.
2388         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
2389         the <Module> class of the image. Fixes #509049.
2390
2391 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2392
2393         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
2394         Check if the thread was interrupted and proccess it straight away.
2395         Makes abortion much more responsive.
2396
2397 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2398
2399         * threads.c (mono_thread_execute_interruption): Use atomic cas with
2400         MonoThread::interruption_requested to match it's counterpart.
2401
2402         Fixes a hang in abort-stress-1 on a 2 core x86.
2403
2404         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
2405         Fix warning.
2406
2407 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2408
2409         Change MonoImage::name_cache to be protected by the image lock
2410         instead of the loader lock.
2411
2412         * appdomain.c (deregister_reflection_info_roots): Protect access
2413         to name_cache.
2414
2415         * class.c (mono_image_init_name_cache): Change from the loader lock
2416         to the image lock. Check if the cache wasn't already created.
2417
2418         * class.c: Change from the loader to the image lock.
2419
2420         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
2421         the code to hold the image lock while iterating over name_cache and
2422         not go into mono_array_new holding it.
2423
2424         * metadata-internals.h: Add a comment about this change.
2425
2426 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2427
2428         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
2429         Under the 2.0 profile raise the loader error.
2430
2431         Fixes #508532.
2432
2433 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
2434
2435         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
2436         of ldind opcode for generic instances so we don't fail for direct wrappers.
2437         This only affect direct calls.
2438
2439 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
2440
2441         * reflection.c (create_dynamic_mono_image): Fix warnings.
2442
2443         * generic-sharing.c (other_info_equal): Ditto.
2444         
2445 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2446
2447         * metadata-verify.c: Implement field signature check.
2448
2449 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
2450
2451         * metadata-verify.c: Implement standalone signature check.
2452
2453 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
2454
2455         * metadata-verify.c: Implement methodref signature check.
2456
2457 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
2458
2459         * object-internals.h (MonoRuntimeCallbacks): New structure containing
2460         callbacks supplied by the runtime.
2461
2462         * object.c (mono_install_callbacks): New internal function to install
2463         the callbacks.
2464
2465         * object.c (mono_create_ftnptr): Move the implementation of this to
2466         mini/.
2467
2468         * object.c (mono_get_addr_from_ftnptr): Ditto.  
2469
2470 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2471
2472         * metadata-verify.c (parse_return_type): Proper byref check.
2473         * metadata-verify.c (is_valid_method_signature): Check for zero arity
2474         generic signatures and method params.
2475
2476 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
2477
2478         * metadata-verify.c (decode_signature_header): Fix bounds check.
2479
2480         * metadata-verify.c (parse_custom_mods): Check custom mods.
2481
2482         * metadata-verify.c (parse_type): Do initial basic verification
2483         of valid values.
2484         
2485         * metadata-verify.c (is_valid_method_signature): Parse the generic
2486         param count.
2487
2488 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
2489
2490         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
2491         discarded based on their most specific definition so we set the method_slots
2492         array before checking if the method is acceptable or not.
2493
2494         Fixes #506757.
2495
2496 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2497
2498         * icall.c: Free the old array when resizing a mono_ptr_array.
2499
2500 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2501
2502         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
2503         for the hashes whose keys are managed objects.
2504
2505 2009-05-26  Mark Probst  <mark.probst@gmail.com>
2506
2507         * object-internals.h, threads.c: Set the execution context on
2508         thread start here, not in corlib.
2509
2510         * appdomain.c: Bump corlib version.
2511
2512 2009-05-27  Martin Baulig  <martin@ximian.com>
2513
2514         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
2515         if `_mono_debug_using_mono_debugger' is set to make things work
2516         properly when embedding Mono.
2517
2518 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
2519
2520         * class.c (mono_class_setup_fields): Don't mark simd types as having
2521         16 bytes alignment as the whole runtime doesn't support.
2522
2523 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
2524
2525         * metadata-verify.c (safe_read): Use endian safe read macros.
2526
2527 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
2528
2529         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
2530         it is read-only when using full aot.
2531
2532 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2533
2534         * metadata-verify.c (is_valid_method_signature): Verify parts
2535         of the return type. Provide an error message in case of failure.
2536
2537 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2538
2539         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
2540
2541 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
2542
2543         * metadata-verify.c: Include the size prefix in the bounds check.
2544
2545 2009-05-22  Miguel de Icaza  <miguel@novell.com>
2546
2547         * icall.c: Remove warnings.
2548
2549         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
2550         prevent auto-detection based on GCC defines.
2551
2552         Add PS3
2553
2554         * metadata-verify.c: Do not include signal.h
2555
2556         * generic-sharing.c, marshal.c: Add returns to avoid some warning
2557         messages.  Not sure why the g_assert_not_reached is not enough to
2558         quiet the compiler.
2559         
2560
2561         * appdomain.c: Remove code that is not used when
2562         DISABLE_SHADOW_COPY is set.
2563
2564         * image.c: use g_getenv
2565
2566 2009-05-21  Miguel de Icaza  <miguel@novell.com>
2567
2568         * reflection.c: Remove code that it not used with
2569         DISABLE_REFLECTION_EMIT is defined.
2570
2571 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
2572
2573         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
2574         invoke wrappers.
2575
2576 2009-05-20  Miguel de Icaza  <miguel@novell.com>
2577
2578         * socket-io.c
2579         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
2580         the ifdef here and instead put that on io-layer
2581
2582 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2583
2584         * metadata-verify.c: Verify the generic param constraint table.
2585
2586 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2587
2588         * metadata-verify.c (verify_generic_param_table): Fix
2589         thinko on the valid flags bits for generic params.
2590
2591 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2592
2593         * metadata-verify.c: Verify the methodspec table.
2594
2595 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
2596
2597         * metadata-verify.c: Verify the generic param table.
2598
2599 2009-05-19  Mark Probst  <mark.probst@gmail.com>
2600
2601         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
2602
2603 2009-05-19  Mark Probst  <mark.probst@gmail.com>
2604
2605         * sgen-gc.c: Use generation enum more consistently and use the
2606         correct generation in mono_gc_register_for_finalization().
2607
2608 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
2609
2610         * metadata-verify.c: Verify the nested class table.
2611
2612 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
2613
2614         * metadata-verify.c: Verify the manifest resource table.
2615
2616 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
2617
2618         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
2619
2620 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
2621
2622         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
2623         wrappers, this is now done in the JIT.
2624         
2625         * class.c (mono_set_generic_sharing_supported): New internal function.
2626         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
2627
2628 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2629
2630         * metadata-verify.c: Verify the exported type table.
2631
2632 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2633
2634         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
2635
2636 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2637
2638         * metadata-verify.c: Verify the file table.
2639
2640 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2641
2642         * metadata-verify.c (verify_assembly_table): Fix an error message.
2643
2644         * metadata-verify.c: Verify the assemblyref table.
2645
2646 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
2647
2648         * metadata-verify.c (verify_assembly_table): Fix the valid
2649         bits mask for flags.
2650
2651 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
2652
2653         * debug-helpers.c (mono_method_full_name): Print generic parameters of
2654         generic methods as well.
2655
2656 2009-05-15  Geoff Norton  <gnorton@novell.com>
2657
2658         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
2659         use-case and is significantly more performant than the wapi layer.
2660
2661 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2662
2663         * metadata-verify.c: Verify the assembly table.
2664
2665 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2666
2667         * metadata-verify.c: Fix rows limit check.
2668
2669 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
2670
2671         * metadata-verify.c: Verify the fieldrva table.
2672
2673 2009-05-13  Mark Probst  <mark.probst@gmail.com>
2674
2675         * sgen.c: Speed up weak links and finalizers by grouping them by
2676         generation.
2677
2678 2009-05-13  Mark Probst  <mark.probst@gmail.com>
2679
2680         * marshal.c (delegate_hash_table_add): When overwriting an entry,
2681         free the old GCHandle (only applies to SGen).
2682
2683 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
2684
2685         * loader.c (mono_get_method_from_token): Avoid the expensive call to
2686         mono_metadata_load_generic_params () for non-generic methods.
2687
2688 2009-05-12  Mark Probst  <mark.probst@gmail.com>
2689
2690         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
2691         New function for returning a monitor's weak link if it has one.
2692
2693         * sgen-gc.c: Remove an object's monitor's weak link (if it has
2694         one) when clearing a domain.  These can still be around because
2695         the object might not have been collected.
2696
2697 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
2698
2699         * gc.c: Fix a warning.
2700
2701 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
2702
2703         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
2704         prevous wait that resulted in a deadlock on Windows when initializing
2705         the runtime form DllMain. Also results in improved startup time.
2706         (finalizer_thread): Get rid of thread_started_event.
2707         * threads.c, threads-types.h (mono_thread_create_internal): Return the
2708         resulting MonoThread.
2709
2710         Contributed under MIT/X11 license.
2711
2712 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
2713
2714         * metadata-verify.c: Verify the implmap table.
2715         Don't require that #US and #Strings be present.
2716
2717 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
2718
2719         * security-core-clr.c: Delegate checks are done at creation time,
2720         not a invocation time. Fix exception for Telerik Silverlight demo
2721
2722 2009-05-11  Mark Probst  <mark.probst@gmail.com>
2723
2724         * sgen-gc.c (need_remove_object_for_domain): Remove the special
2725         case for the Thread class.
2726
2727         * threads.c: Do clean-up of abort exception/state in
2728         thread_cleanup() instead of Thread.free_internal().  Also clean up
2729         current_appcontext.  The reason we have to do that is because
2730         those references might point into another domain and if that
2731         domain is unloaded before the thread is finalized, they point to
2732         invalid data.
2733
2734 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
2735
2736         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
2737         stub signatures.
2738         
2739         Contributed unter MIT/X11 license.
2740
2741 2009-05-09  Miguel de Icaza  <miguel@novell.com>
2742
2743         * verify.c, metadata-verifier.c: Add support for disabling the
2744         verifier in some builds.
2745
2746         [ Sorry, my previous commit accidentally commited some work in
2747         progress ]
2748
2749 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
2750
2751         * class.c (mono_class_setup_fields): Set class->field.first for
2752         generic instances.
2753
2754 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
2755
2756         * metadata-verify.c: Verify the typespec table.
2757
2758 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
2759
2760         * metadata-verify.c: Verify the module table.
2761
2762 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2763
2764         * metadata-verify.c: Verify the methodimpl table.
2765
2766 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
2767
2768         * metadata-verify.c: Verify the property table.
2769
2770 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
2771
2772         * debug-helpers.c (mono_method_desc_match): Add support for generic
2773         glob patterns.
2774
2775 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
2776
2777         * metadata-verify.c: Verify the propertymap table.
2778
2779 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
2780
2781         * metadata-verify.c: Verify the event table.
2782
2783         * metadata-verify.c (search_sorted_table): Fix offset
2784         calculation.
2785
2786 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
2787
2788         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
2789
2790 2009-05-01  Mark Probst  <mark.probst@gmail.com>
2791
2792         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
2793         because mono_delegate_free_ftnptr() needs it.
2794
2795 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2796
2797         * metadata-verify.c: Verify the eventmap table.
2798
2799 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2800
2801         * metadata-verify.c: Verify the standalonesig table.
2802
2803 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2804
2805         * metadata-verify.c: Verify the field layout table.
2806
2807 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2808
2809         * class.c (mono_type_get_name_recurse): Don't crash
2810         for ownerless generic params.
2811
2812         * debug-helpers.c (mono_type_get_desc): Correct the format
2813         for ownerless generic params.
2814
2815 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2816
2817         * metadata-verify.c: Verify the class layout table.
2818
2819 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
2820
2821         * metadata-verify.c: Verify the decl security table.
2822
2823 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2824
2825         * domain.c (mono_domain_set_internal_with_options): Don't do
2826         anything if the old domain is the same as the old one.  Fixes
2827         #499326.
2828
2829 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2830
2831         * appdomain.c: Deregister the reflection_info roots when unloading
2832         a domain.
2833
2834         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
2835         memory allocated by a domain and frees its disappearing links.
2836
2837         * boehm-gc.c, null-gc.c: Empty implementation of
2838         mono_gc_clear_domain().
2839
2840 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2841
2842         * appdomain.c (clear_cached_vtable): Free the static fields memory
2843         block.
2844
2845 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2846
2847         * gc.c: Set the correct domain when invoking finalizers.
2848
2849         * appdomain.c: Set the correct domain when creating threads.
2850
2851 2009-04-30  Mark Probst  <mark.probst@gmail.com>
2852
2853         * sgen-gc.c: Fix skip size for vectors.
2854
2855 2009-05-03  Martin Baulig  <martin@ximian.com>
2856
2857         * mono-debug-debugger.c
2858         (mono_debugger_check_breakpoints): Check class init handlers even
2859         if we don't have any method load handers.
2860
2861 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
2862
2863         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
2864         returning refonly assemblies if refonly is FALSE. Fixes #499013.
2865
2866 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
2867
2868         * metadata-verify.c: Verify the field marshal table.
2869
2870 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
2871
2872         * metadata-verify.c: Verify the custom attribute table.
2873
2874 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2875
2876         * metadata-verify.c: Verify the constant table.
2877
2878 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2879
2880         * metadata-verify.c: Verify the memberef table.
2881
2882 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2883
2884         * metadata-verify.c (get_coded_index_token): Remove
2885         dead argument.
2886
2887 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2888
2889         * metadata-verify.c: Verify the interfaceimpl table.
2890
2891 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
2892
2893         * verify.c: Improve error message.
2894
2895         * debug-helpers.c (mono_type_get_desc): Harden the code that
2896         deals with VAR and MVAR.
2897
2898 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
2899
2900         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
2901         part of #498692.
2902
2903 2009-04-23 Tom Hindle <tom_hindle@sil.org>
2904
2905         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
2906         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
2907
2908 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
2909
2910         * security-core-clr.c: Avoid redundant checks for platform code, 
2911         e.g. check for method and for class (very common) and check
2912         for class and outer class (less common)...
2913
2914 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
2915
2916         * reflection.c: Avoid returning random cattrs for synthetic methods.
2917         Fixes #498545.
2918
2919 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2920
2921         * assembly.c: assemblies in the GAC should never be shadow-copied.
2922
2923 2009-04-26  Mark Probst  <mark.probst@gmail.com>
2924
2925         * domain.c, domain-internals.h: Disable
2926         track_resurrection_{objects,handles}_hash in MonoDomain if using
2927         SGen.
2928
2929 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2930
2931         * metadata-verify.c: Verify the param table.
2932
2933 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2934
2935         * metadata-verify.c (verify_typedef_table): Range check FieldList and
2936         MethodList.
2937
2938         * metadata-verify.c (verify_method_table): Proper check the ParamList
2939         field.
2940
2941 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2942
2943         * metadata-verify.c (verify_method_table): Check for runtime
2944         implemented functions such as delegate .ctors. Remove spurious
2945         printf.
2946         
2947 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
2948
2949         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
2950
2951 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2952
2953         Don't allocate MonoGenericInfo for ownerless generic params.
2954         * class-internals.h (MonoGenericParam::info): Move field to ...
2955         (MonoGenericParamFull): ... this.  New struct.
2956         (MonoGenericContainer::type_params): Change type to
2957         MonoGenericParamFull.
2958         (MonoGenericParam, MonoGenericContainer): Update accessors.
2959         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
2960         'info' field for ownerless generic param.
2961         (mono_metadata_load_generic_params): Update to changes.
2962         * reflection.c (mono_reflection_create_generic_class): Likewise.
2963         (reflection_methodbuilder_to_mono_method): Likewise.
2964         (mono_reflection_initialize_generic_parameter): Likewise.
2965
2966 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2967
2968         Don't use MonoGenericParamInfo for ownerless generic params.
2969         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
2970         use ParamInfo class at all.
2971         (mono_class_from_generic_parameter): Use them.
2972         (make_generic_param_class): Fix a couple of instances where 'pinfo
2973         == NULL' wasn't handle.
2974
2975 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2976
2977         * class.c (make_generic_param_class): Carve out of ...
2978         (mono_class_from_generic_parameter): ... here.
2979
2980 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
2981
2982         Simplify mono_class_from_generic_parameter
2983         * class-internals.h (MonoGenericParamInfo::token): New field.
2984         * metadata.c (mono_metadata_load_generic_params): Initialize it
2985         from metadata.
2986         * class.c (mono_class_from_generic_parameter): Use it instead of
2987         searching through metadata.
2988
2989 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2990
2991         * metadata-verify.c: Add verification of the method table.
2992
2993 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2994
2995         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
2996         Delegate::Invoke optimization.
2997
2998 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
2999
3000         * appdomain.c (mono_domain_create_appdomain_internal): Free the
3001         string returned by get_shadow_assembly_location_base.
3002
3003         * appdomain.c (get_shadow_assembly_location_base): Add a comment
3004         about caller's ownership.
3005
3006 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
3007
3008         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
3009         reflection memory on domain unload.
3010
3011         * domain.c (mono_domain_free): Don't free refobject_hash, let the
3012         reflection cleanup code do it.
3013
3014         * domain-internals.h: Add mono_reflection_cleanup_domain.
3015
3016         This fixes a memory leak for managed mirrors of reflection objects
3017         on domain unload. 
3018
3019 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3020
3021         * metadata-verify.c: Implement more verification of the field table.
3022
3023 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
3024
3025         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
3026         doesn't try to parse the input assembly, which can be broken.
3027
3028 2009-04-23  Mark Probst  <mark.probst@gmail.com>
3029
3030         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
3031         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
3032         by using the lowest bit in the link to store whether the link is
3033         tracked.  Move the track_resurrection hashes into boehm-gc.c.
3034
3035 2009-04-22  Miguel de Icaza  <miguel@novell.com>
3036
3037         * Makefile.am: Split the console support in platform specific code
3038         and put together a framework for making this easy in the future so
3039         that we can start splitting code instead of having a mess of PLATFORM_WIN32
3040
3041 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3042
3043         * pedump.c: Fix a warning.
3044
3045 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3046
3047         * verify.c (mono_delegate_type_equal): Compare valuetypes using
3048         mono_class_from_mono_type to avoid bad interactions with the dual representation
3049         of the generic type definition.
3050
3051 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
3052
3053         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
3054         get the MonoClass for the call context type as it might be a generic
3055         instance.
3056
3057         Fixes #491483.
3058
3059 2009-04-21  Mark Probst  <mark.probst@gmail.com>
3060
3061         * object-internals.h: The Thread object has no execution_context
3062         member anymore.
3063
3064         * threads.c, threadpool.c, threads-types.h: Accessor functions for
3065         the execution context.
3066
3067         * appdomain.c: Bump corlib version.
3068
3069 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3070
3071         * verify.c (do_newobj): Improve error message.
3072
3073 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3074
3075         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
3076         is nested in the filter block.
3077
3078         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
3079         block is not fully nested.
3080
3081         Fixes #495656.
3082
3083 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3084
3085         * verify.c (verify_type_compatibility_full): Compare MonoClass and
3086         not MonoType to check for equality of valuetypes as the generic type
3087         definition allows for two different encodings: the generic type definition
3088         class or a generic instance over the GTD arguments.
3089
3090         Fixes #496175.
3091
3092 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3093
3094         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
3095
3096         * verify.c (do_initobj): Improve error message.
3097
3098 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
3099
3100         * metadata-verify.c: Enable pe verification as the issue with #496453
3101         is that the authenticode data directory have a different unspecified
3102         format. Ignore it for now.
3103
3104         * pedump.c: Run the metadata verifier together with the IL verifier.
3105
3106         Fixes ##496453.
3107
3108 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
3109
3110         * metadata-verify.c: Temporarily disable pe verification due to #496453.
3111
3112 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3113
3114         * class.c (can_access_type): Check visibility against
3115         the element type for pointers and arrays.
3116
3117         Fixes #496150.
3118
3119 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3120
3121         * metadata-verify.c: Fix cli and table verification to use information
3122         from the MonoImage. A lot of duplicated code got killed.
3123
3124 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
3125
3126
3127         This patch starts to integrate the metadata verifier with the runtime code.
3128
3129         This patch causes major regression in functionality for the metadata verifier
3130         as cli and table verification are disabled since they require to be ported to
3131         use MonoImage information.
3132
3133         * image.c (do_mono_image_load): Split the code in this function
3134         into mono_image_load_pe_data and mono_image_load_cli_data.
3135         Add     care_about_pecoff parameter to not load pecoff data.
3136         Call into the metadata verifier for pecoff and cli verification.
3137
3138         * image.c (mono_image_open_raw): New function that doesn't perform
3139         any parsing of the image contents.
3140         
3141         The reason for the 3 new functions is to give pedump better control
3142         into the interaction with the verifier.
3143
3144         * metadata-internals.h: Add new functions from image.c as part of the
3145         internal mono API.
3146
3147         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
3148         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
3149         to make those functions work together with the runtime.
3150
3151         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
3152         true if the image needs to be verified.
3153
3154         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
3155
3156         * pedump.c: Use new metadata verifier API.
3157
3158 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
3159
3160         * object.c (mono_install_vtable_trampoline): Make this receive a
3161         trampoline creation function instead of trampoline, allowing the JIT
3162         to use a different trampoline for each vtable.
3163
3164 2009-04-18  Mark Probst  <mark.probst@gmail.com>
3165
3166         * object.c (mono_raise_exception): Don't reset the thread abort
3167         exception state here.
3168
3169 2009-04-18  Mark Probst  <mark.probst@gmail.com>
3170
3171         * icall-def.h: New icall for getting the thread abort exception
3172         state for a thread.
3173
3174         * object.c, thread.c, object-internals.h: A thread's abort
3175         exception state is now a GC handle.  To get the object it stands
3176         for, we must move it into the current app domain, if it's
3177         different than the one where it originated from.
3178
3179         * appdomain.c: Bump corlib version.
3180
3181         * domain.c, domain-internals.h: New function for setting the
3182         domain and migrate the thread abort exception or not.
3183
3184 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3185
3186         * metadata-verify.c: Add initial verification of the
3187         field table.
3188
3189 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3190
3191         * metadata-verify.c: Add a macro to conditionally enable
3192         dumping of verification information. Add  make_coded_token
3193         and search_sorted_table to enable search sorted tables
3194         by a given coded token.
3195
3196 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3197
3198         * metadata-verify.c: Add array mapping from table index
3199         to description offset. Add get_col_offset and get_col_size
3200         functions.
3201
3202 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3203
3204         * metadata-verify.c: Add remaining table descriptions offsets.
3205         Add remaining coded index descriptions.
3206
3207 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3208
3209         * metadata-verify.c: Fixed constant table description.
3210         Fixed calculation of HasCustomAttribute coded index size.
3211         Fixed calculation of size for many table indexes. 
3212
3213 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3214
3215         * pedump.c (dump_metadata): Dump table offset instead
3216         of useless pointer in memory.
3217
3218 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
3219
3220         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
3221
3222 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3223
3224         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
3225         a missing of for interface types.
3226
3227 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3228
3229         * metadata-verify.c (verify_pe_optional_header): Add comment of why
3230         the code is commented.
3231
3232         * metadata-verify.c (verify_resources_table): Remove spurious printf
3233         and don't fail if there are unmanaged resources. Gmcs generates a useless
3234         one     for all assemblies - I bet it's some MS compatibility junk.
3235
3236 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3237
3238         * metadata-verify.c (verify_typedef_table): Verify the extends field.
3239
3240         * metadata-verify.c (mono_image_verify): Add a is_corlib.
3241
3242         * verify-internals.h: Same.
3243
3244         * pedump.c: Fix for mono_image_verify new signature.
3245
3246 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3247
3248         * metadata-verify.c (verify_typedef_table): Verify for some invalid
3249         flags combinations.
3250
3251 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
3252
3253         * metadata-verify.c (verify_module_table): Ignore the generation field.
3254
3255 2009-04-15  Martin Baulig  <martin@ximian.com>
3256
3257         * debug-mono-symfile.c
3258         (mono_debug_symfile_lookup_location): Don't print a warning for
3259         unknown extended opcodes if they're within 0x40 and 0x7f.
3260
3261 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
3262
3263         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
3264         invoke signatures returning an enum. Fixes #494847.
3265
3266 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3267
3268         * metadata-verify.c: Initial code to verify the typedef table.
3269
3270 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3271
3272         * verify.c (mono_method_verify): Don't fail if an unconditional branch
3273         with non empty stack happens before the beginning of a try block.
3274
3275         Fixes #494812.
3276
3277 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
3278
3279         * metadata-verify.c: Verify typename and typenamespace fields of
3280         the typeref table.
3281
3282 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
3283
3284         * metadata-verify.c: Initial code to verify the typeref table.
3285
3286 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
3287
3288         * verify.c (verify_delegate_compatibility): Fix error message.
3289
3290 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
3291
3292         * security-core-clr.c: Fix typo
3293
3294 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
3295
3296         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
3297         a MonoGHashTable to keep its values alive.
3298         (emit_marshal_boolean): Fix a warning.
3299
3300 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
3301
3302         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
3303         not have any interface configured for IPv4/IPv6.
3304
3305 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
3306
3307         * assembly.c: fix typo in error message.
3308
3309 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
3310
3311         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
3312         allocating the location holding the this argument to prevent
3313         'too many root sets' errors.
3314
3315         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
3316         to mark fields as special static.
3317         (mono_field_static_get_value): Handle special static fields.
3318         (mono_field_static_set_value): Ditto.
3319
3320         * class-internals.h (struct _MonoClassField): Document this.
3321
3322 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3323
3324         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
3325           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
3326           case.  This will handle when managed code returns null to native code.
3327
3328         Code is contributed under MIT/X11 license.
3329
3330 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3331
3332         * object.c (build_imt_slots): Changing a free to a g_free to match
3333           the g_malloc0 in add_imt_builder_entry that allocated this memory.
3334
3335         Code is contributed under MIT/X11 license.
3336
3337 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
3338
3339         * marshal.c (emit_marshal_boolean): Adding code to ensure that
3340           the correct TRUE value is passed through the marshaling layer.
3341
3342         Code is contributed under MIT/X11 license.
3343
3344 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
3345
3346         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
3347         correctly. Fixes #492330.
3348         
3349         * marshal.c: Fix the embedding of object pointers into JITted code in
3350         the native-to-managed wrappers by allocating some GC tracked memory, and
3351         embedding the address of that.
3352
3353 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
3354
3355         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
3356         pointers into the vtable.
3357
3358 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
3359
3360         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
3361
3362         * verify.c (verify_ldftn_delegate): Improve error message.
3363
3364 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
3365
3366         * reflection.c (my_mono_class_from_mono_type): Remove.
3367
3368 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
3369
3370         Prepare to reduce memory usage of owner-less generic parameters (1/n)
3371         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
3372         and constraints fields into ...
3373         (MonoGenericParamInfo): ... this.
3374         (mono_generic_param_info, mono_generic_container_get_param_info):
3375         New accessors.
3376         * class.c, debug-helpers.c, icall.c: Update to changes.
3377         * metadata.c, reflection.c, verify.c: Likewise.
3378
3379 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
3380
3381         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
3382
3383         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
3384         
3385         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
3386         booleans with sbytes.
3387
3388 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3389
3390         * class.c (can_access_instantiation): Verify accesibility of element types
3391         for arrays and pointers.
3392
3393         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
3394
3395         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
3396
3397         Fixes #493068.
3398
3399 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
3400
3401         * verify.c (do_invoke_method): Improve error messages.
3402
3403 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
3404
3405         * verify.c:  Fixing the MSVC build.
3406
3407         Code is contributed under MIT/X11 license.
3408
3409 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3410
3411         * security-core-clr.c: Simplify get_reflection_caller not to call
3412         mono_method_get_last_managed (another stack walk) and adjust the
3413         callers to handle a (should not happen) NULL return value.
3414
3415 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3416
3417         Add accessors to some MonoGenericParam fields
3418         * class-internals.h (mono_generic_param_owner): New accessor.
3419         (mono_generic_param_num): Likewise.
3420         (mono_type_get_generic_param_owner): New helper.
3421         (mono_type_get_generic_param_num): New helper.
3422         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
3423
3424 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3425
3426         * class-internals.h (mono_generic_container_get_param): New wrapper.
3427         * class.c, icall.c, metadata.c, verify.c: Use it.
3428
3429 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
3430
3431         Fix gtest-252.cs
3432         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
3433         the standard case/loop.  In particular, don't complain about
3434         references to generic type definitions.
3435
3436 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
3437
3438         * debug-helpers.c (dis_one): Decode string arguments.
3439
3440 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3441
3442         * pedump.c (dump_verify_info): Dump type name correctly.
3443
3444 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
3445
3446         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
3447         are larger than code size.
3448
3449         This can happen in valid code if the try/catch block is not followed by any instruction
3450         and do a backward branch on the leave instruction.
3451
3452         Fixes #492494.
3453
3454 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
3455
3456         * security-core-clr.c: Fix typo while comparing second method names
3457         in can_avoid_corlib_reflection_delegate_optimization
3458
3459 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
3460
3461         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
3462
3463         Fixes #487738.
3464
3465 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
3466
3467         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
3468         a MVAR using a class context.
3469
3470         Fixes #490335.
3471
3472 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
3473
3474         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
3475
3476         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
3477
3478         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
3479         functions supplied by the JIT for the SGEN GC.
3480
3481         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
3482         
3483 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
3484
3485         monitor.c (mono_monitor_try_enter_internal):
3486         Added calls to profile monitor contentions.
3487         Also duplicated a small piece of code (the "get the monitor" logic)
3488         from the fast path to the slow path, and changed the relevant goto
3489         statements, so that monitor acquisition events can be emitted from the
3490         slow path (this is by Paolo Molaro).
3491
3492 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
3493
3494         * profiler.c, profiler.h, profiler-private.h:
3495         Added support for profiling monitor contentions.
3496
3497 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
3498
3499         * metadata-verify.c: Verify the modules table.
3500
3501 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
3502
3503         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
3504         using the context of the method been verifier and not of the method been called.
3505
3506         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
3507         safely inflate generic types. 
3508
3509 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
3510
3511         * security-core-clr.c: Change the strategy for checking the 
3512         "reflection using delegates optimization" to avoid unneeded 
3513         attributes in multiple class libraries.
3514
3515 2009-04-02  Mark Probst  <mark.probst@gmail.com>
3516
3517         * sgen-gc.c: Remove object element in the disappearing link struct
3518         by storing the object pointer in the link.
3519
3520 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3521
3522         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
3523
3524 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3525
3526         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
3527
3528         * verify.c (mono_method_verify): Do proper bounds checking of exception
3529         clause ranges.
3530
3531 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
3532
3533         * loader.c (mono_field_from_token): Don't crash if the field parent could
3534         not be decoded.
3535
3536 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3537
3538         * sgen-gc.c: Execute critical finalizers after ordinary
3539         finalizers.
3540
3541         * class-internals.h, domain.c: Add CriticalFinalizerObject to
3542         mono_defaults.
3543
3544 2009-03-31 Jb Evain <jbevain@novell.com>
3545
3546         * verify.c (do_ldstr): don't check if a string is in the user strings
3547         heap if the current image is dynamic.
3548
3549 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3550
3551         * sgen-gc.c: Wait until the last finalizer has executed when
3552         returning from WaitForPendingFinalizers.
3553
3554 2009-03-31  Martin Baulig  <martin@ximian.com>
3555
3556         * mono-debug-debugger.h (MonoDebuggerEvent): Add
3557         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
3558         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
3559         (mono_debugger_event_create_appdomain): New function.
3560         (mono_debugger_event_unload_appdomain): New function.
3561
3562         * appdomain.c (mono_domain_create_appdomain_internal): Call
3563         mono_debugger_event_create_appdomain().
3564
3565 2009-03-31  Martin Baulig  <martin@ximian.com>
3566
3567         * mono-debug-debugger.c
3568         (mono_debugger_register_class_init_callback): Also register the
3569         class init callback if the class is already initialized to make
3570         things work with shadow copied assemblies.
3571
3572 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
3573
3574         * security-core-clr.c
3575         (mono_security_core_clr_ensure_reflection_access_field): Let 
3576         critical code access the field (just like we do for methods). Use
3577         check_field_access helper.
3578         (mono_security_core_clr_ensure_reflection_access_method): Use 
3579         check_field_access helper.
3580
3581 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3582
3583         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
3584         call the run-finalize function directly.
3585
3586         * gc.c, gc-internal.h: Make run_finalize() non-static.
3587
3588 2009-03-31  Mark Probst  <mark.probst@gmail.com>
3589
3590         * sgen-gc.c: Use a separate struct for disappearing links.
3591
3592 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
3593
3594         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
3595         * MaxIOVectorLength enabled, just ignore them.
3596         Fixes bug #349688.
3597
3598 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
3599
3600         * metadata-verify.c: Fix eglib build.
3601
3602 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
3603
3604         * threads-types.h: Fix the win32 build.
3605
3606 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
3607
3608         * class.c: move coreclr inheritance/override checks to 
3609         security-core.clr.c
3610         * security-core.clr.c|h: add code from class.c with additional
3611         documentation. Fix override check when the method is not critical.
3612
3613 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
3614
3615         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
3616         (match_class): Ditto.
3617
3618 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
3619
3620         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
3621
3622         * metadata-verify.c: Implement table layout row size calculation. Verify
3623         the total size of the tables.
3624
3625 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
3626
3627         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
3628
3629 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3630
3631         * appdomain.c:
3632         * console-io.[ch]: added new mono_console_init() to make sure that
3633         file descriptors 0, 1 and 2 are opened.
3634         Bug #489019 fixed.
3635
3636 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
3637
3638         * appdomain.h: Export a new callback type and a new function to
3639         set this callback. This allow a mono host to provide it's own
3640         definition for "platform code".
3641         * metadata-internals.h: Add a core_clr_platform_code flag on 
3642         _MonoImage to (cache and) know if it is representing platform 
3643         code.
3644         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
3645         on platform code images.
3646         * security-core-clr.c|h 
3647         (mono_security_set_core_clr_platform_callback): Allow the host
3648         to provide it's own platform check definition.
3649         (mono_security_core_clr_determine_platform_image): Detect if an 
3650         image is platform code (using the specified callback).
3651         (mono_security_core_clr_is_platform_image): Return cached value 
3652         for platform code.
3653
3654 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
3655
3656         * threads.c (mono_create_thread): New helper function to wrap CreateThread
3657         which has different parameter types for the 'tid' argument in windows and
3658         the io-layer.
3659
3660         * appdomain.c attach.c threads.c: Use the new helper.
3661
3662 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
3663
3664         * metadata-verify.c: Verify valid table bits.
3665
3666 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
3667
3668         * metadata-verify.c (verify_metadata_header): Store size in the size field.
3669
3670         * metadata-verify.c: Add initial table schema verification.
3671
3672 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
3673
3674         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
3675         obtain the refclass argument needed by mono_param_get_objects (). Fixes
3676         #488383.
3677
3678         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
3679
3680         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
3681
3682 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
3683
3684         * security-core-clr.c: Add/update documentation
3685
3686 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
3687
3688         * marshal.c (emit_marshal_object): Generate code to throw an exception
3689         instead of throwing it. Fixes #488670.
3690
3691 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
3692
3693         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
3694         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
3695         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
3696         and add a call to mono_security_core_clr_ensure_delegate_creation
3697         to do the extra checks required by CoreCLR.
3698         * security-core-clr.c|h: Add function to check delegate creation,
3699         both in the binding and accessibility, under CoreCLR.
3700
3701 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
3702
3703         * reflection.c (mono_reflection_create_dynamic_method): when 
3704         coreclr is enabled make sure that every resolved object are
3705         checked (e.g. field and method access).
3706         * security-core-clr.c|h: Add function to check objects resolved
3707         when a dynamic method is created.
3708
3709 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3710
3711         * metadata-verify.c: Cache directory rva translations.
3712
3713         * metadata-verify.c: Add cli-header and streams verification.
3714
3715 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
3716
3717         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
3718         the wrong offset (8 instead of 6).
3719
3720 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
3721
3722         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
3723         methods, return the native function address itself. Fixes
3724         #487758.
3725
3726 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
3727
3728         * console-io.c: some of the values for control characters might not be
3729         present.
3730
3731 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
3732
3733         * exception.c|h: Add helpers to create [Field|Method]AccessException
3734         * icall.c: Add required coreclr check calls for field reflection.
3735         Move the existing (method) check logic into security-core-clr.c
3736         * security-core-clr.c: Add functions to check if the access of a
3737         field or method is allowed when reflecting under coreclr. This is
3738         mostly done using a stack walk to find the "real" caller: i.e. the
3739         code that is calling the reflection
3740
3741 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
3742
3743         * gc-internal.h: Change location of gc_wrapper.h
3744
3745 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
3746
3747         * class.c: Simplification to coreclr checks for overrides that
3748         makes it easier to set breakpoints.
3749
3750 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
3751
3752         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
3753         mono_security_core_clr_method_level): Avoid potential 
3754         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
3755         user/application code) and make it easier to set breakpoints
3756
3757 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3758
3759         * metadata-verify.c: Reject cli header tables that mono don't handle.
3760
3761 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3762
3763         * pedump.c: Fix CLI header dumping.
3764
3765 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
3766
3767         * metadata-verify.c: More CLI header verification.
3768
3769 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
3770
3771         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
3772
3773 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
3774
3775         * metadata-verify.c: Initial verification of the CLI header.
3776
3777 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
3778
3779         * metadata-verify.c (verify_resources_table): Fix verification of zero
3780         sized resource section and id entries count.
3781
3782 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
3783
3784         * icall.c: Handle user types in many Type icalls. Fixes #486303.
3785
3786 2009-03-17  Jb Evain  <jbevain@novell.com>
3787
3788         * profiler.c: call mono_gc_base_init from mono_profiler_load.
3789
3790 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
3791
3792         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
3793         (mono_gc_make_descr_for_array): Ditto.
3794
3795 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
3796
3797         * verify.c (mono_verifier_is_class_full_trust): Add support for
3798         CoreCLR security mode where trusted assemblies are defined as
3799         "platform code".
3800
3801 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3802
3803         * metadata-verify.c: Add minimal PECOFF resource verification.
3804
3805 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3806
3807         * metadata-verify.c: Be less restrictive with some coff fields.
3808
3809 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
3810
3811         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
3812         params as boxed values on stack. Fixes #485706.
3813
3814 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
3815
3816         * console-io.c: the termios values may vary in different flavors of unix.
3817
3818 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
3819
3820         * console-io.[ch]: return the entire set of control characters when
3821         initializing the terminal.
3822         * appdomain.c: bump corlib version.
3823
3824 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
3825
3826         * mono-perfcounters.c: added support for in-process custom
3827         performance counters.
3828
3829 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3830
3831         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
3832
3833 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3834
3835         * metadata-verify.c: Verify the data pointed by the import table. 
3836
3837 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
3838
3839         * metadata-verify.c (load_data_directories): Store data
3840         directory contents.
3841
3842         * metadata-verify.c: Verify the import table. 
3843
3844 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3845
3846         * metadata-verify.c: Verify data directories.
3847
3848 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
3849
3850         * metadata-verify.c: Check section header flags.
3851
3852 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
3853
3854         * appdomain.c: if the assembly name is a shadow-copied file, return
3855         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
3856         in mono_make_shadow_copy.
3857         * icall.c: if the assembly name is a shadow-copied file, replace it
3858         with the original assembly path.
3859
3860         Bug #484244 fixed. NUnit tests for corlib can be run without
3861         --noshadow now.
3862
3863 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
3864
3865         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
3866         entries when the table is reallocated.
3867
3868         * icall.c: Allocate the memory used by the mono_ptr_array macros using
3869         mono_gc_alloc_fixed () since it contains GC refs.
3870
3871 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
3872
3873         * reflection.c (ensure_complete_type): New helper function to call
3874         type resolve handlers for unfinished dynamic types.
3875         (resolve_object): Call it for MonoClassFields. Fixes #483852.
3876
3877 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
3878
3879         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
3880         #483247.
3881
3882 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
3883
3884         * appdomain.c (get_shadow_assembly_location): Fix memleak.
3885
3886 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
3887
3888         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
3889         between GCHandles of type WeakTrackResurrection and the objects they
3890         point to.
3891
3892         * gc.c: Partly implement the sematics of GCHandles of type 
3893         WeakTrackResurrection: these handles should only be cleared after the
3894         finalizer of the object they are pointing to has ran.
3895
3896 2009-03-06  Mark Probst  <mark.probst@gmail.com>
3897
3898         * icall.c: Partially revert r126631 because using the jump
3899         trampolines for generic shared methods makes it superfluous.
3900
3901 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
3902
3903         * threads.c (handle_store): Create the 'threads' hash table with the proper
3904         MONO_HASH_VALUE_GC type.
3905
3906 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
3907
3908         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
3909         FIRST_GC_TRACKED.
3910
3911         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
3912         and LAST_GC_TRACKED as a GC root.
3913
3914         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
3915
3916         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
3917         the static data even if it consists of 1 reference.
3918
3919         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
3920         if there is a GC descriptor.
3921
3922         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
3923         instead of through the GC since they contain no object references.
3924
3925 2009-03-05  Mark Probst  <mark.probst@gmail.com>
3926
3927         * generic-sharing.c (instantiate_other_info): Always return a jump
3928         trampoline for method code.
3929
3930 2009-03-05  Marek Habersack  <mhabersack@novell.com>
3931
3932         * culture-info-tables.h: generated to include the en-tt culture.
3933
3934 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
3935
3936         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
3937         capture the thread context.
3938
3939         * object.c (mono_async_result_new): Cache the invoke wrappers to
3940         ExecutionContext::Capture.
3941
3942 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
3943
3944         * marshal.h: Add a prototype for what mono_compile_method returns
3945         for invoke wrappers.
3946
3947         * gc.c: Use the new prototype declaration.
3948
3949 2009-03-04  Geoff Norton  <gnorton@novell.com>
3950
3951         * boehm-gc.c: Add some MONO_LOG tracing for the GC
3952         * gc-internal.h:
3953         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
3954
3955 2009-03-04  Martin Baulig  <martin@ximian.com>
3956
3957         * mono-debug.h
3958         (mono_debugger_runtime_invoke): Removed.
3959
3960         * mono-debug-debugger.c
3961         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
3962
3963 2009-03-02  Martin Baulig  <martin@ximian.com>
3964
3965         * mono-debug.h
3966         (mono_debugger_unhandled_exception): Removed.
3967         (mono_debugger_handle_exception): Removed.
3968         (mono_debugger_throw_exception): Removed.
3969
3970         * mono-debug.c
3971         (mono_debug_debugger_version): Bump to 5.
3972
3973         * mono-debug-debugger.c: Moved the exception handling code to
3974         ../mini/debug-mini.c
3975
3976 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
3977
3978         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
3979         finalize_objects_hash.
3980
3981         * gc.c: Use the separate lock to access the finalize_objects_hash field.
3982         
3983         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
3984         field.
3985
3986         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
3987         cache.
3988
3989         * image.c (mono_image_close): Free it.
3990         
3991         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
3992         allowing a creation of a wrapper which invokes its method using a CALLVIRT
3993         on the this argument.
3994
3995         * gc.c (run_finalize): Optimize the calling of the finalizers.
3996
3997 2009-03-03  Martin Baulig  <martin@ximian.com>
3998
3999         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
4000         of the `MonoGenericInst' changes.
4001
4002 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
4003
4004         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
4005         mono_array_class_get_cached to reduce locking contention. Extract
4006         a domain var.
4007
4008         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
4009         intermediary managed arrays. Use caching version of mono_array_new
4010         to allocate the result array.
4011
4012         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
4013
4014         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
4015
4016         * locales.c (create_names_array_idx):  Use mono_array_new_cached
4017         to reduce locking contention.
4018
4019 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
4020                 
4021         * object.c (mono_method_add_generic_virtual_invocation): Put back the
4022         thunk builder code for the non-interface case.
4023
4024 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
4025
4026         * object.c (get_generic_virtual_entries): New helper function to collect
4027         the virtual generic method instances which need to be added to an IMT
4028         thunk.
4029         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
4030         Instead of creating a new IMT thunk, reset the vtable slot to the
4031         trampoline, the thunk will be created the next time the trampoline is called.
4032         (build_imt_slots): Add support for virtual generic methods in interfaces by
4033         adding to the IMT thunk all the methods registered using 
4034         mono_method_add_generic_virtual_invocation ().
4035
4036         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
4037         (struct _MonoIMTCheckItem): Ditto.
4038
4039         * object.c (mono_method_add_generic_virtual_invocation): Take a
4040         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
4041         the IMT thunk to include all items.
4042         
4043         * object.c (mono_class_create_runtime_vtable): Add a missing
4044         mono_loader_unlock ().
4045
4046 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4047
4048         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4049
4050         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
4051
4052 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4053
4054         * object-internals.h: Rename _MonoReflectionEvent to
4055         MonoReflectionMonoEvent so it reflects the right managed type.
4056         Add a MonoReflectionEvent that correctly represents System.EventInfo.
4057
4058         * icall.c:
4059         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
4060         type.
4061
4062 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
4063
4064         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
4065         intermediary managed arrays. Use caching version of mono_array_new
4066         to allocate the result array.
4067
4068 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4069
4070         * reflection.c: Use cached version of mono_array_new alongside
4071         the mono_reflection_get_custom_attrs_by_type call path.
4072
4073 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4074
4075         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
4076         intermediary managed arrays. Use caching version of mono_array_new
4077         to allocate the result array.
4078
4079         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
4080
4081 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
4082
4083         * icall.c: Add small implementation of a growable stack bound array.
4084
4085         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
4086
4087         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
4088         intermediary managed arrays. Use caching version of mono_array_new
4089         to allocate the result array.
4090
4091 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
4092
4093         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
4094         helps Enum::CompareTo to be implemented without reboxing all enums
4095         to their underlying type.
4096 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
4097
4098         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
4099         since it acquires a global lock leading to scalability problems.
4100
4101         * profiler.c: Make the stat profiler work with multiple appdomains, this
4102         currently only works when no appdomains are unloaded.
4103
4104 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
4105
4106         * appdomain.c: make the check to avoid copying when the assembly is
4107         already shadow copied actually work.
4108
4109 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
4110
4111         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
4112
4113         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
4114         changes to the managed side.
4115
4116 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
4117
4118         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
4119         classes + a separate lock for it, as it is used frequently at runtime, not
4120         just during metadata loading/JIT compilation.
4121
4122         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
4123         for szarrays.
4124         
4125         * object-internals.h (mono_class_from_name_cached): New macro to cache
4126         the results of the lookup locally without having to declare a static
4127         variable to hold it.
4128         (mono_class_get_field_from_name_cached): Ditto.
4129         (mono_array_class_get_cached): Ditto.
4130
4131         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
4132         the new macros.
4133         
4134         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
4135         slower search in metadata.
4136
4137         * pedump.c: Fix a warning.
4138
4139 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
4140
4141         * reflection.c (encode_locals): Add checks for user types.
4142         (method_encode_clauses): Ditto.
4143         (method_encode_code): Ditto.
4144         (mono_image_create_token): Ditto.
4145
4146         * object-internals.h: Change the type of more fields from MonoReflectionType*
4147         to MonoObject*.
4148
4149 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
4150
4151         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
4152         the a thread does not suspend within 100ms.
4153
4154         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
4155         in addition to StopRequested as well.
4156
4157         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
4158
4159         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
4160         search the method_hash before inserting a new entry, to avoid crashes when
4161         the same method is inserted multiple times, causing the old 
4162         MonoDebugMethodInfo structure to be freed by the value dtor function.
4163
4164 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
4165
4166         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
4167         SO_EXLUSIVEADDRUSE where available.
4168
4169 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
4170
4171         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
4172         runtime invoke wrappers, this time it is string ctor wrappers, which
4173         pass a dummy string as 'this' instead of their obj argument. Fixes
4174         #478473.
4175
4176 2009-02-21  Jb Evain  <jbevain@novell.com>
4177
4178         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
4179         only get create_culture once.
4180
4181 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
4182
4183         * reflection.c (mono_reflection_setup_internal_class): Move the user type
4184         check before the locking.
4185         
4186         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
4187         (mono_reflection_create_runtime_class): Ditto.
4188         (mono_reflection_sighelper_get_signature_local): Ditto.
4189         (mono_reflection_sighelper_get_signature_field): Ditto.
4190
4191         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
4192         is a System.MonoType object or similar.
4193         (monotype_cast): New helper function to cast a MonoObject to a 
4194         MonoReflectionType object.
4195
4196         * object-internals.h: Change MonoReflectionType* members in structures to
4197         MonoObject* members to force the usage of the monotype_cast () function.
4198
4199         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
4200         structures/arrays. This causes us to assert instead of crashing when 
4201         instances of user defined subclasses of System.Type are encountered.
4202
4203 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
4204
4205         * cil-coff.h:
4206         * icall-def.h:
4207         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
4208         win32 resource loaded from a PE file.
4209
4210         * image.c: fix mono_image_lookup_resource.
4211
4212 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
4213
4214         * icall-def.h:
4215         * threads-types.h:
4216         * threads.c: added internal call for WaitHandle.SignalAndWait.
4217
4218 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
4219
4220         * cominterop.c : Adding cominterop_type_from_handle and 
4221           registering it as an icall.  Replacing all references
4222           to type_from_handle.
4223
4224         Code is contributed under MIT/X11 license.
4225
4226 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
4227
4228         * Makefile.am: Add lock-tracer.h and lock-trace.c.
4229
4230         * appdomain.c: Call the tracer init function.
4231
4232         * domain-internals.h: Enable the tracer for the domain locks.
4233
4234         * image.c: Enable the tracer for image locks.
4235
4236         * loader.c: Enable the trace for the loader lock.
4237
4238         * lock-tracer.h:
4239         * lock-tracer.c: Initial implementation of the lock trace utility.
4240         The tracer requires a compile time define to be enabled and a env var
4241         to be enabled at runtime.
4242
4243 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
4244
4245         * domain.c (mono_domain_code_foreach): Improve documentation.
4246
4247 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
4248
4249         * appdomain.c:
4250         * generic-sharing.c:
4251         * object.c:
4252         * reflection.c:  Adjust locking order to the new semantics where the loader lock
4253         comes first.
4254
4255 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
4256
4257         * domain.c: Add mono_domain_code_* functions that perform locking
4258         around the domain codeman.
4259
4260         * domain-internals.h: Export those functions.
4261
4262         * object.c: Use new functions instead of acquiring the domain lock.
4263
4264 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
4265
4266         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
4267         delegate. Fixes #477396.
4268
4269 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
4270
4271         * reflection.c (create_custom_attr): Get rid of alloca.
4272
4273 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
4274
4275         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
4276           Adding exception handling for all CCW calls.
4277
4278         Code is contributed under MIT/X11 license.
4279
4280 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
4281
4282         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
4283
4284         * marshal.c (emit_marshal_boolean): Add null checks to the new 
4285         native->managed marshalling code. Fixes #476247.
4286
4287 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
4288
4289         * class.c (mono_class_get_vtable_entry): Move the addition of
4290         static rgctx invoke wrappers for vtable methods here, this simplifies
4291         a lot of code and causes fewer rgctx wrappers to be created.
4292
4293         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
4294         name of the statistics to begin with an uppercase.
4295
4296 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4297
4298         * reflection.c: Revert previous change as it breaks the build.
4299         
4300 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4301
4302         * verify.c: Properly handle SZARRAY element type.
4303
4304         Fixes #474271.
4305
4306 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
4307
4308         * reflection.c (mono_image_create_method_token): Correctly encode
4309         MethodDef MemberRefParent token.
4310
4311         Fixes #472845.
4312
4313 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
4314
4315         * image.c (mono_image_close): Delete the critical section before
4316         freeing the memory holding it.
4317
4318 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4319
4320         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
4321         Fixes #476257.
4322
4323 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4324
4325         * pedump.c (main): Call mono_marshal_init so pedump
4326         doesn't crash.
4327
4328 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4329
4330         * loader.c (method_from_memberref): Properly fix #474271 and
4331         don't break the runtime bad.
4332
4333 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
4334
4335         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
4336         (mono_domain_alloc0): Ditto.
4337
4338 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4339
4340         * loader.c (method_from_memberref): Don't abort if the array
4341         method is not found. A regular loader failure is more informative
4342         and correct.
4343
4344         Fixes #474271.
4345
4346 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
4347
4348         *loader.c: Guard MonoImage::method_cache/methodref_cache
4349         using the image lock instead of the loader lock.
4350
4351         * metadata.h: Add comments about which fields are protected by
4352         the image lock.
4353
4354 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
4355
4356         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
4357
4358         * generic-sharing.c (mono_method_construct_object_context): Remove the
4359         wrapper_type == NONE assert, it is not needed.
4360
4361 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
4362
4363         * reflection.c (clear_cached_object): New helper function.
4364         (mono_method_clear_object): New function to clear the cached reflection
4365         objects for a dynamic method.
4366
4367         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
4368         Partly fixes # 463323.
4369         
4370 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
4371
4372         * class.c:
4373         * loader.c:
4374         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
4375
4376 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
4377
4378         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
4379         take the image lock instead of the loader lock.
4380
4381         * metadata-internals.h: Export new functions.
4382
4383 2009-02-12  Miguel de Icaza  <miguel@novell.com>
4384
4385         * domain.c (app_config_parse): Remove another use of stat that is
4386         not necessary as g_file_get_contents already does the presence
4387         check. 
4388
4389 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
4390
4391         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
4392
4393         * marshal.c: Move the bstr handling code to cominterop.c.
4394
4395         * marshal.c: Remove some COM interop code missed previously.
4396
4397 2009-02-12  Miguel de Icaza  <miguel@novell.com>
4398
4399         More Paolo patches from the Wii port:
4400         
4401         * security.c: Remove ves_icall_System_Environment_get_UserName
4402         from here.
4403
4404         * icall.c: And put ves_icall_System_Environment_get_UserName
4405         here. 
4406
4407         * appdomain.c (mono_set_private_bin_path_from_config): Remove
4408         redundant call to stat that was only used to test for the file
4409         existence.   Patch from Paolo.
4410
4411         * gc.c (run_finalize): If COM is disabled, do not link in
4412         mono_marshal_free_ccw.
4413
4414         * generic-sharing.c: Use alloca.h here as well.
4415
4416 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
4417
4418         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
4419
4420 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
4421
4422         * cominterop.c cominterop.h: New files.
4423
4424         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
4425         function/typedefs which are needed by cominterop.c global.
4426
4427 2009-02-12  Mark Probst  <mark.probst@gmail.com>
4428
4429         * generic-sharing.c: Don't take the loader lock to guard image
4430         mempool allocs.
4431
4432 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4433
4434         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
4435         called without the loader lock which is required to guard MonoImage:tokens.
4436
4437 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4438
4439         * class.c:
4440         * metadata.c:
4441         * method-builder.c:
4442         * marshal.c:
4443         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
4444
4445 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4446
4447         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
4448         Rework the code to use regular mono_image_alloc/0.
4449
4450         * loader.c: Rework the code to use regular mono_image_alloc/0.
4451
4452         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
4453
4454 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
4455
4456         * object-internals.h : Fixing a typo in the 
4457           MonoReflectionComVisibleAttribute struct.
4458
4459         * marshal.c (cominterop_com_visible): Check the implemented 
4460           interfaces for ComImport.
4461
4462         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
4463           assume that bools should be treated as VARIANTBOOLs.
4464
4465         * marshal.c (emit_marshal_boolean): Adding cases for 
4466           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
4467
4468         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
4469           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
4470
4471         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
4472           should be treated as VARIANTBOOLs.    
4473
4474         Code is contributed under MIT/X11 license.
4475
4476 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4477
4478         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
4479         allocation with the image lock.
4480
4481 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4482
4483         This patch is the last of a series to remove explicit reference of MonoImage::mempool
4484         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
4485
4486         * object.c: Add mono_string_to_utf8_image.
4487
4488         * object-internals.h: Export mono_string_to_utf8_image.
4489
4490         * reflection.c: Rework all explicit references to the the image mempool to go thought
4491         the mono_image_alloc set of functions.
4492
4493 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4494
4495         This patch is the third of a series to remove explicit reference of MonoImage::mempool
4496         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
4497         and generics-sharing.c.
4498
4499         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
4500         as first argument. Note that this function remains broken as it doesn't perform locking around the
4501         mempool allocation.
4502
4503         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
4504
4505         * image.c: Add g_slist_append_image.
4506
4507         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
4508         the supplied image for allocation. Move code into mono_metadata_field_info_full.
4509
4510         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
4511         Fix all related code to do the same.
4512
4513         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
4514
4515         * metadata-internals.h: Fix the signatures.
4516
4517 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
4518
4519         This patch is the second of a series to remove explicit reference of MonoImage::mempool
4520         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
4521         and similar to work using MonoImage.
4522
4523         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
4524         MonoMemPool.
4525
4526         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
4527
4528         * class.c (mono_metadata_signature_deep_dup): Same.
4529
4530         * class.c (inflate_generic_type): Same.
4531
4532         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
4533
4534         * metadata.c (mono_metadata_signature_dup_full): Same.
4535
4536         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
4537         mono_metadata_signature_dup_full.
4538
4539         * metadata.c (mono_metadata_type_dup): Same.
4540
4541         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
4542
4543         * reflection.c: Same.
4544
4545         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
4546
4547         * metadata-internals.h: Fix the signatures.
4548
4549         * class-internals.h: Same.
4550
4551 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4552
4553         This patch is the first of a series to remove explicit reference of MonoImage::mempool
4554         and use mono_image_alloc set of functions instead. 
4555
4556         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
4557         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
4558         of a MonoMemPool.
4559
4560         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
4561
4562         * class.c (g_list_prepend_mempool): Removed.
4563
4564         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
4565
4566         * image.c: Add g_list_prepend_image.
4567
4568         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
4569
4570         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
4571
4572
4573 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4574
4575         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
4576         mono_image_unlock.
4577
4578         * image.c (mono_image_init): Init the lock field.
4579  
4580         * image.c (mono_image_init): Cleanup the lock field.
4581
4582         * image.c: Add mono_image_(un)lock functions.
4583
4584 2009-02-11  Mark Probst  <mark.probst@gmail.com>
4585
4586         * class.c, class-internals.h: mono_method_get_context_general()
4587         combines the functionality of mono_method_get_context() and
4588         mini_method_get_context().
4589
4590         * generic-sharing.c, domain-internals.h:
4591         mono_method_construct_object_context() and
4592         mono_domain_lookup_shared_generic() moved from mini.
4593
4594         * icall.c (ves_icall_InternalInvoke): Handle the case where the
4595         method doesn't have the correct instantiation because it's shared
4596         generic code.  Fixes #473999.
4597
4598 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
4599
4600         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
4601
4602         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
4603         
4604 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
4605
4606         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
4607
4608         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
4609
4610         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
4611         and recheck the cache for dups after it.
4612
4613         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
4614
4615         Fixes one of the deadlocks found in #473150.
4616
4617 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
4618
4619         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
4620           For Win32, add additional break conditions for accept.
4621
4622         Code is contributed under MIT/X11 license.
4623
4624 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
4625
4626         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
4627         lazily initialize the native wrapper cache.
4628         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
4629         cache, since they are different from the normal wrappers.
4630
4631         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
4632
4633         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
4634         AOT compiled native wrappers.
4635
4636 2009-02-09  Geoff Norton  <gnorton@novell.com>
4637
4638         * appdomain.h:
4639         * security-core-clr.c: Allow enabling core-clr from the embedding
4640         API.
4641
4642 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4643
4644         * socket-io.c: when requesting all the local ips, if there are no
4645         interfaces up and running, MS returns 127.0.0.1.
4646
4647 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4648
4649         * mono-perfcounters-def.h: processor time is an inverse time.
4650         Fixes bug #468625.
4651
4652 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
4653
4654         * socket-io.c: an empty host name returns the list of local IPs.
4655         Fixes bug #386637 part 1/2.
4656
4657 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
4658
4659         * verify.c (mono_class_interface_implements_interface): Call
4660         mono_class_setup_interfaces ().
4661         (merge_stacks): Ditto.
4662
4663 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
4664
4665         * class.c (mono_class_setup_interfaces): New function to lazily initalize
4666         klass->interfaces.
4667         (mono_generic_class_get_class): Don't initalize klass->interfaces.
4668         (mono_generic_class_get_class): Ditto.
4669
4670 2009-02-06  U-QUACK\miguel  <miguel@quack>
4671
4672         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
4673         they live in security.c
4674
4675         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
4676         another bit from Paolo's code.
4677
4678 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
4679
4680         * object.c (build_imt_slots): Add a small optimization to avoid inflating
4681         methods which will be discarded by add_imt_builder_entry ().
4682
4683         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
4684         need to be boxed.
4685
4686         * loader.c: Add a statistics for the size of the memberref signature cache.
4687         
4688         * loader.c (find_cached_memberref_sig): New helper function.
4689         (cache_memberref_sig): Ditto.
4690
4691         * loader.c: Cache the result of parsing memberref signatures, since otherwise
4692         they will be parsed again for every generic instantiation, leading to unbounded
4693         memory growth.
4694
4695 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4696
4697         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
4698         parameters of generic methods.
4699
4700         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
4701         after the original method is copied to the inflated method.
4702         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
4703
4704         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
4705         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
4706
4707         * class.c metadata.c: Update after the changes above.
4708
4709 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
4710
4711         * metadata-verify.c: Simplified error handling and added
4712         section table validation.
4713
4714 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4715
4716         * class-internals.h (MonoClassExt): New structure containing rarely used
4717         fields of MonoClass.
4718         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
4719         through a new 'ext' field.
4720
4721         * class.c (mono_class_alloc_ext): New helper function to allocate 
4722         class->ext.
4723
4724         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
4725
4726 2009-02-05  Mark Probst  <mark.probst@gmail.com>
4727
4728         * object.c (mono_object_get_virtual_method): Properly inflate
4729         generic methods.  Fixes #472692.
4730
4731 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
4732
4733         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
4734         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
4735         for the parent type, the created type must be ready to be used on a generic
4736         instantiation.
4737         We fill this_arg/byval_arg if the parent is a generic instance to make sure
4738         we won't have duplicated entries in generic_inst_cache.
4739
4740         Fixes #469553.
4741
4742 2009-02-05  Miguel De Icaza  <miguel@novell.com>
4743
4744         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
4745         replace with plain BSD per the comments on the bug MONO77637.
4746
4747 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
4748
4749         * class.c (mono_class_get_generic_class): New accessor function.
4750         (mono_class_get_generic_container): Ditto.
4751
4752         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
4753         fields, similar to the ones in MonoMethod.
4754
4755         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
4756         (mono_class_create_from_typedef): Set klass->is_generic if needed.
4757
4758         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
4759         
4760         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
4761         the same information as element_class->byval_arg.
4762
4763         * class.c reflection.c: Remove references to class->byval_arg.
4764
4765         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
4766         klass->enum_basetype directly.
4767
4768         * verify.c metadata.c object.c icall.c reflection.c: Use 
4769         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
4770         directly.
4771
4772 2009-02-04  Miguel de Icaza  <miguel@novell.com>
4773
4774         * icall-def.h: Remove internal calls for sockets when
4775         DISABLE_SOCKET is defined, file system writing features when the
4776         OS only support reading and not writing data and Policy support if
4777         the Policy is disabled.
4778         
4779         * image.c (do_mono_image_open): Apply Paolo's patches for using
4780         mono_file_map_ APIs here.
4781
4782         * assembly.c: Add support for platforms to avoid prefix
4783         auto-detection. 
4784
4785 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
4786
4787         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
4788         warning.
4789
4790         * class.c (mono_class_inflate_generic_class): New helper function.
4791
4792         * class.c: Use mono_class_inflate_generic_class in a few places. Add
4793         statistics for inflated methods/classes.
4794
4795         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
4796
4797         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
4798         the call is made from Delegate.CreateDelegate () for the invoke method of
4799         a delegate.
4800
4801         * loader.c: Add a statistics for the memory occupied by inflated signatures.
4802
4803         * metadata.c (mono_metadata_signature_size): New helper function.
4804
4805         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
4806         generic instances.
4807
4808         * metadata.c (inflated_method_in_image): Avoid calling 
4809         mono_method_signature () if the method does not already have a signature.
4810
4811 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4812
4813         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
4814         valuetype is compatible with target type, check by inheritance as a
4815         VT is not really compatible with System.ValueType, for example.
4816
4817         * verify.c (do_invoke_method): Improve error message.
4818
4819         * verify.c (do_box_value): If boxing a nullable, use the type argument
4820         on stack instead.
4821
4822         * verify.c (do_newobj): Improve error message.  
4823
4824         Fixes #469549.
4825
4826 2009-02-03  Miguel de Icaza  <miguel@novell.com>
4827
4828         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
4829
4830 2009-02-03  Mark Probst  <mark.probst@gmail.com>
4831
4832         * generic-sharing.c: Don't hold domain lock when calling
4833         instantiate_other_info().  Fixes #471958.
4834
4835         * domain-internals.h, loader.c: Describe locking policy of domain
4836         lock vs loader lock.
4837
4838 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4839
4840         * verify.c (mono_delegate_signature_equal): Make it possible to check
4841         first-arg-bound delegates to static method.
4842
4843         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
4844         static methods with the first arg bound.
4845
4846         Fixes #469529.
4847
4848 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4849
4850         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
4851         errors.
4852
4853         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
4854         under strict mode. Any type, when boxed can be seen as a reference type.
4855
4856         Fixes #469528.
4857
4858 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
4859
4860         * object.h: The lower bound of an array is a signed integer value.
4861         Introduce mono_array_lower_bound_t typedef. It should be used instead of
4862         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
4863
4864         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
4865         calculate the upper bound.
4866         
4867         Fixes #471252.
4868
4869 2009-02-02  Miguel de Icaza  <miguel@novell.com>
4870
4871         From Paolo's work, refactored, cleared up:
4872         
4873         * threadpool.c, icall.c: ifdef code that requires a working socket
4874         stack.
4875
4876         * metadata.c (mono_metadata_field_info): Do not attempt to return
4877         a value from a function declared as void.
4878
4879         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
4880         from the console stack.
4881
4882         * assembly.c: use strrchr instead of rindex.
4883
4884         * class.c, object.c, marshal.c, icall.c, reflection.c: include
4885         alloca.h on systems that have it.
4886
4887         * environment.c: Avoid code that uses stuff from
4888         HAVE_SYS_UTSNAME_H
4889         
4890         * appdomain.c: Include sys/time.h.
4891
4892         * console-io.c: include sys/ioctl.h if it is available.
4893
4894 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
4895
4896         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
4897
4898         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
4899         the method builder.
4900
4901         * marshal.c: Set mb->skip_visibility instead of setting it on the method
4902         after it was created and cached, as the later is not thread safe.
4903         
4904 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
4905
4906         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
4907         called while the debugging module is not initialized. Fixes #471669.
4908
4909 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
4910
4911         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
4912
4913         Fixes #471255.
4914
4915 2009-02-02  Mark Probst  <mark.probst@gmail.com>
4916
4917         * generic-sharing.c (lookup_or_register_other_info): Make sure the
4918         loader lock is not taken while the templates lock is held.  Fixes
4919         #471089.
4920
4921 2009-02-02  Mark Probst  <mark.probst@gmail.com>
4922
4923         * metadata.c (type_in_image): Added a check to fix a monodis
4924         crash.
4925
4926 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
4927
4928         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
4929         nullable arguments.
4930
4931         * object.c (mono_runtime_invoke_array): Ditto.
4932         
4933         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
4934         freeing wrappers of dynamic methods.
4935
4936         * loader.c (mono_free_method): Call it. Fixes #463323.
4937         
4938         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
4939         methods taking vtype/byref arguments, to fix yet another bug caused by
4940         the sharing of runtime invoke wrappers. Partly fixes #471259.
4941
4942 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
4943
4944         * debug-mono-symfile.c (check_line): Return NULL instead of returning
4945         <first file in file table>:1 when the IL offset does not have an associated
4946         line number.
4947
4948 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
4949
4950         * mono-debug.c (mono_debug_lookup_locals): New function to return local
4951         variable info for a method.
4952
4953         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
4954         
4955 2009-01-30  Jb Evain  <jbevain@novell.com>
4956
4957         * pedump.c: reuse code from monodis to make sure pedump honors
4958         MONO_PATH, which is needed to verify net_2_1 assemblies.
4959
4960 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
4961
4962         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
4963         there is no line number info.
4964
4965 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
4966
4967         Avoid some MonoType allocations
4968         * reflection.c (mono_reflection_initialize_generic_parameter):
4969         Reuse MonoType from param->pklass rather than allocating one.
4970         (mono_dynamic_image_free): Update to changes.
4971
4972 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
4973
4974         Rearrange some code to improve consistency
4975         * reflection.c (mono_reflection_setup_generic_class): Move body ...
4976         (mono_reflection_initialize_generic_parameter): ... here.
4977
4978 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
4979
4980         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
4981         with type constraints as an experiment.
4982
4983         * boehm-gc.c (on_gc_notification): Update mono_stats.
4984
4985 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
4986
4987         Avoid some allocations
4988         * class-internals.h (_MonoGenericInst::type_argv): Convert from
4989         pointer to tail array to avoid extra allocation.
4990         * metadata.c (free_generic_inst): Update to changes.
4991         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
4992         on-stack struct.
4993
4994 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
4995
4996         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
4997         return TRUE if the two type objects are the same.
4998
4999 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5000
5001         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
5002         (mono_class_native_size): Use klass->marshal_info->min_align instead of
5003         klass->min_align, since klass->min_align contains the managed alignment,
5004         while the native alignment can be different, like for longs on x86.
5005         Fixes #469135.
5006
5007         * class-internals.h (MonoMarshalType): Add a min_align field.
5008
5009 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
5010
5011         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
5012         the 1.0 format.
5013
5014 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
5015
5016         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
5017         some comments about the usage of the used_regs field.
5018
5019         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
5020         Fixes #469217.
5021
5022 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
5023
5024         * appdomain.c: return NULL instead of throwing FileNotFoundException
5025         when LoadAssembly() fails.
5026
5027 2009-01-23  Mark Probst  <mark.probst@gmail.com>
5028
5029         * metadata.c (mono_metadata_generic_param_equal): Only compare the
5030         image if the owner is NULL.  Fixes the AOT failures.
5031
5032 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
5033
5034         * metadata.c (mono_metadata_load_generic_params): Initialize the 
5035         MonoGenericParam structure using memset so the image field is initialized
5036         as well.
5037
5038 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5039
5040         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
5041         a plain store.
5042
5043 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
5044
5045         * class.c (mono_class_setup_vtable_general): In the generic instance
5046         optimization, set method->slot for abstract virtual methods. Fixes part of
5047         #467834.
5048
5049 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
5050
5051         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
5052         which signals that the unloading has started but all appdomain services must
5053         remain operational.
5054
5055         * appdomain.c (mono_domain_unload): The initial state for unloading now
5056         is unloading_start and we switch to unloading after the managed call to
5057         AppDomain::DomainUnload has finished.
5058
5059         The new unloading state has to be created because managed code in the
5060         DomainUnload event can depend on things like the threadpool still working.
5061         The domain must remain fully functional while the event executes.
5062
5063         This shown as an issue due to Process::WaitForExit, which waits for
5064         async reads of stdout and stderr to complete. Since those are processed
5065         in the threadpool the code deadlocks because the DomainUnload callback 
5066         waits for the async read finished event, which should have been set by a
5067         threadpool job but has been discarded due to the domain been in unload
5068         state.
5069
5070 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5071
5072         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
5073         image must match.
5074
5075 2009-01-21  Mark Probst  <mark.probst@gmail.com>
5076
5077         * reflection.c (resolve_object): For fields, inflate the class and
5078         then get the field in the inflated class.
5079
5080 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5081
5082         * object-internals.h (struct _MonoException): Added a comment
5083         explaining the new use of trace_ips.
5084
5085 2009-01-20  Mark Probst  <mark.probst@gmail.com>
5086
5087         * generic-sharing.c (inflate_other_data): Inflate array methods
5088         correctly.
5089
5090         * loader.c, class-internals.h: Rename search_in_array_class() to
5091         mono_method_search_in_array_class() and make it non-static.
5092
5093 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5094
5095         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
5096         Hopefully fixes #458168.
5097
5098 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5099
5100         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
5101         as it is performed elsewhere.
5102
5103         Code is contributed under MIT/X11 license
5104
5105 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
5106
5107         * mono-perfcounters-def.h: Add counters for asp.net requests total and
5108         requests queued.
5109         * object.c (mono_raise_exception): Increment the exceptions total
5110         counter when an exception is thrown.
5111         * class-internals.h: Add a location for storing the total number of
5112         asp.net requests served.
5113         * mono-perfcounters.c: Implement update support for asp.net counters
5114         from the class libraries. Implement read support for asp.net counters
5115         and exceptions total counter.
5116
5117 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
5118
5119         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
5120         accessing klass->methods. Fixes #467385.
5121
5122 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5123
5124         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
5125         for byval arguments without an [Out] attribute. Fixes #467212.
5126
5127         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
5128         Fix compilation under android.
5129         
5130         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
5131         processed, scan them directly after they are copied, to achieve better locality
5132         and cache usage.
5133
5134         * socket-io.c: Applied patch from Koushik Dutta
5135         (koush@koushikdutta.com). Disable IPV6 when running under android.
5136
5137 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
5138
5139         * icall.c (ves_icall_InternalExecute): Add write barriers.
5140
5141         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
5142         the GC code.
5143
5144         * sgen-gc.c: Implement write barriers in IL code.
5145
5146 2009-01-17  Geoff Norton  <gnorton@novell.com>
5147
5148         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
5149
5150 2009-01-17  Geoff Norton  <gnorton@novell.com>
5151
5152         * image.c: When unloading the image->references table, there can be gaps
5153         in it.  Ensure that we iterate every entry to avoid leaking assembly references
5154         when unloading an appdomain.
5155
5156 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
5157
5158         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
5159         speed up ptr-in-nursery checks.
5160
5161         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
5162         threads_lock () to prevent deadlocks.
5163
5164         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
5165         does not need to be scanned during minor collections, since writes to it
5166         must use write barriers.
5167
5168 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
5169
5170         * metadata-verify.c: Add pe nt header verification.
5171         
5172 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
5173
5174         * gc.c: Fix a few warnings when using SGEN.
5175
5176 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
5177
5178         * metadata-verify.c: Add pe optional header verification.
5179
5180 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
5181
5182         * sgen-gc.c: Add support for user defined marker functions, used by
5183         MonoGHashTable to avoid registering a GC root for every hash node.
5184
5185 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
5186
5187         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
5188         non-pinned roots into separate hashes to avoid having to traverse them
5189         in functions which are only interested in one kind.
5190
5191 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
5192
5193         * metadata-verify.c: Add pe header machine field verification.
5194         
5195 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
5196
5197         * metadata-verify.c: Add pe header size verification.
5198
5199 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
5200
5201         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
5202         using the GC, they don't contain references.
5203
5204         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
5205
5206 2009-01-13  Geoff Norton  <gnorton@novell.com>
5207
5208         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
5209         AppDomains created on the native side can be cleaned up on the native side.
5210
5211 2009-01-13  Geoff Norton  <gnorton@novell.com>
5212
5213         * appdomain.c: Ensure that we call mono_context_init for the embedding api
5214         as well as the managed api.
5215
5216 2009-01-13  Geoff Norton  <gnorton@novell.com>
5217
5218         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
5219         with a MonoAppDomain initialized against it.
5220
5221 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
5222
5223         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
5224         
5225         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
5226
5227         * marshal.c: Avoid setting the exception clauses after a method has been entered 
5228         into the wrapper caches. Fixes #465700.
5229
5230         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
5231         method builder.
5232         (mono_mb_create_method): Set the clauses from the method builder.
5233
5234 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5235
5236         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
5237         Patch from Makoto Kishimoto.
5238
5239 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
5240
5241         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
5242         encoding them as ROOT_DESC_COMPLEX.
5243         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
5244
5245 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
5246
5247         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
5248         no longer point to the nursery.
5249
5250         * sgen-gc.c: Add a few comments/FIXMEs.
5251         
5252         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
5253
5254         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
5255         initialization of the various _method variables thread safe. Fixes
5256         #465377.
5257
5258 2009-01-12  Mark Probst  <mark.probst@gmail.com>
5259
5260         * domain.c, domain-internals.h: Remove the shared_generics_hash
5261         and its lookup functions.
5262
5263 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
5264
5265         * socket-io.c:  Fixing the MSVC build. 
5266
5267         Code is contributed under MIT/X11 license.
5268
5269 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
5270
5271         * metadata-verify.c: Add pe header watermark verification.
5272
5273 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5274
5275         * metadata-verify.c: Add lfanew verification.
5276
5277 2009-01-12  Jb Evain  <jbevain@novell.com>
5278
5279         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
5280         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
5281
5282 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
5283
5284         * socket-io.c: Fix the build.
5285
5286         * environment.c: Fix an #ifdef.
5287
5288 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5289
5290         * threadpool.c (async_invoke_thread): Handle the wait function returning
5291         WAIT_IO_COMPLETION as well.
5292         (async_invoke_io_thread): Ditto.
5293
5294 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
5295
5296         * threads.c: Fixing the Windows build.
5297
5298         Code is contributed under MIT/X11 license.
5299
5300 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5301  
5302         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
5303         interrupt a wait.
5304         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
5305         the thread to wait again.
5306
5307 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5308
5309         * metadata-verify.c: Initial skeleton of the metadata verifier.
5310
5311         * pedump.c: Add support for the metadata verifier.
5312
5313         * verify-internal.h: Export the whole assembly metadata verifier function.
5314
5315 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
5316
5317         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
5318
5319 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
5320
5321         * Makefile.am: Upgrade dtrace-prelink.sh location.
5322
5323 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
5324
5325         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
5326         well. Otherwise the shutdown deadlock that happens on unix will can happen
5327         as well.
5328         If the main thread code finishes too fast it's possible that the finalizer
5329         thread won't have executed yet, won't record itself as the finalizer thread
5330         and the shutdown sequence will wait on it forever.
5331
5332 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
5333
5334         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
5335         with MSVC.
5336
5337 2009-01-08  Miguel de Icaza  <miguel@novell.com>
5338
5339         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
5340         Robert Jordan for pointing this out.
5341
5342 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
5343
5344         * icall.c
5345         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
5346         ves_icall_System_IO_DriveInfo_GetDriveType.
5347
5348 2009-01-07  Miguel de Icaza  <miguel@novell.com>
5349
5350         * icall.c: Wrap calls to mono_strtod in CriticalSection
5351         invocations when using eglib, to work around #464316.
5352
5353 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
5354
5355         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
5356         return value of GetCurrentDirectory to never access unitialized memory.
5357
5358 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
5359
5360         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
5361         return value of GetCurrentDirectory and expand the buffer if needed.
5362
5363         Fixes #459094.
5364
5365 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
5366
5367         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
5368           Adding a call to mono_init_com_types.
5369
5370         Code is contributed under MIT/X11 license.
5371
5372 2009-01-07  Geoff Norton  <gnorton@novell.com>
5373
5374         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
5375         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
5376         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
5377         be the value of the ip buffer.
5378
5379 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5380
5381         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
5382         interfaces_packed here.
5383
5384         Fixes part of #463294.
5385
5386 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5387
5388         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
5389
5390         Fixes part of #463294.
5391
5392 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5393
5394         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
5395         is a boxed complex as well.
5396
5397         Fixes part of #463294.
5398
5399 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
5400
5401         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
5402         control if a methodspec should be created for the generic method definition from external assemblies.
5403         Caching of methodspec is done using the handleref hash table.
5404
5405         Fixes #462592.
5406
5407 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
5408
5409         * loader.c (find_method): When searching the interfaces of a class
5410         check the transitive closure of implemented interfaces.
5411
5412         Fixes #463303.
5413
5414 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
5415
5416         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
5417         
5418 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
5419
5420         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
5421         interfaces calculation to fill_valuetype_array_derived_types.
5422
5423         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
5424         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
5425         for example.
5426
5427         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
5428         interfaces for valuetypes if needed.    
5429
5430         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
5431         for their basetype as well. Types are array expanded if rank is > 0.
5432
5433         Fixes #400716.
5434
5435 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
5436
5437         * socket-io.h : Changing the signature of
5438           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
5439           the blocking state.
5440
5441         * icall-def.h :  Changing the signature of
5442           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
5443
5444         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
5445           For Windows only.  Avoid blocking when calling accept by
5446           querying for a connection via select.  The loop also queries
5447           the thread state every 1000 micro seconds for the thread
5448           stop state.  This will avoid the process hanging on shutdown
5449           when using a TcpChannel that is never connected to.
5450
5451         Code is contributed under MIT/X11 license.
5452
5453 2008-12-30  Marek Safar  <marek.safar@gmail.com>
5454
5455         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
5456
5457 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
5458
5459         * class.c (get_implicit_generic_array_interfaces): Extract common
5460         code to a helper function making it a lot easier on the eyes.
5461
5462 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
5463
5464         * class.c (get_implicit_generic_array_interfaces): If the internal
5465         enumerator is an interface inflate System.Object instead of itself.
5466
5467         Fixes #461261.
5468
5469 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
5470
5471         * object.c (mono_runtime_invoke_array): Don't assert with
5472         byref nullable types.
5473
5474         * marshal.c (mono_marshal_get_runtime_invoke): To handle
5475         byref nullables we unbox the object and store it on the
5476         stack. 
5477         We can't use the boxed object since it is the T of Nullable<T>
5478         and the boxed representation of a nullable it's underlying type
5479         or null.
5480         We could cheat and create a boxed nullable and use the same
5481         machinery of other byref VTs but this feels like a hack and
5482         using the stack has the bonus of reducing heap pressure.
5483
5484         Fixes #461941.
5485
5486 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
5487
5488         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
5489         return value.
5490
5491         Fixes #461867.
5492
5493 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
5494
5495         * icall-def.h : Adding an internal call definition for 
5496           System.Environment.internalBroadcastSettingChange.
5497
5498         * icall.c : Adding a Windows only implementation to broadcast a 
5499           WM_SETTINGCHANGE when an environment variable has changed.
5500
5501         Code is contributed under MIT/X11 license.
5502
5503 2008-12-19  Mark Probst  <mark.probst@gmail.com>
5504
5505         * class.c, class-internals.h: Made
5506         mono_class_has_parent_and_ignore_generics() non-static.
5507
5508 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
5509
5510         * image.c: deal with the mmap failing when loading an image.
5511
5512 2008-12-17  Geoff Norton  <gnorton@novell.com>
5513
5514         * threadpool.c: Ensure that the io_queue_lock is initialized
5515         in all circumstances, as we always attempt to cleanup against it.
5516
5517 2008-12-17  Miguel de Icaza  <miguel@novell.com>
5518
5519         * icall.c (ves_icall_System_Environment_get_Platform): For
5520         compatibility reasons for existing client code we will keep
5521         returning 4 for a while.   
5522
5523         For how long will depend on the documentation being updated, and
5524         for us to give client code a chance to be updated.
5525
5526         This reverts the original decison on #433108 since we did not
5527         catch roughly 33 instances of the broken code in our own source
5528         code base, we did not catch failures on the buildbots, and QA did
5529         not bring this as a problem.
5530
5531         Only today I found some customer's code breaking due to our own
5532         class libraries not being fully updated and tracked it down to
5533         this change.  I am reverting it because if we could not even get
5534         our story straight in our own code base, how can we hope that our
5535         end user code be fixed?
5536
5537         As of this morning, our Wiki page that documents how to detect
5538         Unix had not been fixed.    
5539
5540 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
5541
5542         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
5543
5544         * class.c (mono_class_get_fields): Handle loading errors.
5545
5546 2008-12-12 Mark Mason <mmason@upwardaccess.com>
5547
5548         * 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.
5549         
5550 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
5551
5552         * mono-perfcounters.c: avoid warning.
5553
5554 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5555
5556         * reflection.c (ensure_runtime_vtable): Work on generic instances and
5557         make sure all interfaces have MonoClass::interface_id set.
5558
5559         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
5560         method table is property set.
5561
5562 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5563
5564         * class.c: New function mono_class_setup_interface_id that setup
5565         MonoClass::interface_id if needed.
5566
5567         * class-internals.h: Export new function.
5568
5569 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
5570
5571         * class.c: Add code to sanity check the vtable after setup_vtable_general
5572         has done it's work.
5573
5574 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
5575
5576         * icall.c: make Assembly.GetExecutingAssembly work properly when
5577         reflection is used to invoke the method.
5578         Bug #321781 fixed.
5579
5580 2008-12-11  Mark Probst  <mark.probst@gmail.com>
5581
5582         * metadata/generic-sharing.c: Look for constraints in all type
5583         arguments, not just the first one.
5584
5585 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
5586
5587         * appdomain.c: return the correct CodeBase for an Assembly instance
5588         that was loaded from the shadow-copy directories.
5589         Bug #458190 fixed.
5590
5591 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
5592
5593         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
5594
5595         * sgen-gc.c (check_object): New debugging helper function.
5596
5597         * object.c: Fix calls to mono_value_copy_array ().
5598
5599 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5600
5601         * class.c (mono_class_setup_fields): If working on an inflated class
5602         first check if the generic definition did init with success.
5603
5604         Fixes #445361.
5605
5606 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5607
5608         pedump.c (main): Fix a warning.
5609
5610 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
5611
5612         * object-internals.h : Adding a definition for 
5613           MonoReflectionComVisibleAttribute.
5614
5615         * marshal.c (cominterop_com_visible) :  Method added to check the 
5616           ComVisible attribute of a class.
5617
5618         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
5619           cominterop_raise_hr_exception added to consolidate common code 
5620           to raise hr exceptions.
5621
5622         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
5623           if a managed class should support IDispatch.
5624
5625         * marshal.c 
5626           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
5627           Added additional checks for managed object when getting 
5628           an IDispatch interface.
5629
5630         Code is contributed under MIT/X11 license.
5631
5632 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
5633
5634         pedump.c (main): Handle mono_get_method () returning NULL. 
5635
5636 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
5637
5638         * marshal.h: Fix a warning.
5639
5640 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
5641
5642         * marshal.c : Adding cominterop_release_all_rcws to release all
5643           runtime callable wrappers held by the runtime.
5644
5645         * marshal.h : Adding declaration for cominterop_release_all_rcws.
5646           
5647         Code is contributed under MIT/X11 license.
5648
5649 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
5650
5651         * metadata.c (mono_image_alloc_lock): New helper function.
5652         (mono_image_alloc0_lock): Ditto.
5653
5654         * metadata.c: Use the alloc_lock () helper functions for allocating
5655         memory from the image mempool.
5656
5657 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
5658
5659         * class.c (mono_class_from_generic_parameter): Document it's
5660         locking behavior. Fix double checked locking here, we stored in
5661         param->pklass a partially initialized MonoClass and no membar was used.
5662
5663 2008-12-05  Marek Habersack  <mhabersack@novell.com>
5664
5665         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
5666         (3) functions are present in the C library use them to do the
5667         job. If they are absent, make sure that the sum of int_part and
5668         dec_part is rounded before returning. This is necessary due to the
5669         division of dec_part by the power of 10 before the final addition
5670         is performed - if the result is not rounded in some cases it will
5671         yield invalid results.
5672
5673 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
5674
5675         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
5676         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
5677         instruction instead of a pointer constant.
5678
5679 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
5680
5681         * loader.c (mono_method_get_header): Do most of the work outside the
5682         loader lock, to avoid assembly load hook deadlocks.
5683
5684         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
5685         (mono_metadata_parse_type_full): Ditto.
5686
5687 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
5688
5689         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
5690         Make the stack depth fixed. Ensure proper argument passing to the backtrace
5691         funtions. Finally, use a lock to produce well ordered output.
5692
5693         The lock looks silly, as all calls to the corlib mempool should be guarded
5694         with the loader lock, but for some reason this fact doesn't help. 
5695
5696         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
5697
5698 2008-12-02  Mark Probst  <mark.probst@gmail.com>
5699
5700         * socket-io.c: 64 bit big-endian fixes.
5701
5702 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
5703
5704         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
5705         targets that require strict compatibility between the types.
5706
5707         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
5708         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
5709         Kill the strict argument and create a new one valuetype_must_be_boxed.
5710
5711         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
5712         state that all valuetypes must be boxed.
5713
5714         Fixes #448560.
5715
5716 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
5717
5718         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
5719         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
5720
5721         Contributed under MIT/X11 license.
5722
5723 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
5724
5725         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
5726         the inflate_generic_type machinery should handle it.
5727
5728         This avoids a crash when the field's flags is zero and it's type is
5729         a primitive.
5730         What happens is that mono_metadata_parse_type_full will see that opt_attrs
5731         is zero and will return one of the cached built-in primitive types. Since
5732         those types live in read-only memory, the code that copies it crashes.  
5733
5734 2008-11-28  Mark Probst  <mark.probst@gmail.com>
5735
5736         * object.c: Don't put function descriptors into generalized IMT
5737         thunks.
5738
5739 2008-11-28  Mark Probst  <mark.probst@gmail.com>
5740
5741         * class.c: Enable generic code sharing on PPC64.
5742
5743 2008-11-27  Mark Probst  <mark.probst@gmail.com>
5744
5745         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
5746         from mini/mini.c.
5747
5748         * generic-sharing.c: Allocate the method template slists from the
5749         image mempool so it doesn't leak.
5750
5751 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
5752
5753         * class.c (generic_array_methods): Release the linked list.
5754
5755 2008-11-27  Mark Probst  <mark.probst@gmail.com>
5756
5757         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
5758         invocation to g_utf16_to_utf8().
5759
5760 2008-11-26  Mark Probst  <mark.probst@gmail.com>
5761
5762         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
5763         arguments on big endian archs.
5764
5765 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
5766
5767         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
5768         the type name (test added in corlib).
5769
5770 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
5771
5772         * pedump.c: initialize perf. counters. Fixes a segv.
5773
5774 2008-11-25  Martin Baulig  <martin@ximian.com>
5775
5776         * mono-debug-debugger.c
5777         (mono_debugger_runtime_invoke): Return the exception object if an
5778         exception was thrown.  Visual Studio displays the exception object
5779         in the locals window.
5780
5781 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5782
5783         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
5784         ftnptr.
5785
5786 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5787
5788         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
5789         MONO_TYPE_U are sizeof (gpointer), too.
5790
5791 2008-11-24  Mark Probst  <mark.probst@gmail.com>
5792
5793         * marshal.c (mono_type_native_stack_size): Fixed size and
5794         alignment for reference types.
5795
5796 2008-11-23  Mark Probst  <mark.probst@gmail.com>
5797
5798         * class.c (mono_class_generic_sharing_enabled): Disable generic
5799         code sharing for PPC64.
5800
5801 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
5802
5803         * icall.c (mono_method_get_equivalent_method): Make sure
5804         method->klass->methods is inited before looping over it.
5805
5806 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
5807
5808         * object.c: when calling ExecuteAssembly in a newly created domain,
5809         the configuration file and application base are already set up.
5810         Bug #446353 take 2 fixed.
5811
5812 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
5813
5814         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
5815         Fixes #444715. Fix a warning.
5816
5817 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
5818
5819         * appdomain.c: write the full path of the assembly to the .ini file
5820         created when "shadow-copying"
5821         Bug #446353 fixed.
5822
5823 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
5824
5825         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
5826         if signature==FALSE.
5827
5828 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
5829
5830         * marshal.h : Fix the cygwin build.
5831            marshal.c:12442: undefined reference to `_IID_IMarshal'
5832           
5833         Code is contributed under MIT/X11 license.
5834
5835 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
5836
5837         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
5838           free threaded marshaler when QueryInterface is called on a COM callable
5839           wrapper requesting the IMarshal interface.
5840           
5841         Code is contributed under MIT/X11 license.
5842
5843 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
5844
5845         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
5846
5847         * reflection.c (mono_type_get_object): Special case the very common
5848         void type.
5849
5850         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
5851         hold typeof(void).
5852
5853 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
5854
5855         * process.h : Adding method declaration for
5856           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5857           
5858         * process.c : Adding implementation for
5859           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5860           
5861         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
5862           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
5863
5864         Code is contributed under MIT/X11 license.
5865
5866 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
5867
5868         * appdomain.c (unload_thread_main): Clean up threadpool by
5869         calling mono_thread_pool_remove_domain_jobs.
5870
5871         * domain-internals.h (struct _MonoDomain): Add new fields to
5872         help coordinate the cleanup of the threadpool.
5873
5874         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
5875         that cleans up the threadpool of all jobs associated with an appdomain.
5876         It does that by cleaning up the queues and making sure all active
5877         threads are accounted.
5878
5879         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
5880         unloaded or in the process of. Take this is such way that there is
5881         no race condition between another thread starting the unload and the
5882         current thread acknowledging it.
5883
5884         * threadpool.c (async_invoke_thread): Same.
5885
5886         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
5887         firing the new thread.
5888
5889         * threadpool.c (start_tpthread): Same.
5890
5891         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
5892
5893         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
5894
5895 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
5896
5897         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5898         Add support for DuplicateHandle.
5899         
5900         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5901         Add support for DuplicateHandle.
5902         
5903         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
5904         Add support for DuplicateHandle.
5905
5906         Code is contributed under MIT/X11 license.
5907
5908 2008-11-06  Mark Probst  <mark.probst@gmail.com>
5909
5910         * class-internals.h: Make min_align into a whole byte.
5911
5912         * class.c: Set min_align for SIMD types to 16.
5913
5914 2008-11-05  Geoff Norton  <gnorton@novell.com>
5915
5916         * attach.c: Default the attacher to enabled for all cases including
5917         embedded.
5918
5919 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
5920
5921         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
5922         change r117650.
5923
5924 2008-11-04  Mark Probst  <mark.probst@gmail.com>
5925
5926         * monitor.c, monitor.h: New function for querying offsets of
5927         members of MonoThreadsSync.
5928
5929 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
5930
5931         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
5932         to speed up this function and to avoid the boundless memory growth caused by
5933         the signature_dup () calls.
5934
5935 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
5936
5937         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
5938         wrapper.
5939
5940         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
5941         by 1 bit.
5942
5943         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
5944
5945 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5946
5947         * appdomain.c:
5948         * domain-internals.h: made mono_set_private_bin_path_from_config()
5949         "internal".
5950         * object.c: call the above function after setting the configuration
5951         file path for the root domain.
5952         Fixes bug #314478.
5953
5954 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5955
5956         * assembly.c: when the assembly is loaded from an absolute path, end
5957         basedir with a directory separator.
5958         Bug #440781 fixed.
5959
5960 2008-10-30  Mark Probst  <mark.probst@gmail.com>
5961
5962         * monitor.c (mono_monitor_get_fast_enter_method): If
5963         CompareExchange is not available, don't create the fastpath
5964         instead of asserting.  (The method is missing in the 1.1 profile.)
5965
5966 2008-10-30  Mark Probst  <mark.probst@gmail.com>
5967
5968         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
5969
5970         * monitor.c, monitor.h: Code for generating Monitor.Enter and
5971         Monitor.Exit IL fastpaths.
5972
5973 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
5974
5975         * class.c (mono_class_create_from_typedef): Added Vector2ul.
5976
5977 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
5978
5979         * class.c (mono_class_create_from_typedef): Added Vector2l.
5980
5981 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
5982
5983         * class.c (mono_class_create_from_typedef): Added Vector2d.
5984
5985 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5986
5987         * appdomain.c: translate \ into / for cache_path.
5988         * domain-internals.h: new mono_is_shadow_copy_enabled().
5989         * icall.c: (fill_reflection_assembly_name) do the same path
5990         manipulations that get_code_base does.
5991         (get_code_base) use mono_is_shadow_copy_enabled.
5992
5993 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
5994
5995         * appdomain.c: shadow-copied assemblies go to CachePath +
5996         ApplicationName when both are set. DynamicBase has nothing to do with
5997         shadow copies.
5998         Bug #406877 fixed.
5999
6000 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
6001
6002         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
6003         STANDALONESIG table.
6004
6005         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
6006         standalone signatures.
6007
6008         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
6009         comparison code: instead of comparing the signatures using a custom
6010         equals function, transform them to a common signature and compare that. This
6011         works better with AOT.
6012
6013 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
6014
6015         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
6016
6017         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
6018         call for generic instances.
6019         (mono_class_setup_properties): Call setup_properties () before accessing
6020         gklass->properties.
6021
6022         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6023         over the virtual methods of a class using metadata if possible, avoiding the
6024         creation of MonoMethod's for non-virtual methods.
6025         
6026         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6027         get_virtual_methods () to iterate over the virtual methods of classes.
6028
6029 2008-10-25  Martin Baulig  <martin@ximian.com>
6030
6031         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
6032
6033 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6034
6035         * class.c (mono_class_create_from_typedef): Added Vector4i.
6036
6037 2008-10-24  Mark Probst  <mark.probst@gmail.com>
6038
6039         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
6040         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
6041         special-casing applies to eliminate the call completely.
6042
6043 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
6044
6045         * class.c (mono_class_create_from_typedef): Added Vector8s.
6046
6047 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
6048
6049         * class.c (mono_class_create_from_typedef): Added Vector16sb.
6050
6051 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6052
6053         * icall.c: get rid of annoying warning.
6054
6055 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6056
6057         * threadpool.c: in 1.x, if you change the background status of the
6058         threadpool thread, it's not reset.
6059         Remove unnecessary calls to SetState.
6060
6061 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6062
6063         * threadpool.c: asynchronously create a set of idle threads upon first
6064         use of the threadpool. SetMinThreads will now start the appropriate
6065         number of idle threads if they are not already running. The default is
6066         1 threadpool thread per CPU. Increased the maximum number of threads
6067         per CPU to 10.
6068
6069 2008-10-22  Martin Baulig  <martin@ximian.com>
6070
6071         Revert r116521 from Zoltan, it breaks the debugger:
6072
6073         * class.c (mono_class_get_virtual_methods): New helper function to iterate
6074         over the virtual methods of a class using metadata if possible, avoiding the
6075         creation of MonoMethod's for non-virtual methods.
6076         
6077         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
6078         get_virtual_methods () to iterate over the virtual methods of classes.
6079
6080 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6081
6082         * threads.c: when creating a threadpool thread, set its state to
6083         'background'.
6084         * threadpool.c: reset the background state of a threadpool thread
6085         after finishing each work item
6086         Bug #437888 fixed.
6087
6088 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6089
6090         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
6091         
6092         * class.c (mono_class_setup_vtable_general): Add an optimized version for
6093         generic instances which works by inflating the methods in the container
6094         class's vtable.
6095
6096         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
6097         variant which doesn't make a copy if no inflation was done.
6098         (mono_class_setup_fields): Use it.
6099
6100         * metadata.c (mono_metadata_get_shared_type): New helper function to
6101         return a shared instance of a given MonoType.
6102
6103         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
6104         a copy of most non-generic types.
6105
6106 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
6107
6108         * threadpool.c: remove one more GetSystemInfo () call.
6109
6110 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
6111
6112         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
6113         use the code in mono-proclib.h to get processor information.
6114
6115 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6116
6117         * appdomain.c: fixed the logic that determines whether assemblies in a
6118         directory are "shadow-copied" or not. Bug #433483 fixed.
6119
6120 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
6121
6122         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
6123         warning.
6124
6125 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
6126
6127         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
6128         returning a vtype.
6129
6130         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
6131         reflection.c: Use mono_field_get_name () for accessing a field's name.
6132
6133         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
6134         class.c
6135
6136         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
6137         field.
6138
6139         * loader.c (find_method_in_class): Reenable the metadata optimization by
6140         not using it for generic instances.
6141
6142         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
6143         data/def_type fields from MonoClassField into a separate structure.
6144         (struct MonoClassField): Remove data/def_type fields.
6145         (struct _MonoClass): Add a 'field_def_values' array to store the default
6146         values/RVA for fields.
6147
6148         * class.c reflection.c: Update after the changes.
6149         
6150         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
6151         for accessing field->data.
6152
6153         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
6154
6155         * loader.c (find_method_in_class): Revert the last change for now as
6156         it breaks Mono.C5 unit tests.
6157
6158         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
6159         'field_generic_types' and 'field_objects' which contain the information
6160         previously stored in MonoInflatedField.
6161         (MonoInflatedField): Delete.
6162         (struct _MonoClassField): Delete 'generic_info' field.
6163
6164         * reflection.c: Store the information which was previously in 
6165         field->generic_info in MonoDynamicGenericClass instead.
6166
6167         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
6168         MonoClassField changes.
6169
6170 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
6171
6172         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
6173         store the value inside the data array of the MonoMethodWrapper.
6174         This saves memory, is faster and fixes the lifetime issues (methods
6175         were never removed from the hash previously). May also fix bug#436996.
6176
6177 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
6178
6179         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
6180         generic instances, compute the type from the generic definition instead of
6181         looking in field->generic_info.
6182
6183         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
6184         for inflated fields, the only user was get_fieldref_token () which no
6185         longer needs it.
6186
6187         * class.c (mono_class_init): Revert the last change as it seems to cause
6188         crashes.
6189
6190         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
6191         bytes on 64 bit platforms.
6192
6193         * object.c (mono_class_create_runtime_vtable): Fix a warning.
6194         
6195         * object.c (mono_class_create_runtime_vtable): Don't initalize
6196         field->data/field->def_type here, it is done lazily by 
6197         mono_class_get_field_default_value ().
6198
6199         * icall.c (ves_icall_get_enum_info): Call 
6200         mono_class_get_field_default_value () instead of directly accessing
6201         field->data and field->def_type.
6202
6203         * object.c (get_default_field_value): Ditto.
6204
6205         * class.c (mono_field_get_data): Ditto.
6206         
6207         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
6208         call for generic instances.
6209
6210         * loader.c (find_method_in_class): If klass != from_class, then inflate
6211         the method with the context of from_class, since the caller assumes this.
6212
6213 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
6214
6215         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
6216         for accessing method->slot.
6217
6218 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
6219
6220         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
6221
6222 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
6223
6224         * class.c (mono_method_get_vtable_index): Use
6225         mono_method_get_vtable_slot () for accessing method->slot.
6226
6227         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
6228         accessing klass->methods.
6229
6230         * class.c (mono_method_get_vtable_slot): New helper function.
6231         (mono_class_get_vtable_entry): Ditto.
6232         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
6233         accessing method->slot.
6234
6235         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
6236         method to get_inflated_method ().
6237
6238         * class.c (mono_class_get_inflated_method): New helper method to obtain
6239         a method of an inflated class without calling setup_methods ().
6240         (mono_class_get_cctor): Use get_inflated_method.
6241
6242         * generic-sharing.c (mono_class_get_method_generic): Ditto.
6243         
6244         * marshal.c image.c: Lazily create all the marshal caches.
6245
6246         * image.c (mono_image_init): Move initialization of runtime_invoke
6247         caches to marshal.c.
6248
6249         * marshal.c (get_cache): New helper function to lazily initialize a 
6250         wrapper cache.
6251         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
6252
6253         * debug-helpers.c (mono_method_full_name): Include generic arguments.
6254
6255 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
6256
6257         * loader.c: fixed check for interface type.
6258
6259 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
6260
6261         * appdomain.c: check for NULL setup before it's referenced.
6262
6263 p
6264 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
6265
6266         * class.c: remove the unused old vtable setup code.
6267
6268 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
6269
6270         * class.c: don't depend on interface order in
6271         setup_interface_offsets (bug #435777).
6272         * reflection.c: sort the InterfaceImpl table (patch from
6273         Jb Evain  <jbevain@novell.com>).
6274
6275 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
6276
6277         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
6278         the low level assemblies lock.
6279
6280 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
6281
6282         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
6283         object.c, reflection.c, socket-io.c, threads.c: introduced
6284         mono_framework_version () to return the major framewrok version,
6285         changed the code that was using more complex patterns to use it.
6286         Return the correct value for PlatformID for OSX.
6287
6288 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
6289
6290         * icall-def.h, process.h, process.c: added an icall to get info about
6291         processes using mono-proclib.
6292
6293 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
6294
6295         * mono-perfcounters.c: use the mono-proclib functions to
6296         access process information.
6297
6298 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
6299
6300         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
6301         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
6302         reflection.c: remove rawbuffer usage: mmap support is more sanely
6303         provided by utils/mono-mmap.
6304
6305 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
6306
6307         * gc.c: use posix semaphores when possible so that
6308         mono_gc_finalize_notify() is signal safe.
6309
6310 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
6311
6312         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
6313         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
6314         be #ifdef-ed out, the linker will remove the rest.
6315
6316         * marshal.c: Implement DISABLE_COM.
6317
6318         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
6319
6320 2008-10-11  Miguel de Icaza  <miguel@novell.com>
6321
6322         * locales.c (string_invariant_compare_char): Optimization: do not
6323         call g_unichar_type unless we actually need the information.
6324
6325 2008-10-10  Mark Probst  <mark.probst@gmail.com>
6326
6327         * object.c, class-internals.h: Also create remoting trampolines
6328         for generic methods.  Pass the domain to the remoting trampoline
6329         creation function, too.
6330
6331 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
6332
6333         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
6334
6335 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6336
6337         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
6338         Vector4ui.
6339
6340 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
6341
6342         * assembly.c:
6343         * locales.c: remove the use of g_strdown. Fixes bug #322313.
6344
6345 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
6346
6347         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
6348         for the least possible amount of time (extending the fix in r113458).
6349
6350 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
6351
6352         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
6353
6354 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
6355
6356         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
6357         as possible simd intrinsic types.
6358         Optimized the test to check for the common prefix first.
6359
6360 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
6361
6362         * class.c: back out part of a broken optimization committed on
6363         May 23th (bug #433908).
6364
6365 2008-10-09  Mark Probst  <mark.probst@gmail.com>
6366
6367         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
6368         Win32.  Should fix #432388 for most cases until we have the new
6369         profiler on Win32.
6370
6371 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
6372
6373         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
6374         instead of using inst->id so the hash is stable for AOT.
6375
6376 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6377
6378         * appdomain.c:
6379         * icall.c: create a .ini file for shadow-copied assemblies that
6380         contains the location of the original assembly. Use this to return the
6381         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
6382         Also fix the number of '/' for windows when returning the CodeBase.
6383         Fixes bug #430920.
6384
6385 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6386
6387         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
6388
6389         Code is contributed under MIT/X11 license.
6390
6391 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6392
6393         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
6394           if if the class vtable needs initialized.
6395
6396         Code is contributed under MIT/X11 license.
6397
6398 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
6399
6400         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
6401           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
6402           STRING->BSTR, and CLASS->INTERFACE.
6403
6404         Code is contributed under MIT/X11 license.
6405
6406 2008-10-07  Marek Habersack  <mhabersack@novell.com>
6407
6408         * sysmath.h: changed the declaration of the
6409         ves_icall_System_Math_Round2 icall by adding an extra
6410         away_from_zero parameter.
6411
6412         * sysmath.c (ves_icall_System_Math_Round2): added support for
6413         away from zero rounding. The icall now takes an extra boolean
6414         parameter to signal that away from zero operation is requested.
6415
6416 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
6417
6418         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
6419         the delegate klass so it can work with full-aot.
6420         (mono_marshal_get_delegate_end_invoke): Ditto.
6421         (mono_marshal_get_delegate_invoke): Ditto.
6422
6423 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
6424
6425         * gc.c, attach.h, attach.c: remove a bad pattern:
6426         add_finalizer_callback () is not implemented correctly, it can't
6427         without adding more overhead to the finalizer loop and it's not
6428         even needed, since we know exactly what we need to call, so there is
6429         no need to do so through an expensive function pointer.
6430
6431 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
6432
6433         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
6434         for the no-gc case.
6435         * attach.c (mono_attach_init): Remove the #ifdef.
6436
6437 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
6438
6439         * attach.c (mono_attach_init): Don't use
6440         mono_gc_add_finalizer_thread_callback when compiling without GC.
6441         Fixes #432306.
6442         
6443         Code is contributed under MIT/X11 license.
6444
6445 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
6446
6447         * class.c (mono_class_create_from_typedef): Remove the 
6448         #ifndef DISABLE_SIMD stuff.
6449
6450 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
6451
6452         * class-internals.h (MonoClass): Added simd_type bit field.
6453
6454         * class.c (mono_class_create_from_typedef): Check if type is a simd
6455         intrinsic.
6456
6457 2008-10-03  Mark Probst  <mark.probst@gmail.com>
6458
6459         * object.c (mono_method_add_generic_virtual_invocation): Only add
6460         instantiations to the thunk whose count is at least as large as
6461         the threshold.
6462
6463 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
6464
6465         * icall.c: changed the Type of the exception thrown when trying to
6466         invoke a constructor on an abstract class. Part of the fix for bug
6467         #324185.
6468
6469 2008-10-02  Mark Probst  <mark.probst@gmail.com>
6470
6471         * class.c, class-internals.h (mono_method_get_vtable_index): New
6472         function which returns the index into the vtable and properly
6473         handles inflated virtual generic methods.
6474
6475 2008-10-01  Mark Probst  <mark.probst@gmail.com>
6476
6477         * object.c, domain.c, object-internals.h, domain-internals.h:
6478         Generalize IMT thunk machinery to also handle thunks for virtual
6479         generic method invokes.  When a virtual generic method is invoked
6480         more than a number of times we insert it into the thunk so that it
6481         can be called without lookup in unmanaged code.
6482
6483         * generic-sharing.c, class-internals.h: Fetching a
6484         MonoGenericInst* for a method from an (M)RGCTX.
6485
6486 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
6487
6488         * marshal.c (emit_marshal_string): Applied a variant of a patch by
6489         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
6490         marshalling. Fixes #431304.
6491
6492 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
6493
6494         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
6495           handle when ref is specified without In or Out.
6496
6497         Code is contributed under MIT/X11 license.
6498
6499 2008-09-30  Mark Probst  <mark.probst@gmail.com>
6500
6501         * loader.c (mono_get_method_constrained): Don't expand method with
6502         the class's context, because it's already a method of that class.
6503
6504 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
6505
6506         * attach.c : should be correct build fix.
6507
6508 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
6509
6510         * attach.c: Fix the previous change.
6511
6512 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
6513
6514         * attach.c : quick w32 build fix.
6515
6516 2008-09-27  Miguel de Icaza  <miguel@novell.com>
6517
6518         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
6519         crashes MonoDevelop: #430455.
6520
6521 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
6522
6523         * domain-internals.h (struct _MonoDomain): Move most fields used only by
6524         the JIT do MonoJitDomainInfo in ../mini/mini.h.
6525
6526         * domain.c: Remove initialization/cleanup of the removed fields.
6527
6528 2008-09-27  Mark Probst  <mark.probst@gmail.com>
6529
6530         * class.c (mono_class_generic_sharing_enabled): Enable generic
6531         code sharing for PPC.
6532
6533 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
6534
6535         * attach.c : Fixing the Windows builds.
6536
6537         Code is contributed under MIT/X11 license.
6538
6539 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
6540
6541         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
6542         the default generic sharing mode to 'all'.
6543
6544 2008-09-25  Mark Probst  <mark.probst@gmail.com>
6545
6546         * generic-sharing.c, class-internals.h: New function for checking
6547         whether a method needs a static RGCTX invoke wrapper.  A few
6548         funtions moved from mini/generic-sharing.c.
6549
6550         * icall.c: New function used.
6551
6552 2008-09-25  Mark Probst  <mark.probst@gmail.com>
6553
6554         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
6555         Static RGCTX invoke wrapping applies to value type methods, too.
6556
6557         * class.c (mono_class_setup_vtable_general): In generic-shared
6558         value types, wrap methods with a static RGCTX invoke wrapper.
6559
6560 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
6561
6562         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
6563         osx build.
6564
6565 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
6566
6567         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
6568         register a callback which is called when the finalizer thread is woken
6569         up.
6570         (finalizer_thread): Call the callback if it exists.
6571
6572         * attach.h attach.c: New files, implementing the attach mechanism.
6573
6574         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
6575         
6576         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
6577         by the previous change.
6578
6579 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
6580
6581         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
6582         loader.c, marshal.c, metadata-internals.h, metadata.c,
6583         method-builder.c, object.c, reflection.c: introduced specific functions
6584         to allocate from the domain and image mempools and cleaned up most of
6585         the code to use them (still missing a few in reflection.c).
6586         Keep the loader bytes counter updated.
6587
6588 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
6589
6590         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
6591         loader-related counters.
6592
6593 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
6594
6595         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
6596         added more MS-compatible counters.
6597
6598 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
6599
6600         * class.c (mono_class_setup_fields): Call setup_fields before accessing
6601         class->blittable. Fixes #428217.
6602
6603 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
6604
6605         * reflection.c (mono_image_get_field_on_inst_token): Call 
6606         field_encode_signature () since that handles custom modifiers too.
6607         Fixes #424663.
6608
6609 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
6610
6611         * reflection.c (add_custom_modifiers): New helper function to merge custom
6612         modifiers stored in objects to a MonoType.
6613         (fieldref_encode_signature): Encode custom modifiers.
6614         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
6615         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
6616
6617 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
6618
6619         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
6620         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
6621         64-bit IL only images because imports are not resolved for IL only images.
6622         Special thanks to Bill Holmes for finding this bug and testing the patch.
6623         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
6624
6625         Contributed under MIT/X11 license.
6626
6627 2008-09-19  Miguel de Icaza  <miguel@novell.com>
6628
6629         * mono-config.c (dllmap_start): Add support for the bits keyword
6630         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
6631
6632 2008-09-19  Mark Probst  <mark.probst@gmail.com>
6633
6634         * reflection.c (inflate_mono_method): When the class the method is
6635         to be inflated for is itself not inflated, just return the method.
6636
6637 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
6638
6639         * mono-perfcounters.c: use more user friendly process instance names.
6640
6641 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
6642
6643         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
6644           handle "[in] ref" and "[in][out] ref" cases.
6645
6646         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
6647           to mono_mb_create_method.  This was causing problems calling native to
6648           managed passing Variants by value.
6649
6650         Code is contributed under MIT/X11 license.
6651
6652 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
6653
6654         * class.c (can_access_internals): Call mono_assembly_load_friends ()
6655         before accessing the friend_assembly_names field.
6656
6657         * assembly.c (mono_assembly_load_friends): Make this callable multiple
6658         times.
6659         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
6660         called lazily when it is needed.
6661
6662         * metadata-internals.h (struct _MonoAssembly): Add 
6663         'friend_assembly_names_inited' flag.
6664
6665 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
6666
6667         * mono-perfcounters-def.h: fix the types of a few counters.
6668         * mono-perfcounters.c: implemented the instance names getter
6669         and a few bugfixes.
6670
6671 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
6672
6673         * culture-info-table.h : regenerated.
6674
6675 2008-09-17  Robert Jordan  <robertj@gmx.net>
6676
6677         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
6678         context bound objects. Fixes #415577.
6679
6680         Code is contributed under MIT/X11 license.
6681
6682 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
6683
6684         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
6685         implementation (bug #423582).
6686
6687 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
6688
6689         * object.c (mono_object_get_virtual_method): Handle the case method->slot
6690         is not set. Fixes #426309.
6691
6692 2008-09-16  Jb Evain  <jbevain@novell.com>
6693
6694         * class.c (mono_class_from_name): fix the exported type look up
6695         when the type is defined in a referenced assembly.
6696
6697 2008-09-16  Jb Evain  <jbevain@novell.com>
6698
6699         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
6700         increment the next index counter on each iteration to make that work
6701         for more than one type forwarder. Unmanaged part to fix #422929.
6702
6703 2008-09-15  Mark Probst  <mark.probst@gmail.com>
6704
6705         * object-internals.h: enum ComInterfaceType in
6706         MonoInterfaceTypeAttribute is guint32, not guint16.
6707
6708 2008-09-12  Mark Probst  <mark.probst@gmail.com>
6709
6710         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
6711         writing code.
6712
6713 2008-09-11  Mark Probst  <mark.probst@gmail.com>
6714
6715         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
6716         not gboolean.
6717
6718 2008-09-11  Mark Probst  <mark.probst@gmail.com>
6719
6720         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
6721         Endianness fixes for MonoSymbolFileOffsetTable.
6722
6723 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
6724
6725         * process.c (complete_path) : Removing quotes from the 
6726           input path.  The glib file routines do not handle file paths
6727           that have quotes around them.
6728
6729         Code is contributed under MIT/X11 license.
6730
6731 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
6732
6733         * socket-io.h : Adding a comment to provide locations where 
6734           changes to MonoSocketAsyncResult need to be synced.
6735
6736         Code is contributed under MIT/X11 license.
6737
6738 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
6739
6740         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
6741         parameters as well. Fixes #425001.
6742
6743 2008-09-08  Miguel de Icaza  <miguel@novell.com>
6744
6745         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
6746         windows build.
6747
6748 2008-09-07  Miguel de Icaza  <miguel@novell.com>
6749
6750         * console-io.c: Add support for tracking the window size if it
6751         changes.
6752
6753         The setup is very simple: the TtySetup function will now return a
6754         pointer to a location in memory that tracks the current console
6755         size.  The managed code checks its current value every time its
6756         queried against the last value set, and updates accordingly.
6757
6758         With this setup we can work with multiple consoles, and we do not
6759         require to poke into managed code from a signal handler.
6760
6761         Additionally, the environment for COLUMNS and LINES is now handled
6762         in unmanaged code.
6763
6764         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
6765
6766 2008-09-07  Mark Probst  <mark.probst@gmail.com>
6767
6768         * marshal.c (mono_type_native_stack_size): Treat
6769         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
6770
6771 2008-09-04  Jb Evain  <jbevain@novell.com>
6772
6773         * class.c (mono_class_is_assignable_from): fix assignability of nullables
6774         to nullables.
6775
6776 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
6777
6778         * verify.c (verify_type_compatibility_full): Revert change
6779         to allow converting a native int to unmanaged pointer be verifiable
6780         under non-strict mode.
6781         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
6782
6783         * verify.c: Added some TODOs.
6784
6785 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
6786
6787         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
6788           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
6789           Changed to use GlobalAlloc for the memory returned on Windows platforms.
6790
6791         Code is contributed under MIT/X11 license.
6792
6793 2008-09-02  Jb Evain  <jbevain@novell.com>
6794
6795         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
6796
6797 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
6798
6799         reflection.c (typebuilder_setup_fields): Handle classes with
6800         explicit size.
6801
6802 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
6803
6804         class.c (mono_class_setup_events): Add memory barrier due to
6805         double checked locking.
6806         
6807         class.c (mono_class_setup_properties): Same.
6808
6809 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
6810
6811         * class.c (mono_class_is_assignable_from): Fix the build.
6812         
6813         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
6814         before accessing klass->interface_bitmap. Fixes #421744.
6815
6816 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
6817
6818         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
6819         the runtime into no-exec mode, useful when running the AOT compiler.
6820
6821         * appdomain.c gc.c object.c: Avoid executing managed code when running
6822         in no-exec mode.
6823         
6824         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
6825
6826         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
6827         special case when the mono_assembly_loaded () returns NULL because the 
6828         search hook is not installed.
6829
6830 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
6831
6832         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
6833         crashes in bstr marshalling on linux.
6834
6835 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
6836
6837         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
6838         with more than one parameter.
6839
6840 2008-08-24  Miguel de Icaza  <miguel@novell.com>
6841
6842         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
6843         start/stop flow control as well when turning off ICANON (allows
6844         C-s and C-q to be read by Console.ReadKey).
6845
6846 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
6847
6848         * class.c (mono_class_init): Move the initialization of nested classes
6849         into mono_class_get_nested_types (). Fixes #418433.
6850
6851         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
6852         flag.
6853
6854         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
6855         iterating tough the nested classes of a class.
6856
6857 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
6858
6859         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
6860         on arm.
6861
6862 2008-08-22  Miguel de Icaza  <miguel@novell.com>
6863
6864         * console-io.c (sigcont_handler): Support signal chaining for
6865         SIGCONT.
6866
6867         (console_set_signal_handlers): Use best practices with sigaction,
6868         clear the structure before using it. 
6869
6870 2008-08-22  Robert Jordan  <robertj@gmx.net>
6871
6872         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
6873         Fix the Windows build.
6874
6875 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
6876
6877         * class.c (mono_class_generic_sharing_enabled): Make the default
6878         sharing mode 'corlib'.
6879
6880 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
6881
6882         * console-io.c (console_set_signal_handlers): Fix a warning.
6883
6884         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
6885         method normally, the JIT will take care of avoiding recursion.
6886
6887 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
6888
6889         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
6890
6891         Code is contributed under MIT/X11 license.
6892
6893 2008-08-20  Miguel de Icaza  <miguel@novell.com>
6894
6895         * console-io.c (sigcont_handler): We need to restore the entire
6896         termios state, not only the original settings, as things like echo
6897         can be controlled after this (Booish exposes this issue with its
6898         own ReadLine implementation).
6899
6900         Additionally, we need to set the terminal back into keypad_xmit
6901         mode.
6902         
6903         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
6904         string as a paramter as well.   Otherwise we get different
6905         keyboard sequences.
6906
6907 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
6908
6909         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
6910         delegates with byref out parameter passing. Fixes #351520.
6911
6912         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
6913         a generic context.
6914         (mono_type_get_desc): Add the type arguments for GENERICINST.
6915         (mono_method_full_name): Stringify the class name using mono_type_full_name
6916         so it picks up generic arguments.
6917
6918 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
6919
6920         * console-io.c: Removed debug output.
6921
6922 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
6923
6924         reflection.c (mono_reflection_create_runtime_class): Alloc
6925         the nested classes linked list using the dynamic image mempool.
6926         Fixes leak in corlib compilation.
6927
6928 2008-08-19  Miguel de Icaza  <miguel@novell.com>
6929
6930         * console-io.c: Fix incredibly annoying behavior on the console
6931         after resuming execution after control-z.   This affected every
6932         console application.
6933
6934 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
6935
6936         * mempool-internals.h: Header for mono private mempool functions. The first
6937         two function are for allocating glib linked lists using pools.
6938
6939         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
6940
6941         * Makefile.am: Added mempool-internals.h.
6942
6943 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
6944
6945         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
6946         (mono_domain_free): Ditto.
6947
6948         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
6949         be used by the JIT to store its domain-specific information, instead of putting
6950         it directly into MonoDomain.
6951
6952         * domain.c (mono_install_create_domain_hook): New helper function to install
6953         a hook which initializes domain->runtime_info.
6954
6955         * domain.c (mono_install_free_domain_hook): Ditto.
6956         
6957 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
6958
6959         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
6960         asserting if the ares parameter is null.
6961
6962         * mono-perfcounters.c: Fix warnings.
6963
6964         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
6965         is not needed, don't check for interruptions either.
6966         (mono_marshal_get_delegate_end_invoke): Ditto.
6967
6968 2008-08-15  Marek Habersack  <mhabersack@novell.com>
6969
6970         * mono-perfcounters.c (predef_readonly_counter): added support for
6971         reading the ASP.NET Requests Queued counter from another process.
6972
6973 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
6974
6975         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
6976         MonoImage to simplify the AOT code.
6977
6978 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
6979
6980         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
6981         marshalling. Fixes #416078.
6982
6983 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
6984         
6985         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
6986         it is set, looking up the icall address is deferred to the JIT, since 
6987         in embedded scenarios, the icall might not be registered in the runtime
6988         doing the AOT compilation. Backported from the 2.0 branch.
6989
6990 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
6991
6992         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
6993         Fixes #415621.
6994
6995 2008-08-05  Marek Habersack  <mhabersack@novell.com>
6996
6997         * Makefile.am: added support for cross-compilation.
6998
6999 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
7000
7001         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
7002
7003 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
7004
7005         * mono-perfcounters.c: jitted methods and jitted bytes counters.
7006
7007 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
7008
7009         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
7010         mono-perfcounters.c: performance counters implementation.
7011
7012 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
7013
7014         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
7015         to gpointer, letting the AOT code decide what to store in it.
7016
7017 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
7018
7019         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
7020           mono_class_setup_methods if the methods are not initialized.
7021
7022         Code is contributed under MIT/X11 license.
7023
7024 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7025
7026         * verify.c: Remove some debug code I commited by accident.
7027
7028         * verify.c (mono_method_is_valid_in_context): Change the return value
7029         to make possible to distinguish between invalid and unverifiable.
7030
7031         * verify.c (verifier_load_method): Don't return NULL for unverifiable
7032         methods.
7033
7034 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7035
7036         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
7037         constraints. Fixes regression in gtest-253.
7038
7039 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
7040
7041         * verify.c (mono_verifier_verify_class): Don't allow generic types
7042         with explicit layout.
7043
7044         * verify.c (mono_method_verify): Check locals and argument types.
7045
7046 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
7047
7048         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
7049         wait if the thread is in StopRequested state.
7050
7051         * class.c (mono_class_from_name): Refactor the module searching code into
7052         a separate function so it can be reused in the AOT case too.
7053
7054 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
7055
7056         * verify.c (mono_type_is_valid_in_context): Improve the error message.
7057         Check both the type and it's generic type definition for loader errors.
7058         
7059         * verify.c (mono_method_is_valid_in_context): Don't generate another
7060         error when a type errors occur, this leads to the wrong exception been
7061         thrown.
7062
7063 2008-07-28  Dick Porter  <dick@ximian.com>
7064
7065         * icall-def.h
7066         * process.c
7067         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
7068         New internal calls to duplicate and close a process handle.
7069
7070 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
7071
7072         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
7073
7074 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
7075
7076         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
7077
7078 2008-07-27  Robert Jordan  <robertj@gmx.net>
7079
7080         * class.c (mono_class_init): Don't compute class.has_finalize for
7081         valuetypes. Fixes #412477.
7082
7083 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
7084
7085         * verify.c: Implement constraint equivalence checking.
7086         This is required when a generic parameter is used as
7087         argument to a constrained one.
7088
7089         Fixes #410637.
7090
7091 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
7092
7093         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7094
7095         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
7096
7097         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
7098         synch with managed object layout.
7099
7100 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7101
7102         * verify.c (do_branch_op): Handle valuetypes and generic
7103         arguments properly.
7104
7105         * verify.c (do_cmp_op): Same.
7106
7107         Fixes #410383.
7108
7109 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7110
7111         * generic-sharing.c: Fix memory leaks.
7112
7113         * class.c, class-internals.h: Make
7114         mono_class_inflate_generic_type_with_mempool() non-static.
7115
7116 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
7117
7118         * pedump.c (dump_verify_info): Dump full class name.
7119
7120 2008-07-24  Mark Probst  <mark.probst@gmail.com>
7121
7122         * generic-sharing.c: Removed some old code that didn't do anything.
7123
7124 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
7125         * profiler.c: Added runtime_initialized_event,
7126         mono_profiler_install_runtime_initialized and
7127         mono_profiler_runtime_initialized. This new hook tells the profiler
7128         when the runtime is sufficiently initialized to be able to call
7129         mono_thread_attach on the root appdomain.
7130         * profiler.h, profiler-private.h: Likewise.
7131
7132 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
7133
7134         * verify.c (do_cast): Do boxing for generic arguments as well.
7135
7136         * class.c (is_nesting_type): Drop generic instantiations before
7137         checking for nesting.
7138
7139         * class.c (can_access_instantiation): Allow access to generic
7140         arguments.
7141
7142 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
7143
7144         * verify.c (verify_class_for_overlapping_reference_fields):
7145         On some cases, the field size might be zero, guard against that.
7146         Fix the explicit layout check to work as expected.
7147
7148 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
7149
7150         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
7151         mono_thread_resume () during shutdown, since the thread we want to abort
7152         might be suspended.
7153
7154 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
7155
7156         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
7157         warning.
7158
7159         * debug-mono-symfile.c: Fix a warning.
7160
7161         * mono-perfcounters.c (get_cpu_times): Fix a warning.
7162
7163         * object.c (mono_class_vtable): Check if exception_type is set, and return
7164         NULL as defined by the function comments.
7165
7166 2008-07-22  Mark Probst  <mark.probst@gmail.com>
7167
7168         * mempool.c: Use malloc for every single mempool allocation if the
7169         configure option is set.  This makes it easier to track mempool
7170         allocations with tools like Valgrind.
7171
7172 2008-07-22  Jb Evain  <jbevain@novell.com>
7173
7174         * reflection.c (create_dynamic_mono_image): emit the same
7175         metadata version that SL2 does when creating a SL2 image.
7176
7177 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
7178
7179         * icall-def.h:
7180         * icall.c: New icall System.Enum:get_hashcode. This function
7181         avoids the overhead of boxing the enum to the underlying type.
7182
7183 2008-07-21  Mark Probst  <mark.probst@gmail.com>
7184
7185         * reflection.c (mono_method_get_object): Don't let static RGCTX
7186         invoke wrappers get into MonoReflectionMethods.
7187
7188 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
7189
7190         * object-internals.h:
7191         * object.c: New mono_runtime_class_init_full function
7192         that makes throwing the exception optinal.
7193
7194         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
7195         for the case where the exception object is supplied.
7196
7197 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
7198
7199         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
7200         old ld versions.
7201
7202         Contributed under MIT/X11 license.
7203
7204 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
7205
7206         * string-icalls.c (ves_icall_System_String_InternalSplit):
7207         Optimize array allocation by caching the MonoClass of the
7208         array type.
7209
7210         * icall.c (ves_icall_Type_GetMethodsByName): Same.
7211
7212         * reflection.c (mono_param_get_objects): Same.
7213
7214 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
7215
7216         * icall-def.h:
7217         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
7218         It inflates the given type using the class context.
7219
7220 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
7221
7222         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
7223         the vtable if it already exists.
7224
7225         * object-internals.h: Add mono_class_try_get_vtable as part of the
7226         internal API.
7227
7228         * reflection.c (mono_type_get_object): Use the MonoObject from the
7229         vtable when possible. Reduces locking contention on reflection heavy
7230         code.
7231
7232 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
7233
7234         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
7235         g_bit_nth_msf () since that macro is not implemented in eglib.
7236
7237 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
7238
7239         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
7240         on platforms which do not support it.
7241
7242 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
7243
7244         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
7245
7246 2008-07-11  Martin Baulig  <martin@ximian.com>
7247
7248         * mono-debug-debugger.h
7249         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
7250
7251         * mono-debug-debugger.c
7252         (_mono_debugger_interruption_request): New global volatile variable.
7253         (mono_debugger_check_interruption): New public function.
7254
7255         * threads.c
7256         (mono_thread_current_check_pending_interrupt): Call
7257         mono_debugger_check_interruption().
7258         (mono_thread_interruption_checkpoint_request): Likewise.
7259
7260 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7261
7262         * verify.c: Add more type checks for loaded types. Verify the result
7263         handle from ldtoken.
7264
7265 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7266
7267         * loader.c (field_from_memberref): Don't crash if the field
7268         wasn't found.
7269
7270 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7271
7272         * verify.c: Verify if type and method instantiations
7273         don't have invalid VAR or MVAR arguments.
7274
7275 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7276
7277         * verify.c: Fix double free of function pointer list.
7278
7279 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
7280
7281         * object.c (mono_string_to_utf8): Comment the new code as it
7282         breaks under eglib.
7283
7284 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
7285
7286         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
7287
7288 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
7289
7290         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
7291           is not throw too many times.
7292
7293         Code is contributed under MIT/X11 license.
7294
7295 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
7296
7297         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
7298         debugging is turned off.
7299
7300 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
7301
7302         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
7303
7304 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7305
7306         * class-internals.h, class.c: Added new generic sharing option:
7307         Share only stuff in System.Collections.Generic, which is now the
7308         default.
7309
7310 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7311
7312         * generic-sharing.c, class-internals.h: New function for getting a
7313         generic method in a generic class given the corresponding method
7314         for a different instantiation of the class.  Partly refactored
7315         from mini-trampolines.c.
7316
7317         * class.c: Make sure generic methods have a class_inst if they are
7318         part of a generic class.
7319
7320         * metadata.c (mono_type_stack_size_internal): Handle type
7321         variables.
7322
7323 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7324
7325         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
7326         Signifies whether information on the this/vtable/mrgctx variable
7327         is available.
7328
7329 2008-07-04  Mark Probst  <mark.probst@gmail.com>
7330
7331         * object.c, object-internals.h, icall.c: New function
7332         mono_delegate_ctor_with_method(), which does the same as
7333         mono_delegate_ctor(), but takes an explicit method argument
7334         instead of taking the method from the jit info.
7335
7336         * marshal.c: When creating a delegate with an inflated method take
7337         the "this" argument as the target class for the castclass.
7338
7339 2008-07-03  Mark Probst  <mark.probst@gmail.com>
7340
7341         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
7342         mono_jit_info_table_find() to perform very badly in some cases.
7343
7344 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
7345
7346         * icall.c (type_from_typename): Handle 'string'.
7347
7348         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
7349         wrappers into the wrapper_hash, since the key is not a MonoMethod.
7350
7351 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
7352
7353         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
7354
7355         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
7356         number of available managed allocator types.
7357
7358         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
7359         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
7360
7361 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
7362
7363         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
7364         which is a low level lock protecting just the 'jit_code_hash' hash table.
7365
7366         * domain.c: Initialize+cleanup jit_code_hash_lock.
7367         
7368 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
7369
7370         * coree.c (mono_load_coree): Set coree_module_handle global variable only
7371         after initialization.
7372
7373         * coree.h: Make MonoFixupExe internal.
7374
7375         Contributed under MIT/X11 license.
7376
7377 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
7378
7379         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
7380         because that is platform independent. Check NumberOfRvaAndSizes in PE32
7381         as well.
7382         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
7383         image being loaded is a CLI image and _CorValidateImage gets called.
7384
7385         * coree.h: Add MonoLoadImage.
7386
7387         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
7388         instead of LoadLibrary.
7389
7390         Contributed under MIT/X11 license.
7391
7392 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
7393
7394         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
7395         for any primitive type.
7396
7397 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
7398
7399         * object.c (mono_array_new_specific): Optimize this and the other allocation
7400         functions a bit.
7401         
7402         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
7403         domains too if mono_dont_free_domains is set.
7404
7405         * domain-internals.h (mono_dont_free_domains): New internal option controlling
7406         whenever to free appdomain data after it has been unloaded.
7407
7408         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
7409         
7410 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
7411
7412         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
7413         (mono_method_get_equivalent_method): Fix a warning.
7414
7415         * object.c (mono_message_init): Avoid looking up array types for each call.
7416
7417 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
7418
7419         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
7420         call.
7421
7422         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
7423         even more.
7424
7425         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
7426         each iteration.
7427
7428         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
7429         fields of an enum.
7430
7431 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
7432
7433         * object.c (mono_value_box): Fix boxing of nullables.
7434
7435 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
7436
7437         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
7438         mono_module_handle that is defined by the linker; no initialization required.
7439         * coree.h: Remove mono_module_handle, add __ImageBase, update
7440         mono_image_open_from_module_handle.
7441         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
7442         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
7443         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
7444         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
7445         to 4 GB away from image base address. IA64 version is not tested but was very
7446         easy to implement and should work if we ever need it.
7447         * domain.c (mono_init_internal): Avoid system error message boxes.
7448         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
7449         with has_entry_point. Handle do_mono_image_load fauilre correctly.
7450         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
7451         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
7452         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
7453
7454         Contributed under MIT/X11 license.
7455
7456 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7457
7458         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
7459         as part of the private mono API.
7460         
7461         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
7462         Do proper argument checking for methods that belong to generic classes.
7463         Do proper type resolution for GMFH/2.
7464         Fixes #377324.
7465         
7466 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7467
7468         * verify.c (do_switch): Fix a memory corruption bug with
7469         the jump index is out of bound.
7470
7471 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7472
7473         * verify.c: Disable debug code.
7474
7475 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
7476
7477         * reflection.c (mono_image_get_methodbuilder_token): Use
7478         mono_image_get_methodspec_token_for_generic_method_definition
7479         instead of mono_image_get_memberref_token. We cache more memberef
7480         entries now.
7481
7482 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7483
7484         * verify.c: Inflate exception clause types.
7485         Fixes #402606.
7486         
7487 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7488
7489         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
7490         name.
7491
7492         * reflection.c (mono_image_get_ctorbuilder_token): Same.
7493
7494         * reflection.c (mono_image_create_method_token): Same.
7495
7496 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
7497
7498         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
7499         It does the same as mono_image_get_methodref_token but works on
7500         MethodBuilder.
7501
7502         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
7503         and always generate a methodspec. This follows the old behavior and fixes
7504         the regressions in System.Core. 
7505
7506 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
7507
7508         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
7509         don't event mono_class_get () succeeds. Fixes #402182.
7510
7511 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
7512
7513         * metadata-internals.h: Added MonoDynamicImage::methodspec
7514         hashtable to store methodspec tokens created for MethodBuilders.
7515
7516         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
7517         MethodBuilders as open instantiations if a methodspec was requested.
7518
7519         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
7520
7521         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
7522
7523         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
7524
7525         Fixes bug #349190.
7526
7527 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
7528
7529         * loader.c (method_from_methodspec): Avoid crashing if the
7530         method lookup fails.
7531
7532 2008-06-20  Dick Porter  <dick@ximian.com>
7533
7534         * socket-io.c (get_socket_assembly): Cope with Moonlight network
7535         classes being in a different assembly.  Fixes bug 399184.
7536
7537 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
7538
7539         * loader.c (mono_loader_init): Make this callable multiple times.
7540         (mono_dllmap_insert): Call mono_loader_init () so this works even before
7541         the runtime is initialized. Fixes #401755.
7542
7543 2008-06-19  Dick Porter  <dick@ximian.com>
7544
7545         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
7546         Fixes bug 349688.
7547
7548 2008-06-19  Dick Porter  <dick@ximian.com>
7549
7550         * socket-io.c:
7551         * icall-def.h: Implement Socket generic Send() and Receive()
7552         methods.  Fixes bug 395168.
7553
7554 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
7555
7556         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
7557
7558         Contributed under MIT/X11 license.
7559
7560 2008-06-18  Martin Baulig  <martin@ximian.com>
7561
7562         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
7563         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
7564         set to 80.0.  The debugger <-> runtime interface is now frozen as
7565         well.   
7566
7567         * mono-debug.c
7568         (mono_debug_debugger_version): Bump to 4.
7569
7570 2008-06-18  Martin Baulig  <martin@ximian.com>
7571
7572         * debug-mono-symfile.c
7573         (load_symfile): Don't check the minor version.
7574
7575         * debug-mono-symfile.h: Bump the version number to 50.0.
7576
7577 2008-06-18  Martin Baulig  <martin@ximian.com>
7578
7579         * debug-mono-symfile.c
7580         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
7581         minimum required version.
7582
7583 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
7584
7585         * reflection.c (mono_custom_attrs_from_property): Fix support for
7586         retriveving cattrs of dynamic inflated generic types.
7587
7588         * reflection.c (mono_custom_attrs_from_event): Same.
7589
7590         * reflection.c (mono_custom_attrs_from_field): Same;
7591
7592         * reflection.c (typebuilder_setup_events): Same cattrs of events.
7593
7594         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
7595         Moved to metadata.c.
7596
7597         * metadata.c: New functions to retrive the equivalent field, event
7598         of property from the generic type definition.
7599
7600         * metadata-internals.h: Added new functions from metadata.c.
7601
7602 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
7603
7604         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
7605         to cached in a mempool is used.
7606
7607         * metadata.c (free_generic_class): In some situations field generic_info type
7608         is not properly dup'ed and leads to double free'ing.
7609
7610         Fixes #400643.
7611
7612 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7613
7614         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
7615         this arguments (will be needed later for generic methods).
7616         Collect stats.
7617
7618 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7619
7620         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
7621         Create a static RGCTX invoke wrapper for methods which require it.
7622
7623 2008-06-17  Mark Probst  <mark.probst@gmail.com>
7624
7625         * object.c, class-internals.h: New function for checking whether
7626         an individual field is special static.
7627
7628 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
7629
7630         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
7631         linear search since the table is sorted.
7632
7633         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
7634         Fixes #324180.
7635
7636 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
7637
7638         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
7639         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
7640
7641         * gc.c (mono_domain_finalize): Allow an infinite timeout.
7642
7643         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
7644         
7645         * threads.c (mono_thread_request_interruption): Get rid of locking, use
7646         InterlockedCompareExchange to query and modify 
7647         thread->interruption_requested.
7648
7649         * object-internals.h (struct _MonoThread): Change interruption_requested
7650         to a gint32 so it can be modified by atomic operations. Add 
7651         'critical_region_level' from the managed side, change small_id to a guint32,
7652         add new set of 'unused' fields.
7653
7654         * appdomain.c: Bump corlib version.
7655
7656 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
7657
7658         * class.c (mono_class_from_name): Search modules as well. Fixes
7659         #322332.
7660
7661 2008-06-13  Mark Probst  <mark.probst@gmail.com>
7662
7663         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
7664         templates.  Templates are generalized with an additional type_argc
7665         argument.  RGCTX templates have type_argc==0, MRGCTX templates
7666         have type_argc>0.
7667
7668         * domain-internals.h, domain.c: New hash table for looking up
7669         MRGCTXs.
7670
7671         * metadata.c, metadata-internals.h: Rename hash and equal
7672         functions for MonoGenericInst's and make them public.
7673
7674         * class-internals.h: New data structures for the MRGCTX.  Macros
7675         for distinguishing slots in the RGCTX and the MRGCTX.
7676
7677 2008-06-13  Mark Probst  <mark.probst@gmail.com>
7678
7679         * object.c (mono_method_get_imt_slot): Put the same methods of
7680         different instantiations of the same generic interface in the same
7681         IMT slots, to make generic sharing simpler.
7682
7683 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7684
7685         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
7686
7687         * metadata.c (mono_metadata_field_info_with_mempool): Added.
7688         This function works just like mono_metadata_field_info, but
7689         accept a mempool as argument to be used allocating memory.
7690
7691         * marshal.c (mono_marshal_load_type_info): Use new function
7692         to load marshal data into image mempool.
7693
7694 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7695
7696         * class.c (mono_class_inflate_generic_type_with_mempool):
7697         This function allows to inflate a generic type using
7698         a mempool.
7699
7700         * class.c (inflate_generic_type): Take a mempool as argument
7701         and use it to do type dup'ing.
7702
7703         * class.c (mono_class_setup_fields): Field type for generic
7704         generic classes are allocated from the image mempool.
7705
7706         * metadata.c (free_generic_class): Inflated field type is
7707         now allocated in the image mempool.
7708
7709 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
7710
7711         * threads.c (thread_cleanup): Free MonoThread::name.
7712
7713 2008-06-12  Marek Habersack  <mhabersack@novell.com>
7714
7715         * appdomain.c (ensure_directory_exists): avoid unnecessary
7716         mkdir(2) calls when the shadow directory already exists.
7717         (mono_make_shadow_copy): copy also satellite assemblies from the
7718         private bin directories.
7719
7720 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
7721
7722         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
7723         
7724         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
7725         a page boundary. Fixes #396219.
7726
7727 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7728
7729         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
7730         due to double-checked locking.
7731
7732 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7733
7734         * assembly.c (build_assembly_name): Release memory on failure.
7735
7736         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
7737
7738 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7739
7740         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
7741         memory on failure.
7742
7743 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7744
7745         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
7746         memory on failure.
7747
7748 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7749
7750         * loader.c (field_from_memberref): Check if field signature type is equal
7751         to the non-inflated type of the field. Fixes #398980.
7752
7753 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
7754
7755         * assembly.c (mono_assembly_load_from_full): Call 
7756         mono_assembly_load_friends () outside the assemblies lock, since it can
7757         acquire the loader lock. Fixes #323696.
7758
7759         * reflection.c (resolve_object): Inflate the inst with the context for
7760         FieldOnTypeBuilderInst. Fixes #399010.
7761
7762 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7763
7764         * reflection.c (mono_image_get_field_on_inst_token): Don't
7765         inflate the field to encode it's signature. If it's a
7766         VAR or MVAR it should stay that way in the signature.
7767         Fixes #399047.
7768
7769 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7770
7771         * reflection.c (resolve_object): Release memory of inflated types.
7772
7773 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7774
7775         * loader.c (mono_method_get_signature_full): Remove assert about
7776         loading a methodspec to a generic method. We have such methods, such as
7777         System.Threading.Interlocked::CompareExchange<T>.
7778         This assert was removed since it crashes the verifier when it checks
7779         methods calling CompareExchange<T>.
7780
7781 2008-06-10  Marek Safar  <marek.safar@gmail.com>
7782
7783         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
7784         of Type array and not MonoType.
7785
7786 2008-06-10  Marek Habersack  <mhabersack@novell.com>
7787
7788         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
7789         <lupus@ximian.com>
7790
7791 2008-06-10  Martin Baulig  <martin@ximian.com>
7792
7793         * debug-mono-symfile.h
7794         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
7795         changes to the file format, but we were generating incorrect
7796         source file indices in the line number table due to a bug, which
7797         made backtraces report an incorrect source file.
7798
7799 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
7800
7801         * mono-debug.c: Moved mono_debug_free_method_jit_info from
7802         mini/debug-mini.c to here.
7803
7804         * mono-debug.c (il_offset_from_address): Free memory from find_method.
7805
7806         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
7807         use it to release structs returned by mono_debug_find_method.
7808
7809 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
7810
7811         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
7812         since it needs to set method->slot for all interface methods.
7813
7814 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7815
7816         * class-internals.h: Forgot to add.
7817
7818 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7819
7820         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
7821
7822         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
7823         Lookup the custom attributes from property_hash.
7824
7825         * reflection.c (mono_save_custom_attrs): Save the custom attributes
7826         in property_hash. Allocate all data using the image mempool.
7827
7828         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
7829         for dynamic_custom_attrs to checks if the image is dynamic.
7830
7831 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
7832
7833         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
7834         assemblies array.
7835         
7836         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
7837         runtime functions while holding the domain assemblies lock.
7838
7839 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7840
7841         * verify.c: Reapplied the last bit of the reverted changes.
7842
7843 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
7844
7845         * verify.c: Reapplied more of the reverted changes.
7846
7847 2008-06-09  Martin Baulig  <martin@ximian.com>
7848
7849         * debug-mono-symfile.c (load_symfile): Check the major version
7850         first; if it's wrong, don't print the minor version in the error message.
7851
7852 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
7853
7854         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
7855         lock instead of the domain lock to avoid deadlocks, since the thread might
7856         already hold the loader lock.
7857
7858         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
7859         (mono_thread_attach): Ditto.
7860
7861         * monitor.c: Use a TLS variable for holding the current thread id instead
7862         of calling pthread_self ().
7863         (mono_monitor_init_tls): New internal function to initialize the TLS
7864         variable.
7865         (mono_monitor_try_enter_internal): Put the owner == id check after the
7866         owner == 0 check.
7867
7868         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
7869         missed optimizations when using gcc-4.3.
7870
7871 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
7872
7873         * reflection.c (mono_dynamic_image_free): Free the memory
7874         used by MonoGenericParam in MonoDynamicImage::gen_param.
7875
7876         * reflection.c (mono_reflection_setup_generic_class): Allocate
7877         container from mempool.
7878
7879         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
7880         container from mempool.
7881
7882 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
7883
7884         * threads.c (mono_set_pending_exception): New internal function to set the
7885         pending exception of the current thread.
7886         (mono_thread_get_and_clear_pending_exception): Check for 
7887         thread->pending_exception as well.
7888
7889         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
7890
7891         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
7892         it can trigger a collection.
7893
7894 2008-06-06  Martin Baulig  <martin@ximian.com>
7895
7896         Merged the `debugger-kahalo' branch.
7897
7898         * mono-debug.h
7899         (MONO_DEBUGGER_VERSION): Bumped to 72.
7900
7901         * debug-mono-symfile.h
7902         (MonoSymbolFileMethodIndexEntry): Removed.
7903         (MonoSymbolFileMethodEntry): New public typedef.
7904         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
7905         (MonoSymbolFileSourceEntry): Remove everything except `index' and
7906         `data_offset'.
7907         (MonoSymbolFileMethodEntry): Removed.
7908         (MonoSymbolFileLexicalBlockEntry): Removed.
7909         (MonoSymbolFileLineNumberEntry): Removed.
7910         (MonoDebugLexicalBlockEntry): Removed.
7911         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
7912         removed `num_il_offsets' and `il_offsets'.
7913         (MonoSymbolFile): Replace `version' with `major_version' and
7914         `minor_version'.
7915         (MONO_SYMBOL_FILE_VERSION): Replace with
7916         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
7917         `MONO_SYMBOL_FILE_MINOR_VERSION'.
7918
7919         * debug-mono-symfile.c
7920         (mono_debug_symfile_lookup_location): Add support for the new line
7921         number table format.
7922
7923 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7924
7925         * metadata.c (free_generic_class): Release the inflated
7926         MonoClass of dynamic generic classes if it's not a generic
7927         type definition.
7928
7929 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7930
7931         * verify.c: Reapplied more of the reverted changes.
7932
7933 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7934
7935         * reflection.c (lookup_custom_attr): Clean the cached flag or
7936         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
7937         for SRE types.
7938
7939 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
7940
7941         * verify.c: Reapplied a small part of the reverted changes.
7942
7943 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
7944
7945         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
7946
7947         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
7948         previously in managed code.
7949         (mono_monitor_exit): Ditto.
7950         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
7951
7952         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
7953         the managed definition.
7954
7955 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
7956
7957         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
7958
7959 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
7960
7961         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
7962         
7963         * monitor.c: Add some micro optimizations.
7964
7965         * icall.c (type_from_typename): Handle 'bool'.
7966
7967 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
7968
7969         * verify.c: Implement constructor verification per P III 1.8.1.4.
7970         Fixes #396716.
7971
7972 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
7973
7974         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
7975         holding the assemblies lock here too.
7976
7977 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7978
7979         * verify.c: Kill stack_top function.
7980
7981 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7982
7983         * verify.c: Kill stack_get function.
7984
7985 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7986
7987         * verify.c (mono_method_verify): Last change broke the build. Fixed.
7988
7989 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
7990
7991         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
7992         more reliable.
7993
7994         * verify.c (mono_method_verify): Inflate params and locals to avoid
7995         mismatch when checking for compatibility.
7996
7997 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
7998
7999         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
8000         Length prefix should be size in bytes. Fix bug #339530.
8001         
8002         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
8003         Length prefix should be size in bytes. Fix bug #339530.
8004
8005         Code is contributed under MIT/X11 license.
8006
8007 2008-06-05  Bill Holmes <billholmes54@gmail.com>
8008
8009         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
8010
8011         Contributed under MIT/X11 license.
8012
8013 2008-06-05  Martin Baulig  <martin@ximian.com>
8014
8015         * mono-debug-debugger.c
8016         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
8017
8018 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
8019
8020         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
8021         while holding the assemblies lock to prevent deadlocks. Handle the case
8022         where the search hook returns NULL but the assembly was still loaded.
8023         Fixes #323696.
8024
8025         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
8026         modify domain state.
8027
8028 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
8029
8030         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
8031         * Makefile.am (pedump_LDADD): Post-process object files and
8032         add dtrace-generated object file, if necessary.
8033
8034         Code is contributed under MIT/X11 license.
8035
8036 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8037
8038         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
8039
8040 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8041
8042         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
8043
8044 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8045
8046         * threads.c: Try to free everything from the delayed free table
8047         when shutting down threads, and set the variable to NULL after the
8048         table is freed so that calling
8049         mono_thread_hazardous_try_free_all() when shutting down the root
8050         domain doesn't crash.
8051
8052 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
8053
8054         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
8055         the caller if resulting type was inflated.
8056
8057         * class.c (mono_class_create_from_typespec): Free the MonoType if it
8058         was inflated.
8059
8060         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
8061
8062
8063 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
8064
8065         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
8066         class library tests.
8067
8068         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
8069         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
8070         #396989.
8071
8072 2008-06-04  Mark Probst  <mark.probst@gmail.com>
8073
8074         * domain.c, domain-internals.h: The JIT infos are now freed by the
8075         JIT info table code.  They are freed immediately if there only a
8076         single JIT info table in circulation.  If there is more, the free
8077         is delayed via a queue.
8078
8079         * threads.c, threads-types.h: New hazard pointer function for
8080         freeing all freeable delayed items in one sitting.
8081
8082 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8083
8084         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
8085
8086         * reflection.c (typebuilder_setup_properties): Same.
8087
8088         * reflection.c (typebuilder_setup_events): Same.
8089
8090 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8091
8092         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
8093         and use it for allocating memory.
8094
8095         * reflection.c (mono_marshal_spec_from_builder): Same.
8096
8097         * reflection.c: Change code to use new signatures.
8098
8099         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
8100
8101 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8102
8103         * decimal.c (rescale128): Put back one line which was accidently commented
8104         out.
8105         
8106         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
8107         to cause crashes.
8108
8109 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8110
8111         * reflection.c (mono_reflection_generic_class_initialize): Name must
8112         be always malloc'ed so we can free it later on. Do this for field, property
8113         and event.
8114
8115         * metadata.c (free_generic_class): Free field, property and event names.
8116
8117 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8118
8119         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
8120         instead of g_memdup.
8121
8122         * reflection.c (typebuilder_setup_fields): Same.
8123
8124 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8125
8126         * decimal.c (rescale128): Optimize this function a bit more.
8127
8128 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8129
8130         * metadata.c (free_generic_class): Release some memory from
8131         SRE generic classes.
8132
8133 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
8134
8135         * reflection.c (mono_image_get_generic_field_token): No reference
8136         to name is kept, free it.
8137
8138         * reflection.c (mono_reflection_generic_class_initialize): Free
8139         more memory of the inflated field.
8140
8141 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
8142
8143         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
8144         code.
8145
8146 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
8147
8148         * reflection.c (mono_dynamic_image_free): Release memory used by
8149         MonoDynamicImage::array_methods elements.
8150
8151         * reflection.c (assembly_add_win32_resources): Release memory after
8152         encoding.
8153
8154 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
8155
8156         * decimal.c (log2_32): Use an optimized version for this function too.
8157         
8158         * decimal.c (log2_64): Fix this on 32 bit machines.
8159
8160 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
8161
8162         * class.c (mono_dup_array_type): Implement allocation using a mempool.
8163
8164         * class.c (mono_metadata_signature_deep_dup): Same.
8165
8166         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
8167         a mempool.
8168
8169         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
8170
8171         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
8172
8173         * metadata-internals.h: Added mono_metadata_signature_dup_full.
8174
8175         * class-internals.h: Update signatures to take a MonoMemPool.
8176
8177 2008-06-02  Dick Porter  <dick@ximian.com>
8178
8179         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
8180         * icall-def.h: Add
8181         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
8182         FormatMessage API to get the error text.  Fixes bug 321827.
8183
8184 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
8185
8186         * decimal.c: Add some micro optimizations to make decimal operations faster.
8187
8188 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
8189
8190         * reflection.c (method_encode_clauses): Take a mempool
8191         as parameter and use it to allocate the clause array.
8192
8193         * reflection.c (mono_image_get_field_on_inst_token): Free
8194         the inflated type after encoding it.
8195
8196         * reflection.c (mono_dynamic_image_free): Free each element
8197         of MonoDynamicImage::gen_params.
8198
8199         * reflection.c (reflection_methodbuilder_to_mono_method):
8200         Allocate the generic param array from the mempool.
8201         Allocate signature params from the mempool.
8202
8203         * reflection.c (mono_reflection_generic_class_initialize):
8204         Free inflated fields after been used.
8205
8206 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
8207
8208         * icall.c: Reapply the memory leak fixes as they no
8209         longer make mono crash.
8210
8211 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
8212
8213         * reflection.c (mono_type_get_object): Don't store the suplied
8214         MonoType with type_hash. A caller which pass a type that
8215         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
8216         might end with a pointer to freed memory.
8217         The solution is to use byval_arg or this_arg from the associated
8218         MonoClass of the supplied type.
8219
8220 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
8221
8222         * icall.c: Revert the rest of the last change as it breaks the build too.
8223
8224 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
8225
8226         * icall.c: Revert a leak fix as it's breaking the build.
8227
8228 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
8229
8230         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
8231
8232 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
8233
8234         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
8235
8236 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
8237
8238         * icall.c: Fix some memory leaks.
8239
8240 2008-05-29  Dick Porter  <dick@ximian.com>
8241
8242         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
8243         async socket operations from the pending list when a socket
8244         closes.  Leaving it until the threadpool services the event
8245         exposes a race condition when a socket descriptor is reused.
8246         Fixes bug 377589.
8247
8248 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8249
8250         * object.c: Fix negative index check for array alocation.
8251
8252 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8253
8254         * icall.c, marshal.c: Delegate wrappers should skip visibility.
8255         This check is performed by the verifier for IL created delegates
8256         and by Delegate::CreateDelegate for programatically created ones.
8257         Fixes #372406.
8258
8259 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8260
8261         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
8262         Fix code to use mono_array_size_t instead of int.
8263
8264         Based on patch by Luis F. Ortiz.
8265         Contributed under X11 license.
8266         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8267
8268 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8269
8270         * icall.c: Added ves_icall_System_Array_GetLongLength and
8271         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
8272         arrays.
8273
8274         * icall.h: Export both new functions.
8275
8276         Based on patch by Luis F. Ortiz.
8277         Contributed under X11 license.
8278         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8279
8280 2008-05-28  Martin Baulig  <martin@ximian.com>
8281
8282         The debugger now requires exactly r103463.
8283
8284         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
8285         This version is not supported by the debugger, wait for 72.
8286
8287 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8288
8289         * object.h: Changed array related functions to use
8290         mono_array_size_t instead of guint32. Forgot to commit this file.
8291
8292         Patch by Luis F. Ortiz.
8293         Contributed under X11 license.
8294         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8295
8296
8297 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
8298
8299         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
8300         don't define it. Use the number literal instead.
8301
8302 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8303
8304         * icall.c: Changed array related functions to use
8305         mono_array_size_t instead of guint32.
8306
8307         * icall.c (ves_icall_System_Array_GetLength): Check for length
8308         overflow under MONO_BIG_ARRAYS.
8309
8310         Based on patch by Luis F. Ortiz.
8311         Contributed under X11 license.
8312         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8313
8314 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8315
8316         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
8317
8318         Based on patch by Luis F. Ortiz.
8319         Contributed under X11 license.
8320         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8321
8322 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8323
8324         * object.c, object.h: Changed array related functions to use
8325         mono_array_size_t instead of guint32.
8326
8327         Patch by Luis F. Ortiz.
8328         Contributed under X11 license.
8329         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8330
8331 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
8332
8333         * object.h: Introduced mono_array_size_t typedef. This must be used
8334         in all places an array length is expected. This is 64bits wide if
8335         MONO_BIG_ARRAYS is enabled.
8336
8337         Patch by Luis F. Ortiz.
8338         Contributed under X11 license.
8339         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
8340
8341 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
8342
8343         * security-manager.c class.c: Set the class exception info by calling
8344         mono_class_set_failure ().
8345
8346         * class.c (mono_class_get_exception_data): New accessor function.
8347         (mono_class_set_failure): Store exception_data in the property hash.
8348
8349         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
8350         the struct as a property.
8351
8352         * loader.c (mono_get_method_full): Store the lookup result for method
8353         tokens in method_cache, the others in methodref_cache to decrease the memory
8354         usage of hash tables.
8355
8356         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
8357         (mono_image_init): method_cache is lazy inited now.
8358
8359         * metadata-internals.h (struct _MonoImage): Change method_cache to
8360         a MonoValueHashTable, add a separate methodref_cache.
8361
8362 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
8363
8364         * number-formatter.h: Fix tables to avoid arithemtic overflow in
8365           Double.ToString as exposed by Bug #383531.
8366
8367 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
8368
8369         * number-formatter.h: Make some tables static.
8370
8371         * class.c (mono_method_set_generic_container): New accessor function.
8372         (mono_method_get_generic_container): Ditto.
8373
8374         * class-internals.h (struct _MonoMethod): Remove rarely used 
8375         'generic_container' field, store it in the property hash instead. Add 
8376         'is_generic' boolean field instead.
8377
8378         * image.c (mono_image_init): Initialize property_hash.
8379         (mono_image_close): Destroy property_hash.
8380
8381         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
8382         hold rarely used fields of runtime structures belonging to this image.
8383
8384         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
8385         to get/set method->generic_container.
8386
8387         * loader.c (mono_get_method_from_token): Avoid loading the method header for
8388         generic methods.
8389
8390 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
8391
8392         * class.c (mono_class_inflate_generic_method_full): Don't increase
8393         mono_stats.inflated_method_count for methods found in the cache.
8394
8395         * threads.c (mono_thread_request_interruption): Add a comment about 
8396         QueueUserAPC ().
8397
8398 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
8399
8400         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
8401         interface_offsets_packed table.
8402         
8403         * class.c (mono_class_init): Remove some dead code.
8404
8405         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
8406         mono_class_setup_vtable () when CAS is active to detect security problems.
8407
8408 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
8409
8410         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
8411
8412         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
8413         parameters as it's irrelevant for delegate checking.
8414
8415 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
8416
8417         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
8418
8419         * class.c (mono_class_init): Control the creation of a generic vtable using
8420         a global which is true by default, but set to false by the runtime startup code.
8421         
8422         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
8423         Disabled for now since it breaks the embedding API.
8424         Move the setup of class->methods for arrays to mono_class_setup_methods ().
8425         (mono_class_setup_methods): Add a memory barrier.
8426
8427         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
8428         when mono_class_init () doesn't compute the generic vtable.
8429         
8430 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
8431         * profiler.c: Added mono_profiler_install_statistical_call_chain,
8432         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
8433         to support call chains (backtrace) in the stat profiler.
8434         * profiler.c, profiler-private.h: Likewise.
8435
8436 2008-05-22  Mark Probst  <mark.probst@gmail.com>
8437
8438         * generic-sharing.c: Init generic class when a method of it is
8439         requested via a runtime generic context.
8440
8441 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
8442
8443         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
8444
8445         * reflection.c (mono_type_get_object): Add a FIXME.
8446
8447         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
8448
8449         * class.c (mono_class_get_method_by_index): New helper function, returning an
8450         entry in the class->methods array.
8451
8452 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
8453
8454         * class.c (mono_class_init): Only do the array optimization for szarrays. 
8455         Avoid creating a generic vtable for generic instances as well.
8456         (mono_class_get_method_from_name_flags): Don't search in the metadata for
8457         generic instances.
8458
8459 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
8460
8461         * loader.c (mono_get_method_constrained): Inflate the signature
8462         with class context. Fix #325283.
8463
8464 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
8465
8466         * object.c (mono_class_create_runtime_vtable): Add a comment.
8467
8468         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
8469         where needed.
8470         (setup_interface_offsets): Handle the case when this is called twice for arrays.
8471         (mono_class_setup_vtable_general): Add an assert.
8472         (mono_class_init): Avoid creating a generic vtable for arrays.
8473
8474         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
8475         here, let mono_class_init () do that.
8476
8477         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
8478         interfaces in mscorlib.
8479
8480         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
8481         interfaces. Add some comments.
8482         (mono_class_init): Call mono_class_setup_methods () here since it is no
8483         longer called by mono_class_setup_vtable ().
8484
8485         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
8486         not set in class->vtable.
8487         (mono_class_create_runtime_vtable): Reenable the disabled code.
8488
8489         * object.c (mono_class_create_runtime_vtable): Disable the last change for
8490         now as it causes some test failures.
8491
8492         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
8493         if using the vtable trampoline. Also remove some strange code which put the
8494         generic methods themselves into the vtable slots. Remove the AOT init_vtable
8495         stuff as it is no longer needed.
8496
8497 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
8498
8499         * pedump.c: Give make --verify all option check code as well.
8500         Using --verify code won't check for metadata now.
8501
8502 2008-05-19  Martin Baulig  <martin@ximian.com>
8503
8504         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
8505
8506         * mono-debug.c
8507         (_mono_debug_using_mono_debugger): New global variable; it's set
8508         directly by the debugger, so mono_debug_using_mono_debugger() also
8509         works after attaching.
8510
8511 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
8512
8513         * object.c (mono_class_create_runtime_vtable): Use memory barriers
8514         as we do double checked locking on MonoClass::runtime_info and
8515         MonoClassRuntimeInfo::domain_vtables.
8516
8517 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
8518
8519         * debug-helpers.c (print_field_value): Fix a warning.
8520
8521 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
8522
8523         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
8524         set in the AOT case.
8525
8526 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
8527
8528         * class.c (mono_class_setup_vtable_general): Use memory barriers
8529         as we do double checked locking on MonoClass::vtable.
8530
8531 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
8532
8533         * reflection.c (resolve_object): Inflate only if the generic context
8534         is not null. Fixes #389886.
8535
8536 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
8537
8538         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
8539         instead of g_free.
8540
8541         Code is contributed under MIT/X11 license.
8542
8543 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8544
8545         * class.c: Revert unrelated change.
8546
8547 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8548
8549         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
8550         a generic instantiation, use mono_class_from_mono_type instead of playing
8551         with MonoType directly.
8552
8553 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
8554
8555         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
8556         checks must ignore generic instantiations, so mono_class_has_parent is not
8557         suitable. Fixes #390128.
8558
8559 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
8560
8561         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
8562         it to avoid registering tokens during metadata generation. Fixes #390023.
8563
8564 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
8565
8566         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
8567         consistent.
8568
8569         Contributed under MIT/X11 license.
8570
8571 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
8572
8573         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
8574         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
8575         to fixup the EXE image.
8576         (mono_cleanup): Use mono_close_exe_image.
8577         (mono_close_exe_image): New function.
8578         * image.c: Include "marshal.h".
8579         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
8580         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
8581         counting when the image is loaded outside of mono_image_open_full. Set status
8582         based on GetLastError.
8583         * coree.c: Include required headers. Add init_from_coree.
8584         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
8585         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
8586         (_CorExeMain): Set init_from_coree.
8587         (CorExitProcess): Only call ExitProcess for now.
8588         (CorBindToRuntimeEx): New stub implementation.
8589         (CorBindToRuntime): New function.
8590         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
8591         (MonoFixupExe): ILONLY executables require no fixups.
8592         (mono_set_act_ctx): New function to set activation context.
8593         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
8594         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
8595         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
8596         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
8597         as MONO_INTERNAL.
8598         * domain-internals.h: Add mono_close_exe_image.
8599
8600         Contributed under MIT/X11 license.
8601
8602 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
8603
8604         * metadata.c (mono_metadata_compute_size): Correctly calculate field
8605         size for generic param and event tables. Fixes #388977.
8606
8607 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
8608
8609         * loader.c (mono_method_signature): Use memory barriers because of the double
8610         checked locking pattern.
8611
8612         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
8613         aborting or aborted as well. Fixes #376391.
8614         
8615         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
8616         existing runtime state in the Suspend handler during shutdown.
8617
8618 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
8619
8620         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
8621
8622         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
8623         which are starting up or shutting down.
8624
8625         * threads.c (mono_threads_set_shutting_down): Don't return a value since
8626         this function never returns if the runtime is already shutting down.
8627
8628         * icall.c (ves_icall_System_Environment_Exit): Update after 
8629         mono_threads_set_shutting_down () signature change.
8630         
8631 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
8632
8633         * class.c: Added can_access_instantiation to verify if the instantiation
8634         is visible. Fix access check for nested types as they returned TRUE
8635         before doing type and generic instantiation visibility checks.
8636
8637 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
8638
8639         * reflection.c (mono_reflection_create_generic_class): The created type
8640         must have a different container from its TypeBuilder. Otherwise they
8641         will end sharing generic arguments, which is wrong.
8642
8643         Due to the sharing, making a generic instance of the created type using
8644         the TypeBuider generic arguments resulted in the generic type definition
8645         been returned, which is wrong as well.
8646
8647         As a bonus the code was leaking the type_params array. This memory should
8648         be allocated from the image mempool.
8649
8650         This fixes bug #354047.
8651
8652 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
8653
8654         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
8655         to here         as they are now used in assembly.c new code.
8656         Added a skipverification flag to MonoAssembly.
8657         New internal function mono_assembly_has_skip_verification.
8658
8659         * assembly.c: New function mono_assembly_has_skip_verification. It checks
8660         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
8661         part of #387274.
8662
8663 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
8664
8665         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
8666         needed. Fixes #387034.
8667
8668         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
8669
8670 2008-05-06  Miguel de Icaza  <miguel@novell.com>
8671
8672         * assembly.c (mono_assembly_load_reference): Prevent crash while
8673         disassembling Silverlight 2.0 executables while we still do not
8674         have GACed libraries.
8675
8676 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
8677
8678         * reflection.c: Special case generic type definitions as well. Fixes #383444.
8679
8680 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
8681
8682         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
8683         of the dynamic case. Fixes #387404.
8684
8685 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8686
8687         *verify.c (mono_verifier_is_class_full_trust): If under
8688         verify_all and the verifier mode was not set, only
8689         gac and corlib types are fulltrust. This makes --verify-all
8690         usable to detect unverifiable code, which is the expected
8691         use case.
8692
8693 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8694
8695         * verify.h: Ops, commited the header with debug
8696         enabled.
8697
8698 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
8699
8700         * verify.c (merge_stack): Use the new value on unverifiable
8701         stack merges.
8702
8703         * verify.c (verify_type_compatibility_full): Comparison
8704         of nullable types can't use mono_class_is_assignable_from.
8705
8706         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
8707         that makes all verification errors be reported.
8708
8709         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
8710         mono_method_verify.
8711
8712 2008-05-05  Robert Jordan  <robertj@gmx.net>
8713
8714         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
8715         support for value types. See #386415.
8716
8717         * object.c: comments.
8718
8719         Code is contributed under MIT/X11 license.
8720
8721 2008-05-05  Martin Baulig  <martin@ximian.com>
8722
8723         * debug-mono-symfile.h
8724         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
8725         for old pre-terrania symbol files.
8726
8727 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
8728
8729         * mono-config.c: Add ppc64 architecture.
8730
8731         Code is contributed under MIT/X11 license.
8732
8733 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
8734
8735         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
8736           PPC64 uses function descriptors as well.
8737
8738         Code is contributed under MIT/X11 license.
8739
8740 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
8741
8742         * object.c (compute_class_bitmap): Ignore literal static fields.
8743
8744         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
8745         var has an invalid format.
8746         (describe_ptr): Add some sanity checks for the vtable.
8747         (add_nursery_frag): Clear unused nursery fragments.
8748         (major_collection): Clear all remaining nursery fragments.
8749
8750 2008-05-03  Robert Jordan  <robertj@gmx.net>
8751
8752         * image.c, metadata-internals.h: add thunk_invoke_cache.
8753
8754         * marshal.c, marshal.h: implement
8755         mono_marshal_get_thunk_invoke_wrapper ().
8756
8757         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
8758
8759         Code is contributed under MIT/X11 license.
8760
8761 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
8762
8763         * verify.c (do_leave): Empty the stack.
8764
8765 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
8766
8767         * class.c (mono_class_is_assignable_from): Variance
8768         doesn't work between reference and value types. For example,
8769         given type C<T+>, C<int32> is not assignable to C<object>.
8770         Break the argument checking loop on first error. 
8771
8772 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
8773
8774         * icall.c : base64_to_byte_array() needs some more strict
8775           check for sequence of '=' characters. Patch by Santa
8776           Marta (http://deee.g.hatena.ne.jp/santamarta).
8777
8778           Contributed under MIT/X11 license.
8779           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
8780
8781 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
8782
8783         * domain.c: Disable LoadLibrary support to fix Win32 build.
8784
8785         Code is contributed under MIT/X11 license.
8786
8787 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
8788
8789         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
8790         to help with cache behaviour.
8791
8792 2008-05-01  Miguel de Icaza  <miguel@novell.com>
8793
8794         * appdomain.c (mono_domain_from_appdomain): Add new accessor
8795         method. 
8796
8797 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
8798
8799         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
8800
8801 2008-05-01  Dick Porter  <dick@ximian.com>
8802
8803         * process.c (process_get_fileversion): Only pass 16 bits of
8804         language ID to VerLanguageName.  Fixes bug 381204.
8805
8806 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
8807
8808         * verify.c (mono_method_verify): Fix the comparison
8809         operator for code bounds check.
8810
8811 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
8812
8813         * verify.c (mono_method_verify): Check the bounds of
8814         all access of the code array.
8815
8816 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
8817
8818         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
8819
8820 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
8821
8822         * image.c (mono_image_strong_name_position): Fix return value when the rva is
8823         not valid.
8824
8825 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
8826
8827         * loader.c (mono_get_method_from_token, mono_method_signature): Add
8828         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
8829         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
8830         fixup main EXE images when using mono.exe for mixed-mode assembly support.
8831         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
8832         mono_runtime_load.
8833         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
8834         runtime initialization from metadata.
8835         * assembly.c: Remove obsolete ceGetModuleFileNameA.
8836         (mono_set_rootdir): Use mono_get_module_file_name.
8837         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
8838         handles.
8839         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
8840         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
8841         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
8842         MonoCLIImageInfo. Add support for module handles.
8843         (load_cli_header): Update mono_cli_rva_image_map signature.
8844         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
8845         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
8846         (mono_image_rva_map): Add support for module handles.
8847         (mono_image_ensure_section_idx): Add support for module handles.
8848         (mono_image_close): Add support for module handles.
8849         (do_load_header): Add support for module handles.
8850         (mono_image_open_from_module_handle): New function for internal use.
8851         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
8852         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
8853         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
8854         handles.
8855         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
8856         * image.h: Add mono_image_fixup_vtable.
8857         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
8858         support.
8859         * coree.h: New file.
8860         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
8861         unsupported native code.
8862         (mono_marshal_set_callconv_from_modopt): New function splitted from
8863         mono_marshal_get_managed_wrapper.
8864         (mono_marshal_get_managed_wrapper): Use
8865         mono_marshal_set_callconv_from_modopt.
8866         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
8867         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
8868         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
8869         that results in a deadlock when the runtime is loaded in _CorDllMain.
8870         * Makefile.am: Add coree.c and coree.h.
8871
8872         Contributed under MIT/X11 license.
8873
8874 2008-04-28  Mark Probst  <mark.probst@gmail.com>
8875
8876         * generic-sharing.c: Search for type arguments in array element
8877         types as well.
8878
8879 2008-04-28  Mark Probst  <mark.probst@gmail.com>
8880
8881         * class-internals.h, generic-sharing.c: New, small runtime generic context.
8882
8883         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
8884
8885         * object.c: Don't setup the RGCTX when the vtable is created,
8886         because we're setting it up lazily now.
8887
8888 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
8889
8890         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
8891         64 bit support.
8892
8893 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
8894
8895         * verify.c (verify_class_for_overlapping_reference_fields): 
8896         If class is under fulltrust allow reference types to overllap
8897         if they have the same RVA.
8898
8899 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
8900
8901         * pedump.c: Added new flag valid-only, that makes the verifier
8902         behaves just like --security=validil. It won't fail type load
8903         due to unverifiable restrictions.
8904
8905 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
8906
8907         * class-internals.h (struct MonoMethod): Added a verification_success
8908         field to cache verifier executions. Reduced MonoMethod:slot size by
8909         one bit.
8910
8911 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
8912
8913         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
8914         instead of a 'vt' argument to save an indirection and to allow these to be used
8915         for valuetypes.
8916         (scan_vtype): New helper function to scan an area using a gc descriptor.
8917         (mono_gc_wbarrier_value_copy): Implement this.
8918         (handle_remset): Add support for REMSET_VTYPE.
8919         (find_in_remset_loc): Ditto.
8920         (mono_gc_base_init): Allow some debugging options to be controlled through the
8921         use of the MONO_GC_DEBUG env variable.
8922         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
8923         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
8924
8925 2008-04-23  Martin Baulig  <martin@ximian.com>
8926
8927         * domain.c (mono_domain_create): Move the call to
8928         mono_debug_domain_create() down, after allocating the domain id.
8929
8930 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
8931
8932         verify.c (verify_class_for_overlapping_reference_fields): Skip
8933         static fields while verifying for overlapping fields as they
8934         don't matter at all.
8935
8936 2008-04-23  Marek Habersack  <mhabersack@novell.com>
8937
8938         * domain-internals.h: added a declaration of
8939         mono_make_shadow_copy.
8940
8941         * assembly.c (mono_assembly_open_full): shadow copying of
8942         assemblies moved to here, so that all the assemblies within the
8943         application domain's private binary directories can be
8944         processed. Fixes bug #380546
8945
8946         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
8947         mono_make_shadow_copy and made non-static. The decision whether
8948         to shadow-copy an assembly is made based on its location - it's
8949         copied if it's in one of the private application domain binary
8950         directories and its different to the target file in the shadow
8951         directory. Fixes bug #380546
8952
8953 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
8954
8955         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
8956
8957         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
8958         types.
8959
8960         * reflection.c (mono_image_create_token): Handle 
8961         Method/ConstructorOnTypeBuilderInst.
8962         (resolve_object): Ditto.
8963         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
8964         so it can be called from resolve_object. Also handle the case when the inflated
8965         class already has its methods setup.
8966
8967 2008-04-21  Martin Baulig  <martin@ximian.com>
8968
8969         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
8970
8971 2008-04-20  Geoff Norton  <gnorton@novell.com>
8972
8973         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
8974         pointer dereference.
8975
8976 2008-04-15  Marek Habersack  <mhabersack@novell.com>
8977
8978         * appdomain.c (try_load_from): if IOMAP is in effect, call the
8979         portability API to look up the assembly file. Fixes behavior in
8980         situations when the application has a bin/ directory, but the
8981         assembly search patch refers to Bin/ (and thus the requested file
8982         name is Bin/SomeLibrary.dll). Fixes bug #379888
8983
8984 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
8985
8986         verify.c (mono_type_is_generic_argument): Extracted this check
8987         from a dozen places to here.
8988
8989         verify.c: Fixed all issues related to boxing generic arguments
8990         and their constraints.
8991
8992 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
8993
8994         verify.c (mono_class_interface_implements_interface): Fix win32 build.
8995
8996 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
8997
8998         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
8999         isn't finished yet. Fixes #363447.
9000
9001 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
9002
9003         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
9004         Fixes #346419.
9005
9006 2008-04-13  Jb Evain  <jbevain@novell.com>
9007
9008         * domain.c: update the 2.1 profile versions.
9009         Merged from the Moonlight 2 branch.
9010
9011 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
9012
9013         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
9014         mscorlibs for the non-refonly case as well.
9015
9016         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
9017         in mono_assembly_load_from_full (). Fixes #378924.
9018
9019 2008-04-11  Geoff Norton  <gnorton@novell.com>
9020
9021         * icall.c: The global extern environ doesn't exist on Mac.  We
9022         need to call NSGetEnviron instead.
9023
9024 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9025
9026         verify.c: Add generic method constraint verification.
9027
9028 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9029
9030         class.c (mono_class_inflate_generic_method_full): Add a long
9031         explanation to the is_mb_open hack. Remove the FIXME.
9032
9033 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9034
9035         * verify.c (mono_method_verify): Mark all unknown opcodes
9036         as invalid. Mark jmp as unverifiable.
9037
9038 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9039
9040         * verify.c: Add code to do type constraint verification on class instances.
9041
9042         * verify.c (mono_verifier_verify_class): Use the type constraint 
9043         verification code.
9044
9045 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
9046
9047         * class.c (mono_class_get_field_default_value): Don't pass cindex
9048         as hint to mono_metadata_get_constant_index. The local is not initialized
9049         and should contain garbage most of the time. This could only work
9050         with a lot of luck.
9051
9052 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9053
9054         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
9055
9056 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
9057
9058         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
9059
9060         * class.c (mono_class_from_generic_parameter): Save the token of the
9061         generic param in MonoClass::sizes.generic_param_token.
9062
9063         * reflection.c (mono_custom_attrs_from_class): If the class type is
9064         VAR or MVAR retrieve the attributes of the generic param.
9065
9066 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9067
9068         * class.c (mono_class_init): Do class verification if the verifier
9069         is enabled.
9070
9071 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9072
9073         * verify-internal.h: Added mono_verifier_verify_class.
9074
9075         * verify.c: Added mono_verifier_verify_class. It checks for
9076         classes with explicit layout that have overlapping reference fields.
9077
9078         * pedump.c: Init the verifier state prior to verification. Fixed
9079         command line arguments.
9080
9081 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
9082
9083         * Makefile.am: Added verify-internals.h, hopefully fix the build.
9084
9085 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
9086
9087         * verify-internals.h: Fix a warning.
9088
9089 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9090
9091         * verify-internals.h: New header with the verifier configuration
9092         extracted from mini.c.
9093
9094         * verify.c: Implemented the new functions exported by verify-internals.h.
9095
9096 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
9097
9098         * verify.c: Add proper verification of ckfinite.
9099
9100 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9101
9102         * verify.c (do_conversion): Improved error message to something
9103         more meanfull.
9104
9105         * verify.c (check_is_valid_type_for_field_ops): Fix to work
9106         with primitive types.
9107
9108 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9109
9110         * verify.c: Added tail prefix checking. Marked icall
9111         as unverifible.
9112
9113 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
9114
9115         * verify.c: Fix the detection of branches to the middle
9116         of an instruction.
9117
9118 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
9119
9120         * verify.c: Implemented verification of volatile. and
9121         unaligned. prefix. Check if a type is valid after retrieving it.
9122
9123 2008-04-01  Dick Porter  <dick@ximian.com>
9124
9125         * process.c (process_get_fileversion): If there's no string block,
9126         set the file language to en_US.  Fixes the other new part of bug
9127         374600.
9128
9129 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
9130
9131         * class.c: New functions mono_method_can_access_field_full and
9132         mono_method_can_access_method_full. They perform type visibility
9133         and type site check.
9134
9135         * class-internal.h: Added exported functions.
9136
9137         * verify.c: Use new functions to implement proper visibility checks.
9138
9139 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
9140
9141         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
9142
9143 2008-03-28  Dick Porter  <dick@ximian.com>
9144
9145         * process.c (process_get_fileversion): Use the first language ID
9146         we see, rather than insisting on an invariant language.  Fixes bug
9147         374600.
9148
9149 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
9150
9151         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
9152         the streams to fix reading of invalid memory later.
9153
9154         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
9155         to ease debugging.
9156
9157 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
9158
9159         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
9160         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
9161
9162 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
9163         * threads.h: Added MonoThreadManageCallback type and
9164         mono_thread_set_manage_callback prototype
9165         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
9166         (used to store the mono_thread_manage callback).
9167         * threads.c: Added mono_thread_set_manage_callback, and handle
9168         "MonoThread->manage_callback" in build_wait_tids.
9169
9170 2008-03-26  Dick Porter  <dick@ximian.com>
9171
9172         * process.c (process_get_fileversion): Set FileVersionInfo strings
9173         to Empty when the resource doesn't have the particular info.
9174         Fixes bug 355717.
9175
9176 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
9177
9178         * verify.c (mono_method_verify): Proper prefix validation.
9179
9180 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
9181
9182         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
9183         itself in a separate argument instead of throwing them. Fixes #373448.
9184
9185         * appdomain.c: Bump corlib version.
9186
9187 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
9188
9189         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
9190
9191 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
9192
9193         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
9194         version macros.
9195
9196 2008-03-20  Mark Probst  <mark.probst@gmail.com>
9197
9198         * generic-sharing.c, class-internals.h: Code for putting
9199         reflection types into the runtime generic context.
9200
9201 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
9202
9203         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
9204         Fixes #340662. 
9205
9206
9207 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
9208
9209         * verify.c (VerifyContext): Added instruction prefix data to the struct.
9210
9211         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
9212
9213         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
9214
9215         * verify.c (do_cast): Let the result value keep the boxed status.
9216
9217         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
9218
9219 2008-03-17  Jb Evain  <jbevain@novell.com>
9220
9221         * reflection.c: when running on a 2.0 runtime, emit
9222         unconditionally the #~ header version as 2.0, and the
9223         CLI header version as 2.5, for symmetry's sake with csc.
9224
9225 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
9226
9227         * class.c: Remove the unused cache_interface_offsets stuff.
9228
9229         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
9230         profiler.c: Fix warnings.
9231
9232 2008-03-16  Mark Probst  <mark.probst@gmail.com>
9233
9234         * generic-sharing.c, class-internals.h: Support for putting
9235         methods into the runtime generic context.
9236
9237 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
9238
9239         * class.c (mono_class_setup_fields): Ignore calls made to this function for
9240         classes which are generic instances of not-yet finished typebuilders. Fixes
9241         #351172.
9242
9243         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
9244
9245 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
9246
9247         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
9248
9249         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
9250         field, replace it with a hash table in MonoDynamicImage.
9251
9252         * reflection.c (inflate_mono_method): Access the generic definition object from
9253         image->generic_def_objects instead of imethod->reflection_info.
9254
9255         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
9256
9257         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
9258         
9259         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
9260         function in reflection.c so it is easier to keep in sync with the dynamic image
9261         creation code.
9262
9263         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
9264         mono_image_close ().
9265
9266 2008-03-15  Mark Probst  <mark.probst@gmail.com>
9267
9268         * class.c (mono_class_generic_sharing_enabled): Disable generic
9269         sharing for all architectures except AMD64 and x86 to fix build.
9270
9271 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
9272
9273         * verify.c: Use the generic definition MonoGenericContext when available.
9274         Remove code for checking generics instance compatibility in favor of
9275         mono_class_is_assignable_from.
9276
9277 2008-03-14  Mark Probst  <mark.probst@gmail.com>
9278
9279         * marshal.c, marshal.h, metadata-internals.h, image.c,
9280         wrapper-types.h: New wrapper for invoking a shared static method
9281         without having to pass the runtime generic context argument.
9282
9283 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
9284
9285         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
9286
9287 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
9288
9289         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
9290         
9291         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
9292         create a token from a FieldOnTypeBuilderInst.
9293         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
9294         (resolve_object): Ditto.
9295
9296         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
9297         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
9298
9299 2008-03-14  Martin Baulig  <martin@ximian.com>
9300
9301         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
9302
9303         * debug-mono-symfile.h
9304         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
9305         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
9306
9307 2008-03-10  Martin Baulig  <martin@ximian.com>
9308
9309         * debug-mono-symfile.h
9310         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
9311         `lexical_block_table_offset'.
9312         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
9313         `lexical_blocks'.
9314         (MonoSymbolFile): Added `version'.
9315
9316         * mono-debug.h
9317         (MonoDebugLexicalBlockEntry): Removed.
9318         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
9319         `lexical_blocks'.
9320
9321         * mono-debug.c (mono_debug_add_method): Don't compute lexical
9322         blocks here; the debugger now does this internally.
9323
9324 2008-02-27  Martin Baulig  <martin@ximian.com>
9325
9326         * object.c (mono_runtime_exec_main): Call
9327         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
9328         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
9329
9330 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
9331
9332         * verify.c (verify_type_compatibility_full): Allow native int to be converted
9333         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
9334
9335 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
9336
9337         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
9338         ldftn with a virtual method.
9339
9340 2008-03-13  Geoff Norton  <gnorton@novell.com>
9341
9342         * decimal.c:  Only include memory.h if the platform has it.
9343
9344 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
9345
9346         * assembly.c, class.c, metadata-internals.h: make sure public key
9347         tokesns are compared in a case-insensitive way. Also, all
9348         the lookups in the GAC use a lowercase public key token
9349         (gaacutil already does the lowercasing on install). Fixes
9350         bug #369541.
9351
9352 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
9353
9354         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
9355         and return value.
9356
9357 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
9358
9359         * image.c: when someone loads a mscorlib from a file, return the
9360         currently loaded mscorlib (fixes bug #369253).
9361
9362 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
9363
9364         * class.c: handle types with no parents by forcing them to have
9365         System.Object as a parent and marking them as broken (this currently
9366         allows the first part of bug #369173 to work as well, likely because
9367         we don't check for typeload exceptions everywhere yet).
9368
9369 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
9370
9371         * class.c: more complete check that types belong to corlib
9372         (fixes second part of bug #369173).
9373
9374 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
9375
9376         * generic-sharing.c:  Including glib.h for the MSVC builds to define
9377           "inline" to "__inline" before including mono-membar.h.
9378           
9379         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
9380           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
9381           MSVC builds.
9382
9383         Contributed under MIT/X11 license.
9384
9385 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
9386
9387         * verify.c (do_invoke_method): Remove return type validation.
9388
9389         * verify.c (do_ret): Do return type validation at return site instead of
9390         call site.
9391
9392 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
9393
9394         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
9395
9396         * verify.c: Some todos cleaned and improved a few error messages.
9397
9398 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
9399
9400         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
9401
9402 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
9403
9404         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
9405         system types correctly.
9406
9407         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
9408         function.
9409
9410 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
9411
9412         * assembly.c (build_assembly_name): Fix a warning.
9413
9414 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
9415
9416         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
9417         the called function takes an object type argument. Fixes storing or
9418         valuetypes across remoting as well as reducing memory usage.
9419         * image.c, metadata-internals.h: remove now unused ldfld_remote and
9420         stfld_remote wrapper caches.
9421
9422 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
9423
9424         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
9425         is not found.
9426
9427         * reflection.c (mono_image_register_token): New helper function to save
9428         a token->object mapping.        
9429
9430         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
9431         managed code.
9432
9433         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
9434         one dimension arrays. Fixes #367670.
9435         (mono_reflection_get_type_internal): Ditto.
9436
9437 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
9438
9439         * marshal.c: mono_load_remote_field_new() always returns object.
9440         so use the proper signature (fixes bug #366445).
9441
9442 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
9443         
9444         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
9445         add an 'inline_failure' flag instead.
9446
9447 2008-03-04  Mark Probst  <mark.probst@gmail.com>
9448
9449         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
9450         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
9451         contains the location of "this", used for exception handling.
9452
9453 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
9454
9455         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
9456         their size on all platforms for perf reasons.
9457
9458 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9459
9460         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
9461         object-internal.h
9462
9463         * object-internal.h: Same.
9464
9465 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9466
9467         * reflection.h: Fix the build I just broke.
9468
9469 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9470
9471         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
9472         Test if a token is valid, this remove explicit usage of 
9473         MonoDynamicImage::tokens from the verifier code.
9474
9475         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
9476
9477         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
9478         instead of direct access to MonoDynamicImage::tokens.
9479
9480 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9481
9482         * verify.c (token_bounds_check): Fix the build I just broke.
9483
9484 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
9485
9486         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
9487
9488         * verify.c (verifier_load_method): Fixed the errors message.
9489
9490         * verify.c (mono_method_verify): Fixed a debug message.
9491
9492 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
9493
9494         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
9495         mono-perfcounters.h, class-internals.h: support for predefined
9496         writable counters, query of categories and counters, bugfixes.
9497
9498 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
9499
9500         * verify.c (do_refanytype): Verify the refanytype opcode.
9501
9502         * verify.c (mono_method_verify): Use do_refanytype.
9503
9504 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
9505
9506         * verify.c (do_mkrefany): Verify the mkrefany opcode.
9507
9508         * verify.c (mono_method_verify): Use do_mkrefany.
9509
9510 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
9511
9512         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
9513         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
9514         implementation.
9515
9516 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
9517
9518         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
9519         the type load exception.
9520
9521 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
9522
9523         * verify.c: Added a few FIXME for method signatures
9524
9525         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
9526         of mono_method_get_signature and get vararg call working. Removed unused
9527         checks for return value.
9528
9529         * verify.c (do_refanyval): Verify the refanyval opcode.
9530
9531         * verify.c (mono_method_verify): Implemented verification of arglist and
9532         use do_refanyval.
9533
9534 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
9535
9536         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
9537         vtypes to marshal.c.
9538
9539         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
9540         it works for AOT as well.
9541
9542 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
9543
9544         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
9545         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
9546         the system time is adjusted.
9547
9548 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
9549
9550         * icall.c, icall-def.h: use the new time functions (fixes the
9551         non-monotonic behaviour of TickCount).
9552
9553 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
9554
9555         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
9556         it breaks the build.
9557         
9558         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
9559         cattr is not finished yet.
9560
9561 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
9562
9563         * verify.c: Proper token validation for field, method and type.
9564
9565 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
9566
9567         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
9568
9569         * loader.c (method_from_memberref): Generate type load error instead of method missing
9570         if the type is not found.
9571
9572 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
9573
9574         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
9575         some of the conversions caused the generation of a marshal directive exception.
9576
9577 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
9578
9579         verify.c: Report which exception should be thrown by the JIT.
9580         Added a lot of FIXME notes.
9581
9582 2008-02-22  Mark Probst  <mark.probst@gmail.com>
9583
9584         * generic-sharing.c: Runtime generic context slots are not
9585         instantiated on init anymore.  Instead, provide function to do the
9586         instantiating on demand.
9587
9588         * class-internals.h: Added vtable to runtime generic context.
9589         Macros for encoding direct and indirect slot offsets in one
9590         guint32.
9591
9592 2008-02-21  Mark Probst  <mark.probst@gmail.com>
9593
9594         * object.c, generic-sharing.c: Moved some generic sharing code
9595         from object.c to generic-sharing.c.
9596
9597         * generic-sharing.c: Added support for extensible runtime generic
9598         context.
9599
9600         * metadata-internals.h: Two new hash tables in MonoImage for
9601         extensible runtime generic context support.
9602
9603         * domain.c: Unregister generic vtables upon domain unloading.
9604
9605         * image.c: Destroy new hash tables upon image unloading.
9606
9607         * metadata.c: Unregister generic subclasses upon image unloading.
9608
9609         * class-internals.h: New data structure for runtime generic
9610         context template.  New fields in the runtime generic context for
9611         extensible part.
9612
9613         * Makefile.am: Added generic-sharing.c.
9614
9615 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
9616
9617         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
9618         there is a pending loader exception, raise it.
9619
9620         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
9621         same.
9622
9623         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
9624         same.
9625
9626         Fixes #363450.
9627
9628 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
9629
9630         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
9631
9632         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
9633         
9634         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
9635         ref-only requests for compatibility with MS.
9636
9637 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
9638
9639         * reflection.c (mono_custom_attrs_from_method): Don't silently
9640         return an empty list for generic method instances.
9641         (mono_custom_attrs_from_param): Likewise.
9642
9643 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
9644             Raja R Harinath  <harinath@hurrynot.org>
9645
9646         Fix #354757
9647         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
9648         * class.c (mono_class_inflate_generic_method_full): Initialize it
9649         when a fully-open method is instantiated.
9650         * metadata.c (inflated_method_equal, inflated_method_hash): Update
9651         to new field.
9652         * reflection.c (inflate_mono_method): Don't create a temporary context.
9653
9654 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
9655
9656         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
9657         Compute correct value, to prepare for imethod->reflection_info going away.
9658
9659 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
9660
9661         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
9662
9663 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
9664
9665         * verify.c: Implement skip visibility flag.
9666
9667 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
9668
9669         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
9670         which contains an extra field to tell the kind of exception that should be thrown.
9671
9672         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
9673
9674 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
9675
9676         * loader.c (mono_method_get_param_names): Initialize 'klass' after
9677         'method' is updated.
9678
9679 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
9680
9681         * class.c (mono_class_layout_fields): Set class->min_align for classes using
9682         explicit layout as well. Fixes #360375.
9683
9684 2008-02-11  Geoff Norton  <gnorton@novell.com>
9685
9686         * loader.c: Guard and dereference against inflated generic methods
9687
9688 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
9689
9690         * class.c: Include Retargetable spec in assembly name.
9691         * assembly.c: Always include PublicKeyToken spec in assembly name
9692         (with value "null" if assembly is not signed), and include
9693         Retargetable spec.
9694         * icall-def.h: Added icall for Assembly.get_fullname.
9695         * icall.c: Added icall returning the fullname of an assembly.
9696
9697 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
9698
9699         * class.c (mono_class_setup_vtable_general): Add a missing call to
9700         mono_class_setup_methods () which is needed in the AOT case.
9701
9702 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
9703
9704         * verify.c (mono_type_get_stack_name): Added. Return the name for the
9705         stack type of the given MonoType.
9706
9707         * verify.c (verify_type_compatibility_full): Handle the void type.
9708
9709         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
9710         way stack merging works.
9711
9712         * verify.c (store_local): Improved verification message.
9713
9714         * verify.c (do_branch_op): If the merging is invalid, the method
9715         is unverifiable and not invalid. Improved error message.
9716
9717         * verify.c (merge_stacks): Properly merge a boxed valuetype and
9718         a reference type diferent than System.Object. Improved error
9719         message.
9720
9721 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
9722
9723         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
9724
9725         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
9726         type of an enum even if the argument is byref.
9727
9728         * verify.c: Replace all explicit uses of enumtype and enum_basetype
9729         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
9730
9731         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
9732
9733         *verify.c (verify_type_compatibility_full): Make enum types
9734         compatible with their base types.
9735
9736         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
9737         types are compatible for the special case of a boxed valuetype and
9738         System.Object.
9739
9740         * verify.c (verify_stack_type_compatibility): The function
9741         is_compatible_boxed_valuetype was extracted from here.
9742
9743         * verify.c (push_arg): Only set ctx->has_this_store if the method
9744         is not static.
9745
9746         * verify.c (do_ldelem): Fixed a typo in an error message and added
9747         strict check for mixing int32 and native int as the array type
9748         and ldelem type.
9749
9750         * verify.c (merge_stacks): Consider boxed valuetypes in the
9751         compatibility checks.
9752
9753 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
9754         * profiler.h: (MonoGCEvent): Added start-stop the world events.
9755
9756 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
9757         *class.c: use_new_interface_vtable_code: renamed the env var to have
9758         a "MONO_" prefix, and fix the logic to enable it by default.
9759
9760 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
9761         *class.c:
9762         mono_class_setup_vtable_general: rewrote the way in which interface
9763         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
9764         makes the code more maintainable.
9765         For now the old code is still there, and can be activated setting
9766         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
9767
9768 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
9769
9770         * verify.c: guarded some debug functions around and #ifdef.
9771
9772         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
9773
9774 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
9775
9776         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
9777         changes for now since they seem to break too many things.
9778
9779 2008-02-05  Mark Probst  <mark.probst@gmail.com>
9780
9781         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
9782         mono_marshal_find_nonzero_bit_offset): Added macro and function
9783         for finding the byte- and bit-offset of a bitfield within a
9784         struct.
9785
9786 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
9787
9788         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
9789         (mono_marshal_get_struct_to_ptr): Ditto.
9790
9791         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
9792         cctor_signature.
9793
9794 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
9795
9796         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
9797         between methods for non-corlib types.
9798
9799 2008-02-02  Geoff Norton  <gnorton@novell.com>
9800
9801         * loader.c (mono_method_get_param_names): Populate the parameter name for 
9802         generic parameters as well. (Fixes #342536)
9803
9804 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
9805
9806         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
9807
9808         * verify.c (do_invoke_method): Fix for calling with byref structs.
9809
9810         * verify.c (do_cast): push a boxed value type based on the type token and not
9811         the type of stack.
9812
9813 2008-01-31  William Holmes  <billholmes54@gmail.com>
9814
9815         * process.c (process_module_string_read): Check the size returned form 
9816           VerQueryValue to avoid out of memory exception. 
9817
9818 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
9819
9820         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
9821         Handle properly modules which are not in the moduleref table. Fixes
9822         #356938.
9823
9824 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
9825
9826         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
9827         the dynamic case which is now in managed code.
9828         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
9829
9830         * marshal.c (mono_string_to_bstr): Fix a warning.
9831         (init_com_provider_ms): Ditto.
9832
9833         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
9834
9835         * exception.c (mono_get_exception_out_of_memory): New helper function.
9836
9837 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
9838
9839         * marshal.c: Add support for BSTR marshalling
9840         using other COM systems.
9841
9842         Code is contributed under MIT/X11 license.
9843
9844 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9845
9846         * object.c (mono_runtime_invoke_array): reverted previous
9847         commit as it breaks the build.
9848
9849 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9850
9851         * object.c (mono_runtime_invoke_array): Verify arguments for
9852         invalid types. Fixes #348522.
9853
9854 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
9855
9856         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
9857         non-final virtual calls using call. 
9858
9859         * verify.c (do_invoke): fixed some TODOs.
9860
9861         * verify.c (push_arg): set has_this_store for "ldarga 0".
9862
9863 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
9864
9865         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
9866         which belong to an inflated class. Fixes #356531.
9867
9868 2008-01-26  Robert Jordan  <robertj@gmx.net>
9869
9870         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
9871         which resort to FindFirstFile when a certain error condition
9872         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
9873         Code is contributed under MIT/X11 license.
9874
9875 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
9876
9877         * marshal.c (emit_marshal_string): Fix out string marshalling
9878         to use specified encoding. Fixes #323900.
9879
9880         Code is contributed under MIT/X11 license.
9881
9882 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
9883
9884         * class.c (mono_class_inflate_generic_method_full): Don't modify
9885         iresult->context after cache check.
9886
9887 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
9888
9889         * class.c (mono_class_inflate_generic_method_full): Change the
9890         struct assignments to memcpy for better visibility and add some comments.
9891
9892 2008-01-23  Dick Porter  <dick@ximian.com>
9893
9894         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
9895         procedure, and make it work on windows.
9896
9897 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
9898
9899         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
9900         a MonoReflectionTypeBuilder since it is always of that type.
9901
9902         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
9903
9904         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
9905
9906         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
9907         
9908         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
9909
9910         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
9911
9912         * reflection.c (mono_reflection_create_runtime_class): Remove already created
9913         instantiations from the type cache.
9914
9915 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9916
9917         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
9918
9919         * verify.c (do_unbox_value): push a controled mutability managed pointer.
9920
9921 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9922
9923         * verify.c (do_ldstr): added, verifies if the #US token is valid.
9924
9925         * verify.c (mono_method_verify): removed old TODO
9926
9927 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9928
9929         * verify.c (do_newobj): add visibility check.
9930
9931 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
9932
9933         * verify.c (do_load_function_ptr): add visibility check.
9934
9935 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
9936         *class.c:
9937         mono_generic_class_get_class: hook profiler events.
9938         mono_field_get_offset: added to support heap-shot in the new profiler.
9939         *class.h: exported mono_field_get_offset.
9940         * reflection.c:
9941         mono_reflection_setup_internal_class: hook profiler events.
9942
9943 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
9944
9945         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
9946         argument here too and use it to avoid checking for pending exceptions if 
9947         possible.
9948
9949 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
9950
9951         * assembly.c (build_assembly_name): add arg for passing the assembly
9952         flags. Do not consider a PublicKey with value "null" valid.
9953         (mono_assembly_name_parse_full): added boolean argument that will be
9954         set if the assembly name contains a PublicKeyToken spec. Added support
9955         for the Retargetable spec for which only Yes or No are allowed as valid
9956         value. Consider assembly name invalid if Retargetable spec is set, but
9957         either version, culture or public key (token) are not specified.
9958         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
9959         with implementation in assembly.c.
9960         * icall.c (fill_reflection_assembly_name): also copy assembly flags
9961         from MonoAssemblyName.
9962         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
9963         introduced argument for mono_assembly_name_parse_full to know if the
9964         assembly name has a PublicKeyToken spec, and if it has instruct
9965         fill_reflection_assembly_name to use default value for keyToken (if
9966         PublicKeyToken is null).
9967
9968 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
9969
9970         * verify.c (mono_method_verify): fixed ovf ops with
9971         float values. They are unverifiable now.
9972
9973 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
9974
9975         * class.c (set_failure_from_loader_error): add BadImageException to the
9976         list of exceptions that can cause a type to fail to load.
9977
9978         * class.c (mono_class_get_exception_for_failure): same.
9979
9980 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
9981
9982         * verify.c (in_any_exception_block): added, check if offset
9983         is part of any exception handling clause.
9984
9985         * verify.c (get_stack_type): added VAR and MVAR types.
9986
9987         * verify.c (do_stobj): better error messages.
9988
9989         * verify.c (do_cpobj): added, check cpobj.
9990
9991         * verify.c (do_initobj): added, check initobj.
9992
9993         * verify.c (do_sizeof): added, check sizeof.
9994
9995         * verify.c (do_localloc): added, check localloc.
9996
9997         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
9998
9999 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
10000
10001         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
10002         save_lmf/restore_lmf opcodes.
10003
10004         * threads.c (mono_threads_install_notify_pending_exc): New function to
10005         install a callback notifying the JIT there is a pending exception on a thread.
10006         (mono_thread_request_interruption): Call the new callback.
10007         (mono_thread_get_and_clear_pending_exception): New function to return the
10008         exception pending on a thread.
10009
10010         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
10011         to turn off checking for pending exceptions.
10012         (mono_marshal_get_native_wrapper): Ditto.
10013
10014 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10015
10016         * threads-types.h: Get rid of the unnecessary extern declarations.
10017
10018 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
10019
10020         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
10021         return field from parent class if not private.
10022         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
10023         returns fields from parent class if they are not private.
10024         (method_nonpublic): added function to determine if a given method
10025         should be considered non-public. Returns false for private methods
10026         on parent class, and internal methods from parent on the 1.0 profile.
10027         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
10028         use method_nonpublic function to determine whether method should be
10029         returned.
10030         (property_accessor_public): use newly introduced method_nonpublic
10031         function to determine whether accessor is non-public. 
10032         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
10033         event from parent class if not private. Only return static event if
10034         Static flag is set, and only return static event from parent class if
10035         FlattenHierarchy flag is set.
10036         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
10037         include non-private events from parent class.
10038
10039 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
10040
10041         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
10042         warning.
10043
10044 2008-01-16  Wade Berrier <wberrier@novell.com>
10045
10046         * security.c: Add assembly.h header to appease some warnings
10047
10048 2008-01-16  Dick Porter  <dick@ximian.com>
10049
10050         * process.c (process_module_string_read): Remove trailing null
10051         when saving string.
10052
10053 2008-01-16  Mark Probst  <mark.probst@gmail.com>
10054
10055         * class-internals.h: A new data structure describing the layout of
10056         a runtime generic context (MonoRuntimeGenericContextTemplate).
10057
10058         * metadata-internals.h: Added a hash table to MonoDomain that maps
10059         from open generic classes to their runtime generic context
10060         templates.
10061
10062         * object.c: Building of the runtime generic context, including
10063         proper handling of generic type arguments of superclasses.
10064         Building of the runtime generic context according to the template.
10065
10066 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
10067
10068         * class.c (mono_class_setup_fields): Set field.count for generic instances.
10069         Fixes #350856.
10070
10071         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
10072         mono_portability_find_file (). Fixes #325466.
10073         (mono_image_get_public_key): Fix a warning.
10074
10075 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
10076
10077         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
10078         Fixes #353550.
10079         (mono_class_from_name_case): Ditto.
10080
10081 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
10082
10083         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
10084           common storage for the tables used in the System/NumberFormatter class.
10085
10086 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
10087
10088         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
10089
10090 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
10091
10092         * verify.c (get_boxable_mono_type): check if the token is valid.
10093
10094         * verify.c (set_stack_value): changed to add an error if an
10095         invalid type is set on stack. Changed all callers due to signature change.
10096
10097         * verify.c (do_stobj): implement stobj validation.
10098
10099 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
10100
10101         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
10102         set container->is_method, it was set earlier.
10103
10104         * metadata.c (type_in_image): Handle MVARs which belong to not finished
10105         generic methods.
10106
10107         * reflection.c (mono_reflection_initialize_generic_parameter): Set
10108         is_method of the generic container to TRUE for methods.
10109
10110 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10111
10112         * metadata.c (type_in_image): Handle type parameters properly.
10113
10114         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
10115         memory ownership of this structure.
10116
10117 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
10118
10119         * verify.c (get_boxable_mono_type): make typedref types been just
10120         unverifiable. check for void type.
10121
10122         * verify.c (do_unbox_any): added, verify opcode unbox.any.
10123
10124         * verify.c (do_load_function_ptr): accept method spec tokens.
10125
10126 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
10127
10128         * marshal.c (mono_class_native_size): Always set *align even if this is called
10129         recursively.
10130
10131 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
10132
10133         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
10134         out-of-date.
10135
10136 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
10137
10138         * verify.c: removed some old unused tables. A huge bunch of small fixes
10139         to things found while testing the verifier with mono basic.
10140
10141         * verify.c (dump_stack_value): dump null literal flag to.
10142
10143         * verify.c (verify_type_compatibility_full): fix comparison
10144         for types that have a generic super type.
10145
10146         * verify.c (verify_stack_type_compatibility): fix compatibility
10147         between null literals and reference types. fix compatibility between
10148         boxed valuetypes and object. fix corner case test for enums.
10149
10150         * verify.c (do_cmp_op): proper verification of cgt.un in case
10151         of reference types.
10152
10153         * verify.c (do_invoke_method): fix error message.
10154
10155         * verify.c (do_store_indirect
10156
10157         * verify.c (check_is_valid_type_for_field_ops): proper verification
10158         of managed pointers to valuetypes and boxed valuetypes. proper verification
10159         of null literals.
10160
10161         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
10162         allow token to be a reference type.
10163
10164         * verify.c (do_cast): proper handling of boxes valuetypes.
10165
10166         * verify.c (do_stelem): proper handling of storing a boxed valuetype
10167         in object[].
10168
10169         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
10170         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
10171         fixed the decoding of unbox_any
10172
10173 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
10174
10175         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
10176
10177 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
10178
10179         * verify.c (do_newobj): do delegate verification.
10180
10181         * verify.c (verify_delegate_compatibility): perform delegate
10182         verification.
10183
10184         * verify.c (verify_ldftn_delegate): perform tests related to
10185         ldftn delegates.
10186
10187         * verify.c (mono_delegate_signature_equal): perform the
10188         slightly diferent signature comparison required by delegates.
10189
10190         * metadata.c (mono_metadata_type_equal_full): added and exported
10191         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
10192         allows signature only comparison.
10193
10194         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
10195         as MONO_INTERNAL.
10196
10197 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
10198
10199         * verify.c: added a bunch of stack_slot_* functions to
10200         make access to stack slot type easier. This is required to
10201         allow optional flags, like null literal, boxed value and
10202         this pointer.
10203         All access paths to IlStackDesc::stype have been changed 
10204         to use these new funcions.
10205         Removed a bunch of unused functions and cleared all warnings.
10206         This patch introduces the usage of the this pointer and 
10207         boxed value flags.
10208
10209 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
10210
10211         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
10212
10213 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
10214
10215         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
10216         match managed version.
10217
10218         * appdomain.c: Bump corlib version.
10219         
10220         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
10221         argument.
10222
10223 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
10224
10225         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
10226         Set public key token to zero-length byte array if assembly is not
10227         strongnamed.
10228
10229 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
10230
10231         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
10232         writing a vtype array elem.
10233
10234 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
10235
10236         * assembly.c (build_assembly_name): return FALSE if length of token is
10237         not 16 (if not "null").
10238         (mono_assembly_name_parse_full): return FALSE if value of version,
10239         culture, token or key is 0.
10240         * icall.c (fill_reflection_assembly_name): add boolean arguments to
10241         specify whether public key and public key token must be set to default
10242         value (zero-length byte array) if not available. Set versioncompat to
10243         SameMachine. If public key is available or the default is set, then
10244         set PublicKey flag.
10245         (ves_icall_System_Reflection_Assembly_FillName): if no public key
10246         is available, use empty byte array as default value. On the 2.0
10247         profile, use default value for public key token if not set.
10248         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
10249         profile, use default value for public key if not set. On the 2.0
10250         profile, use default value for public key token if not set.
10251         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
10252         default values for public key and public key token.
10253
10254 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
10255
10256         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
10257         field to keep it in synch with the managed object.
10258
10259         * marshal.c (emit_marshal_object): Add support for byref marshalling of
10260         delegates. Fixes #351520.
10261
10262         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
10263         contains defined memory.
10264         
10265         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
10266
10267         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
10268         
10269         * sgen-gc.c (check_consistency): New helper function to do a consistency check
10270         of the GC data structures.
10271
10272         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
10273
10274         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
10275         
10276         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
10277         barrier.
10278         (mono_array_clone_in_domain): Ditto.
10279         (mono_array_clone_in_domain): Ditto.
10280
10281         * threads.c (start_wrapper): Register the thread start argument as a GC root.
10282         (cache_culture): Use a write barrier.
10283
10284         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
10285         (ves_icall_get_property_info): Ditto.
10286
10287         * object.h (MONO_STRUCT_SETREF): New macro.
10288
10289         * class-internals.h (MonoStats): Add some GC statistics.
10290
10291         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
10292
10293 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
10294
10295         * exception.c (mono_exception_from_name_two_strings):
10296         Break from loop after method is found.
10297
10298 2008-01-04  Dick Porter  <dick@ximian.com>
10299
10300         * process.c (process_module_string_read): Rename variable to
10301         reflect correct usage, after fixing bug 345972.
10302
10303 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
10304
10305         * verify.c (mono_type_create_fnptr_from_mono_method): 
10306         created a MonoType function pointer instance to be used during
10307         verification. The verifier releases this memory at end.
10308
10309         * verify.c (mono_method_is_constructor): extracted repeated
10310         checks for constructor into a single class.
10311
10312         * verify.c (do_push_field): use new extracted method
10313         for constructor check.
10314
10315         * verify.c (do_newobj): same.
10316
10317         * verify.c (do_ldftn): renamed to do_load_function_ptr
10318         and make it verify ldvirtftn too.
10319
10320         * verify.c (mono_method_verify: proper verification
10321         of ldvirtftn. release created MonoMethod instances.
10322
10323 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
10324
10325         * verify.c (token_bounds_check): added.
10326
10327         * verify.c (do_ldftn): added.
10328
10329         * verify.c (mono_method_verify): proper verificartion of ldftn.
10330
10331 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
10332
10333         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
10334         than the table row count. It's the resposibility of the caller to
10335         make the bounds check and raise the correct error.
10336
10337         * metadata.c (mono_metadata_decode_row_col): Same.
10338
10339         * loader.c (mono_get_method_from_token): perform bounds check
10340         on token for methoddef table.
10341
10342 2007-12-29  Miguel de Icaza  <miguel@novell.com>
10343
10344         * icall.c
10345         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
10346         assert into a negative result, the managed code already coped with
10347         that.
10348
10349         Some folks on Windows reported this error. 
10350
10351 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
10352
10353         * appdomain.c: Bump corlib version.
10354         * icall.c:
10355         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
10356         CultureInfo.CreateCulture to create CultureInfo for name.
10357         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
10358         create CultureInfo for name. Fixes bug #347174.
10359
10360 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
10361
10362         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
10363         flags.
10364
10365         * verify.c (is_valid_branch_instruction): allow branching to the
10366         first instruction of the protected block.
10367
10368         * verify.c (is_valid_cmp_branch_instruction): same.
10369
10370         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
10371         avoid double initialization.
10372
10373         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
10374         detect which cases the eval stack should just be copied.
10375
10376         * verify.c (mono_method_verify): check if the eval stack
10377         is empty when entering a protected block.
10378
10379 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
10380
10381         * verify.c: added is_clause_in_range, is_clause_inside_range,
10382         is_clause_nested and verify_clause_relationship. They perform
10383         the verifications stated in P1 12.4.2.7.
10384
10385         * verify.c (mono_method_verify): remove some unused variables,
10386         add the new exception clause checks, add instruction border
10387         checks for protected block start/end, improved some error 
10388         messages and fixed a bug in the way invalid instruction access
10389         is detected.
10390
10391 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
10392
10393         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
10394         from GC 7.0 if available.
10395
10396         * object.c: Remove an unused define.
10397         
10398         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
10399
10400         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
10401
10402         * null-gc.c (mono_gc_make_descr_for_array): Implement.
10403
10404         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
10405
10406         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
10407         to take the same arguments as the other make_descr functions.
10408
10409         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
10410
10411         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
10412         directly.
10413
10414         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
10415         mini.c.
10416
10417         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
10418         call to boehm-gc.c.
10419
10420         * boehm-gc.c (mono_gc_register_root): Fix a warning.
10421
10422         * null-gc.c (mono_gc_register_root): Fix a warning.
10423
10424         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
10425
10426         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
10427         (mono_gc_base_init): Call GC_init ().
10428
10429         * null-gc.c: Define mono_gc_register_root () as a no-op.
10430
10431         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
10432
10433 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
10434
10435         * verify.c: add prototype for merge_stacks at top
10436
10437         * verify.c (do_switch): added.
10438
10439         * verify.c (merge_stacks): on some cases the stack merging
10440         was not happening properly. Unequal stack sizes at merge
10441         points should be invalid.
10442
10443         * verify.c (mono_method_verify): added more debug info on stack state.
10444         verify switch properly.
10445
10446 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
10447
10448         * method-builder.h: New file, moved the mono_mb_ declarations here from 
10449         marshal.h.
10450
10451         * boehm-gc.c marshal.c: Include method-builder.h.
10452
10453         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
10454
10455         * marshal.c: Remove some code which is now in method-builder.c.
10456
10457 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
10458
10459         * method-builder.c: New file, extraction of the method builder functionality 
10460         from marshal.c.
10461
10462         * marshal.c: Move the mb functions into method-builder.c.
10463
10464         * marshal.h marshal.c: Export some mono_mb_... functions.
10465
10466         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
10467
10468         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
10469         the caller.
10470
10471         * class.c (mono_class_get_full): Check the token type in the dynamic case.
10472
10473         * loader.c (mono_field_from_token): Ditto.      
10474
10475         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
10476         type as well.
10477         
10478         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
10479         Fixes #342565.
10480
10481         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
10482         a helper function for setting it.
10483
10484         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
10485
10486         
10487         * assembly.c: Significally simplify code now that referenced assemblies are 
10488         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
10489
10490         * threads.h: Don't include  the internal threads-types.h header file. Fixes
10491         #349952.
10492
10493 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
10494
10495         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
10496         instructions that were target of branches or are at protected block boundaries.
10497
10498         * verify.c (in_same_block): handle filter clauses.
10499
10500         * verify.c (is_valid_branch_instruction): added. checks the target of
10501         instructions br or brtrue/false.
10502
10503         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
10504         binary branch instructions such as beq and bge.
10505
10506         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
10507         and made it pin the instruction as been part of the exception block.
10508
10509         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
10510         of in_same_block.
10511
10512         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
10513         of in_same_block.
10514
10515         * verify.c (do_ret): ret from a protected block is unverifiable and
10516         not invalid.
10517
10518         * verify.c (do_static_branch): verify br and br.s instructions.
10519
10520         * verify.c (merge_stacks): add extra param to support detection
10521         of branches in the middle of instructions.
10522         
10523         * verify.c (mono_method_verify): verify branches and exception blocks
10524         that target the middle of instructions. Proper verification of br and br.s.
10525
10526 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
10527
10528         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
10529         skip_visibility field.
10530         (reflection_methodbuilder_from_dynamic_method): Ditto.
10531
10532         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
10533         registrations. Fixes #348193.
10534
10535         * threads.h: Move the internal mono_thread_get_pending_exception () to
10536         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
10537
10538 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
10539
10540         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
10541         icall registration. Fixes #348193.
10542
10543         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
10544         for corlib classes into object. Fixes #349621.
10545
10546 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
10547
10548         * icall.c (property_accessor_nonpublic): new function to determine
10549         whether an accessor allows a property to be considered non-public.
10550         Returns false for private accessor(s) from parent class, and internal
10551         accessor(s) from parent on 2.0 profile (and higher).
10552         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
10553         to determine whether property should be included if NonPublic flag
10554         is set. Fixes bug #349078.
10555
10556 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
10557
10558         * verify.c (init_stack_with_value): added.
10559
10560         * verify.c (mono_method_verify): extracted common
10561         code for exception initialization into init_stack_with_value.
10562
10563         * verify.c (mono_method_verify): initialize the exception
10564         for handler clauses as well.
10565
10566         * verify.c (mono_method_verify): fix the exception clause
10567         ordering rules, it should use handler end offset and not
10568         start offset.
10569
10570 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
10571
10572         * rawbuffer.c: remove useless warning.
10573
10574 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
10575
10576         * threads.h, threads-types.h: move functions to the correct header
10577         (fixes bug#349952).
10578
10579 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10580
10581         * verify.c (mono_method_verify): proper verification
10582         of exception handling clauses ranges and fallthru in
10583         and out of protected blocks.
10584
10585 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10586
10587         * verify.c (mono_method_verify): fixed compilation issue.
10588
10589 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
10590
10591         * verify.c (mono_method_verify): a printf slipped in, changed
10592         to use verifier debug macro.
10593
10594 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
10595
10596         * verify.c (is_correct_leave): check for filter clauses.
10597
10598         * verify.c (do_filter): added.
10599
10600         * verify.c (mono_method_verify): property verification of leave.
10601
10602
10603 2007-12-18  Mark Probst  <mark.probst@gmail.com>
10604
10605         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
10606         Win32 build, until we figure out how to do the proper thing on
10607         Win32.
10608
10609 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
10610
10611         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
10612         by the previous patch.
10613         
10614         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
10615         the assembly resolve handler for refonly assemblies.
10616
10617 2007-12-17  Mark Probst  <mark.probst@gmail.com>
10618
10619         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
10620         Make sure only one thread is allowed to commence shutdown, and
10621         don't allow new threads to be started once shutdown is in
10622         progress.
10623
10624 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
10625
10626         * verify.c (is_correct_endfilter): added.
10627
10628         * verify.c (is_unverifiable_endfilter): added.
10629
10630         * verify.c (do_endfilter): added.
10631
10632         * verify.c (mono_method_verify): property verification of endfilter
10633         and fixed a corner case or endfinally.
10634
10635 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
10636
10637         * verify.h: new flags to support fail fast of unverifiable code and
10638         do non-strict verification. Non-strict verification is required to
10639         have MS runtime compatibility. There are a huge amount of unverifiable
10640         code that it accepts as verifiable. The strict mode verifies the code
10641         as the specs says.
10642         Non-strict mode will be required in cases where code needs to be
10643         accepted as verifiable but fails under strict mode.
10644
10645         * pedump.c: added support to fail fast and non-strict verification.
10646
10647         * verify.c: added support for both fail fast and non-strict verification.
10648
10649 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
10650
10651         * verify.c (is_correct_endfinally): added.
10652
10653         * verify.c (mono_method_verify): property verification of endfinally.
10654
10655 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
10656
10657         * verify.c (in_any_block): check for filter clauses.
10658
10659         * verify.c (is_correct_rethrow): added.
10660
10661         * verify.c (mono_method_verify): property verification of rethrow.
10662
10663         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
10664
10665 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
10666
10667         * verify.c (do_throw): added.
10668
10669         * verify.c (mono_method_verify): property verification of throw
10670
10671 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
10672
10673         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
10674         assemblies. Fixes #346425.
10675
10676 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
10677
10678         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
10679         FieldBuilders.
10680
10681         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
10682
10683         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
10684         prevent asserts when this is called with a token which might not be valid.
10685
10686         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
10687         lookup_dynamic_token_class with valid_token == FALSE.
10688
10689         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
10690
10691         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
10692
10693         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
10694         
10695 2007-12-10  Mark Probst  <mark.probst@gmail.com>
10696
10697         * gc.c: Don't delay threadpool thread finalization unless Mono is
10698         shutting down.
10699
10700 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
10701
10702         * threads.c: turn an assert into a non-fatal warning.
10703
10704 2007-12-09  Robert Jordan  <robertj@gmx.net>
10705
10706         * icall.c (GetVirtualMethod): Add missing argument validation.
10707
10708 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10709
10710         * verify.c (do_cast): added.
10711
10712         * verify.c (mono_method_verify): property verification of castclass and isinst.
10713
10714
10715 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10716
10717         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
10718
10719         * verify.c (do_stelem): added.
10720
10721         * verify.c (mono_method_verify): property verification of stelem.X.
10722
10723 2007-12-07  Mark Probst  <mark.probst@gmail.com>
10724
10725         * class.c, class-internals.h: Introduce an environment variable
10726         (MONO_GENERIC_SHARING) through which the extent of generic code
10727         sharing can be controlled (share all classes, share only corlib
10728         classes, or share nothing).
10729
10730         * object.c: Only create runtime generic context for classes for
10731         which sharing is enabled.
10732
10733 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10734
10735         * verify.c (do_ldelem): refactor it to work with ldelem.any.
10736
10737         * verify.c (mono_method_verify): property verification of ldelem.any.
10738
10739 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
10740
10741         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
10742         added ldelem.X opcodes.
10743
10744         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
10745
10746         * verify.c: proper verification of ldelem.X 
10747
10748 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
10749
10750         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
10751
10752 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
10753
10754         * verify.c (mono_method_verify): null literal requires special handling,
10755         the value pushed on stack need to be flagged as so.
10756
10757         * verify.c (do_ldelema): Verify ldelema properly.
10758
10759 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
10760
10761         * verify.c: Verify ldlen properly.
10762
10763 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
10764
10765         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
10766         to the target object's type. Fixes #346160.
10767
10768 2007-12-05  Dick Porter  <dick@ximian.com>
10769
10770         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
10771         Solaris needs the same workaround as BSD-derived systems.  Fixes
10772         bug 323524, patch by Burkhard Linke
10773         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
10774
10775 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
10776
10777         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
10778         handle to use when error dialog is shown; otherwise, update mask
10779         to show no error dialog when an error occurs.
10780
10781 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
10782
10783         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
10784
10785         * class.c (mono_class_get_field_default_value): New helper function to initialize
10786         field->def_type and field->data.
10787
10788 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
10789
10790         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
10791         the general one.
10792
10793         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
10794
10795         * marshal.c: Avoid depending on delegate->method_info being set.
10796
10797         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
10798         
10799         * object.c (mono_delegate_ctor): Set delegate->method.
10800
10801         * object-internals.h (struct _MonoDelegate): Add 'method' field.
10802
10803         * appdomain.c: Bump corlib version.
10804
10805 2007-11-27  Raja R Harinath  <harinath@gmail.com>
10806
10807         * metadata.c (mono_generic_inst_equal_full): Short-circuit
10808         equality check if we're comparing canonicalized MonoGenericInsts.
10809
10810 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
10811
10812         * class.c (generic_array_methods): Call mono_class_setup_methods () before
10813         accessing class->methods.
10814
10815 2007-11-22  Dick Porter  <dick@ximian.com>
10816
10817         * threads.c: Ensure that the synch_cs is set before trying to use
10818         it.
10819
10820 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
10821
10822         * profiler.c: r89126 broke the statistial profiler, unbreak.
10823
10824 2007-11-22  Martin Baulig  <martin@ximian.com>
10825
10826         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
10827
10828         * mono-debug.c
10829         (mono_debug_debugger_version): Bump to 3.
10830         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
10831         -> mono_debugger_class_initialized().
10832
10833         * mono-debug-debugger.c
10834         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
10835
10836         * class.c
10837         (mono_debugger_start_class_init_func): Removed.
10838         (mono_debugger_class_loaded_methods_func): Added.
10839         (mono_class_setup_methods): Call it here.
10840
10841 2007-11-22  Martin Baulig  <martin@ximian.com>
10842
10843         * mono-debug.c
10844         (mono_debug_add_delegate_trampoline): New public method.
10845         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
10846
10847         * mono-debug.h
10848         (MonoSymbolTable): Added `global_data_table'.
10849         (MonoDebuggerTypeKind): Removed.
10850
10851 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
10852
10853         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
10854         these methods.
10855
10856         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10857         
10858 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
10859
10860         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
10861
10862 2007-11-20  Martin Baulig  <martin@ximian.com>
10863
10864         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
10865
10866         * mono-debug-debugger.c
10867         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
10868         (mono_debugger_remove_breakpoint): Likewise.
10869         (mono_debugger_check_breakpoints): Likewise.
10870         (mono_debugger_register_class_init_callback): New public method.
10871         (mono_debugger_remove_class_init_callback): Likewise.
10872         (mono_debugger_add_type): Likewise.
10873
10874         * mono-debug-debugger.h
10875         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
10876
10877 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
10878
10879         * class.c: more interface implementations needed for the
10880         array enumerator (fixes bug #341112).
10881
10882 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
10883
10884         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
10885         fix ParamName of ArgumentNullExceptions.
10886
10887 2007-11-17  Miguel de Icaza  <miguel@novell.com>
10888
10889         * reflection.c (mono_reflection_encode_sighelper): Generate the
10890         modopts and modreqs.   I have a useless test that crashes monodis,
10891         but that shows the code working.
10892
10893 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
10894
10895         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
10896         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
10897
10898 2007-11-15  Dick Porter  <dick@ximian.com>
10899
10900         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
10901         When joining a thread, it's the thread that's calling Join that
10902         gets WaitSleepJoin state not the target.  Fixes the standalone
10903         test case in bug 334740, and hopefully the whole bug too.
10904
10905 2007-11-15  Dick Porter  <dick@ximian.com>
10906
10907         * process.c: Read file version info from the files pointed at by
10908         process modules, not the current process.  Fixes bug 315969.
10909
10910         Use windows typedef names in some places to fix warnings on the
10911         windows build.
10912
10913 2007-11-15  Mark Probst  <mark.probst@gmail.com>
10914
10915         * image.c, metadata-internals.h: Added a generic_class_cache hash
10916         to MonoImage for looking up generic classes when sharing generics.
10917
10918 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
10919
10920         * sgen-gc.c: warning cleanups.
10921
10922 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
10923
10924         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
10925         inherited properties.
10926
10927 2007-11-14  Mark Probst  <mark.probst@gmail.com>
10928
10929         * object.c, class-internals.h: Added more information to the
10930         runtime generic context.
10931
10932 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
10933
10934         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
10935         instead of just the target method. Generalize the abstract method handling to
10936         handle any non-static method.
10937
10938         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
10939         mono_marshal_get_delegate_invoke () signature change.
10940
10941 2007-11-13  Mark Probst  <mark.probst@gmail.com>
10942
10943         * class.c, class-internals.h: Made
10944         mono_type_get_basic_type_from_generic () public.  Fixed member
10945         access check for shared generics.
10946
10947         * loader.c: Don't insert field into field cache if it's part of a
10948         non-inflated generic class.
10949
10950         * domain.c, domain-internals.h: The generic sharing context is now
10951         part of the jit info data structure.  Added two accessor
10952         functions.
10953
10954 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
10955
10956         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
10957         the array Get/Set/Address methods, since the JIT inlines them.
10958
10959         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
10960
10961         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
10962         (mono_image_init): Initialize runtime_invoke_direct_cache.      
10963
10964         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
10965         mono_marshal_get_delegate_invoke signature change.
10966
10967         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
10968         an additional argument. Add support for invoking abstract methods.
10969
10970         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
10971
10972         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
10973
10974 2007-11-09  Mark Probst  <mark.probst@gmail.com>
10975
10976         * class.c: Do field layout for open generic classes as well.
10977
10978 2007-11-09  Mark Probst  <mark.probst@gmail.com>
10979
10980         * gc.c, gc-internal.h: Don't finalize threadpool threads with
10981         other objects, because the threadpool is still around.  Put them
10982         in a list instead and after finalizing all other objects in the
10983         root domain shut down the thread pool and then finalize the
10984         threads.  Fixes bug #337383.
10985
10986         * threads.c, thread-types.h: New mono_thread_create_internal()
10987         function for marking a thread with the threadpool flag before it
10988         started.  Set synch_cs to NULL after freeing it.
10989
10990         * threadpool.c: Mark threadpool threads before they start.
10991
10992 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
10993
10994         * reflection.h, reflection.c: don't export random functions
10995         and lazy load dbnull and missing objects.
10996
10997 2007-11-07  Jonathan Chambers <joncham@gmail.com>
10998
10999         * class.c: Initialize COM types if COM interfaces
11000         are present (not just COM classes).
11001         
11002         Code is contributed under MIT/X11 license.
11003
11004 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11005         * reflection.c:
11006         create_dynamic_mono_image: hook module profiler events (dynamic case).
11007         mono_image_basic_init: hook assembly profiler events (dynamic case).
11008
11009 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
11010         * profiler.c:
11011         simple_appdomain_unload: completely terminate the profiler
11012         instead of only processing the statistical samples.
11013         simple_shutdown: make sure this is really called exactly once,
11014         even in multithreaded applications, and always listen to
11015         appdomain events.
11016         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
11017         here, the "[un]load" functions will do it.
11018         Fixes bugs #333791 and #325261.
11019
11020 2007-11-07  Geoff Norton  <gnorton@novell.com>
11021
11022         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
11023         rather than depend on __APPLE__.
11024
11025 2007-11-07  Mark Probst  <mark.probst@gmail.com>
11026
11027         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
11028
11029 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
11030
11031         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
11032         UTF16 MonoString. Fix the crash from bug #335488
11033
11034 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
11035
11036         * marshal.c: Correct (for non-Win32 OS) length != size in 
11037         mono_string_from_bstr. Fix #339530.
11038
11039 2007-11-06  Geoff Norton  <gnorton@novell.com>
11040
11041         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
11042         to succeed
11043
11044 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
11045
11046         * process.c: Added run-time GetProcessId API detection for Windows.
11047
11048 2007-11-04  Miguel de Icaza  <miguel@novell.com>
11049
11050         * reflection.c  (mono_param_get_objects): If a parameter has the
11051         attribute [System.Runtime.InteropServices.Optional] we should
11052         set the DefaultValue of the ParameterInfo to be
11053         System.Reflection.Missing instead of DBNull.
11054
11055         See bug #339013.
11056
11057         (mono_get_reflection_missing_object): New method,
11058         returns the System.Reflection.Missing.Value singleton instance.
11059
11060 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
11061
11062         * culture-info-table.h : regenerated.
11063
11064 2007-11-02  Jonathan Chambers <joncham@gmail.com>
11065
11066         * icall.c: Use GetEnvironmentStrings on windows
11067         so we are using the same environment block as 
11068         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
11069         #333740.
11070         
11071         Code is contributed under MIT/X11 license.
11072
11073 2007-10-31  Martin Baulig  <martin@ximian.com>
11074
11075         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
11076
11077         * mono-debug-debugger.h
11078         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
11079
11080 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
11081
11082         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
11083         classes.
11084
11085 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
11086
11087         * culture-info-table.h : regenerated.
11088
11089 2007-10-30  Robert Jordan  <robertj@gmx.net>
11090
11091         * icall-def.h, icall.c:
11092         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
11093
11094         Code is contributed under MIT/X11 license.
11095
11096 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11097
11098         * class.c (mono_class_setup_vtable): Find the inflated methods in the
11099         inflated class instead of inflating them again.
11100         
11101         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
11102         dynamic case.
11103
11104         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
11105         Call setup_supertypes () after klass->parent is set.
11106         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
11107
11108         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
11109         for inflated instances of not yet created dynamic generic classes.
11110         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
11111         times from inflated_method.
11112         (methodbuilder_to_mono_method): Ditto.
11113
11114 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
11115
11116         * gc.c: code cleanup and removed old untested option of not creating the
11117         finalizer thread.
11118
11119 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
11120
11121         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
11122         creating a jump trampoline for dynamic methods.
11123
11124 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
11125
11126         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
11127         generic TypeBuilders when called from another method of the same type (bug #335131).
11128
11129
11130 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
11131
11132         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
11133         doesn't seem to work perfectly.
11134         
11135         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
11136         called multiple times.
11137         (methodbuilder_to_mono_method): Ditto.
11138         (resolve_object): Inflate FieldBuilder's.
11139
11140 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
11141
11142         * string-icalls.c, string-icalls.h, appdomain.c: patch from
11143         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
11144         RemoveEmptyEntries in the string.Split implementation (bug #322375).
11145
11146 2007-10-26  Dick Porter  <dick@ximian.com>
11147
11148         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
11149         Thread initialisation changes
11150
11151 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
11152
11153         * verify.c: fix compatibility check between arrays and System.Array
11154
11155 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
11156
11157         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
11158         too. Fixes #336999.
11159
11160 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
11161
11162         * object.c (mono_value_box): Use typed allocation here.
11163
11164 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
11165
11166         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
11167         trampoline instead of compiling the method right away.
11168
11169         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
11170
11171 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
11172
11173         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
11174         related fields for dynamic classes. Fixes #334493.
11175
11176 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
11177
11178         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
11179         
11180         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
11181
11182         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
11183         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
11184
11185         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
11186
11187         * reflection.c (create_generic_typespec): Initialize klass->generic_container
11188         if needed.
11189         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
11190
11191 2007-10-18  Jonathan Chambers <joncham@gmail.com>
11192
11193         * marshal.c: Use correct key when removing item
11194         from ccw_hash.
11195         
11196         Code is contributed under MIT/X11 license.
11197
11198 2007-10-17  William Holmes  <billholmes54@gmail.com>
11199
11200         *marshal.c: Adding a case to marshal booleans to U1
11201
11202         Code is contributed under MIT/X11 license.
11203
11204 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
11205
11206         * class.c (mono_class_from_name): Search the modules compromising dynamic
11207         assemblies. Fixes #331601.
11208
11209 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
11210
11211         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
11212         exception if the type name contains an assembly component. Fixes #334203.
11213
11214         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
11215         modules inside dynamic assemblies. Fixes #334200.
11216         
11217         * reflection.c: Set image->public_key and image->public_key_length;
11218
11219         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
11220         fields.
11221
11222         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
11223         
11224 2007-10-16  Mark Probst  <mark.probst@gmail.com>
11225
11226         * metadata.c: Implemented correct comparing of generic classes.
11227         An inflated generic class can be equal to a non-inflated one if it
11228         is inflated with generic type variables as type arguments.  Fixes
11229         bug #333798.
11230
11231 2007-10-15  Dick Porter  <dick@ximian.com>
11232
11233         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
11234         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
11235         81646.
11236
11237         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
11238         instead of a monitor lock.  This means that monitor_try_enter and
11239         co can set the thread state safely.
11240         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
11241         thread_interrupt_requested, so interrupt actually works.
11242
11243         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
11244         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
11245         state accessor function
11246
11247 2007-10-15  Martin Baulig  <martin@ximian.com>
11248
11249         * mono-debug.h
11250         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
11251         the debugger with the current runtime.
11252
11253 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
11254
11255         * object.c, object-internals.h: added the ability to set a single
11256         trampoline for all the slots in a vtable.
11257
11258 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11259
11260         * marshal.c: deal with a possible race condition during multicast
11261         delegate invocation.
11262
11263 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11264
11265         * class.c: ensure value type methods don't have the synchronized
11266         flag set.
11267
11268 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
11269
11270         * string-icalls.c, string-icalls.h: reverted unapproved patch that
11271         breaks the build.
11272
11273 2007-10-11  Joel Reed  <joelwreed@comcast.com>
11274
11275         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
11276         to take an options parameter so that empty entries can be removed during
11277         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
11278
11279 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11280
11281         * marshal.c: make sure we don't store the signature from a dynamic
11282         method into the runtime invoke cache (bug #327189).
11283
11284 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11285
11286         * marshal.c: make sure the wrapper methods are properly initialized.
11287
11288 2007-10-11  Mark Probst  <mark.probst@gmail.com>
11289
11290         * metadata.c, metadata-internals.h: Generalized
11291         mono_type_stack_size() to mono_type_stack_size_internal() which
11292         takes an additional argument specifying whether it allows open
11293         types.
11294
11295 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
11296
11297         * verify.c (do_invoke_method): handle typedbyref params
11298         correctly and check for unverifiable return values.
11299
11300         * verify.c (do_newobj): fix a warning.
11301
11302 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
11303
11304         * verify.c: don't tread typedbyref as allways unverifable,
11305         so uses, like (ld/st)loc.0 are valid. verify for the cases
11306         that it matters, like boxing related operations.
11307
11308 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
11309
11310         * verify.c: add verification of the newobj opcode. verification
11311         of delegate instantation still missing due ldftn and virldftn not
11312         pushing the function type on stack
11313
11314 2007-10-08  Mark Probst  <mark.probst@gmail.com>
11315
11316         * class-internals.h: Runtime generic context data structure
11317         definition.
11318
11319         * object.c: Initialization of runtime generic context at runtime
11320         vtable creation time.
11321
11322 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
11323         * class.c (mono_class_create_from_typedef,
11324         mono_class_from_generic_parameter, mono_ptr_class_get,
11325         mono_fnptr_class_get, mono_bounded_array_class_get)
11326         * domain.c (mono_domain_create, mono_domain_free)
11327         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
11328         * image.c (do_mono_image_load, mono_image_close):
11329         Hooked up load-unload profiler events.
11330
11331 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
11332
11333         * domain.c: track statistics about the actual amount of native code
11334         allocated.
11335
11336 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
11337
11338         * class.c: the valuetype enumerators don't have the additional
11339         supertypes interfaces.
11340
11341 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11342
11343         * class.c: need more interfaces setup for the IEnumerator<T>
11344         object created for arrays (tests/ienumerator-interfaces.2.cs).
11345
11346 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
11347
11348         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
11349
11350 2007-10-05  Alp Toker  <alp@atoker.com>
11351
11352         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
11353         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
11354         #315863.
11355
11356 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
11357
11358         * verify.c (verify_type_compatibility_full): verification of
11359         compatibility improved, validates correctly non-strict checks between
11360         native int and I4 types different than (unsigned)int32.
11361
11362         * verify.c (do_store_indirect): added, do all verification of
11363         ldind.X opcodes. 
11364
11365         * verify.c (get_load_indirect_mono_type): renamed to
11366         get_indirect_op_mono_type, as it now returns the MonoType for 
11367         ldind.X and stind.X opcodes.
11368
11369 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
11370
11371         * reflection.c: Fix the encoding of generic type definition for
11372         TypeBuilders.
11373
11374         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
11375         mono_image_typedef_or_ref but allows to specify if typespec lookups should
11376         be made. Typespec check is done prior to typeref cache lookup.
11377
11378         * reflection.c (mono_image_typedef_or_ref): now just delegate to
11379         mono_image_typedef_or_ref_full.
11380
11381         * reflection.c (encode_generic_class): encode the generic class
11382         directly instead of calling encode_type.
11383
11384         * reflection.c (encode_type): encode the generic type definition
11385         MonoClass as a generic instantiation.
11386
11387         * reflection.c (create_typespec): cache typespec tokens in
11388         the assembly->typespec cache. Don't create typespec for a generic
11389         instance MonoClass. Create typespec for the generic type defintion.
11390
11391         * reflection.c (create_generic_typespec): encode the generic
11392         class directly instead of calling encode_type.
11393
11394         * reflection.c (mono_image_create_token): encode the generic
11395         type definition not using a typespec for MonoType instances.
11396
11397
11398 2007-10-04  Raja R Harinath  <rharinath@novell.com>
11399
11400         Fix #328812
11401         * class.c (mono_image_init_name_cache): Don't return nested
11402         'protected internal' classes.
11403         (mono_class_from_name_case): Likewise.
11404
11405 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
11406
11407         * icall-def.h, icall.c : get_bundled_machine_config() is now the
11408           common function used by both DefaultConfig in System.dll and
11409           InternalConfigurationHost in System.Configuration.dll.
11410
11411 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11412
11413         * class.c: automatically add to vectors only a few essential explicit
11414         generic interfaces. The rest of the interfaces that arrays should
11415         provide are currently implicitly added (but still not lazily, see the
11416         design in the discussion of bug#325495 for the details of what is
11417         needed for that). Additionally, implicit interfaces are assigned the
11418         same vtable slot as the explicit interfaces (as they are compatible):
11419         this enables huge memory savings since we don't need to instantiate
11420         as many memthods and as large vtables anymore. Also, Since
11421         GetEnumerator<T> returns an instance of a type that is required to
11422         support a similarly large set of interfaces as arrays, we add
11423         implicit interfaces and interface offset sharing support to those
11424         types, too. This change adds all the required interfaces so that
11425         the anonarray.cs test case in the bug report works (we don't add
11426         all the interfaces to arrays of arrays 3-level deep and more because
11427         of the memory requirements explained in the bug and since they are much
11428         less common: the lazy-loading support will enabled them to work, too).
11429
11430 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
11431
11432         * verify.c (merge_stacks): major clean up, all type compatibility
11433         checks are done by verify_type_compatibility. This fix my earlier lack
11434         of understanding of the CLR type system and merge_stacks no longer looks
11435         scary.
11436
11437         * verify.c: fixed some bad spelling.
11438
11439 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
11440
11441         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
11442         a given stack slock.
11443         
11444         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
11445         verify_type_compatibility_full. This removed a near indentical function and fixed
11446         handling of Int32 and IntPtr across all opcodes.
11447
11448 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11449
11450         * class.c: only vectors have the additional generic interfaces.
11451
11452 2007-10-01  Jonathan Chambers <joncham@gmail.com>
11453
11454         * mono-config.c: Use g_strcasecmp instead of
11455         strcasecmp like everywhere else to fix
11456         compilation with MSVC.
11457         
11458         Code is contributed under MIT/X11 license.
11459
11460 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
11461
11462         * object.c, object-internals.h: refactored the IMT code to enable
11463         building a single slot at a time and lazily creating the IMT trampolines
11464         and thunks.
11465
11466 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
11467
11468         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
11469
11470         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
11471         Fixes #328501.
11472         
11473 2007-09-29  Raja R Harinath  <harinath@gmail.com>
11474
11475         * loader.c (method_from_methodspec): Rearrange to avoid
11476         un-necessary exposition.  Don't assert out if the method's
11477         declaring type is a generic type definition.
11478
11479 2007-09-28  Martin Baulig  <martin@ximian.com>
11480
11481         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
11482
11483 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
11484
11485         * class-internals.h: optimize field layout of MonoClass to
11486         requires less cachelines at runtime and save a few bytes on 64 bit
11487         systems.
11488
11489 2007-09-28  Jb Evain  <jbevain@novell.com>
11490
11491         * reflection.c: when encoding type names in custom attributes,
11492         if the type is a closed generic type, its generic arguments
11493         have to be serialized as AssemblyQualifiedName, so that when
11494         they are deserialized, it's possible to re-create them properly.
11495         Fixes #329450.
11496
11497
11498 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
11499
11500         * object.c, class-internals.h: added delegate-creation counter.
11501
11502 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
11503
11504         * class.c: cleanup of the code that synthetizes interfaces for
11505         arrays in 2.0: saves quit a bit of corlib mempool memory.
11506         Code to fix bug #325495 ifdeffed out for now until the issues
11507         with memory usage and O(n^2) behaviour are fixed.
11508
11509 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
11510
11511         * marshal.c: when possible, do not duplicate the name of the methods
11512         in the method builder and in the generated MonoMethod.
11513
11514 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
11515         * verify.c: added support for type checking ldind_* opcodes.
11516
11517 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
11518
11519         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
11520         which is used to distinguish the fully open instantiation of a TypeBuilder
11521         with the rest. This temporary hack is required to restore the property that
11522         the fully open instantiation is the same type of the generic type definition.
11523
11524         * class-internals.h (mono_generic_class_is_generic_type_definition):
11525         new function as part of the internal API.
11526
11527         * class.c (inflate_generic_type): return NULL when the generic inst is
11528         fully open. The fully open generic type is now the same as the generic type
11529         definition for non TypeBuilder types.
11530
11531         * class.c (mono_generic_class_get_class): removed assert since it is
11532         no longer valid, gklass->cached_class can point to the generic type definition.
11533
11534         * class.c (mono_generic_class_is_generic_type_definition): new.
11535
11536         * metadata.c (mono_generic_class_hash): added is_tb_open field
11537         to the hash calculation.
11538
11539         * metadata.c (free_generic_class): if the generic class is associated
11540         with the generic type definition, its field will come from the mempool and
11541         must not be freed.
11542
11543         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
11544         new, this function identifies the corner case of a TypeBuilder fully open
11545         instantiation.
11546
11547         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
11548         for lookup. Set gclass->cached_class to be the container class in case of
11549         the fully open instantiation of non TypeBuilder types.
11550
11551         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
11552         to compare generic classes.
11553
11554         * reflection.c (method_encode_methodspec): remove assert that
11555         no longer is valid.
11556
11557         * reflection.c (mono_reflection_generic_class_initialize): add
11558         an aditional assert to ensure the proper type is used.
11559
11560 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
11561
11562         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
11563         to enjoy it.
11564
11565 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
11566
11567         * verify.c (push_arg): Fixed support for ldarga
11568         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
11569         MonoType used as first arg in case of instance calls.
11570
11571 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
11572
11573         * verify.c: Support for verifying VAR and MVAR types, 
11574
11575 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
11576
11577         * icall.c (ves_icall_get_property_info): Set the reflected type of the
11578         accessors correctly.
11579
11580 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
11581
11582         * threads.c: support OSX and other systems in
11583         mono_thread_get_stack_bounds (bug #328026).
11584
11585 2007-09-25  Martin Baulig  <martin@ximian.com>
11586
11587         * mono-debug.h
11588         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
11589
11590 2007-09-24  Martin Baulig  <martin@ximian.com>
11591
11592         * mono-debug.h
11593         (MonoDebugClassEntry): Moved the definition of this struct into
11594         mono-debug.c to make it private.
11595
11596         * mono-debug.c
11597         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
11598         type table per symbol file, we don't need to store the symfile id
11599         any longer.
11600
11601 2007-09-24  Martin Baulig  <martin@ximian.com>
11602
11603         Create one type table per symbol file, since a `MonoClass *' gets
11604         invalid when its image is unloaded.
11605
11606         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
11607         (MonoDebugHandle): Added `type_table'.
11608
11609 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
11610
11611         * mempool.c, mempool.h: added mono_mempool_new_size () API
11612         to be able to specify a smaller initial size for the pool.
11613         Adjusted the code to slowly increase pool size before using
11614         the previous default size.
11615         * image.c: use a small initial size for image mempools.
11616
11617 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
11618
11619         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
11620         Fixes ##320990.
11621
11622         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
11623         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
11624
11625 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
11626
11627         * metadata.c (mono_type_create_from_typespec): Remove an invalid
11628         free. Fixes #327438.
11629
11630 2007-09-21  Raja R Harinath  <harinath@gmail.com>
11631
11632         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
11633         generic instantiations, etc.
11634         <MONO_TYPE_ARRAY>: Likewise.
11635
11636 2007-09-21  Martin Baulig  <martin@ximian.com>
11637
11638         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
11639         these structs were never defined.
11640         (MonoDebugHandle): Removed the `_priv' field, it was never used.
11641
11642 2007-09-21  Martin Baulig  <martin@ximian.com>
11643
11644         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
11645
11646 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
11647
11648         * image.c: removed the guid hash tables: we can get the same info
11649         without the additional memory usage hit (partially fixes also bug #327052).
11650
11651 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11652
11653         * profiler.h, profiler-private.h, profiler.c: add a new profiler
11654         event to handle unloading methods. After the event is called, the
11655         corresponding MonoMethod* must be considered invalid.
11656         * loader.c (mono_free_method): call the new mono_profiler_method_free
11657         event.
11658
11659 2007-09-20  Mark Probst  <mark.probst@gmail.com>
11660
11661         * domain-internals.h: New flag in MonoJitInfo which marks shared
11662         generic methods.  New hash table (shared_generics_hash) in
11663         MonoDomain to keep track of shared generic methods.  Prototypes
11664         for functions to register and lookup shared generic methods.
11665
11666         * domain.c: Support for registering and looking up shared generic
11667         methods via a hash table (shared_generics_hash) in MonoDomain.
11668
11669         * class-internals.h: New exception to signal failure of shared
11670         compilation of a generic method.  New counters for generics
11671         sharing in MonoStats.
11672
11673 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
11674
11675         * image.c, metadata-internals.h: don't keep a file descriptor open
11676         for loaded assemblies (bug#325988).
11677
11678 2007-09-19  Raja R Harinath  <rharinath@novell.com>
11679
11680         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
11681         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
11682         use the corresponding datatypes.
11683         (type_in_image): Update to changes.
11684         (CleanForImageUserData): Simplify.
11685         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
11686         Avoid quadratic behaviour in handling the "stolen" list by
11687         separating the filter predicate out, and by prepending the stolen
11688         items rather than appending them.
11689         (steal_ginst_in_image): Likewise.
11690         (mono_metadata_clean_for_image): Update to changes.
11691
11692 2007-09-19  Martin Baulig  <martin@ximian.com>
11693
11694         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
11695
11696 2007-09-19  Martin Baulig  <martin@ximian.com>
11697
11698         * mono-debug.c (mono_debug_cleanup): Don't call
11699         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
11700
11701 2007-09-19  Raja R Harinath  <harinath@gmail.com>
11702
11703         Fix crash on 'make run-test' in mcs/errors
11704         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
11705         Avoid more potential allocations in mono_class_from_mono_type.
11706         (ginst_in_image): Update to changes.
11707         (gclass_in_image): Rearrange slightly.
11708
11709 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
11710
11711         * class.c (mono_class_init): Move the code that sets up class->methods to 
11712         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
11713
11714         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
11715         canonical instance of an inflated generic signature.
11716         (mono_type_create_from_typespec): Remove an invalid free.
11717
11718         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
11719
11720 2007-09-18  Marek Habersack  <mhabersack@novell.com>
11721
11722         * domain-internals.h: added a declaration of the
11723         mono_assembly_load_full_nosearch internal function.
11724
11725         * assembly.c (mono_assembly_load_with_partial_name): use
11726         mono_try_assembly_resolve return value properly.
11727         (mono_assembly_load_full_nosearch): copied the function body from
11728         mono_assembly_load_full, without the code to invoke assembly
11729         search hooks.
11730         (mono_assembly_load_full): calls the above new function and if the
11731         assembly is not resolved, invokes the search hooks.
11732
11733         * appdomain.c (mono_runtime_init): restore the global postload
11734         assembly search handlers.
11735
11736 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
11737
11738         * class.c (mono_class_init): Make sure class->methods and class->properties
11739         are never NULL in the generics case.
11740
11741         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
11742
11743 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
11744
11745         * metadata.c (free_generic_class): Disable some code to fix the build.
11746
11747         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
11748
11749         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
11750         from the image mempool.
11751
11752         * metadata.c (free_generic_class): Free more data from the inflated class.
11753
11754         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
11755
11756         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
11757         mempool.
11758         (mono_type_create_from_typespec): Ditto.
11759
11760         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
11761         MonoImage to the caller.
11762         (mono_init_internal): Save the opened image in a global variable.
11763         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
11764
11765         * reflection.c (resolve_object): Fix a leak.
11766
11767         * metadata.c: Fix the freeing of data in the generics caches.
11768         
11769         * metadata.c (free_generic_inst): Comment this out to fix the build.
11770         (free_generic_class): Ditto.
11771
11772         * metadata.c: Free cached generic methods, instantinations and classes when
11773         they are removed from the caches.
11774         (mono_metadata_free_type): Free the type itself.
11775
11776         * class.c: Free the result of mono_class_inflate_generic_type () in a few
11777         places.
11778
11779 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
11780
11781         * boehm-gc.c: restrict managed allocs to __thread supporting
11782         architectures.
11783
11784 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
11785
11786         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
11787         (mono_generic_class_get_class): Fix a leak.
11788
11789         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
11790         mono_metadata_free_type ().
11791         (mono_metadata_inflate_generic_inst): Fix a leak.
11792
11793 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11794
11795         * mono-debug.c (free_header_data): Fix a leak missed earlier.
11796
11797         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
11798         mempool.
11799
11800         * mono-debug.c (mono_debug_close_image): Fix call to 
11801         g_hash_table_remove ().
11802
11803 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
11804
11805         * icall-def.h: redirect all the string ctor to the managed
11806         CreateString () methods.
11807         * string-icalls.c, string-icalls.h: removed dead code for string
11808         ctors and icalls.
11809
11810 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11811
11812         * mono-debug.c: Fix memory leaks.
11813
11814 2007-09-14  Jonathan Chambers <joncham@gmail.com>
11815
11816         * threads-types.h: Implement mono_hazard_pointer_set and 
11817         mono_hazard_pointer_clear macros using do/while(0) to fix
11818         compilation with MSVC.
11819         
11820         Code is contributed under MIT/X11 license.
11821
11822 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
11823
11824         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
11825         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
11826
11827 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11828
11829         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
11830         icalls.
11831
11832 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
11833
11834         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
11835         managed-code allocated as well.
11836
11837 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
11838
11839         * class.c (mono_class_is_assignable_from): Add support for generic variance.
11840
11841 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
11842
11843         * boehm-gc.c: fixed the build after the AOT changes.
11844
11845 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
11846
11847         * wrapper-types.h: Add an ALLOC wrapper type.
11848
11849         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
11850         reference managed allocator methods.
11851
11852 2007-09-12  Marek Safar  <marek.safar@gmail.com>
11853
11854         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
11855         of Type array and not MonoType, a fix suggested by Hari.
11856         
11857 2007-09-12  Jonathan Chambers <joncham@gmail.com>
11858
11859         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
11860         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
11861         
11862         Code is contributed under MIT/X11 license.
11863
11864 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11865
11866         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
11867
11868 2007-09-12  Marek Habersack  <mhabersack@novell.com>
11869
11870         * image.c (do_mono_image_open): if assembly file fails to open and
11871         MONO_IOMAP is in effect, try to find the path in a
11872         case-insensitive way.
11873
11874         * appdomain.c (mono_runtime_init): do not install postload hooks -
11875         tests show that MS.NET doesn't use anything of that sort to
11876         trigger the AppDomain.AssemblyResolve event.
11877         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
11878         made non-static.
11879         (mono_runtime_init): init portability helpers here.
11880
11881         * assembly.c (mono_assembly_load_with_partial_name): if other   
11882         attempts fail, trigger the AppDomain.AssemblyResolve event handler
11883         to resolve the assembly.
11884
11885         * domain-internals.h: added mono_try_assembly_resolve and marked
11886         it as internal.
11887
11888 2007-09-11  Jb Evain  <jbevain@novell.com>
11889
11890         * object-internals.h (MonoReflectionDynamicMethod): add
11891         a `MonoReflectionType *owner` field. The owner is used
11892         * reflection.c:
11893         (mono_reflection_create_dynamic_method): use the owner of the dynamic
11894         method as the class declaring the dynamic method.
11895         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
11896         dynamic method to the declaring type of the methodbuilder.
11897
11898 2007-09-11  Mark Probst  <mark.probst@gmail.com>
11899
11900         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
11901         rules for calling methods via reflection.
11902
11903 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
11904
11905         * reflection.c (resolve_object): Add support for MonoGenericClass. 
11906         Inflate MonoType's.
11907
11908 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
11909
11910         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
11911         provide a managed method that does fast allocations without needing
11912         a managed->unmanaged transition. Boehm GC implementation currently
11913         enabled for ptrfree objects on sane architectures.
11914
11915 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
11916
11917         * marshal.c, marshal.h: exported a couple of useful functions and
11918         added mono_mb_get_label () to easily handle backward branches.
11919
11920 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
11921
11922         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
11923
11924 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
11925
11926         * loader.c (find_method): Fixed the regression introduced while
11927         fixing bug #81466.
11928
11929 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
11930
11931         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
11932         well.
11933         
11934         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
11935         icall.c reflection.c: Pass a MonoGenericContext argument to 
11936         mono_lookup_dynamic_token ().
11937
11938         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
11939         #82744.
11940         
11941 2007-09-09  Robert Jordan  <robertj@gmx.net>
11942
11943         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
11944         for generic methods.
11945
11946         * object.c (mono_object_get_virtual_method): Handle generic methods.
11947         Fixes bug #78882.
11948
11949         Code is contributed under MIT/X11 license.
11950
11951 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
11952
11953         * image.c: fix locking in mono_image_load_file_for_image ().
11954
11955 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
11956
11957         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
11958         used only as a cache: added an icall to fill it.
11959
11960 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
11961
11962         * reflection.h: exposed mono_reflection_free_type_info
11963         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
11964         since mono_reflection_bind_generic_parameters makes a copy of it.
11965         * reflection.c (free_type_info): subinfos should be freed.
11966         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
11967         made non static.
11968         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
11969         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
11970         this fixes #82695 and #81726.
11971    
11972
11973 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
11974
11975         * process.h, process.c:  added support for user profile/info in
11976           ProcessStartInfo. For now only Windows works.
11977
11978 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
11979
11980         * metadata.c: consider the generic arguments when comparing
11981         signatures (bug #82614).
11982
11983 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11984
11985         * cil-coff.h, image.c: updated assembly loader to cope with the
11986         PE32+ 64 bit file format.
11987
11988 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
11989
11990         * assembly.c, class.c, domain.c, loader.c: remove useless
11991         inclusion of cil-coff.h.
11992
11993 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
11994
11995         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
11996         if interface is marked with CoClassAttribute. 
11997    
11998         Code is contributed under MIT/X11 license.
11999
12000 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12001
12002         * sgen-gc.c: ensure no object from the to space is copied again or finalized
12003         if it's seen twice in major collections.
12004
12005 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
12006
12007         * sgen-gc.c: big objects are not copied to the gray area, but they
12008         need to be considered for scanning, too, if they are brought alive
12009         by an object ready for finalizations or a survived one.
12010
12011 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
12012
12013         * sgen-gc.c: properly account the number of disappearing links when
12014         they are nullified.
12015
12016 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
12017
12018         * sgen-gc.c: share the code to scan the registered roots between the
12019         different types of collections.
12020
12021 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12022
12023         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
12024
12025 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
12026
12027         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
12028         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
12029
12030 2007-08-28  Mark Probst  <mark.probst@gmail.com>
12031
12032         * security-manager.c (mono_security_manager_get_methods):
12033         LinkDemandSecurityException now has 2 arguments instead of 3.
12034
12035 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
12036
12037         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
12038         platforms which need it.
12039
12040 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12041
12042         * sgen-gc.c: unregister thread data structures with a pthread_key_t
12043         dtor.
12044
12045 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
12046
12047         * threads.c: free the thread static data on thread exit.
12048
12049 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
12050
12051         * class.c: walk the hierarchy to find the generic definition for
12052         a class (fixes runtime part of bug #82498).
12053
12054 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12055
12056         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
12057         ...
12058
12059         * image.c (mono_image_close): Here. Hopefully fixes #82510.
12060
12061 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12062
12063         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
12064
12065 2007-08-24  Robert Jordan  <robertj@gmx.net>
12066
12067         * appdomain.c: don't perform the ':'->';' substitution on Win32.
12068
12069 2007-08-24  Jb Evain  <jbevain@novell.com>
12070
12071         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
12072         for byref types.
12073
12074 2007-08-24  Mark Probst  <mark.probst@gmail.com>
12075
12076         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
12077         #82286.
12078
12079 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
12080
12081         * assembly.c: Fix a warning.
12082         
12083 2007-08-23  Marek Habersack  <mhabersack@novell.com>
12084
12085         * appdomain.c: parse the <runtime> section looking for the probing
12086         element with the 'privatePath' attribute, which sets additional
12087         directories in which the runtime should look for assemblies.
12088
12089 2007-08-23  Robert Jordan  <robertj@gmx.net>
12090
12091         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
12092         Fixes #82499.
12093
12094 2007-08-23  Martin Baulig  <martin@ximian.com>
12095
12096         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
12097         _mono_debug_init_corlib() and remove it from the header file.
12098
12099 2007-08-23  Martin Baulig  <martin@ximian.com>
12100
12101         * mono-debug-debugger.c
12102         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
12103         don't notify the debugger about it.
12104
12105         * mono-debug-debugger.h
12106         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
12107
12108 2007-08-23  Robert Jordan  <robertj@gmx.net>
12109
12110         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
12111         Code is contributed under MIT/X11 license.
12112
12113 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
12114
12115         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
12116
12117 2007-08-22  Martin Baulig  <martin@ximian.com>
12118
12119         * mono-debug.c: Store debugging info on a per-domain basis and
12120         free it on domain unload.  Add support for unloading symbol files.
12121
12122         * mono-debug.h
12123         (MonoDebugList): New typedef.
12124         (MonoSymbolTable):
12125         - add `data_tables and `type_table'.
12126         - replace 'symbol_files' and `num_symbol_files' with a
12127           `MonoDebugList *'.
12128         (mono_debug_data_table): Removed.
12129         (mono_debug_list_add): New public function.
12130         (mono_debug_list_remove): New public function.
12131         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
12132         (mono_debug_init_2_memory): Renamed into
12133         mono_debug_open_image_from_memory().
12134         (mono_debug_close_image): New public function.
12135         (mono_debug_domain_create): Likewise.
12136         (mono_debug_domain_unload): Likewise.
12137         (MONO_DEBUGGER_VERSION): Bump to 60.
12138
12139         * mono-debug-debugger.h
12140         (MonoDebuggerEvent):
12141         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
12142         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
12143         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
12144         - rename `THREAD_CREATED' and `THREAD_EXITED' into
12145           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
12146         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
12147           meaning.
12148         (mono_debugger_add_symbol_file): Removed.
12149         (mono_debugger_add_type): Removed.
12150         (mono_debugger_lookup_type): Removed.
12151         (mono_debugger_lookup_assembly): Removed.
12152
12153         * domain.c
12154         (mono_domain_create): Call mono_debug_domain_create().
12155         (mono_init_internal): Call mono_debug_init_corlib().
12156
12157         * assembly.c
12158         (mono_assembly_close): Call mono_debug_close_image().
12159
12160 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
12161
12162         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
12163         mmap call.
12164
12165 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
12166
12167         * sgen-gc.c: ensure section->pin_queue_end is initialized
12168         correctly when non pinning objects in the section have been found.
12169
12170 2007-08-22  Marek Habersack  <mhabersack@novell.com>
12171
12172         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
12173         containing a list of directories separated by ':'. MSDN docs say
12174         the directories should be separated with ';'. Part of a bugfix for
12175         bug #81446
12176
12177 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
12178
12179         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
12180         it should MonoType and not MonoClass.
12181
12182 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
12183
12184         * culture-info-table.h : regenerated.
12185
12186 2007-08-20  William Holmes  <billholmes54@gmail.com>
12187
12188         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
12189          to call ReplaceFile Kernel32 on windows or in io-layer.
12190         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
12191         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
12192          as an internal call.
12193
12194         Code is contributed under MIT/X11 license.
12195
12196 2007-08-20  Jb Evain  <jbevain@novell.com>
12197
12198         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
12199         and MONO_EXCEPTION_FIELD_ACCESS.
12200
12201         * debug-helpers.[c|h]: new mono_field_full_name function.
12202
12203 2007-08-20  Mark Probst  <mark.probst@gmail.com>
12204
12205         * class.c: Removed class_security_level() and moved it to
12206         security-core-clr.c.
12207
12208         * security-core-clr.c, security-core-clr.h: class_security_level()
12209         is now public and renamed to mono_security_core_clr_class_level().
12210         It also looks for security attributes in the classes a class is
12211         nested in.
12212
12213 2007-08-20  Mark Probst  <mark.probst@gmail.com>
12214
12215         * security-core-clr.c, security-core-clr.h: CoreCLR security
12216         utility functions.
12217
12218         * Makefile.am: Added security-core-clr.[ch].
12219
12220         * security-manager.c, security-manager.h: Functions and enum for
12221         setting and getting the security mode.
12222
12223         * class.c: CoreCLR security checks.
12224
12225 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
12226
12227         * icall-def.h, process.c, process.h: implemented icall to get
12228         user/system processor times.
12229
12230 2007-08-17  Mark Probst  <mark.probst@gmail.com>
12231
12232         * domain.c, threads.c, class-internals.h, domain-internals.h: New
12233         reader-lock-free jit_info_table.
12234
12235 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
12236
12237         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
12238
12239         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
12240
12241         * object-internals.h (MonoException): Add missing _data member.
12242
12243 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
12244
12245         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
12246         checking that only methods with matching qname or fqname are picked
12247         from implemented interfaces.
12248
12249 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
12250
12251         * verify.c (do_newarr):added, do type verification of
12252         newarr ops, push the right value on the eval stack.
12253         * verify.c (mono_method_verify): use do_newarr
12254
12255
12256 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
12257
12258         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
12259         factored the common code into get_boxable_mono_type, which
12260         is now using mono_type_get_full, this fixed byref related tests.
12261
12262 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
12263
12264         * class.c: added mono_type_get_full, this function has the same
12265         behavior of mono_class_get_full but the returned MonoType has
12266         all metadata of the associated token in case of a typespec token.
12267         * class.c: added mono_type_retrieve_from_typespec, used by 
12268         mono_type_get_full to retrieve the token type.
12269         * class.c (mono_class_create_from_typespec): changed to use
12270         mono_type_retrieve_from_typespec.
12271         * class.c (mono_ldtoken): changed to use mono_type_get_full
12272         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
12273         * class-internals.h: exported mono_type_get_full for internal use.
12274
12275 2007-08-16  Jb Evain  <jbevain@novell.com>
12276
12277         * domain.c (supported_runtimes): add entry for
12278         the 'moonlight' runtime version.
12279
12280 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12281
12282         * verify.c (mono_method_verify): small typo sliped in.  
12283
12284 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12285
12286         * verify.c (do_unbox_value): added, do type verification of
12287         unboxing ops
12288         * verify.c (mono_method_verify): use do_unbox_value
12289
12290
12291 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12292
12293         * verify.c (dump_stack_value): fixed typo, was printing string
12294         instead of object on stack.
12295         * verify.c (do_box_value): moved the byref check up as it leads
12296         to invalid code and should be done earlier.
12297         * verify.c: improved error messages for and ldobj
12298
12299 2007-08-15  William Holmes  <billholmes54@gmail.com>
12300
12301         * marshal.c (emit_marshal_custom): Omit the call to 
12302           marshal_native_to_managed when calling native to managed 
12303           and the argument is specified as an out argument.
12304
12305         Code is contributed under MIT/X11 license.
12306
12307 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
12308
12309         * verify.c: fixed the type checks for generics, function pointers and vectors.
12310         Added type verification for ldobj and ldtoken. The verifier
12311         would segfault if header or signature of a method contained references
12312         to non-existant types.
12313
12314 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
12315
12316         * marshal.c (cominterop_get_ccw): Patch from
12317         Bill Holmes to no walk up interface hierarchy. 
12318         All parent methods should be present in the interface for COM.
12319    
12320         Code is contributed under MIT/X11 license.
12321
12322 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
12323
12324         * marshal.c (emit_marshal_com_interface): Patch from
12325         Bill Holmes to handle COM Interfaces as return values
12326         for native->managed calls.
12327    
12328         Code is contributed under MIT/X11 license.
12329
12330 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
12331
12332         * marshal.c (cominterop_get_idispatch_for_object): Implement
12333         for runtime callable wrappers.
12334    
12335         Code is contributed under MIT/X11 license.
12336
12337 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
12338
12339         * pedump.c (main): changed from mono_init to mono_init_from_assembly
12340         so 2.0 types are accessible
12341
12342
12343 2007-08-13  Miguel de Icaza  <miguel@novell.com>
12344
12345         * domain.c (mono_init_internal): Call mono_assembly_load_friends
12346         once we load mscorlib.   Due to the order in which we initialize,
12347         the mono_assembly_load_full routine that loads mscorlib did not
12348         load friends.   We now load it once we load the
12349         mono_defaults.internals_visible_class class. 
12350
12351         * assembly.c: Expose the mono_load_friend_assemblies method.
12352
12353 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
12354
12355         * verify.c: improved the handling of boxing, better
12356         type checking for unary ops and conversion. Fix bug
12357         regarding managed pointer compatibility checking
12358
12359 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
12360
12361         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
12362
12363         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
12364
12365 2007-08-09  Raja R Harinath  <rharinath@novell.com>
12366
12367         * reflection.c (dup_type): Remove.
12368         * class.c (dup_type): Remove.
12369         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
12370         instead of the dodgy 'dup_type'.
12371         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
12372         handle the case where 'dup_type' needed the second argument.
12373
12374 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
12375
12376         * domain.c: Fix a warning.
12377
12378 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
12379
12380         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
12381         checking that methods with the same fqname are not overridden
12382         with a method from an ancestor.
12383
12384 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
12385
12386         * threads.c (free_thread_static_data_helper): Avoid a crash if
12387         thread->static_data is not yet set.
12388
12389 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
12390
12391         * marshal.c: Use correct image when emitting
12392         native wrapper for COM calls.
12393    
12394         Code is contributed under MIT/X11 license.
12395
12396 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
12397
12398         * icall-def.h, security.c, security.h :
12399           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
12400
12401 2007-08-07  Martin Baulig  <martin@ximian.com>
12402
12403         * mono-debug-debugger.h
12404         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
12405
12406         * domain.c (mono_domain_free): Call
12407         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
12408
12409 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
12410
12411         * verify.c (check_underflow, check_overflow): error message now returns IL offset
12412         * verify.c (in_same_block): code should test if either offset is inside the clauses
12413         * verify.c (mono_method_verify): push the exception into the eval stack of exception
12414         and filter blocks
12415
12416 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
12417
12418         * image.c (mono_image_close): Fix a leak.
12419
12420         * object.c (mono_runtime_invoke_array): Avoid using alloca.
12421
12422         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
12423
12424 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
12425
12426         * domain.c, threads.c, threads-types.h: fix memory retention issue
12427         with thread static variables not being cleared on domain unload.
12428         Reuse thread static slots after domain unload.
12429
12430 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
12431
12432         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
12433         nullable type.
12434
12435         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
12436         now done in mono_runtime_invoke_array.
12437
12438         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
12439         receiver is a nullable type.
12440
12441         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
12442         generic parameter.
12443
12444 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
12445
12446         * marshal.c: Implement COM Objects as return type for 
12447         managed->unmanaged calls. Added Release calls for COM Object
12448         out/return values in managed->unmanaged calls.
12449
12450         Code is contributed under MIT/X11 license.
12451
12452 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
12453
12454         * threads.h, threads-type.h: move the hazard pointer declarations
12455         to the private header.
12456
12457 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
12458
12459         * file-io.c, appdomain.c: memory leak fixes.
12460
12461 2007-08-02  Dick Porter  <dick@ximian.com>
12462
12463         * socket-io.c
12464         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
12465         SO_REUSEADDR setting into io-layer/sockets.c.
12466
12467 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
12468
12469         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
12470         from Object when called on a generic parameter. Fixes #82211.
12471
12472 2007-08-01  Dick Porter  <dick@ximian.com>
12473
12474         * file-io.c (convert_share): Test FileShare values bit-by-bit.
12475         Fixes bug 79250 yet again.
12476
12477 2007-07-30  Martin Baulig  <martin@ximian.com>
12478
12479         Merged the `debugger-dublin' branch.
12480
12481         * mono-debug.h
12482         (MonoDebugDataTable): New typedef.
12483         (MonoDebugMethodAddressList): New typedef.
12484         (MonoDebugWrapperData): Removed.
12485         (MonoDebugSymbolTable): Removed `current_data_table',
12486         `current_data_table_size', `current_data_table_offset'.
12487         (MonoDebugDataItemType): Moved into mono-debug.c.
12488         (MonoDebugMethodJitInfo): Remove `address'.
12489         (mono_debug_data_table): New global variable.
12490         (mono_debug_lookup_method_addresses): New public function.
12491         (mono_debug_find_method): Take a `MonoMethod *', not a
12492         `MonoDebugMethodInfo *'.
12493
12494         * mono-debug.c: Drop support for the old symbol tables.
12495
12496 2007-06-28  Martin Baulig  <martin@ximian.com>
12497
12498         * mono-debug.c (mono_debug_debugger_version): New public variable.
12499
12500 2007-07-31  William Holmes  <billholmes54@gmail.com>
12501
12502         * metadata.c Changed mono_type_create_from_typespec to not insert
12503           the type into the hash map until after
12504           do_mono_metadata_parse_type has completed.
12505         Fixes Bug #82194
12506         Code is contributed under MIT/X11 license.
12507
12508 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
12509
12510         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
12511         generic parameter. Fixes #82211.
12512
12513 2007-07-27  Jb Evain  <jbevain@novell.com>
12514
12515         * pedump.c (dump_metadata, dump_metadata_header): dump
12516         versions contained in the metadata header.
12517
12518 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
12519
12520         * threads.c: register small_id_table with the GC.
12521
12522 2007-07-27  Mark Probst  <mark.probst@gmail.com>
12523
12524         * threads.c, threads.h, class-internals.h, object-internals.h:
12525         Hazard pointers, to be used by lock-free parallel algorithms.
12526
12527 2007-07-26  Dick Porter  <dick@ximian.com>
12528
12529         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
12530         routine on non-windows platforms, as I've not managed to think of
12531         a non-kludgy way of doing this.  Finishes off bug 78739.
12532
12533 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
12534
12535         * object.c: properly setup interface_bitmap in proxy vtables.
12536
12537 2007-07-25  Marek Habersack  <mhabersack@novell.com>
12538
12539         * appdomain.c (get_shadow_assembly_location): do not use TickCount
12540         to create unique shadow copy target directories, use the domain's
12541         serial number instead. Each domain gets a unique target directory
12542         that way.
12543
12544         * domain.c (mono_domain_create): added code to increment domain
12545         shadow copy serial number and cache the value in the current
12546         domain structure.
12547
12548         * domain-internals.h (struct _MonoDomain): added a new field -
12549         shadow_serial to hold the serial number used in generation of
12550         shadow-copy directories. This is to make sure that the directory
12551         name is unique for each and every domain created. We avoid a race
12552         condition with overriding assemblies already in use by other app
12553         domains.
12554
12555 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
12556
12557         * class.c (mono_bounded_array_class_get): fixed memory leak when 
12558         binding generic parameters.
12559
12560 2007-07-24  Raja R Harinath  <rharinath@novell.com>
12561
12562         * metadata.c (do_mono_metadata_parse_generic_class): Use
12563         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
12564         error.
12565
12566 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
12567
12568         * loader.c, class-internals.h, reflection.c: removed the per-method
12569         generics hashtable: we use the global one through the call of
12570         mono_class_inflate_generic_method ().
12571
12572 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
12573
12574         * class.c, metadata.c, class-internals.h: introduce yet another
12575         generics global cache for inflated methods (fixes 98% of the perf
12576         issue in bug #81806).
12577
12578 2007-07-23  Raja R Harinath  <rharinath@novell.com>
12579
12580         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
12581         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
12582         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
12583         return a MonoGenericInst containing (a copy) of those types.
12584         (mono_metadata_inflate_generic_inst): Update to changes.
12585         (mono_metadata_parse_generic_inst): Likewise.
12586         (mono_get_shared_generic_inst): Likewise.
12587         * reflection.c (mono_class_bind_generic_parameters): Likewise.
12588         (mono_reflection_bind_generic_method_parameters): Likewise.
12589         * metadata-internals.h: Likewise.
12590         * icall.c (free_generic_context): Kill.
12591         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
12592
12593         * reflection.c (reflection_methodbuilder_to_mono_method): Use
12594         mono_metadata_type_dup.
12595         * marshal.c (mono_mb_create_method): Likewise.
12596
12597         * metadata.c (mono_metadata_type_dup): Rename from
12598         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
12599         MonoImage.  Handle a few more cases, esp. when no mempool is given.
12600         * marshal.c, metadata-internals.h: Update to changes.
12601
12602 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
12603
12604         * class.c: fixed a small leak for array classes and removed warning.
12605
12606 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
12607
12608         * loader.c (mono_method_get_param_token): Make this work on generic methods.
12609         Return 0x8000000 for return parameters. Fixes #82161.
12610
12611 2007-07-21  Marek Habersack  <grendello@gmail.com>
12612
12613         * appdomain.c (get_shadow_assembly_location): append the current
12614         ticks value to the path. Avoids overwriting the same assemblies by
12615         several threads at the same time.
12616
12617 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
12618         and Raja R Harinath  <rharinath@novell.com>
12619
12620         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
12621         Simplify slightly.
12622         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
12623         property for testing if a method is a generic method definition.
12624
12625 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
12626
12627         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
12628
12629 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12630
12631         * verify.c: used function from private branch, reverted to the one in class.h 
12632
12633 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12634
12635         * verify.c: a typo slipped in and the code wont compile
12636
12637 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12638
12639         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
12640         disabled box instruction as it is doing the wrong thing
12641         improved stack dump messages, now it is easier to debug type related issues
12642
12643
12644 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
12645
12646         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
12647
12648 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12649
12650         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
12651         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
12652         grouped with class and valuetype. This change will simply 
12653         the code as it should be handled just like unmanaged pointers.
12654
12655 2007-07-19  Mark Probst  <mark.probst@gmail.com>
12656
12657         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
12658
12659 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
12660
12661         * verify.c: several stack merge issues fixed, reference comparisons now
12662         check the type size. strict type check now works correctly.
12663         added more uses of IS_MANAGED_POINTER macro.
12664         fixed issues pointed by running the test suite against .net.
12665         
12666
12667 2007-07-19  Mark Probst  <mark.probst@gmail.com>
12668
12669         * class.c, loader.c, class-internals.h: Removed the
12670         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
12671         defines.
12672
12673         * icall.c: Better error checking in some internal reflection
12674         methods.
12675
12676 2007-07-18  William Holmes  <billholmes54@gmail.com>
12677
12678         * filewatcher.c : removed unused variable 'filename' in 
12679           ves_icall_System_IO_FSW_SupportsFSW
12680
12681 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
12682
12683         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
12684         obsolete, removed.
12685
12686 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
12687
12688         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
12689         
12690         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
12691
12692 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
12693
12694         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
12695         Implement generics support.
12696         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
12697
12698         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
12699         type_args and method_args arguments.
12700         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
12701         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
12702         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
12703
12704 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
12705
12706         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
12707           It adds a rootimage parameter to mono_reflection_get_type_internal,
12708           adds new function mono_reflection_get_type_with_rootimage and use
12709           the rootimage to resolve the types instead of the current image
12710
12711 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
12712
12713         * culture-info-table.h: Forgot to update after r78304.
12714
12715 2007-07-13  Raja R Harinath  <rharinath@novell.com>
12716
12717         * class.c (mono_class_is_open_constructed_type)
12718         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
12719
12720 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
12721
12722         * class.c (mono_bounded_array_class_get):  method fails if used with
12723         an incomplete TypeBuilder enum (no basetype field), fixed it by 
12724         avoiding calculating the size for such array as it cannot be instantiated.
12725         Fix bug #82015
12726
12727 2007-07-12  Raja R Harinath  <rharinath@novell.com>
12728
12729         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
12730         field.
12731         * metadata.c, reflection.c: Update to changes.
12732
12733 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
12734
12735         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
12736         mono_class_is_valid_enum, they are used to valide a enum when loading.
12737         * reflection.c: used new functions to throw TypeLoadException when and
12738         invalid enum is build with TypeBuilder. Fixes #82018
12739   
12740 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
12741
12742         * object.c: forgot commit of mono_class_setup_methods () to access
12743         iface->methods.
12744         * object-internals.h: added a few more handy fields to
12745         MonoIMTCheckItem.
12746
12747 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
12748
12749         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
12750         iface->methods.
12751
12752 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
12753
12754         * class-internals.h, object-internals.h, object.c: IMT-based
12755         interface invocation core from Massimiliano Mantione
12756         (massi@ximian.com) with a reworked arch-specific interface,
12757         bsearch implementation and a few bugfixes and memory savings by me.
12758
12759 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
12760
12761         * class.c (mono_class_create_from_typedef): mono would segfault if 
12762         an enum did not have a __value field. It now throws a TypeLoadException
12763         for such cases. Fix bug #82022
12764
12765 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
12766
12767         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
12768
12769 2007-07-09  Mark Probst  <mark.probst@gmail.com>
12770
12771         * class.c (mono_class_init): If a class is already inited but has
12772         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
12773
12774 2007-07-09  Mark Probst  <mark.probst@gmail.com>
12775
12776         * class.c: Properly handle the case of an unimplemented interface
12777         method.  Fixes: 81673.
12778
12779 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
12780
12781         * class-internals.h, object.c: cleanup patch from massi: use
12782         MonoVTable->interface_bitmap since the vtable interfaces offset array
12783         is going away.
12784
12785 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
12786
12787         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
12788         GetMDStreamVersion icall instead.
12789
12790 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
12791
12792         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
12793         not use mono_dl_build_path() with a full library name: makes
12794         fallbacks to libgaim and libfam work.
12795
12796 2007-07-06  William Holmes  <billholmes54@gmail.com>
12797
12798         * assembly.c: Added a continue statement in probe_for_partial_name when
12799          parse_assembly_directory_name fails.  Fixes : 82002
12800
12801 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
12802
12803         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
12804         and added a verification  for TYPEDBYREF.
12805         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
12806         make native int interchangeable with int32 and some small cleanup and formating.
12807         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
12808         handle byref of byref.
12809         * verify.c (push_local): handle byref of byref.
12810         * verify.c (do_binop): invalid mix of values is unverifiable
12811         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
12812         added visibility checks
12813         * verify.c (field related method): added visibility checks
12814         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
12815
12816 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
12817
12818         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
12819         string.
12820
12821 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
12822
12823         * profiler.c (mono_profiler_load): Fix an off-by-one error.
12824
12825         * marshal.c (emit_marshal_string): When returning a string from managed code,
12826         allways make a copy even for unicode strings. Fixes #81990.
12827
12828 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
12829
12830         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
12831         of byref generic inst types (bug #81997).
12832
12833 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
12834
12835         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
12836         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
12837
12838 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
12839
12840         * marshal.c (emit_marshal_string): Add support for unicode strings in
12841         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
12842
12843 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
12844
12845         * verify.c: field load/store are now verified, missing only access checks now
12846
12847 2007-06-28  Martin Baulig  <martin@ximian.com>
12848
12849         * mono-debug.c (mono_debug_debugger_version): New public variable.
12850
12851 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
12852
12853         * locales.c: When constructing DateTimeFormat or NumberFormat for
12854         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
12855         MonoCultureInfo contructed from the current locale is always
12856         read-only and has UseUserOverride set to true. All MonoCultureInfo
12857         instances returned for GetCultures have both IsReadOnly and
12858         UseUserOverride set to true. Fixes part of bug #81930.
12859
12860 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
12861
12862        * icall-def.h: Update System.__ComObject icalls
12863        * marshal.c: Avoid managed transition (and object creation)
12864        when looking up COM interface in RCW.
12865        * marshal.h: Ditto.
12866        
12867        Code is contributed under MIT/X11 license.
12868
12869 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
12870
12871         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
12872         to avoid crashes during assembly unloading.
12873
12874 2007-06-22  Raja R Harinath  <rharinath@novell.com>
12875
12876         Fix MethodInfo.IsGenericMethodDefinition
12877         * reflection.c (mono_reflection_bind_generic_method_parameters):
12878         Rearrange code to ensure we always uses a generic method definition.
12879         * class.c (mono_class_inflate_generic_method_full): Set
12880         'generic_container' field only for generic method definitions.
12881         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
12882         Use presense of 'generic_container' field as indication of being a
12883         generic method definition.
12884
12885 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
12886
12887         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12888
12889         * object-internals.h: Reflect changes in the layout of the managed Delegate
12890         class.
12891         
12892         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
12893         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
12894         runtime memory used by the dynamic method. Fixes #77146.
12895
12896 2007-06-21  Dick Porter  <dick@ximian.com>
12897
12898         * file-io.h: 
12899         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
12900         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
12901         81767.
12902
12903 2007-06-21  Raja R Harinath  <rharinath@novell.com>
12904
12905         * reflection.c (method_encode_methodspec): Add a tripwire.
12906         * class.c (inflate_generic_type): The fully open generic type is
12907         not the same as the generic type definition.
12908
12909 2007-06-21  Martin Baulig  <martin@ximian.com>
12910
12911         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
12912
12913         * mono-debug-debugger.h
12914         (MonoDebuggerBreakpointInfo): Removed.
12915         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
12916         (mono_debugger_remove_breakpoint): Likewise.
12917         (mono_debugger_breakpoint_callback): Likewise.
12918         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
12919
12920 2007-06-21  Raja R Harinath  <rharinath@novell.com>
12921
12922         * metadata.c (mono_metadata_lookup_generic_class): The fully open
12923         generic type is not the same as the generic type definition.
12924         * class.c (mono_generic_class_get_class): Likewise.
12925
12926 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
12927
12928         * icall.c: The second argument to 
12929         System.Reflection.MethodBase.GetMethodFromHandleInternalType
12930         is a MonoType not a MonoClass.
12931
12932 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
12933
12934         * verify.c: support for function pointers in the verifier
12935
12936 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
12937
12938         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
12939
12940 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
12941
12942         * assembly.c: removed Mono.Data.SqliteClient from the list of
12943         forward-compatible assemblies as it breaks the ABI (bug #81899).
12944
12945 2007-06-19  Raja R Harinath  <rharinath@novell.com>
12946
12947         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
12948         lookup/update with the loader lock.
12949         * reflection.c (mono_class_bind_generic_parameters): No need to
12950         protect mono_metadata_lookup_* with the loader lock.
12951         * class.c (inflate_generic_type): Likewise.
12952         
12953         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
12954         on a generic instantiated type.
12955
12956 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
12957
12958         *verify.c: produce meanfull error messages on verification error
12959         *verify.c: fixed some cases of verification errors reported as validation errors
12960         *pedump.c: fixed the error name array, now it shows validation errors properly
12961         *verify.h: fixed the contant that should be used for verification errors
12962
12963 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
12964
12965         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
12966         for bug #77596, 81858 and 80743 (generics data structures on domain
12967         unload).
12968
12969 2007-06-15  Raja R Harinath  <rharinath@novell.com>
12970
12971         Avoid allocating 'MonoGenericContext' on the heap.
12972         * class-internals (_MonoMethodInflated::context): Make field
12973         inline, not a pointer.
12974         * loader.c (method_from_methodspec): Allocate 'new_context' on the
12975         stack.  Use the context embedded within the inflated method as the
12976         hash key, rather than 'new_context'.
12977         * class.c (inflate_generic_context): Simplify.  Return a struct
12978         rather than allocating on the heap.
12979         (mono_class_inflate_generic_method_full): Update to changes.  Now,
12980         doesn't salt away a copy of the context -- simplifying the
12981         lifetime rules of a 'MonoGenericContext *'.
12982         (mono_method_get_context): Return pointer to embedded context.
12983         (setup_generic_array_ifaces): Allocate temporary context on stack.
12984         * reflection.c (inflate_mono_method): Likewise.
12985         (mono_reflection_bind_generic_method_parameters): Likewise.
12986         Use the context embedded within the inflated method as the hash key.
12987
12988         Avoid a source of allocation of 'MonoGenericContext'.
12989         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
12990         and 'cached_context' fields into embedded 'MonoGenericContext' field.
12991         * class.c: Update to changes.
12992         (mono_generic_class_get_context): Simplify drastically.  Now just
12993         returns a pointer to the field.
12994         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
12995         argument as a const pointer.
12996         (mono_metadata_generic_context_equal): Likewise.
12997         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
12998         Update to changes.
12999
13000 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
13001
13002         * verify.c improved the handling of brtrue/brfalse, factored out common code
13003
13004 2007-06-14  Raja R Harinath  <rharinath@novell.com>
13005
13006         Kill MonoGenericMethod.
13007         * class-internals.h (MonoGenericContext::method_inst): Rename from
13008         'gmethod' and convert to a MonoGenericInst.
13009         (MonoGenericMethod): Remove.
13010         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
13011         * loader.c (method_from_methodspec): Update to changes.  Use a
13012         MonoGenericContext as the key to the hashtable.
13013         * metadata.c (mono_metadata_generic_context_equal): Rename from 
13014         'mono_metadata_generic_method_equal' and take MonoGenericContext.
13015         (mono_metadata_generic_context_hash): Likewise from
13016         'mono_metadata_generic_method_hash'.  Change hash function.
13017         (mono_metadata_load_generic_params): Update to changes.
13018         (mono_get_shared_generic_method): Remove.
13019         * metadata-internals.h (mono_get_shared_generic_method): Remove.
13020         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
13021         (inflate_generic_context): Likewise.
13022         (mono_class_inflate_generic_method_full): Likewise.
13023         (setup_generic_array_ifaces): Likewise.
13024         (mono_class_create_from_typespec): Likewise.
13025         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
13026         (method_encode_methodspec): Update callsite.
13027         (reflection_methodbuilder_to_mono_method): Update to changes.
13028         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
13029         MonoGenericContext as the key to the hashtable.
13030         (inflate_mono_method): Update to changes.
13031
13032         * class-internals.h (MonoGenericMethod::container): Remove.
13033         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
13034
13035 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
13036
13037         * profiler-private.h, profiler.c, profiler.h: added API to profile
13038         exception events.
13039
13040 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13041
13042         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
13043
13044 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
13045
13046         * verify.c: method invocation is now validated, now we verify parameter types on stack.
13047         Fixed overflow and underflow not aborting the verification process.
13048
13049 2007-06-13  Mark Probst  <mark.probst@gmail.com>
13050
13051         * class-internals.h (MonoStats): Added stats entries for dynamic
13052         code allocations.
13053
13054 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
13055
13056         * loader.c (mono_free_method): Free header->locals and header->clauses.
13057
13058         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
13059         dynamic case.
13060
13061         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
13062
13063         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
13064
13065 2007-06-12  Raja R Harinath  <rharinath@novell.com>
13066
13067         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
13068         the tables.
13069
13070 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13071
13072         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
13073
13074 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13075
13076         MonoGenericMethod on a diet
13077         * class-internals.h (_MonoMethodInflated::reflection_info): Move
13078         here ...
13079         (_MonoGenericMethod::reflection_info): ... from here.
13080         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
13081         Update to changes.
13082         * reflection.c (inflate_mono_method): Likewise.
13083         (mono_reflection_bind_generic_method_parameters): Likewise.
13084
13085 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13086
13087         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
13088         *verify.c: factored long ldarg forms to share code with short forms
13089
13090 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
13091
13092         *verify.c: fixed code formating factored some duplicate code
13093         into a new function
13094
13095         *verify.h: fixed binary incompatibility introduced earlier
13096
13097         *pedump.c: fixed formating
13098
13099 2007-06-11  Raja R Harinath  <harinath@gmail.com>
13100
13101         Fix assertion when disassembling Mono.C5.dll
13102         * loader.c (method_from_methodspec): Avoid inflating a method
13103         twice with the same context.  If the methodref is inflated, use
13104         the declaring method instead.
13105
13106         * class.c (mono_class_from_generic_parameter): Fix case similar to
13107         bug #81830 handled below, but for method containers.
13108
13109 2007-06-10  Raja R Harinath  <harinath@gmail.com>
13110
13111         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
13112         get_shared_generic_class.  Directly inflate the instance.
13113         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
13114         (inflate_generic_class): Delete.
13115         (get_shared_generic_class): Delete.  Move setting of
13116         'cached_class' and 'cached_context' ...
13117         * metadata.c (mono_metadata_lookup_generic_class): ... here.
13118
13119         * metadata.c (mono_metadata_lookup_generic_class): Change
13120         signature to take the components of a MonoGenericClass rather than
13121         an allocated MonoGenericClass.  Change semantics to be intern-like.
13122         * reflection.c (mono_class_bind_generic_parameters): Update to
13123         changes.  Make locking region tighter.
13124         * class.c (inflate_generic_class): Update to changes.
13125         (get_shared_generic_class): Likewise.
13126         * metadata-internals.h: Likewise.
13127
13128         * reflection.c (mono_class_bind_generic_parameters): Take and
13129         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
13130         (mono_reflection_bind_generic_parameters): Use
13131         'mono_class_bind_generic_parameters' rather than duplicate the code.
13132         * class.c (mono_bounded_array_class_get): Update to changes.
13133         * object-internals.h: Likewise.
13134
13135         * reflection.c (mono_class_bind_generic_parameters): Only support
13136         parameterizing generic type definitions.  Remove support for other
13137         open types.
13138
13139 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
13140
13141         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
13142
13143         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
13144         in the dynamic case.
13145
13146 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
13147
13148         * threads.c: When cleaning up thread, reset the Background bit.
13149         Fixes bug #81720.
13150
13151 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
13152
13153        * metadata.c: Move variable declarations to top of scope.
13154        * verify.c: Move variable declarations to top of scope.
13155
13156        Code is contributed under MIT/X11 license.
13157
13158 2007-06-08  Raja R Harinath  <rharinath@novell.com>
13159
13160         * reflection.c (mono_class_bind_generic_parameters): Replace
13161         open-coded loop with mono_metadata_inflate_generic_inst.
13162
13163         * class.c (get_shared_generic_class): Don't call
13164         mono_get_shared_generic_inst.  Use the container's own
13165         'class_inst'.
13166
13167         * metadata.c (mono_metadata_load_generic_params): Move
13168         initialization of 'context' field here from ...
13169         * class.c (mono_class_create_from_typedef): ... here, and ...
13170         * loader.c (mono_get_method_from_token): ... here.
13171
13172         * class.c (get_shared_generic_class): Rename from
13173         mono_get_shared_generic_class and make static.
13174         (mono_get_shared_generic_inst): Move to metadata.c.
13175         * loader.c (mono_get_shared_generic_method): Likewise.
13176         * class-internals.h, metadata-internals.h: Update to changes.
13177
13178         Fix #81830
13179         * class.c (mono_class_from_generic_parameter): Don't assume a
13180         generic container owner exists.  Generic containers from monodis
13181         don't have any.
13182
13183 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
13184
13185         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
13186         * verify.h: new typedefs to returns the non-verifiable status
13187         * verify.c: initial implementation of generics, stack merging and object compatibility check
13188
13189 2007-06-06  Mark Probst  <mark.probst@gmail.com>
13190
13191         * class.c, image.c, class-internals.h (MonoImage): class_cache is
13192         a MonoInternalHashTable again (fixed bug in internal hash table
13193         code).
13194
13195 2007-06-06  Mark Probst  <mark.probst@gmail.com>
13196
13197         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
13198         MonoInternalHashTable again (fixed bug in internal hash table
13199         code).
13200
13201 2007-06-06  Mark Probst  <mark.probst@gmail.com>
13202
13203         * class.c, image.c, class-internals.h, domain.c,
13204         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
13205         changes.  Have to figure out what makes them break the SWF
13206         regression.
13207
13208 2007-06-04  Mark Probst  <mark.probst@gmail.com>
13209
13210         * class.c, image.c, class-internals.h (MonoImage): class_cache is
13211         a MonoInternalHashTable now.
13212
13213 2007-06-04  Mark Probst  <mark.probst@gmail.com>
13214
13215         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
13216         MonoInternalHashTable now.
13217
13218 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
13219
13220         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
13221         invoke_impl code.
13222
13223         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
13224
13225         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
13226         dependent trampoline.
13227
13228         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13229
13230         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
13231
13232 2007-05-29  Robert Jordan  <robertj@gmx.net>
13233
13234         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
13235
13236 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
13237
13238         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
13239
13240 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
13241
13242        * marshal.c: Fix interface lookup loops for
13243        cominterop_get_com_slot_for_method and 
13244        cominterop_get_method_interface. Only need to lookup
13245        if type is a class, else use interface type method is on.
13246
13247        Code is contributed under MIT/X11 license.
13248
13249 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
13250
13251         * reflection.c: HasSecurity can be present even if no specially 
13252         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
13253         SecurityAttribute). Fix CAS regression tests on buildbot.
13254
13255 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
13256
13257        * appdomain.c: Add configure checks for header files.
13258        * image.c: Add configure checks for header files.
13259        * file-io.c: Add configure checks for header files.
13260        * debug-mono-symfile.c: Add configure checks for header files.
13261        * threadpool.c: Add configure checks for header files.
13262        * console-io.c: Add configure checks for header files.
13263        * profiler.c: Add configure checks for header files.
13264        * rawbuffer.c: Add configure checks for header files.
13265        * icall.c: Add configure checks for header files.
13266        * rand.c: Add configure checks for header files.
13267        * socket-io.c: Add configure checks for header files.
13268
13269        Code is contributed under MIT/X11 license.
13270
13271 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
13272
13273         * reflection.c (mono_custom_attrs_from_builders): Remove the 
13274         assertion as it breaks the build.
13275         
13276         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
13277
13278         * reflection.c (lookup_custom_attr): Make a copy here too.
13279
13280         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
13281         dynamic images.
13282
13283         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
13284         images.
13285
13286         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
13287         info.
13288
13289 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
13290
13291         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
13292         (load_cattr_value): Ditto.
13293
13294 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
13295
13296         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
13297
13298 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
13299
13300         * threads.c: In "start_wrapper", set apartment_state to MTA if
13301         apartment_state is Unknown and we're running on 2.0 profile or
13302         higher.
13303         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
13304         to main method, then set apartment_state to Unknown on 1.0 profile,
13305         and MTA on 2.0 profile.
13306
13307 2007-05-16  Jb Evain  <jb@nurv.fr>
13308
13309         * class-internals.h (MonoDefaults): Add an attribute_class and
13310           customattribute_data_class.
13311         * domain.c (mono_init_internal): Populate them.
13312         * reflection.c: Use them to remove duplicates. Make a vew
13313         MonoClass variables `static'.
13314
13315 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
13316
13317         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
13318         step in implementing IMT, so that all isinst checks now can go
13319         through the bitmap.
13320         This was needed because vtables for TransparentProxy need to look
13321         like the vtable of the "target" class, so they need to point to
13322         its interface bitmap directly.
13323
13324         * object.c: inside "mono_class_create_runtime_vtable" and
13325         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
13326
13327 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
13328
13329         * object-internals.h
13330           culture-info.h : added territory field in MonoCulture and
13331           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
13332         * locales.c : fill territory field above too.
13333         * culture-info-table.h : regenerated.
13334
13335 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
13336
13337         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
13338         Fixes #81599.
13339
13340 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
13341
13342         * object.c: Always initialize apartment, even if 
13343         there is no custom attributes on entry point.
13344         
13345         Code is contributed under MIT/X11 license.
13346
13347 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
13348
13349         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
13350         * metadata.c: If no encoding is set, check for unicode
13351         on class.
13352         
13353         Code is contributed under MIT/X11 license.
13354
13355 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
13356
13357         * threads.c: Handle if mono_thread_current returns NULL 
13358         
13359         Code is contributed under MIT/X11 license.
13360
13361 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
13362
13363         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
13364         in start_wrapper. Added mono_thread_init_apartment_state and
13365         mono_thread_cleanup_apartment_state.
13366         * object.c: Initialize thread apartment state on main thread
13367         by checking for STAThreadAttribute on entry point.
13368         * object-internals.h: Add apartment_state field to MonoThread.
13369         * threads-types.h: Add unmanaged definition of 
13370         System.Threading.ApartmentState, MonoThreadApartmentState.
13371         
13372         Code is contributed under MIT/X11 license.
13373         
13374 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
13375
13376         * class.c: Fix windows build.
13377         * class-internals.h: Fix windows build.
13378         
13379         Code is contributed under MIT/X11 license.
13380
13381 2007-05-08  Robert Jordan  <robertj@gmx.net>
13382
13383         * process.c (CreateProcess_internal):
13384         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
13385         .CreateNoWindow was specified. Fixes #81496.
13386
13387 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
13388
13389         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
13390         step in implementing IMT, replaced it with two compact arrays
13391         (interfaces_packed and interface_offsets_packed) and a bitmap that
13392         is used for isinst checks (interface_bitmap).
13393
13394         * class.c: (compare_interface_ids): compare function to pass to
13395         bsearch when looking for an interface with a given id.
13396         (mono_class_interface_offset): reimplemented using bsearch on
13397         interfaces_packed, getting the offset from interface_offsets_packed.
13398         (print_implemented_interfaces): utility debugging function.
13399         (setup_interface_offsets): reworked to initialize interfaces_packed,
13400         interface_offsets_packed and interface_bitmap.
13401
13402         * object.c: replaced all accesses to "MonoClass.interface_offsets"
13403         with uses of interfaces_packed and interface_offsets_packed.
13404
13405 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
13406
13407         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
13408         mono_class_interface_offset prototype to wrap all accesses to
13409         "MonoClass.interface_offsets".
13410
13411         * class.c: Implemented mono_class_interface_offset, and wrapped all
13412         accesses to "MonoClass.interface_offsets".
13413
13414         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
13415         "MonoClass.interface_offsets".
13416
13417 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
13418
13419         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
13420         GetMethodFromHandle overloads (bug #78637).
13421
13422 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
13423
13424         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
13425         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
13426
13427 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
13428
13429         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
13430         #81498.
13431
13432         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
13433         gracefully.
13434         (mono_custom_attrs_from_index): Ditto.
13435
13436         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
13437         Fixes #81501.
13438
13439 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
13440
13441         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
13442         is now allocated from a mempool.
13443
13444 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
13445
13446         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
13447         caller holds threads_lock, leading to deadlocks. Fixes #81476.
13448
13449 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
13450
13451         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
13452         mono_loader_clear_error () too late. Fixes #81463.
13453
13454 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
13455
13456         * culture-info-table.h : regenerated.
13457
13458 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
13459
13460         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
13461         is missing.
13462
13463 2007-04-25  Dick Porter  <dick@ximian.com>
13464
13465         * Makefile.am: Put the mingw enforced-optimisation back into the
13466         PLATFORM_WIN32 section.
13467
13468 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
13469
13470         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
13471         patch.
13472
13473         * image.c (mono_image_load_module): New API function to load a module reference.
13474
13475         * image.c (load_modules): Load modules lazily. Fixes #80812.
13476
13477         * class.c (mono_class_from_typeref): Use mono_image_load_module.
13478         
13479         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
13480
13481         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
13482         to mono_image_load_module_dynamic.
13483
13484 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
13485
13486         * marshal.c: Fix calling convention for CCW on non-windows
13487         platforms. STDCALL on windows, CDECL everywhere else to work 
13488         with XPCOM and MainWin COM.
13489         
13490         Code is contributed under MIT/X11 license.
13491
13492 2007-04-23  Martin Baulig  <martin@ximian.com>
13493
13494         Fix #80969.
13495
13496         * loader.c
13497         (method_from_memberref): Added `gboolean *used_context' argument.
13498         (mono_get_method_from_token): Likewise.
13499         (mono_get_method_full): Don't insert the method in the cache when
13500         `used_context' is true.
13501
13502 2007-04-23  Raja R Harinath  <rharinath@novell.com>
13503
13504         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
13505
13506         * reflection.c (mono_reflection_bind_generic_parameters): Don't
13507         create new MonoTypes for returned types.
13508         * class.c (mono_generic_class_get_class): Export mono-internal.
13509         * class-internals.h: Update to changes.
13510
13511 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
13512
13513         * threadpool.c, threadpool.h, icall-def.h: patch from
13514         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
13515
13516 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
13517
13518         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
13519         
13520         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
13521
13522         * threads.c (mono_thread_get_stack_bounds): New helper function.
13523
13524         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
13525         Correctly compute stack bounds when attaching. Fixes #81394.
13526
13527 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
13528
13529         * reflection.c: fix handling of doubles in custom attributes
13530         for the arm-fpa format (bug #81368).
13531
13532 2007-04-18  Raja R Harinath  <rharinath@novell.com>
13533
13534         * reflection.c (assembly_add_win32_resources): Mildly relax an
13535         bounds check to let the end pointer point just past the end of the
13536         allocated buffer.  (may fix #81384)
13537
13538 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
13539
13540         * culture-info-table.h : regenerated.
13541
13542 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
13543
13544         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
13545         the thread is aborted early.
13546
13547 2007-04-05  Dick Porter  <dick@ximian.com>
13548
13549         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
13550         FindFirstFile()/FindNextFile() to find entries.  This lets the
13551         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
13552         81038.
13553
13554         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
13555         the parameters of
13556         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
13557
13558 2007-04-04  Martin Baulig  <martin@ximian.com>
13559
13560         * debug-helpers.c
13561         (mono_method_desc_full_match): Add support for nested classes.
13562
13563 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
13564
13565         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
13566
13567 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
13568
13569         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
13570         waiting for too many threads.
13571
13572 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
13573
13574         * environment.c: Fix return value check on uname so we can get the 
13575         executing version on Solaris operating systems.
13576
13577 2007-03-28  Jb Evain  <jbevain@gmail.com>
13578
13579         * class.c (mono_type_get_name_recurse): Complete the
13580         fix for the creation of assembly qualified names for
13581         pointer types. Fixes #81208.
13582
13583 2007-03-27  Dick Porter  <dick@ximian.com>
13584
13585         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
13586         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
13587         changed.
13588
13589         * threads.c
13590         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
13591         the value of ReleaseMutex().
13592
13593 2007-03-27  Dick Porter  <dick@ximian.com>
13594
13595         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
13596         in little-endian order, not network endian, so must be converted
13597         to host endian here.  Fixes bug 80593.
13598
13599 2007-03-22  Jb Evain  <jbevain@gmail.com>
13600
13601         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
13602         qualified names for pointer types. Fixes #81208.
13603
13604 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
13605
13606         * marshal.c: Add support for PreserveSigAttribute. 
13607         
13608         Code is contributed under MIT/X11 license.
13609
13610 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
13611
13612         * process.c: Fix endianness issues. Fixes #81126.
13613
13614         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
13615         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
13616
13617         * image.c (mono_image_lookup_resource): Make this work on big-endian
13618         machines.Change API contract so the caller needs to free the return value.
13619         
13620         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
13621         API change.
13622         
13623 2007-03-14  Martin Baulig  <martin@ximian.com>
13624
13625         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
13626         mono_type_get_desc() as well.
13627
13628 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
13629
13630         * icall.c:  Fix environ access in VS.  
13631         
13632 2007-03-13  Alp Toker  <alp@atoker.com>
13633
13634         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
13635         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
13636         #63841.
13637
13638 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
13639
13640         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
13641         circular references among dynamic methods. Fixes #81091.
13642
13643         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
13644
13645 2007-03-09  Martin Baulig  <martin@ximian.com>
13646
13647         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
13648
13649 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
13650
13651         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
13652         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
13653         
13654         Code is contributed under MIT/X11 license.
13655         
13656 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
13657
13658         * loader.c: Reapply patch for bug #79424.
13659
13660 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
13661
13662         * metadata.c (mono_type_to_unmanaged): Only convert object to
13663         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
13664
13665 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
13666
13667         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
13668         (and incorrectly set) is_reference field from MonoGenericInst.
13669
13670 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
13671
13672         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
13673         a little earlier.
13674
13675         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
13676
13677         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
13678
13679 2007-03-05  Miguel de Icaza  <miguel@novell.com>
13680
13681         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
13682         FileOptions.1 value to mean "temporary", map that to
13683         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
13684
13685         Fixes 80688
13686
13687 2007-03-03  Marek Habersack  <mhabersack@novell.com>
13688
13689         * appdomain.c: implement MS .Net style shadow copying. Copies of
13690         the assemblies are made in a subdirectory of the dynamic base
13691         directory, the assembly names are preserved.
13692         Copy .mdb and .config files along with the assemblies being shadowed.
13693
13694 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
13695
13696         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
13697         (emit_marshal_handleref): Ditto.
13698
13699         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
13700         on Visual C++. Fixes #80671.
13701
13702 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
13703
13704         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
13705         for clone operations.
13706
13707 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
13708
13709         * marshal.c: Fix warnings.
13710
13711 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
13712
13713         * loader.c: allow case-insensitive matching of the dll name
13714         in dllmap handling when prefixed with "i:".
13715
13716 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
13717
13718         * threads.c: Fix #ifdef for dummy_apc function for VS.
13719
13720 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
13721
13722         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
13723
13724 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
13725         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
13726         giving precedence to the methods with a fully qualified name
13727         (InterfaceName.MethodName) when building the interface sections
13728         of the vtable.
13729
13730 2007-02-16  Dick Porter  <dick@ximian.com>
13731
13732         * threadpool.c (append_job): Fix fast-path array handling, so it's
13733         less likely the array will grow exponentially when the load is
13734         heavy.
13735
13736 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13737
13738         * metadata-internals.h, loader.c: fix dllmap lookup order
13739         for non-function maps, too, and prepare for fallback code.
13740
13741 2007-02-12  Robert Jordan  <robertj@gmx.net>
13742
13743         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
13744         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
13745         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
13746         GlobalFree. Fixes a part of bug #77075.
13747
13748 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
13749
13750         * loader.c: implemented typedef parent in field memberref.
13751
13752 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
13753
13754         * marshal.c: Fix warnings and remember to call Release on
13755         IUnknown of RCW.
13756         
13757         Code is contributed under MIT/X11 license.
13758
13759 2007-02-10  Miguel de Icaza  <miguel@novell.com>
13760
13761         * class-internals.h: Add MonoHandleRef definition, and
13762         handleref_class to mono_defaults. 
13763
13764         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
13765         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
13766
13767         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
13768         (do nothing on this stage)
13769         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
13770         (emit_marshal_handleref): New method, used for argument handling
13771         of HandleRefs. 
13772
13773 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
13774
13775         * class.c (mono_class_setup_parent): Lazily init com types.
13776         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
13777         init com types.
13778         * object.c (mono_remote_class_vtable): Lazily init com types.
13779         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
13780         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
13781         * domain-internals.h: Expose mono_init_com_types.
13782         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
13783         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
13784         Add support for COM Callable Wrapper marshalling.
13785         * marshal.h: Add icall definitions.
13786         * gc.c: Handle freeing of CCWs in finalizer code.
13787         
13788         Code is contributed under MIT/X11 license.
13789
13790 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
13791
13792         * reflection.c: changed all the signature encoding code to use
13793         a variable-sized buffer.
13794
13795 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13796
13797         * marshal.c: locking fixes: never take the loader lock
13798         or other runtime locks when holding the marshal lock
13799         (fixes bug#80664).
13800
13801 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
13802
13803         * marshal.c: make the delegate function pointer mapping
13804         work for the moving GC.
13805
13806 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
13807
13808         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
13809         for bug #80618.
13810
13811 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13812
13813         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
13814         gmodule.
13815
13816 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
13817
13818         * threadpool.c: made the code moving-GC safe.
13819
13820 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
13821
13822         * assembly.c, boehm-gc.c, class-internals.h, class.c,
13823         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
13824         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
13825         warning cleanup.
13826         * reflection.c: warning cleanup, some threading and moving GC fixes.
13827
13828 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
13829
13830         * class.c, loader.c: create the needed Set/Get/Address array methods
13831         as well as the .ctors in mono_class_init (), fixes bug #80567.
13832
13833 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
13834
13835         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
13836         we doesn't decrease its alignment. Should fix the sparc build.
13837
13838 2007-01-24  Dick Porter  <dick@ximian.com>
13839
13840         * socket-io.c
13841         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
13842         Create the returned object if we need to ignore an unsupported
13843         socket option.  Fixes a segfault reported by Atsushi.
13844
13845 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
13846
13847         * class.c, object.c: restrict GC-tracked fields to
13848         UIntPtr fields used inside corlib, so we provide better
13849         type info to the GC and also allow broken packing as in
13850         bug #80580.
13851
13852 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
13853
13854         * sgen-gc.c: removed duplicated function.
13855
13856 2007-01-19  Miguel de Icaza  <miguel@novell.com>
13857
13858         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
13859         value that means that the value is not supported, but that we
13860         should not return a failure, but instead report this as a
13861         successful operation.
13862
13863 2007-01-19  Raja R Harinath  <rharinath@novell.com>
13864
13865         Fix tests/bug79956.2.il
13866         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
13867         (mono_generic_class_get_class): If the generic definition in an
13868         enum, copy over other fields related to it.
13869
13870 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
13871
13872         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
13873         genericinst enums (bug #79215).
13874
13875 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
13876         * class.c: Fix bug 80307.
13877
13878 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
13879
13880         * image.c: if the file table is not present, try to load
13881         all the modules, since we don't have info about them
13882         having or not metadata (bug #80517).
13883         * assembly.c: allow mono_assembly_load_references () to
13884         work for netmodules.
13885
13886 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13887
13888         * image.c, metadata-internals.h, object.c: execute module
13889         cctors when running on the 2 runtime if present (bug #80487).
13890
13891 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
13892
13893         * icall.c: optimized InitializeArray() on bigendian.
13894
13895 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
13896
13897         * icall.c: fix for the broken ARM FPA double format.
13898
13899 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
13900
13901         * icall.c: handle endian issues for r4 and r8 types, too, in
13902         the InitializeArray() icall.
13903
13904 2007-01-15  Miguel de Icaza  <miguel@novell.com>
13905
13906         * loader.c (mono_loader_error_prepare_exception): Clear the error
13907         once we have extracted the information from it, do this before we
13908         call into the JIT's class loading mechanisms.
13909
13910         * object.c (mono_class_create_runtime_vtable): Do not clear the
13911         loader error before calling mono_class_get_exception_for_failure
13912         as the loader error is needed inside
13913         mono_class_get_exception_for_failure to throw the error (thinko).
13914
13915         Fixes #80521
13916         
13917 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
13918
13919         * reflection.c: align fields rva data so it's faster to load at
13920         runtime.
13921
13922 2007-01-12  Raja R Harinath  <rharinath@novell.com>
13923
13924         Prepare to simplify GenericMethod handling.
13925         * class-internals.h (mono_method_get_context): New accessor function.
13926         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
13927         rather than directly accessing '->context' field.
13928
13929         * class-internals.h (_MonoGenericParam.method): Move ...
13930         (_MonoGenericContainer): ... here.  Add into union with klass field.
13931         * class.c, icall.c, loader.c, metadata.c, reflection.c:
13932         Update to changes.
13933
13934 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
13935
13936         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
13937         the wrapper type enum and reduce relocations.
13938
13939 2007-01-12  Raja R Harinath  <rharinath@novell.com>
13940
13941         * reflection.c (inflate_mono_method): Reuse method instantiation
13942         from the generic method, if available.
13943
13944 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13945
13946         * marshal.c (emit_marshal_variant): Fix conv_arg
13947         type in last commit, based on whether parameter is byref.
13948         
13949 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13950
13951         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
13952         marshalling.
13953         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
13954         MONO_TYPE_OBJECT back for VARIANT support.
13955
13956 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
13957
13958         * marshal.c, marshal.h, icall-def.h: Implement 
13959         Marshal.ReAllocCoTaskMem.
13960
13961 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
13962
13963         * marshal.c: memory retention fixes: use the proper
13964         image cache for runtime_invoke method lookups.
13965
13966 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
13967
13968         * mempool.c: added code to help debug mempool allocations.
13969
13970 2007-01-11  Dick Porter  <dick@ximian.com>
13971
13972         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
13973         support (experimenting with faking it with IP_MTU_DISCOVER for
13974         systems that don't have IP_DONTFRAGMENT.)
13975         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
13976         icall.
13977
13978         * icall-def.h: new System.Net.Sockets.Disconnect icall.
13979
13980         * socket-io.h: Add new fields to MonoSocketAsyncResult
13981         corresponding to the new ones in Socket.cs.
13982
13983 2007-01-11  Raja R Harinath  <rharinath@novell.com>
13984
13985         Fix IronPython regression mentioned in #80249
13986         * metadata.c (do_mono_metadata_parse_generic_class): Clear
13987         'cached_context' field, since it may have been initialized as a
13988         side-effect of metadata parsing.
13989
13990         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
13991         (_MonoGenericClass.cached_class): Move here and rename from lone
13992         remaining field of ...
13993         (_MonoInflatedGenericClass): ... this.  Remove.
13994         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
13995         to changes.
13996
13997         Fix mcs/tests/test-128.cs regression.
13998         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
13999         2007-01-10 change below.
14000         [MONO_TYPE_OBJECT]: Recurse into array case.
14001
14002 2007-01-11  Raja R Harinath  <harinath@gmail.com>
14003
14004         * class-internals.h (mono_get_inflated_generic_class): Remove.
14005         * class.c (mono_get_inflated_generic_class): Remove.
14006         (mono_generic_class_get_class): Rename from
14007         mono_class_create_generic.
14008         (mono_class_from_mono_type) [GENERICINST]: Use it.
14009         * reflection.c, metadata.c: Update to changes.  Use
14010         'mono_class_from_mono_type'.
14011
14012 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
14013
14014         * reflection.c: use passed type when encoding an array element
14015         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
14016
14017 2007-01-09  Robert Jordan  <robertj@gmx.net>
14018
14019         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
14020         result arguments (someDelegate.EndInvoke (unrelatedAres)).
14021         Fixes bug #80392.
14022
14023 2007-01-09  Raja R Harinath  <rharinath@novell.com>
14024
14025         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
14026
14027         * object.c (set_value): Avoid aliasing between type->data.klass
14028         and type->data.generic_class.
14029
14030         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
14031
14032 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14033
14034         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
14035         between type->data.klass and type->data.generic_class.
14036
14037 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
14038
14039         * marshal.c: In MS.NET, StringBuilder objects are not copied by
14040         value in out parameters.
14041
14042 2007-01-08  Raja R Harinath  <rharinath@novell.com>
14043
14044         Simplify invariant for MonoGenericClass::klass field.
14045         * class.c (mono_class_create_generic): Verify 'klass' is null.
14046         * metadata.c (do_mono_metadata_parse_generic_class): Don't
14047         initialize 'klass' field.
14048
14049 2007-01-05  Raja R Harinath  <rharinath@novell.com>
14050
14051         Ongoing work to avoid redundant data and simplify invariants.
14052         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
14053         'generic_class', and change type to a GenericInst.
14054         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
14055         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
14056
14057 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
14058
14059         * class.c : skip io-layer under PLATFORM_WIN32.
14060
14061 2007-01-03  Tor Lillqvist  <tml@novell.com>
14062
14063         Fix #80305: In a bundled executable, look in the bundled exe
14064         assembly to determine the runtime version. Add the possibility to
14065         bundle also the machine.config file.
14066         
14067         * assembly.c (mono_assembly_open_from_bundle): Make
14068         non-static. Allow being called even if we have no bundled
14069         assemblies, and return NULL right away in that case.
14070
14071         * domain-internals.h: Declare mono_assembly_open_from_bundle()
14072         here.
14073
14074         * domain.c (app_config_parse): Take an assembly exe file name as
14075         parameter instead of a config file name. Check for a bundled
14076         config file for that assembly by calling
14077         mono_config_string_for_assembly_file() (see below) before looking
14078         for one in the file system.
14079         (get_runtimes_from_exe): Corrsponding change to call of
14080         app_config_parse().
14081         (get_runtimes_from_exe): Check for bundled assembly exe file first
14082         by calling mono_assembly_open_from_bundle(). If no bundled
14083         assembly exe file is found, call mono_image_open() as before to
14084         look it up in the file system.
14085
14086         * mono-config.c: Add variable bundled_machinec_onfig.
14087         (mono_config_string_for_assembly_file): New function.
14088         (mono_config_for_assembly): Move code snippet that looks for a
14089         bundled assembly .config file into the above new function. Call
14090         it.
14091         (mono_register_machine_config, mono_get_machine_config): New
14092         functions to set and retrieve
14093
14094         * assembly.h: Declare mono_register_machine_config().
14095
14096         * mono-config.h: Declare mono_get_machine_config() and
14097         mono_config_string_for_assembly_file().
14098
14099         * icall.c: No declaration of environ necessary on Win32. It is
14100         declared (as a macro expanding to a function call) in stdlib.h.
14101         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
14102         New internal mono function. Returns the value of
14103         mono_get_machine_config() as a Mono string.
14104
14105         * icall-def.h: Add get_bundled_machine_config().
14106
14107 2007-01-04  Raja R Harinath  <rharinath@novell.com>
14108
14109         Remove redundant field
14110         * class-internals.h (_MonoGenericContext.container): Remove field.
14111         * loader.c (mono_method_get_signature_full): Don't parse a
14112         "container" for a signature parse when the signature is inflated
14113         immediately.
14114         (method_from_methodspec): Likewise, for a generic_inst.
14115         * class.c, metadata.c, reflection.c: Update to changes.
14116
14117 2006-01-04  Raja R Harinath  <rharinath@novell.com>
14118
14119         * class-internals.h (_MonoGenericClass): Rename 'context' field to
14120         'cached_context', and change semantics -- it starts off NULL, and
14121         is initialized on demand.
14122         * class.c (mono_generic_class_get_context): New accessor to
14123         replace 'context' field accesses.
14124         (mono_class_get_context): New helper.
14125         (*): Update to changes.
14126         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
14127
14128 2007-01-03  Miguel de Icaza  <miguel@novell.com>
14129
14130         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
14131         before the memcpy.   Fixes Marshal2 regression.
14132
14133 2007-01-02  Jb Evain  <jbevain@gmail.com>
14134
14135         * blob.h: add a MONO_TYPE_ENUM definition
14136         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
14137         fix the encoding of arrays of enums in custom attributes.
14138
14139         Fixes #79666.
14140
14141 2007-01-01  Miguel de Icaza  <miguel@novell.com>
14142
14143         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
14144         string is null terminated, but only cut the string short if it
14145         overflows the buffer.   
14146         
14147         (mono_string_to_byvalstr): Also fix this routine.   The code here
14148         was not properly terminating a string (it was only terminated
14149         because of the previous catch-all memset). 
14150
14151         I left the memset, because I do not know if applications expect
14152         the runtime to clear this region. 
14153
14154         Fixes #79944.
14155
14156         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
14157         Clear the error before returning to unmanaged code to prevent the
14158         runtime from being confused later on (fixes  80420).
14159         (ves_icall_type_from_name): Always call mono_loader_clear_error
14160         after parsing a type that could have failed.
14161         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
14162
14163         * loader.c (mono_loader_clear_error): Fix indentation.
14164
14165 2006-12-28  Martin Baulig  <martin@ximian.com>
14166
14167         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
14168
14169 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
14170
14171         * reflection.c: patch from Rolf Bjarne Kvinge to fix
14172         getting a token for an EnumBuilder.
14173
14174 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
14175
14176         * reflection.c: be more careful in case resource generation
14177         fails to create the data array.
14178
14179 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
14180
14181         * sgen-gc.c: write barrier for clone and fix unregister handles.
14182
14183 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
14184
14185         * reflection.c: some fixes needed in the generics code for the moving GC.
14186
14187 2006-12-22  Robert Jordan  <robertj@gmx.net>
14188
14189         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
14190         account. Fixes bug #80299.
14191
14192 2006-12-21  Raja R Harinath  <rharinath@novell.com>
14193
14194         Fix WaitHandle usage in delegates.
14195         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
14196         * object.c (mono_wait_handle_new): Use the property set method to
14197         initialize the handle.
14198         (mono_wait_handle_get_handle): New.
14199         * threadpool.c (mono_async_invoke): Use it.
14200         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
14201         Likewise.
14202         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
14203
14204 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
14205
14206         * marshal.c (emit_marshal): Call emit_marshal_variant and
14207         emit_marshal_com_interface when applicable.
14208         (emit_marshal_variant, emit_marshal_com_interface): Add
14209         methods for this case and remove if's from emit_marshal_object.
14210         
14211 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
14212
14213         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
14214
14215 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
14216
14217         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
14218         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
14219         and GlobalFree on Windows. Remove FIXME.
14220
14221 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
14222
14223         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
14224         implementation for managed objects.
14225
14226 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
14227
14228         * object.c: implemented code to be used for checking
14229         that no reference field overlaps with non-references.
14230
14231 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
14232
14233         * threadpool.c: fix queue code to be compatible with the
14234         moving GC.
14235
14236 2006-12-18  Miguel de Icaza  <miguel@novell.com>
14237
14238         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
14239         in structures by throwing ArgumentNullException.
14240
14241         (emit_marshal_safehandle): Also when they are null parameters.
14242
14243         (emit_marshal_safehandle): Add support for ref
14244         SafeHandles parameters
14245
14246 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
14247
14248         * profiler.c: updated to use the mono-dl API instead of
14249         gmodule.
14250
14251 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
14252
14253         * profiler.c: updated to use the mono-dl dynamic loading
14254         API instead of gmodule.
14255
14256 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
14257
14258         * profiler.c: use readlink, older versions of glib don't have
14259         g_file_read_link ().
14260
14261 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
14262
14263         * profiler.c: try to detect the path to mono if libc fails to provide
14264         a useful name (bug #80286).
14265
14266 2006-12-16  Raja R Harinath  <rharinath@novell.com>
14267
14268         Fix #80242
14269         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
14270         instance, use the generic type definition instead.
14271         (ves_icall_Type_GetNestedTypes): Likewise.
14272         * class.c (mono_class_create_generic): Always set the
14273         nested_classes of a generic instance to NULL, even if the generic
14274         type definition has nested types.
14275
14276 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
14277
14278         * marshal.c (mono_string_from_bstr): Revert previous Windows change
14279         and fix on Linux.
14280         
14281 2006-12-15  Miguel de Icaza  <miguel@novell.com>
14282
14283         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
14284         my arguments were in the wrong order.   I also fixed the Windows
14285         version which seems to have had the same issue.
14286
14287         (mono_free_bstr): On Unix, this is g_free.
14288         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
14289         conversions (for the tests in corlib to pass).
14290
14291 2006-12-14  Miguel de Icaza  <miguel@novell.com>
14292
14293         * marshal.c (emit_ptr_to_object_conv): For now, ignore
14294         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
14295         exception if a ref SafeHandle in a struct has changed).
14296         
14297         (emit_struct_conv): Do not perform layout checks for classes
14298         derived from SafeHandle, as those are specially handled. 
14299
14300         (emit_object_to_ptr_conv): Add support for
14301         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
14302
14303         (emit_marshal_safehandle): Implement conversion of return values
14304         of safehandles (MARSHAL_ACTION_CONV_RESULT).
14305         
14306         * threads.c: WaitHandle now is compiled with two different handles
14307         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
14308         for 2.0.
14309         
14310         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
14311         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
14312         these routines to cope with both kinds of fields.
14313
14314 2006-12-12  Miguel de Icaza  <miguel@novell.com>
14315
14316         * metadata.c (mono_type_to_unmanaged): Handle the case where
14317         type->data.klass is a SafeHandle, and in that case, return the
14318         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
14319         MONO_MARSHAL_CONV_SAFEHANDLE. 
14320
14321 2006-12-11  Miguel de Icaza  <miguel@novell.com>
14322
14323         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
14324         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
14325         calling emit_marshal_object.
14326
14327         (emit_marshal_safehandle): Implement marshalling of
14328         SafeHandle parameters (no ref support yet).
14329
14330         (MarshalAction): Document the defines as I implement
14331         them for SafeHandle.
14332
14333         (emit_marshal_object): indentation police.
14334
14335         * class-internals.h: Define MonoSafeHandle.
14336         Add safehandle_class to MonoDefaults type.
14337
14338         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
14339         list of classes to check for fields. 
14340
14341         * domain.c (mono_init_internal): Add SafeHandle to the list of
14342         mono_defaults loaded.
14343
14344 2006-12-15  Raja R Harinath  <rharinath@novell.com>
14345
14346         Fix #80253
14347         * reflection.c (mono_reflection_bind_generic_parameters): If the
14348         generic type definition is a type builder, ensure that it is fully
14349         initialized before instantiating it.  Kill some dead code.
14350
14351 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
14352
14353         * object.c: clear the loader_error () before loading
14354         more metadata stuff (bug #80258).
14355
14356 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
14357
14358         * icall.c, icall-defs.h: type modifiers icalls for
14359         parameters and properties.
14360
14361 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
14362
14363         * object.c, icall.c: fixed warnings.
14364
14365 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
14366
14367         * marshal.c: fixed a couple of leaks and coding style in a few places.
14368
14369 2006-12-08  Dick Porter  <dick@ximian.com>
14370
14371         * process.c: Cope with NULL ProcessStartInfo arguments on windows
14372         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
14373         80173.
14374
14375 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
14376
14377         * process.c: ProcessStartInfo may have only filename set and
14378         arguments can be NULL.
14379
14380 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
14381
14382         * icall.c: fix leak found by Robert Jordan.
14383
14384 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
14385
14386         * marshal.c, marshal.h: generate managed method to access an element
14387         of a multi-dimensional array.
14388
14389 2006-11-30  Paolo Molaro (lupus@ximian.com)
14390
14391         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
14392
14393 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
14394
14395         * icall.c: back out GetFields () fix until the serialization code is
14396         fixed to not depend on the incorrect behaviour.
14397
14398 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
14399
14400         * profiler.c: provide defaults if none are set.
14401
14402 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
14403
14404         * Makefile.am, attrdefs.h: new public header file with
14405         constants for attributes for use by embedders.
14406
14407 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
14408
14409         * icall.c: GetFields () fix for bug #80064.
14410
14411 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
14412
14413         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
14414         removed long unused icalls.
14415
14416 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
14417   
14418         * marshal.c: 
14419                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
14420                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
14421                 can be generated without a delegate class.
14422                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
14423         
14424         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
14425
14426 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14427
14428         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
14429         #80069.
14430
14431 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
14432
14433         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
14434         icall-def.h: added icalls needed by System.GC.
14435
14436 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
14437
14438         * loader.c: ensure the class in catch clauses is handled
14439         correctly for generics methods (fixes bug#79980).
14440
14441 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
14442
14443         * monitor.h, monitor.c: added mono_locks_dump () function
14444         to help debug deadlocks involving managed locks.
14445
14446 2006-11-13  Dick Porter  <dick@ximian.com>
14447
14448         * file-io.c (get_file_attributes): If the file is a symlink try
14449         and get the stat data for the target, but also add the
14450         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
14451         the specs for the windows symlink support, but will probably have
14452         to be reworked when I have test data from a vista machine.  Fixes
14453         bug 79887.
14454
14455 2006-11-13  Dick Porter  <dick@ximian.com>
14456
14457         * gc.c (mono_domain_finalize): 
14458         * marshal.c (mono_delegate_begin_invoke): 
14459         * threadpool.c (socket_io_init, mono_thread_pool_init)
14460         (mono_thread_pool_finish): 
14461         * monitor.c (mono_monitor_try_enter_internal): 
14462         * threads.c (mono_thread_resume, mono_thread_init)
14463         (mono_thread_suspend_all_other_threads)
14464         (mono_thread_execute_interruption): 
14465         * appdomain.c (mono_domain_unload): Check for NULL error returns
14466         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
14467         75733.
14468
14469 2006-11-11  Miguel de Icaza  <miguel@novell.com>
14470
14471         * process.c
14472         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
14473         Only close the handle if the value of the handle is not
14474         INVALID_HANDLE_VALUE.  This just makes the process a bit more
14475         robust.
14476
14477         Improvement for #75733, so that we do not run into this problem. 
14478
14479         
14480         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
14481         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
14482         internal variables.  Fixes #79462 
14483         
14484
14485 2006-11-09  Dick Porter  <dick@ximian.com>
14486
14487         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
14488         Use poll() not select().  Fixes bug 79397.
14489
14490 2006-11-09  Raja R Harinath  <rharinath@novell.com>
14491
14492         Fix #79872
14493         * assembly.c (mono_assembly_load_from_full): Check that the given
14494         image has an assembly manifest.
14495
14496 2006-11-09  Ankit Jain  <jankit@novell.com>
14497
14498         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
14499         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
14500         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
14501
14502 2006-11-07  Dick Porter  <dick@ximian.com>
14503
14504         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
14505         Put the old resolver behaviour back for pre-2.0 profiles.
14506
14507 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
14508
14509         * threadpool.c: precise GC and locking fixes.
14510
14511 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
14512
14513         * class.c: don't load types that have an explicit unaligned
14514         managed reference. Provide better info in the TypeLoad exception.
14515         Part of the fix for bug #79744.
14516         * object.c: use the correct check for class type load issues.
14517
14518 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
14519
14520         * class.c: enforce alignment of fields with managed references
14521         even when Pack=1 is forced by the user (bug #77788).
14522
14523 2006-11-03  Dick Porter  <dick@ximian.com>
14524
14525         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
14526         If the address reverse lookup fails, return it as the hostname
14527         anyway.  Fixes bug 79721.
14528
14529 2006-11-03  Dick Porter  <dick@ximian.com>
14530
14531         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
14532         Fix build on Windows.
14533
14534 2006-11-02  Dick Porter  <dick@ximian.com>
14535
14536         * icall-def.h: 
14537         * object-internals.h: 
14538         * exception.c (mono_get_exception_thread_interrupted): 
14539         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
14540         Fixes bug 74525.
14541
14542         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
14543         Check for pending Thread.Interrupt.
14544
14545 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
14546         * loader.c: Fixed bug 79684.
14547
14548 2006-10-27  Dick Porter  <dick@ximian.com>
14549
14550         * file-io.c (get_file_attributes): Force symlinks to directories
14551         to be returned as a regular file.  Fixes bug 79733.
14552 2006-10-26  Dick Porter  <dick@ximian.com>
14553
14554         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
14555         CreateFile to open a directory then we need to set the
14556         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
14557
14558 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
14559
14560         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
14561         friends.
14562
14563 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14564
14565         * sgengc.c: small cleanup of timer code.
14566
14567 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
14568
14569         * sgen-gc.c: fix some warnings and start adding support for
14570         complete object removal on domain unload.
14571
14572 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
14573
14574         * assembly.c: build_assembly_name should not consider a version
14575         number without build or revision number invalid. Fixes bug #79715.
14576
14577 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
14578
14579         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
14580         call kernel32 function OutputDebugString directly.
14581         
14582         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
14583         
14584 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
14585
14586         * reflection.c: small cleanup, using a function to insert a MonoString
14587         in the string heap.
14588
14589 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
14590
14591         * reflection.c: moving GC fixes.
14592
14593 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
14594
14595         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
14596         all the objects with finalizers belonging to an unloading appdomain.
14597
14598 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
14599
14600         * sgen-gc.c: added ability to allocate even when the nursery is fully
14601         pinned and fixed a couple of bugs.
14602
14603 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
14604
14605         * threads.h: Revert the last change for now.
14606
14607         * threads.h (mono_thread_get_pending_exception): Rename this to
14608         mono_thread_get_undeniable_exception ().
14609
14610 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
14611
14612         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
14613         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
14614         when fname does not refer to valid assembly. This result in a more
14615         meaningful error message.
14616         * exception.c: added mono_get_exception_bad_image_format2 which 
14617         constructs a BadImageFormatException using the ctor taking a custom
14618         message and the file name. Passing in a NULL msg results in a default
14619         message.
14620         * exception.h: define mono_get_exception_bad_image_format2 function.
14621         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
14622         when file name pointed to an invalid IL image. Use 
14623         mono_get_exception_file_not_found2 to construct FileNotFoundException,
14624         as this results in a more meaningful error message.
14625
14626 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
14627
14628         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
14629         #79465.
14630
14631 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
14632
14633         * metadata.c (mono_type_size): Change the align parameter to guint32 for
14634         consistency with the other _size functions.
14635         (mono_type_stack_size): Ditto.
14636
14637         * class.c object.c icall.c: Fix warnings caused by the above change.
14638
14639         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
14640
14641         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
14642
14643         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
14644
14645 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
14646
14647         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
14648         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
14649         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
14650         threadpool.h, threads-types.h: mark more internal functions.
14651
14652 2006-10-11  Dick Porter  <dick@ximian.com>
14653
14654         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
14655         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
14656         reproduce the bug even before applying the fix.)
14657
14658 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
14659
14660         * reflection.c: allow retrieving attributes for arguments in generic
14661         methods (bug #79241).
14662
14663 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
14664
14665         * debug-mono-symfile.c: properly check fopen () result (found by
14666         coverity).
14667
14668 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
14669
14670         * reflection.c: make error message clearer and fixed two
14671         issuelets found by Coverity.
14672
14673 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
14674
14675         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
14676
14677 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
14678
14679         * object-internals.h, gc-internal.h, profiler-private.h:
14680         mark internal functions.
14681
14682 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
14683
14684         * reflection.c: put data in the text section.
14685         * icall.c: recognize more types in type_from_typename ().
14686         * process.c, marshal.c: added some GC FIXMEs.
14687
14688 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
14689
14690         * loader.c: check for NULL before initializing.
14691
14692 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
14693
14694         * gc.c (finalizer_thread): Use a non-alertable wait here.
14695
14696         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
14697         until the correct solution is found.
14698
14699 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
14700
14701         * reflection.c (mono_module_get_object): Avoid an assert when operating on
14702         modules with no metadata. Fixes #79596.
14703
14704         * image.c (load_metadata_ptrs): Put back the error message when
14705         the #- heap is encountered since the support is not complete yet.
14706
14707 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
14708
14709         * gc.c: do not allow the user to SuppressFinalize () a
14710         delegate because it would leak the trampoline if present.
14711
14712 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
14713
14714         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
14715         PropertyPtr table.
14716
14717 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
14718
14719         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
14720
14721         * metadata.c (mono_metadata_get_param_attrs): Ditto.
14722
14723         * row-indexes.h: Add definitions for *Ptr tables.
14724
14725         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
14726
14727         * metadata.c (mono_metadata_translate_token_index): New helper function to
14728         translate table indexes used in uncompressed metadata.
14729         (mono_metadata_decode_table_row): Ditto.
14730         (mono_metadata_decode_table_row_col): Ditto.
14731
14732         * metadata.c: Add table schema for *Ptr tables.
14733
14734         * class.c loader.c: Use the new helper function to access the affected metadata
14735         tables.
14736         
14737         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
14738         #38532.
14739         
14740 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
14741
14742         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
14743         sequences which can be unbounded in size. Fixes #79583.
14744
14745 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
14746
14747         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
14748         static initialization.
14749
14750         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
14751
14752         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
14753
14754         * domain.c (mono_domain_free): Free up type_init_exception_hash.
14755
14756         * object.c (mono_runtime_class_init): Implement correct semantics when a static
14757         ctor fails, i.e. throw the same exception on subsequent accesses.
14758         
14759 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
14760
14761         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
14762         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
14763         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
14764         Handle marshalling of interfaces and VARIANTs contained in structs.
14765         
14766         Code is contributed under MIT/X11 license.
14767         
14768 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
14769
14770         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
14771         
14772         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
14773         mempool.
14774
14775 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14776
14777         * console-io.c: ignore previous SIGINT handler.
14778
14779 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
14780
14781         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
14782         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
14783         #79460, #79461, #79485.
14784
14785         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
14786
14787         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
14788         #79217.
14789
14790 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
14791
14792         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
14793         could be generated from it.
14794
14795 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
14796
14797         * rand.c: fix read loop to correctly handle EINTR.
14798
14799 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14800
14801         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
14802         internal calls are defined to keep methods closer to the declaring
14803         type and allow a significant reduction in runtime relocations and
14804         memory usage.
14805
14806 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
14807
14808         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
14809         exception message to have FileNotFoundException use the default
14810         assembly load error message. Fixes bug #79426.
14811         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
14812
14813 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14814
14815         * threadpool.c: (start_thread_or_queue) use the root domain when
14816         creating the thread instead of the async object one.
14817
14818 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
14819
14820         * class.c, object.c, class-internals.h, reflection.c:
14821         for arrays, store element_size inside MonoClass (speedup
14822         for array object creation).
14823
14824 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
14825
14826         * icall.c: fixed CodeBase to use the file name and not the module
14827         name (bug #79365).
14828
14829 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
14830
14831         * mono-debug.c, mono-debug.h: export find_method as
14832         mono_debug_find_method ().
14833
14834 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
14835
14836         * debug-helpers.c, class-internals.h: added a few functions useful
14837         when debugging under gdb.
14838
14839 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14840
14841         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
14842         characters that need special handling.
14843
14844 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
14845
14846         * mono-config.c: make the os/cpu specification more flexible,
14847         allowing lists and negation.
14848
14849 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
14850
14851         * marshal.c: COM Interop fixes. Handle case where method->klass.
14852         is interface. Handle BSTR/MonoString when null. Use CDECL as 
14853         calling convention on non-windows platforms. This is for
14854         compatibility with XPCOM and MainWin COM.
14855         
14856         Code is contributed under MIT/X11 license.
14857         
14858
14859 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
14860
14861         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
14862         correctly. Fixes #79217.
14863
14864         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
14865
14866 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
14867
14868         * mono-config.c: allow both an os and cpu attribute for dllmap
14869         and dllentry elemnets to enable a single config file to be used
14870         for multiple architectures.
14871
14872 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
14873
14874         * loader.c: MonoLoaderError was cleared too soon on load failure.
14875         Fixes bug #79424.
14876
14877 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
14878
14879         * icall.c: use the defining class vtable when accessing a
14880         static field, not a pobblibly derived class.
14881
14882 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
14883
14884         * icall.c string-icalls.c: Remove references to unicode.h.
14885
14886         * unicode.h unicode.c Makefile.am: Remove these unused source files.
14887
14888         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
14889
14890         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
14891         indicating the image where custom marshaller types should be looked up.
14892         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
14893         custom marshallers, instead of corlib. Fixes #79425.
14894
14895 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
14896
14897         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
14898
14899 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
14900
14901         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
14902         Implement Environment.ProcessorCount.
14903         
14904         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
14905         Implement Environment.ProcessorCount.
14906         
14907         * icall.c: 
14908         Add Environment.ProcessorCount icall.
14909         
14910         Patch by Jason McFall.
14911
14912 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14913
14914         * assembly.c: don't append .exe/.dll when the filename already contains
14915         one of those extensions.
14916
14917 2006-09-12  Martin Baulig  <martin@ximian.com>
14918
14919         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
14920         to array interfaces.
14921
14922 2006-09-11  Martin Baulig  <martin@ximian.com>
14923
14924         * reflection.c (mono_image_build_metadata): Create the
14925         MethodImpl's after emitting all types and methods, so we don't
14926         need another fixup pass for them.
14927
14928 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
14929
14930         * class.c (mono_class_from_name_case): Fix regression introduced by the last
14931         change.
14932
14933 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
14934
14935         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
14936         unload.
14937
14938 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
14939
14940         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
14941         args is not set. Fixes #78926.
14942
14943 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
14944
14945         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
14946
14947         * image.c (load_class_names): Move this to class.c, and rename it to 
14948         'mono_image_init_name_cache'.
14949         (load_modules): Fix a warning.
14950
14951         * class.c icall.c image.c: Initialize image->name_cache lazily.
14952
14953         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
14954         on its name using information in the AOT file.
14955
14956         * class.c (mono_class_from_name): Use the new hook function.
14957
14958 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
14959
14960         * reflection.c (mono_param_get_objects): Handle enum default parameter values
14961         correctly.
14962
14963         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
14964         Fixes #79289.
14965         
14966 2006-09-06  Martin Baulig  <martin@ximian.com>
14967
14968         * icall.c (mono_lookup_internal_call): Small fix.
14969
14970 2006-09-05  Raja R Harinath  <rharinath@novell.com>
14971
14972         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
14973         double g_free.
14974
14975 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
14976
14977         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
14978         when --debug is specified.
14979
14980 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
14981
14982         * class.c (setup_generic_array_ifaces): Fix a warning.
14983
14984 2006-09-04  Miguel de Icaza  <miguel@novell.com>
14985
14986         * Temporarily remove the patch to assemly.c that checks the
14987         assembly versions as it breaks our gacutil.
14988
14989 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
14990
14991         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
14992
14993         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
14994         a net 1.0 runtime.
14995
14996         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
14997         created using the default ctor. Fixes #79152.
14998         (mono_string_builder_to_utf16): Ditto.
14999
15000 2006-09-01  Martin Baulig  <martin@ximian.com>
15001
15002         Fix handling of the generic array interfaces.
15003
15004         * class-internals.h
15005         (MonoDefaults): Removed `generic_array_class' and added
15006         `generic_ilist' class.
15007
15008         * class.c
15009         (mono_bounded_array_class_get): Add the new generic array interfaces.
15010         (setup_generic_array_ifaces): New static method; create vtable
15011         entries for each method in the generic array interfaces.
15012
15013         * metadata.c
15014         (select_container): Allow "parent-less" generic methods.
15015
15016         * marshal.c
15017         (mono_marshal_get_generic_array_helper): New public method.
15018
15019         * icall.c
15020         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
15021         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
15022         moved the interncall into System.Array.
15023
15024 2006-09-01  Raja R Harinath  <rharinath@novell.com>
15025
15026         A few more cases of avoiding work on types with ->byref set.
15027         Has the real fix for #79238
15028         * icall.c (is_generic_parameter): New helper.
15029         (ves_icall_Type_GetGenericParameterPosition): Use it.
15030         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
15031         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
15032         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
15033         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
15034         reference types.
15035         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
15036         reference types.
15037         (ves_icall_Type_get_IsGenericInstance): Likewise.
15038         (ves_icall_Type_get_IsGenericType): Likewise.
15039
15040 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
15041
15042         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
15043         class if possible.
15044
15045         * mempool.h (mono_mempool_get_allocated): New helper function.
15046
15047         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
15048         change.
15049
15050         * mempool.c: Fix warnings and the calculation of stats.
15051
15052         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
15053
15054         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
15055
15056         * loader.c (mono_get_method_from_token): Update method_count stat.
15057
15058         * class-internals.h (MonoStats): Add some stats.
15059
15060 2006-08-31 Robert Jordan  <robertj@gmx.net>
15061
15062         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
15063         with managed variants.
15064         All code is contributed under the MIT/X11 license.
15065         
15066 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
15067
15068         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
15069         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
15070
15071         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
15072
15073         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
15074         with cycles in classes.
15075
15076         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
15077
15078         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
15079         missing a [MarshalAs] directive. Fixes #79203.
15080
15081         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
15082         klass->marshal_info. Fixes #79217.
15083
15084 2006-08-30  Martin Baulig  <martin@ximian.com>
15085
15086         Committing a patch from Joachim Ante <joe@otee.dk>:
15087         Add support for binary data symbol stores.
15088
15089         * debug-mono-symfile.c
15090         (mono_debug_open_mono_symbol_file): Renamed into
15091         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
15092         arguments.
15093
15094         * mono-debug.c
15095         (mono_debug_open_image): Added `raw_contents' and `size' args.
15096         (mono_debug_init_2_memory): New public function.
15097
15098 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
15099
15100         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
15101
15102 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15103
15104         * appdomain.c: implement support for ShadowCopyFiles.
15105
15106 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
15107
15108         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
15109         when value is NULL (and should remove CID #51).
15110
15111 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15112
15113         * image.c: moved 2 functions to ../utils.
15114
15115 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
15116
15117         * gc.c: cope with the target object of a GC handle being NULL
15118         (bug #78877).
15119
15120 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
15121
15122         * class.c: recursively check parent's explicit implementations
15123         of interface methods (fixes bug #79125).
15124
15125 2006-08-19  Miguel de Icaza  <miguel@novell.com>
15126
15127         * filewatcher.c: Avoid warnings when building, do not redefine
15128         constants that are defined.
15129
15130         Remove warnings.
15131
15132 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15133
15134         * image.c: don't fail when the link points to an absolute path.
15135
15136 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
15137
15138         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
15139         Fix CID #3.
15140
15141 2006-08-17  Miguel de Icaza  <miguel@novell.com>
15142
15143         * image.c (full_path): A new method used to obtain the actual path
15144         of an assembly even in the presence of symbolic links.  
15145
15146         This is necessary for the case where we are running a binary that
15147         has been GACed, but we are using the "published" path name
15148         ($prefix/mono/1.0/blah.exe) which happens to point to the real
15149         file in the GAC.
15150
15151         This was the source of the failure for the `xsp' command with the
15152         recent AppDomain changes, as far as the runtime was concerned,
15153         there were two different assemblies: $prefix/mono/1.0/blah.exe and
15154         $prefix/mono/gac/blah/version/blah.exe.
15155
15156         (do_mono_image_open): use full path
15157
15158 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
15159
15160         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
15161
15162 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
15163
15164         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
15165         domain_id is supplied. Fix CID #241 and corlib's unit tests.
15166
15167 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
15168
15169         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
15170         small structures. Fixes #78990.
15171
15172 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
15173
15174         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
15175
15176         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
15177
15178 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15179
15180         * appdomain.c:
15181         * marshal.c: don't load all the assemblies from a domain into newly
15182         created ones. The new domains might have different rules and load
15183         assemblies from different locations. Fixes bug #76757.
15184
15185         Patch by Lluis. Conflicts resolved by Brian Crowell.
15186
15187 2006-08-16  Alp Toker  <alp@atoker.com>
15188
15189         * socket-io.c: First half of the fix for #79084.
15190         Set sa_size to the length of the content, not that of the struct.
15191         Don't add NULL suffix to the content, this should be done in
15192         managed code if needed.
15193
15194 2006-08-14  Raja R Harinath  <rharinath@novell.com>
15195
15196         Fix part of #79012
15197         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
15198         mono_metadata_parse_type returns NULL.
15199
15200 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
15201
15202         * normalization-tables.h : new file for string normalization data.
15203         * locales.c, locales.h, icall.c :
15204           added load_normalization_resource() for string normalization,
15205           and icall as well.
15206         * Makefile.am : added normalization-tables.h to the sources.
15207
15208 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
15209
15210         * marshal.c: Add more helper functions to reduce code duplication and use them
15211         everywhere.
15212
15213 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
15214
15215         * marshal.c: Fix non-x86 stdcall warnings.
15216         
15217         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
15218         them everywhere.
15219
15220 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
15221
15222         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
15223         type check on multi-dimensional arrays. Fixes #79000.
15224
15225 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
15226
15227         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
15228         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
15229         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
15230         * class-internals.h: add is_com_object to class structure.
15231         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
15232         null checks to COM object marshalling. Fix .ctor call on RCW.
15233         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
15234         
15235         All code is contributed under the MIT/X11 license.
15236
15237 2006-08-09  Dick Porter  <dick@ximian.com>
15238
15239         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
15240         racing mono_monitor_allocator_lock() somewhere, so don't delete
15241         the critical section for now.  Found by running and exiting
15242         monodevelop.
15243
15244 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
15245
15246         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
15247         (ves_icall_System_ComObject_FindInterface): Ditto.
15248         (ves_icall_System_ComObject_CacheInterface): Ditto.
15249
15250         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
15251         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
15252
15253 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15254
15255         * threadpool.c: treat pipes from process asynchronous reads as sockets
15256         when reading from them, so we get select/poll or epoll to wait for
15257         data.
15258
15259 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
15260
15261         * loader.c: Fix a typo (CID #233) in the null check.
15262
15263 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
15264
15265         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
15266         Hopefully fixes #78949.
15267         
15268         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
15269         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
15270         bytes. Fixes #78972.
15271
15272 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15273
15274         * filewatcher.c: we need to set errno here.
15275
15276 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15277
15278         * filewatcher.c: let Win32Exception get the error value.
15279
15280 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15281
15282         * filewatcher.c: translate errno into win32 errors for Win32Exception
15283         to know what happened.
15284
15285 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
15286
15287         * threadpool.c: Fix more warnings.
15288
15289         * assembly.c (search_loaded): Fix warnings.
15290
15291         * threadpool.c (mono_thread_pool_finish): Fix warnings.
15292         (mono_async_invoke): Ditto.
15293
15294 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
15295
15296         * object.c (mono_remote_class_vtable): Need to create proxy vtable
15297         entries for __ComObject type in addition to ComImport types.
15298         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
15299         about hash table.
15300         
15301         All code is contributed under the MIT/X11 license.
15302
15303 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
15304
15305         * image.c: avoid tentative loading of modulerefs that contain
15306         no metadata (P/Invoke library names).
15307
15308 2006-07-28  Dick Porter  <dick@ximian.com>
15309
15310         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
15311         mono_loader_lock() somewhere, so don't delete the critical section
15312         for now.  Found by running and exiting monodevelop.
15313
15314 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15315
15316         * filewatcher.c: define the inotify syscalls when we're building on
15317         linux and have sys/syscall.h. The build system might not have support
15318         for inotify but the target system might have it.
15319
15320 2006-07-26  Miguel de Icaza  <miguel@novell.com>
15321
15322         * domain.c: Documentation updates.
15323
15324         * loader.c (mono_free_method): Do not release the method
15325         information if we are being profiled, as profilers will use this
15326         information at shut down to present some data to the user.
15327
15328         This is needed so that the profiler does not crash, as the
15329         profiler tends to keep MonoMethods around, and they might become
15330         invalid if we free these.
15331
15332         (mono_get_method_constrained): Return the original CIL stream
15333         method as well, so verification can be performed against it.
15334
15335 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15336
15337         * filewatcher.[ch]: support for inotify file system watcher.
15338         * icall.c: add new internal calls for the inotify file system watcher.
15339
15340 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15341
15342         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
15343         #78888.
15344
15345 2006-07-20  Dick Porter  <dick@ximian.com>
15346
15347         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
15348         warning.
15349
15350 2006-07-20  Dick Porter  <dick@ximian.com>
15351
15352         * threads.c (start_wrapper): Do the thread cleanup while we still
15353         hold a reference to its object.  Fixes bug 78123.
15354
15355 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
15356
15357         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
15358         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
15359           "managed-to-managed".
15360         * icall.c: Redirect string constructors that take sbyte* to
15361           ves_icall_System_String_ctor_RedirectToCreateString.
15362         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
15363           to CreateString () methods with matching signature.
15364         * reflection.c: Use original security informations for
15365           MONO_WRAPPER_MANAGED_TO_MANAGED.
15366         * security-manager.c: Use original security informations for
15367           MONO_WRAPPER_MANAGED_TO_MANAGED.
15368         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
15369           that is a placeholder and only its address should be used.
15370         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
15371           that is a placeholder and only its address should be used.
15372
15373 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
15374
15375         Begin implementing COM Interop.
15376         * appdomain.c: Increment corlib version.
15377         * class.c: Set ComImport classes' parent to __ComObject.
15378         * loader.c: Mark cominterop methods as such.
15379         * domain.c: Add __ComObject class to MonoDefaults structure.
15380         * image.c: Add 2 hashtables to the image for COM Interop related methods
15381         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
15382         using the mempool allocator
15383         
15384         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
15385         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
15386         declaration for mono_metadata_type_dup_mp.
15387         
15388         * debug-helpers.c: Added strings for two additional wrapper types
15389         * object.c: Create proxy objects for ComImport classes
15390         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
15391         and added __ComObject class to MonoDefaults structure.
15392         
15393         * object-internals.h: Finish MonoRealProxy definition, and add definition of
15394         MonoComInteropProxy and MonoComObject.
15395         
15396         * marshal.c: Added support for COM Interop
15397         (signature_cominterop): Converts managed signature to corresponding
15398         unmanaged COM signature.
15399         (cominterop_get_function_pointer): gets unmanaged function pointer via
15400         COM object vtable
15401         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
15402         (cominterop_get_method_interface): returns interface type that method is defined on
15403         (mono_mb_emit_cominterop_call): emits native call to function pointer
15404         gotten from vtable
15405         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
15406         that matches signature of unmanaged function.
15407         (cominterop_get_native_wrapper): wrapper around adjusted method call.
15408         (cominterop_get_invoke): forwards call from proxy to __ComObject
15409         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
15410         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
15411         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
15412         
15413         * marshal.h: Added Marshal icall declarations.
15414         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
15415         so we can access them in finalizer
15416         
15417 2006-07-14  Dick Porter  <dick@ximian.com>
15418
15419         * object.c (mono_type_initialization_cleanup): Fix a race
15420         condition by temporarily commenting out the critical section
15421         deletion.
15422
15423 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
15424
15425         * reflection.c (create_custom_attr): Fix some warnings.
15426         (create_custom_attr_data): Ditto.
15427         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
15428         types. Fixes #78855.
15429
15430 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
15431
15432         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
15433
15434         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
15435
15436 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
15437
15438         * reflection.c (resolve_object): Add support for DynamicMethod.
15439
15440         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
15441         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
15442
15443 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
15444
15445         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
15446         don't leak GPtrArray's pdata has we have no use (nor free) for it.
15447
15448 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
15449
15450         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
15451         Fixes #77888.
15452
15453 2006-06-30  Raja R Harinath  <rharinath@novell.com>
15454
15455         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
15456         slightly: remove a shadow local variable.
15457
15458 2006-06-29  Raja R Harinath  <rharinath@novell.com>
15459
15460         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
15461         definition that introduces the virtual function slot.
15462         Also fix Coverity #105.
15463
15464 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
15465
15466         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
15467         for dynamic assemblies. Fixes #78724.
15468
15469 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
15470
15471         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
15472         Fixes #78722.
15473
15474 2006-06-21  Martin Baulig  <martin@ximian.com>
15475
15476         * reflection.c
15477         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
15478         fixes #76484.
15479
15480 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
15481
15482         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
15483
15484 2006-06-20  Raja R Harinath  <rharinath@novell.com>
15485
15486         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
15487         nor TYPEREFs.
15488         * class.c (mono_class_create_from_typespec): Add 'context' argument.
15489         Inflate result if necessary.
15490         (mono_class_get_full): Remove old version.  Rename from
15491         'mono_class_get' and add 'context' argument.  Pass it to
15492         ..._create_from_typespec.
15493         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
15494         (mono_ldtoken): Revert change below.
15495
15496 2006-06-20  Martin Baulig  <martin@ximian.com>
15497
15498         * class.c (mono_ldtoken): Don't pass the generic context to
15499         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
15500
15501 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
15502
15503         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
15504         and later freeing it. Fixes #78638.
15505
15506 2006-06-15  Miguel de Icaza  <miguel@novell.com>
15507
15508         * icall.c (mono_class_get_throw): Revert over-zealous error
15509         throwing, the caller for mono_class_get_throw will cope with
15510         errors when classes are not properly initialized already.
15511
15512         The code still copes with loader exceptions though.
15513
15514         Fixes the regression in reftype1 and reftype3 from the CAS tests.
15515         
15516 2006-06-14  Miguel de Icaza  <miguel@novell.com>
15517
15518         Fixes the `make run1' version of RuntimeAbort (to be commited,
15519         source is in Bugzilla).
15520         
15521         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
15522         FALSE on class loading failure instead of returning true.
15523
15524         * class.c (mono_class_create_from_typedef): It is possible for
15525         mono_metadata_interfaces_from_typedef_full to fail if a class is
15526         not found, cope with this.
15527         
15528
15529 2006-06-14  Dick Porter  <dick@ximian.com>
15530
15531         * socket-io.c: 
15532         * process.c: Fix a bunch of signed/unsigned warnings from gcc
15533         4.1.1
15534
15535 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
15536
15537         * culture-info-table.h : oops, forgot to make it nsync with r61548.
15538
15539 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
15540
15541         * icall.c: Another fix for building mono in Visual Studio.
15542
15543 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
15544
15545         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
15546         
15547 2006-06-09  Martin Baulig  <martin@ximian.com>
15548
15549         * debug-mono-symfile.c: Put this back and really fix it this
15550         time. Sorry for all the trouble.
15551
15552 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
15553
15554         * icall.c (mono_class_get_throw): Fix a warning.
15555         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
15556         ReflectionTypeLoadException if needed. Fixes #78606.
15557
15558         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
15559         (mono_class_init): Ditto.
15560
15561         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
15562         ref_only exceptions.
15563         (mono_loader_clear_error): Make this work even if there is no error.
15564
15565 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
15566
15567         * object-internals.h marshal.c marshal.h icall.c: Implement method 
15568         Marshal.GetComSlotForMethodInfo using internal call.
15569
15570 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
15571
15572         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
15573         a function for signalling it.
15574
15575         * class.c (mono_class_from_typeref): Use the new kind of loader error when
15576         a referenced assembly is not found.
15577
15578         * loader.c (mono_loader_error_prepare_exception): Add support for 
15579         LOADER_ERROR_ASSEMBLY. Fix formatting.
15580
15581 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
15582
15583         * domain.c appdomain.c class-internals.h marshal.c: Add support 
15584         for VARIANT marshalling on windows and increment corlib version
15585         since Variant struct was added.
15586
15587 2006-06-03  Miguel de Icaza  <miguel@novell.com>
15588
15589         * debug-mono-symfile.c: Revert Martin's previous patch which broke
15590         stack trace line information:
15591
15592         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
15593         (Martin) when looking up B which is between A and C, return A not C.
15594
15595         Bug is #78573.
15596
15597         Thanks to Alexander Olk for tracking this down.
15598
15599 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
15600
15601         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
15602         
15603         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
15604         avoid clobbering its value.
15605         (mono_string_to_lpstr): Fix a warning on windows.
15606
15607 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
15608
15609         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
15610
15611         * reflection.c loader.c: Removed references to 'dummy' flag.
15612
15613         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
15614
15615         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
15616         it gets GC tracking.
15617
15618         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
15619         GC tracking.
15620         
15621         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
15622
15623         * marshal.c threadpool.c: Update callers of mono_async_result_new.
15624
15625         * appdomain.c: Bump corlib version.
15626
15627 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
15628
15629         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
15630         CEE_STIND_REF when working with object references.
15631
15632 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
15633
15634         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
15635         Fixes #78539.
15636
15637 2006-05-30  Miguel de Icaza  <miguel@novell.com>
15638
15639         * loader.c (method_from_memberref): Fix argument value for
15640         mono_loader_set_error_method_load (I was passing the MonoClass
15641         instead of the class name char *).
15642
15643 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
15644
15645         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
15646         CEE_STIND_REF when working with object references.
15647
15648 2006-05-30  Martin Baulig  <martin@ximian.com>
15649
15650         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
15651         mono_method_full_name() change and replace the ':' with a '.'
15652         here.
15653
15654 2006-05-30  Martin Baulig  <martin@ximian.com>
15655
15656         * debug-mono-symfile.c
15657         (mono_debug_symfile_lookup_location): Fix the algorithm:
15658         when looking up B which is between A and C, return A not C.
15659
15660 2006-05-29  Martin Baulig  <martin@ximian.com>
15661
15662         * mono-debug.h
15663         (MonoDebugMethodInfo): Make the typedef public.
15664         (MonoDebugSourceLocation): New public struct.
15665
15666         * mono-debug.c
15667         (mono_debug_source_location_from_address): Removed.
15668         (mono_debug_source_location_from_il_offset): Removed.
15669         (mono_debug_il_offset_from_address): Removed.
15670         (mono_debug_address_from_il_offset): Removed.
15671         (mono_debug_lookup_method): New public function.
15672         (mono_debug_lookup_source_location): New public function; replaces
15673         the old mono_debug_source_location_from_*() functions; see the
15674         inline documentation.
15675         (mono_debug_free_source_location): New public function.
15676         (mono_debug_print_stack_frame): New public function; see the
15677         inline documentation.
15678
15679         * debug-mono-symfile.c
15680         (mono_debug_find_source_location): Renamed into
15681         mono_debug_symfile_lookup_location(); only take a
15682         `MonoDebugMethodInfo *' and an `offset' argument; added inline
15683         documentation.
15684         (mono_debug_find_method): Renamed into
15685         mono_debug_symfile_lookup_method().
15686
15687 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
15688
15689         * assembly.c (mono_assembly_open_full): Dont overwrite the status
15690         returned by mono_image_open_full ().
15691
15692         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
15693         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
15694         #78517.
15695
15696         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
15697         #78518.
15698
15699 2006-05-27  Miguel de Icaza  <miguel@novell.com>
15700
15701         * class.c (mono_class_from_typeref): handle missing images
15702         earlier, deals with bug #78418.   Refactor code; 
15703
15704         Fix a warning introduced in my previous commit (some stale code
15705         from before I revisited my patch).
15706
15707         * class.c (mono_class_create_from_typedef): On failure, remove the
15708         class from the MonoImage->class_cache as the class is not
15709         initialized;   Fixes the leak pointed out by Paolo.
15710
15711 2006-05-25  Dick Porter  <dick@ximian.com>
15712
15713         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
15714         DeleteCriticalSections until I figure out which one may still be
15715         sometimes locked when mono_thread_cleanup is called.
15716
15717 2006-05-24  Dick Porter  <dick@ximian.com>
15718
15719         * threads.c (mono_thread_cleanup): Move the threading cleanup out
15720         of mono_thread_manage and back into its own function, so it can be
15721         called after the finalizer thread has finished.
15722
15723         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
15724
15725 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
15726
15727         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
15728         Fixes #78495.
15729
15730         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
15731         with non-blittable elements.
15732         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
15733
15734 2006-05-24  Martin Baulig  <martin@ximian.com>
15735
15736         * mono-debug-debugger.h (MonoDebuggerEvent): Added
15737         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
15738
15739         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
15740         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
15741         `mono_debugger_event_handler' to NULL.
15742
15743 2006-05-24  Martin Baulig  <martin@ximian.com>
15744
15745         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
15746
15747 2006-05-24  Martin Baulig  <martin@ximian.com>
15748
15749         * mono-debug-debugger.h
15750         (mono_debugger_create_notification_function): Added
15751         `MonoCodeManager *' argument.
15752
15753 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
15754
15755         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
15756
15757 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
15758
15759         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
15760         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
15761         implementation.
15762
15763 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
15764
15765         * icall.c: precise GC support: objects can't be stored in unmanaged
15766         memory anymore, even if they are kept alive by other references: since
15767         they can move the GC needs to be able to always find them.
15768
15769 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
15770
15771         * object.c: precise GC support for static fields. Support
15772         for moving GCs: write barriers and pinned allocation for interned
15773         strings.
15774
15775 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
15776
15777         * domain.c, domain-internals.h: precise GC support for the MonoDomain
15778         structure.
15779
15780 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
15781
15782         * class.c, gc.c: sgen and precise GC updates.
15783
15784 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
15785
15786         * marshal.h, marshal.c: added write barrier wrapper and precise type
15787         fixes.
15788
15789 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
15790
15791         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
15792         support.
15793
15794 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
15795
15796         * reflection.c: precise and sgen GC updates.
15797
15798 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
15799
15800         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
15801
15802 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
15803
15804         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
15805
15806 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
15807
15808         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
15809         MONO_TYPE_OBJECT. Fixes #78462.
15810
15811 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
15812
15813         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
15814         and blittable types.
15815
15816 2006-05-17  Miguel de Icaza  <miguel@novell.com>
15817
15818         * class.c (mono_class_get_exception_for_failure): Implement parts
15819         of a TODO: if the loader error is set (instead of the class
15820         error), we return a Loader exception that can be properly thrown
15821         elsewhere.
15822
15823         This was exposed by some Winforms 2.0 code that I tried to run
15824         (Atsushi pointed me to it).
15825
15826 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
15827
15828         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
15829         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
15830         
15831         * marshal.c (emit_marshal_vtype): Add limited support for 
15832         UnmanagedType.LPStruct. Fixes #78427.
15833
15834         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
15835         Applied a patch from kangaroo to fix #77523.
15836
15837 2006-05-17  Martin Baulig  <martin@ximian.com>
15838
15839         * threads.c
15840         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
15841         (debugger_thread_created): Removed.
15842         (debugger_thread_exited): Removed.
15843
15844 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
15845
15846         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15847
15848         * object-internals.h (MonoReflectionResource): Sync with managed version.
15849
15850 2006-05-12  Wade Berrier <wberrier@novell.com>
15851
15852         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
15853
15854 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
15855
15856         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
15857         functions try to allocate from the image mempool.
15858
15859 2006-05-12  Dick Porter  <dick@ximian.com>
15860
15861         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
15862
15863 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
15864
15865         * object.c: The FieldGetter and FieldSetter methods require the full
15866         name of the class, not only the name. Fixes bug #78277.
15867
15868 2006-05-11  Miguel de Icaza  <miguel@novell.com>
15869
15870         * loader.c (method_from_memberref): Do not pass the NULL klass to
15871         mono_loader_set_error_() methods.  Pass the non-NULL value
15872         (class). 
15873
15874 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
15875
15876         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
15877         (mono_assembly_close): Null out assembly->image->references after freeing it.
15878
15879         * image.c (mono_image_close): Free image->references.
15880         
15881         * reflection.c (mono_image_basic_init): Fix a small memory leak.
15882
15883 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
15884
15885         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
15886         before checking if it's NULL (g_assert).
15887
15888 2006-05-10  Martin Baulig  <martin@ximian.com>
15889
15890         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
15891         I thought I already killed that two months ago, but now it somehow reappeared.
15892
15893 2006-05-10  Martin Baulig  <martin@ximian.com>
15894
15895         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
15896
15897 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
15898
15899         * reflection.c: Allocate memory for dynamically created methods in the image
15900         mempools.
15901
15902 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
15903
15904         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
15905         don't use the ad pointer before checking if it's NULL (g_assert).
15906
15907 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
15908
15909         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
15910         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
15911
15912         * marshal.c: Allocate all signatures from mempools.
15913
15914         * marshal.c: Allocate some more signatures from mempools.
15915
15916 2006-05-09  Miguel de Icaza  <miguel@novell.com>
15917
15918         * object.c (mono_load_remote_field): The code used to provide a
15919         temporary variable for returning results if the user did not
15920         provide a result pointer.  But our temporary variable was allocted
15921         on the satck.
15922
15923         Fix calling code to always pass a result area.   Coverity ID 103.
15924
15925 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
15926
15927         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
15928         value, not the old. Fixes #78312.
15929         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
15930
15931         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
15932         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
15933         per-image cache.
15934
15935         * assembly.c (mono_assembly_close): Free image->references.
15936
15937         * assembly.c (mono_assembly_names_equal): Fix a warning.
15938         (mono_assemblies_cleanup): Cleanup more global data.
15939
15940         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
15941
15942         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
15943         ptr_cache and image->modules.
15944
15945         * image.c (mono_image_init): Allocate array_cache lazily.
15946         
15947 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15948
15949         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
15950         behavior was changed recently and has bad side effects.
15951
15952 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
15953
15954         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
15955         
15956         * assembly.c (mono_assembly_close): Remove a debug printf.
15957
15958         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
15959
15960         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
15961         to also allow for temporary references between mono_image_open ()/close ().
15962
15963         * domain.c (get_runtimes_from_exe): Add a FIXME.        
15964
15965 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
15966
15967         * marshal.c: Fix support for dynamic methods.
15968
15969         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
15970
15971         * marshal.c (mono_marshal_cleanup): New cleanup function.
15972
15973         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
15974         image mempools.
15975
15976         * class.c (mono_class_init): Fix leaking class->nested_classes.
15977
15978         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
15979
15980         * image.c (mono_image_init): Initialize the new cashes.
15981
15982         * image.c (mono_image_close): Destroy the new cashes.
15983
15984         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
15985
15986         * mempool.c (mono_mempool_strdup): New helper function.
15987
15988         * class-internals.h: Add prototype for mono_loader_unlock ().
15989
15990         * domain.c (mono_jit_info_table_find): Fix a warning.
15991         (mono_debugger_check_runtime_version): Ditto.
15992
15993         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
15994         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
15995         functions to these modules.
15996
15997         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
15998         metadata modules.
15999         
16000         * marshal.c (mono_free_bstr): Fix a warning.
16001
16002         * assembly.c (mono_assembly_open_full): Fix another small leak.
16003
16004         * object.c: Fix some unload leaks in the remoting code.
16005
16006         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
16007         function.
16008
16009         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
16010
16011         * reflection.c: Fix some unload leaks in dynamic assemblies.
16012
16013 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
16014
16015         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
16016         * marshal.h: Add BSTR support on Win32
16017         * icall.c: Add BSTR icalls
16018         * metadata.h: Add BSTR enums
16019
16020 2006-04-28  Miguel de Icaza  <miguel@novell.com>
16021
16022         Work to catch the crash from #76795 and turn it into an
16023         exception.   As I stubbed out pieces of the VisualBasic support,
16024         I found a number of places where the code was failing and I added
16025         checks to those places. 
16026         
16027         * metadata.c (do_mono_metadata_parse_generic_class): Make this
16028         function return a status code.  If we fail to parse the signature
16029         from mono_metadata_parse_generic_inst, return FALSE.
16030
16031         * loader.c (mono_get_method_from_token): If we fail to load the
16032         method (mono_class_get) return NULL.   
16033
16034         * (method_from_memberref): Return NULL if we are unable to parse
16035         the method signature
16036
16037         (mono_loader_error_prepare_exception): Since we now use the
16038         loader_error flag internally to stop processing, and obtaining
16039         exceptions that might be thrown will walk this code path the
16040         proper way of going from a MonoLoaderError into a
16041         MonoException was convoluted.   This new routine encapsulates the
16042         process of turning the error into an exception and *clearing* the
16043         error afterwards.
16044         
16045 2006-04-27  Miguel de Icaza  <miguel@novell.com>
16046
16047         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
16048         with missing assemblies), and to cope with:
16049
16050                 * Missing fieldref from a non-existing assembly.
16051                 * Missing methodref from a non-existing assembly.
16052
16053         The first batch of work to address *some* of the issues from 76661.
16054         
16055         * object.c (mono_class_create_runtime_vtable): If we fail to
16056         initialize the class raise the exception here. 
16057
16058         * metadata.c (mono_class_get_overrides_full): If any methods fail
16059         to load return the failure to the caller.
16060
16061         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
16062         flagging assemblies that failed to load.   
16063
16064         Do not crash if we are unable to load the assembly.
16065
16066         (mono_assembly_close): Do nothing with REFERENCE_MISSING
16067         assemblies. 
16068
16069         * loader.c (mono_loader_set_error_type_load): Change the
16070         convention to always pass unallocated strings, so we make our own
16071         copies (I know our own code had duplicated strings before, but
16072         this keeps the normal conventions).
16073         (method_from_memberref): Call mono_loader_set_error_method_load
16074         for all possible failures of loading the class. 
16075         Remove assert, turn into a loader error.
16076
16077         (mono_loader_error_to_exception): Move this routine from mini
16078         (mini_loader_error_to_exception) there was no need to have that in
16079         mini. 
16080
16081         * class.c (mono_class_from_typeref): If we were not able to load
16082         the assembly with mono_assembly_load_reference, call the
16083         mono_loader_set_error_type_load to register the problem.
16084
16085         (mono_class_setup_fields): If we fail to load the type from
16086         mono_metadata_parse_type_full, call mono_class_set_failure and
16087         break from the loop.
16088
16089         If class->exception_type is set, we do not layout the fields as
16090         that might crash the runtime, and instead return (from breaking
16091         from the previous loop).
16092
16093         (mono_class_setup_vtable): This now returns a boolean indicating
16094         whether the table was properly setup.   The decision is driven by
16095         mono_class_get_overrides_full which might run into non-existing
16096         methods. 
16097         
16098         (mono_class_init): Returns TRUE on success or FALSE if there was a
16099         problem in loading the type (incorrect assemblies, missing
16100         assemblies, methods, etc).
16101
16102         When we call mono_class_setup_fields we also check for a potential
16103         error inside this call (either a class exception or a general
16104         loader exception).
16105
16106         (mono_class_create_from_typedef): If the parent fails to load
16107         (calling mono_class_get_full) return NULL.
16108         
16109         ** Important **
16110
16111         calls to mono_metadata_parse_type_full should be checked
16112         everywhere and set the mono_class_set_failure
16113         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
16114
16115         The current patch checks the places where my manually constructed
16116         tests show the errors are showing up, but we should do it
16117         everywhere. 
16118
16119         ** Important2 **
16120
16121         mono_class_init return values should be tested everywhere, like
16122         the previous case this is something that we should audit
16123         everywhere and not only on the cases exposed by the tests I
16124         created. 
16125
16126 2006-04-26  Miguel de Icaza  <miguel@novell.com>
16127
16128         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
16129         boolean parameter and instead pass the information on `options'
16130         parameter (FileOptions).
16131
16132         * icall.c: Register the new signature for MonoIO.Open.
16133
16134         * debug-helpers.c (dis_one): Trying to understand how coverity
16135         works.  Fix Run 5, item 78.
16136
16137 2006-04-26  Dick Porter  <dick@ximian.com>
16138
16139         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
16140         dereference.
16141
16142 2006-04-25  Martin Baulig  <martin@ximian.com>
16143
16144         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
16145
16146         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
16147         debugger_thread_created().
16148         (debugger_gc_push_all_stacks): Don't handle the main thread in any
16149         special way.
16150         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
16151         (mono_debugger_finalize_threads): New function; undo the effects
16152         of mono_debugger_init_threads().
16153         (mono_debugger_create_all_threads): Removed.
16154
16155 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
16156
16157         * image.c (mono_image_close): Tidy up trace messages.
16158
16159         * assembly.c (mono_assembly_close): Ditto.
16160
16161         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
16162         no longer references an already freed assembly. Fixes #78168.
16163
16164 2006-04-21  Dick Porter  <dick@ximian.com>
16165
16166         * threads.c (mono_thread_detach): Fix reference counting when
16167         detaching threads.
16168
16169 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
16170
16171         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
16172         #78155.
16173
16174 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
16175
16176         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
16177         (mono_type_to_stind): Ditto.
16178
16179         * marshal.c: Use the new helper functions to simplify code.
16180
16181         * image.c (mono_image_close): Add some code for help debug assembly unloading
16182         problems.
16183
16184         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
16185         image mempool.
16186
16187         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
16188         assembly was already loaded in another appdomain. Fixes #78083.
16189
16190 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
16191
16192         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
16193         referenced assemblies.
16194         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
16195
16196         * domain.c (mono_domain_free): Add a trace message.
16197
16198         * appdomain.c (add_assemblies_to_domain): Ditto.        
16199
16200         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
16201         field.  
16202
16203 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
16204
16205         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
16206
16207 2006-04-12  Martin Baulig  <martin@ximian.com>
16208
16209         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
16210         `USE_INCLUDED_LIBGC'.   
16211
16212 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
16213
16214         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
16215         the patch contains ../ and a small directory name later. Hopefully fixes
16216         #78035.
16217
16218 2006-04-10  Martin Baulig  <martin@ximian.com>
16219
16220         Clean up the debugger's thread-handling code.
16221
16222         The debugger's thread-handling code has been moved from
16223         ../mini/debug-debugger.c to threads.c.  We now iterate directly
16224         over the `threads' hash, keep track of exiting threads and also
16225         use proper locking.
16226
16227         We can now debug XSP and XSP based applications with the debugger.
16228
16229         * object-internals.h (MonoThread): Added `gpointer end_stack'.
16230
16231         * threads.h
16232         (MonoThreadCallbacks): Removed; this was only used by the debugger.
16233         (mono_install_thread_callbacks): Likewise.      
16234
16235         * threads.c (mono_thread_callbacks): Removed.
16236         (debugger_thread_created, debugger_thread_exited): New static functions.
16237         (start_wrapper): Call debugger_thread_created().
16238         (thread_cleanup): Call debugger_thread_exited().
16239         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
16240         (mono_debugger_init_threads): New public function.
16241         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
16242         iterate directly over the `threads' hash and also use proper locking.
16243
16244         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
16245
16246         * mono-debug-debugger.h
16247         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
16248
16249 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
16250
16251         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
16252         argument type=array. Fixes #78057.
16253
16254 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
16255
16256         * culture-info-table.h : regenerated. Fixed bug #69652.
16257
16258 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
16259
16260         * loader.c metadata.c: Reapply a variant r59116.
16261         
16262         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
16263
16264         * class.c (mono_class_setup_interface_offsets): New internal function.
16265
16266         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
16267         interfaces too. Fixes #77398.
16268
16269         * reflection.c (encode_cattr_value): Add support for 
16270         parameter type=object, argument type=array.
16271         (load_cattr_value): Ditto. Fixes #77916.
16272
16273         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
16274         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
16275
16276         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
16277         a byval char array and CharSet is Ansi.
16278
16279         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
16280
16281 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
16282
16283         * metadata.c: Add some locking comments.
16284         
16285         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
16286         mempool.
16287         (mono_metadata_free_method_signature): Don't free the signature itself.
16288
16289         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
16290
16291         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
16292         reference the same MonoImage.
16293         (mono_assembly_load_from_full): Add an assert.
16294
16295 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
16296
16297         * image.c (mono_image_close): Don't put the image we are about to free into the
16298         loaded_images_guid_hash.
16299
16300         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
16301         to reduce code duplication.
16302
16303         * marshal.c: Register the native functions called by this module as icalls, to
16304         somewhat centralize the creation of MonoMethodSignature's.
16305
16306         * loader.c (mono_method_signature): Add a cache for method signatures.
16307
16308         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
16309         the parameter attributes of a method.
16310         (mono_metadata_parse_method_signature_full): Refactored the computation of
16311         parameter attributes into a separate function. Also avoid one allocation in
16312         most cases.
16313
16314         * assembly.c (mono_assembly_close): Ditto.
16315
16316         * image.c (mono_image_close): Log trace messages with INFO level.
16317
16318         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
16319
16320         * image.c reflection.c: Correct reference counting of image modules.
16321         
16322         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
16323         of this function from the image mempool.
16324         
16325         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
16326         to allow more cached types to be used.
16327
16328         * mono-debug.c (mono_debug_add_method): Appled patch from
16329         David S. Miller  <davem@sunset.davemloft.net>: Access 
16330         minfo->lexical_blocks[] entry elements using read32().
16331
16332 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
16333
16334         * loader.c (mono_free_method): No longer free the method header for non-dynamic
16335         methods as it is allocated from the mempool.
16336
16337         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
16338         image mempool.
16339
16340         * metadata-internals.h: Add comments describing the reference counting scheme
16341         used for MonoImage and MonoAssembly.
16342
16343         * image.c assembly.c reflection.c: Rework reference counting of images and 
16344         assemblies so they are freed when the runtime is shut down. Free some 
16345         additional memory structures when an image is unloaded.
16346         
16347 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
16348
16349         * class.c loader.c reflection.c: Allocate more data structures in
16350         the image mempool.
16351
16352 2006-03-31  Miguel de Icaza  <miguel@novell.com>
16353
16354         * icall.c
16355         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
16356         build on pre glib 2.4 systems.
16357
16358 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
16359
16360         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
16361
16362         * icall.c: Fix some warnings.
16363
16364 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
16365
16366         * culture-info-table.h : regenerated.
16367
16368 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
16369
16370         * threads.c, object-internals.h, verify.c: changed the culture caching
16371         code to use a normal MonoArray for storage so the GC can keep track of
16372         them easily. Fixed bits of the cache logic, too and simplified the
16373         code.
16374
16375 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
16376
16377         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
16378         thread for non-Boehm GCs.
16379
16380 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
16381
16382         * domain.c, object.c, domain-internals.h: reduce the amount of memory
16383         needed to keep track of the data for static fields.
16384
16385 2006-03-29  Raja R Harinath  <rharinath@novell.com>
16386
16387         Fix #75172
16388         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
16389         for interface classes.  Use 'num_methods' instead.
16390         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
16391         before using '->vtable_size' field.
16392
16393 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
16394
16395         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
16396         doesn't contain managed pointers, so use a normal hashtable.
16397
16398 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
16399
16400         * reflection.c, class-internals.h, domain.c: fixed handling of types
16401         used as values for objects in custom attributes (bug #77915):
16402
16403 2006-03-24  Martin Baulig  <martin@ximian.com>
16404
16405         * class.c (mono_class_setup_fields): Added support for generic
16406         instances; fixes #77580.
16407
16408 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16409
16410         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
16411
16412 2006-03-24  Dick Porter  <dick@ximian.com>
16413
16414         * file-io.c (get_file_attributes): More stat macro breakage.
16415         Fixes bug 77759.
16416
16417 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
16418
16419         * profiler.c: added the file=filename option in the default profiler
16420         to output the profile data to filename.
16421
16422 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16423
16424         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
16425         bug #77877.
16426
16427 2006-03-22  Martin Baulig  <martin@ximian.com>
16428
16429         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
16430         allocated `MonoClassField *' in `fb->handle'.
16431
16432 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16433
16434         * class.c, image.c, metadata-internals.h: implemented new mechanism to
16435         allocate interface ID to save memory and allow better ID reuse on
16436         appdomain unload. setup_generic_vtable () removal from Martin.
16437
16438 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
16439
16440         * object.h, appdomain.c, domain.c, exception.c, icall.c,
16441         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
16442         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
16443         write barriers for reference stores with managed objects accessed with
16444         C structures in the runtime and in embedding programs.
16445
16446 2006-03-20  Raja R Harinath  <rharinath@novell.com>
16447
16448         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
16449         'interface_id' and 'max_interface_id' fields of MonoClasses
16450         representing open generic types.
16451
16452 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
16453
16454         * object.h, object.c, icall.c: added functions to deal with
16455         storing valuetypes that contain references in managed objects.
16456         * reflection.c, string-icalls.c, threads.c, marshal.c: small
16457         fixes and comments around uses of mono_array_addr ().
16458
16459 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
16460
16461         * object.h, icall.c, monitor.c: object.GetHashCode ()
16462         implementation that supports the moving garbage collector.
16463
16464 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
16465
16466         * icall.c, threads-types.h, threads.c: implemented finalizer for
16467         LocalDataStoreSlot.
16468
16469 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
16470
16471         * metadata.c (mono_type_size): Add a fixme.
16472         (mono_type_stack_size): Ditto.
16473
16474         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
16475         'type_forwarders' field.
16476
16477         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
16478         attribute from net 2.0.
16479
16480         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
16481         from class.c.
16482
16483         * class.c (mono_class_setup_fields): Fix a warning.
16484         
16485         * class.c (mono_class_from_name): Add support for assemblyref entries
16486         in the EXPORTEDTYPE table.
16487
16488         * reflection.c: Add support for handling type forwarders under net 2.0.
16489
16490         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
16491         
16492 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
16493
16494         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
16495         overwriting entries in ModuleBuild->types, also clean up the code
16496         a little. Fixes #77774.
16497
16498 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
16499
16500         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
16501         load friend assembly info when present.
16502
16503 2006-03-14  Raja R Harinath  <rharinath@novell.com>
16504
16505         Fix crasher on gtest-158.cs.
16506         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
16507         the return value if the MonoClass we want is yet in an
16508         inconsistent state.
16509         * class.c (mono_class_create_from_typedef): Add an comment
16510         explaining an order dependency between mono_class_setup_parent and
16511         mono_class_setup_mono_type.
16512
16513 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
16514
16515         * class.c: documentation updates and events bug fix.
16516
16517 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
16518
16519         * class.c: some cleanup, locking fixes.
16520
16521 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
16522
16523         * class.c: fix the generics code to setup nested
16524         type info to the instantiated type (bug #77770).
16525
16526 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
16527
16528         * marshal.c: fixed a few type correctness issues.
16529
16530 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16531
16532         * loader.c: the Set/Get/Addrtess array methods should be public.
16533
16534 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
16535
16536         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
16537         
16538         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
16539         info->wrapper.
16540
16541 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
16542
16543         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
16544
16545         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
16546
16547         * mempool.c (mono_mempool_alloc): Speed this up a bit.
16548         (mono_mempool_alloc0): Ditto.
16549
16550 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16551
16552         * socket-io.c:
16553         (create_object_from_sockaddr): it was allocating 4 extra bytes
16554         for the AF_UNIX data. Fixes bug #77747.
16555
16556 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
16557
16558         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
16559
16560 2006-03-09  Dick Porter  <dick@ximian.com>
16561
16562         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
16563         Fixes bug 76966 again.
16564
16565 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
16566
16567         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
16568         names from r57532
16569         * appdomain.c: Bumped corlib version to 48 (due to r57532)
16570
16571 2006-03-07  Martin Baulig  <martin@ximian.com>
16572
16573         * object.c
16574         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
16575
16576 2006-03-07  Martin Baulig  <martin@ximian.com>
16577
16578         * class.c
16579         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
16580         regression introduced in r56970; see gtest-252.cs.
16581
16582         * loader.c (mono_get_method_constrained): Correctly handle generic
16583         methods; see gtest-253.cs.
16584
16585 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
16586
16587         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
16588
16589 2006-03-04  Martin Baulig  <martin@ximian.com>
16590
16591         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
16592         compute the parent type at runtime, just like we're already doing
16593         it for interfaces.
16594
16595         * reflection.c
16596         (mono_reflection_bind_generic_parameters): Don't compute the
16597         parent type anymore.
16598
16599         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
16600
16601 2006-03-04  Martin Baulig  <martin@ximian.com>
16602
16603         * mono-debug-debugger.h
16604         (mono_debugger_create_notification_function): Allocate memory at
16605         runtime and return a pointer to it.
16606
16607 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
16608
16609         * assembly.c: Fix windows build.
16610         
16611         * assembly.c: Fix build.
16612
16613         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
16614
16615         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
16616         
16617 2006-03-03  Dick Porter  <dick@ximian.com>
16618
16619         * process.c
16620         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
16621         Check parameters before dereferencing them.  Fixes Aaron's part of
16622         bug 77393.
16623
16624 2006-03-03  Raja R Harinath  <rharinath@novell.com>
16625
16626         Fix performance regression.
16627         * loader.c (find_method_in_class): Add 'from_class' argument.
16628         Rename 'klass' argument to 'in_class'.  The signature is compared
16629         against the method in 'in_class', and the corresponding method is
16630         returned from 'from_class'.
16631         (find_method): Walk both 'in_class' and 'from_class' in parallel.
16632         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
16633         type definition and generic instantiation in parallel.
16634         (mono_get_method_constrained): Update to changes.
16635
16636 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
16637
16638         * threads.c: make sure the domain is correct, too when doing
16639         mono_thread_attach ().
16640
16641 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
16642
16643         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
16644         windows. Fixes #77683.
16645
16646 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
16647
16648         * object.h, *: introduced specific way to set elements of an array
16649         of references to be used as write barrier. Still need to audit the
16650         uses of mono_array_addr.
16651
16652 2006-03-01  Miguel de Icaza  <miguel@novell.com>
16653
16654         * object-internals.h: New field to cache the assmebly name, patch
16655         from Tambet Ingo (tambet@ximian.com)
16656
16657 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
16658
16659         * decimal.h, class-internals.h, metadata-internals.h,
16660         file-io.h: mark a few function declarations as internal, to
16661         reduce the number of PLT entries.
16662
16663 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16664
16665         * file-io.c: fix typo in warning message.
16666
16667 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
16668
16669         * loader.c: on unix, lookup the "*A" version of a function
16670         if charset is auto as a second option before failing.
16671
16672 2006-02-28  Raja R Harinath  <rharinath@novell.com>
16673
16674         * class.h (mono_class_inflate_generic_method): Revert to two
16675         argument version.
16676         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
16677         (mono_class_inflate_generic_method_full): Add.
16678         * class.c (mono_class_inflate_generic_method_full): Rename from
16679         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
16680         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
16681         * loader.c, reflection.c: Update to changes.
16682
16683 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
16684
16685         * icall.c: const fixes and small improvements.
16686
16687 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16688
16689         * threadpool.c: for asynchronous connect(), enable the same workaround
16690         for BSD 6 as for the Mac. Fixes bug #77637.
16691
16692 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
16693
16694         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
16695         formatted classes. Fixes #77524.
16696
16697 2006-02-24  Raja R Harinath  <rharinath@novell.com>
16698
16699         * class.c (inflate_generic_type): Add a couple more
16700         micro-optimizations.
16701         (inflate_generic_context): Don't use the 'gmethod' from
16702         'inflate_with'.
16703         (mono_class_inflate_generic_method): If the method has generic
16704         parameters, but the passed-in context doesn't have a 'gmethod',
16705         create one.  Use the possibly simplified generic instantiation
16706         from the declaring class instead of the one passed in.
16707
16708 2006-02-24  Raja R Harinath  <harinath@gmail.com>
16709
16710         Make generic method signature and method header handling lazy.
16711         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
16712         (inflate_generic_header): Likewise.
16713         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
16714         parameter to avoid inflating types.
16715         (mono_get_inflated_method): Empty out.
16716         * class.h (mono_class_inflate_generic_method): Update to changes.
16717         * loader.c (mono_get_method_from_token): Don't parse signature for
16718         generic methods, nor methods of generic classes.
16719         (mono_method_signature): Rename from 'mono_method_signature'.
16720         Inflate signature on demand.
16721         (mono_method_get_header): Inflate method header on demand.
16722         * reflection.c: Update to changes.
16723
16724 2006-02-23  Raja R Harinath  <rharinath@novell.com>
16725
16726         * metadata.c (mono_metadata_inflate_generic_inst): If the
16727         instantiation is closed, don't bother expanding it in the new
16728         context.
16729         * class.c (inflate_generic_class): If the generic instantiation
16730         doesn't change after inflation, return the argument itself.
16731         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
16732         Add bounds checks.
16733         (inflate_generic_context): If neither the generic class nor the
16734         generic method instantiations change, return the original context.
16735         * reflection.c (mono_method_get_object): Do
16736         'mono_get_inflated_method' before accessing the ->klass field.
16737         (inflate_mono_method): Don't create a MonoGenericMethod unless
16738         necessary.
16739         (inflate_method): Don't pass a constructed type as the declaring
16740         type of a methodbuilder.
16741
16742 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
16743
16744         * object.c: fix memory overwrite.
16745
16746 2006-02-22  Dick Porter  <dick@ximian.com>
16747
16748         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
16749         it doesn't work any more.
16750         (mono_threads_request_thread_dump): Fix unused variable warnings.
16751
16752 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16753
16754         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
16755         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
16756         the public header file.
16757
16758 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
16759
16760         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
16761
16762 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
16763
16764         * class-internals.h, object.c: reduce the size of MonoVTable
16765         and store the interface_offsets array at negative offsets.
16766
16767 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
16768
16769         * metadata.c: tweak table descriptors data structures to reduce
16770         size and runtime relocations.
16771
16772 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16773
16774         * marshal.c: fix some types and opcodes to be type-safe
16775         in marshaling wrappers.
16776
16777 2006-02-21  Ankit Jain  <jankit@novell.com>
16778
16779         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
16780
16781 2006-02-21  Raja R Harinath  <rharinath@novell.com>
16782
16783         * metadata.c (get_constraints): Relax debugging checks for monodis.
16784
16785 2006-02-21  Ankit Jain  <jankit@novell.com>
16786
16787         * metadata.c (mono_metadata_load_generic_params): Move the code
16788         checking for ambiguous generic params from here to mono/dis/get.c
16789         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
16790
16791 2006-02-21  Raja R Harinath  <harinath@gmail.com>
16792
16793         Fix assertion triggered when compiling nemerle.
16794         * class.c (mono_get_shared_generic_inst): Rename from
16795         get_shared_inst and make non-static.
16796         * loader.c (mono_get_shared_generic_method): New.  Used to create
16797         the MonoGenericContext-equivalent of a MonoGenericContainer.
16798         (mono_get_method_from_token): Initialize the 'context' field of
16799         the created MonoGenericContainer.
16800         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
16801         * metadata.c (get_constraints): Add sanity check.
16802         * class-internals.h: Add new internal methods.
16803
16804         * reflection.c (verify_safe_for_managed_space): New sanity check.
16805         Currently checks that owner-less generic parameters aren't allowed
16806         in managed space.
16807         (mono_type_get_object): Use it.
16808         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
16809         that are now in mono_type_get_object.
16810         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
16811
16812 2006-02-19  Raja R Harinath  <harinath@gmail.com>
16813
16814         * metadata.c (mono_type_create_from_typespec): Rename from
16815         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
16816         argument and caching of types in the generic container.
16817         (unwrap_arrays, find_generic_param): Remove.
16818         * metadata-internals.h: Update.
16819         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
16820
16821 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
16822
16823         * class.c (mono_class_get_exception_for_failure): Fix a warning.
16824
16825         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
16826         return values. Fixes #77581.
16827
16828         * class.c (mono_fnptr_class_get): Switch name and name_space.
16829
16830         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
16831         classes and add support for [In, Out] attributes.
16832         (mono_marshal_free_asany): Ditto. Fixes #77524.
16833
16834 2006-02-18  Raja R Harinath  <harinath@gmail.com>
16835
16836         * class.c (mono_class_from_generic_parameter): Make more robust to
16837         incomplete MonoGenericContainers from monodis.
16838
16839 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16840
16841         * class-internals.h: added some more exception types.
16842         * class.c, metadata.c: added a few checks to handle missing
16843         types.
16844
16845 2006-02-17  Raja R Harinath  <rharinath@novell.com>
16846
16847         Use owner-less generic-params some more.
16848         * class.c (my_mono_class_from_generic_parameter): Remove.
16849         (mono_class_from_generic_parameter): Handle null image,
16850         param->name and param->owner.
16851         (mono_class_from_mono_type): Update.
16852         (mono_class_create_from_typespec): Remove 'container' parameter.
16853         If that parameter is non-null, the result is always inflated by
16854         'mono_class_get_full' anyway.
16855         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
16856         parameter.
16857         (mono_class_get_full): Update.
16858
16859         * class.c (inflate_generic_type) [GENERICINST]: If the generic
16860         instance is not open, don't bother inflating.
16861         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
16862         parse metadata for inflated classes.
16863         (_mono_class_get): Change GenericContext* parameter to
16864         GenericContainer*.
16865         (mono_class_create_from_typespec): Likewise.  Simplify, and
16866         implement trivially.  All the cases are handled in
16867         mono_class_from_mono_type.  Don't inflate returned class.
16868         (mono_class_get_full): Delegate GENERICINST optimization to
16869         inflate_generic_type.
16870         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
16871
16872 2006-02-16  Dick Porter  <dick@ximian.com>
16873
16874         * socket-io.c (create_object_from_sockaddr): Fix typo.
16875         (create_sockaddr_from_object): Check array lengths before
16876         potentially accessing items off the end.
16877         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
16878         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
16879         (ves_icall_System_Net_Sockets_Socket_Send_internal)
16880         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
16881         length checks to avoid wraparound overflows.
16882         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
16883         contents of the array of sockets
16884         (hostent_to_IPHostEntry2)
16885         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
16886         Check return value of inet_ntop ().
16887         (addrinfo_to_IPHostEntry): Fix typo
16888
16889 2006-02-16  Raja R Harinath  <rharinath@novell.com>
16890
16891         Type metadata parsing doesn't use generic-instantiation information.
16892         * metadata.c (mono_metadata_parse_array_full): Change
16893         MonoGenericContext* parameter to MonoGenericContainer*.
16894         (mono_metadata_parse_type_full): Likewise.
16895         (mono_type_create_from_typespec_full): Likewise.
16896         (mono_metadata_parse_mh_full): Likewise.
16897         (mono_metadata_parse_generic_inst): Likewise.
16898         (do_mono_metadata_parse_generic_class): Likewise.
16899         (do_mono_metadata_parse_type): Likewise.
16900         * metadata-internals.h: Update to changes.
16901         * class.c (mono_class_find_enum_basetype): Likewise.
16902         (mono_class_setup_fields): Likewise.
16903         (mono_class_create_from_typespec): Likewise.
16904         * loader.c (method_from_methodspec): Likewise.
16905         (mono_get_method_from_token): Likewise.
16906         (mono_method_get_header): Likewise.
16907
16908 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16909
16910         * marshal.c: handle additional GENERICINST case (patch from
16911         Thong Nguyen <tum@veridicus.com>).
16912         Fix a few cases where LDIND_I/STIND_I was used for references.
16913
16914 2006-02-16  Raja R Harinath  <rharinath@novell.com>
16915
16916         * reflection.c (mono_reflection_get_token): Remove unused variable.
16917
16918 2006-02-16  Martin Baulig  <martin@ximian.com>
16919
16920         * reflection.c (mono_reflection_get_token): Add support for fields
16921         in instantiated generic types.
16922
16923         * icall.c
16924         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
16925
16926 2006-02-15  Martin Baulig  <martin@ximian.com>
16927
16928         * icall.c
16929         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
16930         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
16931         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
16932         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
16933
16934 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
16935
16936         * class.c, metadata.c, metadata.h, object.c, icall.c,
16937         marshal.c: changed mono_type_get_underlying_type () to do
16938         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
16939         Fixed handling of instantiated generic valuetypes (bug #75479).
16940
16941 2006-02-15  Raja R Harinath  <rharinath@novell.com>
16942
16943         * metadata.c (mono_metadata_decode_signed_value): Simplify.
16944         Delegate to mono_metadata_decode_value, and work on the returned value.
16945
16946         * icall.c (ves_icall_MonoType_GetGenericArguments):
16947         Add consistency check here too.
16948         
16949 2006-02-15  Ankit Jain  <jankit@novell.com>
16950
16951         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
16952         char/short etc.
16953
16954 2006-02-15  Ankit Jain  <jankit@novell.com>
16955
16956         * metadata.c (mono_metadata_decode_signed_value): New function to decode
16957         signed values, used only for representing lower bounds of arrays.
16958         (mono_metadata_parse_array_full): Use new
16959         mono_metadata_decode_signed_value to decode lower bounds.
16960
16961 2006-02-14  Martin Baulig  <martin@ximian.com>
16962
16963         * reflection.c
16964         (mono_reflection_get_token): Support "MonoGenericMethod" and
16965         "MonoGenericCMethod" and allow generic instances / methods.
16966
16967 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
16968
16969         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
16970         to obtain the terminal size using an ioctl.
16971
16972         * object.c (mono_nullable_init): Revert this as nullable reference
16973         types are not valid.
16974         (mono_nullable_box): Ditto.
16975
16976 2006-02-09  Dick Porter  <dick@ximian.com>
16977
16978         * threads.c (mono_thread_detach): Drop a reference to the thread
16979         we're detaching.
16980
16981 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
16982
16983         * object.c (mono_nullable_init): Handle nullable reference types.
16984         (mono_nullable_box): Ditto. Fixes #77446.
16985
16986 2006-02-07  Martin Baulig  <martin@ximian.com>
16987
16988         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
16989
16990 2006-02-07  Ankit Jain  <jankit@novell.com>
16991
16992         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
16993         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
16994         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
16995         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
16996         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
16997         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
16998
16999 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
17000
17001         * class.c (mono_class_create_generic): Set type_token as well.
17002
17003         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
17004         compatible with MS.
17005
17006 2006-02-02  Martin Baulig  <martin@ximian.com>
17007
17008         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
17009         has never been used so far.
17010
17011 2006-02-02  Martin Baulig  <martin@ximian.com>
17012
17013         * mono-debug-debugger.h: Changed comment at the top of this file;
17014         the header is not installed, but it's safe to #include it from
17015         within the JIT.
17016
17017         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
17018         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
17019
17020 2006-02-02  Martin Baulig  <martin@ximian.com>
17021
17022         * mono-debug.h
17023         (MonoSymbolTable): Removed the `metadata_info' field.
17024
17025         * mono-debug.c
17026         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
17027
17028         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
17029         (mono_debugger_add_builtin_types): Removed.
17030         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
17031         (mono_debugger_create_notification_function): We now operate on a
17032         pre-allocated area; take a `gpointer' and return `void'.
17033
17034         * mono-debug-debugger.c
17035         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
17036         (mono_debugger_add_builtin_types): Removed.
17037
17038 2006-02-02  Martin Baulig  <martin@ximian.com>
17039
17040         * threads.c (mono_debugger_create_all_threads): New public method.
17041
17042 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
17043
17044         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
17045         breaks on several platforms.
17046
17047 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
17048
17049         * assembly.c: the VS.NET build doesn't supply default values for
17050         MONO_ASSEMBLIES and MONO_CFG_DIR.
17051
17052 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
17053
17054         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
17055         helper function.
17056
17057         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
17058
17059         * loader.c (method_from_memberref): Fix a warning.
17060
17061         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
17062
17063         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
17064         with explicit layout. Fixes #77433.
17065
17066 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
17067
17068         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
17069         max_interface_id is initialized before using it. Fixes #77398.
17070         (ves_icall_Type_GetInterfaces): Ditto.
17071
17072 2006-01-30  Raja R Harinath  <rharinath@novell.com>
17073
17074         * metadata.c (mono_metadata_parse_method_signature_full): Don't
17075         allocate memory for parameter attributes when parsing memberref
17076         signatures.
17077         * loader.c (mono_loader_set_error_method_load): Don't warn.
17078         (method_from_memberref): Ensure MissingMethodException gets thrown
17079         if method is not found.  Make warning more informative.
17080
17081 2006-01-29  Raja R Harinath  <harinath@gmail.com>
17082
17083         Fix #77397
17084         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
17085         return true if is byref.
17086         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17087         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
17088         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
17089
17090 2006-01-27  Raja R Harinath  <rharinath@novell.com>
17091
17092         Fix tests/find-method.2.il
17093         * loader.c (find_method, find_method_in_class): Remove is_inflated
17094         argument.  Revert 2006-01-18 change.
17095         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
17096         is generic, search for method in its generic definition.
17097         * class.c (mono_class_setup_vtable_general): Print generic
17098         arguments of generic types in debugging printf.
17099
17100 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
17101
17102         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
17103
17104         * threads.c (mono_threads_request_thread_dump): New helper function.
17105
17106 2006-01-25  Raja R Harinath  <rharinath@novell.com>
17107
17108         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
17109
17110 2006-01-25  Ankit Jain  <jankit@novell.com>
17111
17112         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
17113         move definition to ..
17114         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
17115         
17116 2006-01-25  Ankit Jain  <jankit@novell.com>
17117             Raja R Harinath  <rharinath@novell.com>
17118
17119         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
17120         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
17121         as necessary.
17122
17123 2006-01-25  Martin Baulig  <martin@ximian.com>
17124
17125         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
17126         `MonoDebuggerThread' into debug-debugger.c.
17127
17128 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
17129
17130         * profiler.c: fix printing of data.
17131
17132 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
17133
17134         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
17135           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
17136
17137 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
17138
17139         * object.c: fix deadlock related to string interning.
17140
17141 2006-01-23  Martin Baulig  <martin@ximian.com>
17142
17143         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
17144
17145         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
17146
17147 2006-01-23  Martin Baulig  <martin@ximian.com>
17148
17149         * mono-debug.h: Moved the prototypes of some functions which are
17150         used by the JIT here from mono-debug-debugger.h.
17151
17152 2006-01-21  Martin Baulig  <martin@ximian.com>
17153
17154         * Makefile.am: Don't install mono-debug-debugger.h.
17155
17156 2006-01-21  Martin Baulig  <martin@ximian.com>
17157
17158         * mono-debug-debugger.h: Enforce the private status of this header
17159         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
17160         Moved some stuff from mono-debugger-jit-wrapper.h here.
17161
17162 2006-01-20  Raja R Harinath  <rharinath@novell.com>
17163
17164         * class.c (mono_class_from_typeref): Add a sanity test to help
17165         catch lack of assembly load/search hooks.
17166
17167 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
17168
17169         * marshal.c (emit_struct_conv): Relax the fields with same offset
17170         check even more. Fixes #77230.
17171
17172 2006-01-18  Martin Baulig  <martin@ximian.com>
17173
17174         * loader.c (find_method_in_class): Added `gboolean is_inflated'
17175         argument; if false, we compare the uninstantiated signatures.
17176         (method_from_memberref): Compare the uninstantiated signatures;
17177         fixes #76417.
17178
17179 2006-01-18  Robert Jordan  <robertj@gmx.net>
17180
17181         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
17182         Clear the weak link. Fixes bug #77170.
17183
17184         * gc.c (mono_gchandle_free):
17185         Reflect *-gc.c changes (tiny optimization).
17186
17187 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
17188
17189         * metadata.c (mono_metadata_signature_dup): Applied patch from
17190         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
17191         Fixes #77288.
17192
17193 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
17194
17195         * marshal.c (emit_struct_conv): Allow fields with the same offset when
17196         marshalling from native to managed code. Fixes #77230.
17197
17198 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17199
17200         * threadpool.c: fix problem (Mac only) when more than one asynchronous
17201         connect. Fixes bug #77020.
17202
17203 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
17204
17205         * class.c: fixed id assignement for nested interfaces (bug #77275).
17206         Added also better info for --print-vtable debugging.
17207
17208 2006-01-12  Martin Baulig  <martin@ximian.com>
17209
17210         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
17211         interfaces on-the-fly; fixes #76625.
17212
17213         * class-internals.h
17214         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
17215         don't need that anymore.
17216
17217 2006-01-12  Miguel de Icaza  <miguel@novell.com>
17218
17219         * socket-io.c
17220         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
17221         To avoid initing the nested_classes when not needed I turned the
17222         PeerCredData as a toplevel internal class, as it has to be shared
17223         anyways. 
17224
17225         Fixes the CASA issue.
17226
17227 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
17228
17229         * domain.c: Accessors for MonoJitInfo
17230
17231         * profiler-private.h: Add jitinfo to the end jit hook
17232
17233         * profiler.[ch]: Define new hooks, called after jitting which give
17234         the MonoJitInfo that was compiled
17235
17236 2006-01-10  Martin Baulig  <martin@ximian.com>
17237
17238         * class.c (mono_class_setup_events): Add support for generic
17239         classes; fixes #76440.
17240
17241 2006-01-06  Raja R Harinath  <rharinath@novell.com>
17242
17243         Fix #77160.
17244         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
17245         on passed-in method.
17246
17247 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
17248
17249         * object.c (mono_runtime_invoke_array): Add Nullable support.
17250
17251         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
17252
17253 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
17254
17255         * file-io.c: Don't consider sockets as directory and avoid an endless
17256         loop. Fix bug #76966.
17257
17258 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
17259
17260         * object.c (mono_nullable_init): New helper function.
17261         (mono_nullable_box): Ditto.
17262
17263         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
17264
17265         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
17266
17267         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
17268         
17269 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
17270
17271         * class.c (mono_class_is_assignable_from): Make T assignable to 
17272         Nullable<T>.
17273
17274 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
17275
17276         * appdomain.c: Bump corlib version to 46.
17277         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
17278         serialization purpose) and changed ves_icall_System_Reflection_
17279         Assembly_get_code_base signature to accept a boolean (to escape, or 
17280         not, the assembly code base).
17281
17282 2005-12-23  Dick Porter  <dick@ximian.com>
17283
17284         * icall.c: 
17285         * threads-types.h: 
17286         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
17287         CreateEvent icall now returns "created" boolean parameter.
17288
17289 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
17290
17291         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
17292         #76967.
17293
17294         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
17295         when attr_klass is an interface. Fixes #77045.
17296
17297 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
17298
17299         * marshal.c (emit_struct_conv): Fix previous patch.
17300         
17301         * marshal.c (emit_struct_conv): Add a check for fields with the same
17302         offset.
17303
17304 2005-12-20  Raja R Harinath  <rharinath@novell.com>
17305
17306         Fix regression in Mono.C5.
17307         * class.c (mono_class_create_generic): If 'klass' is an interface
17308         set up the interface offsets.
17309         (mono_class_is_assignable_from): Don't throw away generic arguments.
17310
17311 2005-12-19  Raja R Harinath  <rharinath@novell.com>
17312
17313         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
17314         type parameters.
17315
17316 2005-12-15  Raja R Harinath  <rharinath@novell.com>
17317
17318         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
17319         dead store.
17320         (do_mono_metadata_parse_generic_class): Don't pass the current
17321         generic context when parsing the type being instantiated: it
17322         cannot use it, anyway.
17323
17324         * loader.c (method_from_memberref): Don't inflate a signature if
17325         it doesn't contain any type parameters.
17326
17327 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
17328
17329         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
17330
17331 2005-12-14  Martin Baulig  <martin@ximian.com>
17332
17333         * class.c
17334         (mono_type_get_name_recurse): Don't return null for type
17335         parameters and open generic classes.
17336         (mono_class_setup_methods): Don't exclude generic instances.
17337         (mono_get_unique_iid): Use different IDs for different
17338         instantiations of the same generic type.
17339         (mono_class_setup_vtable): Only use setup_generic_vtable() for
17340         open generic instances; create a normal vtable for closed generic
17341         instances.
17342         (mono_class_setup_vtable_general): We're now also called for
17343         closed generic instances.
17344
17345         * reflection.c
17346         (mono_reflection_bind_generic_parameters): Correctly use
17347         mono_metadata_lookup_generic_inst() everywhere.
17348
17349 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
17350
17351         * object.c (mono_class_create_runtime_vtable): Call 
17352         mono_class_setup_vtable ().
17353
17354         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
17355         function.
17356         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
17357         #76959.
17358
17359         * loader.c (mono_loader_set_error_type_load): Print the type load
17360         warnings to the console so they are more visible to the user.
17361         (mono_loader_set_error_method_load): Ditto.
17362
17363         * reflection.c (ensure_runtime_vtable): Revert the last change as it
17364         is still broken.
17365         
17366         * reflection.c (ensure_runtime_vtable): Fix build.
17367
17368         * reflection.c (ensure_runtime_vtable): Disable an optimization which
17369         doesn't work in all cases.
17370
17371 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
17372
17373         * object.c (mono_array_new_full): Treat a single dimensional array
17374         with 0 lower bounds as an szarray. Fixes #76973.
17375
17376         * reflection.c (custom_attr_visible): Really fix this.
17377
17378 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
17379
17380         * reflection.c (custom_attr_visible): Allow nested public attributes
17381         as well.
17382
17383         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
17384         interface check.
17385
17386 2005-12-12  Raja R Harinath  <harinath@gmail.com>
17387
17388         * class.c (set_generic_param_owner): Delete.
17389         (mono_class_create_from_typedef): Don't set ->owner field of
17390         generic parameters to "param containers" of enclosing classes.
17391         * reflection.c (mono_reflection_initialize_generic_parameter):
17392         Likewise.
17393
17394 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
17395
17396         * reflection.c (custom_attr_visible): Fix build.
17397
17398 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
17399
17400         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
17401         private attributes.
17402         
17403         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
17404         handling of null parameter defaults.
17405
17406 2005-12-09  Raja R Harinath  <rharinath@novell.com>
17407
17408         * class.c (mono_class_from_generic_parameter): Don't set
17409         klass->generic_container.
17410         (my_mono_class_from_generic_parameter): Likewise.
17411
17412 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
17413
17414         * reflection.c (load_public_key): Fix a warning.
17415         (method_encode_code): Fix unaligned accesses.
17416
17417 2005-12-07  Martin Baulig  <martin@ximian.com>
17418
17419         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
17420
17421         * reflection.c
17422         (write_generic_param_entry): Encode our custom attrs.
17423
17424         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
17425
17426 2005-12-07  Martin Baulig  <martin@ximian.com>
17427
17428         * reflection.c (encode_new_constraint): Removed; we don't use the
17429         `NewConstraintAttribute' anymore.
17430
17431 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
17432
17433         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
17434         not fire a TypeResolve event when Assembly.GetType () is called.
17435
17436 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
17437
17438         Beginning of support for nullable types in the runtime. Parts of
17439         this patch are from Martin.
17440
17441         * appdomain.c (MONO_CORLIB_VERSION): Bump
17442
17443         * domain.c (mono_init_internal): get the nullable type
17444
17445         * class.c (mono_class_is_nullable): New method
17446         (mono_class_get_nullable_param): New mehod
17447         (mono_class_create_generic): In types T? set cast_class to T
17448
17449         * class-internals.h (MonoDefaults): new nullable default class
17450         (mono_class_get_nullable_param, mono_class_get_nullable_param):
17451         new methods.
17452
17453 2005-12-05  Raja R Harinath  <rharinath@novell.com>
17454
17455         * metadata.c (select_container): New.  Refactor code to select the
17456         appropriate GenericContainer given the type of generic parameter
17457         we are looking for.
17458         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
17459         not a MonoGenericContext.  Use select_container.  Update parameters.
17460         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
17461         and MONO_TYPE_MVAR.
17462         (unwrap_arrays): Remove duplicate tests.
17463         (find_generic_param): Rename from 'has_same_context'.  Now walks a
17464         generic instantiated class to find any arguments that are generic
17465         parameters.
17466         (mono_type_create_from_typespec_full): Use find_generic_param to
17467         avoid evicting some generic instantiations from the typespec
17468         cache.
17469
17470 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
17471
17472         * reflection.c: fixed writing of doubles on ARM FPA.
17473
17474 2005-12-02  Robert Jordan  <robertj@gmx.net>
17475
17476         * icall.c: Fixed EventInfo.ReflectedType (#76829).
17477
17478 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17479
17480         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
17481         least on SUSE 10 they are not the same (on debian, they are just the
17482         same thing).
17483
17484 2005-12-01  Raja R Harinath  <rharinath@novell.com>
17485
17486         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
17487         DeclaringType for VARs and MVARs.
17488         * class.c (set_generic_param_owner): Fix initialization of owner
17489         fields.
17490
17491 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
17492
17493         * icall.c: fixed Enum.ToObject() to correctly convert the values.
17494
17495 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17496
17497         * threadpool.c: workaround for a bug that shows up on the Mac:
17498         select()+connect() on a blocking socket is not like it should
17499         be, so we proceed to connect() in that case, wasting the I/O
17500         threadpool thread until connect succeedes. Fixes bug #75436.
17501
17502 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17503
17504         * threadpool.c: fix typo when setting file descriptor states.
17505
17506 2005-11-28  Raja R Harinath  <rharinath@novell.com>
17507
17508         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
17509         * metadata.c (mono_metadata_parse_method_signature_full): Don't
17510         create a temporary signature container.
17511         (mono_metadata_parse_generic_param): Update to changes.
17512         (mono_type_create_from_typespec_full): Update to changes.
17513         * loader.c (method_from_memberref): Don't use a
17514         MonoGenericContainer while parsing a memberref signature.
17515         (method_from_methodspec): Remove dead-store of the 'container'
17516         variable.  It's overwritten before use.
17517
17518         * metadata.c (mono_type_create_from_typespec_full): Make debugging
17519         checks tighter.
17520         (mono_metadata_parse_generic_param): Likewise.
17521         * loader.c (find_method_in_class): Does not need a
17522         MonoGenericContainer.  Use 'mono_method_signature' rather than
17523         'mono_method_signature_full'.
17524         (find_method, mono_get_method_constrained, method_from_memberref):
17525         Update to changes.
17526
17527         * metadata.c (mono_type_create_from_typespec_full): Ensure that
17528         owner-less generic-parameters are never evicted from the typespec
17529         cache.
17530
17531         * loader.c (method_from_memberref): Don't use the current context
17532         when parsing signatures.
17533         (method_from_methodspec, mono_get_method_from_token): Update to changes.
17534
17535         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
17536         side-effects in g_assert.
17537         * loader.c (mono_get_method_from_token): Resolve klass earlier so
17538         that we don't potentially lose information.
17539
17540 2005-11-26  Dick Porter  <dick@ximian.com>
17541
17542         * icall.c:
17543         * threads.c: icalls to implement basic (ie, not named)
17544         System.Threading.Semaphore.
17545
17546 2005-11-24  Dick Porter  <dick@ximian.com>
17547
17548         * process.c
17549         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
17550         Use GetProcessId() if it's available.
17551
17552 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
17553
17554         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
17555
17556 2005-11-23  Raja R Harinath  <rharinath@novell.com>
17557             Ankit Jain  <jankit@novell.com>
17558
17559         * loader.c (mono_get_method_from_token): Initialize 'method' field
17560         of all generic parameters before parsing the signature.  Remove
17561         code that "fixed"-up MVAR references.
17562
17563 2005-11-23  Ankit Jain  <jankit@novell.com>
17564
17565         * metadata.c (mono_metadata_has_generic_params):
17566         (mono_metadata_load_generic_param_constraints):
17567         (mono_metadata_load_generic_params): Move duplicate code ...
17568         (mono_metadata_get_generic_param_row): ... here. Returns the
17569         first row-id in GenericParam table for a given owner (token).
17570         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
17571         prototype.
17572
17573 2005-11-23  Raja R Harinath  <rharinath@novell.com>
17574             Ankit Jain  <jankit@novell.com>
17575
17576         * metadata.c (mono_metadata_class_equal): Pass signature_only when
17577         comparing VARs too.
17578         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
17579         type->data.generic_param only if the type is an MVAR.
17580         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
17581         leak owner-less VARs and MVARs into managed space.
17582
17583 2005-11-21  Martin Baulig  <martin@ximian.com>
17584
17585         * class-internals.h
17586         (MonoMethod): Moved the `generic_container' here from
17587         `MonoMethodNormal' since we now also need it for
17588         `MonoMethodPInvoke';
17589         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
17590         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
17591         an union containing both `MonoMethodNormal' and
17592         `MonoMethodPInvoke'.
17593
17594         * loader.c
17595         (mono_get_method_from_token): Allow implementing generic methods
17596         as interncalls.
17597
17598         * threads.c
17599         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
17600         icall.
17601
17602 2005-11-17  Dick Porter  <dick@ximian.com>
17603
17604         * icall.c: 
17605         * process.h: 
17606         * process.c: Split the Process Start_internal icall into
17607         ShellExecuteEx_internal and CreateProcess_internal, which are
17608         called depending on whether UseShellExecute is true.  Fixes bug
17609         76670.
17610
17611         * appdomain.c (MONO_CORLIB_VERSION): Incremented
17612
17613 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
17614
17615         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
17616         'msize' parameters, use the information in 'mspec' instead.
17617         (emit_object_to_ptr_conv): Ditto.
17618
17619         * marshal.c (emit_struct_conv): Handle explicit layout structs with
17620         fields out of order. Fixes #76733.
17621
17622 2005-11-17  Ankit Jain  <jankit@novell.com>
17623
17624         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
17625
17626 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
17627
17628         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
17629           bug #76575.
17630
17631 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
17632
17633         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
17634         for types with non-auto layout. Fixes #76717.
17635
17636 2005-11-16  Ankit Jain  <jankit@novell.com>
17637
17638         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
17639         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
17640         if generic_context is null.
17641           (mono_metadata_generic_param_equal): param->owner can be null.
17642           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
17643         null.
17644
17645 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
17646
17647         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
17648         the correct value.
17649
17650 2005-11-15  Martin Baulig  <martin@ximian.com>
17651
17652         * object.c (set_value): Use mono_class_from_mono_type() instead of
17653         the hack for generic instances; fixes #76136.
17654
17655 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
17656
17657         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
17658         fields.
17659
17660         * image.c (load_metadata_ptrs): Initialize the new fields.
17661
17662         * reflection.c (create_dynamic_mono_image): Ditto.
17663
17664         * reflection.c (build_compressed_metadata): Use the new fields.
17665
17666         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
17667         icall.
17668
17669         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
17670         icall.
17671         
17672 2005-11-15  Ankit Jain  <jankit@novell.com>
17673             Raja R Harinath  <harinath@gmail.com>
17674
17675         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
17676         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
17677         new per-generic_container cache if the cached MonoType's context matches
17678         the current context.
17679           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
17680         to the expected context.
17681           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
17682
17683 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17684
17685         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
17686         we changed the signature of an icall.
17687         * icall.c: Modify to mono_double_ParseImpl return true/false 
17688         depending on the success, instead of throwing the exception. This will
17689         help us in Double.TryParse methods.
17690         
17691 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
17692
17693         * marshal.c (emit_marshal_object): Throw an exception when
17694         marshalling 'object' instead of crashing. Fixes #76696.
17695
17696 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
17697
17698         * class-internals.h: Add prototype for mono_type_get_full_name ().
17699
17700 2005-11-11  Dick Porter  <dick@ximian.com>
17701
17702         * threads.c (mono_thread_manage): Make sure the main thread has
17703         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
17704
17705 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
17706
17707         * loader.c (mono_loader_set_error_type_load): Log a warning to the
17708         console about the missing type.
17709         (mono_loader_set_error_method_load): Ditto.
17710
17711 2005-11-09  Miguel de Icaza  <miguel@novell.com>
17712
17713         * mono-config.c (mono_get_config_dir): Set the system defaults if
17714         none is specified.
17715
17716         * assembly.c (mono_set_dirs): New API entry point to set the
17717         assembly and the config directory in one call
17718
17719 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
17720
17721         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
17722         the ftnptr was created from a delegate in a domain other than the
17723         current domain. Fixes #75377.
17724
17725         * exception.h exception.c: Add mono_get_exception_not_supported ().
17726
17727 2005-11-08  Martin Baulig  <martin@ximian.com>
17728
17729         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
17730
17731 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
17732
17733         * security-manager.h: Added definitions to deal with strongname key 
17734         pairs bigger (and smaller) than 1024 bits.
17735         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
17736         adjust wrt the public key length being used.
17737
17738 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
17739
17740         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
17741           Windows build (r51396-51397).
17742
17743 2005-11-03  Martin Baulig  <martin@ximian.com>
17744
17745         * class.c (mono_class_setup_vtable_general): Also add generic
17746         methods to the vtable; fixes #76581.
17747
17748 2005-11-01  Miguel de Icaza  <miguel@novell.com>
17749
17750         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
17751         sure that we lookup GetString method from the System.Text.Encoding
17752         class, not the derived class or we get an empty method.
17753
17754         Fixed class #76612.
17755
17756 2005-10-25  Miguel de Icaza  <miguel@novell.com>
17757
17758         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
17759         if it has been previously set (embedders). 
17760
17761         Make mono_set_rootdir available also on Unix.
17762
17763 005-10-24  Robert Jordan  <robertj@gmx.net>
17764
17765         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
17766
17767 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
17768
17769         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
17770         only calls which are made to native code use this flag.
17771
17772         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
17773
17774 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
17775
17776         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
17777         Add support for FieldBuilders.
17778
17779 2005-10-29  Martin Baulig  <martin@ximian.com>
17780
17781         * mono-debug.c
17782         (mono_debug_using_mono_debugger): New public method; returns
17783         whether we're running inside the debugger.
17784
17785 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
17786
17787         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
17788         for Method/Constructor/FieldBuilders.
17789
17790 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
17791
17792         * reflection.c (module_add_cattrs): Save custom attributes for global methods
17793         and fields as well.
17794
17795 2005-10-26  Martin Baulig  <martin@ximian.com>
17796
17797         * mono-debug-debugger.c
17798         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
17799
17800 2005-10-24  Raja R Harinath  <harinath@gmail.com>
17801
17802         * icall.c (base64_to_byte_array): Don't pass an out-of-range
17803         integer to isspace.
17804
17805 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
17806
17807         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
17808         when passing valuetypes byref. Fixes #76502.
17809
17810 2005-10-19  Jackson Harper  <jackson@ximian.com>
17811
17812         * profiler.c: Don't put a . in front of types that are not in a
17813         namespace.
17814
17815 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
17816
17817         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
17818
17819 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
17820
17821         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
17822         #76436.
17823         (mono_marshal_get_ldflda_wrapper): Fix a warning.
17824
17825 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
17826
17827         * assembly.c metadata-internals.h icall.c: Define an additional
17828         parameter for mono_assembly_name_parse_full, so we can avoid creating
17829         S.R.AssemblyName.Version when no version info wasn't passed.
17830         
17831 2005-10-09  Miguel de Icaza  <miguel@novell.com>
17832
17833         * class.c (mono_type_get_full_name): Reimplement method that was
17834         removed. 
17835
17836         * image.c: Some docs
17837
17838 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
17839
17840         * profiler.c (output_newobj_profile): Fix printing of Total memory
17841         on x86.
17842
17843 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
17844
17845         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
17846
17847 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
17848
17849         * threads.c: remove debug output.
17850
17851 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
17852
17853         * threads.c (mono_thread_manage): Fix crashes if more than 64
17854         threads need to be aborted. Hopefully fixes #75899.
17855
17856         * assembly.c (mono_stringify_assembly_name): New helper function.
17857
17858         * class.c: Use mono_stringify_assembly_name instead of the similar
17859         static function.
17860
17861         * assembly.h assembly.c: Add support for calling a postload search 
17862         hook if an assembly cannot be loaded.
17863
17864         * appdomain.c: Register new search hooks which call the AssemblyResolve
17865         events in AppDomain. Fixes #75231
17866
17867 2005-10-07  Martin Baulig  <martin@ximian.com>
17868
17869         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
17870         methods without debug info.
17871
17872 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
17873
17874         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
17875         wrappers.
17876
17877 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17878
17879         * file-io.c: now that we return symlinks, use lstat and, when the file
17880         is a symbolic link, stat, to get the file attributes. Also avoid the
17881         conversion to/from utf16/external.
17882
17883 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
17884
17885         * class.c (mono_class_layout_fields): Compute klass->has_references
17886         correctly if an embedded valuetype is not yet initialized. Fixes
17887         #76331.
17888
17889 2005-10-04  Martin Baulig  <martin@ximian.com>
17890
17891         * metadata.c
17892         (mono_metadata_load_generic_param_constraints): New public
17893         function; splitted the constraints loading out from
17894         mono_metadata_load_generic_params().
17895
17896         * class.c (mono_class_create_from_typedef): Call
17897         mono_metadata_load_generic_param_constraints() after setting up
17898         the type and creating our parent; fixes #75329.
17899
17900 2005-10-04  Martin Baulig  <martin@ximian.com>
17901
17902         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
17903         non-dynamic parent classes.
17904
17905 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
17906
17907         * file-io.c : win32 build fix (ETXTBSY seems not found).
17908
17909 2005-10-04  Martin Baulig  <martin@ximian.com>
17910
17911         * reflection.c
17912         (mono_image_get_methodspec_token): Make the cache actually work;
17913         fixes #75974.
17914
17915 2005-10-04  Martin Baulig  <martin@ximian.com>
17916
17917         * class.c (mono_class_name_from_token): Removed the unneccessary
17918         `MonoGenericContext *' argument.
17919
17920 2005-10-04  Martin Baulig  <martin@ximian.com>
17921
17922         * loader.c
17923         (method_from_methodspec): Make the caching work again; fixes the
17924         performance regression from #76262.
17925
17926 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17927
17928         * file-io.c:
17929         * file-io.h:
17930         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
17931         GetFileSystemEntries that performs the same work but without going
17932         into io-layer, locking, etc.
17933
17934 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
17935
17936         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
17937         ThreadState_Stopped as well. Fixes #76047.
17938
17939 2005-09-29  Martin Baulig  <martin@ximian.com>
17940
17941         * class.c
17942         (inflate_generic_context): If the new context has a `gmethod', set
17943         its `container' that that gmethod's `container'.
17944
17945         * metadata.c
17946         (mono_metadata_parse_generic_param): Simplify things;
17947         `generic_container = generic_context->container;' is just fine.
17948
17949         * loader.c (method_from_methodspec): Code cleanups.
17950
17951 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
17952
17953         * decimal.c: fix warning (and let gcc generate correct
17954         code on ARM with optimizations).
17955
17956 2005-09-28  Martin Baulig  <martin@ximian.com>
17957
17958         * loader.c
17959         (method_from_memberref): Added `MonoGenericContext *class_context'
17960         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
17961         (method_from_methodspec): If we're a memberref, use the enclosing
17962         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
17963
17964 2005-09-28  Martin Baulig  <martin@ximian.com>
17965
17966         * object.c (mono_runtime_invoke_array): Added support for
17967         MONO_TYPE_GENERICINST; fixes #75917.
17968
17969 2005-09-27  Martin Baulig  <martin@ximian.com>
17970
17971         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
17972         `k->byval_arg.type' to determine the actual type.
17973
17974         * loader.c (method_from_methodspec): Removed some hacks.
17975
17976 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
17977
17978         * class-internals.h (mono_field_is_deleted): Do the test for
17979         rtspecialname before we check the actual name of the field. This
17980         prevents us from dereferencing a pointer into the string table,
17981         saving us from accessing a few pages
17982
17983         * *.c: Replace the use of {Enter,Leave}CriticalSection with
17984         macros. This will allow a deadlock debugger to easily be plugged
17985         in.
17986
17987 2005-09-27  Martin Baulig  <martin@ximian.com>
17988
17989         * loader.c (method_from_methodspec): Create a "signature"
17990         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
17991
17992 2005-09-27  Martin Baulig  <martin@ximian.com>
17993
17994         * class.c
17995         (inflate_generic_class): Correctly set the new context's
17996         container.
17997
17998         * loader.c
17999         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
18000         instead of a `MonoGenericContext *'.
18001         (mono_method_signature_full): Take a `MonoGenericContainer *'
18002         instead of a `MonoGenericContext *'.
18003
18004         * metadata.c
18005         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
18006         instead of a `MonoGenericContext *'.
18007         (mono_metadata_parse_method_signature_full): Likewise.
18008
18009 2005-09-26  Martin Baulig  <martin@ximian.com>
18010
18011         * class.c
18012         (mono_class_from_generic_parameter): Set `klass->generic_container'
18013         (mono_class_from_generic_parameter): Likewise.
18014         (mono_bounded_array_class_get): We inherit the generic container
18015         from the element class.
18016
18017         * loader.c
18018         (find_method, find_method_in_class): Take a `MonoGenericContext *'
18019         argument rather than computing it here.
18020         (method_from_memberref): Correctly set the generic context before
18021         parsing the signature.  Fixes #75681.
18022
18023 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
18024
18025         * object.c (mono_class_has_special_static_fields): Fix warnings.
18026
18027 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18028
18029         * assembly.c: Add parse_public_key function, to
18030         par the public keys. Also added mono_assembly_name_parse_full,
18031         to define it the parsed key should be freed or not.
18032         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
18033         to parse a long format assembly name.
18034         * metadata-internals.h: Keep mono_assembly_name_parse_full as
18035         private, since calling it to preserve the key requires
18036         freeing it manually.
18037         
18038 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
18039
18040         * locales.c : removed HAVE_ICU part.
18041
18042 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
18043
18044         * object.c (mono_class_create_runtime_vtable): Avoid calling 
18045         field_is_special_static if the klass has no special static fields.
18046
18047         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
18048         (MonoCachedClassInfo): Likewise.
18049
18050         * object.c (mono_class_has_special_static_fields): New helper function.
18051
18052 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18053
18054         * class.c (mono_class_create_from_typedef): Don't call 
18055         interfaces_from_typedef_full for enums.
18056         (mono_class_create_from_typedef): Compute the base types of enums directly
18057         without calling mono_class_setup_fields ().
18058         (mono_class_find_enum_basetype): New helper function.
18059
18060         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
18061         one place inside the string heap.
18062         
18063 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
18064
18065         * class.c: locking fixes, code cleanups, some docs added.
18066         Allocate some data structures in the image mempool.
18067
18068 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18069
18070         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18071         the example code.
18072         
18073 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
18074
18075         * class-internals.h, class.c, reflection.c: reduce memory taken by
18076         MonoClass.
18077
18078 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
18079
18080         * metadata.c, metadata.h, loader.h: documentation updates, code and
18081         API cleanups.
18082
18083 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
18084
18085         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
18086         the example code.
18087
18088         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
18089         page faults caused by the runtime while reading metadata.
18090
18091 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18092
18093         * socket-io.c: the field names were changed 3 months ago and no one
18094         realized until bug #76077 got filed!
18095
18096 2005-09-20  Martin Baulig  <martin@ximian.com>
18097
18098         * icall.c (assembly_icalls): Removed some unused debugger icalls.
18099
18100 2005-09-20  Martin Baulig  <martin@ximian.com>
18101
18102         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
18103         write the rank into the class entry.
18104
18105 2005-09-20  Martin Baulig  <martin@ximian.com>
18106
18107         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
18108
18109 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
18110
18111         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18112
18113         * icall.c (custom_attrs_defined_internal): New icall.
18114
18115         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
18116         function.
18117         (mono_custom_attrs_construct_by_type): New helper function.
18118
18119 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
18120
18121         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
18122         terminate the resulting string. Fixes #76123.
18123
18124 2005-09-16  Martin Baulig  <martin@ximian.com>
18125
18126         * mono-debug.c
18127         (mono_debug_add_method): Ignore inflated methods for the moment.
18128
18129 2005-09-14  Martin Baulig  <martin@ximian.com>
18130
18131         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
18132
18133 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
18134
18135         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
18136         return a success/failure indication.
18137         (mono_metadata_interfaces_from_typedef_full): Ditto.
18138         (get_constraints): Ditto.
18139
18140 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
18141
18142         * marshal.c (emit_marshal_array): Fix handling of null arrays.
18143         
18144         * marshal.c (emit_marshal_array): Add support for returning string
18145         arrays from delegates. Fixes #76063.
18146
18147         * marshal.c: Use the emit_ldloc/stloc macros where possible.
18148
18149 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
18150
18151         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
18152         icall.
18153
18154 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
18155
18156         * reflection.c icall.c: Fix after mono_get_exception_type_load
18157         signature change.
18158
18159         * assembly.c (mono_assembly_get_assemblyref): New helper function.
18160         (mono_assembly_load_reference): Use the new helper.
18161
18162         * class-internals.h (MonoLoaderError): New structure containing 
18163         information about type loading errors.
18164
18165         * class-internals.h loader.c: Add APIs to store per-thread loader
18166         error information.
18167
18168         * loader.c class.c: Set the loader error if needed.
18169
18170         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
18171
18172 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
18173
18174         * decimal.c: fixed to handle the broken ARM fp format.
18175
18176 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
18177
18178         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
18179         broken.
18180
18181 2005-09-06  Martin Baulig  <martin@ximian.com>
18182
18183         * domain.c (supported_runtimes): Added v2.0.50727.
18184
18185 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
18186
18187         * culture-info.h: reduce the size of some structures.
18188
18189 2005-09-05  Martin Baulig  <martin@ximian.com>
18190
18191         Reflect latest API changes in the August CTP.
18192
18193         * icall.c
18194         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
18195         ("MonoType.HasGenericArguments"): Removed.
18196         ("MonoMethod.BindGenericParameters"): Renamed to
18197         "MakeGenericMethod".
18198         ("MethodBuilder.BindGenericParameters"): Renamed to
18199         "MakeGenericMethod".    
18200
18201 2005-09-05  Martin Baulig  <martin@ximian.com>
18202
18203         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
18204
18205 2005-09-05  Martin Baulig  <martin@ximian.com>
18206
18207         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18208
18209         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
18210         generic_container is non-NULL.
18211
18212 2005-09-05  Martin Baulig  <martin@ximian.com>
18213
18214         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18215
18216         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
18217
18218 2005-08-29  Michal Moskal  <malekith@nemerle.org>
18219
18220         * reflection.c (encode_locals,
18221         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
18222         for large generic types.
18223
18224 2005-09-05  Martin Baulig  <martin@ximian.com>
18225
18226         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18227
18228         * class.c (mono_dup_array_type): New public method.
18229         (mono_metadata_signature_deep_dup): New public method.
18230         (dup_type): Correctly duplicate array and function types.
18231
18232 2005-09-05  Martin Baulig  <martin@ximian.com>
18233
18234         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18235
18236         * reflection.c (get_default_param_value_blobs): Handle generic types
18237         and generic methods.
18238
18239 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
18240
18241         * class.c: Fixed error reporting (method/class were inversed) for 
18242         inheritance demands.
18243         * security-manager.c|h: Added the AppDomain when calling the managed
18244         System.Security.SecurityManager.InheritanceDemand method.
18245
18246 2005-09-01  Raja R Harinath  <rharinath@novell.com>
18247
18248         * reflection.c (encode_marshal_blob): 'marshaltype' and
18249         'marshaltyperef' are alternate sources for the custom marshaler
18250         name.
18251
18252 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
18253
18254         * class.c: fix creation of array classes with rank == 1
18255         (patch by Ankit Jain <jankit@novell.com>).
18256
18257 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
18258
18259         * object.c: fix check for creating the bound data for arrays vs
18260         szarrays.
18261
18262 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18263
18264         * object.c: configuration file name is now based on the executable name,
18265         not the image name. Fixes bug #75931.
18266
18267 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
18268
18269         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
18270         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
18271
18272 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
18273
18274         * rand.c: Use wincrypt.h instead of WinCrypt.h.
18275
18276 2005-08-24  Ankit Jain  <jankit@novell.com>
18277             Raja R Harinath  <rharinath@novell.com>
18278
18279         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
18280           called by it recursively.
18281           (mono_class_init): Remove special case in pending_init handling, since it's
18282           superseded by the fix to mono_class_from_typeref.
18283
18284 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
18285
18286         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
18287         BROKEN_THREAD_START stuff.
18288
18289 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
18290
18291         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
18292         trampoline.
18293
18294         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
18295         
18296         * object.c (mono_delegate_ctor): Replace the original function address with
18297         a delegate trampoline.
18298
18299 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
18300
18301         * icall.c: add boolean argument to base64_to_byte_array and 
18302         InternalFromBase64String to control whether a whitespace-only string
18303         is allowed (or should casue a FormatException to be thrown). We need
18304         this as the behavior has changed between MS.NET 1.x and 2.0, and we
18305         to match the MS behaviour in both profiles.
18306         * appdomain.c: Bump corlib version.
18307
18308 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18309
18310         This patch implements a big portion of publisher policy
18311         support, used to bind assembly versions and redirect
18312         one assembly from version A to version B.
18313
18314         * assembly.c:
18315         New GSList loaded_assembly_bindings, for storing the cached
18316         assembly bindings.
18317         (assembly_binding_maps_name): New static function for checking if a 
18318         assembly binding information maps an assembly name.
18319         (mono_assembly_binding_info_free): New function for freeing
18320         assembly binding information resources.
18321         (get_publisher_policy_info): New static function for retrieving 
18322         assembly binding information from a MonoImage.
18323         (compare_versions): New static function for comparing an assembly
18324         binding information data and the version of an assembly name.
18325         (check_policy_versions): New static function for checking if an
18326         assembly binding info mapping an assembly name is valid for it.
18327         (mono_assembly_load_publisher_policy): New static function for
18328         loading the 'policy.major.minor.MyAssembly' image for an assembly
18329         with an assembly name 'aname'.
18330         (mono_assembly_bind_version): New static function for updating
18331         assembly redirection.
18332         (mono_assembly_apply_binding): New static function for applying
18333         assembly binding.
18334         (search_binding_loaded): New static function for searching 
18335         loaded assembly binding infos in the cache domain.
18336         (mono_assembly_load_full): Don't apply assembly binding for
18337         reflection only assemblies.
18338
18339         * metadata-internals.h: Add MonoAssemblyBindingInfo,
18340         which contains information about assembly binding. Also
18341         declare signature for mono_config_parse_publisher_policy ()
18342         function, used to retrieve pub policy info.
18343         
18344         * mono-config.c:
18345         (publisher_policy_start): New static function used to parse publisher 
18346         policy config files.
18347         (publisher_policy_parser): New static MonoParseHandler containing 
18348         the functions used when parsing config files.
18349         (mono_config_parse_publisher_policy): New function for parsing
18350         publisher policy files.
18351         
18352 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
18353
18354         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
18355
18356         * marshal.c (mono_delegate_free_ftnptr): Ditto.
18357
18358         * object.c (mono_get_addr_from_ftnptr): New helper function.
18359
18360         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
18361
18362         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18363
18364 2005-08-19  Dick Porter  <dick@ximian.com>
18365
18366         * threads.c, threads.h, appdomain.c, appdomain.h,
18367         profiler-private.h, monitor.c, object.c, object-internals.h,
18368         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
18369         store the thread ID, so it can hold a 64 bit value if needed.
18370
18371 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
18372
18373         * reflection.c (mono_reflection_create_dynamic_method): Store the
18374         handle class into the method references as well so ldtoken works in
18375         dynamic methods.
18376
18377         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
18378         types.
18379
18380 2005-08-19  Ankit Jain <jankit@novell.com>
18381
18382         Fix #75847.
18383         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
18384           here rather than using the method signature of a arbitrary function
18385           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
18386           two arguments.
18387           Hack done with Harinath.
18388
18389 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18390
18391         * threadpool.c: disable printing stack traces when we get a exception
18392         in a threadpool thread. I need to do more testing to figure out which
18393         cases actually print this. Fixes bug #75828.
18394
18395 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18396
18397         * icall.c: there might be ignored whitespace after the last '='. This
18398         fixes length computation and bug #75840.
18399
18400 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
18401
18402         * assembly.c (mono_assembly_load_full): Consider .exe extension as
18403         well. Fixes #75809.
18404
18405         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
18406         #75784.
18407         
18408         * reflection.c (create_custom_attr_data): Ditto.
18409
18410 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
18411
18412         * locales.c, culture-info.h : removed RegionLCIDMap.
18413         * culture-info-tables.h : regenerated.
18414
18415 2005-08-16  Martin Baulig  <martin@ximian.com>
18416
18417         * class.c (mono_type_get_name_recurse): Small fix.
18418
18419 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
18420
18421         * locales.c : indentation fixie.
18422
18423 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
18424
18425         * object-internals.h,
18426           locales.h,
18427           locales.c,
18428           culture-info.h,
18429           icall.c : added RegionInfo table support.
18430         * culture-info-table.h : regenerated for region support.
18431
18432 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
18433
18434         * reflection.c (resolve_object): handle all kinds of MonoMethod
18435         including generic ones
18436
18437 2005-08-12  Ankit Jain <jankit@novell.com>
18438
18439         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
18440           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
18441
18442 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
18443
18444         * process.c: Don't close a thread handle when it's NULL. This is a
18445         workaround for bug #75733.
18446
18447 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
18448
18449         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
18450
18451 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
18452
18453         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
18454
18455 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18456
18457         * threadpool.c: if a work item in the thread pool has a callback that
18458         catches a exception, don't propagate it after invoking the callback.
18459         Fixes bug #75336.
18460
18461 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
18462
18463         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
18464
18465         * class-internals.h (MonoCachedClassInfo): Add some new fields.
18466
18467         * class.c (mono_class_init): Load field info lazily in the AOT case.    
18468
18469         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
18470
18471 2005-08-03  Ankit Jain  <jankit@novell.com>
18472
18473         Fix #75683.
18474         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
18475           PInvoke calling convention is 0.
18476
18477 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
18478
18479         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
18480         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
18481
18482 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
18483
18484         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
18485         to handle threads not started by the GC (patch by Michael Meeks
18486         <michael.meeks@novell.com>).
18487
18488 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
18489
18490         * reflection.c: Make buffer used in emitting types larger for some
18491         big generic types (patch by Michal Moskal).
18492
18493 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
18494
18495         * mono-debug.c: Fix some (not all) alignment problems.
18496
18497 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18498
18499         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
18500         Invoke mono_image_load_from_data_full passing the refonly
18501         parameter.
18502
18503         * assembly.c
18504         (mono_assembly_open_from_bundle): Add the refonly argument, 
18505         in order to pass it to other methods it calls to.
18506         (do_mono_assembly_open): Add the refonly argument, in order 
18507         to pass it to other methods it calls to.
18508         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
18509         the refonly parameter to it.
18510
18511         * image.c: Add loaded_images_refonly_hash and
18512         loaded_images_refonly_guid_hash to cache the reflection
18513         only loaded images.
18514         (mono_images_init): Initialize the hash tables used for
18515         caching the reflection only images.
18516         (load_modules): Invoke mono_image_open_full passing the refonly
18517         parameter to load the modules the correct way.
18518         (build_guid_table): Add the refonly argument, to re-build the 
18519         correct hash table.
18520         (do_mono_image_open): Added the refonly argument, in order to
18521         define it for the loaded image.
18522         (mono_image_loaded_full): New function, which receives an
18523         additional parameter to look for the image in the refonly or
18524         non-refonly section.
18525         (mono_image_loaded): Updated, using mono_image_loaded_full.
18526         (mono_image_loaded_by_guid_full): The same case that happens
18527         with mono_image_loaded_full.
18528         (mono_image_loaded_by_guid): Likewise.
18529         (register_image): Use the ref_only variable inside MonoImage
18530         to decide in which hash table store the current image.
18531         (mono_image_open_from_data_full): Rename
18532         mono_image_open_from_data to mono_image_open_from_data_full,
18533         adding the refonly argument, to define the ref_only variable 
18534         inside MonoImage.
18535         (mono_image_open_from_data): Return 
18536         mono_image_open_from_data_full.
18537         (mono_image_open_full): Rename mono_image_open to
18538         mono_image_open_full, receiving the new refonly argument,
18539         to pass it to inner methods.
18540         (mono_pe_file_open): Update this function, to open
18541         a MonoImage as a non-refonly image.
18542         (mono_image_close): Use the refonly variable inside
18543         MonoImage to remove the image from the correct caches.
18544
18545         * image.h: Add the signatures of mono_image_open_full,
18546         mono_image_open_from_data_full, mono_image_loaded_full,
18547         mono_image_loaded_by_guid_full.
18548
18549         * metadata-internals.h: Add the ref_only field to 
18550         MonoImage.
18551         
18552 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
18553
18554         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
18555         Fix the last behavior, which used to load the assemblies and
18556         extract MonoReflectionAssemblyName information, instead of
18557         extract it from the metadata tables. Needed for Reflection
18558         Only assemblies.
18559         
18560 2005-07-29  Martin Baulig  <martin@ximian.com>
18561
18562         * mono-debug-debugger.c
18563         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
18564         not initialized.
18565
18566         * mono-debug.c
18567         (mono_debug_address_from_il_offset): Check whether we have
18568         debugging support before attempting to take the lock.
18569         (mono_debug_source_location_from_address): Likewise.
18570         (mono_debug_source_location_from_il_offset): Likewise.
18571         (mono_debug_il_offset_from_address): Likewise.
18572         (mono_debug_address_from_il_offset): Likewise.
18573
18574 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
18575
18576         * class.c (mono_class_from_name_case): Add support for dynamic images.
18577         Fixes #75650.
18578
18579         * object.c (mono_class_compute_gc_descriptor): Add a workaround
18580         for #75479.
18581
18582 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
18583         
18584         * reflection.c (mono_method_get_object): Fix warning.
18585
18586 2005-07-28  Martin Baulig  <martin@ximian.com>
18587
18588         * mono-debug.c
18589         (mono_debug_add_wrapper): Also write the wrapper type.
18590
18591 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
18592
18593         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
18594         
18595         * class.c (mono_class_init): Avoid reading nested classes if the AOT
18596         data indicates the class has none.
18597
18598 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
18599
18600         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
18601         loader lock with the debugger lock. Prevents deadlocks for beagle.
18602
18603         Beagle can now run on an smp box for a weekend without any
18604         issues. Woohoo!
18605
18606 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
18607
18608         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
18609         in a module. Fixes #75629.
18610
18611 2005-07-26  Martin Baulig  <martin@ximian.com>
18612
18613         * mono-debug.c (mono_debug_add_wrapper): New static method.
18614         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
18615         interncall or a wrapper.
18616
18617         * mono-debug.h (MonoDebugWrapperData): New public typedef.
18618         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
18619         (MONO_DEBUGGER_VERSION): Bump to 51.
18620
18621         * mono-debug-debugger.c
18622         (mono_debugger_add_type): Removed this empty function.
18623         (mono_debugger_add_method): Likewise.
18624
18625 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
18626
18627         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
18628         before accessing method->slot.
18629
18630 2005-07-21  Jb Evain  <jbevain@gmail.com>
18631
18632         * reflection.c (method_encode_clauses/class): Handle filters clauses.
18633         Fixes #75010.
18634
18635 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
18636
18637         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
18638         #75587.
18639
18640 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
18641
18642         * image.h image.c: Add mono_image_get_guid () API function.
18643
18644 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
18645
18646         There were issues when multiple threads tried to load
18647         assemblies. A deadlock was created between assemblies_mutex and
18648         mono_domain_assemblies_lock. This fixes the issue by making the
18649         assembly ref counting be lock free. See bug 75586.
18650         
18651         * image.c (mono_image_close): The add ref function here was using
18652         Interlocked operations while the unref was using a mutex and a
18653         --. I don't think this was ever a bug that would be exposed in a
18654         non-pendantic way (ie, by an embedder doing a ref on one thread
18655         and an unref on another), but for the sake of correctness, this is
18656         now Interlocked.
18657
18658         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
18659         (mono_assembly_load_reference): Call mono_assembly_addref rather
18660         than touching the refcount ourselves.
18661         (mono_assembly_close): Use InterlockedDecrement to unref the
18662         assembly. Don't acquire the lock unless it is actually needed.
18663
18664 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
18665
18666         * class.c (mono_class_layout_fields): Fix calculation of has_references
18667         for generic types.
18668
18669 2005-07-12  Martin Baulig  <martin@ximian.com>
18670
18671         Applying a patch from Michal Moskal <malekith@nemerle.org>.
18672
18673         * metadata.c
18674         (mono_type_hash): Provide better hashing for generic instances.
18675         (mono_generic_inst_hash): Improve hashing.
18676         (mono_generic_class_hash): Likewise.
18677
18678         * reflection.c (mymono_metadata_type_hash): Improve hashing for
18679         generic instances.
18680
18681 2005-07-12  Martin Baulig  <martin@ximian.com>
18682
18683         * reflection.c (mono_reflection_create_runtime_class): Remove the
18684         hack for generic type definitions and non-`Run' assemblies.
18685         (mono_reflection_bind_generic_parameters): Also use
18686         `klass->wastypebuilder' to check for TypeBuilders.
18687
18688 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
18689
18690         * class.c (mono_class_layout_fields): Fix calculation of has_references
18691         for generic types.
18692
18693         * class.c (inflate_generic_class): Fix a leak.
18694         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
18695         for generic types.
18696
18697 2005-07-11  Martin Baulig  <martin@ximian.com>
18698
18699         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
18700         on error.
18701
18702 2005-07-11  Martin Baulig  <martin@ximian.com>
18703
18704         * loader.c (find_method): Also lookup in
18705         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
18706
18707 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18708
18709         * appdomain.c (mono_domain_unload): Don't free the error message
18710         before passing it to mono_get_exception_...
18711
18712         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
18713         
18714 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
18715
18716         * threads.c: try to better guess an available RT signal (bug #75387).
18717
18718 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18719
18720         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
18721         and CACHE_OBJECT.
18722
18723 2005-07-07  Martin Baulig  <martin@ximian.com>
18724
18725         * class.c (mono_type_get_name_full): Return NULL for
18726         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
18727         fixes #75408.
18728
18729 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
18730
18731         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
18732         exit the appdomain as well being aborted.
18733
18734         * threadpool.c: Create all threadpool threads inside the root appdomain, and
18735         change back to the root domain after calling managed code. This enables
18736         appdomains using threadpools to be unloaded.
18737
18738 2005-07-07  Martin Baulig  <martin@ximian.com>
18739
18740         * class-internals.h
18741         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
18742         into `MonoDynamicGenericClass' since we only need it for dynamic
18743         types.
18744
18745         * reflection.c (mono_class_bind_generic_parameters): We don't need
18746         to compute the `parent' here.
18747
18748 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
18749
18750         * culture-info-table.h : regenerated.
18751
18752 2005-07-06  Martin Baulig  <martin@ximian.com>
18753
18754         * icall.c
18755         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
18756
18757         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
18758
18759 2005-07-06  Martin Baulig  <martin@ximian.com>
18760
18761         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
18762         we're doing a signature-only comparision; fixes #74945.
18763
18764 2005-07-06  Martin Baulig  <martin@ximian.com>
18765
18766         * class-internals.h (MonoGenericClass): Moved some things out into
18767         a new `MonoInflatedGenericClass' type.  
18768         (MonoInflatedGenericClass): New type; the `klass' of a
18769         `MonoGenericClass' is now computed lazyly in
18770         mono_get_inflated_generic_class().      
18771
18772         * class.c (mono_get_inflated_generic_class): New public function.
18773         (mono_class_inflate_generic_method): Removed the unused
18774         `MonoClass *' argument.
18775         (setup_generic_vtable): Don't call mono_get_inflated_method() on
18776         all the methods.
18777         (mono_class_create_generic): Make this static and merge it with
18778         mono_class_create_generic_2(); we're now called automatically from
18779         mono_get_inflated_generic_class().
18780
18781         * loader.c (mono_method_signature): Call
18782         mono_get_inflated_method() here.
18783
18784 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
18785
18786         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
18787         type of fields with RVA.
18788
18789         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
18790         for this pseudo class.
18791         (my_mono_class_from_generic_parameter): Likewise.
18792         (mono_class_init): Allow interfaces to have cctors.
18793
18794 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
18795
18796         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
18797         lazily for AOT methods.
18798
18799 2005-07-05  Martin Baulig  <martin@ximian.com>
18800
18801         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
18802         returns FALSE for a successful match, not TRUE.
18803
18804 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
18805
18806         * loader.c (mono_method_get_index): Optimize this a bit.
18807
18808 2005-07-04  Martin Baulig  <martin@ximian.com>
18809
18810         * class.c
18811         (class_compute_field_layout): Move the check for generic type
18812         definitions into mono_class_layout_fields().  Fixes #74684.
18813         (mono_class_from_generic_parameter): Correctly compute
18814         `klass->parent'; fixes #75457.
18815
18816         * reflection.c (register_assembly, register_module): Make sure
18817         `domain->rejobject_hash' is already created.
18818
18819 2005-07-02  Martin Baulig  <martin@ximian.com>
18820
18821         * class-internals.h
18822         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
18823         `MonoDynamicGenericClass'.      
18824
18825 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
18826
18827         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
18828         returned by a field getter is null, since null is a valid value.
18829
18830 2005-07-01  Martin Baulig  <martin@ximian.com>
18831
18832         * reflection.c (mono_reflection_generic_class_initialize): Update
18833         the `dgclass->fields [i].parent' to the correct class.
18834         (mono_image_get_fieldref_token): Use the declaring type, not the
18835         reflected type.
18836
18837 2005-07-01  Martin Baulig  <martin@ximian.com>
18838
18839         * loader.c (find_method): Also look in the interfaces; fixes #75429.
18840
18841 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
18842
18843         * threads.c (thread_cleanup): assert that thread != NULL
18844         (wait_for_tids_or_state_change): We were using the wrong variable
18845         when accessing wait->threads. `i' was always out of the bounds of
18846         the array.
18847
18848 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18849
18850         * loader.c: map user32 and kernel32 to libMonoSupportW
18851
18852 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
18853
18854         * appdomain.c (unload_thread_main): Mark this as WINAPI.
18855
18856 2005-06-28  Martin Baulig  <martin@ximian.com>
18857
18858         * loader.c (method_from_methodspec): Fix #75334.
18859
18860 2005-06-28  Martin Baulig  <martin@ximian.com>
18861
18862         Fix #74953 - Arrays now implement the generic IList<T> interface
18863         on the 2.0 platform.
18864
18865         * class-internals.h (MonoDefaults): Added `generic_array_class'.
18866
18867         * reflection.c (mono_class_bind_generic_parameters): New public
18868         function; similar to mono_reflection_bind_generic_parameters(),
18869         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
18870
18871         * domain.c (mono_init_internal): Try to initialize.
18872         `mono_defaults.generic_array_class' here; this'll only succeed if
18873         we're using the 2.0 corlib.
18874
18875         * icall.c
18876         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
18877         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
18878         (mono_lookup_internal_call): Added support for nested classes.
18879
18880         * loader.c
18881         (mono_get_method_from_token): Set `result->signature->pinvoke' if
18882         we're an interncall and have generic arguments.
18883
18884         * class.c
18885         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
18886         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
18887         instance of System.Array.InternalArray<T> for arrays, so they
18888         implement the generic IList<T> interface.
18889
18890 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
18891
18892         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
18893         (chastamar@yahoo.com). Fixes #75374.    
18894
18895 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
18896
18897         * culture-info-table.h: regenerated.
18898
18899 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18900
18901         * icall.c: handle spaces correctly for base64 strings.
18902
18903 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
18904
18905         * *.c: Kill some warnings.
18906
18907 2005-06-23  Duncan Mak  <duncan@novell.com>
18908
18909         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
18910         that this builds on Solaris 10 (x86).
18911
18912 2005-06-23  Martin Baulig  <martin@ximian.com>
18913
18914         * class.c
18915         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
18916         generic type definitions.
18917
18918 2005-06-23  Martin Baulig  <martin@ximian.com>
18919
18920         Fix #75331.
18921
18922         * metadata.c (mono_class_get_overrides): Renamed to
18923         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
18924         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
18925         pass it to mono_get_method_full().
18926
18927 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
18928
18929         * reflection.c (mono_reflection_create_runtime_class): take the
18930         mono_domain_lock in this method. Prevents deadlocks
18931
18932 2005-06-22  Martin Baulig  <martin@ximian.com>
18933
18934         * loader.c (method_from_methodspec): Fix #75330.
18935
18936 2005-06-22  Martin Baulig  <martin@ximian.com>
18937
18938         * reflection.c (type_get_qualified_name): Use
18939         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
18940         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
18941         argument; use it if we don't have an assembly name.
18942
18943 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
18944
18945         * object.c: In mono_message_init, set "copy out" flag for in
18946         parameters with the [Out] flag.
18947
18948 2005-06-21  Martin Baulig  <martin@ximian.com>
18949
18950         * class.c
18951         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
18952         and MONO_TYPE_PTR.
18953
18954 2005-06-21  Martin Baulig  <martin@ximian.com>
18955
18956         * class.c (mono_class_init): Don't initialize `class->fields' for
18957         generic instances since they're initialized again in
18958         compute_field_layout(). 
18959         (compute_field_layout): Set the field's `generic_info' here; fix
18960         #75320. 
18961
18962 2005-06-21  Martin Baulig  <martin@ximian.com>
18963
18964         * class-internals.h
18965         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
18966
18967         * metadata.c (mono_metadata_generic_method_equal): Also
18968         distinguish the `generic_class'; fixes #75334.
18969
18970 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18971
18972         * domain.c:
18973         * appdomain.c:
18974         * domain-internals.h:
18975         * reflection.c: 'domain_assemblies' field is now protected by its own
18976         lock. Don't call into managed code to run the AssemblyLoad event if we
18977         now there are no registered delegates for it.
18978
18979 2005-06-20  Martin Baulig  <martin@ximian.com>
18980
18981         * class.c (mono_class_is_assignable_from): Use a custom version of
18982         mono_class_has_parent() to make things work for generic instances;
18983         fix #75300.
18984
18985 2005-06-20  Martin Baulig  <martin@ximian.com>
18986
18987         * loader.c (method_from_methodspec): Apply a patch from
18988         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
18989
18990 2005-06-20  Martin Baulig  <martin@ximian.com>
18991
18992         * class.c (mono_class_init): Reverted Zoltan's last change; it
18993         breaks generics.
18994
18995 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
18996
18997         * threads.c (wait_for_tids_or_state_change): Add missing locking.
18998
18999 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19000
19001         * socket-io.c: fix the index in the socket array for writable/error
19002         sockets. Fixes bug #75306.
19003
19004 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
19005
19006         * class.c (mono_class_init): Allow interfaces to have static ctors.
19007
19008 2005-06-17  Martin Baulig  <martin@ximian.com>
19009
19010         * loader.c (method_from_methodspec): Use `context->container' when
19011         parsing the `gmethod->inst'.
19012
19013 2005-06-17  Martin Baulig  <martin@ximian.com>
19014
19015         * class.c (mono_type_get_name_recurse): Don't add the assembly
19016         name for type arguments.
19017
19018 2005-06-15  Martin Baulig  <martin@ximian.com>
19019
19020         * reflection.c (mono_image_get_inflated_method_token): Encode
19021         correct klass; fixes #75260.
19022
19023 2005-06-13 Michal Moskal <malekith@nemerle.org>
19024
19025         * icall.c: Make GetCorrespondingMethod/Constructor take
19026         MonoReflectionMethod method not MonoMethod. Removed
19027         MonoType.GetCorrespondingField, and make
19028         MonoGenericType.GetCorrespondingField take name not
19029         MonoClassField.
19030
19031 2005-06-13  Michal Moskal <malekith@nemerle.org>
19032
19033         * reflection.c (field_encode_signature, encode_locals):
19034          Make sizes of buffers for types larger (for big generic types).
19035          (create_generic_typespec,
19036          mono_reflection_sighelper_get_signature_local,
19037          mono_reflection_sighelper_get_signature_field):
19038          Add asserts for too small buffers.
19039
19040 2005-06-15  Martin Baulig  <martin@ximian.com>
19041
19042         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
19043         if our parent is not a dynamic type.
19044
19045 2005-06-15  Martin Baulig  <martin@ximian.com>
19046
19047         * class-internals.h (MonoTypeNameFormat): New enum.
19048
19049         * class.c
19050         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
19051         (mono_type_get_full_name): Removed.
19052         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
19053         argument instead of the boolean's.
19054
19055         * icall.c (ves_icall_System_MonoType_getFullName):
19056         Added `gboolean assembly_qualified'.    
19057
19058         * reflection.h
19059         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
19060
19061         * reflection.c (mono_reflection_parse_type): Parse the new type
19062         name format.
19063
19064 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19065
19066         * icall.c: no need to convert from utf16 to utf8 and then back again
19067         after the call to GetLogicalDrives.
19068
19069 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19070
19071         * icall.c: frombase64. Fix problems exposed by new tests.
19072
19073 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19074
19075         * icall.c: added internal calls for converting char [] and strings in
19076         base64 into byte [].
19077
19078 2005-06-10  Martin Baulig  <martin@ximian.com>
19079
19080         * class.c (mono_class_create_generic_2): Read the nested classes
19081         from the metadata rather than from `gklass->nested_classes' since
19082         `gklass' might not be initialized yet.
19083
19084 2005-06-09  Duncan Mak  <duncan@novell.com>
19085
19086         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
19087         all public headers. Fixes #74919.
19088
19089 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
19090
19091         * domain.c: The key for proxy_vtable_hash is now a pointer
19092         array. Added new GHashFunc and GCompareFunc functions for this.
19093
19094         * class.h: The list of interfaces in MonoRemoteClass is known in
19095         advance and can't grow (we create a new MonoRemoteClass if needed),
19096         so now the interface array can be allocated together with
19097         MonoRemoteClass.
19098         
19099         * object.c: Added a new method create_remote_class_key.
19100         Fixed mono_remote_class so it does not depend on
19101         mono_upgrade_remote_class.
19102         Removed extend_interface_array.
19103         Added new method clone_remote_class(), which makes a copy of a remote
19104         class and adds a new interface or class to it.
19105         mono_upgrade_remote_class() now creates a new remote class (or gets
19106         it from the cache) if an vtable upgrade is needed. In this way
19107         we make sure that other objects sharing the same remote class
19108         don't get the new vtable with unwanted interfaces.
19109         
19110         * object-internals.h:
19111         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
19112         
19113         * marshal.c: Track changes in mono_upgrade_remote_class().
19114
19115 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
19116         * icall.c: Add runtime methods for obtaining members of inflated
19117         class, which were created from supplied non-inflated members. It
19118         is used in internal Get{Method,Constructor,Field} methods in
19119         System.Type
19120
19121 2005-06-09  Martin Baulig  <martin@ximian.com>
19122
19123         * reflection.c
19124         (mono_reflection_bind_generic_method_parameters): Fix #75169.
19125
19126 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19127         * reflection.c (mono_image_basic_init): Define
19128         Version in MonoDynamicAssembly. 
19129         
19130 2005-06-08  Martin Baulig  <martin@ximian.com>
19131
19132         Fix #75136.
19133
19134         * loader.c
19135         (mono_method_signature_full): New public method; takes a
19136         `MonoGenericContext *'.
19137         (find_method): Use mono_method_signature_full() and pass the
19138         klass'es context to it.
19139
19140         * class.c (mono_class_is_inflated_method): Use
19141         mono_method_signature_full() and pass the context to it.
19142
19143 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
19144
19145         * object.c: add proper locking in mono_remote_class_vtable(),
19146         fixes possible memory corruption.
19147
19148 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
19149
19150         * marshal.c (mono_remoting_marshal_init): set
19151         initialized after initialization.
19152
19153 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
19154
19155         * locales.c : hush.
19156
19157 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
19158
19159         * object.c (extend_interface_array): fix really silly
19160         memory corrupting / comparison bug.
19161
19162 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19163
19164         * reflection.c: Functions added to support the creation
19165         of CustomAttributeData, which includes Attribute data
19166         used by ReflectionOnly methods.
19167
19168         * reflection.h:  mono_reflection_get_custom_attrs_data and
19169          mono_custom_attrs_data_construct added (functions exposed).
19170
19171          * icall.c: Added mono_reflection_get_custom_attrs_data
19172          as icall.
19173         
19174 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
19175
19176         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
19177         lupus's request.
19178
19179 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
19180
19181         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
19182
19183         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
19184         dynamic DllImportAttribute.
19185
19186         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
19187         dynamic DllImportAttribute.
19188
19189         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
19190         Fixes #75162.
19191
19192 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19193
19194         * threads.c: avoid segfault when an unstarted thread is aborted.
19195
19196 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
19197
19198         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
19199         Returns the name and version of the runtime for reporting.
19200
19201 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19202
19203         * appdomain.c: bump corlib version.
19204         * object-internals.h: new field in MonoReflectionAssembly.
19205
19206 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19207
19208         * object-internals.h: Carlos forgot to add this field.
19209
19210 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19211
19212         * icall.c: Added create_version to create instances
19213         of Version of MonoReflectionAssemblyName. This change helps
19214         the AssemblyName tests to keep running fine.
19215         
19216 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
19217   
19218         * object.c (mono_method_return_message_restore): A somehow less
19219         intrusive fix for #75138.
19220
19221 2005-06-03  Raja R Harinath  <rharinath@novell.com>
19222
19223         * object.c (mono_method_return_message_restore): Fix computation
19224         of expected number of out args.
19225
19226 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
19227
19228         * reflection.c (mono_image_get_method_info): Fix the case when the
19229         charset is empty.
19230
19231 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
19232
19233         * object.c: Added missing null check in
19234           mono_method_return_message_restore.
19235
19236 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
19237
19238         * reflection.c (mono_image_get_method_info): Handle the case when
19239         dllentry is empty.
19240
19241 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
19242
19243         * object.c: When creating the vtable for a proxy, take into account
19244         all inherited interfaces, not only the ones registered in
19245         iclass->interfaces. This fixs bug #74996.
19246         Also, in mono_method_return_message_restore, verify that the array
19247         of out args has the expected lengh.
19248
19249 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19250
19251         * socket-io.c: update the timeout in Poll when the call is interrupte.
19252
19253 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19254
19255         * socket-io.c: support abort/suspend in Select_internal after last
19256         change.
19257
19258 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19259
19260         * threadpool.c: remove warning.
19261
19262 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19263
19264         * icall.c:
19265         * socket-io.[ch]: Select_internal uses poll() now when available, thus
19266         removing the 1024 limit from select(). Runtime part of the fix for
19267         bug #71203.
19268
19269 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19270
19271         * socket-io.c: when resolving the addresses for the same
19272         host returned by gethostname(), get the local IPs from the interface
19273         list. Loopback addresses are discarded if the are interfaces up with
19274         non-loopback ones. Fixes bug #63265.
19275
19276 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
19277
19278         * appdomain.c, verify.c, object-internals.h, reflection.c:
19279         bumped corlib number to 36, and added new extra_flags field
19280         to ReflectionMethodBuilder and friends.  Fixes #75060.
19281
19282 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
19283
19284         * gc.c: register a new weak link only if the object is non-null
19285         (fixes bug#75047).
19286
19287 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19288
19289         * culture-info.h : short time pattern too.
19290
19291 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
19292
19293         * culture-info.h : expand long time pattern string length.
19294
19295 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19296
19297         * culture-info-table.h : update (more French date format; #72788).
19298
19299 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
19300
19301         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
19302         the method is static. Fixes #75029.
19303
19304 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
19305
19306         * reflection.c: Update the table_idx field of method builders after
19307         saving the module, since it can change. This is a workaround for
19308         bug #74914. 
19309
19310 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
19311
19312         * culture-info-table.h : update (additional French date format).
19313
19314 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
19315
19316         * icall.c (ves_icall_type_Equals): Revert last change.
19317         
19318         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
19319
19320         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
19321
19322 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
19323
19324         * class-internals.h: Added executioncontext_class field to 
19325         MonoDefaults structure.
19326         * domain.c: Cache System.Threading.ExecutionContext class in 
19327         mono_defaults.
19328         * object.c: Capture the ExecutionContext for asynchroneous calls in
19329          mono_async_result_new.
19330         * object-internals.h: Added execution_context and original_context 
19331         fields to MonoAsyncResult. Added execution_context to MonoThread.
19332         * security-manager.c|.h: Added mono_get_context_capture_method to 
19333         return the capture method (if required by the security manager or by
19334         the framework version used).
19335         * threadpool.c: Apply capture (if present) ExecutionContext in 
19336         mono_async_invoke and revert to original context after it completes.
19337
19338 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
19339
19340         * culture-info-table.h : updated (real hacky solution for zh-CHT).
19341
19342 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
19343
19344         * culture-info-table.h : zh-CHT related workaround.
19345
19346 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
19347
19348         * marshal.c (emit_marshal_custom): Add some error checking and call the
19349         methods in the ICustomMarshaler interface. Fixes #74875.
19350         
19351         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
19352         native->managed wrappers.
19353
19354 2005-05-12  Martin Baulig  <martin@ximian.com>
19355
19356         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
19357         here and use the loader lock.
19358
19359         * mono-debug.c: Properly lock when the debugger is not attached.
19360         (mono_debug_init): Release the initial lock if we're not running
19361         in the debugger.
19362
19363 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
19364
19365         * marshal.c (emit_marshal_custom): Pass through NULL values without
19366         calling the custom marshalling routines.
19367
19368         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
19369         conversion in structures. Fixes #74882.
19370
19371 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
19372
19373         * culture-info-table.h : zh-* cultures were missing.
19374
19375 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
19376
19377         * threads.c: Added a new event background_change_event which is signaled
19378         when a thread changes its background mode.
19379         Moved here several checks previously done in managed code. The checks
19380         require the thread lock, and using the thread lock in managed code
19381         can result in deadlocks.
19382         Merged Start_internal and Thread_internal into a single method. Now 
19383         Thread_internal does all work of creating and starting a thread.
19384         Added icalls for setting and getting the state of the object. Moved from
19385         managed code to avoid locking there.
19386         Added wait_for_tids_or_state_change() which is called instad of
19387         wait_for_tids when waiting for non-backround threads to end. This method
19388         will return if one of the threads ends or the background_change_event
19389         is signaled.
19390         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
19391         the background mode. This method signals the background_change_event
19392         event.
19393         * icall.c:
19394         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
19395         removed Start_internal.
19396         
19397 2005-05-11  Martin Baulig  <martin@ximian.com>
19398
19399         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
19400         to order of some fields to get proper alignment on 64-bit machines.
19401
19402 2005-05-11  Martin Baulig  <martin@ximian.com>
19403
19404         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
19405         changes as they're broken and completely fuck up the debugger.
19406
19407         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
19408
19409 2005-05-10  Martin Baulig  <martin@ximian.com>
19410
19411         * reflection.c (mono_reflection_generic_class_initialize): Don't
19412         call mono_class_setup_parent() here.
19413
19414 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19415
19416         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
19417         send/receive timeout use an integer in milliseconds. We were using a
19418         struct timeval.
19419
19420 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19421
19422         * locales.c:
19423         (internal_get_cultures): reserve the first slot of the array for the
19424         InvariantCulture, which will be filled in managed code.
19425
19426 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
19427
19428         * reflection.c (mono_image_fill_module_table): Initialize the
19429         GENERATION field as well.
19430
19431 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19432
19433         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
19434         Monitor.Enter on the object.
19435
19436 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
19437
19438         * threads.c: Enable the wait for running threads when exiting.
19439         * icall.c: Suspend all threads before exiting.
19440
19441 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
19442
19443         * assembly.c (mono_assembly_load_reference): Fix warning.
19444
19445 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19446
19447         * threadpool.c: changed the default number of threads per cpu. From now
19448         on, the default will be 20 + (5 * number of cpus) instead of 50.
19449
19450 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
19451
19452         * loader.c (mono_method_get_signature_full): Add locking here.
19453
19454 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
19455
19456         * appdomain.c: Moved methods for parsing and freeing assembly
19457         names to assembly.c.
19458         * assembly.c, domain-internals.h: Created public methods for parsing
19459         assembly names. Fixed mono_assembly_load_with_partial_name:
19460         it now finds the best match, taking into account the version,
19461         token and culture specified in the partial name. Also return
19462         the latest version if no version information is specified.
19463
19464 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
19465
19466         * threadpool.c: replace check for SocketAsyncCall class.
19467
19468 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19469
19470         * threadpool-internals.h:
19471         * Makefile.am: added threadpool-internals.h
19472
19473         * threadpool.c: call mono_unhandled_exception on exceptions not handled
19474         that happen in threadpool threads (tested on MS).
19475         (mono_thread_pool_remove_socket): new function that dispatch any pending
19476         AIO call on a socket that is closing. By now only epoll really needs it,
19477         as select/poll wake up when the socket closes.
19478
19479
19480         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
19481
19482 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
19483
19484         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
19485
19486 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
19487
19488         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
19489
19490 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
19491
19492         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
19493         has an abort request, convert it into a suspend request.
19494
19495 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
19496
19497         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
19498         warning for the usage of `UnmanagedFunctionPointerAttribute' which
19499         is not supported yet.
19500
19501 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19502
19503         * image.c: register assemblies loaded from data (bundles) in the loaded
19504         assemblies hash. Fixes bug #74772.
19505
19506 2005-04-29  Martin Baulig  <martin@ximian.com>
19507
19508         * class.c (mono_type_get_name_recurse): Update to the new naming
19509         schema from the latest .NET 2.x beta2.
19510         (mono_class_setup_vtable_general): If we're a generic instance,
19511         copy the vtable from our generic type definition and inflate all
19512         the methods in it.
19513
19514         * loader.c (find_method): Update to the new naming schema from the
19515         latest .NET 2.x beta2.
19516
19517 2005-04-29  Raja R Harinath  <harinath@gmail.com>
19518
19519         * class.c (mono_class_init): Add a mono_loader_unlock to the
19520         #74734 fix.
19521
19522 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
19523
19524         * icall.c (ves_icall_System_Environment_Exit): Remove the 
19525         suspend_all_other_threads () call for the time being, since it can hang.
19526
19527         * threads.c (mono_thread_manage): Similarly, disable the waiting for
19528         the background threads to exit, since it can also hang.
19529
19530         * class.c (mono_class_init): Applied patch from Ankit Jain 
19531         (radical@gmail.com). Avoid pending init errors when a field refers
19532         to a nested class using a typeref. Fixes #74734.
19533
19534         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
19535         this for dynamic modules.
19536
19537 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19538
19539         * threads.c: don't wait for threads that are in the process of aborting
19540         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
19541         and waiting for background threads to finish. This makes xsp and
19542         mod-mono-server exit without random length delays and/or hangs.
19543
19544 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19545
19546         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
19547
19548 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
19549
19550         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
19551         dynamic types to prevent infinite loops. Fixes #74727.
19552
19553         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
19554         ..._is_assignable_to.
19555
19556 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
19557
19558         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
19559
19560 2005-04-25  Martin Baulig  <martin@ximian.com>
19561
19562         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
19563
19564         * domain.c
19565         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
19566
19567         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
19568
19569         * reflection.c (build_compressed_metadata): Set metadata header
19570         version to 2.0.
19571
19572 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
19573
19574         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
19575         number into an integral and a decimal part. Fixes #70473.
19576
19577         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
19578
19579 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
19580
19581         * culture-info-table.h : reflected the latest locale-builder output.
19582
19583 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19584
19585         * threadpool.c: check for SuspendRequested too when deciding if
19586         mono_thread_interruption_checkpoint should be called.
19587
19588 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19589
19590         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
19591         * threads.c: remove interruption_mutex and use Interlocked instead. When
19592         suspending all the threads, wait for all the suspended events at once.
19593         If we're shutting down and get an APC that is going to be queued,
19594         call mono_thread_execute_interruption immediately, as the thread might
19595         be sleeping on a pthread condition or mutex.
19596
19597         * icall.c: call mono_runtime_set_shutting_down before suspending the
19598         threads.
19599
19600         Fixes bug #74693. And now xsp is happier when exiting.
19601
19602 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
19603
19604         * loader.c (mono_stack_walk): Fix #74690.
19605
19606 2005-04-22  Martin Baulig  <martin@ximian.com>
19607
19608         * mono-debug.h (MonoDebugMethodJitInfo): Added
19609         `MonoDebugMethodJitInfo *jit'.
19610
19611         * mono-debug.c (mono_debug_read_method): Cache the
19612         MonoDebugMethodJitInfo in `address->jit'.
19613         (mono_debug_free_method_jit_info): New public method.
19614
19615 2005-04-22  Martin Baulig  <martin@ximian.com>
19616
19617         * class.c (mono_class_is_assignable_from): Disallow
19618         type parameter -> interface.
19619
19620 2005-04-21  Dick Porter  <dick@ximian.com>
19621
19622         * threads.c (mono_thread_create): Turn an assertion into an error.
19623
19624 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
19625
19626         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
19627         
19628         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
19629         Fix some gcc 4.0 warnings.
19630
19631 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
19632
19633         * file-io.c: fix alt dir separator char on unix systems
19634         and cleanup (fixes bug #71214).
19635
19636 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
19637
19638         * marshal.c: Use CALLVIRT instead of CALL when dispatching
19639         a call to a remote domain, since the method may be an
19640         interface method in the client domain. This fixes bug #74192.
19641
19642 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19643
19644         * threadpool.c: recv/send are now performed before going back to managed
19645         code to save one transition.
19646
19647 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19648
19649         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
19650
19651         * metadata/threadpool.c: removed hack to workaround the bug above.
19652
19653         Fixes bug #74618.
19654
19655 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
19656
19657         * reflection.c reflection.h: Fix handling of parameter defaults in
19658         dynamic methods. Also fixes handling of parameter attributes.
19659         Fixes #74609.
19660
19661         * mono-debug.c (mono_debug_close_image): Fix warning.
19662
19663 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19664
19665         * socket-io.h: replaced old unused field with new 'blocking'.
19666         * threadpool.c: restore socket blocking state on windows(tm).
19667
19668 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
19669
19670         * icall.c: don't return the codebase in the AssemblyName[] returned by
19671         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
19672         * object-internals.h: Removed FIXME (fields were presents) and fixed
19673         versioncompat declaration.
19674
19675 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19676
19677         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
19678         not closed, so don't cleanup when it happens.
19679
19680 2005-04-13  Chris Toshok  <toshok@ximian.com>
19681
19682         * mono-debug-debugger.h: change prototype for
19683         mono_debugger_lookup_type.
19684
19685         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
19686         this function, although it should probably be named
19687         mono_debugger_init_type.
19688
19689 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19690
19691         * threadpool.c: fix non-AIO case.
19692
19693 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
19694
19695         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
19696         the built-in profiler to measure just JIT compilation times.
19697
19698 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19699
19700         * threadpool.c: the epollfd might be closed by another thread at
19701         any time, so ignore EBADF at treat it as a "we're closing" sign.
19702
19703 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19704
19705         * threadpool.c: release the semaphores with a count equals to the number
19706         of working threads in both IO and regular pools. Fixed typo that messed
19707         up the count of IO pool threads. Don't initialize the pipe handles if
19708         we're using epoll.
19709
19710 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19711
19712         * threadpool.c: some systems don't like a NULL when deleting the socket
19713         from epoll.
19714
19715 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19716
19717         * threadpool.c: fix semaphore allocation.
19718
19719 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19720
19721         * threadpool.c: added epoll() based implementation for asynchronous IO
19722         that is used instead of the default poll() when available.
19723         It can be disabled by setting MONO_DISABLE_AIO.
19724
19725 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19726
19727         * threadpool.c: windows needs 'closesocket' and instead of returning
19728         0 when the stream is closed while in select, it returns -1. Fixes bug
19729         #74573.
19730
19731 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
19732
19733         * class.c (class_compute_field_layout): Fix the regression caused by
19734         the previous try.
19735
19736 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19737
19738         * threadpool.c: separate pool for socket async. IO.
19739         * threadpool.h: mono_max_worker_threads is not a global any more.
19740
19741 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
19742
19743         * class.c (class_compute_field_layout): Fix #74549.
19744
19745 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19746
19747         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
19748         use 2 connected sockets instead.
19749
19750 2005-04-08  Miguel de Icaza  <miguel@novell.com>
19751
19752         * mono-config.c: Add new entry point for mkbundle
19753         mono_config_parse_memory. 
19754
19755 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19756
19757         * threadpool.c: removed another unused function.
19758
19759 2005-04-08  Ankit Jain  <radical@corewars.org>
19760
19761         * reflection.c (get_default_param_value_blobs): Add 'types'
19762         parameter to get the types encoded in the constant table.
19763         (mono_param_get_objects): Use the type from the constant table,
19764         not the type of the parameter, when creating default values.
19765         Handle null default values correctly.
19766
19767 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19768
19769         * file-io.c:
19770         * file-io.h:
19771         * threadpool.c:
19772         * threadpool.h:
19773         * icall.c:
19774         * socket-io.c: removed dead code for async IO.
19775
19776 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19777
19778         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
19779
19780         * threadpool.c: intercept socket async. calls and pass them to a thread
19781         that is polling and dispatching the job items to the threadpool as
19782         socket become ready. Fixes bugs #71217, #71933.
19783
19784         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
19785         between char and short/ushort arrays.
19786
19787         * socket-io.c: remove dead code.
19788
19789 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
19790
19791         * locales.c,
19792           icall.c : removed InternalToUpper_Comp() and
19793           InternalToLower_Comp().
19794
19795 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
19796
19797         * char-conversions.h : The tables were incorrectly generated. Should
19798           be generated against invariant culture.
19799
19800 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
19801
19802         * object.c (mono_runtime_invoke_array): Fix return value when 
19803         passing pre-created valuetype objects to ctors.
19804
19805         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
19806         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
19807         Fixes #74338.
19808
19809 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
19810
19811         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
19812         only used with --security and hides the wrong corlib version error.
19813
19814 2005-03-30  Joshua Tauberer  <tauberer@for.net>
19815
19816         * class.c: Changed mono_class_name_from_token so that types
19817         outside of a namespace don't have an initial period.  Improved
19818         the g_warning message used in _mono_class_get when loading
19819         fails.
19820         * assembly.c: In mono_assembly_load_reference, when an assembly
19821         can't be found, "No such file or directory" is misleading and
19822         unhelpful because a few paths were checked for the presence of
19823         the assembly.  When that happens (ENOENT), display a nicer
19824         message indicating the directories that were searched.  In all
19825         cases, the warning is made easier to read for non-hackers.
19826
19827 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
19828
19829         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
19830         project/solution.
19831         * appdomain.h|domain.c: Removed inline from functions.
19832         * appdomain.c: Reduced warnings when compiling on windows.
19833         * icall.c: Fixed output_debug declaration to gunichar2*.
19834         * mono-config.c: Reduced warnings when compiling on windows.
19835         * rand.c: Added missing "windows.h". Added missing return value.
19836         * rawbuffer.c: Added missing winsock2.h for windows.
19837         * sysmath.h: Added mono-compiler.h header to allow/ease 
19838         compilation with non-GCC compilers.
19839         * threads.c: Fixed declarations to compile with VS.NET C compiler.
19840         Removed cast warnings.
19841
19842         Adapted from the work of J Lothian (for VC6).
19843
19844 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
19845
19846         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
19847         from default_path.
19848
19849 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
19850
19851         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
19852         the 2.0 profile.
19853
19854 2005-03-27  Raja R Harinath  <harinath@gmail.com>
19855
19856         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
19857         has to be in $(exec_prefix).  $(prefix) is for arch-independent
19858         stuff, and it would probably use $(prefix)/share rather than
19859         $(prefix)/lib.
19860
19861 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19862
19863         * console-io.c: added 2 includes that might be missing.
19864
19865 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
19866
19867         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
19868         profile.
19869
19870         * reflection.c (create_custom_attr): Allocate the params array using
19871         alloca so it gets GC tracking.
19872
19873 2005-03-23  Chris Toshok  <toshok@ximian.com>
19874
19875         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
19876         out some spew.
19877
19878 2005-03-24  Raja R Harinath  <rharinath@novell.com>
19879
19880         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
19881         changes to pick up any changes in prefix, etc.
19882
19883 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
19884
19885         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
19886         
19887         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
19888         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
19889
19890 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
19891
19892         * class-internals.h object-internals.h class.c reflection.c: Extend the
19893         mono_lookup_dynamic_token () function to return the class of the
19894         token as well. 
19895
19896         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
19897         well. Fixes #73848.
19898
19899 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
19900
19901         * security-manager.c: Skip inheritance checks for intra-corlib
19902         class inheritance and method overrides. This skips a lot of checks
19903         and (anyway) permissions cannot work until corlib is loaded.
19904
19905 2005-03-23  Martin Baulig  <martin@ximian.com>
19906
19907         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
19908         MONO_TYPE_GENERICINST.  
19909
19910 2005-03-23  Martin Baulig  <martin@ximian.com>
19911
19912         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
19913
19914 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
19915
19916         * class.c: added locking comments to some functions.
19917         Cache the interface offsets arrays (saves about 20 KB
19918         of runtime memory in a typical app).
19919         Reduce the time overhead in mono_class_setup_supertypes ().
19920
19921 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
19922
19923         * icall.c: speedup and fix leaks in GetMethodsByName and
19924         GetPropertiesByName.
19925
19926 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
19927
19928         * reflection.c: some locking fixes.
19929
19930 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
19931
19932         * metadata.c: added missing break in case statement.
19933
19934 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
19935
19936         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
19937         typedbyref return values. Fixes #73941.
19938
19939 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
19940
19941         * security-manager.c|h: Added demandunmanaged method and 
19942         suppressunmanagedcodesecurity class to MonoSecurityManager.
19943         Renamed aptc class to allowpartiallytrustedcallers.
19944
19945 2005-03-17  Martin Baulig  <martin@ximian.com>
19946
19947         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
19948
19949 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19950
19951         * file-io.c: disabled file async. IO using aio_*. It uses the
19952         threadpool now. Workaround for bug #73718.
19953
19954 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
19955
19956         * assembly.h, mono-config.c: added code to deal with bundled configs
19957         for bundled assemblies.
19958
19959 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
19960
19961         * *.c, private.h: cleanup, removing old private.h header file.
19962
19963 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
19964
19965         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
19966         and throw_on_unmappable_char attributes.
19967
19968 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
19969
19970         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
19971         _ProcessName_internal.
19972
19973 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
19974
19975         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
19976         #73631.
19977
19978         * icall.c threads.c threads-types.h: Remove slothash icalls as they
19979         are no longer used.
19980
19981 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
19982
19983         * object.c (compute_class_bitmap): Add support for generics. Fixes
19984         #73527.
19985
19986 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
19987
19988         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
19989
19990 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19991
19992         * filewatcher.c: commented out the code for windows watcher, as we don't
19993         use it (we use the managed implementation instead).
19994
19995 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
19996
19997         * object-internals.h (MonoThread): Remove 'unused1' field.
19998
19999         * appdomain.c: Bump corlib version.
20000
20001         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
20002
20003         * reflection.c (mono_reflection_create_runtime_class): Remove the
20004         AssemblyBuilder.Save optimization since it causes too many problems.
20005
20006 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
20007
20008         * exception.c|h: Added mono_get_exception_reflection_type_load to
20009         create a ReflectionTypeLoadException object.
20010         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
20011         to return NULL is a InheritanceDemand fails during reflection. Updated
20012         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
20013         ReflectionTypeLoadException if an InheritanceDemand fails during 
20014         reflection. Added icall mapping for GetLinkDemandSecurity.
20015         * security-manager.c|h: Added ves_icall_System_Security_
20016         SecurityManager_GetLinkDemandSecurity internal call to return the
20017         class and methods permissions set for a LinkDemand. Removed unused
20018         fields in MonoSecurityManager.
20019
20020 2005-03-10  Martin Baulig  <martin@ximian.com>
20021
20022         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
20023         it's a generic instance.
20024
20025 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
20026
20027         * reflection.c (mono_get_object_from_blob): Applied patch from
20028         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
20029
20030         * class.c (mono_class_is_assignable_from): Another try at fixing 
20031         #73469 without breaking anything.
20032
20033 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
20034
20035         * class.c: (mono_class_is_assignable_from): Revert the last changes
20036         since they don't work with generics.
20037         
20038         * class.c (mono_class_is_assignable_from): Fix build bustage.
20039
20040         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
20041         the managed IsAssignableFrom method. Fixes #73469.
20042
20043         * reflection.c (mono_reflection_call_is_assignable_from): New helper
20044         function.
20045
20046 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
20047
20048         * object.c (mono_load_remote_field_new): Fix returning uninitialized
20049         memory when the remoting callback does not sets the out arguments.
20050         Fixes #73007.
20051
20052         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
20053         by mistake.
20054
20055         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
20056
20057         * object-internals.h (MonoStackFrame): Sync with managed object layout.
20058
20059         * appdomain.c: Bump corlib version.
20060
20061 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
20062
20063         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
20064         function.
20065
20066         * threads.c (mono_thread_attach): Detect threads which are not started
20067         by the GC pthread wrappers.
20068
20069 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
20070
20071         * icall.c: Added new icall for RNG.
20072         * rand.c|h: Added new icall to open the RNG. This allows to share a 
20073         single handle on Linux to access /dev/urandom and fix #73183.
20074
20075 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
20076
20077         * object.c: setting the new vtable in a transparent proxy object must
20078         not change the GC descriptor.
20079
20080 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20081
20082         * object.c: fixed compilation without GCJ support.
20083         * reflection.c: for runtime-created types ensure klass->has_references
20084         is correct (bug #73215).
20085
20086 2005-03-02  Martin Baulig  <martin@ximian.com>
20087
20088         * class.c (mono_class_is_assignable_from): Make this work if
20089         `oklass' is a generic instance; fixes #72831.
20090
20091 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20092
20093         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
20094         with hasthis set.
20095         
20096         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
20097
20098         * marshal.c: Reorganize native->managed marshalling code to also use
20099         the emit_marshal_... functions.
20100
20101 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20102
20103         * object.c: typed allocs have issues with bitmap sizes > 30,
20104         so check for max_set >= 30.
20105
20106 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
20107
20108         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
20109         managed code. Fixes #73012.
20110
20111         * metadata.h (MonoMarshalSpec): Add elem_mult field.
20112
20113         * metadata.c reflection.c: Load/Emit elem_mult as well.
20114         
20115         * metadata.h (MonoMarshalSpec): Add comment.
20116
20117         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
20118
20119         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
20120         num_elem to -1 if not given.
20121
20122         * object-internals.h (MonoReflectionMarshal): Add has_size field.
20123
20124         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
20125         given values.
20126
20127 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
20128
20129         * null-gc.c (mono_gc_free_fixed): Was not compilable.
20130
20131 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
20132
20133         * reflection.c (encode_marshal_blob): Encode param_num field as well.
20134
20135         * object-internals.h (MonoReflectionMarshal): Add param_num field.
20136
20137 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
20138
20139         * object.c: generalized the reference bitmap creation
20140         and added hooks for the new GC.
20141         * class-internals.c: removed the gc_bitmap field from MonoClass.
20142
20143 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
20144
20145         * domain.c: help the compiler to produce better code
20146         in mono_jit_info_table_find ().
20147
20148 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
20149
20150         * object.c: make all allocations look typed.
20151
20152 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
20153
20154         * socket-io.c: load Mono.Posix if it's not loaded already
20155         (fixes bug#73033).
20156
20157 2005-02-24  Martin Baulig  <martin@ximian.com>
20158
20159         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
20160         * reflection.c (dup_type): Likewise.
20161
20162 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
20163
20164         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
20165         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
20166
20167 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
20168
20169         * domain.c, threads.c, object-internals.h: make the critical thread
20170         local vars use the fast access mode (even when we're compiled in
20171         a lib). Provide accessors to be used by the jit during codegen.
20172
20173 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20174
20175         * appdomain.c: Changed hook functios behavior to include
20176         support for the reflection only assemblies. Some icalls were changed
20177         to support the mentioned assemblies too. Signatures of static methods
20178         try_assembly_resolve and real_load now have an additional parameter:
20179         refonly.
20180
20181         * assembly.c: General changes to mono_assembly_ methods to support
20182         reflection only api. Functions mono_assembly_open, mono_assembly_load,
20183         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
20184         suffix, to support an additional gbool parameter to specify whether
20185         the assembli is reflection only or not. Created some new hook functions 
20186         to add support for reflection only assemblies. Signatures of static 
20187         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
20188         have now an additional parameter: refonly.
20189
20190         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
20191         indicating whether the assembly is reflection only or not.
20192
20193         * exception.c: Add mono_get_exception_invalid_operation.
20194
20195         * icall.c: Throw an InvalidOperationException when trying to invoke
20196         a property/method/event, or trying to set/get the value of a field.
20197         Also add an icall to retrieve the ref_only flag to the
20198         MonoReflectionAssembly.
20199
20200 2005-02-23  Chris Toshok  <toshok@ximian.com>
20201
20202         Part of fix for #72827.
20203         * mono-debug.c (mono_debug_add_method): add lexical block data to
20204         the info we write.  Kind of a hack at the moment - we copy the
20205         lexical block info from the MonoDebugMethodInfo to the
20206         MonoDebugMethodJitInfo here, before writing it.
20207         (mono_debug_read_method): read the lexical block info.
20208
20209         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
20210
20211         * debug-mono-symfile.h: add lexical block support.
20212
20213         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
20214         support.
20215
20216 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
20217
20218         * loader.c (mono_lookup_pinvoke_call): Fix warning.
20219
20220         * object.c (mono_runtime_free_method): Call mono_free_method () and
20221         put the TODOs there.
20222
20223         * loader.c (mono_free_method): Free up most memory allocated for 
20224         dynamic methods.
20225
20226 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
20227
20228         * reflection.c: properly flag a Type argument to a
20229         named custom attr value (bug #72248).
20230
20231 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
20232
20233         * reflection.c: reduce code duplication in named custom
20234         attribute encoding.
20235
20236 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
20237
20238         * reflection.c: properly encode custom attrs of type object
20239         (bug #72649).
20240
20241 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
20242
20243         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
20244
20245 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
20246
20247         * socket-io.c: load System.dll if it's not loaded already
20248         (bug #72850 and #70477).
20249
20250 2005-02-21  Martin Baulig  <martin@ximian.com>
20251
20252         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
20253         generic instances.
20254
20255 2005-02-21  Martin Baulig  <martin@ximian.com>
20256
20257         * reflection.c (mono_image_build_metadata): We also need to
20258         "fixup" the MethodImpl table after we computed the final method
20259         indices.  Call fixup_methodimpl() to do that.
20260         (fixup_methodimpl): New private method.
20261
20262 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
20263
20264         * assembly.c: special case mscorlib.dll (bug#72536),
20265         patch from Carlos Alberto Cortez.
20266
20267 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
20268
20269         * threads-types.h threads.c: Fix build bustage.
20270
20271         * threads.c: Use a union for long<->double conversions.
20272
20273         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
20274         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
20275
20276         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
20277         containing the checkpoint call with NOT_TAKEN.
20278         
20279         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
20280         checkpoint before pushing the arguments, so they won't have to be
20281         spilled to stack.
20282
20283 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20284
20285         * domain.c, assembly.c, domain-internals.h: make some data
20286         const and relocation-free.
20287
20288 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
20289
20290         * object.c, appdomain.c, class-internals.h: introduce the
20291         MonoClassRuntimeInfo structure to hold the info needed to
20292         use a class at runtime. Made mono_class_vtable() lock-free
20293         for all the appdomains.
20294
20295 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
20296
20297         * metadata-internals.h, image.c: introduce a per-image mempool to
20298         be used for memory that has the same lifetime as the image.
20299
20300 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
20301
20302         * domain.c: In mono_init_internal(), instead of selecting the first
20303         runtime version supported by an executable, get a list of all
20304         supported versions and select the one for which an mscorlib exists
20305         (since even if the runtime supports a given version, it doesn't mean
20306         that the framework for that version is installed).
20307         Modified get_runtimes_from_exe to support this behavior.
20308         In supported_runtimes, added information about additional system
20309         assembly versions.
20310         
20311         * assembly.c: Added support for more than one system assembly version
20312         per runtime version. Updated the assembly list.
20313         In mono_assembly_remap_version, removed the initial version check,
20314         since we don't know to which version we need to compare until we
20315         get the version set on which the assembly is based.
20316         Moved the code for loading corlib into the new method
20317         mono_assembly_load_corlib(), so it can be used by the initialization
20318         code.
20319         
20320         * domain-internals.h: Updated data structures and added declaration
20321         for mono_assembly_load_corlib.
20322
20323 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
20324
20325         * reflection.c (resolve_object): Fix the creation of the signature in 
20326         the SignatureHelper case.
20327
20328         * assembly.c (mono_assembly_remap_version): Fix binary search.
20329         
20330 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
20331  
20332         * class.c: Added inheritance check when a method is overloaded (from a
20333         virtual method or when implementing an interface) and when a class is
20334         inherited. Added functions to set a failure for a class and to 
20335         retreive the exception from a failure.
20336         * class-internals.h: Added fields to MonoClass to keep the exception
20337         information status for inheritance (or other exceptions) to be thrown
20338         later (i.e. not at load time).
20339         * object.c: Throw the inheritance SecurityException when a type is to 
20340         be created with either class or method inheritance violations.
20341         * reflection.c|h: Fix when getting declsec from a class. Removed 
20342         unrequired code for class. Improved sanity in parameter naming.
20343         * security-manager.c|h: Added functions to check for class and method
20344         inheritance.
20345
20346 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
20347
20348         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
20349         and has_finalize in dynamic types as well.
20350
20351 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
20352
20353         * culture-info-table.h : fixed currency format for en-GB (and so on).
20354
20355 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
20356
20357         * gc.c: ensure the GC handles never have 0 as a value.
20358
20359 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
20360
20361         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
20362         a pointer to a struct to unmanaged code. Fixes #72625.
20363
20364 2005-02-16  Martin Baulig  <martin@ximian.com>
20365
20366         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
20367
20368 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
20369
20370         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
20371
20372 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
20373
20374         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
20375
20376         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
20377         UnmanagedFunctionPointerAttribute, use it for determining calling convention
20378         etc. Fixes #71471.
20379
20380         * reflection.c (mono_custom_attrs_get_attr): New helper function.
20381
20382         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
20383
20384 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
20385
20386         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
20387         changes to make the current context a field in MonoThread.
20388
20389 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
20390
20391         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
20392         the last change.
20393         
20394         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
20395         extracted from mono_marshal_get_native_wrapper.
20396
20397         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
20398         to create wrappers around native functions.
20399
20400         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
20401         delegates for arbitrary function pointers. Fixes #71472.
20402
20403 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
20404
20405         * threads.c: cleaned up the code a little.
20406
20407 2005-02-15  Martin Baulig  <martin@ximian.com>
20408
20409         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
20410         the data table.
20411
20412         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
20413         allocate larger chunks if needed.
20414
20415 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
20416
20417         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
20418         in by mistake.
20419
20420 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
20421
20422         * domain.c: keep the domains in an array and ensure the domain ids
20423         are kept small, so they can be used as indexes to domain-specific data
20424         with a small memory overhead.
20425
20426 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
20427
20428         * icall.c: Handle byref types in Type icalls. Fixes #72544.
20429
20430 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
20431
20432         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
20433
20434 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
20435
20436         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
20437
20438         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
20439         values.
20440
20441         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
20442         
20443 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
20444
20445         * domain-internals.h: add the hashtable here.
20446
20447         * class-internals.h: Remove `info' from MonoMethod
20448
20449         * domain.c: Add a new hashtable, jit_trampoline_hash
20450
20451 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
20452
20453         * object.c: don't set the value of static fields
20454         (fixes bug#72494).
20455
20456 2005-02-11  Martin Baulig  <martin@ximian.com>
20457
20458         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
20459         (mono_debug_add_method): Silently ignore the method if it's too big.
20460         (mono_debug_add_type): Likewise.
20461
20462 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
20463
20464         * threads.c, appdomain.c: remove #ifdefs from the code.
20465
20466 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
20467
20468         * metadata-internals.h: Added flags to MonoAssembly to cache the most
20469         common security informations. This allows us to stay in unmanaged code
20470         when doing LinkDemand and it's special cases (except for the first 
20471         time for initialization). The flags a very much used with --security.
20472         * reflection.c|h: Added code to get declarative security attributes 
20473         for LinkDemand and InheritanceDemand. This required to refactor the
20474         existing code for Demand.
20475         * security-manager.c|h: Added new method fields for the special cases
20476         of LinkDemand.
20477
20478 2005-02-10  Martin Baulig  <martin@ximian.com>
20479
20480         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
20481         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
20482
20483 2005-02-10  Martin Baulig  <martin@ximian.com>
20484
20485         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
20486         debugging code; this is almost a complete rewrite.
20487
20488         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
20489
20490 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20491
20492         * domain.c, object.h: expose mono_string_equal () and 
20493         mono_string_hash ().
20494         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
20495         it's implemented in managed code.
20496
20497 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20498
20499         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
20500         lo leak objects between appdomains.
20501
20502 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20503
20504         * assembly.c: old compilers compilation fix from 
20505         robertj@gmx.net (Robert Jordan).
20506
20507 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
20508
20509         * class-internals.h: Little reminder for the future.
20510
20511         * debug-helpers.c: Fix up wrapper_type_names
20512
20513 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20514
20515         * image.c, metadata-internals.h: when loading an image from a file,
20516         mmap all of it and use the same codepaths as when using a
20517         in-memory image: the code is simpler and we use less memory
20518         (both writable and readonly).
20519
20520 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
20521
20522         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
20523         API to alloc runtime data structures that need to be tracked by the
20524         GC and contain pointers.
20525         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
20526         make the code more readable and eventually use a different GC.
20527
20528 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
20529
20530         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
20531         for out arguments.
20532         
20533 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
20534
20535         * object.c: In release_type_locks(), don't release the cctor lock
20536         if it has already been released. This fixes a crash in the
20537         thread5 test.
20538
20539 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
20540
20541         * gc.c, marshal.c, icall.c: register a delegate for finalization
20542         only when the native function pointer has been allocated for it.
20543
20544 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
20545
20546         * object.c: cleaned up some code, allocate objects that are
20547         pointer free with the atomic malloc variant. Allocate memory
20548         for static data from the mempool if it's pointer-free.
20549         Allocate the bounds array at the end of the array data, when needed.
20550         * object-internals.h, object.h: move a private function in a private
20551         header.
20552         * class.c: handle missing case in tracking references in fields.
20553
20554 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
20555
20556         * class.c, class-internals.h: keep track if a type has
20557         reference fields in either the instance or static fields.
20558
20559 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
20560
20561         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
20562         and renamed to MonoRuntimeInfo. Added fields to store the expected
20563         framework assembly version. Changed mono_get_framework_version and
20564         mono_get_runtime_version for a single mono_get_runtime_info method.
20565         
20566         * assembly.c: Added method to remap system assembly versions to the
20567         current executing runtime version. Removed old mapping code.
20568         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
20569         
20570         * icall.c, reflection.c: Track api changes.
20571
20572 2005-02-06  Miguel de Icaza  <miguel@novell.com>
20573
20574         * loader.c (method_from_memberref): Improve error reporting,
20575         produce the class name instead of the typeref/typedef index. 
20576
20577 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
20578
20579         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
20580
20581 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20582
20583         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
20584         stdcall and charset name mangling.  Reorganize the code and add
20585         some tracing stuff.
20586
20587 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
20588
20589         * monodiet.c: More iters!
20590
20591         * marshal.c: Iter usage.
20592
20593         * icall.c: Iter usage.
20594
20595         * object.c: Use iters.
20596
20597         * debug-helpers.c: More iters
20598
20599 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20600
20601         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
20602         under win32.
20603
20604 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
20605
20606         * mono-debug-debugger.c: use iters
20607
20608         * class.c, class-internals.h: mono_class_setup_events is static
20609         now
20610
20611         * All callers: use iters
20612
20613 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
20614
20615         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
20616         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
20617
20618 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
20619
20620         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
20621
20622         * marshal.h: Add prototypes for ldfld/stfld_remote.
20623
20624         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
20625         this is called during startup.
20626         
20627 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
20628
20629         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
20630         MonoThreadsSync struct private in monitor.c. Changed the way
20631         MonoThreadsSync is allocated so it's faster and there is no
20632         need to keep track of it with a finalizer and it uses less memory.
20633         This also finally allows us to allocate mono objects as ptrfree when
20634         there are no reference fields.
20635
20636 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
20637
20638         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
20639         disappearing link to the GC interface and use them to simplify
20640         the gchandles code.
20641
20642 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
20643
20644         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
20645         stfld_remote which call mono_load/store_field_new. This allows methods
20646         calling ldfld/stfld wrappers to be AOTed.
20647
20648         * console-io.c: Include sys/filio.h under solaris.
20649         
20650         * console-io.c: Include curses.h if needed correctly.
20651
20652 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
20653         
20654         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
20655         method->klass as well.
20656
20657         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
20658
20659         * class.c (mono_class_init): Switch on lazy initialization of 
20660         methods.
20661
20662         * class.c (mono_class_get_finalizer): Handle the case when the 
20663         finalizer is inherited.
20664
20665 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20666
20667         * console-io.c: <curses.h> is needed by term.h on solaris.
20668
20669 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
20670
20671         * icall.c, class-internals.h, monodiet.c, class.c: Remove
20672         mono_class_setup_properties where possible. Remove this ftn from
20673         the header file, and make it static.
20674
20675 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
20676
20677         * loader.c: Add missing setup_... call.
20678
20679         * class.c: Add missing setup_... calls.
20680
20681         * class.c (mono_class_init): Switch on lazy initialization of 
20682         the generic vtable.
20683         
20684         * class.c (mono_class_init): Fix generics broken by the recent changes.
20685
20686         * monodiet.c (handle_type): Add missing setup_... calls.
20687
20688         * class.c: Back out garbage in previous patch.
20689         
20690         * class.c: Add missing setup_... calls.
20691
20692         * class.c (mono_class_get_method_from_name_flags): Avoid calling
20693         mono_class_setup_methods () if possible.
20694
20695         * class-internals.h (MonoClass): Add 'has_cctor' flag.
20696
20697         * class-internals.h (MonoCachedClassInfo): New structure.
20698
20699         * class.c: Initialize properties and events fields of MonoClass lazily.
20700
20701         * class.c: Add infrastructure for lazily initializing the methods and
20702         vtable fields of MonoClass. Not yet used.
20703
20704         * class.c (mono_class_get_finalizer): New helper function.
20705
20706         * class.c: Add infrastructure for loading some class related data from
20707         an AOT file.
20708
20709         * object.c: Add infrastructure for initializing the vtable from data
20710         in the AOT file.
20711
20712         * gc.c (run_finalize): Use mono_class_get_finalizer ().
20713
20714         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
20715         appropriate initialization function before accessing parts of the
20716         MonoClass structure.
20717
20718         * marshal.c: Fix warnings.
20719         
20720         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
20721
20722         * mono-debug-debugger.c (get_exception_message): Use 
20723         mono_class_get_method_from_name_flags ().
20724
20725 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
20726
20727         * reflection.c, appdomain.c: Replace a few manual searches that
20728         Zoltan missed. (Paolo approved this part of my initial patch).
20729
20730 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
20731
20732         * profiler.c: disable recording statistical events at report time.
20733
20734 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20735
20736         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
20737         to byteswap arrays of enum values, too (bug #72080).
20738
20739 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
20740
20741         * appdomain.c (set_domain_search_path): Allow this to be called if
20742         domain->setup is not yet set.
20743
20744         * loader.c (mono_method_get_index): New helper function.
20745
20746         * loader.c reflection.c: Use mono_method_get_index ().
20747
20748         * class.c (mono_class_get_method_from_name_flags): New helper method.
20749
20750         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
20751         this.
20752
20753         * class.c (mono_class_get_cctor): New helper method.
20754
20755         * string-icalls.c object.c class.c marshal.c reflection.c: Use
20756         mono_class_get_method () to look up methods.
20757
20758 2005-02-01  Miguel de Icaza  <miguel@novell.com>
20759
20760         * console-io.c: Fix the build, this should work on Windows.
20761
20762 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
20763
20764         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
20765         be set to null to keep things valid
20766
20767 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20768
20769         * icall.c: added Console 2.0 icalls.
20770         * Makefile.am: added console-io.[ch]
20771         * console-io.[ch]: internal calls for Console 2.0 API.
20772
20773 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20774
20775         * class.c: make sure we consider all the interfaces
20776         when calculating max_interface_id (bug found by
20777         Jeroen Frijters running ikvm).
20778
20779 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
20780
20781         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
20782         valuetype fields to null.
20783
20784         * object.c (set_value): Ditto. Fixes #71669.    
20785
20786 2005-01-31  Martin Baulig  <martin@ximian.com>
20787
20788         * metadata.c (mono_metadata_has_generic_params): New public
20789         function; checks whether something is a generic method.
20790
20791 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
20792
20793         * appdomain.c: fix infinite recursion when adding assemblies.
20794
20795 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
20796
20797         * object.c: Fix small typo to return all items for Environment.
20798         GetCommandLineArgs.
20799
20800 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
20801
20802         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
20803         reflection.c: more domain and assembly-unload related fixes
20804         and memory leaks plugs.
20805
20806 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
20807
20808         * 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.
20809
20810 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
20811
20812         * loader.c (mono_method_signature): Make this method lazy
20813         (mono_get_method_from_token): Don't computate the signature here.
20814
20815         Doing this saves quite a bit of memory. I got 90 kb on starting up
20816         monodoc. It should also save some disk reads on startup.
20817
20818         * *: MonoMethod->signature might be NULL now. You *MUST* use
20819         mono_method_signature.
20820
20821 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
20822
20823         * object.c (mono_runtime_get_main_args): Return an array from the
20824         current domain here. Fixes #71938.
20825
20826 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
20827
20828         * monitor.c: formatting changes to comply with the
20829         mono coding style and remove #ifdefs from the code.
20830
20831 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20832
20833         * metadata.c, private.h: remove some unneeded data
20834         and use a more compact representation for table schemas.
20835
20836 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
20837
20838         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
20839         to get a better distribution in hash tables.
20840         * *.c: use mono_aligned_addr_hash() where appropriate.
20841         * assembly.c: make var static.
20842
20843 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
20844
20845         * domain-internals.h: Put MonoJitInfo on a diet.
20846
20847         * domain.c: Fix a warning.
20848
20849 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
20850
20851         * gc.c: rework the gc handles code to reuse handles
20852         when freed.
20853
20854 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
20855
20856         * domain.c: fixed long standing bug in mono_string_equal() which
20857         was brought to light with the ldstr changes.
20858
20859 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
20860
20861         * reflection.c: Remove warning by adding missing include for marshal.h
20862
20863 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
20864
20865         * domain.c, object.c: change the ldstr_table to hold
20866         MonoString* as keys: makes the runtime isinterned lookup
20867         faster and simplifies memory management.
20868
20869 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
20870  
20871         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
20872         possible to add imperative security checks before calling the icall.
20873         * reflection.c: Return security attributes on the original MonoMethod
20874         (and not the wrapped one). This fix permissions on icalls.
20875
20876 2005-01-25  Dick Porter  <dick@ximian.com>
20877
20878         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
20879         the check for mktime() support actually test the mktime() return
20880         value.  "Fixes" bug 71682, though the output is still different to
20881         MS.
20882
20883 2005-01-25  Martin Baulig  <martin@ximian.com>
20884
20885         * class.c (mono_class_is_assignable_from): Make this work for
20886         generic instances.
20887
20888 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
20889
20890         * marshal.c (mono_string_utf8_to_builder)
20891         (mono_string_builder_to_utf16): We might not have ownership of the
20892         string. In thise case, we need to create a new buffer.
20893
20894         * object-internals.h (mono_stringbuilder_capacity): sb->str might
20895         be null, in which case, use the default capacity.
20896
20897 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
20898
20899         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
20900         GC events to the profiler.
20901
20902 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
20903
20904         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
20905         if you don't want the GC to run.
20906
20907 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
20908
20909         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
20910         start providing a GC API and keeping different implementations in
20911         their own file.
20912         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
20913
20914 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
20915
20916         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
20917         mmap rather than allocating a huge buffer.
20918         (mono_debug_close_mono_symbol_file): Free the buffer allocated
20919         above.
20920
20921 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
20922
20923         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
20924         and CheckExecutionRights.
20925         * reflection.c|h: Keep the index of the declarative security to be 
20926         used, instead of the pointer, when AOT compiler is used. Also add 
20927         class initialization when requesting demands.
20928         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
20929         CheckExecutionRights. Both properties are now FALSE by default, and
20930         unmodifiable, unless the --security option is used.
20931
20932 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
20933
20934         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
20935         reflection.c: properly refcount images and assemblies, many leaks fixed.
20936
20937 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20938
20939         * threadpool.c: increase the timeout for threads in the thread pool to
20940         10s.  Fixes bug #67159.
20941
20942 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
20943
20944         * class-internals.h: Sun's compiler insists on explicit
20945         signed on bit fields to handle then correctly.
20946
20947 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
20948
20949         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
20950         Make the size of the array fit only the number of invalid path
20951         chars that we have.
20952
20953         * class.c (_mono_class_get): Improve the error reporting when a
20954         class referenced is not found, to assist debugging. 
20955
20956 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
20957
20958         * threads.c: fix off-by-one error.
20959         * domain.c: free data allocated in the domain.
20960
20961 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
20962
20963         * reflection.c (mono_method_body_get_object): Fill out exception info
20964         as well.
20965
20966         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
20967         structure.
20968         
20969 2005-01-19  Martin Baulig  <martin@ximian.com>
20970
20971         * loader.c (mono_get_method_constrained): Make this work again.
20972
20973 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
20974
20975         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
20976         guint16 to match the managed side.
20977
20978         * reflection.c (mono_reflection_body_get_object): Fill out local
20979         variables array.
20980
20981         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
20982         as well.
20983
20984         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
20985         'local_var_sig_token'.
20986
20987 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
20988
20989         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
20990         System.Drawing.
20991
20992         * reflection.c (mono_method_body_get_object): Handle abstract and
20993         runtime methods.
20994
20995 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
20996
20997         * marshal.c, loader.c, class-internals.h, reflection.c:
20998         store the emthod data for a wrapper in an array instead of a list.
20999
21000 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
21001
21002         * marshal.c: change the code to allocate memory more
21003         conservatively for method wrappers.
21004
21005 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
21006
21007         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
21008         fields from MonoClass to the marshal info structure where they belong.
21009
21010 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
21011
21012         * class.c, object.c, class-internals.h, marshal.c: rearrange
21013         some fields and tweak some types to lower memory usage.
21014
21015 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
21016
21017         * threads.c (signal_thread_state_change): Handle the case when the
21018         target thread is the current thread.
21019
21020         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
21021
21022         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
21023         emit_ptr_to_object_conv. 
21024
21025         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
21026         marshalling. Fixes #71352.
21027
21028 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
21029
21030         * metadata.h, blob.h: move table enum to blob.h so it can be included
21031         in any header.
21032         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
21033         cut the size of MonoImage/MonoDynamicImage.
21034
21035 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
21036
21037         * profiler.c (mono_profiler_install_simple): Fix default arguments.
21038
21039 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
21040
21041         * reflection.c, reflection.h, icall.c: add a function to check
21042         if an attribute type is defined for a metadata object.
21043
21044 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
21045
21046         * object-internals.h: Added some needed fields from StringBuilder class.
21047         * marshal.c: Set the maxCapacity when creating a StringBuilder.
21048
21049 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
21050
21051         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
21052         threads before shutting down the runtime.
21053
21054         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
21055
21056 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
21057
21058         * object-internal.h, threads.c: implement stacksize and 
21059         parameterized thread start functionality (requires
21060         matching corlib). Marked broken code for later removal.
21061
21062 2005-01-12  Martin Baulig  <martin@ximian.com>
21063
21064         * class-internals.h (MonoGenericClass): Moved the `initialized'
21065         flag to MonoDynamicGenericClass, removed `init_pending'.
21066         (MonoGenericInst): Added `is_reference' flag.
21067
21068 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
21069
21070         * reflection.c (mono_image_create_pefile): Only set the pe_offset
21071         inside the MSDOS header. Fixes #71201.
21072
21073         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
21074         gc thread.
21075         (mono_domain_finalize): Ditto.
21076
21077 2005-01-12  Martin Baulig  <martin@ximian.com>
21078
21079         * class.c (mono_get_shared_generic_class): Use the cache for
21080         non-dynamic generic classes.
21081
21082         * class-internals.h (mono_class_create_generic_2): Removed
21083         function prototype, this function is now static inside class.c.
21084
21085         * class.c (mono_class_create_generic_2): Made this static, only
21086         call it from mono_class_init() and mono_class_setup_parent().
21087         (collect_implemented_interfaces_aux): Call mono_class_init() on
21088         the interfaces we collect.
21089         (mono_class_setup_vtable): Call mono_class_init (class->parent).
21090
21091 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21092
21093         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
21094         it a real thread handle.
21095
21096         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
21097         MonoJitExceptionInfo, since each catch clause needs its own variable.
21098         
21099 2005-01-11  Dick Porter  <dick@ximian.com>
21100
21101         * image.c (mono_pe_file_open): New variant on mono_image_open()
21102         that does not set up the CLI metadata; used for FileVersionInfo so
21103         it can get the data for windows binaries too.
21104         
21105         * process.c (process_read_string_block): Don't read off the end of
21106         the StringTable block.
21107
21108         These both fix bug 70766.
21109
21110 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
21111
21112         * gc.c: set some fields to NULL at GC cleanup time.
21113         * threads.c: if we quit the main thread, call exit ().
21114
21115 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
21116
21117         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
21118
21119 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
21120
21121         * threads.h, threads.c, object.c: added accessor and settor for
21122         main_thread. Handle it specially when exiting from it: wait
21123         for other foreground threads to exit.
21124
21125 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
21126
21127         * process.c, verify.c: remove some bloat.
21128
21129 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
21130
21131         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
21132         the calling convention to cdecl under win32.
21133
21134 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
21135
21136         * object.c (mono_object_get_size): New function to get the size of
21137         an object instance.
21138
21139         * profiler.c (simple_allocation): Use above.
21140
21141 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
21142
21143         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
21144         ves_icall_System_AppDomain_getRootDomain (as it's not required to
21145         get an appdomain by it's id and we can't assume the root's id is 0).
21146         * domain-internals.h: Change the function prototype to match.
21147         * icall.c: Change the icall table for AppDomain.
21148
21149 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
21150
21151         * locales.c (string_invariant_compare_char): Only compute
21152         GUnicodeTypes in the case where we need them.  Test for ordinality
21153         first and return if so.
21154
21155         From the commit:
21156
21157                 /*
21158                  * FIXME: here we must use the information from c1type and c2type
21159                  * to find out the proper collation, even on the InvariantCulture, the
21160                  * sorting is not done by computing the unicode values, but their
21161                  * actual sort order.
21162                  */
21163
21164 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
21165
21166         * loader.c: for P/Invoke methods, allow the "Internal" shared
21167         library name to refer to the calling process symbol namespace.
21168
21169 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
21170
21171         * Makefile.am: Add the security manager to the build.
21172         * security-manager.c|h: New. Initialization of the security manager.
21173
21174 2005-01-07  Dick Porter  <dick@ximian.com>
21175
21176         * threads.c: 
21177         * monitor.c: Update thread state during Monitor and WaitHandle
21178         waits.  Fixes bug 71031.
21179
21180 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
21181
21182         * reflection.c (property_encode_signature): Correctly handle when the
21183         property has no methods.
21184
21185 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
21186
21187         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
21188         
21189         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
21190         fields from mb, not rmb. Fixes #71017.
21191
21192         * marshal.c (emit_ptr_to_str_conv): Add support for 
21193         ByValTStr -> string conversion. Fixes #71015.
21194
21195         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
21196
21197         * mempool.c (mono_mempool_contains_addr): New helper function.
21198
21199 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
21200
21201         * metadata.c (mono_metadata_compute_size): Fix size calculation of
21202         HasSematics encoded fields.
21203         
21204         * metadata.c (mono_type_to_unmanaged): Improve error message for 
21205         invalid string marshalling.
21206
21207         * metadata.c: Fix warnings.
21208         
21209 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
21210
21211         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
21212         profiler support.
21213
21214 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
21215
21216         * domain.c object.c domain-internals.h: Revert part of r38077 since the
21217         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
21218         tests.
21219
21220 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
21221
21222         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
21223         so methods containing these can be AOTed.
21224
21225 2005-01-03  Martin Baulig  <martin@ximian.com>
21226
21227         * loader.c (find_method): Removed the hack for generic instances.
21228         (method_from_memberref): If our parent is a generic instance, pass
21229         its generic type definition to find_method() and then inflate the
21230         method.
21231         (mono_get_method_constrained): Pass the generic type definition to
21232         find_method() and inflate the method later.
21233
21234         * class-internals.h (MonoStats): Added `generic_class_count'.
21235
21236         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
21237         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
21238
21239         * reflection.c (mono_custom_attrs_from_params): Don't ignore
21240         generic type definitions.
21241
21242 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
21243
21244         * loader.c icall.c: Fix warnings.
21245
21246 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
21247
21248         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
21249         blittable types. Fixes #70864.
21250
21251 2004-12-29  Martin Baulig  <martin@ximian.com>
21252
21253         * icall.c
21254         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
21255
21256         * reflection.c (mono_method_get_object): Create a
21257         "System.Reflection.MonoGenericMethod" for inflated methods; don't
21258         call mono_get_inflated_method().
21259
21260         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
21261
21262 2004-12-27  Martin Baulig  <martin@ximian.com>
21263
21264         * class-internals.h (MonoMethod): Added `is_inflated' flag.
21265         (MonoMethodInflated): Added `inflated' field.
21266
21267         * class.c (mono_class_inflate_generic_method): Don't really
21268         inflate the method here; just set the `is_inflated' flag in the
21269         MonoMethod.
21270         (mono_class_get_inflated_method): Actually inflate the method here
21271         if it's not already inflated; we use the MonoMethodInflated's new
21272         `inflated' field as a cache.
21273
21274 2004-12-26  Martin Baulig  <martin@ximian.com>
21275
21276         * class.c
21277         (inflate_generic_class): Moved some code out of inflate_generic_type().
21278         (mono_class_inflate_generic_method): If we're already inflated,
21279         inflate the context and use the declaring method; ie. make sure
21280         the declaring method of an inflated method is always the generic
21281         method definition.
21282         (mono_class_create_from_typedef): Create
21283         `class->generic_container->context->gclass'.
21284
21285 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
21286
21287         * metadata-internals.h, marshal.c, reflection.c: More
21288         MonoGHashTable->GHashTable.
21289
21290         * domain-internals.h, class.c: Change MonoGHashTable's into
21291         GHashTables for some cases where no gc stuff is used
21292
21293         All users: update apis
21294
21295 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
21296
21297         * metadata.c (builtin_types): Make this `const'. Makes this get
21298         put into the shareable section.
21299         (mono_metadata_init): Casts to make gcc happy.
21300
21301 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
21302
21303         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
21304
21305 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
21306
21307         * icall.c: Added an internal call to retrieve the position and length
21308         of assembly-level declarative security attributes (RequestMinimum, 
21309         RequestOptional and RequestRefuse). This is used by the Assembly class
21310         to re-create the corresponding permission sets.
21311
21312 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
21313
21314         * marshal.c: fix the stelemref wrapper to be type correct
21315         (and faster).
21316
21317 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
21318
21319         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
21320         to do key & 0x7fffffff. Hashtable already does this. It just
21321         results in longer code.
21322
21323 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
21324
21325         * appdomain.c: Bump corlib version.
21326         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
21327         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
21328         * reflection.c|h: Add functions to get declarative security infos
21329         (blob position and length) for assemblies, classes and methods.
21330
21331 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
21332
21333         * reflection.c: sort the constant table (bug #70693).
21334
21335 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
21336
21337         * object-internals.h, threads.c, domain.c: add accessors for
21338         the MonoThread and MonoDomain tls keys.
21339
21340 2004-12-18  Martin Baulig  <martin@ximian.com>
21341
21342         * class.c (inflate_generic_type): If we're inflating a generic
21343         instance, set `ngclass->context->container = context->container';
21344         ie. the container we inflated into.
21345
21346         * metadata.c (mono_metadata_parse_generic_param): Reflect above
21347         inflate_generic_type() changes.
21348
21349 2004-12-17  Martin Baulig  <martin@ximian.com>
21350
21351         * class-internals.h
21352         (MonoGenericClass): Replaced `MonoType *generic_type' with
21353         `MonoClass *generic_class'.  Removed `dynamic_info'; if
21354         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
21355         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
21356
21357 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
21358
21359         * exception.c (mono_exception_from_token): New helper function.
21360
21361 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
21362
21363         * assembly.c (mono_assembly_load_with_partial_name): Call 
21364         mono_assembly_loaded before invoking the preload hooks. Fixes
21365         #70564.
21366
21367         * object-internals.h (MonoThread): Change culture_info and 
21368         ui_culture_info into an array.
21369
21370         * threads.c: Cache culture info objects from more than one appdomain.
21371
21372         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
21373         current UI culture.
21374
21375 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
21376
21377         * threads.h threads.c appdomain.c: Clear the culture_info field of
21378         all threads during unloading if they point to an object in the dying
21379         appdomain.
21380
21381 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
21382
21383         * culture-info.h (TextInfoEntry): New struct
21384         * object-internals.h: sync with managed
21385         * locales.c: fill the `text_info_data' field
21386         * culture-info-tables.h: update
21387
21388 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
21389
21390         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
21391         collector.
21392
21393 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
21394
21395         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
21396         (ves_icall_ModuleBuilder_getMethodToken): Ditto
21397
21398 2004-12-12  Martin Baulig  <martin@ximian.com>
21399
21400         * mono-debug-debugger.c (write_type): If we're an enum and the
21401         builtin types have already been initialized, call mono_class_init().
21402
21403 2004-12-11  Martin Baulig  <martin@ximian.com>
21404
21405         * metadata.c (mono_metadata_load_generic_params): Added
21406         `MonoGenericContainer *parent_container' argument; automatically
21407         compute `container->is_method'; pass the correct owner to
21408         get_constraints().      
21409
21410         * reflection.c (compare_genericparam): Sort the GenericParam table
21411         according to increasing owners. 
21412
21413 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
21414
21415         * profiler.c: allow disabling the default profiler.
21416
21417 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
21418
21419         * decimal.c, icall.c: allow disabling System.Decimal support.
21420
21421 2004-12-09  Marek Safar <marek.safar@seznam.cz>
21422
21423         * reflection.c: Add support for null attribute arguments.
21424
21425 2004-12-09  Martin Baulig  <martin@ximian.com>
21426
21427         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
21428         names to get rid of compiler warnings.
21429
21430 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
21431
21432         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
21433         mono_marshal_load_type_info (). Fixes #69625.
21434         (mono_marshal_get_ptr_to_struct): Likewise.
21435
21436 2004-12-08  Martin Baulig  <martin@ximian.com>
21437
21438         * mono-debug.h: Bumped version number to 47.
21439
21440         * mono-debug-debugger.c
21441         (mono_debugger_event_handler, mono_debugger_event): Take two
21442         guint64 arguments insteed of a gpointer and a guint32.  
21443
21444 2004-12-08  Martin Baulig  <martin@ximian.com>
21445
21446         * debug-mono-symfile.h
21447         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
21448         `address' to `native_offset'.
21449
21450 2004-12-08  Martin Baulig  <martin@ximian.com>
21451
21452         * class.c (mono_class_create_from_typespec): Only inflate if we
21453         either have `context->gclass' or `context->gmethod'.
21454
21455 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
21456
21457         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
21458
21459         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
21460
21461         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
21462
21463         * reflection.c (mono_assembly_get_object): Remove the workaround put
21464         in for the release.
21465         
21466         * appdomain.c: Use the corlib_internal field from MonoAssembly.
21467
21468         * appdomain.c: Bump corlib version.
21469
21470         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
21471         be visible in other appdomains.
21472
21473 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
21474
21475         * threads.c: Interlocked inc and dec for longs were messed up,
21476         use a KISS based impl for this. Fixes 70234
21477
21478 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
21479
21480         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
21481
21482 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
21483
21484         * icall.c: fix to follow policy not to allow struct
21485         arguments in icalls.
21486
21487 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21488
21489         * process.c: make the patch that handles spaces in file paths work
21490         on mono/windows too.
21491
21492 2004-12-06  Martin Baulig  <martin@ximian.com>
21493
21494         * class.c (mono_class_create_generic): Call
21495         mono_class_setup_supertypes() if we're dynamic.
21496         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
21497
21498 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
21499
21500         * object-internals.h: Add new fields to MonoThread.
21501
21502         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
21503
21504         * icall.c threads-types.h threads.c: Add new icalls.
21505
21506         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
21507
21508         * object-internals.h (MonoReflectionAssembly): Sync object layout with
21509         managed side.
21510
21511         * appdomain.c: Bump corlib version.
21512
21513         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
21514         internal assemblies. Fixes #69181.
21515
21516 2004-12-05  Martin Baulig  <martin@ximian.com>
21517
21518         * class.c (mono_class_inflate_generic_signature): Make this a
21519         no-op if `context' is NULL or we don't have any type parameters;
21520         also copy `sentinelpos'.        
21521
21522 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
21523
21524         * image.c: Add unbox_wrapper_cache.
21525
21526         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
21527
21528         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
21529         function generator.
21530         
21531         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
21532         Fixes #70173.
21533
21534         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
21535         
21536 2004-12-04  Martin Baulig  <martin@ximian.com>
21537
21538         * loader.c (mono_method_get_signature_full): New public function;
21539         like mono_method_get_signature(), but with an additional
21540         `MonoGenericContext *' argument.
21541
21542         * class.c (mono_class_inflate_generic_signature): Formerly known
21543         as inflate_generic_signature(); make this public.
21544
21545 2004-12-04  Martin Baulig  <martin@ximian.com>
21546
21547         * metadata.c
21548         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
21549         instead of a `MonoGenericContainer *'.  
21550         (mono_metadata_parse_array_full): Likewise.
21551         (mono_metadata_parse_signature_full): Likewise.
21552         (mono_metadata_parse_method_signature_full): Likewise.
21553         (mono_metadata_parse_generic_inst): Likewise.
21554         (mono_metadata_parse_generic_param): Likewise.
21555         (mono_metadata_parse_mh_full): Likewise.
21556         (mono_type_create_from_typespec_full): Likewise.
21557
21558 2004-12-03  Martin Baulig  <martin@ximian.com>
21559
21560         * class-internals.h (MonoGenericContainer): Replaced the
21561         `MonoGenericContext * pointer with a `MonoGenericContext'
21562         structure and made it the first element.
21563
21564 2004-12-03  Martin Baulig  <martin@ximian.com>
21565
21566         * class.c
21567         (inflate_generic_type): Set the `context->container' when creating
21568         a new MonoGenericContext.
21569         (mono_class_inflate_generic_method): Likewise.
21570         (mono_class_create_from_typespec): Just use `context->container'
21571         to get the container.
21572
21573         * loader.c (method_from_methodspec): Set `context->parent' from
21574         `context->container' - and if that's a method container, use its
21575         parent.  Also set the `context->container' when creating a new
21576         MonoGenericContext.
21577         (mono_get_method_from_token): Use just `context->container' to get
21578         the container.
21579
21580         * metadata.c (do_mono_metadata_parse_generic_class): Also set
21581         `gclass->context->container'.
21582
21583         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
21584         the `context->container' when creating a new MonoGenericContext.
21585
21586 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
21587
21588         * reflection.c (compare_genericparam): Sort params with identical
21589         owner by their number. Fixes gen-111 on sparc.
21590
21591 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
21592
21593         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
21594         around the domain changes.
21595
21596         * appdomain.c (mono_domain_unload): Handle the case when the thread
21597         calling Unload is itself being aborted during unloading. Fixes #70022.
21598
21599         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
21600
21601         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
21602         checkpoint_func as an icall so it gets a wrapper.
21603         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
21604         in the cross-appdomain wrappers too.
21605
21606         * threads.c (mono_thread_has_appdomain_ref): Make this public.
21607
21608         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
21609
21610         * reflection.c: Fix some memory leaks.
21611         
21612 2004-12-02  Martin Baulig  <martin@ximian.com>
21613
21614         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
21615
21616         * metadata.c (generic_class_cache): New static hashtable.
21617         (mono_metadata_lookup_generic_class): New public method.
21618
21619 2004-12-02  Martin Baulig  <martin@ximian.com>
21620
21621         * class.c (mono_class_create_from_typedef): Call
21622         mono_class_setup_parent() and mono_class_create_mono_type() before
21623         parsing the interfaces.
21624
21625 2004-12-02  Martin Baulig  <martin@ximian.com>
21626
21627         * metadata.c (generic_inst_cache): New static hashtable.
21628         (mono_metadata_lookup_generic_inst): New public function.
21629         (mono_metadata_inflate_generic_inst): New public function.
21630         (mono_metadata_parse_generic_inst): New public function.
21631         (do_mono_metadata_parse_generic_class): Use the new
21632         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
21633         since this'll also use the cache.
21634
21635         * reflection.c (mono_reflection_bind_generic_method_parameters):
21636         Use mono_metadata_lookup_generic_inst() to use the new cache.
21637
21638         * class.c (inflate_mono_type): Use
21639         mono_metadata_inflate_generic_inst() to inflate a generic
21640         instance; this'll also use the new cache.
21641
21642         * loader.c (method_from_methodspec): Use
21643         mono_metadata_parse_generic_inst() and
21644         mono_metadata_inflate_generic_inst() rather than parsing it
21645         manually, so we can use the new cache.
21646
21647 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
21648
21649         * threads.c (wait_for_tids): Do not incorrectly free threads when 
21650         the wait times out.
21651
21652 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
21653
21654         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
21655         iter->args based on whether parameters are passed in registers (i.e.
21656         MONO_ARCH_REGPARMS is defined)
21657
21658 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
21659
21660         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
21661         the exception message. Fixes #70070.
21662         (method_from_methodspec): Fix warnings.
21663
21664 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21665
21666         * process.c: (complete_path) return the path quoted
21667
21668 2004-12-01  Martin Baulig  <martin@ximian.com>
21669
21670         * class-internals.h (MonoGenericInst): New structure.
21671         (MonoGenericClass): Replaced `type_argc', `type_argv' and
21672         `is_open' with `MonoGenericInst *inst'.
21673         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
21674         `is_open' with `MonoGenericInst *inst'.
21675
21676 2004-11-30  Martin Baulig  <martin@ximian.com>
21677
21678         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
21679
21680         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
21681         to `generic_class_cache'.
21682
21683         * metadata.c
21684         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
21685         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
21686         (mono_generic_inst_is_valuetype): Renamed to
21687         mono_generic_class_is_valuetype().
21688
21689         * class-internals.h
21690         (MonoGenericInst): Renamed to MonoGenericClass.
21691         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
21692         (MonoClass): Renamed `generic_inst' to `generic_class'.
21693         (MonoGenericContext): Renamed `ginst' to `gclass'.
21694
21695         * object-internals.h
21696         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
21697
21698         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
21699         mono_reflection_generic_class_initialize().
21700
21701         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
21702         now known as "System.Reflection.MonoGenericClass".
21703         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
21704
21705 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
21706
21707         * class-internals.h: Added a flag field to MonoClass to cache the
21708         declarative security attributes actions associated with the class.
21709         * domain-internals.h: Added booleans to MonoJitInfo to cache the
21710         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
21711         applicable to the JITted method.
21712         * reflection.c|h: Added functions to extract (as flags) which security
21713         actions are available (declaratively) for a method, class or assembly.
21714         * metadata.c|h: Added functions to search the declarative security
21715         table in the metadata.
21716         
21717 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
21718
21719         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
21720         EXPORTEDTYPES are already in the class name cache, so there is no
21721         need to add extra code here to look at them. Just removes a bit of
21722         cruft.
21723
21724         (ves_icall_System_Environment_get_TickCount): No need for #if
21725         WINDOWS. We already have the code in io-layer.
21726
21727 2004-11-28  Martin Baulig  <martin@ximian.com>
21728
21729         * loader.c
21730         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
21731         Fixes gen-112.cs.
21732
21733 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
21734
21735         * assembly.c (do_mono_assembly_open): Instead of having a
21736         conditional WITH_BUNDLE, incorporate support for bundles here, by
21737         having a global `bundles' variable holding a pointer to the actual
21738         bundles. 
21739
21740         (mono_register_bundled_assemblies): New API call used by the
21741         bundle code. 
21742
21743         See mkbundle.1 for details.
21744         
21745 2004-11-27  Martin Baulig  <martin@ximian.com>
21746
21747         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
21748         the vtable for generic methods.
21749
21750 2004-11-26  Martin Baulig  <martin@ximian.com>
21751
21752         * metadata.c
21753         (mono_metadata_generic_method_hash): New public function.
21754         (mono_metadata_generic_method_equal): Likewise.
21755
21756         * class-internals.h
21757         (MonoGenericContainer): Added `GHashTable *method_hash'.
21758
21759         * reflection.c (ReflectionMethodBuilder): Added
21760         `MonoGenericContainer *generic_container'.
21761         (reflection_methodbuilder_to_mono_method): Don't create a new
21762         MonoGenericContainer each time we're called.
21763         (mono_reflection_bind_generic_method_parameters): Use
21764         `container->method_hash' to cache the results so we don't create a
21765         different method if we're called several times with the same
21766         arguments.
21767
21768         * loader.c (method_from_methodspec): Use the new
21769         `container->method_hash' here, too.
21770
21771 2004-11-26  Martin Baulig  <martin@ximian.com>
21772
21773         * class.c (inflate_generic_signature): Correctly compute
21774         `res->has_type_parameters'.
21775         (mono_class_vtable): Use the `has_type_parameters' flag to
21776         determine whether we're a generic method.
21777
21778         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
21779
21780 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
21781
21782         * object.c (mono_runtime_run_main): Fix a small memory leak.
21783
21784 2004-11-25  Martin Baulig  <martin@ximian.com>
21785
21786         * class.c (set_generic_param_owner): Fixed the loop.
21787
21788 2004-11-25  Martin Baulig  <martin@ximian.com>
21789
21790         * object.c (mono_class_vtable): Don't create any JIT wrappers for
21791         generic methods.
21792
21793 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
21794
21795         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
21796         names. Fixes #69787.
21797
21798 2004-11-24  Martin Baulig  <martin@ximian.com>
21799
21800         * class.c (mono_class_create_generic_2): If we don't have a
21801         `ginst->parent', inflate `gklass->parent' to get our parent.
21802
21803 2004-11-24  Martin Baulig  <martin@ximian.com>
21804
21805         * reflection.c (compare_genericparam): Correctly sort the
21806         GenericParam table; fixes #69779.
21807
21808 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
21809
21810         * reflection.c: When writing a PE file, don't create a huge
21811         buffer in memory. Just write the arrays we have to the file.
21812         This reduces memory usage.
21813
21814         * metadata-internals.h: MonoDynamicStream pefile is no longer used
21815         globally.
21816
21817 2004-11-17  Martin Baulig  <martin@ximian.com>
21818
21819         * class.c (mono_class_init): Don't setup `class->parent' for
21820         dynamic instances; moved this to mono_class_generic_2().
21821         (mono_class_create_generic): Also set `klass->inited' for dynamic
21822         generic instances.
21823         (mono_class_create_generic_2): Don't do anything for dynamic
21824         generic instances.  Set `klass->parent' here and also call
21825         mono_class_setup_parent() here. 
21826
21827         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
21828         `MonoType *parent' argument; set `ginst->parent' before calling
21829         mono_class_create_generic_2(), so we set the correct parent.
21830
21831 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
21832
21833         * reflection.c: allow getting attributes from ModuleBuilder
21834         (used by ikvm).
21835
21836 2004-11-17  Martin Baulig  <martin@ximian.com>
21837
21838         * class.c (mono_class_create_from_typedef): If a type parameter is
21839         inherited from an outer class, set its owner to that class.
21840
21841 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
21842
21843         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
21844           for (int*) written size. This fixes bug #69592.
21845
21846 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
21847
21848         * icall.c: Added IsAuthenticodePresnet internal call.
21849         * image.c|h: New function that check a MonoImage for an Authenticode
21850         signature in the certificate PE data directory.
21851         * security.c|h: New internal call to ask the runtime if an 
21852         Authenticode signature seems referenced in the PE header.
21853
21854 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
21855
21856         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
21857
21858         * reflection.c (mono_image_create_pefile): Free the assembly streams
21859         after writing out the assembly file.
21860
21861         * object.c (mono_runtime_run_main): Fix small memory leak.
21862
21863         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
21864         property access modifiers. Fixes #69389.
21865
21866 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
21867
21868         * domain.c, object.c, object-internals.h, domain-internals.h,
21869         object.h, marshal.c: keep dynamic code info per domain.
21870
21871 2004-11-15  Martin Baulig  <martin@ximian.com>
21872
21873         * class.c (mono_type_get_name_recurse): Put type arguments in
21874         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
21875         see bug #68387.
21876
21877 2004-11-15  Martin Baulig  <martin@ximian.com>
21878
21879         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
21880         (mono_class_setup_vtable): When computing `the_cname' for a
21881         generic instance, don't include the namespace since we'd otherwise
21882         add it twice.
21883
21884 2004-11-15  Martin Baulig  <martin@ximian.com>
21885
21886         * class.c (mono_class_create_generic): Changed return type to void.
21887         (mono_class_create_generic_2): New public function; setup
21888         `class->method', `class->field' and `class->interfaces' here
21889         instead of in mono_class_init().
21890
21891         * class.h (mono_class_create_generic): Moved to class-internals.h.
21892
21893 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
21894
21895         * reflection.c (mono_image_create_pefile): take a file HANDLE.
21896         rather than writing to memory, write to this file. Right now,
21897         we are just writting into a buffer, and copying that. However
21898         we can avoid the buffer later.
21899
21900         (mono_dynamic_stream_reset): new function
21901
21902         * icall.c, object-internals.h: update for the above.
21903
21904 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
21905
21906         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
21907         have been using gc'd memory. First it is slower, unlikely
21908         the comment in the source code said, secondly, it increases
21909         our footprint to do it in the gc.
21910
21911         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
21912         the method so that it does not have to copy to managed code.
21913
21914 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
21915
21916         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
21917
21918 2004-11-12  Martin Baulig  <martin@localhost>
21919
21920         * reflection.c (mono_image_create_token): Allow generic method
21921         definitions here, since they may appear in an `.override'; see
21922         gen-98/gen-99 for an example.
21923
21924 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
21925
21926         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
21927         #69365.
21928
21929         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
21930         descriptive.
21931
21932 2004-11-11  Martin Baulig  <martin@ximian.com>
21933
21934         * class.c (mono_class_setup_vtable): In an explicit interface
21935         implementation, the method name now includes the arity.
21936
21937 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
21938
21939         * object.c (mono_array_full_copy): Fix warning.
21940
21941 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
21942
21943         * appdomain.c: Removed look_for_method_by_name(). Use the new method
21944         mono_class_get_method_from_name() instead.
21945         
21946         * class-internals.h: Added two new types of wrappers. 
21947         Added MonoRemotingTarget enum. Added new trampoline function type, which
21948         takes an additional MonoRemotingTarget value as parameter, so it is
21949         possible to request a trampoline for a specific target.
21950         
21951         * class.c: Added new mono_class_get_method_from_name() method.
21952         
21953         * class.h: In MonoRemoteClass, we can have now to vtables, one for
21954         general remoting sinks and one specific for cross domain calls.
21955         
21956         * debug-helpers.c: Added new wrapper names.
21957         
21958         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
21959         of a remote class.
21960         
21961         * image.c: Porperly delete value objects form the remoting invoke hashtable.
21962         
21963         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
21964         with several other methods (mono_marshal_get_xappdomain_dispatch,
21965         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
21966         and others) can generate a fast remoting wrapper for cross domain calls.
21967         More information can be found in docs/remoting.
21968         Other changes: Removed mono_find_method_by_name, and used
21969         mono_class_get_method_from_name instead.
21970         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
21971         is stored in the remoting invoke hashtable.
21972         
21973         * marshal.h: published the new method for getting the xdomain wrapper,
21974         and also added a method for getting the adequate wrapper for a given
21975         method and target.
21976         
21977         * object-internals.h, object.c: Added a couple of methods for capying and
21978         cloning arrays.
21979         Modified mono_install_remoting_trampoline, which takes the new remoting
21980         trampoline that has a remoting target as parameter.
21981         mono_class_proxy_vtable now also takes a remoting target as parameter, and
21982         will return the most suitable vtable for the target.
21983         Added mono_remote_class_vtable, which returns the vtable of a remote class
21984         (which can be the normal remoting vtable or the xdomain vtable).
21985         
21986         * threads.c: the xdomain invoke and dispatch wrappers must also be
21987         protected against interruptions.
21988
21989 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21990
21991         * icall.c: use memmove in BlockCopyInternal when the source and
21992         destination arrays are the same.
21993
21994 2004-11-09  Martin Baulig  <martin@ximian.com>
21995
21996         * class-internals.h (MonoGenericContainer): Removed `method' and
21997         `signature', replaced them with `is_method' and `is_signature'
21998         flags.  Added `context'.
21999
22000         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
22001         instead of a `MonoGenericContainer *'.
22002
22003         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
22004         for dynamic type parameters.
22005         (mono_metadata_load_generic_params): Setup `container->context'.
22006
22007         * reflection.c (mono_reflection_setup_generic_class): Setup
22008         `tb->generic_container->context'.
22009         (do_mono_reflection_bind_generic_parameters): Use
22010         mono_class_inflate_generic_type() to correctly inflate types,
22011         rather than using our own hack just for MONO_TYPE_VAR.
22012
22013 2004-11-09  Martin Baulig  <martin@ximian.com>
22014
22015         * class.c (mono_class_inflate_generic_method): Small fix; don't
22016         crash here.
22017
22018         * icall.c
22019         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
22020         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
22021         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
22022         (ves_icall_Type_BindGenericParameters): Likewise.
22023         (ves_icall_Type_get_IsGenericInstance): Likewise.
22024         (ves_icall_Type_GetGenericParameterPosition): Likewise.
22025         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
22026         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
22027         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
22028
22029 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
22030
22031         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
22032         assembly versions and public key tokens. Fixes #69113.
22033
22034 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
22035
22036         * metadata.c: fix bug introduced with the type cache changes
22037         on 2004-11-06.
22038
22039 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
22040
22041         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
22042         the MonoClass pointer instead of the token in exception clauses.
22043         * reflection.c: updates for the above and make the code not depend
22044         on the structure of MonoExceptionClause.
22045
22046 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
22047
22048         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22049         Add support for dynamic assemblies. Fixes #69114.
22050
22051         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
22052
22053 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
22054
22055         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
22056         since most only those methods use it. the code member of
22057         MonoMethodPInvoke was dead, so that can be removed too. Also,
22058         remove inline_count (again, not used), and move slot so that it
22059         can share bits with some other flags. This saves 8 bytes in the
22060         structure and gives us about 50 kb back for mcs helloworld.cs
22061
22062         * *.[ch]: Do naming changes for the above.
22063
22064         * loader.c (mono_method_get_header): Lazily init the header
22065         on first access.
22066         (mono_get_method_from_token): don't init the header here
22067         (mono_free_method): the header may never be allocated
22068
22069         Overall, this saves 150 kb of unmanaged allocations
22070         for mcs helloworld.cs. That accounts for 10% of the unmanaged
22071         memory at runtime.
22072         
22073         * loader.c, loader.h (mono_method_get_header): new accessor.
22074
22075         * *.[ch]: use the above method. Prepares us to lazily load
22076         the header.
22077
22078         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
22079         three warnings, which are actual bugs (see 69206).
22080
22081         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
22082         unused. Saves a cool 4 bytes / method.
22083
22084 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
22085
22086         * metadata.c (builtin_types): Add types for System.Object here.
22087         (mono_metadata_parse_type_full): Cache MonoType*'s that are
22088         for a class or valuetype from klass->this_arg or klass->byval_arg.
22089
22090         On mcs for a hello world, this gets us down from 21836 MonoType's
22091         to 14560.
22092
22093         (mono_metadata_free_type): Account for the above change.
22094
22095 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
22096
22097         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
22098         exception instead of asserting if name is null.
22099         (ves_icall_System_AppDomain_GetData): Ditto.
22100
22101 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
22102
22103         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
22104         EnumBuilder.
22105
22106         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
22107         Return NULL when the domain does not have entry_assembly set.
22108
22109         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
22110         Add a 'resource_modules' argument.
22111         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
22112
22113         * reflection.c (mono_reflection_create_runtime_class): Move setting
22114         of wastypebuilder here, so mono_get_type_object () returns a MonoType
22115         for enums too.
22116
22117         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
22118         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
22119         Throw an ArgumentNullException if 'ptr' is null.
22120
22121         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
22122         assemblies here. Fixes #69020.
22123
22124 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
22125
22126         * reflection.c (build_compressed_metadata): Fix the previous patch for
22127         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
22128         the stack.
22129
22130 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
22131
22132         * assembly.c (mono_assembly_names_equal): Allow a match if one of
22133         the cultures is false. Fixes #69090.
22134
22135         * reflection.c (build_compressed_metadata): Fix invalid memory read 
22136         detected by valgrind.
22137         
22138         * reflection.c (mono_reflection_get_type): Avoid triggering a 
22139         TypeResolve multiple times for the same type. Fixes #65577.
22140
22141 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
22142
22143         * marshal.c: Avoid using ldftn to call managed functions. It is
22144         much slower than just a call.
22145
22146         * reflection.c (mono_module_get_object): free the basename we
22147         allocate here from glib.
22148         
22149         * reflection.c (ensure_runtime_vtable): make sure to free
22150         overrides.  Also, we were allocating an array of MonoMethod not an
22151         array of MonoMethod*.
22152
22153         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
22154
22155         * image.c (mono_image_close): free image->guid here.
22156
22157 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
22158
22159         * reflection.c: Fix some spec conformance issues with the PE file
22160         structures so mcs compiled apps run on the Net 2.0 beta.
22161
22162 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
22163
22164         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
22165         Implement this. Fixes #67264.
22166
22167         * debug-helpers.h debug-helpers.c marshal.c: Move 
22168         mono_find_method_by_name to debug-helpers.c.
22169
22170 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
22171
22172         * object.c (mono_release_type_locks): type_initialization_hash is
22173         a GHashTable.
22174
22175         * reflection.c object.c object-internals.h: Fix warnings.
22176
22177         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
22178         without accessors. Fixes #61561.
22179
22180         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
22181         application base from the root domain if not set. Fixes #65641.
22182         (mono_runtime_init): Fix warning.
22183
22184 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22185
22186         * appdomain.c: call mono_thread_pool_init.
22187         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
22188         of worker threads based on the number of CPUs and the environment
22189         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
22190         for non-windows (windows) systems.
22191
22192 2004-10-27  Chris Toshok  <toshok@ximian.com>
22193
22194         * mono-debug-debugger.c (write_class): don't call mono_class_init
22195         here, as even with the check for (!klass->init_pending), we get
22196         into a situation where we're hitting cycles in class
22197         initialization.  Fixes #68816.
22198
22199 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
22200
22201         * image.c: Avoid overwriting values in the loaded_images_hash when an
22202         assembly is loaded multiple times. Fixes #61152.
22203
22204         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
22205         so multiple satellite assemblies for the same name can be loaded.
22206         Fixes #68259.
22207
22208         * mono_domain_assembly_preload: Actually return the loaded assembly, 
22209         not NULL.
22210
22211         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
22212         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
22213
22214         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
22215         pending finalizers are not invoked after the appdomain has been 
22216         unloaded. Fixes #67862.
22217
22218 2004-10-22  Martin Baulig  <martin@ximian.com>
22219
22220         * mono-debug-debugger.c
22221         (mono_debugger_runtime_invoke): Don't box valuetypes.
22222
22223 2004-10-22  Chris Toshok  <toshok@ximian.com>
22224
22225         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
22226         don't hide private methods.
22227
22228 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
22229
22230         * icall.c: Allows the runtime to "share" (when known) the public key
22231         token of an assembly. This avoid the need to recalculate the token 
22232         (from the public key) in managed code.
22233
22234 2004-10-21  Chris Toshok  <toshok@ximian.com>
22235
22236         * debug-helpers.c (append_class_name): argh, revert last patch.
22237         
22238 2004-10-21  Chris Toshok  <toshok@ximian.com>
22239
22240         * debug-helpers.c (append_class_name): use '+' as the delimiter,
22241         not '/', so that it matches what the debugger uses to look up
22242         methods.
22243
22244 2004-10-21  Martin Baulig  <martin@ximian.com>
22245
22246         * mono-debug-debugger.c (mono_debugger_throw_exception): New
22247         public method; this is called each time an exception is thrown and
22248         allows the debugger to use exception catch points.
22249
22250 2004-10-21  Martin Baulig  <martin@ximian.com>
22251
22252         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
22253         the stack pointer and the exception object in some struct and pass
22254         that to the debugger.
22255
22256 2004-10-21  Chris Toshok  <toshok@ximian.com>
22257
22258         * mono-debug-debugger.c (do_write_class): add instance/static
22259         event support.  We don't expose "raise" or "other" yet.
22260         (event_is_static): new method.
22261
22262 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
22263
22264         * mono-debug-debugger.c
22265         (mono_debugger_handle_exception): Remove
22266         bogus return value for fussy compilers.
22267
22268 2004-10-20  Martin Baulig  <martin@ximian.com>
22269
22270         * mono-debug-debugger.c
22271         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
22272         (mono_debugger_handled_exception): Likewise.
22273
22274 2004-10-20  Martin Baulig  <martin@ximian.com>
22275
22276         * mono-debug-debugger.h (MonoDebuggerEvent): Added
22277         MONO_DEBUGGER_EVENT_EXCEPTION.
22278
22279         * mono-debug-debugger.c (mono_debugger_handle_exception): New
22280         public function to send the debugger a notification for an
22281         exception and inform it about a catch/finally clause.
22282
22283 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
22284
22285         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
22286         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
22287         fix 2.95 build. 
22288
22289         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
22290
22291 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
22292
22293         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
22294         marshalled as [In,Out]. Fixes #58325.
22295
22296 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
22297
22298         * reflection.c (mono_method_body_get_object): Implement some fields.
22299
22300 2004-10-12  Martin Baulig  <martin@ximian.com>
22301
22302         * reflection.c (mono_reflection_bind_generic_parameters): Small
22303         fix, correctly retrieve our parent from a generic instance.
22304
22305 2004-10-12  Martin Baulig  <martin@ximian.com>
22306
22307         * metadata.c (mono_metadata_generic_param_equal): We always have
22308         an owner.
22309
22310         * class.c
22311         (mono_class_from_generic_parameter): We need to have an owner.
22312         (my_mono_class_from_generic_parameter): Likewise.
22313
22314         * reflection.c (mono_reflection_setup_generic_class): Renamed to
22315         mono_reflection_create_generic_class() and added a new
22316         mono_reflection_setup_generic_class().  
22317         (mono_reflection_initialize_generic_param): If we're a nested
22318         generic type and inherited from the containing class, set our
22319         owner to the outer class.
22320
22321 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
22322
22323         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
22324
22325         * reflection.c (mono_method_body_get_object): New function to create
22326         a MethodBody object.
22327
22328         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
22329
22330 2004-10-11  Martin Baulig  <martin@ximian.com>
22331
22332         * metadata.c (_mono_metadata_type_equal): Renamed to
22333         do_mono_metadata_type_equal() and made static.
22334
22335 2004-10-11  Martin Baulig  <martin@ximian.com>
22336
22337         * appdomain.c: Bump corlib version number to 28.
22338
22339 2004-10-10  Martin Baulig  <martin@ximian.com>
22340
22341         * class-internals.h
22342         (MonoGenericInst): Added `MonoGenericContainer *container'.
22343         (MonoGenericMethod): Likewise.
22344         (MonoGenericContext): Likewise.
22345         (MonoGenericParam): Added `MonoGenericContainer *owner'.
22346
22347         * metadata.c
22348         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
22349         (do_mono_metadata_parse_generic_inst): Likewise.
22350         (mono_metadata_parse_type_full): New public method.  This is the actual
22351         mono_metadata_parse_type() implementation - with an additional
22352         `MonoGenericContainer *' argument.
22353         (mono_metadata_parse_array_full): Likewise.
22354         (mono_metadata_parse_signature_full): Likewise.
22355         (mono_metadata_parse_method_signature_full): Likewise.
22356         (mono_metadata_parse_mh_full): Likewise.
22357         (mono_type_create_from_typespec): Likewise.
22358         (mono_metadata_interfaces_from_typedef_full): New public method;
22359         this is similar to the other _full() methods, but we take a
22360         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
22361         (mono_metadata_parse_generic_param): Take an additional
22362         `MonoGenericContainer *' argument and lookup the MonoGenericParam
22363         from that container.
22364         (mono_metadata_generic_param_equal): New static method to compare
22365         two type parameters.
22366         (_mono_metadata_type_equal): New static method; takes an
22367         additional `gboolean signature_only' argument - if true, we don't
22368         compare the owners of generic parameters.
22369         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
22370         with a TRUE argument - do a signature-only comparision.
22371
22372         * loader.c: Use the new _full() methods and pass the
22373         MonoGenericContainer to them.
22374
22375         * object-internals.h (MonoReflectionTypeBuilder): Added
22376         `MonoGenericContainer *generic_container' field.
22377         (MonoReflectionMethodBuilder): Likewise.
22378
22379 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
22380
22381         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
22382         case initial images of dynamic assemblies.
22383
22384         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
22385
22386         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
22387
22388         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
22389         length of event->other array.
22390         (typebuilder_setup_events): Ditto.
22391
22392         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
22393         'assembly_by_name' and add an 'assemblies' list.
22394
22395         * assembly.h assembly.c: Add a new search hook for determining whenever
22396         an assembly is already loaded. Use this instead of searching in the
22397         loaded_assemblies list.
22398
22399         * domain.c appdomain.c: Implement the new search hook so loaded 
22400         assemblies are now scoped by appdomain. Fixes #67727.
22401
22402 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
22403
22404         * threads.c (mono_thread_attach): Initialize synch_lock field so
22405         mono_thread_detach works again.
22406
22407         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
22408         'lib' too. Fixes #63130.
22409
22410 2004-10-06  Jackson Harper  <jackson@ximian.com>
22411
22412         * culture-info-tables.h: regenerated.
22413
22414 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
22415
22416         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
22417         implemented by other interfaces in the result. Fixes #65764.
22418         
22419         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22420         Handle unloadable modules without crashing.
22421
22422         * image.c (load_modules): Revert the previous patch since modules must
22423         have a fixed index inside the array.
22424         
22425         * image.c (load_modules): Don't include native modules in the modules
22426         array.
22427
22428 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
22429
22430         * reflection.h: Add param_defaults field.
22431
22432         * reflection.c: Add support for parameter defaults in dynamic methods.
22433         Fixes #64595.
22434
22435         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
22436         an empty string when a type has no namespace. Fixes #64230.
22437
22438 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
22439
22440         * tabledefs.h: Added "internal" security actions to support non-CAS
22441         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
22442         Note: they do not seems to be used anymore in 2.0 (new metadata format)
22443
22444 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
22445
22446         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
22447         constructor of abstract class. Fixes #61689.
22448
22449 2004-10-04  Martin Baulig  <martin@ximian.com>
22450
22451         * class-internals.h (MonoGenericContainer): New type.
22452         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
22453         `MonoGenericContainer *generic_container'.
22454         (MonoClass): Replaced `gen_params' and `num_gen_params' with
22455         `MonoGenericContainer *generic_container'.
22456
22457         * metadata.c (mono_metadata_load_generic_params): Return a
22458         `MonoGenericContainer *' instead of a `MonoGenericParam *';
22459         removed the `num' argument.
22460
22461 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
22462
22463         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
22464         for dynamic images.
22465
22466         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
22467         machine fields.
22468
22469         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
22470
22471         * reflection.c: Save pe_kind and machine values into the generated
22472         image file.
22473
22474         * appdomain.c: Bump corlib version number.
22475
22476         * object-internals.h: Reorganize layout of LocalBuilder.
22477
22478         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
22479         New helper function.
22480
22481         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
22482         created MonoType for dynamic types. Fixes #66180.
22483
22484 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
22485
22486         * threadpool.c: the ares hashtable needs a critical section around it.
22487         this prevents some nasty segfaults
22488
22489 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
22490
22491         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
22492         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
22493         bug 67324).
22494         
22495 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
22496
22497         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
22498         
22499 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
22500
22501         * image.c: Always canonicalize image file names, to avoid loading
22502         the same assembly twice when referenced using a relative path.
22503
22504 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
22505
22506         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
22507
22508         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
22509
22510         * marshal.c: Fix warnings.
22511
22512 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
22513
22514         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
22515         attempting to marshal the delegate_trampoline as the method_addr.
22516         This patch has a static hashtable of marshalled delegates so that 
22517         we can map delegate_trampoline addresses back to delegates.  This
22518         allows a delegate passed to managed code to be passed back into native
22519         code.  Fixes #67039
22520
22521 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
22522
22523         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
22524
22525         * reflection.c (method_encode_code): Align method headers properly.
22526         Fixes #66025.
22527
22528 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
22529
22530         * marshal.c: In the runtime invoke wrapper, reset the abort
22531         exception if it is cached. This avoids the automatic rethrowal of 
22532         the exception after the catch of the wrapper. Also check for pending
22533         interruptions before calling the managed method. This is done using
22534         the new method emit_thread_force_interrupt_checkpoint, since the
22535         normal checkpoint method is ignored when running the invoke wrapper.
22536         * object.c: If the abort exception is rethrown, set the abort_exc
22537         field of the thread, so it will be rethrown aftere every catch.
22538         * threadpool.c: Only run an interruption checkpoint if what has been
22539         requested is a stop of the thread (aborts will be ignored).
22540         * threads.c: By default, a thread will now never be interrumped while
22541         running the runtime invoke wrapper (this ensures that runtime_invoke
22542         will always return to the caller if an exception pointer is provided).
22543         There is a new special method mono_thread_force_interruption_checkpoint()
22544         to force an interruption checkpoint even if running a protected
22545         wrapper, which is used by the same runtime invoke wrapper to do a check
22546         at a safe point.
22547
22548 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
22549
22550         * object.c, object-internals.h: Implemented mono_release_type_locks,
22551         which releases the cctor locks held by a thread.
22552         * threads.c, threads.h: In thread_cleanup, release cctor locks held
22553         by a thread. Added mono_thread_exit() method to be used to safely stop
22554         a thread.
22555
22556 2004-09-28  Raja R Harinath  <rharinath@novell.com>
22557
22558         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
22559         Move null check before dereference.  Avoid indexing beyond the end
22560         of the 'modules' array.
22561
22562 2004-09-28  Raja R Harinath  <rharinath@novell.com>
22563
22564         * metadata-internals.h (MonoImage): Add module_count field.
22565         * image.c (load_modules): Set image->module_count.
22566         (mono_image_load_file_for_image): Use image->module_count.
22567         * reflection.c (mono_image_load_module): Append to image->modules array 
22568         of dynamic assembly.
22569         (mono_module_get_object): Fix loop to actually increment index.
22570         Use image->module_count.
22571         * assembly.c (mono_assembly_load_references): Use image->module_count.
22572         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
22573         Likewise.
22574
22575 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
22576
22577         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
22578         Avoid assert on generic types.
22579
22580 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
22581
22582         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
22583
22584         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
22585
22586         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
22587         function to convert a MarshalSpec structure to its managed counterpart.
22588
22589         * reflection.c: Fix warnings.
22590         
22591         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
22592         field.
22593
22594         * icall.c (mono_create_icall_signature): Fix build.
22595
22596 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
22597
22598         * icall.c: Add MakePointType icall.
22599
22600         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
22601         warnings.
22602
22603 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22604
22605         * threadpool.c: reuse allocated slots in the queue.
22606
22607 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
22608
22609         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
22610
22611         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
22612
22613         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
22614         previous change.
22615
22616         * tabledefs.h: Add constants for pinvoke attributes BestFit and
22617         ThrowOnUnmappableChar.
22618
22619         * icall.c (ves_icall_Type_GetPacking): New icall.
22620
22621 2004-09-24  Martin Baulig  <martin@ximian.com>
22622
22623         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
22624
22625 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22626
22627         * appdomain.c:
22628         (mono_domain_set): allow setting a domain that is being unloaded.
22629         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
22630         being unloaded.
22631
22632 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
22633
22634         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
22635         the GetCustomAttributes icall.
22636
22637 2004-09-23  Martin Baulig  <martin@ximian.com>
22638
22639         * object-internals.h (MonoReflectionGenericParam): Replaced
22640         'has_ctor_constraint', `has_reference_type' and `has_value_type'
22641         with `guint32 attrs'.
22642
22643 2004-09-23  Martin Baulig  <martin@ximian.com>
22644
22645         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
22646
22647 2004-09-23  Martin Baulig  <martin@ximian.com>
22648
22649         * object-internals.h (GenericParameterAttributes): New enum.
22650
22651 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
22652
22653         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
22654         
22655         * class.c (init_events): Fill out event->other field.
22656
22657         * class.c: Fix warnings.
22658
22659         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
22660
22661 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
22662
22663         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
22664         walk which doesn't supply the IL offset.
22665
22666 2004-09-22  Martin Baulig  <martin@ximian.com>
22667
22668         * reflection.c (mono_reflection_setup_internal_class): If we're
22669         System.ValueType, System.Object or System.Enum, set
22670         `klass->instance_size' and create the vtable.
22671         (mono_reflection_create_internal_class): If we're an enum type,
22672         get the base class from our current corlib.
22673
22674 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
22675
22676         * reflection.h (MonoResolveTokenError): New type.
22677
22678         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
22679         icall.
22680
22681         * icall.c: Add an 'error' argument to the ResolveToken icalls.
22682
22683 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
22684
22685         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
22686         Support also calling constructors, but only for already allocated objects.
22687
22688 2004-09-17  Geoff Norton <gnorton@customerdna.com>
22689
22690         * reflection.c (type_get_qualified_name): If the klass is null
22691         return the typename to avoid a NullRefEx.
22692         (encode_cattr_value): Get the qualified name of the boxed type,
22693         not the underlying enumtype.  Fixes #62984.
22694
22695 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
22696
22697         * marshal.c: Fix problems with previous checkin.
22698
22699 2004-09-21    <vargaz@freemail.hu>
22700
22701         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
22702         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
22703
22704         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
22705
22706 2004-09-21  Geoff Norton <gnorton@customerdna.com>
22707
22708         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
22709         should only return a type for pointers, arrays, and passbyref types.
22710         Fixes bug #63841.
22711
22712 2004-09-21  Martin Baulig  <martin@ximian.com>
22713
22714         * domain.c (mono_debugger_check_runtime_version): New public
22715         function.
22716
22717         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
22718
22719 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
22720
22721         * reflection.c: Added missing sort to the declarative security 
22722         attributes table. MS implementation stops seeing the attributes if the
22723         token number regress in the table (as shown by ildasm and permview).
22724
22725 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
22726
22727         * object-internals.h (MonoReflectionModule): Add 'token' field.
22728         
22729         * reflection.c (mono_reflection_get_token): Add support for Module
22730         and Assembly.
22731         (mono_module_get_object): Set 'token' field.
22732         (mono_module_file_get_object): Set 'token' field.
22733
22734         * icall.c: Add new Assembly and Module icalls.
22735
22736         * appdomain.c: Bump corlib version.
22737
22738 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
22739
22740         * loader.h loader.c class.h class.c: Add helper functions for obtaining
22741         tokens of metadata objects.
22742
22743         * reflection.h reflection.c (mono_reflection_get_token): New function
22744         to obtain the token of a metadata object.
22745
22746         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
22747
22748 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
22749
22750         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
22751         
22752         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
22753
22754 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
22755
22756         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
22757         * object-internals.h: Added 3 MonoArray* members to MonoReflection
22758         AssemblyBuilder to access the permissions set in the class lib.
22759         * reflection.c: Added security attributes encoding step in 
22760         mono_image_build_metadata.
22761         * tabledefs.h: Added new security actions defined in 2.0:
22762         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
22763
22764 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
22765
22766         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
22767         macro parameter.
22768
22769 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
22770  
22771         * locales.c: nullify the ICU_collator member of CompareInfo when it is
22772           finalized. There where random SIGSEVs at program termination, when
22773           an object being finalized was trying to do a string comparison and
22774           the current culture was already finalized.
22775  
22776 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22777
22778         * threads.c: call thread_cleanup before finishing the thread if we get
22779         there.
22780
22781 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
22782
22783         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
22784         assemblies from the parent. Fixes #65665.
22785
22786 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
22787
22788         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
22789         modifiers.
22790
22791 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
22792
22793         * reflection.h: add prototype for mono_get_dbnull_object
22794         * reflection.c: add prototypes for get_default_param_value_blobs 
22795         and mono_get_object_from_blob for fussier compilers
22796
22797 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
22798  
22799         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
22800         false deadlock checks in class initialization.
22801  
22802 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
22803
22804         * image.c (mono_image_addref): Fix comment.
22805
22806         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
22807         possible.
22808
22809 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
22810
22811         * reflection.c (mono_param_get_objects): Modified to return
22812         ParameterInfo.DefaultValue object.
22813
22814         (get_default_param_value_blobs):
22815         (mono_get_object_from_blob):
22816         (mono_get_dbnull_object): New helper routines. 
22817
22818         * object.c (mono_get_constant_value_from_blob): New helper routine
22819         carved out from get_default_field_value ()
22820
22821         * object-internals.h (mono_get_constant_value_from_blob): Added
22822         function declaration.
22823
22824 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
22825
22826         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
22827         referenced assemblies. Fixes #62135.
22828
22829         * exception.h exception.c (mono_get_exception_file_not_found2): New
22830         helper function.
22831
22832 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
22833
22834         * class.h class.c: Add mono_type_get_underlying_type ().
22835
22836 2004-09-09  Geoff Norton <gnorton@customerndna.com>
22837
22838         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
22839         Fix GetTypes() to support dynamically created assemblies.
22840
22841 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
22842
22843         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
22844         
22845         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
22846         previous patch.
22847
22848         * reflection.h reflection.c loader.c: Allow dynamic construction of
22849         pinvoke methods. Fixes #65571.
22850         
22851         * reflection.c (mono_reflection_get_type): Revert previous change since
22852         it causes regressions.
22853
22854 2004-09-08  Martin Baulig  <martin@ximian.com>
22855
22856         * class.c (class_compute_field_layout): Don't call
22857         mono_class_layout_fields() for open generic instances.
22858
22859 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
22860         * threads.c appdomain.c: fix typo in GC macro
22861
22862 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22863
22864         * threads.c: don't call mono_thread_detach() in start_wrapper(),
22865         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
22866
22867 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
22868
22869         * image.c (mono_image_close): Applied patch from 
22870         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
22871         assembly is loaded multiple times from data.
22872         
22873         * image.c (mono_image_open): Fix warning.
22874
22875 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22876
22877         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
22878         once. Fixes #58334.
22879         
22880         * reflection.c (mono_reflection_create_runtime_class): Initialize
22881         klass->nested_classes. Fixes #61224.
22882
22883 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
22884
22885         * threads.c: sched_yield() on exit, to allow threads to quit.
22886
22887 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22888
22889         * object.c (mono_unhandled_exception): Remove leftover debug code.
22890
22891 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
22892
22893         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
22894
22895 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
22896
22897         * marshal.c (emit_marshal_array): Really null terminate string arrays.
22898         
22899         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
22900
22901 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22902
22903         * marshal.c (emit_marshal_array): Null terminate string arrays.
22904         
22905         * marshal.c (raise_auto_layout_exception): Fix warning.
22906
22907         * reflection.c (mono_param_get_objects): Initialize the default value
22908         with DBNull.Value, not null. Fixes #62123.
22909
22910 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
22911
22912         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
22913         throw an exception with a cute explanation.
22914
22915 2004-09-06  Dick Porter  <dick@ximian.com>
22916
22917         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
22918         Close the new process's thread handle, as we don't use it.  The
22919         handle stays around forever otherwise.
22920
22921 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22922
22923         * object.c (arith_overflow): Fix warning.
22924
22925         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
22926         calling conventions in method refs. Fixes #65352.
22927
22928         * reflection.c: Fix warnings.
22929
22930 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
22931
22932         * icall.c: Add a new icall for Array.Clear
22933
22934 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
22935
22936         * object.c: When allocating an array, we have to throw
22937         an overflow exception if any of the lengths are < 0.
22938
22939 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
22940
22941         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
22942         properly. Also move implementation of string array marshalling to 
22943         managed code. Fixes #42316.
22944
22945 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22946
22947         * assembly.c: provide more information when loading an assembly fails.
22948
22949 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22950
22951         * filewatcher.c: don't expect the development fam package to be
22952         installed.
22953
22954 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
22955
22956         * marshal.c: Make a copy of the signature cookie since it will be
22957         freed by the caller.
22958         
22959         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
22960
22961         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
22962
22963         * metadata.c (mono_metadata_free_marshal_spec): New function to free
22964         marshal specs.
22965
22966         * marshal.c: More refactoring.
22967         
22968         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
22969         smaller functions.
22970
22971 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
22972
22973         * object.c: In mono_message_invoke, fill the output parameter array after
22974           calling the managed method (it was done before the call). This fixes
22975           bug #59299.
22976
22977 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
22978
22979         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
22980         as well.
22981
22982 2004-09-02  Martin Baulig  <martin@ximian.com>
22983
22984         * class.c (mono_class_instance_size): Don't allow generic type
22985         definitions or open generic instances.
22986         (mono_class_array_element_size): If we're a value type, call
22987         mono_class_instance_size() on the original class.
22988
22989         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
22990         handle generic instances.
22991
22992         * mono-debug-debugger.c (write_type): Handle generic instances
22993         like classes.
22994
22995 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
22996
22997         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
22998         the allocation request fails. Fixes #65089.
22999
23000         * object.c (mono_runtime_free_method): Do not call mono_free_method.
23001         
23002         * object.c (mono_runtime_free_method): New function to free a dynamic
23003         method.
23004
23005         * marshal.c (mono_delegate_free_ftnptr): New function to free the
23006         delegate trampoline.
23007
23008         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
23009         with hasthis as dynamic,
23010
23011         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
23012
23013         * domain.c (mono_jit_info_table_remove): New function to remove an
23014         entry from the jit info table.
23015
23016         * class-internals.h (MonoMethod): Add 'dynamic' field.
23017
23018         * loader.c: Fix warnings.
23019
23020 2004-09-01  Martin Baulig  <martin@ximian.com>
23021
23022         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
23023         instead of mono_debugger_lock() because the latter one is a no-op
23024         unless running in the debugger.
23025
23026 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23027
23028         * class.c (class_compute_field_layout): Classes with auto-layout or
23029         reference fields are not blittable.
23030         
23031 2004-09-01  Dick Porter  <dick@ximian.com>
23032
23033         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
23034         mono_image_get_filename() to get the assembly location.
23035
23036         * icall.c:
23037         * metadata.h: Fix compile warnings
23038
23039 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
23040
23041         * class.c (class_compute_field_layout): System.Object is blittable.
23042
23043         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
23044         as in/out. Fixes #59909.
23045
23046 2004-09-01  Martin Baulig  <martin@ximian.com>
23047
23048         * metadata.h (MONO_TYPE_ISREFERENCE): Call
23049         mono_metadata_generic_inst_is_valuetype() if we're a generic
23050         instance to check whether our underlying type is a reference type.
23051
23052 2004-09-01  Martin Baulig  <martin@ximian.com>
23053
23054         * metadata.c (mono_type_size): If we're a generic instance, call
23055         mono_class_value_size() for value types.
23056
23057 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
23058
23059         * marshal.c: Implement more custom marshalling functionality. Fixes
23060         #64915.
23061
23062 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
23063
23064         * mono-debug.c, debug-mono-symfile.c: add some locking love.
23065
23066 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
23067
23068         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
23069
23070         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
23071
23072         * icall.c: Fix some warnings.
23073
23074         * threads.c (abort_appdomain_thread): Fix unref errors.
23075         (mono_thread_current): Fix THREAD_DEBUG define.
23076
23077 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
23078
23079         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
23080
23081         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
23082
23083 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
23084
23085         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
23086         string arrays.
23087
23088 2004-08-28  Martin Baulig  <martin@ximian.com>
23089
23090         * metadata.c
23091         (mono_metadata_generic_inst_is_valuetype): New public function.
23092
23093         * metadata.h (MONO_TYPE_ISSTRUCT): Call
23094         mono_metadata_generic_inst_is_valuetype() if we're a generic
23095         instance to check whether our underlying type is a valuetype.
23096
23097 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
23098
23099         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
23100         #63768.
23101
23102 2004-08-25  Martin Baulig  <martin@ximian.com>
23103
23104         * loader.c (mono_get_method_from_token): Abstract methods can also
23105         be generic and thus have type parameters.
23106
23107         * metadata-internals.h
23108         (MonoDynamicImage): Added `GPtrArray *gen_params'.
23109
23110         * reflection.c (mono_image_get_generic_param_info): Don't create a
23111         metadata row, just add an entry to the `gen_params' array.
23112         (build_compressed_metadata): Sort the `gen_params' array and then
23113         actually create the metadata.
23114
23115 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23116
23117         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
23118
23119 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
23120
23121         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
23122
23123 2004-08-24  Martin Baulig  <martin@ximian.com>
23124
23125         * class.cs (mono_class_is_subclass_of): Like an interface, a
23126         generic instance also derives from System.Object.
23127
23128 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
23129
23130         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
23131         custom modifiers to be in any order. Fixes #61990.
23132
23133 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
23134
23135         * object.c: Register mono_object_new_fast icall.
23136         
23137         * object.c (mono_class_get_allocation_ftn): Return to calling
23138         mono_object_new_fast, since it seems faster to compute the object 
23139         size in unmanaged code than passing it as a parameter.
23140
23141         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
23142
23143         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
23144         this function with Boehm as the oom handler, so we don't have to check
23145         the result of GC_malloc.
23146
23147         * object.c: Remove checks for oom.
23148
23149         * object.h object.c (mono_class_get_allocation_ftn): New function to
23150         return the icall which can be used to allocate an instance of a given
23151         class. 
23152
23153         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
23154
23155         * class-internals.h: Add 'enabled' field.
23156
23157 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
23158
23159         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
23160
23161 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
23162         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
23163         value 0x0010.
23164
23165 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
23166
23167         * appdomain.c: use the Tls function for appdomain too,
23168         at Zoltan's request. Actually return in mono_context_get
23169
23170         * appdomain.c, profiler.c, threads.c: use __thread
23171
23172 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
23173
23174         * appdomain.c threads.c: Call GC_CreateThread on windows.
23175
23176         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
23177         multiple libraries since this don't work on windows.
23178
23179 2004-08-18  Martin Baulig  <martin@ximian.com>
23180
23181         * class-internals.h
23182         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
23183         MonoMethodHeader.
23184
23185         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
23186         MonoMethodNormal since we also need it for abstract and interface
23187         methods.
23188
23189         * reflection.c
23190         (build_compressed_metadata): Sort the GenericParam table.
23191         (mono_image_create_token): Added `gboolean create_methodspec'
23192         argument; this is false when generating a MethodImpl token.
23193         (reflection_methodbuilder_to_mono_method): Abstract and interface
23194         methods may also have generic parameters.
23195
23196 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
23197
23198         * appdomain.c: thread local alloc
23199
23200 2004-08-17  Martin Baulig  <martin@ximian.com>
23201
23202         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
23203
23204         * icall.c
23205         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
23206         argument.
23207
23208         * class.c (mono_type_get_full_name): New public function.
23209         (mono_type_get_name): Don't include the type arguments.
23210
23211 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
23212
23213         * Makefile.am: Build static versions of libmetadata and libmonoruntime
23214         for inclusion into the mono executable.
23215
23216 2004-08-16  Martin Baulig  <martin@ximian.com>
23217
23218         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
23219         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
23220
23221 2004-08-14  Martin Baulig  <martin@ximian.com>
23222
23223         * class.c (dup_type): Also copy the `byref' field.
23224
23225 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
23226
23227         * reflection.c (create_dynamic_mono_image): Revert the last change 
23228         since it breaks bootstrap.
23229
23230 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
23231
23232         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
23233
23234         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
23235         not free them with g_free.
23236
23237 2004-08-11  Martin Baulig  <martin@ximian.com>
23238
23239         * reflection.c (mono_reflection_setup_internal_class): Also call
23240         mono_class_setup_mono_type() if we already have a `tb->type.type'.
23241
23242 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
23243
23244         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
23245         called during default (first) AppDomain creation. Keep track of
23246         Evidence when loading assemblies.
23247
23248 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
23249
23250         * opcodes.c, opcodes.h: reduce runtime relocations.
23251
23252 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
23253
23254         * culture-info.h, locales.c: fixes and chages to sue the new
23255         optimized format of the locale data.
23256         * culture-info-tables.h: regenerated.
23257
23258 2004-08-06  Geoff Norton <gnorton@customerdna.com>
23259         
23260         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
23261
23262 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
23263
23264         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
23265         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
23266         * domain-internals.h: icall declaration.
23267         * icall.c: icall registration.
23268         * object-internals.h: New fields in MonoAssembly for CAS.
23269
23270 2004-08-05  Duncan Mak  <duncan@ximian.com>
23271
23272         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
23273         CEE_LDELEM_ANY.
23274
23275 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
23276
23277         * reflection.c: fix to deal with object[] arrays in custom ctors
23278         (bug #62550).
23279
23280 2004-08-05  Martin Baulig  <martin@ximian.com>
23281
23282         * class.c (mono_class_array_element_size): Added support for
23283         generic instances and correctly handle "recursive" types.
23284
23285 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
23286
23287         * assembly.c: Fix warnings.
23288
23289 2004-08-04  Martin Baulig  <martin@ximian.com>
23290
23291         * class.c
23292         (mono_type_get_name_recurse): Added `gboolean include_arity'
23293         argument specifying whether or not we should include the generic
23294         arity in the type name.
23295         (_mono_type_get_name): New static function.
23296         (mono_class_setup_vtable): If we're a generic instance, don't
23297         include the generic arity in the names of explicit method
23298         implementations.        
23299
23300 2004-08-03  Martin Baulig  <martin@ximian.com>
23301
23302         * class.c (mono_type_get_name_recurse): Enclose the generic type
23303         arguments in `<', '>'.
23304
23305 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
23306
23307         * gc.c: make GC warning messages use the trace API, they are just
23308         noise to most of the users.
23309
23310 2004-08-03  Martin Baulig  <martin@ximian.com>
23311
23312         * debug-mono-symfile.c (read_string): Correctly read the string.
23313
23314 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
23315
23316         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
23317         
23318         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
23319         icalls.
23320         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
23321
23322 2004-07-30  Martin Baulig  <martin@ximian.com>
23323
23324         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
23325         Reflect latest symbol writer changes.   
23326
23327 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
23328
23329         * object.c: always create an object if null is passed
23330         to Invoke() where a valuetype is expected.
23331
23332 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
23333
23334         * marshal.c (mono_marshal_init): make managed
23335         signatures match native ones better for 64bits.
23336
23337 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23338
23339         * appdomain.c: hack to build correctly the private bin path on windows.
23340         Fixes bug #61991.
23341
23342 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
23343
23344         * assembly.c: Load mscorlib from the correct framework directory
23345           (mono/<version>/mscorlib.dll).
23346         * appdomain.h: Added prototypes for new functions.
23347         * internals.h: Added some prototypes.
23348         * domain.c: When initializing the runtime, get from the executable and
23349           the configuration files the runtime version that the app supports.
23350           Added support methods for reading app.exe.config. Added list of versions
23351           supported by the JIT. Added two new methods: mono_init_from_assembly,
23352           which initializes the runtime and determines the required version from
23353           the provided exe file, and mono_init_version, which initializes
23354           the runtime using the provided version.
23355         * icall.c: Get machine.config from version-specific directory.
23356         * reflection.c: When generating an image, embed the version number
23357           of the current runtime.
23358
23359 2004-07-28  Dick Porter  <dick@ximian.com>
23360
23361         * socket-io.c
23362         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
23363         returned sockaddr size before creating the remote address object.
23364         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
23365         61608.
23366
23367 2004-07-28  Dick Porter  <dick@ximian.com>
23368
23369         * locales.c (string_invariant_compare_char): Fix invariant char
23370         compares between upper and lower cases.  Fixes bug 61458.
23371
23372 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
23373         
23374         * marshal.c: actually cache stelem.ref wrappers.
23375         
23376 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
23377
23378         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
23379         sections and remove the mono_cli_rva_map () function.
23380
23381 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
23382
23383         * debug-mono-symfile.c: fix one more endianess issue, from a patch
23384         by Geoff Norton (<gnorton@customerdna.com>).
23385
23386 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
23387
23388         * class.c: fix class loads for pointer types (typeof(int) !=
23389         typeof(int*)).
23390
23391 2004-07-27  Martin Baulig  <martin@ximian.com>
23392
23393         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
23394         reading the debugging information from an external ".mdb" file.
23395
23396 2004-07-24  Martin Baulig  <martin@ximian.com>
23397
23398         * reflection.c (mono_image_get_type_info): Only write a class
23399         layout entry if we actually have a size or a packing size.
23400
23401 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
23402
23403         * reflection.c (type_get_fully_qualified_name): 
23404         insert cast to get type checking of ?: with non-gcc compilers
23405
23406 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
23407
23408         * rand.c: use g_getenv for both lookups of
23409         MONO_EGD_SOCKET
23410
23411 2004-07-17  Martin Baulig  <martin@ximian.com>
23412
23413         * reflection.c (mono_reflection_bind_generic_method_parameters):
23414         Set `gmethod->reflection_info'.
23415
23416 2004-07-17  Martin Baulig  <martin@ximian.com>
23417
23418         * class.c (mono_class_create_from_typedef): Insert the newly
23419         created class into the hash table before computing the interfaces
23420         since we could be called recursively.
23421
23422 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
23423
23424         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
23425         function to implement stelem.ref in managed code
23426         * class-internals.h, debug-helpers.c: a new wrapper type
23427         for the above.
23428
23429 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
23430
23431         * gc.c: allow GC handles to work even when no GC is compiled in.
23432         Fix part of bug #61134 (GetAddrOfPinnedObject).
23433
23434 2004-07-13  Peter Williams  <peter@newton.cx>
23435  
23436         * process.c (complete_path): Make sure we don't attempt to execute
23437         directories.
23438  
23439 2004-07-12  Geoff Norton <gnorton@customerdna.com>
23440
23441         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
23442           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
23443           and will add/subtract the hour if needed
23444
23445 2004-07-12  Martin Baulig  <martin@ximian.com>
23446
23447         * reflection.c (mono_field_get_object): If we have
23448         `field->generic_info', take the attributes from
23449         `field->generic_info->generic_type'.    
23450
23451 2004-07-12  Martin Baulig  <martin@ximian.com>
23452
23453         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
23454         This function must be called before initializing the runtime.
23455         (mono_debug_init_1): New function; call this after initializing
23456         the runtime, but before loading the assembly.  It tells the
23457         debugger to load corlib and the builtin types.
23458
23459         * mono-debug-debugger.c: Did some larger changes in the debugging
23460         code; support recursive class declarations, make sure we actually
23461         add all classes.
23462
23463 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23464
23465         * debug-helpers.c: undo my previous patch and fixed the real issue in
23466         ../mini/exceptions-x86.c
23467
23468 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23469
23470         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
23471         when no HOME env. variable was set and a NullRef was thrown in a .cctor
23472         called from other .cctors.
23473
23474 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
23475
23476         * loader.c: Removed the mono_loader_wine_init hack now that we are
23477         doing a managed version of Windows.Forms.
23478
23479 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
23480
23481         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
23482         threadpool.c, threads.c: remove static data from rootset.
23483
23484 2004-07-09  Dick Porter  <dick@ximian.com>
23485
23486         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
23487         Don't do any more processing if the matched length was 0.  It was
23488         increasing the size of the string before.  Fixes bug 61167.
23489
23490 2004-07-09  Dick Porter  <dick@ximian.com>
23491
23492         * socket-io.h:
23493         * socket-io.c
23494         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
23495         Add support for SO_PEERCRED if its available.
23496
23497 2004-07-09  Peter Bartok <pbartok@novell.com>
23498         * loader.c: winelib.exe.so error message is now only displayed if
23499         MONO_DEBUG is set. To help us avoid questions when people are trying
23500         out the new Managed.Windows.Forms.
23501
23502 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
23503
23504         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
23505         for isinst and castclass wrappers.
23506
23507         * class-internals.h icall.c: Move registration and lookup of JIT icalls
23508         to libmetadata from the JIT, so they could be used by the marshalling
23509         code and the interpreter.
23510
23511         * marshal.c: Register marshalling related JIT icalls here instead of
23512         in mini.c. Use CEE_MONO_ICALL instead of the family of 
23513         CEE_MONO_PROC<x> opcodes to call marshalling functions.
23514
23515         * metadata.h: Remove unneeded marshalling conversions.
23516
23517         * opcodes.c: Update for new opcodes.
23518         
23519 2004-07-08  Martin Baulig  <martin@ximian.com>
23520
23521         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
23522         (mono_debug_get_domain_data): Make this function static.
23523
23524 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
23525
23526         * gc.c, object.h: add nice GC handle API for embedders.
23527
23528 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
23529
23530         * reflection.c: more changes for the new api
23531
23532         * object.c: When we reflect on a field w/ a constant value, it
23533         will not have a memory location, so we must access metadata. Also,
23534         allow easier reading of strings so that we can read them from
23535         the constant data.
23536
23537         * class.c (mono_class_layout_fields): no need for literal fields here.
23538
23539         * class-internals.h: api changes for const fields
23540
23541         * icall.c (ves_icall_get_enum_info): use new apis for const fields
23542
23543 2004-07-06  Martin Baulig  <martin@ximian.com>
23544
23545         * mono-debug.h: Increment version number to 44.
23546
23547         * mono-debug.c (mono_debug_add_wrapper): The second argument is
23548         now a gpointer, rewrote this whole method.
23549
23550         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
23551         function.  Add information about the wrapper in a new "misc table".
23552
23553         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
23554         for the new misc table.
23555
23556 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
23557
23558         * metadata-internals.h image.c: Add a cache for helper signatures.
23559
23560         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
23561
23562 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
23563
23564         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
23565         delegates from a delegate. Fixes #61033.
23566         
23567         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
23568         marshalling of stringbuilder arrays. Fixes #59900.
23569
23570 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
23571
23572         * icall.c: Add EnumBuilder:setup_enum_type icall.
23573
23574 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
23575
23576         * icall.c: Added a new icall for the property version of
23577         OffsetOfStringData.
23578
23579 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
23580
23581         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
23582         it has a constant size across platforms.
23583
23584         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
23585         stack trace.
23586
23587 2004-06-29  Martin Baulig  <martin@ximian.com>
23588
23589         * mono-debug.c (mono_debug_add_method): Protect the whole function
23590         in mono_debugger_lock(), not just parts of it.
23591
23592 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
23593
23594         * reflection.c: make sure padding bytes in heaps are zeroed.
23595
23596 2004-06-24  David Waite  <mass@akuma.org>
23597
23598         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
23599         image.c, loader.c, locales.c, marshal.c, metadata.c,
23600         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
23601         string-icalls.c, threads.c: change to C90-style comments from C99 /
23602         C++ -style
23603
23604 2004-06-24  Dick Porter  <dick@ximian.com>
23605
23606         * threads.c
23607         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
23608         return createdNew.  Fixes bug 60412.
23609
23610         * threads-types.h: 
23611         * icall.c: Add createdNew parameter to CreateMutex icall
23612
23613 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
23614
23615         * reflection.c, object-internals.h: save default value in params.
23616
23617 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23618
23619         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
23620         no need to build a new path combining that with the application base.
23621         Fixes bug #60442.
23622
23623 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
23624
23625         * reflection.c: fixed minor standard compliance issues.
23626
23627 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
23628
23629         * reflection.c: fixed issue with encoding some custom attributes
23630         (arrays in properties and fields, bug #60411).
23631
23632 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23633
23634         * reflection.c: fix start address when copying the public key token.
23635
23636 2004-06-23  Martin Baulig  <martin@ximian.com>
23637
23638         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
23639         the `exc' object in a static object to put it into the GC's root set.
23640
23641 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
23642
23643         * reflection.c: make mono_reflection_setup_internal_class ()
23644         callable a second time to setup a new parent class.
23645
23646 2004-06-23  Dick Porter  <dick@ximian.com>
23647
23648         * threads.c: Check for WAIT_IO_COMPLETION return values.
23649
23650 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
23651
23652         * appdomain.c: Removed the g_free on the public key token. Now copy 
23653         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
23654         * assembly.c: Added public key token string value when loading 
23655         assemblies. Fix bug #60439.
23656         * icall.c: Added missing informations (like public key) in 
23657         GetReferencedAssemblies. Fix #60519.
23658         * image.h: Changed definition for public key token from const char*
23659         public_tok_value to guchar public_key_token [17];
23660         * reflection.c: Updated for changes to public key token.
23661
23662 2004-06-22  Lluis Sanchez Gual
23663
23664         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
23665         for the field in base classes.
23666
23667 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
23668
23669         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
23670         mark headers as not supported, they are installed only for use by the
23671         debugger.
23672
23673 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
23674
23675         * *.c, *.h: avoid namespace pollution in public headers.
23676
23677 2004-06-21  Martin Baulig  <martin@ximian.com>
23678
23679         * exception.c (mono_get_exception_security): It's in
23680         "System.Security", not in "System".
23681
23682         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
23683         the exception classes.
23684
23685 2004-06-21  Martin Baulig  <martin@ximian.com>
23686
23687         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
23688         Protect the exception object from being finalized.
23689
23690 2004-06-21  Martin Baulig  <martin@ximian.com>
23691
23692         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
23693         public function.
23694
23695 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
23696
23697         * reflection.c: Load the assembly in mono_reflection_type_from_name,
23698         if it was not loaded before. Fix parts of #60439.
23699
23700 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
23701
23702         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
23703         code that was broken since Ben's change: wrappers are now
23704         dependent on the method signature only again.
23705
23706 2004-06-21  Martin Baulig  <martin@ximian.com>
23707
23708         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
23709         added interface support.
23710
23711 2004-06-21  Martin Baulig  <martin@ximian.com>
23712
23713         * class.c (mono_vtable_get_static_field_data): New public method.
23714
23715 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
23716
23717         * filewatcher.c : Windows build fix to be compliant with API changes.
23718
23719 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
23720
23721         * class.h, class.c: more accessors.
23722         * metadata.h, metadata.c: prepare for hiding MonoType and
23723         MonoMethodSignature: people should use the accessors from now on
23724         outside of the tree.
23725
23726 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
23727
23728         * *.c, *.h: more API cleanups.
23729
23730 2004-06-18  Jackson Harper  <jackson@ximian.com>
23731
23732         * assembly.c: Trace loading assemblies.
23733         * loader.c: Trace loading native libraries.
23734         * mono-config.c: Trace loading config files.
23735         
23736 2004-06-18  Dick Porter  <dick@ximian.com>
23737
23738         * locales.c: Tell ICU the lengths of strings, it can cope with
23739         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
23740
23741 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
23742
23743         * image.c: swapped name/filename;
23744
23745 2004-06-18  Martin Baulig  <martin@ximian.com>
23746
23747         * mono-debug-debugger.c (write_class): Write the parent class at
23748         the end of the header.
23749
23750 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
23751
23752         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
23753
23754 2004-06-17  Raja R Harinath  <rharinath@novell.com>
23755
23756         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
23757         (bundle_obj): New conditional define.
23758         (BUILT_SOURCES): Remove.
23759         ($(bundle_srcs)): Make parallel-make safe.
23760         (libmonoruntime_la_LIBADD): Make unconditional.
23761         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
23762         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
23763
23764 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
23765
23766         * culture-info-tables.h: It was inconsistent with the latest
23767           supp info files.
23768
23769 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
23770
23771         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
23772         be loaded.
23773
23774         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
23775         with gcc 2.95.
23776
23777 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
23778
23779         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
23780         cleaned up public header threads.h.
23781
23782 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
23783
23784         * Makefile.am, *.c, *.h: more API cleanups.
23785
23786 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
23787
23788         * Makefile.am: removed monosn from compilation.
23789         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
23790         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
23791         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
23792         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
23793         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
23794         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
23795
23796 2004-06-15  Jackson Harper  <jackson@ximian.com>
23797
23798         * assembly.c: Make locales lower case when searching the GAC for
23799         assemblies. gacutil will always make locales lowercase when
23800         installing so this effectively makes them case insensitive.
23801         
23802 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
23803
23804         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
23805         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
23806           parameter which allows to choose whether the wait can be interrupted or 
23807           not. Also added the method mono_monitor_enter(), which locks the monitor
23808           using an infinite wait and without allowing interruption.
23809           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
23810           interrupted.
23811         * object.h: Added new fields in MonoThread. suspend_event holds the event
23812           used to susped/resume the thread. synch_lock is the lock object to use for
23813           modifying the thread state.
23814         * threads.c: Use the new synch_lock object for locking, instead of "this",
23815           which can generate deadlocks.
23816           Moved thread state change in Thread.Sleep and Thread.Join from managed
23817           to unmanaged code. This avoids a deadlock when the thread was suspended
23818           just after acquiring the thread lock.
23819           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
23820           Implemented Thread.Suspend using an event instead of ThreadSuspend,
23821           which is not fully implemented in the io-layer.
23822         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
23823
23824 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
23825
23826         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
23827         threads-types.h: more API cleanups.
23828
23829 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
23830
23831         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
23832         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
23833         threadpool.c, threads.c: first pass at the exported API cleanup.
23834
23835 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
23836
23837         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
23838
23839 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23840
23841         * icall.c: added internalGetHome.
23842
23843 2004-06-14  Dick Porter  <dick@ximian.com>
23844
23845         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
23846         possible to return successfully when '.' or '..' were the only
23847         entries in a directory, but were skipped.  The MonoIOStat was not
23848         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
23849         Fixes bug 59574.
23850
23851 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
23852
23853         * reflection.c: make binaries run on .Net 1.1 by default.
23854
23855 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
23856
23857         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
23858
23859 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
23860
23861         * marshal.c: keep track of struct size with explicit layout
23862         (bug #59979).
23863
23864 2004-06-12  Martin Baulig  <martin@ximian.com>
23865
23866         * mono-debug-debugger.c: Comment out a debugging g_message().
23867
23868 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
23869
23870         * reflection.c, reflection.h: do not free custom attrs that are cached.
23871         * icall.c: use braces to make code clearer.
23872
23873 2004-06-11  Martin Baulig  <martin@ximian.com>
23874
23875         * class.h (MonoInflatedField): New type.
23876         (MonoClassField): Replaced `MonoType *generic_type' with
23877         `MonoInflatedField *generic_info'.
23878
23879         * icall.c
23880         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
23881
23882 2004-06-11  Martin Baulig  <martin@ximian.com>
23883
23884         * reflection.c (mono_image_create_method_token): Correctly encode
23885         varargs methods.
23886
23887 2004-06-11  Martin Baulig  <martin@ximian.com>
23888
23889         * metadata.c (mono_metadata_parse_method_signature): When parsing
23890         a MethodDef which has VarArgs, also set sentinelpos if we don't
23891         have any parameters.
23892
23893 2004-06-11  Martin Baulig  <martin@ximian.com>
23894
23895         * verify.c (mono_method_verify): In CEE_CALL, use
23896         mono_method_get_signature() to get the method's signature, unless
23897         we're a PInvoke method.
23898
23899 2004-06-10  Jackson Harper  <jackson@ximian.com>
23900
23901         * assembly.c: Use <path>/lib/mono/gac for the extra paths
23902         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
23903         logical name as the supplied path is just a prefix to the gac not
23904         the direct path to it.
23905         
23906 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
23907
23908         * reflection.c: make the token for a created method match
23909         the token of the MethodBuilder it was created from
23910         (IKVM requires this behaviour now).
23911
23912 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
23913
23914         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
23915         reflection.c, socket-io.c: leak fixes.
23916
23917 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
23918
23919         * icall.c: handle sentinel pos in vararg methods in position different
23920         from 0.
23921
23922 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23923
23924         * culture-info-tables.h: freshly generated.
23925
23926 2004-06-09  Martin Baulig  <martin@ximian.com>
23927
23928         * loader.c (mono_get_method_constrained): Call `mono_class_init
23929         (constrained_class)'.   
23930
23931 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
23932
23933         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
23934         any methods. Fixes #59629.
23935
23936 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
23937
23938         * culture-info-tables.h: reflecting locale-builder updates.
23939
23940 2004-06-08  Dick Porter  <dick@ximian.com>
23941
23942         * object.h:
23943         * locales.c: Fixed compile warnings, including a real bug in
23944         CompareInfo_internal_compare.
23945         
23946 2004-06-08  Dick Porter  <dick@ximian.com>
23947
23948         * locales.c
23949         (ves_icall_System_Globalization_CompareInfo_internal_index):
23950         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
23951         Double-check the resuls of usearches, because ICU currently
23952         ignores most of the collator settings here.  Fixes bug 59720.
23953         
23954 2004-06-08  Dick Porter  <dick@ximian.com>
23955
23956         * locales.c
23957         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
23958         Fix memory leak and segfault-causing typo.  No idea how this one
23959         lasted so long without being noticed.
23960
23961 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
23962
23963         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
23964         any methods. Fixes #59629.
23965
23966 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23967
23968         * assembly.c:
23969         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
23970         own the critical section before). Removed dead code (that's done
23971         in the preload hook).
23972
23973         (mono_assembly_load_with_partial_name): call the preload hook.
23974
23975 2004-06-08  Martin Baulig  <martin@ximian.com>
23976
23977         * metadata.c (mono_metadata_signature_alloc): Default
23978         `sentinelpos' to -1.
23979
23980         * reflection.c (mono_image_get_array_token): Likewise.
23981
23982 2004-06-08  Martin Baulig  <martin@ximian.com>
23983
23984         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
23985
23986         * metadata.c (mono_metadata_parse_method_signature): When parsing
23987         a MethodDef which has VarArgs, set sentinelpos.
23988
23989         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
23990         `gint16' since we're using -1 for non-varargs methods.
23991
23992         * reflection.c
23993         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
23994         (method_encode_signature): Added varargs support.
23995         (method_builder_encode_signature): Likewise.
23996         (mono_image_get_varargs_method_token): New static method.
23997         (mono_image_create_method_token): New public method; this is
23998         called via an icall instead of mono_image_create_token() when
23999         calling a varargs method.       
24000
24001 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
24002
24003         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
24004
24005 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24006
24007         * culture-info-tables.h : Reflecting the latest locale-builder that
24008           fixed empty array representation ({} to {0}).
24009
24010 2004-06-07  Jackson Harper  <jackson@ximian.com>
24011
24012         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
24013         looking up extra gac paths. This allows MONO_GAC_PATH to act
24014         exactly like a prefix.
24015         
24016 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24017
24018         * reflection.c (mono_reflection_type_from_name): Make a copy of the
24019         type name before modifying it. Fixes #59405.
24020
24021 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
24022
24023         * culture-info.h: added fields for "all datetime patterns".
24024         * locales.c: (  ves_icall_System_Globalization_CultureInfo
24025           _construct_datetime_format ()): fill xxx_patterns fields.
24026         * object.h: added fields for "all datetime patterns" to
24027           MonoDateTimeFormatInfo.
24028         * culture-info-tables.h: reflecting locale-builder updates.
24029
24030 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
24031
24032         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
24033         the event has no add and remove methods. Fixes #59629.
24034
24035 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
24036
24037         * object.c: Fixed possible integer overflow when allocating large
24038         strings.
24039
24040 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24041
24042         * culture-info-tables.h: reflecting locale-builder updates.
24043
24044 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
24045
24046         * culture-info-tables.h: reflecting locale-builder updates.
24047
24048 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
24049
24050         * culture-info-tables.h: reflecting locale-builder updates.
24051
24052 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
24053
24054         * threads.c: Made Thread.Sleep abortable.
24055
24056 2004-06-02  Martin Baulig  <martin@ximian.com>
24057
24058         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
24059
24060         * debug-mono-symfile.h: Bumped symbol file version number to 37.
24061
24062 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
24063
24064         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
24065
24066 2004-05-30  Jackson Harper  <jackson@ximian.com>
24067
24068         * reflection.c: Do not hardcode assembly versions or public key
24069         tokens anymore. All of this except the corlib section was dead
24070         code anyways.
24071         
24072 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
24073
24074         * object.c (mono_runtime_invoke_array): Automatically create boxed
24075         objects for byref valuetypes if needed. Fixes #59300.
24076         
24077         * object.c (mono_method_return_message_restore): Handle 
24078         MONO_TYPE_OBJECT as well.
24079
24080 2004-05-28  Jackson Harper  <jackson@ximian.com>
24081
24082         * reflection.c: The modified type encoding was causing build
24083         problems. Reverted for now.
24084         
24085 2004-05-28  Jackson Harper  <jackson@ximian.com>
24086
24087         * reflection.c/h: Take an assembly ref so that we dont create
24088         fully qualified names when encoding types in the same assembly as
24089         the custom attribute being emitted.
24090         * appdomain.c: Increment version number.
24091         
24092 2004-05-26  Duncan Mak  <duncan@ximian.com>
24093
24094         * icall.c
24095         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
24096         Set the full version number (major, minor, build, revision).
24097
24098 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
24099
24100         * marshal.c (emit_struct_conv): increment src/dst after blit
24101         (mono_marshal_get_managed_wrapper,
24102         mono_marshal_get_native_wrapper): make sure we have marshalling
24103         info before marshalling params (info computation affects
24104         blittable)
24105
24106         * class.c (class_compute_field_layout): correctly deal with
24107         blittable
24108         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
24109         value types (as per what windows dows by default)
24110         (mono_class_setup_mono_type): System.ValueType is blittable
24111         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
24112         blittable
24113
24114         * marshal.c (mono_marshal_load_type_info): flag types  as
24115         non-blittable if the native layout doesn't match the managed
24116         layout
24117
24118 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24119
24120         * appdomain.c: don't add stuff in the private search path that is
24121         above the application base. If application base is not set, there's
24122         no private search path.
24123
24124 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
24125
24126         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
24127         byref struct arguments in native->managed marshalling.
24128
24129 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
24130
24131         * marshal.c (mono_marshal_get_runtime_invoke): correctly
24132         cache methods using signature (special case for methods
24133         that are value type or string class)
24134         
24135         * image.c (mono_image_close): clean up allocated GSList's
24136         in runtime_invoke_cache.
24137
24138 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24139
24140         * mono-config.c: set the correct path for mono_cfg_dir on windows when
24141         there's no MONO_CFG_DIR environment variable defined.
24142
24143 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24144
24145         * threads.c: windows version must be >= 0x0500 to include OpenThread.
24146
24147 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
24148
24149         * threadpool.c: Really wait for 500ms after the async call, even if the wait
24150           is interrumped.
24151         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
24152           before waiting for it, and call CloseHandle after the wait to unref it.
24153           This will make sure that handles are not disposed too early.
24154
24155 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24156
24157         * appdomain.c:
24158         * appdomain.h:
24159         * icall.c: removed
24160         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
24161         needed now.
24162
24163         * object.c: se the application_base only for the domain that runs
24164         Main. Fixes bug #59216,
24165
24166 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24167
24168         * appdomain.c:
24169         * object.c: only the domain in which Main is run have
24170         SetupInformation.ConfigurationFile set, so moved a few lines from
24171         appdomain.c to object.c.
24172
24173 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24174
24175         * appdomain.c: we tried to load [name].(dll|exe), but according
24176         to bug #57710, we must also try [culture]/[name].(dll|exe) and
24177         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
24178         There's a test case attached to bug #58922.
24179
24180 2004-05-27  Dick Porter  <dick@ximian.com>
24181
24182         * icall.c:
24183         * file-io.c: Implemented icalls for locking and unlocking regions
24184         in a file.
24185         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
24186         FALSE on error (fixes both compiler warning and real bug.)
24187
24188 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
24189
24190         * culture-info-tables.h: reflecting locale-builder updates.
24191
24192           (Added missing ChangeLog entry for 05/26)
24193
24194 2004-05-27  Jackson Harper  <jackson@ximian.com>
24195
24196         * locales.c: Fix some cut and paste errors.
24197         
24198 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24199
24200         * mono-config.c: set the correct path for config. directory on windows.
24201
24202 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
24203
24204         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
24205           on win32.
24206
24207 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
24208
24209         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
24210         from pinvoke functions.
24211         
24212         * marshal.c (mono_ftnptr_to_delegate): Implement this.
24213
24214 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
24215
24216         * culture-info-tables.h: reflecting locale-builder updates.
24217
24218 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
24219
24220         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
24221         #59086.
24222
24223 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
24224
24225         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
24226         * icall.c: Modified icalls for RNG.
24227         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
24228         Windows (CryptoAPI).
24229
24230 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
24231
24232         * locales.c: Fix build.
24233
24234 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
24235
24236         * culture-info-tables.h: reflecting locale-builder updates.
24237
24238 2004-05-25  Jackson Harper  <jackson@ximian.com>
24239
24240         * locales.c: When creating the current culture use the $LANGs
24241         specific culture. So DateTimeFormat and NumberFormat entries are created.
24242         
24243 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
24244
24245         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
24246         a char array as parameter.
24247
24248 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
24249
24250         * image.c: In mono_image_open(), always use an absolute path name to
24251           look for already loaded images.
24252
24253 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
24254
24255         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
24256         missing in the windows build (like older cygwin include files).
24257
24258 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
24259
24260         * icall.c: Fixed check for possible integer overflow in Buffer_
24261         BlockCopy icall. Replaced comments style // by /* */.
24262
24263 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
24264
24265         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
24266         
24267         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
24268         check after MONO_VTADDR. Fixes pinvoke2.exe.
24269
24270         * marshal.h marshal.c metadata.h: Add beginnings of support for
24271         ftnptr -> delegate marshalling.
24272
24273 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
24274
24275         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
24276         * threads.c: Fix warnings.
24277
24278 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
24279
24280         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
24281         * icall.c: Registered icalls for Suspend and Resume.
24282         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
24283           Thread.Abort.
24284         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
24285         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
24286         * process.c: Use WaitForSingleObjectEx.
24287         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
24288           checkpoints.
24289         * threads.c, threads.h: Make use of new Ex wait methods. Improved
24290           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
24291           for Suspend and Resume. Added new mono_thread_stop, used for stoping
24292           background threads. Added basic support for Abort in Windows.
24293           Start new threads using a managed delegate invoke wrapper. This wrapper
24294           has an interruption checkpoint that is needed since an interruption
24295           can be requested before the thread leaves the unmanaged code that starts 
24296           the thread.
24297         * marshal.c: Added interruption checkpoint after every native call, and
24298           also before managed calls for wrappers called from unmanaged code to
24299           go into managed code.
24300         * object.h: Added new field in MonoThread to keep track of interruption
24301           requests.
24302
24303 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
24304
24305         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
24306         calls.
24307
24308 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24309
24310         * appdomain.c:
24311         * assembly.c:
24312         * gc.c:
24313         * locales.c:
24314         * mono-config.c:
24315         * rand.c: getenv -> g_getenv (windows!)
24316
24317         * process.c: complete_path is also used on non-windows platforms.
24318
24319 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24320
24321         * icall.c: new signature for Process_Start.
24322
24323         * process.[ch]: new signature for Process_Start. If we're on windows
24324         and UseShellExecute is false, we have to search for the program by
24325         ourselves if we don't get a full path.
24326
24327 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
24328
24329         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
24330         marshalling and call CleanUpNativeData if needed. Fixes #58646.
24331
24332 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24333
24334         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
24335         Fixes bug #58373.
24336
24337 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24338
24339         * process.c: use double quotes to quote program name and arguments on
24340         windows. Fixes bug #58575.
24341
24342 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24343
24344         * file-io.c: don't return "." and ".." when using windows Find*File.
24345
24346 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
24347
24348         * marshal.c: Don't pass wrappers to message init because method 
24349         addressed used to lookup metadata. part of remoting[2|3] fix.
24350
24351 2004-05-15  Jackson Harper  <jackson@ximian.com>
24352
24353         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
24354         path is essentially the same as MONO_PATH except that it points to
24355         GACs instead of lib directories.
24356         * loader.h: The user gac is gone so we dont need function to
24357         enable/disable it.
24358         * mono-config.c: user gac option is now gone.
24359         
24360 2004-05-15  Jackson Harper  <jackson@ximian.com>
24361
24362         * culture-info.h: Make defines more consistent, add calendar data
24363         to the culture info table.
24364         * culture-info-tables.h: Add basic calendar data. Basically
24365         everyone gets default gregorian until all the data is
24366         updated.
24367         * locales.c: Use the new consistent defines. Set calendar data for
24368         culture info objects.
24369         * object.h: add a field for calendar data to CultureInfo
24370         
24371 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
24372
24373         * image.c: image->runtime_invoke_cache is keyed on signatures now.
24374         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
24375         a signature.
24376         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
24377         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
24378         an extra param that is the pointer of the method to invoke. The IL for
24379         the invoke method is no longer specific to the method, but to the
24380         signature of the method. Thus, we can share the same code for multiple
24381         methods. This reduces the number of methods that have to be compiled.
24382
24383 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
24384
24385         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
24386
24387         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
24388
24389         * icall.c: Optimize Buffer.BlockCopy.
24390
24391 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24392
24393         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
24394         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
24395         quote). Changed them to "MMMM yyyy".
24396
24397 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
24398
24399         * rand.c
24400         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
24401
24402 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
24403
24404         * reflection.h: Updated after changes to managed structures.
24405
24406         * appdomain.c: Bump corlib version.
24407
24408 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24409
24410         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
24411         windows.
24412
24413 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24414
24415         * Makefile.am: link to ../os/libmonoos.la on windows.
24416
24417         * assembly.c:
24418                 -If MONO_DEBUG, warn about non-existing directories in
24419                 MONO_PATH.
24420                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
24421                 compile time variable.
24422                 -Removed init_default_path and call mono_set_rootdir from
24423                 libmonoos.a instead (windows only).
24424
24425         * assembly.h: declare mono_assembly_getrootdir().
24426
24427         * domain.c:
24428         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
24429
24430         * loader.c: s/getenv/g_getenv/
24431
24432 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
24433
24434         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
24435
24436         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
24437
24438         * metadata.h: Add new marshalling conversions.
24439
24440         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
24441         function.
24442
24443         * reflection.c (mono_reflection_get_type): Lookup the type in all
24444         modules of a multi-module assembly. Fixes #58291.
24445
24446 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
24447
24448         * threads.c: Before aborting a background, set the StopRequested
24449         state.  This avoids throwing the Abort exception.
24450         In mono_thread_manage, don't continue with the shutdown until all
24451         aborted threads have actually stopped.
24452
24453 2004-05-10  Jackson Harper  <jackson@ximian.com>
24454
24455         * locales.c: Remove the modifier from culture names.
24456         
24457 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24458
24459         * Makefile.am: monosn is not installed any more. It has been deprecated
24460         in favor of sn.
24461
24462 2004-05-07  Jackson Harper  <jackson@ximian.com>
24463
24464         * locales.c
24465         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
24466         Fix array construction, add bailout if the length is 0.
24467
24468 2004-05-07  Dick Porter  <dick@ximian.com>
24469
24470         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
24471         machine doesn't have a DNS entry.  Patch by Urs Muff
24472         (umuff@quark.com), fixes bug 57928.
24473
24474 2004-05-06  Jackson Harper  <jackson@ximian.com>
24475
24476         * reflection.c: Handle null PublicTokens properly. alloc mem for
24477         assembly names culture so we dont crash when freeing it.
24478         
24479 2004-05-06  Jackson Harper  <jackson@ximian.com>
24480
24481         * assembly.c: Check the usergac when loading with partial names.
24482         
24483 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
24484
24485         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
24486         does nothing for now (not required for Linux/Windows) but the class
24487         library can call it (and a newer or modified runtime could need it).
24488         * icall.c: Registred icall.
24489
24490 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24491
24492         * loader.c: prints a message on module loading error we set MONO_DEBUG
24493         environment variable.
24494
24495 2004-05-05  Jackson Harper  <jackson@ximian.com>
24496
24497         * appdomain.c: Handle PublicKeyToken=null properly.
24498         
24499 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
24500
24501         * environment.c|h: Added icall ves_icall_System_Environment_
24502         GetOSVersionString to get the current OS version as a string.
24503         * icall.c: Registred icall.
24504
24505 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
24506
24507         * object.c: in mono_object_get_virtual_method(), take into account that
24508         non-virtual methods don't have a slot in the vtable. Check needed when
24509         the object is a proxy.
24510
24511 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
24512
24513         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
24514         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
24515
24516         * object.c (mono_class_compute_gc_descriptor): Fix warning.
24517
24518         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
24519         passed when a valuetype is expected.
24520
24521         * object.c (mono_unhandled_exception): Only set the exit code if the
24522         exception happens in the main thread. Fixes thread5.exe.
24523
24524         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
24525         invalid names. Fixes #58047.
24526
24527 2004-05-03  Jackson Harper  <jackson@ximian.com>
24528
24529         * assembly.c: This line was committed accidently and is unneeded.
24530         
24531 2004-05-03  Jackson Harper  <jackson@ximian.com>
24532
24533         * icall.c: Add new icall for Assembly::LoadWithPartialName
24534         * assembly.c/.h: new function that probes the GAC to load partial
24535         assembly names by Paolo Molaro.
24536         
24537 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24538
24539         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
24540         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
24541         (type_get_fully_qualified_name): Added PublicKeyToken when building a
24542         full type name.
24543
24544 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24545
24546         * appdomain.c: fixed check for 'neutral' culture and removed warning.
24547         * reflection.c: fix bug when parsing a full type name and Version is not
24548         the last thing in the string.
24549
24550 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
24551
24552         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
24553         crashes when it is freed.
24554
24555 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24556
24557         * assembly.c: print the compat warning to stderr.
24558
24559 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
24560
24561         * assembly.c (mono_assembly_load_references): Add a compatibility
24562         hack to run old applications that might be still referencing the
24563         3300-based assemblies, only do this for System.xxx.
24564
24565 2004-05-01  Jackson Harper  <jackson@ximian.com>
24566
24567         * appdomain.c: If the culture is neutral we set it to "".
24568         
24569 2004-04-29  Jackson Harper  <jackson@ximian.com>
24570
24571         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
24572
24573 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
24574  
24575         * string-icalls.c: added low overhead function for copying chars
24576         * icall.c: added needed icall for the above function
24577  
24578 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24579
24580         * icall.c: fix return value of get_global_assembly_cache.  Implemented
24581         Environment.GetLogicalDrives.
24582
24583 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
24584
24585         * rand.c: try and talk to egd or prngd
24586         for random bytes if opening devices fail.
24587
24588 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
24589
24590         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
24591         alignment for the type using the native alignment of its members 
24592         instead of using klass->min_align.
24593
24594         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
24595
24596 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24597
24598         * file-io.c:
24599         * socket-io.c: added check for sys/aio.h.
24600
24601 2004-04-28  Dick Porter  <dick@ximian.com>
24602
24603         * threads.c: Don't abort a thread thats already aborting, when
24604         terminating everything.
24605
24606 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24607
24608         * icall.c: added 2 new async calls for Socket.
24609
24610         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
24611         IO on *nix systems.
24612
24613         * threadpool.c: removed unused variable.
24614
24615 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
24616
24617         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
24618
24619 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
24620
24621         * locales.c: put back string_invariant_tolower () and
24622         string_invariant_toupper ().
24623
24624 2004-04-26 David Waite <mass@akuma.org>
24625
24626         * file-io.h:
24627         * socket-io.h:
24628         * threads.h:
24629         * unicode.h: remove comma from end of enumeration declarations
24630
24631 2004-04-26 David Waite <mass@akuma.org>
24632
24633         * debug-mono-symfile.h:
24634         * decimal.c:
24635         * mono_debug.h:
24636         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
24637
24638
24639 2004-04-26  Jackson Harper  <jackson@ximian.com>
24640
24641         * appdomain.c: Increment version number.
24642         
24643 2004-04-26  Jackson Harper  <jackson@ximian.com>
24644
24645         * appdomain.c: Set assembly references public token value when
24646         PublicKeyToken is specified, not the hash_value. Free public token
24647         values when free assembly name data. Previously the public key
24648         token was hex decoded, however we are using hex encoded public key
24649         tokens, so this is not neccasary.
24650         * assembly.c: Lookup assemblies in the gac if their public token
24651         value is set. Add function to allow enabling user gac
24652         lookups. Specify whether or not the assembly was loaded from the
24653         GAC. Compare full assembly names when checking the cache for
24654         assemblies (Temporarily disabled see comment in code). Remove
24655         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
24656         specifies trace-loader they get extra info to stdout on the
24657         loading of assemblies.
24658         * image.h: Add a field for an assembly references public token
24659         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
24660         whether an assembly has been loaded from the GAC.
24661         * image.c: Remove a corlib -> mscorlib name mapping.
24662         * loader.h: Add function to enable/disable the user gac.
24663         * mono-config.c: Check if the usergac is enabled in the config
24664         file.
24665         * icall.c: New icall to determine whether or not an assembly has
24666         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
24667         * tabldefs.h: Add constant for assemblyref flag that specifies a
24668         full public key is used instead of a public token.
24669         * reflection.c: Remove mscorlib -> corlib mappings. Set
24670         PublicTokenValue instead of hash value. This value is a hex
24671         string so it does not need to be expanded.
24672
24673 2004-04-26  Martin Baulig  <martin@ximian.com>
24674
24675         * mono-debug-debugger.c (mono_debugger_initialize): Set
24676         `mono_debugger_initialized' before calling mono_debug_lock().
24677
24678 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
24679
24680         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
24681           InternalToUpper/InternalToLower.
24682         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
24683           removed invariant culture shortcut.  This is now done in managed code.
24684         * locales.c: (string_invariant_toupper/tolower) removed.
24685
24686 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24687
24688         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
24689         Added Poll internal call.
24690
24691         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
24692         call for Poll. Select was too heavy for polling a single socket.
24693
24694         * threadpool.[ch]: added mono_threadpool_cleanup.
24695         * threads.c: use it. Don't use Thread_Abort on windows.
24696
24697 2004-04-23  Martin Baulig  <martin@ximian.com>
24698
24699         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
24700
24701 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
24702
24703         * icall.c: Registred new icalls for key pair protection and added an
24704         icall for Environment.GetFolderPath on Windows.
24705         * security.c|h: Added new icalls for key pair protection.
24706
24707 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24708
24709         * socket-io.c: don't display the non-supported family warning for known
24710         families. Now this is not displayed on windows when checking support
24711         for IPv4/IPv6.
24712
24713 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24714
24715         * class.c: don't display the layout warning for static fields.
24716
24717 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
24718
24719         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
24720         * locales.c, locales.h: Added new icalls for culture-specific
24721         Char.ToLower and Char.ToUpper.
24722
24723 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24724
24725         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
24726         by David Waite.
24727
24728 2004-04-20  Martin Baulig  <martin@ximian.com>
24729
24730         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
24731         of the type name before passing it to mono_reflection_type_from_name().
24732
24733 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
24734
24735         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
24736         encodings here. Fixes #56965.
24737
24738 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
24739
24740         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
24741         fix test on strstr result not that I can see anything that
24742         relies on the result.
24743
24744 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
24745
24746         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
24747         Fixes #57081.
24748
24749         * marshal.c (mono_marshal_get_string_encoding): New helper function.
24750
24751         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
24752         function to determine which marshalling to use for strings. Fixes
24753         #56965.
24754
24755         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
24756
24757         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
24758
24759 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
24760
24761         * icall.c: #include mono-config.h
24762
24763 2004-04-15  Jackson Harper  <jackson@ximian.com>
24764
24765         * culture-info-tables.h: Fix date formats for en-US culture.
24766         
24767 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
24768
24769         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
24770         ThreadPool.SetMinThreads.
24771         * threadpool.c: Implemented ThreadPool.GetMinThreads and
24772         ThreadPool.SetMinThreads.
24773
24774 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
24775
24776         * mono-config.c: also load the .config file in the directory
24777         where the assembly was found.
24778
24779 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
24780
24781         * assembly.c: load per-assembly config files.
24782         * icall.c: decrapified code to get the config dir and moved to
24783         mono-config.c.
24784         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
24785         per-assembly config files. When doing a dll map lookup give precedence
24786         to the per-assembly data.
24787
24788 2004-04-14  Martin Baulig  <martin@ximian.com>
24789
24790         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
24791         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
24792         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
24793
24794         * mono-debugger-debugger.c: While the debugger is locked, remember
24795         whether the symbol tables have changes and send one single
24796         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
24797
24798 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
24799
24800         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
24801
24802         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
24803         function.
24804
24805         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
24806         account when marshalling string arrays. Fixes #56965.
24807
24808 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
24809
24810         * icall.c: Add new icalls mapping for security.
24811         * security.c|h: Add internal calls for WindowsIdentity,
24812         WindowsImpersonationContext and WindowsPrincipal.
24813
24814 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
24815
24816         * class.c: Added comment to ensure the System.MonoDummy class
24817         is removed when no longer necessary
24818
24819 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
24820
24821         * appdomain.c: Pass arguments to the bootstraping exceptions to
24822         minimize JITed methods at boot
24823
24824         * metadata.c (mono_exception_from_name_two_strings): Allow for the
24825         second string to be null.
24826
24827         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
24828         Change the protocol to minimize the JIT methods at startup.  Now
24829         it Returns the internal codepage, if the value of "int_code_page"
24830         is 1 at entry, and we can not compute a suitable code page
24831         number, returns the code page as a string.
24832
24833 2004-04-13  Jackson Harper  <jackson@ximian.com>
24834
24835         * culture-info-tables.h: Fix number of decimal digits for all
24836         english locales.
24837
24838 2004-04-13  Jackson Harper  <jackson@ximian.com>
24839
24840         * icall.c: Clairfy out of sync error message. It is not always
24841         your corlib that is out of sync.
24842
24843 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
24844
24845         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
24846         properties when only the set accessor is overriden. Fixes #55874.
24847
24848 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
24849
24850         * assembly.c (mono_assembly_load_references): Make this thread safe.
24851         Fixes #56327.
24852
24853 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
24854
24855         * monosn.c: Add missing initialization calls.
24856
24857 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
24858
24859         * locales.c:
24860         ves_icall_System_Globalization_CultureInfo_construct_number_format
24861         Fix g_assert so it compiles on fussier compilers re int/ptr
24862         mismatch
24863
24864 2004-04-08  Dick Porter  <dick@ximian.com>
24865
24866         * socket-io.h:
24867         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
24868         53992.  Also rearrange the code so that the internal calls return
24869         an error value and exceptions are thrown from managed code.
24870
24871         * icall.c: Add type info to the socket icalls.
24872
24873 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24874
24875         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
24876         owes me a beer.
24877
24878 2004-04-07  Martin Baulig  <martin@ximian.com>
24879
24880         * class.c (mono_class_from_generic_parameter): Don't default
24881         `klass->parent' to `mono_defaults.object_type'.
24882
24883 2004-04-07  Martin Baulig  <martin@ximian.com>
24884
24885         * reflection.c (mono_reflection_initialize_generic_parameter): Set
24886         `param->pklass->reflection_info'.       
24887
24888 2004-04-07  Jackson Harper  <jackson@ximian.com>
24889
24890         * culture-info-tables.h: Fix date separator symbol.
24891         
24892 2004-04-07  Martin Baulig  <martin@ximian.com>
24893
24894         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
24895         from System.Type to System.MonoType.
24896
24897 2004-04-07  Martin Baulig  <martin@ximian.com>
24898
24899         * reflection.h
24900         (MonoReflectionGenericParam): Added `has_reference_type' and
24901         `has_value_type' fields.
24902
24903         * reflection.c (mono_image_get_generic_param_info): Encode the
24904         correct flags if we have the `class' or `struct' constraint.
24905
24906 2004-04-07  Martin Baulig  <martin@ximian.com>
24907
24908         * reflection.h
24909         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
24910
24911 2004-04-07  Jackson Harper  <jackson@ximian.com>
24912
24913         * appdomain.c: Revert extra patches, just wanted to bump the
24914         version number.
24915         
24916 2004-04-07  Jackson Harper  <jackson@ximian.com>
24917
24918         * Makefile.am: Add culture-info private headers.
24919         * icall.c: Add new icalls for contructing locales.
24920         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
24921         * locales.h: Declare new culture info construction methods.
24922         * object.h: Add new fields used to avoid the CultureMap to
24923         MonoCultureInfo.
24924         * culture-info.h: Definition of structs used in the culture info
24925         tables.
24926         * culture-info-tables.h: Autogenerated tables that contain culture
24927         info data. This file was generated with the locale-builder tool.
24928         * appdomain.c: Incement corlib version number.
24929         
24930 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
24931
24932         * appdomain.c: (mono_runtime_init) move mono_thread_init
24933         to before mono_object_new calls so critical sections
24934         are initialized before use.
24935
24936 2004-04-07  Martin Baulig  <martin@ximian.com>
24937
24938         * icall.c
24939         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
24940         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
24941         (ves_icall_MonoGenericParam_initialize): Removed.
24942         (monogenericparam_icalls): Removed.
24943         (generictypeparambuilder_icalls): Added new table for
24944         System.Reflection.Emit.GenericTypeParameterBuilder.
24945
24946         * reflection.c
24947         (mono_reflection_define_generic_parameter): Removed.
24948         (mono_reflection_initialize_generic_parameter): This is now called
24949         from GenericTypeParameterBuilder's .ctor.
24950
24951 2004-04-06  Martin Baulig  <martin@ximian.com>
24952
24953         * class.c (mono_class_init): Don't inflate nested classes in a
24954         generic instance.
24955         (mono_type_get_name_recurse): Include the generic arguments for
24956         generic instances and generic type declarations.
24957         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
24958         (_mono_class_get_instantiation_name): Removed.
24959         (mono_class_create_generic): Always use `gklass->name' as our name.
24960
24961         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
24962
24963         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
24964         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
24965         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
24966         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
24967         closed generic methods here.
24968
24969         * reflection.c
24970         (mono_reflection_generic_inst_get_nested_types): Removed.
24971         (inflate_mono_method): Copy the generic parameters from the
24972         MonoMethodHeader into out MonoGenericMethod.
24973
24974 2004-04-06  Martin Baulig  <martin@ximian.com>
24975
24976         * row-indexes.h
24977         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
24978
24979         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
24980
24981         * reflection.c (build_compressed_metadata): If we have any entries
24982         in the GenericParam, MethodSpec or GenericParamConstraint tables,
24983         set the header version to 1.1.
24984
24985 2004-04-06  Martin Baulig  <martin@ximian.com>
24986
24987         * class.c (mono_class_init): If we're a generic instance,
24988         initialize our nested classes, too.
24989         (_mono_class_get_instantiation_name): Deal with the new `!%d'
24990         suffix. 
24991
24992 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
24993
24994         * process.c: quote the argument passed to the shell on windows.
24995
24996 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
24997
24998         * threads.c (mono_alloc_special_static_data): Allow this to be
24999         called during startup.
25000
25001 2004-04-02  Martin Baulig  <martin@ximian.com>
25002
25003         * icall.c
25004         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
25005
25006 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
25007
25008         * icall.c: Fix build.
25009
25010 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
25011
25012         * Makefile.am: Added security.c|h.
25013         * icall.c: Added icall for get_UserName;
25014         * security.c: New file for security related icalls. Added function
25015         get_UserName for System.Environment (fix #56144).
25016         * security.h: New. Header file for security.c
25017
25018 2004-04-02  Dick Porter  <dick@ximian.com>
25019
25020         * icall.c: Deleted the icalls that were obsoleted some time ago
25021         by the ICU string code, and which were mixed into the icall
25022         rearranging.  Fixes bug 55969.
25023
25024         * string-icalls.h: 
25025         * string-icalls.c: Deleted the code that those icalls reference.
25026
25027 2004-04-01  Martin Baulig  <martin@ximian.com>
25028
25029         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
25030
25031         * class.c (mono_class_from_generic_parameter): Don't set 
25032         TYPE_ATTRIBUTE_INTERFACE.
25033         (my_mono_class_from_generic_parameter): Likewise.
25034
25035 2004-04-01  Martin Baulig  <martin@ximian.com>
25036
25037         * loader.c (find_method): Added an optional `MonoClass *ic'
25038         argument to search in a specific interface.
25039         (mono_get_method_constrained): New public function.
25040
25041 2004-04-01  Martin Baulig  <martin@ximian.com>
25042
25043         * reflection.c (mono_image_get_generic_field_token): Use the
25044         `handleref' cache here.
25045
25046 2004-04-01  Martin Baulig  <martin@ximian.com>
25047
25048         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
25049
25050         * reflection.c (create_generic_typespec): Use the `typespec' hash
25051         here, not the `typeref' one.    
25052
25053 2004-04-01  Martin Baulig  <martin@ximian.com>
25054
25055         * class.c (mono_class_inflate_generic_type): Moved the
25056         functionality into a new static inflate_generic_type() which
25057         returns NULL if it didn't do anything.  Only increment the
25058         `mono_stats.inflated_type_count' if we actually inflated
25059         something.
25060         (mono_class_get_full): Check the classes type to see whether we
25061         need to inflate it; also inflate MONO_TYPE_(M)VAR.
25062
25063 2004-04-01  Jackson Harper  <jackson@ximian.com>
25064
25065         * reflection.c: Set culture for assembly references.
25066         
25067 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
25068
25069         * reflection.[ch], icall.[ch], Fix support for pinning variables.
25070
25071 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25072
25073         * assembly.c:
25074         (do_mono_assembly_open): the critical section also covers
25075         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
25076
25077 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25078
25079         * threads.c:
25080         (mono_manage_threads): abort the background threads when finishing.
25081         Fixes bug #47232.
25082
25083 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25084
25085         * gc.c: only close the done_event handle if there was no timeout.
25086         C-ified comments.
25087
25088 2004-03-30  Martin Baulig  <martin@ximian.com>
25089
25090         * icall.c (icall_entries): It's called "System.Activator", not
25091         "System.Activation".    
25092
25093 2004-03-30  Martin Baulig  <martin@ximian.com>
25094
25095         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
25096         (mono_class_create_from_typespec): Likewise.
25097
25098 2004-03-30  Martin Baulig  <martin@ximian.com>
25099
25100         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
25101         `has_ctor_constraint' and `initialized'.
25102
25103 2004-03-30  Martin Baulig  <martin@ximian.com>
25104
25105         * reflection.c (encode_new_constraint): New static function to add
25106         the constructor constraint attribute to a type parameter.
25107         (encode_constraints): Call encode_new_constraint() if necessary.
25108
25109         * reflection.h
25110         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
25111
25112         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
25113         
25114 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
25115
25116         * reflection.c, icall.c: add support for pinning variables. 
25117
25118 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
25119
25120         * marshal.c (mono_marshal_get_managed_wrapper):
25121         init bool local with zero rather than null.
25122
25123 2004-03-29  Martin Baulig  <martin@ximian.com>
25124
25125         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
25126         the "official" behavior here.
25127         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
25128
25129 2004-03-29  Martin Baulig  <martin@ximian.com>
25130
25131         * icall.c: Reflect latest API changes.
25132
25133 2004-03-29  Martin Baulig  <martin@ximian.com>
25134
25135         * loader.c (mono_get_method_from_token): Also call
25136         mono_metadata_load_generic_params () for abstract and interface
25137         methods; replace the type arguments in the method signature with
25138         the ones which are loaded from the metadata.
25139
25140 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
25141
25142         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
25143         of the lock is not the current thread. MS.NET don't do it, in spite of
25144         what the documentation says. See bug #56157.
25145
25146 2004-03-28  Martin Baulig  <martin@ximian.com>
25147
25148         * class.c (mono_class_init): Don't call init_properties() and
25149         init_events() for generic instances; set `prop->parent' when
25150         inflating properties.
25151
25152         * reflection.c (mono_generic_inst_get_object): Call
25153         `mono_class_init (ginst->klass)'.
25154         (mono_type_get_object): Only create a MonoGenericInst if your
25155         generic type is a TypeBuilder.
25156         (do_mono_reflection_bind_generic_parameters): Only set
25157         `ginst->is_dynamic' if our generic type is a TypeBuilder.
25158
25159 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
25160
25161         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
25162         Fixes #56091.
25163
25164 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25165
25166         * icall.c: added Kill_internal icall.
25167         * process.[ch]: added Kill_internal icall.
25168
25169 2004-03-25  Martin Baulig  <martin@ximian.com>
25170
25171         * class.h (MonoStats): Added `generic_instance_count',
25172         `inflated_method_count', `inflated_type_count' and
25173         `generics_metadata_size'.       
25174
25175 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25176
25177         * reflection.c: no warnings now.
25178
25179 2004-03-25  Martin Baulig  <martin@ximian.com>
25180
25181         * class.c (mono_class_get_full): New public function; does a
25182         mono_class_get(), but also takes a `MonoGenericContext *'.
25183
25184         * loader.c (mono_field_from_memberref): Renamed to
25185         `field_from_memberref', made static and added `MonoGenericContext *'
25186         argument.
25187         (mono_field_from_token): Added `MonoGenericInst *' argument.
25188         (method_from_memberef): Likewise.
25189         (mono_get_method_from_token): Likewise.
25190         (mono_get_method_full): New public function; does a
25191         mono_get_method(), but also takes a `MonoGenericContext *'.
25192
25193         * verify.c (mono_method_verify): Get the method's generic context
25194         and pass it to mono_field_from_token(), mono_get_method_full() and
25195         mono_class_get_full().
25196
25197 2004-03-25  Martin Baulig  <martin@ximian.com>
25198
25199         * class.c (mono_class_inflate_generic_type): Take a
25200         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
25201         `MonoGenericMethod *'.
25202
25203 2004-03-25  Martin Baulig  <martin@ximian.com>
25204
25205         * loader.h (MonoMethodInflated): Store the MonoGenericContext
25206         instead of the MonoGenericMethod here.
25207
25208 2004-03-25  Martin Baulig  <martin@ximian.com>
25209
25210         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
25211         each time we create a new MonoGenericInst, we also create a new
25212         context which points back to us.
25213
25214         * class.c (inflate_method): Use `ginst->context' instead of
25215         creating a new context.
25216
25217         * loader.c (method_from_memberref): Use
25218         `klass->generic_inst->context' instead of creating a new context.
25219
25220 2004-03-25  Martin Baulig  <martin@ximian.com>
25221
25222         * class.h (MonoGenericContext): New struct.
25223         (MonoGenericMethod): Removed `generic_inst'.
25224
25225         * class.c (mono_class_inflate_generic_method): Take a
25226         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
25227
25228 2004-03-25  Martin Baulig  <martin@ximian.com>
25229
25230         * loader.h (MonoMethodInflated): New typedef.
25231
25232         * metadata.h (MonoMethodSignature): Removed `gen_method', make
25233         `generic_param_count' consume just 30 bits, added `is_inflated'
25234         and `has_type_parameters' flags (one bit each).
25235
25236         * class.c (mono_class_inflate_generic_method): Create a
25237         MonoMethodInflated instead of a MonoMethodNormal and set
25238         `is_inflated' in the method signature.
25239
25240         * class.h (MonoGenericMethod): Removed `generic_method'.
25241
25242 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
25243
25244         * image.c: Make sure the name of a MonoImage is always an absolute path.
25245           This fixes bug #54415.
25246
25247 2004-03-24  Martin Baulig  <martin@ximian.com>
25248
25249         * class.c (mono_class_setup_vtable): If we're a generic instance,
25250         use our generic type's vtable size.
25251
25252 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
25253
25254         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
25255         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
25256         problems.
25257
25258 2004-03-23  Martin Baulig  <martin@ximian.com>
25259
25260         * class.h (MonoDynamicGenericInst): Added `int count_events' and
25261         `MonoEvent *events'.
25262
25263         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
25264         (typebuilder_icalls): Added "get_event_info"; calls
25265         mono_reflection_event_builder_get_event_info(). 
25266
25267         * reflection.c (mono_reflection_generic_inst_initialize): Added
25268         `MonoArray *events'.
25269         (mono_reflection_event_builder_get_event_info): New function.
25270
25271 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
25272
25273         * object.h: add mono_type_initialization_init
25274
25275         * object.c (mono_runtime_class_init): 
25276         implement class constructor synchronization rules
25277         to cope with threading issues.  
25278         add mono_type_initialization_init
25279
25280         * appdomain.c (mono_runtime_init): call 
25281         mono_type_initialization_init
25282
25283         * class.h: removing initializing field from MonoVTable
25284
25285 2004-03-23  Martin Baulig  <martin@ximian.com>
25286
25287         * class.c (my_mono_class_from_generic_parameter): Use
25288         `param->name' if it's not NULL. 
25289
25290 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
25291
25292         * class.c: do not insert non-virtual methods in the vtable.
25293         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
25294         that means the method is non-virtual. This never would have
25295         happened before.
25296
25297 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
25298
25299         * profiler.c: Added lock for accessing coverage_hash.
25300
25301 2004-03-22  Martin Baulig  <martin@ximian.com>
25302
25303         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
25304         `method->method->signature->generic_param_count != 0' to make it
25305         work for interface methods.
25306
25307 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25308
25309         * process.c: quote the string passed to the shell using g_shell_quote.
25310
25311 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25312
25313         * threads.c:
25314         (mono_threads_manage): don't remove the finalizer thread and self
25315         from the threads hash table so that mono_thread_manage can be called
25316         more than once.
25317
25318 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25319
25320         * process.c: quote the arguments when UseShellExecute is true. Fixes
25321         bug #55790.
25322
25323 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25324
25325         * threads.c: set mono_thread_detach as a cleanup routine for every
25326         thread. This way it's always executed upon thread termination, either
25327         aborted or finished normally. No more xsp hangs!
25328
25329 2004-03-17  Martin Baulig  <martin@ximian.com>
25330
25331         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
25332         `int count_nested' and a `MonoType **nested'.
25333
25334         * reflection.c (mono_reflection_bind_generic_parameters): Moved
25335         most of the functionality into a new static
25336         do_mono_reflection_bind_generic_parameters() and don't take a
25337         `MonoType *nested_in' argument any more.  Don't compute nested
25338         types here.
25339         (mono_reflection_generic_inst_get_nested_types): New public method
25340         to get nested types.
25341
25342         * class.c (mono_class_create_generic): Set `klass->nested_in' if
25343         we're a nested class.
25344
25345         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
25346         mono_reflection_generic_inst_get_nested_types() to compute the
25347         nested types.
25348
25349 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
25350
25351         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
25352         descriptive error message under windows.
25353         
25354 2004-03-17  Martin Baulig  <martin@ximian.com>
25355
25356         * class.c (dup_type): Added `const MonoType *original' argument;
25357         copy the attrs from the original type.
25358
25359 2004-03-17  Martin Baulig  <martin@ximian.com>
25360
25361         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
25362         `m->generic_inst_cache' here.
25363
25364 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
25365
25366         * exception.h exception.c: Add stack_overflow_exception.
25367
25368 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25369
25370         * threadpool.c:
25371         (overlapped_callback): call SetEvent *after* invoking the callback.
25372         No need to call CloseHandle.
25373
25374 2004-03-16  Martin Baulig  <martin@ximian.com>
25375
25376         * reflection.c (mono_image_get_fieldref_token): Take a
25377         `MonoReflectionField *' instead of a `MonoClassField *' and a
25378         `MonoClass *'; store the `MonoReflectionField *' in the hash.
25379
25380 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25381
25382         * appdomain.c: don't add the culture to the filename we're looking for
25383         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
25384
25385 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25386
25387         * locales.c: don't ignore symbols when doing case insensitive compares.
25388         Thanks Dick! Fixes bug #54046.
25389
25390         * threads.c: surround 'threads' usage with enter/leave in
25391         mono_thread_manage.
25392
25393 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
25394
25395         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
25396         implicitly marshalled as [Out]. Fixes #55450.
25397
25398         (mono_marshal_get_runtime_invoke): Zero out the result if there is
25399         an exception.
25400
25401 2004-03-16  Martin Baulig  <martin@ximian.com>
25402
25403         * class.c (mono_class_from_generic_parameter): Use the actual
25404         parameter name. 
25405
25406 2004-03-16  Martin Baulig  <martin@ximian.com>
25407
25408         * reflection.c (type_get_signature_size): New static function.
25409         Compues the size of the type in a method signature.
25410         (method_get_signature_size): New static function; calls
25411         type_get_signature_size() to compute the actual size of the
25412         method's signature.
25413         (method_encode_signature): Use method_get_signature_size() to get
25414         the signature's size rather than using `nparams * 10'.
25415
25416 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25417
25418         * file-io.h: define here WapiOverlapped on windows. I don't want the
25419         regular OVERLAPPED one.
25420
25421         * file-io.c:
25422         * threadpool.c: somehow, BindIoCompletionCallback is not found.
25423         Disabling AIO on windows.
25424
25425 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25426
25427         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
25428         bug #55385.
25429
25430 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25431
25432         * appdomain.c: upgraded corlib version.
25433
25434         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
25435         and BeginWrite. Allow opening files for asynchrnous operations.
25436
25437         * file-io.h: new struct that maps FileStreamAsyncResult.
25438         * icall.c: added new icalls.
25439         * process.[ch]: support setting child process environment variables
25440         and use the SHELL or COMSPEC when UseShellExecute is true.
25441
25442         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
25443         callback for async. IO is here and also BindHandle.
25444
25445         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
25446         from here.
25447
25448 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
25449
25450         * reflection.c (create_custom_attr): Allow len == 0.
25451
25452         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
25453         computation on big-endian machines.
25454
25455 2004-03-13  Martin Baulig  <martin@ximian.com>
25456
25457         * class.h (MonoGenericInst): Added `int count_ifaces'.
25458
25459         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
25460         `ginst->count_ifaces' instead `klass->interface_count' since we
25461         may get called before the vtable is created.
25462
25463         * loader.c (mono_method_get_param_names): If we're a generic
25464         instance, return and don't initialize the class.
25465
25466         * reflection.c (mono_reflection_setup_generic_class): Don't call
25467         ensure_runtime_vtable().
25468         (mono_reflection_bind_generic_parameters): Set
25469         `ginst->count_ifaces'.
25470
25471 2004-03-11  Jackson Harper <jackson@ximian.com>
25472
25473         * icall.c:
25474         * unicode.c:
25475         * unicode.h: Remove unused System.Char icalls.
25476         
25477 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
25478
25479         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
25480         code when we P/Invoke the first library in Windows.Forms, instead
25481         of when we first open the assembly.
25482
25483         * assembly.c: Drop the lookup from here.
25484
25485 2004-03-10  Martin Baulig  <martin@ximian.com>
25486
25487         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
25488         class for properties, fields and events.  Finally fixes #54945.
25489
25490 2004-03-10  Martin Baulig  <martin@ximian.com>
25491
25492         * metadata.c (mono_metadata_class_equal): New static function;
25493         checks whether two generic instances or two generic parameters are
25494         equal.
25495         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
25496         compare classes.        
25497
25498 2004-03-10  Martin Baulig  <martin@ximian.com>
25499
25500         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
25501
25502         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
25503         argument and write it into the `reflection_info' field.
25504
25505         * icall.c
25506         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
25507         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
25508
25509 2004-03-09  Jackson Harper  <jackson@ximian.com>
25510
25511         * char-conversions.h: use 8 bits for numeric data its all we need
25512         * icall.c: numeric data is only 8 bits now.
25513
25514 2004-03-09  Martin Baulig  <martin@ximian.com>
25515
25516         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
25517
25518         * class.c (init_properties, init_events): Initialize the new
25519         `parent' field.
25520
25521         * reflection.c (typebuilder_setup_properties): Likewise.
25522         (typebuilder_setup_events): Likewise.
25523
25524         * reflection.h (MonoEventInfo): Replaced `parent with
25525         `declaring_type' and `reflected_type'.
25526
25527         * icall.c (ves_icall_get_property_info): Distinguish between
25528         declaring and reflected type.
25529         (ves_icall_get_event_info): Likewise.
25530
25531 2004-03-09  Martin Baulig  <martin@ximian.com>
25532
25533         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
25534         (ves_icall_Type_GetField): Correctly set field->klass.
25535
25536 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
25537
25538         * loader.h: Fix warning.
25539
25540 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
25541
25542         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
25543         library routine if present.  Notice that it will still continue
25544         executing even if its missing, for those working on the Gtk#
25545         edition of Windows.Forms.
25546
25547         * assembly.c (do_mono_assembly_open): If loading the
25548         System.Windows.Forms call mono_loader_wini_init.
25549
25550 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
25551
25552         * class.h: Added MonoRemoteClass struct.
25553         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
25554         function for MonoStrings.
25555         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
25556         Added internal call for getting the proxy type.
25557         * marshal.c: Get the type of transparent proxies from its remote_class.
25558         Added methods that generate the IL for type checks and casts:
25559         mono_marshal_get_isinst, mono_marshal_get_castclass, 
25560         mono_marshal_get_proxy_cancast.
25561         * marshal.h: Declaration of the previous new methods.
25562         * object.c: Added new moethods for creating and updating MonoRemoteClass
25563         instances: mono_remote_class, mono_upgrade_remote_class, 
25564         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
25565         * verify.c: FIx transparent_proxy_fields layout.
25566         * appdomain.c: Bump corlib version.
25567
25568 2004-03-04  Jackson Harper  <jackson@ximian.com>
25569
25570         * icall.c: Add icall to access char conversion tables.
25571         * char-conversions.h: Character conversion tables.
25572         * Makefile.am: Add char-conversions.h private header file.
25573         
25574 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
25575
25576         * appdomain.c (unload_thread_main): Increase unloading timeout to
25577         10 sec as a temporary workaround for Nant problems.
25578
25579 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
25580
25581         * gc.c: Add checks for GC_enable and GC_disable.
25582
25583         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
25584         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
25585         (bug #54988).
25586         
25587 2004-02-27  Martin Baulig  <martin@ximian.com>
25588
25589         * reflection.c (mono_reflection_bind_generic_parameters): Take a
25590         `MonoReflectionType *' instead of a `MonoType *'.
25591
25592 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
25593
25594         * gc.c (run_finalize): Avoid finalizing the object representing the
25595         finalizer thread.
25596         (finalizer_thread): Fix warning.
25597
25598 2004-02-25  Martin Baulig  <martin@ximian.com>
25599
25600         * class.c (_mono_class_get_instantiation_name): Added `int offset'
25601         argument for nested types.
25602         (mono_class_create_generic): Added support for nested generictypes.
25603
25604         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
25605         `GList *nested'.
25606
25607         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
25608
25609         * reflection.c (method_encode_signature): Increase the minimum
25610         value of `size' from 10 to 11.
25611         (mono_reflection_bind_generic_parameters): Take `int type_argc'
25612         and `MonoType **types' arguments instead of the `MonoArray
25613         *types'; added `MonoType *nested_in'.  Recursively instantiate
25614         nested classes. 
25615
25616 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
25617
25618         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
25619         stack_overflow_ex members which are used by exception handling.
25620
25621         * appdomain.c (mono_runtime_init): Initialize the new members.
25622
25623         * gc.c (mono_gc_enable): New helper function.
25624         * gc.c (mono_gc_disable): New helper function.
25625
25626 2004-02-23  Martin Baulig  <martin@ximian.com>
25627
25628         * icall.c: I must have been really stupid - make it actually work
25629         this time ;-)
25630
25631 2004-02-23  Martin Baulig  <martin@ximian.com>
25632
25633         * loader.c (method_from_memberref): Only inflate the method if
25634         it's in another klass.
25635
25636 2004-02-23  Martin Baulig  <martin@ximian.com>
25637
25638         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
25639         (mono_class_init): If we're a generic instance and an interface,
25640         compute `class->interface_id'; also create `class->interfaces'
25641         here and inflate them.
25642
25643         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
25644         `ginst->is_open'.
25645         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
25646
25647         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
25648
25649 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
25650
25651         * reflection.c (method_encode_code): Improved the error message
25652         generated by the exception.
25653
25654 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25655
25656         * icall.c: Martin did not do what he said in the ChangeLog for
25657         2004-02-18, but put back the changes for properties and events.
25658         Commenting those changes out again and adding comment to bug #54518.
25659         
25660         * process.c: removed warning.
25661
25662 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
25663
25664         * marshal.c (emit_struct_conv): Print an error message instead of
25665         asserting when a type does not have the StructLayout attribute.
25666
25667 2004-02-20  Martin Baulig  <martin@ximian.com>
25668
25669         * reflection.c (mono_type_get_object): Also use the cache for
25670         generic instances.
25671         (mono_reflection_bind_generic_parameters): Always compute
25672         `ginst->ifaces'.        
25673
25674 2004-02-20  Martin Baulig  <martin@ximian.com>
25675
25676         * class.h (MonoGenericMethod): Removed `klass'.
25677
25678         * class.c (mono_class_inflate_generic_method): Added `MonoClass
25679         *klass' argument.
25680
25681 2004-02-20  Martin Baulig  <martin@ximian.com>
25682
25683         * reflection.c (method_encode_methodspec): Actually use the
25684         uninflated signature for the memberref.
25685
25686 2004-02-20  Martin Baulig  <martin@ximian.com>
25687
25688         * class.h (MonoGenericMethod): Removed `declaring'.
25689
25690         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
25691         is NULL, compute it here.
25692
25693 2004-02-20  Martin Baulig  <martin@ximian.com>
25694
25695         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
25696
25697         * metadata.c (mono_metadata_generic_inst_hash): New method.
25698         (mono_metadata_generic_inst_equal): New method.
25699
25700         * reflection.c (mono_reflection_bind_generic_parameters): Use the
25701         `klass->image->generic_inst_cache' cache to avoid creating
25702         duplicate MonoGenericInst's.
25703
25704         * class.c (mono_class_inflate_generic_type): Use the cache.
25705
25706 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
25707
25708         * object.c: fixed gc descriptor calculation for embedded valuetypes.
25709
25710 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25711
25712         * icall.c: added Socket.WSAIoctl icall.
25713
25714         * socket-io.[ch]: implemented
25715         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
25716
25717 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
25718
25719         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
25720
25721 2004-02-18  Urs C Muff  <umuff@quark.com>
25722
25723         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
25724         this work on PPC and other big-endian architectures.
25725
25726         * debug-mono-symfile.h: Prepended the names of all the `guint32'
25727         fields with an underscore to make sure they're only accessed by
25728         the read32() macro.
25729
25730 2004-02-18  Martin Baulig  <martin@ximian.com>
25731
25732         * icall.c: Put the klass->refclass changes back for methods and
25733         fields, but not for properties and events.  We're currently not
25734         distinguishing between DeclaringType and ReflectedType for
25735         properties and events, that's what caused the regressions.
25736
25737 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25738
25739         * object.c:
25740         (mono_async_result_new): the handle can be NULL.
25741
25742         * threadpool.c: Use an event instead of a semaphore, don't initialize
25743         it until needed. This saves quite a few semaphores from being created
25744         when using the threadpool.
25745
25746 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
25747
25748         * object.c (mono_string_is_interned_lookup): Fix interning of long
25749         strings. Fixes #54473.
25750
25751         * domain.c (ldstr_equal): Optimize if the two strings are equal.
25752
25753         * icall.c: Revert the klass->refclass changes since they introduce
25754         regressions (bug #54518).
25755
25756 2004-02-18  Martin Baulig  <martin@ximian.com>
25757
25758         * class.c (mono_class_init): If we're a generic instance and don't
25759         come from a TypeBuilder, inflate our members here.
25760         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
25761         (mono_class_create_generic): New public method.
25762         (mono_class_initialize_generic): Removed.
25763         (get_instantiation_name): Renamed to
25764         _mono_class_get_instantiation_name() and made it public.
25765
25766 2004-02-18  Martin Baulig  <martin@ximian.com>
25767
25768         * class.c (mono_class_inflate_generic_type): Clear the new
25769         instance's `nginst->klass' when inflating a generic instance.
25770         (mono_class_is_subclass_of): Added (basic) support for generic
25771         instances.
25772
25773 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
25774
25775         * appdomain.h, domain.c: use a MonoCodeManager instead of a
25776         MonoMempool to hold compiled native code.
25777
25778 2004-02-17  Martin Baulig  <martin@ximian.com>
25779
25780         * class.h (MonoDynamicGenericInst): Added `count_properties' and
25781         `properties'.
25782
25783         * reflection.c (mono_reflection_generic_inst_initialize): Added
25784         `MonoArray *properties' argument.
25785
25786         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
25787
25788 2004-02-17  Martin Baulig  <martin@ximian.com>
25789
25790         * icall.c (ves_icall_Type_GetFields): Renamed to
25791         ves_icall_Type_GetFields_internal() and added a
25792         `MonoReflectionType *rtype' argument; pass it to
25793         mono_field_get_object() to set the field's "reflected" type.
25794         (ves_icall_Type_GetConstructors): Likewise.
25795         (ves_icall_Type_GetEvents): Likewise.
25796         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
25797         argument; pass it to mono_method_get_object() to set the method's
25798         "reflected" type.       
25799
25800 2004-02-17  Martin Baulig  <martin@ximian.com>
25801
25802         * class.h (MonoDynamicGenericInst): New type.
25803         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
25804
25805         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
25806         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
25807         (ves_icall_MonoGenericInst_GetFields): New interncall.
25808
25809         * class.c (mono_class_from_generic): Don't call
25810         mono_class_initialize_generic() if this is a dynamic instance;
25811         ie. it's being created from a TypeBuilder.
25812         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
25813         `class->byval_arg.type'.
25814
25815         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
25816         to `inflate_method' and made static.
25817         (mono_reflection_inflate_field): Removed.
25818         (mono_reflection_generic_inst_initialize): New public method.
25819
25820         * reflection.h (MonoReflectionGenericInst): Removed `methods',
25821         `ctors' and `fields'; added `initialized'.
25822
25823 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
25824
25825         * debug-helpers.c (mono_method_full_name): Fix output for empty
25826         namespaces.
25827
25828 2004-02-12  Martin Baulig  <martin@ximian.com>
25829
25830         * class.h (MonoClassField): Added `MonoType *generic_type'.
25831
25832         * reflection.c (mono_image_get_fieldref_token): Added support for
25833         instantiated generic types.
25834         (field_encode_inflated_field): Removed.
25835         (mono_image_get_inflated_field_token): Removed.
25836         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
25837
25838         * reflection.h (MonoReflectionInflatedField): Removed.
25839
25840 2004-02-12  Martin Baulig  <martin@ximian.com>
25841
25842         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
25843         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
25844
25845         * reflection.c (mono_image_get_methodspec_token): Take a
25846         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
25847         (mono_image_create_token): Check whether we have a
25848         `method->signature->gen_method' and call
25849         mono_image_get_methodspec_token() if appropriate.
25850         (inflated_method_get_object): Removed.
25851         (mono_reflection_bind_generic_method_parameters): Return a
25852         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
25853         (mono_reflection_inflate_method_or_ctor): Likewise.
25854
25855         * reflection.h (MonoReflectionInflatedMethod): Removed.
25856
25857 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
25858
25859         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
25860         for custom valuetype marshalling.
25861
25862         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
25863
25864 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25865
25866         * icall.c: fixed WSAGetLastError_internal name.
25867
25868 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
25869
25870         * threads.c (mono_thread_attach): Allow this to be called multiple
25871         times for a thread.
25872         
25873         * threads.c (build_wait_tids): Do not wait for ourselves.
25874
25875         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
25876         appdomain list is empty.
25877
25878         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
25879         memory returned by mono_string_builder_to_utf16, since it points into
25880         managed memory. Thanks to Bernie Solomon for noticing this.
25881
25882         * icall.c: Add AppDomainSetup icalls.
25883
25884         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
25885
25886         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
25887         types.
25888
25889         * reflection.c (reflection_methodbuilder_to_mono_method): Save
25890         custom attributes to the method_aux struct. Also fix array indexes etc.
25891
25892         * loader.c (mono_method_get_param_names): Make dynamic case work again.
25893         
25894 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
25895
25896         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
25897         (both static and runtime) and reduce startup time.
25898
25899 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
25900
25901         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
25902         AsAny marshalling conversion instead of crashing.
25903
25904         * marshal.c: Fix warnings.
25905
25906 2004-02-09  Martin Baulig  <martin@ximian.com>
25907
25908         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
25909
25910         * reflection.h (MonoReflectionInflatedMethod): Removed the
25911         `declaring' field, it's now in the unmanaged MonoGenericMethod.
25912
25913         * reflection.c (method_encode_methodspec): Removed the `method'
25914         argument; we get it from `gmethod->declaring'.
25915         (inflated_method_get_object): Removed the `declaring' argument.
25916
25917 2004-02-09  Martin Baulig  <martin@ximian.com>
25918
25919         * class.h (MonoGenericMethod): New type.
25920         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
25921         `generic_method'.
25922
25923         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
25924         a `MonoGenericMethod *gen_method' one.
25925
25926         * class.c (mono_class_inflate_generic_type): Take an additional
25927         `MonoGenericMethod * argument.  This is only non-NULL if we're
25928         inflating types for a generic method.   
25929         (mono_class_inflate_generic_signature): Renamed to
25930         inflate_generic_signature() and made static; take a
25931         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
25932         (inflate_generic_header): Take a `MonoGenericMethod *' argument
25933         instead of a `MonoGenericInst *' one.
25934         (mono_class_inflate_generic_method): Likewise.
25935
25936         * reflection.c (encode_generic_method_sig): Take a
25937         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
25938         (method_encode_methodspec): Likewise.
25939         (inflated_method_get_object): Likewise. 
25940
25941         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
25942         field with a `MonoGenericMethod *gmethod' one.  
25943
25944 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
25945
25946         * class.h (mono_class_has_parent): add parens to expansion
25947         so you can ! this.
25948
25949 2004-02-08  Martin Baulig  <martin@ximian.com>
25950
25951         * image.h (MonoImage): Removed `generics_cache'.
25952
25953         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
25954         instead of a `MonoType *' argument; removed the `inflate_methods'
25955         argument.  Don't inflate methods here.
25956
25957         * loader.c (find_method): If it's a generic instance, call
25958         mono_class_init() on the `sclass->generic_inst->generic_type'.
25959
25960         * metadata.c (mono_type_size): Make this work on uninitialized
25961         generic instances; call it on the `ginst->generic_type's class.
25962
25963         * reflection.c (mono_reflection_bind_generic_parameters): Call
25964         mono_class_from_generic() to create the `ginst->klass'.
25965
25966 2004-02-08  Martin Baulig  <martin@ximian.com>
25967
25968         * class.h (MonoClass): Changed type of `generic_inst' from
25969         `MonoType *' to `MonoGenericInst *'.
25970
25971 2004-02-08  Martin Baulig  <martin@ximian.com>
25972
25973         * icall.c (ves_icall_Type_BindGenericParameters): Just call
25974         mono_type_get_object(), this is now creating a `MonoGenericInst'
25975         for MONO_TYPE_GENERICINST.
25976         (ves_icall_MonoGenericInst_GetParentType): Likewise.
25977         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
25978
25979         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
25980         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
25981         (inflated_method_get_object): Added `MonoClass *refclass' argument.
25982         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
25983         and reflected type.
25984
25985         * reflection.h (MonoReflectionInflatedMethod): Removed
25986         `declaring_type' and `reflected_type'.
25987
25988 2004-02-08  Martin Baulig  <martin@ximian.com>
25989
25990         * class.h (MonoGenericInst): Added `MonoType *parent' and
25991         `MonoType **ifaces'.
25992
25993         * reflection.h (MonoReflectionGenericInst): Removed `klass',
25994         `parent' and `interfaces'.
25995
25996         * reflection.c (mono_reflection_bind_generic_parameters): Take a
25997         `MonoType *' argument and return a `MonoType *'.
25998
25999         * icall.c
26000         (ves_icall_MonoGenericInst_GetParentType): New interncall.
26001         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
26002
26003 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26004
26005         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
26006         valuetype marshalling.
26007
26008 2004-02-06  Martin Baulig  <martin@ximian.com>
26009
26010         * class.c
26011         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
26012         (my_mono_class_from_generic_parameter): Likewise.
26013
26014 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
26015
26016         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
26017         contents of the symbol files lazily.
26018
26019         * object.h (MonoThread): Add 'name' and 'name_len' fields.
26020
26021         * threads.h threads.c icall.c: New icalls for getting and setting the
26022         threads name.
26023
26024 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
26025
26026         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
26027         Raise an exception when the domain is not found.
26028
26029 2004-02-03  Martin Baulig  <martin@ximian.com>
26030
26031         * reflection.c (mono_image_get_methodspec_token): Use the
26032         uninflated signature; fixes gen-33.
26033
26034 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
26035
26036         * gc.c threads.c: Make the finalizer thread a normal managed thread so
26037         the finalizer code can use thread functionality.
26038
26039         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
26040         the finalizer thread.
26041
26042         * threads.c: Make some functions more robust.
26043
26044         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
26045
26046         * metadata.h: Add new marshalling conventions.
26047
26048         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
26049         stringbuilder marshalling. Fixes #53700.
26050
26051         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
26052
26053         * reflection.c (mono_image_get_type_info): Save declarative security
26054         info.
26055
26056         * reflection.c (mono_image_get_field_info): Handle uninitialized 
26057         unmanaged fields as well.
26058
26059         * appdomain.c: Bump corlib version.
26060
26061 2004-02-01  Martin Baulig  <martin@ximian.com>
26062
26063         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
26064         method type arguments.  
26065
26066 2004-01-30  Duncan Mak  <duncan@ximian.com>
26067
26068         * marshal.h: Add prototype for
26069         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
26070         and
26071         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
26072         fix the build.
26073
26074 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
26075
26076         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
26077         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
26078
26079 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26080
26081         * marshal.c (mono_marshal_get_native_wrapper): Add support for
26082         custom marshalling of valuetypes.
26083
26084         * marshal.c: Fix some warnings.
26085
26086 2004-01-29  Martin Baulig  <martin@ximian.com>
26087
26088         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
26089         for generic method parameters.
26090
26091         * reflection.c (method_encode_methodspec): Write the uninflated
26092         signature into the methodspec table.
26093         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
26094         is always the uninflated method.
26095         (reflection_methodbuilder_to_mono_method): Copy the generic
26096         parameters from the MethodBuilder into `header->gen_params'.
26097
26098 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
26099
26100         * class.c (mono_class_from_generic_parameter): Fix warning.
26101
26102 2004-01-27  Martin Baulig  <martin@ximian.com>
26103
26104         * class.c (mono_class_from_generic_parameter): Don't create
26105         `klass->methods' here.  
26106
26107 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
26108
26109         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
26110         extension since it does not work with libraries named lib<FOO>.dll.so.
26111
26112 2004-01-25  Martin Baulig  <martin@ximian.com>
26113
26114         * class.c (mono_class_inflate_generic_type): Added support for
26115         MONO_TYPE_GENERICINST.
26116
26117         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
26118         inflate methods on open constructed types.      
26119
26120 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26121
26122         * object.c: fire ProcessExit event in the root AppDomain after running
26123         Main. Fixes bug #53299.
26124
26125 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
26126
26127         * socket-io.c: include the new socket-wrappers.h header.
26128         Use the wrappers instead of the unix socket functions to make the code
26129         more clear.
26130
26131 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
26132
26133         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
26134
26135         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
26136         Fixes #22532.
26137
26138 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
26139
26140         * reflection.c (mono_image_create_pefile): Handle the case when the
26141         entry point is not a MethodBuilder.
26142
26143         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
26144         field to ReflectionMethod since it is not allways a builder.
26145
26146         * reflection.c (type_get_fully_qualified_name): New helper function to
26147         return the fully qualified name of a type.
26148
26149         * reflection.c (encode_marshal_blob): Always emit the fully qualified
26150         type name for custom marshallers.
26151
26152         * reflection.c (mono_marshal_spec_from_builder): Ditto.
26153
26154         * class.c (mono_class_setup_vtable): If a parent class already 
26155         implements an interface, use the implementing methods from that class.
26156         Fixes #53148.
26157
26158 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26159
26160         * threadpool.c: just return instead of ExitThread to allow for thread
26161         clean up earlier.
26162
26163 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
26164
26165         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
26166         when closing resource modules.
26167
26168         * reflection.c (mono_image_create_pefile): Handle the case when the
26169         entry point is not a MethodBuilder.
26170
26171         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
26172         field to ReflectionMethod since it is not allways a builder.
26173
26174 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
26175
26176         * marshal.c (mono_marshal_get_managed_wrapper): 
26177         mono_marshal_alloc takes native int so CONV_I
26178         the arg for 64bits.
26179
26180 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
26181
26182         * reflection.c (fixup_cattrs): New function to fixup the methoddef
26183         tokens in the cattr table. Fixes #53108.
26184
26185 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26186
26187         * loader.c: don't trim ".dll" before looking up in the config file.
26188         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
26189
26190 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
26191
26192         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
26193         Return the module which contains the resource as well.
26194         (ves_icall_System_Reflection_Module_Close): New icall.
26195
26196         * appdomain.c: Bump corlib version number.
26197
26198         * image.c (mono_image_addref): New public function.
26199
26200         * assembly.c: Call mono_image_addref.
26201
26202         * reflection.c (mono_module_get_object): Increase reference count of 
26203         the image.
26204
26205         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
26206         Fixes #22532.
26207
26208         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
26209         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
26210         proper exceptions on DllImport problems.
26211
26212 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
26213
26214         * class.c, metadata.c: eliminate CSIZE macro.
26215
26216 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
26217
26218         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
26219         * object.h: Added async_callback field in MonoAsyncResult.
26220         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
26221         * verify.c: Added async_callback in MonoAsyncResult layout.
26222
26223 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
26224
26225         * reflection.c (mono_reflection_get_custom_attrs): Add support
26226         for Modules.
26227
26228 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
26229
26230         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
26231         marshalling.
26232         (mono_marshal_method_from_wrapper): Add null pointer check.
26233
26234 2004-01-16  Martin Baulig  <martin@ximian.com>
26235
26236         * debug-mono-symfile.h: Set version number to 36 and reflect
26237         latest symbol writer changes.
26238
26239 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
26240
26241         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
26242         multi-dimensional arrays.
26243         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
26244         (mono_class_from_mono_type): Use bounded_array_class_get.
26245         
26246         * class.c (mono_bounded_array_class_get): New function which takes
26247         a 'bounded' bool argument to distinguish vectors from one dimensional
26248         arrays.
26249
26250         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
26251         bounded_array_class_get if the array has bounds.
26252
26253         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
26254         Search modules loaded using AssemblyBuilder:AddModule as well.
26255
26256 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26257
26258         * appdomain.c: increased corlib version.
26259         * filewatcher.c: removed g_print.
26260         * icall.c:
26261         (get_property_info): only allocate what is actually requested.
26262         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
26263
26264 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26265
26266         * Makefile.am: added filewatcher.[ch]
26267         * filewatcher.[ch]: FileSystemWatcher runtime support.
26268         * icall.c: added new FSW icalls.
26269
26270 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
26271
26272         * string-icalls.c: fix stringbuilder regression as suggested by
26273         Iain McCoy <iain@mccoy.id.au>.
26274
26275 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
26276
26277         * process.c (process_read_stringtable_block): Recognize '007f' as
26278         a language neutral stringtable block.
26279
26280 2004-01-12  Patrik Torstensson
26281
26282         * object.h (MonoStringBuilder) : Changed layout to support our
26283         new stringbuilder class.
26284         * marshal.c: Change marshalling to support the new layout of 
26285         string builder.
26286         * appdomain.c: increased version number because new layout of
26287         string builder.
26288
26289 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
26290
26291         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
26292         assembly name as an string instead of an AssemblyName, since it is
26293         easier to extract info from it.
26294
26295         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
26296         the culture subdirectories too. Fixes #52231.
26297
26298 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26299
26300         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
26301         It takes 2 new parameters with an optional name for the method to look
26302         for and case ignoring info.
26303
26304         * threadpool.c: removed unused variable.
26305
26306 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26307
26308         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
26309         It takes 2 new parameters with an optional name for the property to look
26310         for and case ignoring info.
26311         Fixes bug #52753.
26312
26313 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
26314
26315         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
26316         Fix #52451.
26317
26318 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26319
26320         * appdomain.c:
26321         * assembly.c: escape the uri before passing it to g_filename_from_uri.
26322         Fixes bug #52630.
26323
26324 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
26325
26326         * reflection.c: Add support for more than one unmanaged resource.
26327
26328         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
26329         in field->def_value, as done in all other cases.
26330
26331         * reflection.c (mono_reflection_get_custom_attrs): Add support for
26332         TypeBuilders.
26333
26334         * reflection.c (mono_reflection_create_runtime_class): Remove 
26335         errorneous assignment to klass->element_class, since it is already
26336         done in mono_reflection_setup_internal_class.
26337
26338 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26339
26340         * gc.c: added missing LeaveCriticalSection.
26341         * icall.c: indented a couple of lines.
26342         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
26343         if we call EndInvoke inside a callback. Fixes bug #52601.
26344
26345 2004-01-07  Martin Baulig  <martin@ximian.com>
26346
26347         * mono-debug-debugger.h
26348         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
26349
26350 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
26351
26352         * appdomain.c: Use messages in NotImplementedException.
26353
26354         * exception.c (mono_get_exception_not_implemented): Now this takes
26355         a message argument.
26356
26357         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
26358         exception instead of g_asserting an aborting when something is not
26359         implemented.
26360
26361         Add some inline docs.
26362
26363 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
26364
26365         * reflection.h: Update after changes to object layout.
26366
26367         * reflection.c: Implement saving of unmanaged aka win32 resources.
26368
26369         * appdomain.c: Bump version number.
26370
26371         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
26372         Handle missing domains gracefully.
26373
26374 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
26375
26376         * file-io.c : On Windows, there are much more invalid_path_chars.
26377
26378 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
26379
26380         * class.h, object.c: prepare for GetType () speedup.
26381
26382 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
26383
26384         * profiler.c: workaround for --profile null reference exception on
26385           cygwin. Patch by Patrik Torstensson.
26386
26387 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
26388
26389         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
26390         make work for unaligned access.
26391
26392 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
26393
26394         * class.c: small cleanup (class->fields [i] -> field).
26395         * image.c: check address of metadata is valid.
26396
26397 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
26398
26399         * assembly.h assembly.c (mono_assembly_loaded): New public function to
26400         search the list of loaded assemblies.
26401
26402         * reflection.c (mono_reflection_type_from_name): Use 
26403         mono_assembly_loaded instead of mono_image_loaded.
26404
26405         * reflection.c: Fix warnings.
26406
26407 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
26408
26409         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
26410         is dynamic. This is needed since an assembly can contain both dynamic and
26411         non-dynamic images.
26412
26413         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
26414         assembly->dynamic.
26415
26416         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
26417
26418         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
26419         to store modules loaded using AddModule.
26420
26421         * reflection.c (mono_image_fill_file_table): Generalize this so it works
26422         on Modules.
26423
26424         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
26425
26426         * reflection.c (mono_image_fill_export_table_from_module): New function to
26427         fill out the EXPORTEDTYPES table from a module.
26428
26429         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
26430         into a separate function. Also handle loaded non-dynamic modules.
26431
26432         * reflection.c (mono_image_basic_init): Fix memory allocation.
26433
26434         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26435
26436         * assembly.c (mono_assembly_load_references): Make this public.
26437
26438 2003-12-19  Martin Baulig  <martin@ximian.com>
26439
26440         * class.c (mono_class_initialize_generic): Made this static, take
26441         a `MonoGenericInst *' instead of a `MonoClass *'.
26442         (mono_class_from_generic): Call mono_class_initialize_generic()
26443         unless we're already initialized or being called from
26444         do_mono_metadata_parse_generic_inst().
26445
26446         * class.h (MonoGenericInst): Added `initialized' and
26447         `init_pending' flags.
26448
26449         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
26450         `mono_class_init (gklass)' or mono_class_initialize_generic()
26451         here; set `generic_inst->init_pending' while parsing the
26452         `type_argv'.
26453
26454 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
26455
26456         * locales.c: include string.h for memxxx prototypes
26457
26458 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
26459
26460         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
26461         constructor when accessing literal fields.
26462
26463 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
26464
26465         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26466
26467         * reflection.c (assembly_add_resource_manifest): New function to fill
26468         the MANIFESTRESOURCE table.
26469
26470         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
26471
26472         * reflection.h: Update to changes in class layout.
26473
26474         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
26475         Reenable call to mono_runtime_is_shutting_down ().
26476
26477         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
26478         determine if the runtime is shutting down.
26479
26480 2003-12-16  Jackson Harper <jackson@ximian.com>
26481
26482         * icall.c: comment out call to mono_runtime_is_shutting_down to
26483         fix build.
26484         
26485 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
26486
26487         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
26488         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
26489
26490 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
26491
26492         * reflection.c: move definition of swap_with_size
26493         to before its first call
26494
26495 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
26496
26497         * appdomain.c (mono_runtime_is_shutting_down): New public function.
26498
26499         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
26500         icall.
26501
26502         * object.c: Fix warnings.
26503
26504         * icall.c (ves_icall_Type_Get...): Only consider inherited static
26505         members if FlattenHierarchy is set.
26506
26507         * reflection.c (mono_image_add_decl_security): New function to emit
26508         declarative security.
26509
26510         * reflection.h reflection.c: Add support for declarative security.
26511
26512         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
26513         
26514 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
26515
26516         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
26517         
26518         * appdomain.c verify.c: Moved corlib version checking into its own
26519         function in appdomain.c since it needs to create vtables etc.
26520
26521 2003-12-13  Patrik Torstensson <p@rxc.se>
26522
26523         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
26524         instead of unwrapped server.
26525
26526 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
26527
26528         * verify.c (check_corlib): Fix field index.
26529
26530 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
26531
26532         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
26533         GetGacPath icall.
26534
26535 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
26536
26537         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
26538         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
26539         cope with sizeof(size_t) != sizeof(guint32).
26540
26541 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26542
26543         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
26544         in case of failure.
26545
26546 2003-12-10  Mark Crichton <crichton@gimp.org>
26547
26548         * icall.c: removed the GetNonZeroBytes.  We now handle this case
26549         in managed code.
26550
26551         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
26552
26553 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
26554
26555         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
26556         marked as deleted.
26557
26558 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
26559
26560         * verify.c (check_corlib): Handle the case when the version field is 
26561         initialized by a static constructor.
26562
26563 2003-12-08  Patrik Torstensson  <p@rxc.se>
26564
26565     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
26566
26567 2003-12-08  Martin Baulig  <martin@ximian.com>
26568
26569         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
26570         a MonoReflectionGenericParameter, also take the parameter index
26571         and name as arguments.
26572         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
26573         (ves_icall_MonoGenericParam_initialize): New interncall.
26574         (ves_icall_Type_make_byref_type): New interncall.
26575
26576         * reflection.h (MonoReflectionGenericParam): Derive from
26577         MonoReflectionType, not just from MonoObject.  Added `refobj' and
26578         `index' fields.
26579
26580         * reflection.c (mono_reflection_define_generic_parameter): Create
26581         and return a new MonoReflectionGenericParam; don't initialize the
26582         constraints here.
26583         (mono_reflection_initialize_generic_parameter): New public method;
26584         initializes the constraints and creates the `param->pklass'.
26585
26586 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
26587
26588         * reflection.h reflection.c: Use the new fields 'num_types', 
26589         'num_fields' and 'num_methods' to track the number of types etc.
26590
26591         * verify.c (check_corlib): Check corlib version number.
26592
26593 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
26594
26595         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
26596         function works on all methods.
26597
26598 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
26599
26600         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
26601         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
26602         the custom_type_info flag of the transparent proxy.
26603         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
26604         objects that supports IRemotingTypeInfo.
26605         * object.h: Added custom_type_info field in transparent proxy.
26606
26607 2003-12-06  Martin Baulig  <martin@ximian.com>
26608
26609         * class.c (mono_class_create_from_generic): Removed.
26610         (mono_class_from_generic): Check `ginst->klass' before doing
26611         anything else.  This is important to fully support "recursive"
26612         generic types.
26613
26614         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
26615         empty `generic_inst->klass' before doing anything else.
26616
26617 2003-12-06  Dick Porter  <dick@ximian.com>
26618
26619         * verify.c: 
26620         * object.h:
26621         * icall.c:
26622         * locales.c: Use C structs to access class fields.  Don't do a
26623         conversion between MonoString and UChar because both are
26624         platform-endian UTF-16.  Compare now takes startindex and count
26625         parameters.  Add a char overload for IndexOf.  Speed up the
26626         invariant string IndexOf.
26627
26628 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
26629
26630         * Makefile.am (monosn_LDADD): Fix parallel build.
26631
26632 2003-12-04  Martin Baulig  <martin@ximian.com>
26633
26634         * icall.c
26635         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
26636         (ves_icall_Type_make_array_type): New interncall.       
26637
26638 2003-12-04  Martin Baulig  <martin@ximian.com>
26639
26640         * locales.c: also change it in the !HAVE_ICU case.
26641
26642 2003-12-04  Dick Porter  <dick@ximian.com>
26643
26644         * icall.c:
26645         * locales.c: construct_compareinfo is now in CompareInfo, not
26646         CultureInfo.
26647
26648 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
26649
26650         * image.c (mono_image_load_file_for_image): Cache loaded images in the
26651         image->files array.
26652
26653         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
26654         table as well.
26655
26656         * assembly.c (mono_assembly_load_references): Only load references
26657         once.
26658
26659         * class.c (mono_class_from_name): Avoid linear search of the 
26660         EXPORTEDTYPE table.
26661
26662         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
26663
26664 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
26665
26666         * image.h (MonoImage): Add 'field_cache' field.
26667
26668         * loader.c (mono_field_from_token): Cache field lookups.
26669         
26670         * reflection.c (mono_module_get_object): Fix name property.
26671
26672         * icall.c (ves_icall_get_enum_info): Update after changes to 
26673         mono_metadata_get_constant_index ().
26674
26675         * icall.c: Get rid of get_type_info icall, use a separate icall for
26676         each type property to avoid needless memory allocations. Fixes #51514.
26677
26678         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
26679         to avoid needless binary searches.
26680
26681         * class.c (class_compute_field_layout): Move the initialization of
26682         field->def_value to mono_class_vtable ().
26683
26684         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
26685         non-corlib types.
26686
26687         * object.c (mono_object_allocate): Make it inline.
26688
26689         * object.c (mono_object_allocate_spec): Make it inline.
26690         
26691 2003-12-02  Dick Porter  <dick@ximian.com>
26692
26693         * locales.c (create_NumberFormat): NumberFormatInfo construction.
26694         Patch by Mohammad DAMT (mdamt@cdl2000.com).
26695
26696 2003-12-01  Dick Porter  <dick@ximian.com>
26697
26698         * threads.c: Fix signature and call in CreateMutex and
26699         CreateEvent.
26700
26701 2003-12-01  Dick Porter  <dick@ximian.com>
26702
26703         * icall.c: 
26704         * locales.c: Implement string compares and searching
26705
26706         * object.h: Add extra Thread field
26707
26708 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
26709
26710         * reflection.c (fixup_method): Add support for MonoCMethod.
26711
26712 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
26713
26714         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
26715
26716         * reflection.c (assembly_name_to_aname): Allow extra characters in
26717         assembly names. Fixes #51468.
26718
26719 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
26720
26721         * exception.c (mono_exception_from_name_domain): New helper function.
26722
26723         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
26724         exception object in the correct domain.
26725
26726         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
26727         formatting + make a copy a the input data.
26728
26729         * loader.c (mono_get_method_from_token): Methods which contain
26730         native code do not have entries in the ImplMap.
26731
26732         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
26733         Thanks to Gonzalo for spotting this.
26734         
26735         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
26736         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
26737
26738         * assembly.h (mono_assembly_load_from): Split the second part of 
26739         assembly loading into a new public function.
26740
26741         * exception.h (mono_get_exception_bad_image_format): New function.
26742
26743 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
26744
26745         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
26746         Enumerate all modules inside a dynamic assembly. Fixes #51293.
26747         
26748         * icall.c: Add new icall for creating dynamic methods.
26749
26750         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
26751
26752         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
26753
26754         * reflection.c (mono_reflection_create_dynamic_method): New icall to
26755         create a dynamic method.
26756
26757         * reflection.c (resolve_object): New helper function.
26758
26759         * reflection.c: Generalize ReflectionMethodBuilder and the functions
26760         which manipulate it so they can also work on dynamic methods.
26761
26762         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
26763         creating the MonoReflectionMethodAux structure if it is not needed.
26764         
26765         * reflection.h verify.c: Update after changes to object layout.
26766
26767         * reflection.c (method_builder_encode_signature): Fix compilation on
26768         gcc 2.95.x.
26769
26770 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
26771
26772         * appdomain.h: Added support for context static fields. Added static_data
26773           field to MonoAppContext and renamed thread_static_fields to a more
26774           generic special_static_fields in MonoAppDomain, since it can now contain
26775           context static fields.
26776         * domain.c: Updated hashtable name.
26777         * object.c: Replaced field_is_thread_static() for a more generic
26778           field_is_special_static() which also checks for context static attribute.
26779           In mono_class_vtable(), added support for static context fields.
26780         * threads.c: Changed methods that manage thread static fields to more
26781           generic methods so they can be reused both for thread and context static
26782           data.
26783         * threads.h: Declared some new methods.
26784
26785 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
26786
26787         * reflection.h: Update after changes to the managed types.
26788
26789         * reflection.c (encode_custom_modifiers): New helper function.
26790
26791         * reflection.c (method_encode_signature): Emit custom modifiers.
26792
26793         * reflection.c (field_encode_signature): Emit custom modifiers.
26794
26795 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
26796
26797         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
26798
26799         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
26800         implementation.
26801
26802         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
26803         icall.
26804
26805         * object.c (mono_field_get_value_object): New function.
26806
26807         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
26808         specific.
26809
26810 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
26811
26812         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
26813         return a preallocated out-of-memory exception instance.
26814
26815         * object.c (out_of_memory): Use the new function.
26816
26817         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
26818         flag is before the custom modifiers. Fixes #49802.
26819
26820 2003-11-16  Martin Baulig  <martin@ximian.com>
26821
26822         * class.c (mono_class_is_open_constructed_type): Implemented the
26823         MONO_TYPE_GENERICINST case.
26824
26825 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
26826
26827         * assembly.c (mono_assembly_fill_assembly_name): New function to
26828         fill out the MonoAssemblyName structure.
26829         (mono_assembly_open): Use the new function.
26830
26831         * icall.c (fill_reflection_assembly_name): New helper function.
26832
26833         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
26834         new function.
26835
26836         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
26837
26838 2003-11-15  Martin Baulig  <martin@ximian.com>
26839
26840         * class.c (mono_class_is_open_constructed_type): New public
26841         function; checks whether a type is an open constructed type,
26842         ie. whether it still contains type parameters.
26843         (mono_class_inflate_generic_type): If we're a type parameter and
26844         the inflated type is also a MONO_TYPE_(M)VAR, return the original
26845         type.
26846
26847         * class.h (MonoGenericInst): Added `guint32 is_open'.
26848
26849         * loader.c (method_from_methodspec): Check whether we're an open
26850         or closed constructed type and set `ginst->is_open'.
26851
26852         * reflection.c (mono_reflection_bind_generic_parameters): Check
26853         whether we're an open or closed constructed type and set
26854         `ginst->is_open'.
26855         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
26856         from open constructed types.
26857
26858 2003-11-15  Martin Baulig  <martin@ximian.com>
26859
26860         * reflection.c (mono_reflection_bind_generic_parameters): If we're
26861         a generic instance (instead of a generic type declaration) with
26862         unbound generic parameters, bind them to our actual types.
26863
26864 2003-11-14  Martin Baulig  <martin@ximian.com>
26865
26866         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
26867
26868         * reflection.c (mono_reflection_bind_generic_parameters): If we're
26869         an interface type, populate `res->interfaces' with instantiated
26870         versions of all the interfaces we inherit.
26871
26872 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
26873
26874         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
26875         when MONO_PATH is set but doesn't contain the install dir.
26876
26877 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26878
26879         * icall.c:
26880         (ves_icall_Type_GetInterfaces): don't return an interface twice when
26881         it's also implemented in base classes. Fixes bug #50927.
26882
26883 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
26884
26885         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
26886         if this method is called from a finalizer. Fixes #50913.
26887
26888 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
26889
26890         * threads.c: Implement VolatileRead/VolatileWrite
26891
26892         * icall.c: Add new icalls for VolatileRead/VolatileWrite
26893
26894 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26895
26896         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
26897         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
26898         2.95.3.
26899
26900         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
26901         from Peter Ross (pro@missioncriticalit.com).
26902         
26903 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
26904
26905         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
26906
26907 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26908
26909         * assembly.c (mono_assembly_load_references): Disable check because it
26910         triggers on older corlibs which lots of people have.
26911
26912 2003-11-12  Jackson Harper  <jackson@ximian.com>
26913
26914         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
26915         load corlib.dll if mscorlib.dll is not found.
26916         * assembly.h: Remove corlib name define.
26917         * class.c:
26918         * domain.c:
26919         * image.c: Change corlib name to mscorlib.
26920         
26921 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
26922
26923         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
26924
26925 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
26926
26927         * appdomain.h: Added loader_optimization here to sync with the C#
26928         code, and add disallow_binding_redirects field.
26929
26930 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
26931
26932         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
26933
26934         * reflection.c (mono_image_build_metadata): Fix crash on modules
26935         with no types.
26936
26937         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
26938
26939         * icall.c (ves_icall_get_method_info): Return callingConvention as
26940         well.
26941
26942         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
26943         namespaces from the EXPORTEDTYPE table as well.
26944
26945         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
26946         from all modules inside the assembly.
26947         
26948 2003-11-11  Martin Baulig  <martin@ximian.com>
26949
26950         * reflection.c (mono_reflection_bind_generic_parameters): Make
26951         this work for interfaces.
26952
26953 2003-11-11  Martin Baulig  <martin@ximian.com>
26954
26955         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
26956
26957 2003-11-11  Martin Baulig  <martin@ximian.com>
26958
26959         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
26960         "MonoInflatedMethod" and "MonoInflatedCtor".
26961
26962 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
26963
26964         * reflection.c (resolution_scope_from_image): Use the assembly table
26965         from the manifest module, since other modules don't have it.
26966
26967         * debug-helpers.c (mono_type_full_name): New helper function.
26968
26969         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
26970
26971         * image.c (mono_image_load_file_for_image): New public function which
26972         is a replacement for the load_file_for_image in class.c.
26973
26974         * assembly.c (mono_assembly_load_module): A wrapper for the function
26975         above which does assembly association and reference loading too.
26976
26977         * class.c (mono_class_from_name): Call mono_assembly_load_module.
26978
26979 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26980
26981         * appdomain.c: not all of the attributes for the full assembly name
26982         are required and the order doesn't matter. Fixes bug #50787.
26983
26984 2003-11-10  Dick Porter  <dick@ximian.com>
26985
26986         * locales.c: Use platform-endian UTF16
26987
26988 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
26989
26990         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
26991         
26992 2003-11-10  Martin Baulig  <martin@ximian.com>
26993
26994         * metadata.c
26995         (mono_metadata_load_generic_params): Make this actually work.
26996
26997         * reflection.c (mono_reflection_bind_generic_parameters): If our
26998         parent is a generic instance, pass all the `types' to it, no
26999         matter whether it has the same number of type parameters or not.
27000
27001 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
27002
27003         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
27004
27005         * assembly.c (mono_assembly_load_references): Move the image<->assembly
27006         assignment code to this function so it gets called recursively for all
27007         modules.
27008
27009         * image.c (load_modules): Remove the assembly assignment since it is
27010         now done by mono_assembly_load_references.
27011         
27012         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
27013         Add 'module' argument.
27014         (mono_module_get_types): New helper function.
27015         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
27016
27017 2003-11-08  Martin Baulig  <martin@ximian.com>
27018
27019         * class.c (mono_class_inflate_generic_method): Interface method
27020         don't have a header.
27021
27022         * reflection.c (mono_image_get_methodspec_token): Take an
27023         additional `MonoGenericInst *' argument instead of reading it from
27024         the header; this is necessary to support interfaces.
27025         (mono_image_create_token): Pass the `MonoGenericInst *' from the
27026         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
27027         (inflated_method_get_object): Take an additional `MonoGenericInst *'
27028         argument.
27029
27030         * reflection.h (MonoReflectionInflatedMethod): Added
27031         `MonoGenericInst *ginst'.
27032
27033 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
27034
27035         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
27036
27037 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
27038
27039         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
27040
27041 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
27042
27043         * reflection.c 
27044         (reflection_methodbuilder_from_method_builder):
27045         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
27046         initialize a ReflectionMethodBuilder structure.
27047         (mono_image_get_methodbuilder_token):
27048         (mono_image_get_ctorbuilder_token): New functions to emit memberref
27049         tokens which point to types in another module inside the same assembly.
27050
27051         * reflection.c: Use the new helper functions.
27052         
27053         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
27054
27055         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
27056         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
27057
27058         * reflection.c (resolution_scope_from_image): Emit a moduleref if
27059         neccesary.
27060
27061         * reflection.c (mono_image_build_metadata): Emit metadata only for the
27062         current module. Emit the manifest only for the main module.
27063
27064         * reflection.c (mono_image_create_token): Add assertion when a 
27065         memberref needs to be created.
27066
27067         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
27068
27069         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
27070         larger buffer for the custom attribute blob. Fixes #50637.
27071         
27072 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27073
27074         * threadpool.c: notify listener on async processing handles after
27075         invoking the async callback. Thanks to Zoltan.
27076
27077 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27078
27079         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
27080         avoid code duplication.
27081
27082         * reflection.h (MonoDynamicImage): New type which is currently unused,
27083         but will be used through the ref.emit code in place of 
27084         MonoDynamicAssembly.
27085
27086         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27087         object layout.
27088
27089         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
27090         a MonoDynamicImage instead of just a MonoImage.
27091         
27092         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
27093         icalls to ModuleBuilder but keep their semantics, so they will work
27094         with moduleb->assemblyb. This will change later.
27095         
27096 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27097
27098         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
27099         object layout.
27100
27101         * reflection.c (mono_image_build_metadata): Avoid creation of a default
27102         main module, since it is now done by the managed code.
27103
27104 2003-11-03  Martin Baulig  <martin@ximian.com>
27105
27106         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
27107         `ginst->klass' here.
27108         (method_encode_methodspec): Don't use the `ginst->generic_method's
27109         klass if it's a generic instance, use `ginst->klass' in this case.
27110
27111 2003-11-03  Martin Baulig  <martin@ximian.com>
27112
27113         * reflection.c (mono_image_get_generic_method_param_info):
27114         Removed, use mono_image_get_generic_param_info() instead.
27115         (mono_image_get_type_info): Write the GenericParam table before
27116         the Method table.  This is neccessary because in the GenericParam
27117         table, type parameters of the class (ie. '!0' etc.) must come
27118         before the ones from its generic methods (ie. '!!0' etc).
27119
27120 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
27121
27122         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
27123
27124 2003-11-02  Martin Baulig  <martin@ximian.com>
27125
27126         * reflection.c (create_generic_typespec): Take a
27127         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
27128         the generic parameters from it.
27129
27130 2003-11-02  Martin Baulig  <martin@ximian.com>
27131
27132         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
27133         instead of a `MonoClassField *' since we just need the type.
27134         (create_generic_typespec): New static function.  Creates a
27135         TypeSpec token for a generic type declaration.
27136         (mono_image_get_generic_field_token): New static function.
27137         (mono_image_create_token): If we're a FieldBuilder in a generic
27138         type declaration, call mono_image_get_generic_field_token() to get
27139         the token.
27140
27141 2003-11-02  Martin Baulig  <martin@ximian.com>
27142
27143         * reflection.h
27144         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
27145         `MonoReflectionGenericInst *declaring_type' and
27146         `MonoReflectionGenericInst *reflected_type' fields.
27147
27148         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
27149         `MonoReflectionGenericInst *declaring_type' and a
27150         `MonoReflectionGenericInst *reflected_type' argument instead of a
27151         single `MonoReflectionGenericInst *type' one.  Set
27152         `res->declaring_type' and `res->reflected_type' from them.
27153         (mono_reflection_inflate_field): Likewise.      
27154
27155 2003-11-02  Martin Baulig  <martin@ximian.com>
27156
27157         * class.c (mono_class_setup_vtable): Don't store generic methods
27158         in the vtable.  
27159
27160 2003-11-02  Martin Baulig  <martin@ximian.com>
27161
27162         * reflection.h (MonoReflectionGenericInst): Added
27163         `MonoReflectionType *declaring_type'.
27164
27165         * reflection.c (mono_reflection_bind_generic_parameters): Use
27166         `if (tb->parent)' instead of `klass->parent'.
27167
27168 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
27169
27170         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
27171         with an empty ASSEMBLY table.
27172
27173         * reflection.c (mono_image_build_metadata): Avoid using the same loop
27174         variable in the inner and outer loops.
27175
27176 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
27177
27178         * metadata.h (mono_metadata_make_token): Put parentheses around macro
27179         argument.
27180
27181         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
27182         
27183         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
27184         icalls. Instead, do everything in managed code. This is needed since
27185         it is hard to restore the original domain etc. in unmanaged code in the
27186         presence of undeniable exceptions.
27187
27188         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
27189         New icalls to push and pop appdomain refs.
27190
27191 2003-10-31  Martin Baulig  <martin@ximian.com>
27192
27193         * class.c (inflate_generic_type): Renamed to
27194         mono_class_inflate_generic_type() and made it public.
27195
27196         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
27197         New interncall.
27198
27199         * loader.c (mono_field_from_memberref): Also set the retklass for
27200         typespecs.
27201
27202         * fielder.c (mono_image_get_inflated_field_token): New static
27203         method; creates a metadata token for an inflated field.
27204         (mono_image_create_token, fixup_method): Added support for
27205         "MonoInflatedField".
27206         (fieldbuilder_to_mono_class_field): New static function.
27207         (mono_reflection_inflate_field): New public function.
27208
27209         * reflection.h
27210         (MonoReflectionGenericInst): Added `MonoArray *fields'.
27211         (MonoReflectionInflatedField): New typedef.     
27212
27213 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
27214
27215         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
27216         for Solaris and other platforms without s6_addr16
27217
27218 2003-10-30  Martin Baulig  <martin@ximian.com>
27219
27220         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
27221         argument instead of two.
27222         (mono_class_inflate_generic_signature): Likewise.
27223         (inflate_generic_header): Likewise.
27224         (mono_class_inflate_generic_method): Likewise.  In addition, if
27225         `ginst->klass' is set, it becomes the new `method->klass'.
27226
27227         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
27228         field.
27229
27230         * reflection.c (encode_generic_method_sig): Write a 0xa as the
27231         first byte. [FIXME]
27232         (method_encode_methodspec): If we have generic parameters, create
27233         a MethodSpec instead of a MethodRef.
27234         (fixup_method): Added support for "MonoInflatedMethod" and
27235         "MonoInflatedCtor".
27236         (mono_image_create_token): Added support for "MonoInflatedMethod"
27237         and "MonoInflatedCtor".
27238         (inflated_method_get_object): New static function; returns a
27239         managed "System.Reflection.MonoInflatedMethod" object.
27240         (mono_reflection_bind_generic_method_parameters): Return a
27241         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
27242         (mono_reflection_inflate_method_or_ctor): Likewise.
27243         (mono_image_get_generic_method_param_info): Initialize unused
27244         fields to zero.
27245         (mono_image_get_generic_param_info): Likewise.
27246
27247         * reflection.h (MonoReflectionInflatedMethod): New public
27248         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
27249         "S.R.MonoInflatedCtor" classes.
27250
27251         * loader.c (method_from_memberref): If we're a TypeSpec and it
27252         resolves to a generic instance, inflate the method.
27253
27254 2003-10-28  Dick Porter  <dick@ximian.com>
27255
27256         * object.c (mono_runtime_run_main): Convert command-line arguments
27257         into utf8, falling back to the user's locale encoding to do so.
27258
27259 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
27260
27261         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
27262         at this time.
27263
27264         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
27265
27266         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
27267         up icalls at method definition time. Partially fixes #33569.
27268
27269 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
27270
27271         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
27272         marshalling of arrays. Fixes #50116.
27273
27274         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
27275
27276         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
27277         points to a vtable in the dying appdomain.
27278
27279         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
27280         listeners into unmanaged code inside the lock.
27281
27282         * object.c (mono_class_vtable): Turn off typed allocation in non-root
27283         domains and add some comments.
27284
27285 2003-10-25  Martin Baulig  <martin@ximian.com>
27286
27287         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
27288
27289         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
27290
27291         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
27292         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
27293         currently parsing.  Create the generic class and store it in
27294         `generic_inst->klass' before parsing the type arguments.  This is
27295         required to support "recursive" definitions; see mcs/tests/gen-23.cs
27296         for an example.
27297         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
27298         to support recursive typespec entries.
27299
27300         * class.c (mono_class_setup_parent): If our parent is a generic
27301         instance, we may get called before it has its name set.
27302         (mono_class_from_generic): Splitted into
27303         mono_class_create_from_generic() and mono_class_initialize_generic().
27304
27305 2003-10-25  Martin Baulig  <martin@ximian.com>
27306
27307         * icall.c (ves_icall_Type_BindGenericParameters): Return a
27308         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
27309         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
27310         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
27311
27312         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
27313         (create_typespec): Likewise.
27314         (mono_reflection_bind_generic_parameters): Return a
27315         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
27316         (mono_reflection_inflate_method_or_ctor): New public function.
27317
27318         * reflection.h (MonoReflectionGenericInst): New typedef.        
27319
27320 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
27321
27322         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
27323         inside the domain lock. Fixes #49993.
27324         
27325         * object.c (mono_class_vtable): When typed allocation is used, 
27326         allocate vtables in the GC heap instead of in the mempool, since the
27327         vtables contain GC descriptors which are used by the collector even
27328         after the domain owning the mempool is unloaded.
27329
27330         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
27331
27332         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
27333         reflect what it does. Also invalidate mempools instead of freeing
27334         them if a define is set.
27335
27336         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
27337         of the appdomain.
27338         
27339         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
27340         hold the finalizable objects in this domain.
27341
27342         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
27343         appdomain.
27344
27345         * appdomain.c (mono_domain_set): New function to set the current
27346         appdomain, but only if it is not being unloaded.
27347
27348         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
27349         appdomain which is being unloaded.
27350         
27351         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
27352         unloading of the root appdomain.
27353
27354         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
27355         icall to execute a method in another appdomain. Intended as a 
27356         replacement for InternalSetDomain, which can confuse the code 
27357         generation in the JIT.
27358
27359         * appdomain.c (mono_domain_is_unloading): New function to determine
27360         whenever an appdomain is unloading.
27361
27362         * appdomain.c (mono_domain_unload): New function to correctly unload
27363         an appdomain.
27364
27365         * assembly.c (mono_assembly_load_references): Check that an assembly
27366         does not references itself.
27367
27368         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
27369         domain manually, it asks the finalizer thread to do it, then waits for
27370         the result. Also added a timeout.
27371
27372         * icall.c: Register the new icalls.
27373
27374         * threads.h threads.c: Export the mono_gc_stop_world and 
27375         mono_gc_start_world functions.
27376         
27377         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
27378         function to fill out the mempool with 0x2a.
27379
27380 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
27381
27382         * reflection.h (MonoReflectionMethodAux): New structure to store
27383         information which is rarely used, thus is not in the MonoMethod
27384         structure.
27385
27386         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
27387         store the aux info.
27388
27389         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
27390         and marshalling info into the aux structure.
27391
27392         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
27393         from the aux structure.
27394
27395         * loader.c (mono_method_get_param_names): Retrieve the param names from
27396         the aux structure.
27397         
27398 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
27399
27400         * exception.h exception.c: Add AppDomainUnloadedException && fix 
27401         warning.
27402
27403 2003-10-21  Dick Porter  <dick@ximian.com>
27404
27405         * socket-io.c
27406         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
27407         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
27408
27409 2003-10-21  Martin Baulig  <martin@ximian.com>
27410
27411         * reflection.c (mono_reflection_bind_generic_parameters):
27412         `klass->parent' is NULL for interfaces.
27413
27414 2003-10-21  Martin Baulig  <martin@ximian.com>
27415
27416         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27417
27418 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
27419
27420         * exception.c (mono_exception_from_name_msg): New helper function for
27421         creating exceptions and initializing their message field.
27422
27423         * exception.c: Simplify functions using the new helper.
27424
27425         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
27426         New function.
27427
27428         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
27429         mono_raise_exception, since otherwise gcc doesn't generate the function
27430         epilog for raise_exception, confusing the stack unwinding in the JIT.
27431         Fixes #45043.
27432
27433         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
27434         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
27435         Fixes #49499.
27436
27437 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27438
27439         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
27440         utf8.
27441
27442 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
27443
27444         * icall.c: Removed GetUninitializedObject method because
27445           AllocateUninitializedClassInstance does the same.
27446
27447 2003-10-18  Martin Baulig  <martin@ximian.com>
27448
27449         * class.c (inflate_generic_signature): Renamed to
27450         mono_class_inflate_generic_signature() and made it public.
27451         (my_mono_class_from_generic_parameter): New static function; if we
27452         don't already have the generic parameter's MonoClass, create a
27453         very simple one which is just used internally in the runtime and
27454         not passed back to managed code.
27455
27456         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
27457
27458         * metadata.h (MonoMethodSignature): Moved the
27459         `MonoGenericParam *gen_params' to the MonoMethodHeader.
27460         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
27461
27462         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
27463         ves_icall_MonoMethod_GetGenericArguments(); this is now an
27464         interncall on the MonoMethod class, not on MethodInfo.
27465         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
27466         calling mono_reflection_bind_generic_method_parameters() directly.
27467
27468         * loader.c (mono_method_get_signature): If this is a MethodSpec;
27469         return the already computed `method->signature'.
27470         (method_from_methodspec): New static function to load a method
27471         from a MethodSpec entry.
27472         (mono_get_method_from_token): Call the new method_from_methodspec()
27473         for MethodSpec tokens.  
27474         (mono_get_method_from_token): If we're a generic method, load the
27475         type parameters.
27476
27477         * reflection.c (mono_image_get_memberref_token): Allow
27478         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
27479         table.
27480         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
27481         (mono_image_create_token): First check whether it's a generic
27482         method (so we'd need to create a MethodSpec), then do the other
27483         two alternatives.
27484         (mono_reflection_bind_generic_method_parameters): Return a
27485         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
27486         called directly from the interncall.
27487
27488 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
27489
27490         * reflection.c (load_public_key): Move loading of the public key
27491         into managed code.
27492
27493         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
27494
27495         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
27496         fields.
27497
27498         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
27499         culture, hash_alg and public_key. Fixes #49555.
27500
27501 2003-10-17  Martin Baulig  <martin@ximian.com>
27502
27503         * class.h (MonoGenericInst): Moved this declaration here and added
27504         `MonoMethod *generic_method'.
27505
27506         * icall.c
27507         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
27508         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
27509
27510         * metadata.c (mono_metadata_type_equal): Two types of
27511         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
27512         index; ie. don't compare the address of the `MonoGenericParam'
27513         structure.
27514         (mono_metadata_load_generic_params): Removed the `MonoMethod
27515         *method' argument.
27516
27517         * metadata.h (MonoGenericInst): Moved declaration to class.h.
27518         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
27519
27520         * reflection.c (method_encode_signature): Encode the number of
27521         generic parameters.
27522         (encode_generic_method_sig): New static function.
27523         (method_encode_methodspec): New static function; creates an entry
27524         in the MethodSpec table for a generic method.
27525         (mono_image_get_methodspec_token): New static function.
27526         (mono_image_create_token): Call mono_image_get_methodspec_token()
27527         for generic methods.
27528         (mono_reflection_bind_generic_method_parameters): New public
27529         function.  Instantiates a generic method.
27530
27531 2003-10-16  Martin Baulig  <martin@ximian.com>
27532
27533         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
27534         *gen_params' here from MonoMethodHeader.
27535
27536         * metadata.c (mono_metadata_parse_method_signature): If we have
27537         generic parameters, initialize `method->gen_params' and then set
27538         the correct `type->data.generic_param' in all the parameters.
27539
27540 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
27541
27542         * threads.c (mono_threads_get_default_stacksize): New function to 
27543         return the default stacksize.
27544
27545         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
27546         termination of the finalizer thread, since the previous method had
27547         race conditions. Fixes #49628.
27548
27549         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
27550         as for the other managed threads.
27551
27552 2003-10-16  Martin Baulig  <martin@ximian.com>
27553
27554         * class.c (inflate_generic_signature): Copy `generic_param_count'
27555         and `gen_params'.
27556
27557         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
27558         New interncall.
27559
27560         * metadata.c (mono_metadata_parse_method_signature): Actually set
27561         the `method->generic_param_count' here.
27562         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
27563
27564 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
27565
27566         * object.h: Add a new field to TypedRef to simplify the implementation
27567         of the REFANY opcodes in the JIT.
27568
27569         * icall.c: Make use of the new field.
27570
27571         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
27572         dynamically.
27573
27574 2003-10-15  Martin Baulig  <martin@ximian.com>
27575
27576         * class.c (mono_class_from_gen_param): Renamed to
27577         mono_class_from_generic_parameter() and moved most of the
27578         functionality from mono_reflection_define_generic_parameter()
27579         here; ie. we create a "real" class here.
27580         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
27581         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
27582         previously been called.
27583
27584         * class.h (MonoGenericParam): Moved the declaration of this struct
27585         here from metadata.h and added `MonoMethod *method'.
27586
27587         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
27588         interncall.
27589
27590         * loader.c (mono_get_method_from_token): If we have any generic
27591         parameters, call mono_metadata_load_generic_params() to read them
27592         from the MONO_TABLE_GENERICPAR.
27593
27594         * metadata.c (mono_metadata_load_generic_params): Added
27595         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
27596
27597         * metadata.h (MonoMethodSignature): Replaced
27598         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
27599         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
27600
27601         * reflection.c (mono_reflection_define_generic_parameter): Moved
27602         most of the functionality into the new
27603         mono_class_from_generic_parameter(); set the `method' field if
27604         we're a method parameter.       
27605
27606 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
27607
27608         * marshal.c (emit_struct_conv): if native size is 0
27609         emit no code.
27610
27611 2003-10-14  Martin Baulig  <martin@ximian.com>
27612
27613         * icall.c: The generics API has changed in the spec since it was
27614         added to System.Type; these modifications make it match the spec
27615         again.
27616         (ves_icall_Type_GetGenericParameters): Renamed to
27617         `ves_icall_Type_GetGenericArguments'.
27618         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
27619         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
27620         `ves_icall_MonoType_get_HasGenericArguments'.
27621         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
27622         `ves_icall_MonoType_get_IsGenericParameter'.
27623         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
27624         this is no interncall anymore.
27625         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
27626         `ves_icall_TypeBuilder_get_IsGenericParameter'.
27627
27628 2003-10-14  Martin Baulig  <martin@ximian.com>
27629
27630         * reflection.c (mono_reflection_bind_generic_parameters): Also
27631         inflate generic methods if we're reading the class from IL.
27632
27633 2003-10-13  Martin Baulig  <martin@ximian.com>
27634
27635         * reflection.c (mono_reflection_define_generic_parameter): This
27636         method isn't called directly from the icall anymore; take a
27637         `MonoReflectionAssemblyBuilder *' so we can use this for type and
27638         method generic parameters.
27639         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
27640         (method_builder_encode_signature): Encode generic parameters.
27641         (mono_image_get_method_info): Write generic params to the
27642         MONO_TABLE_GENERICPARAM table.
27643
27644         * reflection.h (MonoReflectionMethodBuilder): Added
27645         `MonoArray *generic_params'.
27646
27647         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
27648
27649         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
27650         wrapper for mono_reflection_define_generic_parameter().
27651         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
27652
27653 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
27654
27655         * marshal.h: Add missing function to fix build.
27656
27657         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
27658         the SetLastError pinvoke attribute.
27659
27660         * marshal.c (mono_marshal_set_last_error): New helper function called
27661         by the generated code.
27662         
27663         * marshal.c (mono_mb_emit_branch): New helper function.
27664
27665         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
27666
27667         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
27668         classes as parameters and return values of delegates. Fixes #29256. 
27669
27670 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
27671
27672         * locales.c: use gint32 in non HAVE_ICU case
27673
27674 2003-10-11  Martin Baulig  <martin@ximian.com>
27675
27676         * mono-debug.c (mono_debug_add_method): Added a workaround for
27677         bug #48591.
27678
27679 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
27680
27681         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
27682         delegates passed to native code must use the STDCALL calling 
27683         convention. Fixes #35987.
27684
27685 2003-10-10  Martin Baulig  <martin@ximian.com>
27686
27687         * class.c (inflate_generic_type): If we're inflating for a generic
27688         type instance (and not for a generic method), return
27689         MONO_TYPE_MVAR unchanged.
27690
27691 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27692
27693         * string-icalls.c: Join ignores null strings in the source array.
27694         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
27695         * threads.c: GetAvailableTheads is slightly more accurate.
27696
27697 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
27698
27699         * threads.h threads.c : add mono_threads_set_default_stacksize
27700         and pass default to CreateThread calls.
27701
27702 2003-10-09  Dick Porter  <dick@ximian.com>
27703
27704         * icall.c:
27705         * locales.h:
27706         * locales.c: Internal calls for constructing CultureInfo and
27707         related objects from libicu (if its available.)
27708
27709 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
27710
27711         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
27712
27713 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27714
27715         * threadpool.c: added an argument to async_invoke_thread that is the
27716         item to process, pass the MonoAsyncResult to the thread start function
27717         when creating a new thread. This way we don't need to acquire any lock
27718         when we're creating a new thread. Readded a semaphore for faster
27719         response times (instead of that Sleep i added).
27720
27721 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
27722
27723         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
27724         get daylight change dates better on Windows, fix handling
27725         of platforms without tm_gmtoff.
27726
27727 2003-10-06  Martin Baulig  <martin@ximian.com>
27728
27729         * class.c (inflate_generic_method): Renamed to
27730         mono_class_inflate_generic_method() and made public.
27731         (mono_class_init): Don't inflate the generic methods here.
27732         (mono_class_from_generic): Added `gboolean inflate_methods'
27733         argument.  Inflate the methods here.
27734
27735         * loader.c (mono_method_get_param_names): Ignore instances of
27736         generic types for the moment.
27737
27738         * reflection.c (fixup_method): Added support for inflated methods.
27739         (mono_image_create_token): Use mono_image_get_methodref_token()
27740         for inflated methods.
27741         (mono_custom_attrs_from_param): Ignore instances of generic types
27742         for the moment.
27743         (mono_reflection_bind_generic_parameters): New public function.
27744         Moved all the functionality from
27745         ves_icall_Type_BindGenericParameters() here and added support for
27746         dynamic types.
27747         (mono_reflection_define_generic_parameter): Initialize
27748         `klass->methods' here.
27749
27750         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
27751         functionality into mono_reflection_define_generic_parameter().
27752         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
27753         TypeBuilder, return that TypeBuilder.
27754
27755 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27756
27757         * appdomain.c: removed mono_delegate_semaphore.
27758
27759         * threadpool.c:
27760         (mono_thread_pool_add): moved hash table creation inside and the thread 
27761         creation outside of the critical region.
27762         (mono_thread_pool_finish): removed obsolete code.
27763         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
27764         continue or exit the thread depending on the queue.
27765
27766 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
27767
27768         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
27769         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
27770         handle more bool marshalling options
27771
27772 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
27773
27774         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
27775         arrays of structs. Also add a more descriptive error message when
27776         a structure member is marshalled as LPArray.
27777
27778 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
27779
27780         * marshal.c (mono_marshal_get_native_wrapper): Add support for
27781         marshalling arrays of complex types. Fixes #29098. Also remove an
27782         usused and incomplete function.
27783
27784 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
27785
27786         * gc.c: report heap_size - free_bytes as total memory allocated
27787         (bug#49362).
27788
27789 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
27790
27791         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
27792         fix timezone handling problems on Windows.
27793         
27794         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
27795         asserts when the year is outside the range handled by ms the functions.
27796
27797         * class.c (setup_interface_offsets): If the class is an interface,
27798         fill out its interface_offsets slot.
27799
27800 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27801
27802         * threadpool.c: mark threadpool threads as background.
27803
27804 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
27805
27806         * decimal.c - define DECINLINE to nothing if not using GCC
27807
27808 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
27809
27810         * assembly.c: More refcount fixes.
27811
27812 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27813
27814         * string-icalls.c: if we're not trimming, return the same string.
27815         When not splitting, don't create a new string.
27816
27817 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27818
27819         * image.c:
27820         (mono_image_open): increment the ref_count inside the critical section.
27821
27822 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
27823
27824         * image.c (mono_image_open): Fix reference counting bug.
27825
27826 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
27827
27828         * marshal.c (mono_marshal_type_size) struct alignment changed for 
27829         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
27830         64bits. Avoid leak in mono_marshal_get_native_wrapper when
27831         mono_lookup_pinvoke_call throws.        
27832
27833 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
27834
27835         * reflection.c (mono_reflection_parse_type): Fix #49114.
27836
27837         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
27838         temporary workaround for cygwin header problem.
27839
27840         * object.c (mono_object_isinst): Synchronize this with the code
27841         generated by the JIT for casts.
27842
27843 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
27844
27845         * reflection.c (encode_type): Fix #38332.
27846
27847 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
27848
27849         * marshal.c (mono_marshal_method_from_wrapper): New function to return
27850         the original method from the wrapper method.
27851
27852 2003-09-25  Martin Baulig  <martin@ximian.com>
27853
27854         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
27855         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
27856         (ves_icall_Type_get_IsGenericInstance): New interncall.
27857
27858 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
27859
27860         * object.c: fix cast warning in big endian code.
27861
27862 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
27863
27864         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
27865         
27866 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27867
27868         * assembly.c: don't call check_env from mono_assembly_load. It's
27869         already done once in mono_assemblies_init and may cause headaches when
27870         multiple threads are loading assemblies.
27871
27872 2003-09-19  Martin Baulig  <martin@ximian.com>
27873
27874         * reflection.c (mono_reflection_define_generic_parameter): Don't
27875         allocate `klass->methods', set `klass->flags' to
27876         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
27877
27878 2003-09-18  Martin Baulig  <martin@ximian.com>
27879
27880         * class.c (mono_class_init): Don't create `class->methods' if it's
27881         already initialized.
27882
27883         * metadata.c (mono_metadata_load_generic_params): Make this
27884         actually work.
27885
27886         * reflection.c (mono_reflection_define_generic_parameter): Set
27887         parent class and interfaces from the constraints.
27888
27889         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
27890         to keep this struct in sync with the declaration in TypeBuilder.cs.
27891
27892 2003-09-17  Martin Baulig  <martin@ximian.com>
27893
27894         * metadata.h (MonoType): Replaced the data's `int type_param'
27895         field with `MonoGenericParam *generic_param'.
27896         (MonoGenericParam): Added `MonoClass *klass'.
27897
27898         * class.c (mono_class_from_gen_param): Removed the
27899         `MonoImage *image' and `int type_num' arguments.
27900
27901         * metadata.c (mono_metadata_parse_generic_param): New static
27902         method; creates a MonoGenericParam which just contains the index.
27903         (do_mono_metadata_parse_type): Call
27904         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
27905         MONO_TYPE_MVAR.
27906
27907         * reflection.c (mono_image_typedef_or_ref): Generic type
27908         parameters may be in the same assembly, but never use a typedef
27909         for them.
27910         (mono_reflection_define_generic_parameter): We're now creating a
27911         "real" class for the type parameter; it's now safe to call
27912         mono_class_from_mono_type() on the class'es type, it'll do the
27913         right thing.
27914
27915 2003-09-16  Martin Baulig  <martin@ximian.com>
27916
27917         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
27918         `symfile->range_entry_size' and `symfile->class_entry_size' here;
27919         the `symfile' data structure must be fully initialized before it
27920         gets added to the table.
27921
27922 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
27923
27924         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
27925
27926         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
27927         class init trampolines.
27928
27929 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
27930
27931         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
27932         to the built-in profiler to turn off time and allocation profiling
27933         respectively.
27934
27935 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
27936
27937         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
27938         g_direct_equal.
27939
27940         * debug-helpers.c (mono_method_full_name): Print the wrapper type
27941         in human readable form.
27942
27943 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
27944
27945         * reflection.c icall.c: Fixed warnings.
27946
27947         * image.c (load_class_names): Use a temporary hash table to hold the
27948         namespaces in order to avoid doing many string comparisons.
27949
27950         * image.h: Fix typo.
27951
27952         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
27953         Pass NULL instead of g_direct_equal to the GHashTable constructor 
27954         since the NULL case is short-circuited inside g_hash_table_lookup, 
27955         leading to better performance.  
27956
27957         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
27958         obtain the first custom attribute for a given index. Depends on the
27959         CustomAttribute table being sorted by the parent field.
27960
27961         * reflection.c (mono_custom_attrs_from_index): Use the new function 
27962         for better performance.
27963
27964 2003-09-07  Martin Baulig  <martin@ximian.com>
27965
27966         * class.c (mono_class_init): If we're a generic instance, inflate
27967         all our methods instead of loading them from the image.
27968         (mono_class_from_generic): Set `class->methods = gklass->methods'.
27969
27970 2003-09-07  Martin Baulig  <martin@ximian.com>
27971
27972         * mono-debug-debugger.c: Added support for constructors.
27973
27974 2003-09-06  Martin Baulig  <martin@ximian.com>
27975
27976         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
27977         New interncall.
27978
27979         * reflection.c (mono_reflection_setup_generic_class): Call
27980         ensure_runtime_vtable() to create the vtable.
27981
27982 2003-09-05  Martin Baulig  <martin@ximian.com>
27983
27984         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
27985         MONO_TYPE_MVAR.
27986
27987 2003-09-04  Martin Baulig  <martin@ximian.com>
27988
27989         * reflection.c (mono_reflection_define_generic_parameter): Generic
27990         parameters start with zero.
27991
27992 2003-09-04  Martin Baulig  <martin@ximian.com>
27993
27994         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
27995
27996         * reflection.h (MonoReflectionGenericParam): New typedef.
27997         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
27998         the generic parameters from the managed TypeBuilder.
27999
28000         * reflection.c (mono_reflection_define_generic_parameter): New function.
28001         (mono_reflection_create_runtime_class): Encode generic parameters.
28002         (mono_reflection_setup_generic_class): New function; this is
28003         called after adding adding all generic params to the TypeBuilder.
28004         (encode_type): Added MONO_TYPE_VAR.
28005
28006 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
28007
28008         * class.h class.c (mono_class_needs_cctor_run): Moved this method
28009         here from the JIT.
28010
28011         * assembly.h assembly.c: Moved the AOT loading code into an assembly
28012         load hook.
28013
28014 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
28015
28016         * reflection.h reflection.c class.h class.c: Delete duplicate 
28017         definition of mono_type_get_name () from reflection.c and export the
28018         one in class.c.
28019
28020         * class.c: Class loading fixes from Bernie Solomon 
28021         (bernard@ugsolutions.com).
28022
28023         * reflection.c: Endianness fixes from Bernie Solomon 
28024         (bernard@ugsolutions.com).
28025         
28026 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
28027
28028         * assembly.h assembly.c: Define a file format version for AOT
28029         libraries.
28030         
28031         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
28032
28033         * appdomain.h (MonoJitInfo): New field to determine whenever the
28034         code is domain neutral.
28035         
28036 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
28037
28038         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
28039
28040 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
28041
28042         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
28043         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
28044         Avoid caching the result since strings must be domain specific. Fixes
28045         #48050.
28046
28047 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
28048
28049         * marshal.c (mono_marshal_init): Make this callable multiple times
28050         since it is hard to find a correct place to call it.
28051
28052         * object.c (mono_runtime_class_init): Execute static constructors in
28053         the correct appdomain.
28054
28055         * image.c (build_guid_table): Handle the case when multiple images have
28056         the same GUID.
28057
28058 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28059
28060         * icall.c: added a couple of icalls for System.Web.
28061
28062 2003-08-28  Martin Baulig  <martin@ximian.com>
28063
28064         * icall.c (ves_icall_Type_BindGenericParameters): Use
28065         `klass->generic_inst' instead of `&klass->byval_arg' in the
28066         mono_type_get_object() call.  The returned type must be
28067         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
28068
28069 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
28070
28071         * NOTES: New file.
28072
28073         * object.c (mono_class_proxy_vtable): Make it thread safe.
28074
28075         * pedump.c: Fix warning.
28076
28077         * object.c appdomain.h: Get rid of metadata_section. 
28078         It is no longer needed and it was causing deadlocks with domain->lock.
28079
28080         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
28081
28082 2003-08-26  Martin Baulig  <martin@ximian.com>
28083
28084         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
28085
28086 2003-08-26  Martin Baulig  <martin@ximian.com>
28087
28088         * pedump.c (main): Call mono_metadata_init(),
28089         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
28090         and mono_loader_init().
28091
28092 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
28093
28094         * loader.h: Add missing include to fix build.
28095
28096         * image.h: mono_image_load_references is no more.
28097
28098         * assembly.c: Reworked assembly loading to make it really thread safe.
28099         After these changes, the assembly returned by mono_assembly_open is
28100         fully initialized, i.e. all its references assemblies are loaded.
28101
28102         * assembly.c (mono_image_load_references): Renamed to 
28103         mono_assembly_load_references, and made private, since clients no
28104         longer need to call it.
28105
28106         * class.c: Removed calls to mono_assembly_load_references, since it was
28107         a source of deadlocks.
28108
28109         * loader.h loader.c class.h class.c: Protect data structures using a 
28110         new lock, the loader lock.
28111
28112         * class.c (mono_class_setup_vtable): Create temporary hash tables and
28113         GPtrArrays only when needed.
28114
28115         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
28116         into empty structures by mcs. Fixes pinvoke7.cs.
28117         
28118         * domain.c (mono_init): Call a new initialization function.
28119
28120         * appdomain.c (mono_runtime_init): Call the new initializer function
28121         of the marshal module.
28122
28123         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
28124         inserted into empty structures by mcs. Fixes pinvoke7.cs.
28125
28126         * marshal.h marshal.c: Added locks around the wrapper caches to make
28127         this module thread safe.
28128
28129         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
28130         this argument. Fixes pinvoke1.exe.
28131
28132 2003-08-25  Lluis Sanchez <lluis@ximian.com>
28133
28134         * object.h: Added call_type field to MonoMethodMessage and the corresponding
28135         enumeration of values. Removed fields to store remote call output values in
28136         MonoAsyncResult. Not needed any more.
28137         * object.c: Initialize call_type and async_result fields in mono_message_init.
28138         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
28139         dispatching the message.
28140         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
28141         async call to finish. To do it use a message with EndInvoke call type.
28142
28143 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
28144
28145         * loader.h loader.c (mono_method_hash_marhal_info): New function which
28146         determines whenever a method has marshalling info.
28147
28148 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28149
28150         * assembly.c: fix the build on windows.
28151
28152 2003-08-22 Lluis Sanchez <lluis@ximian.com>
28153
28154         * object.cs: Fixed bug #47785.
28155
28156 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
28157
28158         * string-icalls.c (StringReplace): If their are no occurances of
28159         the old string found return a reference to the supplied
28160         string. This saves some memory and matches MS behavoir.
28161         
28162 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28163
28164         * socket-io.c: fixed compilation for systems that define AF_INET6
28165         and don't define SOL_IP/SOL_IPV6.
28166
28167 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
28168
28169         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
28170         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
28171
28172         * rawbuffer.c rawbuffer.h: Make this module thread safe.
28173
28174         * domain.c: Make this module thread safe.
28175
28176         * domain.c (mono_init): Call new initialization function.
28177
28178         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
28179         reference types too. Fixes #38812.
28180
28181         * image.c (mono_image_init): Fixed warnings.
28182
28183         * class.c (mono_class_from_typeref): Handle assembly load failure
28184         correctly.
28185
28186         * appdomain.c (add_assemblies_to_domain): Handle the case when
28187         the references of an assembly are not yet loaded.
28188
28189         * metadata.c image.c assembly.c: Moved initialization of global
28190         variables to a separate function called at startup since lazy 
28191         initialization of these variables is not thread safe.
28192         
28193         * image.c assembly.c: Made this module thread safe by adding locks in 
28194         the appropriate places.
28195
28196         * domain.c (mono_init): Call the new initialization functions of the
28197         three modules.
28198
28199 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
28200
28201         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
28202           make a direct call. It is proxy's work to make the call asynchronous.
28203           mono_delegate_end_invoke(): If the targe is a proxy, just collect
28204           the return values.
28205         * object.cs: mono_method_call_message_new(): read AsyncResult and
28206           state object from parameters list, if this info is requested.
28207         * object.h: Added fields to store remote call output values in
28208           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
28209
28210 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
28211
28212         * object.h: add needed fields to MonoThread.
28213         * threads.c, threads.h: allow registering a function to cleanup data
28214         allocated per thread by the JIT.
28215
28216 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
28217
28218         * loader.h: portability fix by Bernie Solomon
28219         * <bernard@ugsolutions.com>.
28220
28221 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
28222
28223         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
28224         return a MonoArray. This simplifies the code and also ensures that
28225         the cache allways contains an object reference as a value.
28226
28227         * icall.c (ves_icall_get_parameter_info): Simplified using the new
28228         function.
28229
28230 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28231
28232         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
28233         fixes a problem with byte ordering when getting the address family for
28234         a socket.
28235
28236 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
28237
28238         * .cvsignore: Added monosn.
28239
28240         * reflection.h reflection.c loader.c: Added support for parameter
28241         marshalling to dynamically created types. Fixes #47295.
28242
28243 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
28244
28245         * rand.c: remove useless warnings.
28246
28247 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
28248
28249         * class.c: implemented ldtoken for methods and fieldrefs.
28250
28251 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28252
28253         * threadpool.c: when mono_async_invoke was called, no one took care of
28254         monitoring the queue. So if the method invoked took some time and we
28255         got new async invoke requests after 500 ms (the thread created waited
28256         that long in WaitForSingleObject), the new async invoke was not called
28257         until the previous one finished.
28258
28259         This is fixed now. Thanks to Totte for helping with it.
28260
28261 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28262
28263         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
28264
28265 2003-08-11  Martin Baulig  <martin@ximian.com>
28266
28267         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
28268
28269 2003-08-06  Martin Baulig  <martin@ximian.com>
28270
28271         * mono-debug-debugger.c: Added support for static fields,
28272         properties and methods.
28273
28274 2003-08-06  Martin Baulig  <martin@ximian.com>
28275
28276         * mono-debug-debugger.c: Don't store the MonoString's vtable to
28277         make this work for applications with multiple application domains.
28278
28279 2003-08-04  Martin Baulig  <martin@ximian.com>
28280
28281         * mono-debug-debugger.c: Completely reworked the type support; the
28282         most important thing is that we're now just using one single
28283         `MonoType' instance per type.
28284
28285 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
28286
28287         * mono-endian.h, mono-endian.c, icall.c: Added icall
28288         ves_icall_System_Double_AssertEndianity to assert double word endianity
28289         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
28290
28291 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28292
28293         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
28294         support, icalls and fixes.
28295
28296 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
28297
28298         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
28299         classes that are a punctuation character in .NET is not the same a
28300         g_unichar_ispunct.
28301
28302 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
28303
28304         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
28305
28306 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
28307
28308         * icall.c: Add new MemCopy internalcall.
28309         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
28310         Simplified code; It is not necessary to handle all the cases here,
28311         as the C# code takes care of it.  Only handle the case of the name
28312         resource embedded into the assembly.
28313
28314         Changed signature to return the data pointer and the size of the
28315         data. 
28316
28317 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
28318
28319         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
28320         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
28321
28322 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
28323
28324         * socket-io.c: ignore EINTR error in select.
28325
28326 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
28327
28328         * class.h, class.c: removed unused subclasses field in MonoClass.
28329
28330 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
28331
28332         * icall.c: improve fix of get_base_definition(). If the parent class
28333           doesn't have the mehod, look at the parent of the parent.
28334         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
28335           to check if a parameter is an in or out parameter
28336           (PARAM_ATTRIBUTE_IN is not set by default).
28337           mono_method_return_message_restore(): Use mono_class_value_size to
28338           get the size of a value type. mono_type_stack_size (parameterType)
28339           does not return the correct value if parameterType is byRef.
28340           mono_load_remote_field(), mono_load_remote_field_new(),
28341           mono_store_remote_field(), mono_store_remote_field_new():
28342           raise exception if the remote call returns an exception.
28343
28344 2003-07-28  Martin Baulig  <martin@ximian.com>
28345
28346         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
28347         method.  This is a wrapper around mono_runtime_invoke() which
28348         boxes the instance object if neccessary.
28349
28350 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28351
28352         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
28353         metadata.h, row-indexes.h, verify.c: first cut of generics support.
28354
28355 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28356
28357         * icall.c: disable mcs bug workaround.
28358
28359 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
28360
28361         * object.c (mono_runtime_class_init): Take the metadata_section
28362         mutex before obtaining the domain mutex.
28363
28364         * appdomain.h: Added definition of metadata_section mutex here. 
28365
28366         * object.c: define metadata_mutex here.
28367
28368 2003-07-24  Ravi Pratap  <ravi@ximian.com>
28369
28370         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
28371         fixed.
28372
28373 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
28374
28375         * reflection.c: Fix bug #46669
28376
28377 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28378
28379         * exception.c:
28380         * exception.h:
28381         * icall.c:
28382         * object.h: fill in the type name for TypeLoadException.
28383
28384 2003-07-23  Ravi Pratap  <ravi@ximian.com>
28385
28386         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
28387         relationship between TypeBuilders while compiling corlib) and bug
28388         45993 (Array types returned from the runtime while compiling
28389         corlib were from the loaded corlib).
28390
28391 2003-07-22  Martin Baulig  <martin@ximian.com>
28392
28393         * mono-debug-debugger.c: Reworked the type support a bit more;
28394         distinguish between types and classes.
28395
28396 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
28397
28398         * icall.c: add IsArrayImpl icall.
28399
28400 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
28401
28402         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
28403         initializing real_size only once. Also fix bug #46602.
28404
28405 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
28406
28407         * object.c: Renamed mono_metadata_section to metadata_section.
28408
28409 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
28410
28411         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
28412           empty array if the type is an array. Fixed.
28413           ves_icall_MonoMethod_get_base_definition: if the base method
28414           is abstract, get the MethodInfo from the list of methods of
28415           the class.
28416         * reflection.c: ParameterInfo.PositionImpl should be zero-based
28417           and it was 1-based. Fixed in mono_param_get_objects.
28418
28419 2003-07-20  Martin Baulig  <martin@ximian.com>
28420
28421         * mono-debug.h: Set version number to 31.
28422         (mono_debug_init): Added `MonoDomain *' argument.
28423
28424         * mono-debug-debugger.c: Reworked the type support; explicitly
28425         tell the debugger about builtin types; pass the `klass' address to
28426         the debugger.
28427
28428 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
28429
28430         * image.c: Allow new metadata tables to be loaded without a
28431         warning. Also update the warning message to give the new constant value.
28432                 
28433 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
28434
28435         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
28436         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
28437         array type representation changes.
28438
28439 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
28440
28441         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
28442         on Environment.Exit () call.
28443
28444 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
28445
28446         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
28447         requires a matching corlib.
28448
28449 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
28450
28451         * Changelog: My editor decided to add a CR to each line. Sorry about that.
28452           Committed again without the CRs.
28453         
28454 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
28455
28456         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
28457           getting it from the "this" socket instance. Did not work
28458           if the socket is a subclass of Socket.
28459           Also fixed bug #35371.
28460
28461 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
28462
28463         * metadata.c: fixed size for TypedByRef.
28464         * loader.c: when searching for a method, consider the vararg amrker.
28465         * unicode.c, decimal.c: constify some arrays.
28466
28467 2003-07-15  Dick Porter  <dick@ximian.com>
28468
28469         * socket-io.c: Fixed compilation for gcc < 3.2.
28470
28471         Fixed compilation for machines that don't have AF_INET6 (thanks to
28472         Bernie Solomon <bernard@ugsolutions.com> for that part.)
28473
28474         Fixed compile warnings.
28475         
28476         Fixed formatting and line endings.
28477
28478 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
28479
28480         * socket-io.h:
28481         * socket-io.c: Added IPv6 support.
28482
28483 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
28484
28485         * class.c (mono_class_is_assignable_from): New function to implement
28486         the is_assignable_from logic. Used by mono_object_isinst, 
28487         Type::IsAssignableFrom () and the interpreter.
28488
28489         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
28490         Object, even interfaces.
28491         
28492         * object.c (mono_object_isinst): Implement in terms of 
28493         is_assignable_from.
28494
28495         * icall.c (ves_icall_type_is_assignable_from): New icall.
28496
28497 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
28498
28499         * domain.c (foreach_domain): fix compiler warning.
28500
28501 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
28502
28503         * image.c (load_metadata_ptrs): use g_strndup because strndup is
28504         not available on all plattforms
28505
28506 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
28507
28508         * image.h image.c: Store the metadata version string in MonoImage.
28509         * icall.c: New icall to retrieve the image version.
28510         * reflection.c (create_dynamic_image): Fill in the image version field
28511         * reflection.c (build_compressed_metadata): Use the image version
28512         from the image structure.
28513
28514 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28515
28516         * appdomain.c: modified comment.
28517         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
28518         That will be its last iteration when mono_gc_cleanup is called from
28519         mono_runtime_cleanup and before the domain is unloaded.
28520
28521         Fixes bug #45962.
28522
28523 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
28524
28525         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
28526         attributes.
28527
28528 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28529
28530         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
28531         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
28532         Bernie Solomon <bernard@ugsolutions.com>.
28533
28534 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
28535
28536         * object.c, object.h: provide mono_object_new_fast() for faster
28537         allocation in some special cases.
28538
28539 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
28540
28541         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
28542         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
28543
28544 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
28545
28546         * threadpool.c: fix leaks.
28547
28548 2003-07-01  Dick Porter  <dick@ximian.com>
28549
28550         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
28551         using MonoGHashTables.  Fixes threadpool bug posted to list.
28552
28553 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
28554
28555         * image.h, image.c: added support to load an assembly from a byte array.
28556         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
28557         assembly bundle support.
28558
28559 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
28560
28561         * threadpool.c (mono_thread_pool_add): keep a reference to the
28562         AsyncResult to prevent GC
28563
28564 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
28565
28566         * class.c: leak fix.
28567
28568 2003-06-25  Dick Porter  <dick@ximian.com>
28569
28570         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
28571         for the async object, the WaitHandle object will close the handle.
28572         Fixes bug 45321.
28573
28574 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
28575
28576         * class.c: in mono_array_class_get (), lookup from the hash with the
28577         same type we insert: this works around a bug in
28578         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
28579         lluis. The real fix will have to wait for after the release.
28580
28581 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
28582
28583         * icall.c: fix memory leak when getting type members.
28584
28585 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
28586
28587         * reflection.c: added more pubtoken special cases.
28588
28589 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
28590
28591         * class.c: handle field offset correctly when class size
28592         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
28593
28594 2003-06-20  Martin Baulig  <martin@ximian.com>
28595
28596         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
28597         *image' field.
28598
28599 2003-06-20  Martin Baulig  <martin@ximian.com>
28600
28601         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
28602
28603 2003-06-20  Martin Baulig  <martin@ximian.com>
28604
28605         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
28606         just distinguish between variables in registers and variables at
28607         an offset relative to a register.
28608
28609 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28610
28611         * icall.c: #ifdef out latest changes until mcs is fixed.
28612
28613 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
28614
28615         * icall.c: return members in metadata order.
28616
28617 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
28618
28619         * icall.c: avoid infinite loop in GetTimeZoneData.
28620
28621 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
28622
28623         * icall.c: added Marshal.Prelink/All icalls.
28624
28625 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
28626
28627         * object.c, object.h: fix warnings and do some overflow checking
28628         when creating arrays.
28629
28630 2003-06-17  Dick Porter  <dick@ximian.com>
28631
28632         * file-io.h:
28633         * file-io.c: File attributes need to be tweaked slightly when
28634         passed from the managed to the w32 world.
28635
28636 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
28637         * profiler.h profiler-private.h profiler.c: Rework last patch
28638         based on suggestion by Paolo.
28639         
28640 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
28641
28642         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
28643         instruction level coverage data collection.
28644         * profiler.h profiler.c (: Added new callback function which can be
28645         used by the profiler to limit which functions should have coverage
28646         instrumentation.
28647         * profiler.c (mono_profiler_load): Call g_module_build_path to
28648         generate the file name of the profiler library.
28649
28650 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
28651
28652         * profiler.c, profiler.h, profiler-private.h: added basic block 
28653         coverage profiling API.
28654
28655 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
28656
28657         * reflection.c (mono_reflection_create_runtime_class): Add support
28658         for events in dynamically generated code.
28659
28660         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
28661         not allocated.
28662
28663 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
28664
28665         * icall.c: when getting timezone info, return reasonable values if we
28666         can't get the actual data.
28667
28668 2003-06-14  Dick Porter  <dick@ximian.com>
28669
28670         * threads.c (start_wrapper): Remove the reference to the thread
28671         object in the TLS data, so the thread object can be finalized.
28672         This won't be reached if the thread threw an uncaught exception,
28673         so those thread handles will stay referenced :-( (This is due to
28674         missing support for scanning thread-specific data in the Boehm GC
28675         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
28676
28677 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
28678
28679         * reflection.c: ensure streams and tables are first allocated with
28680         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
28681
28682 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
28683
28684         * icall.c: fixed GetElementType for byrefs (bug# 44792).
28685
28686 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
28687
28688         * reflection.c (mono_reflection_create_runtime_class): Add support for
28689         properties to dynamically created classes.
28690         * reflection.c: Fix a few places where non-MonoObjects were inserted
28691         into the tokens hashtable.
28692
28693 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
28694
28695         * object.c: some support to handle out of memory exceptions.
28696
28697 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
28698
28699         * marshal.c (mono_marshal_get_native_wrapper): support reference
28700         return types
28701
28702 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
28703
28704         * object.h, object.c: more portability stuff from Bernie Solomon.
28705         Unexport mono_object_allocate(). Added mono_object_unbox ().
28706         Set exitcode when an unhandled exception is thrown.
28707
28708 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
28709
28710         * marshal.c (mono_marshal_get_native_wrapper): use custom
28711         marshaler for return types.
28712
28713 2003-06-10  Dick Porter  <dick@ximian.com>
28714
28715         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
28716         ip_mreq is available
28717
28718 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
28719
28720         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
28721         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
28722         by Bernie Solomon <bernard@ugsolutions.com>.
28723
28724 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
28725
28726         * gc.c (mono_gc_init): Avoid error message on shutdown when
28727         GC_DONT_GC=1 is used.
28728
28729         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
28730         New icall to return the GUID of a module.
28731
28732 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
28733
28734         * class.c: ensure instance size always includes the parent's size
28735         even whem class size is set explicitly (fixes bug#44294).
28736
28737 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
28738
28739         * profiler.h, profiler.c: made the simple profiler thread-safe,
28740         get more accurate timing info. Allow the loading of an
28741         externally-developed profiler module.
28742
28743 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
28744
28745         * marshal.c (mono_marshal_get_native_wrapper): improved
28746         class/byref arguments.
28747         (mono_marshal_get_native_wrapper): better string marshaling support.
28748
28749 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
28750
28751         * class.c: ensure .pack and .size are handled correctly and
28752         simplified layout of static fields.
28753
28754 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
28755
28756         * appdomain.c
28757         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
28758
28759         * loader.c (mono_lookup_pinvoke_call): look for modules in the
28760         current directory (fix bug 44008)
28761
28762 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
28763
28764         * marshal.c (mono_marshal_get_native_wrapper): started support for
28765         custom marshalers.
28766         (mono_delegate_to_ftnptr): consider marshalling specifications
28767
28768 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
28769
28770         * reflection.c, reflection.h: emit custom marshal info.
28771
28772 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28773
28774         * object.c: free the GError.
28775         * icall.c: added CloseEvent_internal.
28776         * threads.[ch]:
28777         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
28778         call.
28779
28780 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
28781
28782         * loader.c (mono_method_get_signature): Add support for dynamic
28783         assemblies.
28784
28785 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
28786
28787         * reflection.c: fixed bug #43905.
28788
28789 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
28790
28791         * class.c, domain.c, icall.c, metadata.h, object.h: support for
28792         handling TypedReference and ArgIterator.
28793         * loader.c, loader.h: added function to get signature at call site.
28794
28795 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
28796
28797         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
28798         data readonly. Buglets and warning fixes. Some MethodSpec support.
28799
28800 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
28801
28802         * class.h, class.c, object.c: remove relative numbering support.
28803
28804 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
28805
28806         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
28807         free the string, until we get a chance to fix Gtk#
28808
28809 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28810
28811         * marshal.c: revert last patch.
28812
28813 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
28814
28815         * icall.c: updates for new mono_class_vtable() not calling
28816         the type constructor anymore.
28817
28818 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
28819
28820         * object.h, object.c: separate vtable creation from type
28821         initialization. Make running the .cctor thread safe.
28822
28823 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
28824
28825         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
28826
28827 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
28828
28829         * loader.c (mono_get_method): consider calling convention
28830
28831 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
28832
28833         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
28834         to return the invisible global type for a module.
28835
28836         * reflection.c (mono_image_build_metadata): Emit global fields too.
28837
28838 2003-05-20  Peter Williams  <peterw@ximian.com>
28839
28840         * loader.c (mono_lookup_internal_call): Add a few newlines.
28841
28842 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
28843
28844         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
28845         literal strings.
28846
28847         * appdomain.c (set_domain_search_path): Recalculate search path when
28848         AppDomainSetup.PrivateBinPath changes.
28849
28850         * object.c (mono_class_compute_gc_descriptor): It turns out some
28851         parts of the class libs (like System.Thread) holds pointers to
28852         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
28853         to treat native int a pointer type here.
28854         
28855 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
28856
28857         * appdomain.h, domain.c: add hashtable for jump target resolution.
28858
28859 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
28860
28861         * reflection.h reflection.c icall.c: Added new icalls 
28862         GetManifestResourceInfoInternal, GetModulesInternal and support
28863         infrastructure.
28864
28865 2003-05-16  Dick Porter  <dick@ximian.com>
28866
28867         * icall.c:
28868         * file-io.h:
28869         * file-io.c: Implement System.IO.MonoIO::GetTempPath
28870
28871 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
28872
28873         * object.c: mono_store_remote_field: little fix to previous patch.
28874
28875 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
28876
28877         * class.c: add constructors to array classes.
28878         * icall.c: special case array construction for InternalInvoke (),
28879
28880 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
28881
28882         * class.h class.c reflection.c object.c: Added support for field
28883         defaults in dynamically generated classes.
28884
28885 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
28886
28887         * reflection.c: properly encode charset for ddlimport.
28888
28889 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
28890
28891         * threads.c: allow compiling without GC.
28892
28893 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
28894
28895         * appdomain.h, object.c, object.h, threads.c, threads.h: added
28896         handling of thread static data.
28897
28898 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
28899
28900         * reflection.h, reflection.c: added mono_custom_attrs_free ().
28901
28902 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
28903
28904         * class.c (mono_array_class_get): always set the serializable flags
28905         (mono_array_class_get): always set the SEALED attribute for array types
28906
28907 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
28908
28909         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
28910         attributes (fix for bug 42021).
28911
28912 2003-05-12  Dick Porter  <dick@ximian.com>
28913
28914         * gc.c: Don't run finalizers when the finalizer thread is
28915         finishing up, because the default domain has already been
28916         destroyed.
28917
28918 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
28919
28920         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
28921         value is null, we should throw an exception.   This is slightly
28922         different than the other conventions used for the constructor.
28923
28924 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28925
28926         * socket-io.c: fixed windows build.
28927
28928 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28929
28930         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
28931
28932 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
28933
28934         * object.c (mono_string_new_wrapper): Compatibility fix for MS
28935         compilers.
28936
28937 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
28938
28939         * class.c (mono_class_layout_fields): Add experimental GC aware
28940         auto layout facility. Requires class library changes to work correctly.
28941
28942         (mono_class_setup_vtable): Avoid overriding explicit interface
28943         method implementations. Fixes iface3.exe test.
28944
28945         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
28946         object reference.
28947         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
28948         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
28949
28950         * metadata.h: Add new type classification macro which determines
28951         whenever the type holds an object reference.
28952
28953 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
28954
28955         * marshal.c (mono_marshal_get_native_wrapper): cleanups
28956
28957 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
28958
28959         * gc.c (finalizer_thread): Work around a GC bug.
28960
28961 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
28962
28963         * marshal.c (emit_struct_conv): allow unions
28964
28965         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
28966
28967 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
28968
28969         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
28970
28971 2003-05-06  Martin Baulig  <martin@ximian.com>
28972
28973         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
28974
28975 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28976
28977         * socket-io.c:
28978         (Select_internal): allow NULLs, don't create arrays if not needed.
28979         Coupled with Socket.cs changes.
28980
28981         * threadpool.c:
28982         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
28983         register a finalizer for it that will close the semaphore handle. This
28984         fixes the leak and make Lupus' test run with > 4080 loops.
28985
28986 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
28987
28988         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
28989         Jerome Laban (bug #42287)
28990
28991 2003-05-02  Martin Baulig  <martin@ximian.com>
28992
28993         * debug-mono-symfile.h
28994         (MonoSymbolFile): Moved declaration into mono-debug.h.
28995         (MonoDebugMethodJitInfo): Likewise.
28996         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
28997         argument.
28998         (_mono_debug_address_from_il_offset): Take a
28999         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
29000
29001         * mono-debug.h
29002         (MonoDebugDomainData): New struct.
29003         (mono_debug_get_domain_data): New function.
29004         (mono_debug_add_method): Take an additional `MonoDomain *'
29005         argument.
29006         (mono_debug_source_location_from_address): Likewise.
29007         (mono_debug_il_offset_from_address): Likewise.
29008         (mono_debug_address_from_il_offset): Likewise.
29009
29010 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
29011
29012         * reflection.c: one more check for null type in custom attrs.
29013
29014 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29015
29016         * reflection.c: avoid warning (comparison is always false due to limited
29017         range of data type).
29018
29019 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29020
29021         * icall.c: throw an exception in Type.GetField if the argument 'name'
29022         is NULL.
29023
29024 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
29025
29026         * reflection.c: fixed handling of enums in named arguments to custom
29027         attributes (bug #42123).
29028
29029 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
29030
29031         * reflection.c: use the right array element type and handle
29032         a null for a Type argument, too.
29033
29034 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
29035
29036         * reflection.c: handle arrays as arguments to custom attributes.
29037
29038 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
29039
29040         * reflection.c: handle a string value in a custom attr
29041         ctor that takes an object.
29042
29043 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
29044
29045         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
29046         (fix bug #42063)
29047
29048 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
29049
29050         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
29051
29052 2003-04-27  Martin Baulig  <martin@ximian.com>
29053
29054         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
29055         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
29056         MONO_DEBUGGER_EVENT_BREAKPOINT.
29057         (mono_breakpoint_trampoline_code): Removed.
29058         (mono_debugger_event_handler): The last argument is now a
29059         `guint32'.
29060         (mono_debugger_insert_breakpoint_full): Removed the
29061         `use_trampoline' argument.
29062         (mono_debugger_method_has_breakpoint): Likewise.
29063         (mono_debugger_trampoline_breakpoint_callback): Renamed to
29064         mono_debugger_breakpoint_callback(); take the method and
29065         breakpoint number as arguments.
29066
29067 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
29068
29069         * metadata.c: fix off by one when loading parameters attributes.
29070
29071 2003-04-24  Martin Baulig  <martin@ximian.com>
29072
29073         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
29074
29075 2003-04-24  Martin Baulig  <martin@ximian.com>
29076
29077         * mono-debug-debugger.c: Moved all code which interacts with the
29078         Mono Debugger here.
29079
29080         * debug-mono-symfile.c: This code now just deals with the symbol
29081         file itself, the debugger code is now in mono-debug-debugger.c.
29082
29083 2003-04-23  Martin Baulig  <martin@ximian.com>
29084
29085         * mono-debug.c (mono_debug_source_location_from_il_offset):
29086         New method; like mono_debug_source_location_from_address(), but
29087         takes an IL offset instead of a machine address.
29088
29089 2003-04-23  Martin Baulig  <martin@ximian.com>
29090
29091         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
29092         `line' field; this is now computed by the debugger.
29093
29094 2003-04-23  Martin Baulig  <martin@ximian.com>
29095
29096         * mono-debug.[ch]: New files.  This is the new debugging interface.
29097
29098         * mono-debug-debugger.[ch]: New files.  Moved all code which
29099         interacts with the Mono Debugger here.
29100
29101 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
29102
29103         * domain.c (mono_init): initialize mono_defaults.monitor_class
29104
29105 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
29106
29107         * reflection.c (method_encode_code): Add a spicy exception to help
29108         future compiler authors.
29109
29110 2003-04-21  Martin Baulig  <martin@ximian.com>
29111
29112         * icall.c
29113         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
29114         Make this work with relative pathnames; g_filename_to_uri() needs
29115         an absolute filename.
29116
29117 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
29118
29119         * icall.c: Track name changes in Object and ValueType.
29120
29121 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
29122
29123         * metadata.c (mono_type_stack_size): size should be a multiple of
29124         sizeof (gpointer)
29125
29126 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29127
29128         * gc.c:
29129         (internal_domain_finalize): moved into mono_domain_finalize. No need
29130         to create another thread because the finalizers will be run in the
29131         finalizer thread.
29132         
29133         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
29134         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
29135         to be run (MS does this too).
29136
29137 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
29138
29139         * object.c (mono_class_compute_gc_descriptor): Update comment.
29140
29141         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
29142
29143         * image.h: Add synchronized wrapper cache.
29144
29145         * image.c (do_mono_image_open): Initialize cache.
29146
29147         * reflection.c (create_dynamic_mono_image): Initialize cache.
29148
29149 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29150
29151         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
29152         ves_icall_System_Buffer_ByteLengthInternal.
29153
29154 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
29155
29156         * reflection.c: setup klass->nested_in earlier. Allow
29157         a dash in the assembly name.
29158
29159 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
29160
29161         * metadata.c (mono_type_to_unmanaged): dont access
29162         type->data.klass for MONO_TYPE_OBJECT
29163         (mono_type_to_unmanaged): consider System.Delegate class
29164
29165 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
29166
29167         * class.c: just setup supertypes in the proper place instead of
29168         initializing the full element class for arrays.
29169
29170 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
29171
29172         * class.c: ensure the element class of arrays is initialized.
29173         Setup the supertype info for array classes, too.
29174
29175 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
29176
29177         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
29178
29179 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29180
29181         * Makefile.am: re-added -m option when running cygpath. This way,
29182         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
29183         separator.
29184         * mono-config.c: same codepath for locating mono config file for WIN32
29185         and the rest.
29186         * assembly.c: if mono_assembly_setrootdir is called, don't override
29187         the value set.
29188
29189 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29190
29191         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
29192         MONO_ASSEMBLIES variable.
29193
29194 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
29195
29196         * icall.c: added Assembly::GetNamespaces() icall.
29197
29198 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29199
29200         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
29201
29202 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
29203
29204         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
29205         * object.c: fixed bug in the construction of vtable for proxies
29206
29207 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
29208
29209         * object.c (mono_array_new): Mark mono_array_new as an icall.
29210
29211 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29212
29213         * class.c: fixed test for public method when overriding interfaces.
29214         Closes bug #40970.
29215
29216 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
29217
29218         * appdomain.h, domain.c: added mono_domain_foreach() to
29219         be able to access the currently loaded appdomains.
29220         * object.c: make string interning work across sppdomains.
29221         Mark some functions for use as icalls.
29222
29223 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
29224
29225         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
29226
29227         * reflection.h reflection.c: Allocate long living data using 
29228         GC_MALLOC_ATOMIC so the collector does not need to scan it.
29229
29230         * reflection.c: Double the allocation size in streams instead of
29231         increasing it, to prevent unneccesary copying on large assemblies.
29232         
29233         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
29234         creation if the assembly does not have the Run flag set.
29235
29236 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
29237
29238         * class.h: avoid the C++ keywords in header files (Jerome Laban
29239         spotted and fixed this).
29240
29241 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29242
29243         * object.c:
29244         (mono_unhandled_exception): fill in the arguments for the
29245         UnhandledException event. Only trigger that event for the default
29246         domain (as MS does).
29247
29248 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
29249
29250         * object.c: Improve typed allocation stuff based on suggestions from
29251         Paolo. Also turn it on if the GC library supports it.
29252
29253 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
29254
29255         * object.c object.h class.h: Added experimental typed allocation
29256         facility using the interfaces in gc_gcj.h.
29257
29258         * os/gc_wrapper.h: Added new include files.
29259         
29260 2003-04-03  Martin Baulig  <martin@ximian.com>
29261
29262         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
29263         which is not yet enabled by default.
29264
29265         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
29266         functions.
29267         (mono_gc_lock, mono_gc_unlock): New static functions.
29268
29269         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
29270         functions; stop/start the world for the garbage collector.  This
29271         is using the windows API; we need to complete the SuspendThread()/
29272         ResumeThread() implementation in the io-layer to make this work on Unix.
29273         (mono_gc_push_all_stacks): New public function; tells the garbage
29274         collector about the stack pointers from all managed threads.
29275
29276 2003-04-03  Martin Baulig  <martin@ximian.com>
29277
29278         * object.h (MonoThread): Added `gpointer stack_ptr'.
29279
29280         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
29281
29282 2003-04-03  Martin Baulig  <martin@ximian.com>
29283
29284         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
29285
29286 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
29287
29288         * reflection.c (typebuilder_setup_fields): Initialize field.first and
29289         field.last.
29290
29291 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
29292
29293         * loader.c (mono_lookup_internal_call): Report the corlib that is
29294         out of sync.
29295
29296 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
29297
29298         * icall.c (ves_icall_type_GetTypeCode): fixed check for
29299         System.DBNull (it's class not valuetype).
29300
29301 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
29302
29303         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
29304         if the array method was already assigned a token (fixes bug#40646).
29305
29306 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
29307
29308         * reflection.c (mono_reflection_get_type): Attempt type resolve even
29309         if no assembly is given.
29310
29311 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
29312
29313         * metadata.h: Added the new tables.
29314
29315         * row-indexes.h: Added definitions for new tables.
29316
29317         * metadata.c: Add schemas for new tables, and add support for
29318         computing the sizes of them.
29319
29320         * class.c: Update for handling the new type cases.
29321
29322 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
29323
29324         * metadata.h (MONO_TYPE_IS_VOID): new macro
29325
29326 2003-03-31  Martin Baulig  <martin@ximian.com>
29327
29328         * threads.h (MonoThreadCallbacks): Added `thread_created'.
29329
29330         * threads.c (mono_thread_new_init): Call `thread_created' in the
29331         mono_thread_callbacks.
29332
29333 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
29334
29335         * loader.h: added marshalbyrefobject_class to mono_defaults
29336         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
29337         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
29338           generation of output parameters.
29339           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
29340         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
29341           contextbound and the target object belongs to the context of the caller.
29342         * object.h: added context and unwrapped_server variables in MonoRealProxy.
29343         * object.c: Implemented support for interfaces and abstract classes
29344           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
29345           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
29346
29347 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
29348
29349         * class.h class.c (mono_class_is_subclass_of): New function.
29350         
29351         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
29352         routines for most common case (calls from ArrayList::ToArray).
29353
29354         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
29355         routine so programs which call Environment::Exit() can be profiled.
29356
29357         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
29358         Added MONO_ARCH_SAVE_REGS.
29359
29360         * icall.c (ves_icall_type_is_subtype_of): Use new function.
29361
29362 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
29363
29364         * blob.h: Add a couple of new MonoType types definitions.
29365
29366         * tabledefs.h: Add a couple of new call convs.
29367
29368 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
29369
29370         * reflection.h (MonoReflectionDynamicAssembly): track changes in
29371         the layout of the class.
29372
29373         * reflection.c (alloc_table): double the size on overflow to avoid
29374         unnecessary copying.
29375
29376         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
29377         avoid filling out metadata tables and blobs. Also set mb->ilgen to
29378         null so it can be garbage collected.
29379         
29380 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
29381
29382         * reflection.c (mono_reflection_get_type): Return the resolved type
29383         only if it is in the assembly we searched.
29384
29385         * reflection.c (ensure_runtime_vtable): Initialize method slots.
29386
29387         * class.c (mono_class_setup_vtable): Set the slot of the overriding
29388         method.
29389
29390 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29391
29392         * appdomain.c:
29393         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
29394         the right one is 'file:///blah', but MS allows it.
29395         * assembly.c:
29396         (mono_assembly_open): allow 'file://blah'
29397
29398         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
29399
29400 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
29401
29402         * socket-io.c: fixes bug #40310.
29403
29404 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
29405
29406         * reflection.c (mono_reflection_parse_type): handle deeply nested
29407         types correctly.
29408
29409         * reflection.c (mono_image_create_token): Use unique token values
29410         since they will be put into a hash table.
29411
29412         * class.c (mono_class_setup_vtable): If a method occurs in more than
29413         one place in the vtable, and it gets overriden, then change the
29414         other occurances too.
29415
29416         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
29417         object as return type.
29418
29419 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29420
29421         * icall.c: Deleted "ToString" implementation for double and float
29422         because they are full implemented in managed code.
29423
29424 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29425
29426         * reflection.c, reflection.h: implemented and exported functions
29427         to retrieve info about custom attributes.
29428
29429 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29430
29431         * appdomain.c: moved Uri handling to assembly.c
29432         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
29433         work when using a file Uri in *nix and windows.
29434
29435         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
29436         GetReferencedAssemblies.
29437
29438 2003-03-18  Dick Porter  <dick@ximian.com>
29439
29440         * icall.c: Rename a couple of internal calls
29441
29442         * threads.c: Set the thread state to Stopped when a thread exits.
29443         Fixes bug 39377.
29444
29445 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
29446
29447         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
29448         New icall.
29449
29450         * object.c (mono_class_vtable): fix warning.
29451
29452 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
29453
29454         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
29455
29456         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
29457         memory.
29458         (method_encode_clauses): Create exception info structures in the right
29459         order.
29460         (mono_reflection_setup_internal_class): Initialize supertypes field.
29461
29462         * class.c object.c: Handle interfaces which implement other interfaces 
29463         correctly.
29464
29465         * class.h class.c: Move the supertypes array initialization code into 
29466         a separate function so it can be used for dynamic types too. Also call
29467         it earlier, in mono_class_init(), since it can be used before the
29468         type is initialized.
29469
29470 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29471
29472         * Makefile.am:
29473         * assembly.c:
29474         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
29475
29476         * appdomain.c:
29477         * appdomain.h:
29478         * marshal.c:
29479         * object.c: remove warnings.
29480
29481 2003-03-13  Martin Baulig  <martin@ximian.com>
29482
29483         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
29484         (MonoDebugLexicalBlockEntry): New types.
29485
29486         * debug-mono-symfile.c
29487         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
29488
29489 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29490
29491         * process.c: ret can be any non-zero value accroding to MS doc.
29492
29493 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
29494
29495         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
29496         fixing a warning for a miss-used prototype, would have cause
29497         random memory corruption.
29498
29499 2003-03-07  Martin Baulig  <martin@ximian.com>
29500
29501         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
29502         getting really annoying ....
29503
29504 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
29505
29506         * reflection.c (fixup_method): added support for array methods.
29507
29508 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
29509
29510         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
29511         (pointed out by Michael Adams).
29512
29513 2003-03-04  Dick Porter  <dick@ximian.com>
29514
29515         * icall.c: Temporarily reverted the Double and Single ToString()
29516         change, because it broke nunit.
29517
29518 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
29519
29520         * object.h, threads.h: make include files compatible with C++
29521         (patch by Jerome Laban <jlaban@wanadoo.fr>).
29522
29523 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29524
29525         * icall.c: Erased ToString helper functions for Double and Single.
29526         Now, that implementations ar all in managed code (Double and Single
29527         Formatters).
29528
29529 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
29530
29531         * appdomain.c: Added method for initializing the default context of
29532         a domain. Added internal call for getting the default context.
29533         * appdomain.h: Added context variable in MonoDomain struct.
29534         * domain.c: mono_domain_set also sets the default context of the domain
29535         * icall.c: Mapped internal method InternalGetDefaultContext.
29536         * object.c: mono_object_get_virtual_method returns always a remoting
29537         wrapper if the object is a transparent proxy.
29538         mono_runtime_invoke_array: when creating an object by calling the
29539         constructor, if the created object is a proxy, then the constructor should
29540         be called using the a remoting wrapper.
29541
29542 2003-03-03  Dick Porter  <dick@ximian.com>
29543
29544         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
29545         variable so it compiles on solaris.  Problem spotted by
29546         Christopher Taylor <ct@cs.clemson.edu>
29547
29548 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29549
29550         * appdomain.c:
29551         (get_info_from_assembly_name): don't leak value.
29552
29553         * icall.c:
29554         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
29555         result.
29556
29557 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
29558
29559         * assembly.c: export mono_image_load_references ().
29560         * class.c: handle function pointers. mono_class_from_name() now
29561         supports nested type names directly.
29562
29563 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
29564
29565         * reflection.h reflection.c: Encode already created dynamic methods 
29566         and fields correctly as a DEF instead of a REF.
29567
29568         * reflection.c: Get rid of the force_ref argument to 
29569         mono_image_typedef_or_ref since it was wrong in the first place.
29570
29571         * string-icalls.c: add error checking to string constructors according
29572         to the MSDN docs.
29573
29574         * reflection.c: Emit types in the order their TypeBuilders were 
29575         created. Previously, a new table index was assigned to each type before
29576         the tables were emitted. This was wrong because the signature blob
29577         might already refer to a type by its original table index.
29578
29579 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
29580
29581         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
29582         change.
29583         
29584 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29585
29586         * Makefile.am: make assemblies dir have \ instead of / on windows.
29587
29588 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
29589
29590         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
29591         iterate over the NESTEDCLASS table using a linear search since the
29592         table is not guaranteed to be sorted by the secondary key.
29593
29594         * class.c (mono_class_create_from_typedef): fixed up call to
29595         mono_metadata_nesting_typedef.
29596         
29597 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
29598
29599         * marshal.c (mono_string_to_byvalstr): clear the memory as
29600         suggested by Jerome Laban <jlaban@wanadoo.fr>
29601
29602 2003-02-26  Dick Porter  <dick@ximian.com>
29603
29604         * process.c: Cope with padding in .rsrc blocks
29605
29606 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
29607
29608         * metadata.h: reverted the filter_len change, it breaks reflection
29609         
29610 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
29611
29612         * metadata.h: added a new field to store the filter_len
29613         
29614
29615 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
29616
29617         * reflection.c: handle custom attributes for types and members
29618         created with Reflection.Emit (bug#38422).
29619
29620 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
29621
29622         * reflection.c: define RTSpecialName automatically for constructors for
29623         compatibility with MS.NET.
29624
29625         * reflection.c (mono_reflection_create_runtime_class): initialize
29626         nested_in field of dynamically created classes.
29627
29628 2003-02-22  Martin Baulig  <martin@ximian.com>
29629
29630         * debug-mono-symfile.h: Incremented version number.
29631
29632 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
29633
29634         * object.h icall.c process.c: fix warnings.
29635
29636 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
29637
29638         * appdomain.h appdomain.c:
29639         (mono_domain_try_type_resolve): split the 
29640         name_or_tb argument into a name and a tb argument.
29641         (mono_domain_has_type_resolve): new function to check whenever the
29642         application has registered a TypeResolve event handler.
29643         
29644         * icall.c reflection.h reflection.c: move the type resolve logic into
29645         mono_reflection_get_type () so it will be invoked when 
29646         Assembly::GetType () is called.
29647
29648         * reflection.c:
29649         (mono_reflection_get_type): renamed to get_type_internal.
29650         (mono_reflection_get_type): fixed type name generation so it works 
29651         for nested types too.
29652         (mono_reflection_get_type): call has_type_resolve () to avoid the 
29653         costly type name generation if there is no resolve event handler.
29654
29655 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29656
29657         * class.c, image.c: load exported types from file references.
29658
29659 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
29660
29661         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
29662           used to cache the managed methods used to create proxies and make 
29663           remote invocation of methods.
29664         * class.h: Added in MonoVTable a flag to indicate that a class needs 
29665           to be remotely created.
29666         * object.c: Modified the method mono_class_vtable(). It now initializes 
29667           the remote flag of the vtable. Modified mono_object_new_specific(), 
29668           so now it checks the remote flag.
29669         * icall.c: Added a couple of internal methods, one for enabling instance 
29670           creation interception for a type, and one for creating objects bypassing
29671           the remote check.
29672
29673 2003-02-18  Martin Baulig  <martin@ximian.com>
29674
29675         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
29676         New interncall to get a method's metadata token.
29677
29678         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
29679         New interncall for the debugger.
29680
29681 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
29682
29683         * class.c (mono_class_setup_vtable): allocate supertype array
29684
29685 2003-02-18  Martin Baulig  <martin@ximian.com>
29686
29687         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
29688
29689 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29690
29691         * reflection.c:
29692         (assembly_name_to_aname): jump over unknown properties (i've found
29693         something like: 'type, assembly, version=xxx, custom=null, public...',
29694         so now will ignore custom=null and still get the rest of the values).
29695
29696 2003-02-17  Dick Porter  <dick@ximian.com>
29697
29698         * threads.c: Have Thread.Start() wait for a semaphore to signal
29699         that the thread has set up all its local data.  This fixes bug
29700         34323, where Abort() raced the new thread's TLS data.
29701
29702         Also removes the handle_store() call from start_wrapper, because
29703         threads are now always created suspended and there is no longer a
29704         race between the parent and child threads to store the info.
29705
29706 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
29707
29708         * image.c: explain the #- heap issue in a message, hopefully
29709         avoiding FAQs on mono-list.
29710
29711 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29712
29713         * icall.c:
29714         (GetEntryAssembly): if the domain has not invoked
29715         AppDomain.ExecuteAssembly yet, return the assembly of the default
29716         AppDomain.
29717
29718 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
29719
29720         * class.c (mono_ldtoken): make it work in dynamic assemblies.
29721
29722 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
29723
29724         * metadata.c, reflection.c: simple speedup to type hash
29725         and equals code.
29726
29727 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
29728
29729         * image.c, image.h, class.c, assembly.c: move module loading
29730         to MonoImage. When loading metadata, consider alignemnet from
29731         the start of metadata, not from the metadata address in memory.
29732
29733 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
29734
29735         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
29736         AssemblyBuilder objects. Factored out custom attribute creation into
29737         a separate function.
29738         (create_custom_attr): new function to create custom attributes.
29739
29740 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
29741
29742         * Makefile.am: Got tired of typing the full pathname to pedump.
29743         Until there is another option, am installing this.
29744
29745 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
29746
29747         * class.c (class_compute_field_layout): always set field->parent 
29748         (mono_ldtoken): use mono_defaults.fieldhandle_class;
29749
29750 2003-02-11  Dick Porter  <dick@ximian.com>
29751
29752         * threads-types.h:
29753         * monitor.c: Rewrote Monitor, making lock much faster and
29754         Pulse/Wait work as specified.  Also uses much fewer handles, and only
29755         creates them as needed.
29756
29757         * exception.c: Added SynchronizationLockException
29758
29759         * threads.c: Deleted old Monitor implementation.  The new one is
29760         in a new file.
29761
29762 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
29763
29764         * class.c: handled TypedReference type code. Set the correct size for
29765         class data. Setup interface_offsets for interface classes, too.
29766
29767 2003-02-09  Martin Baulig  <martin@ximian.com>
29768
29769         * debug-mono-symfile.h: Reflect latest symbol writer changes.
29770
29771 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
29772
29773         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
29774         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
29775         * object.c: fixed mono_object_get_virtual_method () for interfaces.
29776         * verify.c: check for code that runs after the end of the method.
29777
29778 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
29779
29780         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
29781         "System.Math::Round2".
29782         * sysmath.h: Added Floor, Round and Round2 definitions.
29783         * sysmath.c: Modified certain functions that were not 100% compliant
29784         with MS.NET (math precision) and added the implementation of Floor,
29785         Round and Round2.
29786
29787 2003-02-07  Martin Baulig  <martin@ximian.com>
29788
29789         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
29790
29791 2003-02-07  Martin Baulig  <martin@ximian.com>
29792
29793         * debug-mono-symfile.c: Reflected latest symwriter changes.
29794         (mono_debug_create_mono_symbol_file): Removed.
29795         (mono_debug_open_mono_symbol_file): Take an argument which
29796         specifies whether to create a dynamic symbol file.
29797
29798 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
29799
29800         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
29801
29802 2003-02-05  Martin Baulig  <martin@ximian.com>
29803
29804         * reflection.c (mono_image_build_metadata): Make this public,
29805         protect it against being called multiple times, don't create
29806         resources and don't build the compressed metadata here.
29807         (mono_image_create_pefile): Do this here.
29808
29809         * icall.c
29810         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
29811
29812 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29813
29814         * socket-io.c: fixed bug #36322.
29815
29816 2003-02-06  Piers Haken <piersh@friskit.com>
29817
29818         * appdomain.[ch]:
29819         * class.h:
29820         * debug-mono-symfile.c:
29821         * icall.c:
29822         * loader.c:
29823         * mono-config.c:
29824         * monosn.c:
29825         * reflection.c:
29826         * socket-io.c: warning cleanups
29827
29828 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
29829
29830         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
29831         function. works like remoting invoke, but does a check for the Proxy first.
29832
29833 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
29834
29835         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
29836
29837 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
29838
29839         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
29840         array of pointers.
29841         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
29842         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
29843
29844         * object.c (mono_store_remote_field_new): used by the new jit
29845         instead of mono_store_remote_field
29846         (mono_load_remote_field_new): used by the new jit
29847         instead of mono_load_remote_field
29848
29849 2003-02-05  Patrik Torstensson
29850
29851         * appdomain.c: changed unload to take the domain id instead
29852         of domain
29853         
29854         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
29855
29856
29857 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29858
29859         * appdomain.c: don't look for assemblies in ApplicationBase if
29860         PrivateBinPathProbe is set.
29861
29862 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29863
29864         * object.c: make the first argument in main_args contain the absolute
29865         path to the assembly. Fixes bug #37511.
29866
29867 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29868
29869         * icall.c: get correct UTC offset for countries not using daylight
29870         time saving. Fixes bug #30030.
29871
29872 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29873
29874         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
29875         and 1 are the family).
29876
29877 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
29878
29879         * icall.c (ves_icall_InternalExecute): removed wrong assertion
29880
29881         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
29882
29883 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
29884
29885         * reflection.c: added support for SignatureHelper tokens, which is
29886         needed by the Calli opcode.
29887
29888         * reflection.h: track changes to SignatureHelper class.
29889
29890         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
29891
29892 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29893
29894         * appdomain.c: fixed loading assemblies from PrivateBinPath.
29895
29896 2003-02-03  Patrik Torstensson
29897         * appdomain.[c|h], domain.c : 
29898          - Added support for getting a domain via domain id
29899          - Support for setting and getting domain from System.AppDomain 
29900            (used in cross appdomain channel)
29901          - Added support for get/set for a MonoAppContext on a thread 
29902            (Context class in System.Runtime.Remoting.Contexts),
29903          - Removed hack in Get/SetData and ExecuteAssembly.
29904         
29905         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
29906         the managed world to get control when a proxy is created.
29907
29908         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
29909         
29910 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
29911
29912         * icall.c
29913         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
29914         Populate the codebase field as well.
29915
29916 2003-02-02  Martin Baulig  <martin@ximian.com>
29917
29918         * debug-mono-symfile.c
29919         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
29920         (mono_debug_symfile_add_method): Allow interncalls.
29921
29922 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29923
29924         * icall.c: throw parse exception if strtod fails or the string is empty.
29925
29926 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
29927
29928         * marshal.c: handle object type separately from defined
29929         class types.
29930
29931 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
29932
29933         * marshal.c: handle NATIVE_LPSTR for strings when it's
29934         explicitly specified.
29935
29936 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
29937
29938         * reflection.c, reflection.h, icall.c: setup the reflection
29939         handle cache for ModuleBuilders and AssemblyBuilders.
29940
29941 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
29942
29943         * reflection.c (reflection_methodbuilder_to_mono_method): set
29944         pinvoke flag
29945
29946 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29947
29948         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
29949
29950 2003-01-29  Dick Porter  <dick@ximian.com>
29951
29952         * threads.c: No need for the fake_thread kludge now that Thread
29953         doesn't run a class constructor
29954         
29955 2003-01-29  Dick Porter  <dick@ximian.com>
29956
29957         * threads.c: Use g_direct_hash instead of the rather bogus
29958         g_int_hash
29959
29960 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
29961
29962         * marshal.c (mono_marshal_get_native_wrapper): add check for null
29963         (fix pinvoke12.exe)
29964         (mono_marshal_get_struct_to_ptr): generate valid IL code
29965         (mono_marshal_get_ptr_to_struct): generate valid IL code
29966         (*): correctly set sig->pinvoke, we need to memdup the signature
29967         to do that
29968
29969 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
29970
29971         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
29972         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
29973
29974 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
29975
29976         * profiler.c: provide more callers information.
29977
29978 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
29979
29980         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
29981
29982         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
29983
29984         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
29985
29986 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
29987
29988         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
29989         exception instead of going into an infinite loop on dates which it 
29990         can't yet handle.
29991
29992         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
29993         out-of-range exception if needed.
29994
29995         * class.c (mono_class_setup_vtable): allow a virtual method to provide
29996         an implementation for an interface method and to override an inherited
29997         method at the same time. 
29998         Imagine a scenario when a virtual method is used to override a
29999         virtual abstract method in a parent class, and this same method 
30000         provides an implementation for an method inherited from an interface. 
30001         In this case, the interface resolution code will set im->slot, which 
30002         means that the virtual method override pass will skip this method 
30003         which means a pointer to the abstract method inherited from the parent
30004         will remain in the vtable of this non-abstract class.
30005
30006         * class.c: (mono_class_setup_vtable): continue search for a real 
30007         method if only an abstract method is found.     
30008
30009 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
30010
30011         * reflection.c: add size to encoding for ByValStr and ByValArray
30012         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
30013
30014 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30015
30016         * class.c (mono_class_setup_vtable): pass the override info as an
30017         argument.
30018
30019         * class.c (mono_class_setup_vtable): set the slot of overriding methods
30020         correctly.
30021         
30022         * reflection.c (ensure_runtime_vtable); add support for method 
30023         overrides.
30024         
30025 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30026
30027         * reflection.c (resolution_scope_from_image): Hack to work to work with
30028         dynamic assemblies.
30029
30030         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
30031         added a 'force_ref' argument to force this function to allways return 
30032         a TypeRef. This is needed by mono_image_get_memberref_token ().
30033         
30034 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30035
30036         * reflection.c (mono_image_get_type_info): interfaces really don't have
30037         a parent.
30038
30039         * reflection.c (mono_image_basic_init): fill out missing fields of
30040         image structure.
30041
30042         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
30043         dynamic assemblies. This is required so dynamic assemblies show up in
30044         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
30045         Type::GetType() etc. This is consistent with MS behaviour.
30046
30047         * image.c image.h reflection.c: add newly created classes to the name 
30048         cache so mono_class_get () will find them.      
30049
30050 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
30051
30052         First part of changes to get IKVM.NET running under mono.
30053         
30054         * appdomain.h, appdomain.c: added new function 
30055         mono_domain_try_type_resolve() which will emit TypeResolve events. 
30056         This function will call AppDomain::DoTypeResolve to do the actual work.
30057
30058         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
30059         moved existing code dealing with dynamic tokens to a new function 
30060         called mono_reflection_lookup_dynamic_token (). This function will 
30061         raise TypeResolve events when appropriate. Since reflection.c is not 
30062         part of libmetadata, a new hook function called 
30063         mono_lookup_dynamic_token() is added to class.c which will call this.
30064
30065         * assembly.h assembly.c: make the invoke_load_hook function public,
30066         so it can be called for dynamic assemblies.
30067
30068         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
30069
30070         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
30071         type isn't found.
30072
30073         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
30074         MonoGHashTable, since it contains pointers to objects which the GC 
30075         needs to track.
30076
30077         * assembly.c (search_loaded): remove unused variable.
30078         
30079 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
30080
30081         * object.c: fixed issue exposed by gcc-generated IL programs
30082         that use RVA data for pointers.
30083
30084 2003-01-25  Martin Baulig  <martin@ximian.com>
30085
30086         * threads.c (start_wrapper): Moved the initialization of
30087         `start_func' above the mono_new_thread_init() call to which we
30088         pass it as argument.
30089
30090 2003-01-24  Martin Baulig  <martin@ximian.com>
30091
30092         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
30093         the MonoThread pointer.
30094
30095 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
30096
30097         * icall.c: Rename `PowImpl' to Pow.
30098
30099 2003-01-23  Dick Porter  <dick@ximian.com>
30100
30101         * threads.c (start_wrapper): Create a Thread object if needed, so
30102         the Main() thread can do the class initialisation in a subthread
30103         that has been set up to allow managed code execution.
30104
30105         Pass the thread ID instead of the MonoThread pointer to the thread
30106         start and attach callbacks.  This change is required, because the
30107         jit thread start callback must be called _before_ the Thread
30108         object can be created.
30109         
30110         (mono_thread_init): Removed much object creation code that is no
30111         longer needed.  No managed code is called from here now.
30112
30113         * object.c (mono_runtime_exec_managed_code): Create a subthread
30114         for Main, and call back to the runtime to use it.
30115         Set the exit code when Main exits.
30116
30117         * gc.c: Make sure domain finalisation happens in a subthread.
30118         Re-enable threaded GC, fixing bug 31333 (again).
30119
30120         * environment.c: System.Environment internall calls (so far just
30121         ExitCode is here, the others are still in icall.c)
30122
30123         * appdomain.c (mono_runtime_cleanup): All threads running managed
30124         code should have finished before mono_runtime_cleanup() is
30125         reached, so no need to clean up threads.
30126
30127 2003-01-22  Martin Baulig  <martin@ximian.com>
30128
30129         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
30130         `gpointer func' arguments.      
30131         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
30132         but added `MonoThread *thread' argument.
30133         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
30134
30135         * threads.c (mono_new_thread_init): Added `gpointer func' argument
30136         and pass it to the mono_thread_start_cb callback.
30137         (mono_install_thread_callbacks): New public function to install a
30138         set of callbacks which are set by the debugger.
30139         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
30140
30141 2003-01-22  Martin Baulig  <martin@ximian.com>
30142
30143         * Makefile.am: Install debug-mono-symfile.h.
30144
30145 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
30146
30147         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
30148
30149 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
30150
30151         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
30152         * class.c (mono_ptr_class_get): correctly set access levels of pointers
30153         (mono_array_class_get): correctly set access levels of arrays
30154
30155 2003-01-20      Patrik Torstensson
30156         * image.h (MonoAssemblyName): changed major, minor, build, revision
30157         from signed to unsigned.
30158
30159 2003-01-20  sean kasun <skasun@azstarnet.com>
30160
30161         * reflection.c (load_cattr_value): Now this handles
30162         MONO_TYPE_SZARRAY.  Fixes bug #35629
30163
30164 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
30165
30166         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
30167         integer value
30168
30169 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30170
30171         * decimal.c: fixed bug #26056.
30172
30173 2003-01-17  Martin Baulig  <martin@ximian.com>
30174
30175         * gc.c: Raise an ExecutionEngineException instead of using g_error().
30176
30177 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30178
30179         * exception.[ch]:
30180         (mono_get_exception_type_initialization): new function.
30181
30182         * object.c: throw a TypeInitializationException when an exception is
30183         thrown invoking the class constructor.
30184
30185 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30186
30187         * reflection.c: fixed attribute reading.
30188
30189 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30190
30191         * icall.c:
30192         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
30193         provided, look for the type in the calling assembly and then in
30194         mscorlib; if the assembly name is provided, only try that one.
30195
30196 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
30197
30198         * object.c: register the vtable before there is a chance it's
30199         queried again recursively.
30200
30201 2003-01-13  Duncan Mak  <duncan@ximian.com>
30202
30203         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
30204         gc-internal.h. 
30205         
30206 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
30207
30208         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
30209
30210 2003-01-11  Martin Baulig  <martin@ximian.com>
30211
30212         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
30213         this to 20 for the release.
30214
30215 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
30216
30217         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
30218
30219         * loader.c (mono_method_get_marshal_info): bug fix
30220
30221         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
30222         structures with explicit layout
30223
30224 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
30225
30226         * profiler.c: made the output more readable (and sorted). 
30227         Added caller information for the allocation profiler.
30228
30229 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
30230
30231         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
30232
30233 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30234
30235         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
30236         to get value types.
30237         
30238 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
30239
30240         * object.c, profiler.h, profiler.c, profiler-private.h:
30241         Added object allocation profiler.
30242
30243 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
30244
30245         * reflection.h, reflection.c: handle global methods.
30246         Compress blob entries.
30247
30248 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
30249
30250         * marshal.c: fix compilation.
30251
30252 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
30253
30254         * loader.c (mono_method_get_marshal_info): impl.
30255
30256         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
30257
30258 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30259
30260         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
30261         for reference types.
30262
30263 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
30264
30265         * loader.c: fixed off by one error in loaded parameter names.
30266
30267 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
30268
30269         * marshal.c (mono_marshal_get_icall_wrapper): like
30270         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
30271         instead of a MonoMethod.
30272
30273 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30274
30275         * decimal.c: fixed bug #36537.
30276
30277 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
30278
30279         * marshal.c: throw a missing method exception if a
30280         P/Invoke method is not found.
30281
30282 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
30283
30284         * icall.c: allow a null this for constructors.
30285
30286 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
30287
30288         * icall.c: raise the proper exceptions if the arguments to the
30289         internal Invoke are incorrect.
30290
30291 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
30292
30293         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
30294
30295 2003-01-03  Martin Baulig  <martin@ximian.com>
30296
30297         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
30298
30299 2002-12-31  Martin Baulig  <martin@ximian.com>
30300
30301         * debug-mono-symfile.c: Completely rewrote the type section.
30302         Instead of using individual malloc()ed fields, we use one big
30303         continuous memory area and offsets into this area.
30304         See the comments in the source code for details.
30305
30306 2002-12-30  Martin Baulig  <martin@ximian.com>
30307
30308         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
30309
30310 2002-12-30  Martin Baulig  <martin@ximian.com>
30311
30312         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
30313         line number table in this data blob instead of using an external
30314         pointer.
30315
30316 2002-12-28  Martin Baulig  <martin@ximian.com>
30317
30318         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
30319
30320 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
30321
30322         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
30323         as a boxed return type.
30324
30325 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
30326
30327         * appdomain.c
30328         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
30329         g_build_filename to properly get separators on the filename created.
30330
30331         * object.h: Small change, introduce MonoMarshalByRefObject to
30332         track the layout of that structure in the C# universe as we make
30333         changes there.
30334
30335 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
30336
30337         * object.c: removed assert to allow static fields on interfaces.
30338         * loader.c: a TypeSpec may be used for any type, not just arrays.
30339
30340 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
30341
30342         * class.c, class.h: added mono_class_array_element_size ().
30343         Ignore static methods in interfaces.
30344
30345 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30346
30347         * threads.c: fixed the build under cygwin.
30348
30349 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
30350
30351         * reflection.c: handle nullref constants. Allocate keys for
30352         reflection handles with the GC.
30353
30354 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
30355
30356         * threads.c, threads.h: added mono_thread_get_abort_signal()
30357         to get a suitable signal for thread abort.
30358
30359 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
30360
30361         * metadata.c: fix handling of ExportedType table.
30362
30363 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30364
30365         * icall.c: added WriteWindowsDebugString internal call.
30366
30367 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30368
30369         * reflection.h: added fields to match C# implementation.
30370
30371 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30372
30373         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
30374
30375 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
30376
30377         * gc.h, gc-internal.h: Rename header for GC internal calls to
30378         gc-internal.h from gc.h as to not clash with Boehm GC having its
30379         header installed as <gc.h> in outside include paths.
30380         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
30381         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
30382
30383 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30384
30385         * icall.c: assign minor, build and revision in FillName.
30386
30387 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
30388
30389         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
30390         Added support for running code generated by Reflection.Emit.
30391
30392 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30393
30394         * appdomain.c: check for NULL argument in LoadFrom.
30395
30396 2002-12-10  Dick Porter  <dick@ximian.com>
30397
30398         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
30399
30400 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30401
30402         * appdomain.c: fix buglet when building exe file name.  Handle full
30403         assembly name (needed after latest changes to AssemblyName).
30404         * image.c:
30405         (mono_image_close): free some hashtables.
30406
30407 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
30408
30409         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
30410         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
30411         on some systems (redhat 7.3) 
30412
30413 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
30414
30415         * threads.c: delete the critical section of a sync block,
30416         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
30417
30418 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
30419
30420         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
30421
30422 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30423
30424         * appdomain.[ch]: handle the assembly preload event to try loading the
30425         assemblies using the paths we have in the current domain.
30426
30427         * assembly.[ch]: created an assembly preload hook that is called to try
30428         loading the assembly by other means that the ones provided here.
30429
30430         * domain.c: initialize the domain search path.
30431
30432         From now on, assemblies (TODO: except corlib and System) are loaded
30433         according to these rules when using mono_assembly_load ():
30434
30435                 1. It tries to load the assembly from the ApplicationBase
30436                 of the current domain appending .dll and .exe (TODO: have to
30437                 try loading from name/name.dll and name/name.exe).
30438
30439                 2. It tries the search path specified in PrivateBinPath for the
30440                 current domain (if any).
30441
30442                 3. Previous behavior.
30443
30444 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
30445
30446         * icall.c: implemented GetInterfaceMap() related icall.
30447         * domain.c, loader.h: load MethodInfo in mono_defaults.
30448
30449 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
30450
30451         * gc.c: disable the finalizer thread for now, untill all the issues
30452         with it are resolved.
30453
30454 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
30455
30456         * string-icalls.c: handle embedded nulls in string ctor when the
30457         length is specified.
30458
30459 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
30460
30461         * class.c: look for explicit interface implementation in parent
30462         classes, too.
30463
30464 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
30465
30466         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
30467
30468 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
30469
30470         * gc.c: protect handles with a critical section.
30471
30472 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30473
30474         * icall.c:
30475         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
30476         parameters. If no assembly specified, try getting the type from all
30477         the assemblies in the current domain, else, load the assembly and get
30478         the type from it.
30479
30480 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30481
30482         * marshal.c: applied patch from Aleksey Demakov that fixes
30483         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
30484
30485 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30486
30487         * icall.c: fixed get_location.
30488
30489 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
30490
30491         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
30492         declarations to make it work with older gcc. 
30493
30494         * loader.c (mono_get_method): set signature->pinvoke for native calls
30495
30496 2002-11-20  Dick Porter  <dick@ximian.com>
30497
30498         * threads.c (mono_thread_init): Set the main thread's handle
30499
30500 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
30501
30502         * gc.c: allow compilation without GC support. Changed to match the
30503         mono coding style.
30504
30505 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
30506
30507         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
30508
30509 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
30510
30511         * reflection.c: set a public key token on the core assemblies.
30512
30513 2002-11-18  Dick Porter  <dick@ximian.com>
30514
30515         * threads.c: Split out some thread initialisation so that other
30516         files can set the start callback function.
30517
30518         * gc.c: Run finalisers in a separate thread, to avoid stack
30519         overflow.  Fixes bug 31333.
30520
30521         * appdomain.c: Set up GC finalisation thread.
30522
30523         * reflection.c: 
30524         * object.c: 
30525         * domain.c: Use gc.h macros for GC_malloc
30526         
30527 2002-11-15  Dick Porter  <dick@ximian.com>
30528
30529         * threadpool.c: 
30530         * threads.c:
30531         * appdomain.c: Removed mono_runtime_init_with_attach(),
30532         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
30533         merging the extra parameter with the existing function.  Removed
30534         unneeded code in mono_thread_attach().
30535
30536 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
30537
30538         * image.c (mono_image_loaded_by_guid): a method to get loaded
30539         images by guid. 
30540         (load_metadata_ptrs): we store the guid as string.
30541
30542 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
30543
30544         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
30545
30546         * metadata.c (mono_guid_to_string): imported method form Zoltan
30547         Varga (slightly modified)
30548
30549         * assembly.c (mono_assembly_open): load precompiled code
30550
30551         * loader.h (MonoMethod): we store the method token for use in the
30552         aot compiler. 
30553
30554 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30555
30556         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
30557         the hook function called when an assembly is loaded.
30558         
30559         * domain.c: Modified file.
30560         (mono_domain_assembly_load): removed hash table insertion of assemblies.
30561
30562         Fixes bug #33196.
30563
30564 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
30565
30566         * reflection.c: Map PEFileKind to the value expected by the WinNT
30567         image loader. 
30568
30569 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30570
30571         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
30572         Read until the buffer is filled completely.
30573
30574 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30575
30576         * icall.c: implemented MonoType.InternalGetEvent ().
30577
30578 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30579
30580         * appdomain.c: implemented InitAppDomainSetup. Delayed
30581         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
30582         the entry_assembly.
30583
30584         * assembly.c: base_dir is now an absolute path ending with
30585         G_DIR_SEPARATOR.
30586
30587         * icall.c: modified get_location according to the above changes.
30588
30589         * object.c: init AppDomain.SetupInformation for the default domain after
30590         we have the entry assembly.
30591
30592         * domain.c: when unloading a domain, setup = NULL.
30593
30594 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
30595
30596         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
30597
30598 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
30599
30600         * object.h, object.c: introduced mono_object_get_virtual_method ()
30601         to lookup the method invoked on an object when a callvirt is done on
30602         a method.
30603         * icall.c: make MethodInfo::Invoke() always do a virtual call.
30604
30605 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30606
30607         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
30608         current domain when loaded an assembly and failed to load it.
30609
30610         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
30611
30612 2002-10-31  Dick Porter  <dick@ximian.com>
30613
30614         * icall.c: 
30615         * file-io.h: 
30616         * file-io.c: Return the error status in a parameter, as the
30617         GetLastError() value has long since been blown away if we try and
30618         look it up in a subsequent internal call invocation.  Delete the
30619         GetLastError() internal call, because it's useless.
30620
30621 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
30622
30623         * class.[ch]: added cast_class to fix bug 29517
30624
30625 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
30626
30627         * marshal.c: create valid IL code in the filter clause:
30628         the new JIT is less forgiving:-)
30629
30630 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30631
30632         * icall.c: removed get_property internal call.
30633
30634 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
30635
30636         * appdomain.h domain.c: Added an ID to appdomains.
30637         
30638         * threads.c threads.h icall.c: Implement icall
30639         Thread:GetDomainID(), and remove unused icall 
30640         CurrentThreadDomain_internal.
30641
30642 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30643
30644         * icall.c: Don't recurse through the base types in GetConstructor.
30645         Fixes bug #32063. 
30646
30647 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
30648
30649         * mempool.h, mempool.c: added mono_mempool_empty() and
30650         mono_mempool_stats().
30651
30652 2002-10-23  Dick Porter  <dick@ximian.com>
30653
30654         * file-io.c: 
30655         * file-io.h: 
30656         * icall.c: Added MonoIO.GetFileType internal call
30657
30658 2002-10-17  Dick Porter  <dick@ximian.com>
30659
30660         * appdomain.c (mono_runtime_cleanup): Don't signal the async
30661         delegate semaphore before waiting for all threads to finish,
30662         because new threads can also call async delegates.  Fixes bug
30663         32004.
30664
30665         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
30666         of 3 seconds, in case another async job is queued.  (This part is
30667         needed because the bug fix reintroduced the 3s exit lag.)  This
30668         makes the mono_runtime_shutdown flag superfluous.
30669
30670 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
30671
30672         * reflection.c: include ehader size in method section headers.
30673         Really check for suplicated modules entries.
30674
30675 2002-10-17  Martin Baulig  <martin@gnome.org>
30676
30677         * debug-mono-symfile.c: Added back support for locals.
30678
30679 2002-10-14  Martin Baulig  <martin@gnome.org>
30680
30681         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
30682         MONO_TYPE_VOID.
30683
30684 2002-10-14  Martin Baulig  <martin@gnome.org>
30685
30686         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
30687         mono_class_get() instead of looking in the class cache. 
30688
30689 2002-10-13  Martin Baulig  <martin@gnome.org>
30690
30691         * debug-mono-symfile.c: Set version number to 28, include the
30692         signature in method names.
30693
30694 2002-10-13  Martin Baulig  <martin@gnome.org>
30695
30696         * debug-mono-symfile.h: Set version number to 27.
30697
30698 2002-10-11  Martin Baulig  <martin@gnome.org>
30699
30700         * gc.c: Don't register/unregister NULL pointers as disappearing links.
30701
30702 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
30703
30704         * metadata.c, metadata.h: added helper function to allocate signatures.
30705
30706 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30707
30708         * icall.c: added internal call to get the location of machine.config.
30709
30710 2002-10-08  Martin Baulig  <martin@gnome.org>
30711
30712         * debug-mono-symfile.c: Ignore classes with a pending init for the
30713         moment.
30714
30715 2002-10-03  Dick Porter  <dick@ximian.com>
30716
30717         * threads.c: Freebsd pthread_t is a pointer
30718
30719 2002-10-03  Dick Porter  <dick@ximian.com>
30720
30721         * socket-io.c: Implemented GetHostName_internal
30722
30723 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30724
30725         * mono-config.c:
30726         (mono_config_parse_file): don't leak the text.
30727
30728 2002-10-02  Martin Baulig  <martin@gnome.org>
30729
30730         * debug-mono-symfile.c: Added support for methods.
30731
30732 2002-10-01  Martin Baulig  <martin@gnome.org>
30733
30734         * debug-mono-symfile.c: Don't emit methods and line numbers for
30735         the dynamic symbol file, just write the type table.  We can easily
30736         have an external helper program which creates a symbol file for an
30737         IL file.        
30738
30739 2002-10-01  Dick Porter  <dick@ximian.com>
30740
30741         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
30742         Only add the handle to the cleanup array when we're about to
30743         launch the thread.  Bug 31425 deadlocked when the test was run on
30744         mono under w32.
30745
30746 2002-10-01  Martin Baulig  <martin@gnome.org>
30747
30748         * debug-mono-symfile.c: Added support for properties.
30749
30750 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
30751
30752         * reflection.c: unaligned store fix from Mark Crichton
30753         <crichton@gimp.org>.
30754
30755 2002-09-27  Martin Baulig  <martin@gnome.org>
30756
30757         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
30758         New interncall.
30759
30760 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
30761
30762         * assembly.h, assembly.c: use a sane API to hook into the assembly
30763         loading process instead of a useless special-purpouse hack
30764         (ngen needs a hook, too, for example).
30765
30766 2002-09-27  Dick Porter  <dick@ximian.com>
30767
30768         * threads.c (mono_thread_init): Call GetCurrentProcess() so
30769         io-layer can set up some process handle info.  Not needed on w32,
30770         but doesn't hurt either.
30771
30772         * process.c: Pass the program name in the second parameter to
30773         CreateProcess, so the path is searched.  Include the working
30774         directory. Implemented process name, process enumeration, and some
30775         process detail internal calls.
30776         
30777         * icall.c: Added internal calls for process lookup, and some
30778         process details
30779
30780 2002-09-26  Martin Baulig  <martin@gnome.org>
30781
30782         * assembly.c (mono_install_open_assembly_hook): New global
30783         function to install a function to be invoked each time a new
30784         assembly is loaded.
30785         (mono_assembly_open): Run this callback function if set.
30786
30787         * debug-mono-symfile.c: Put back line numbers for the dynamic
30788         symbol file and also record the .il file as source file.  This
30789         allows us to install the temporary symbol file as `file.dbg' just
30790         like a compiler-generated one.
30791
30792 2002-09-26  Nick Zigarovich <nick@chemlab.org>
30793
30794         * Corrected typo in gc.c (BOHEM vs BOEHM).
30795
30796 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30797
30798         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
30799         GetProperties. Also avoid calling g_slist_length in GetProperties and
30800         GetMethods.
30801
30802 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
30803
30804         * reflection.c: avoid unaligned stores (bug spotted by
30805         Mark Crichton  <crichton@gimp.org>).
30806
30807 2002-09-25  Martin Baulig  <martin@gnome.org>
30808
30809         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
30810         instead of guint64 for addresses and added prologue/epilogue info.
30811
30812 2002-09-25  Martin Baulig  <martin@gnome.org>
30813
30814         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
30815         store line number info.  For the dynamic symbol file, we only need
30816         to provide the JIT generated dynamic line number info for the dynamic
30817         symbol file.
30818
30819 2002-09-25  Martin Baulig  <martin@gnome.org>
30820
30821         * debug-mono-symfile.h: Incremented version number.
30822
30823 2002-09-24  Martin Baulig  <martin@gnome.org>
30824
30825         * class.c (mono_debugger_class_init_func): New global function
30826         pointer variable.
30827         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
30828         call it.
30829
30830         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
30831         function.  This is called via the mono_debugger_class_init_func
30832         hook to add all types to the dynamic type table.
30833         (ves_icall_MonoDebugger_GetType): New interncall to get a class
30834         from its metadata token.
30835
30836         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
30837         New interncall for the debugger.
30838
30839 2002-09-24  Nick Drochak <ndrochak@gol.com>
30840
30841         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
30842         before using it in case it is null.
30843         
30844 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
30845
30846         * metadata.c: allow custom modifiers in local var signatures
30847         (bug spotted by Zoltan Varga).
30848
30849 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
30850
30851         * class.c: deal with the <Module> class that may have a NULL vtable.
30852         Eliminate warnings.
30853
30854 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
30855
30856         * image.c, image.h: more strong name helpers.
30857         * monosn.c: more work: convert pem keys to cryptoapi format.
30858
30859 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
30860
30861         * string-icalls.c: speedup IndexOf.
30862
30863 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
30864
30865         * icall.c: updates from Zoltan.2.Varga@nokia.com.
30866
30867 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
30868
30869         * icall.c: cleanup: use mono_object_domain ().
30870
30871 2002-09-23  Martin Baulig  <martin@gnome.org>
30872
30873         * debug-mono-symfile.c: Improved type support.
30874
30875 2002-09-22  Martin Baulig  <martin@gnome.org>
30876
30877         * debug-mono-symfile.c: Added support for reference types and strings.
30878
30879 2002-09-22  Martin Baulig  <martin@gnome.org>
30880
30881         * debug-mono-symfile.c: Started to work on the type table.
30882
30883 2002-09-21  Martin Baulig  <martin@gnome.org>
30884
30885         * debug-mono-symfile.c: Largely reworked the symbol table format.
30886         The symbol table is now incrementally updated each time a new
30887         method is added.  We're now also using our own magic and version
30888         so that you don't need to recompile all your classes if the
30889         dynamic table changes.
30890         (mono_debug_update_mono_symbol_file): Removed.
30891         (mono_debug_symfile_add_method): New function to add a method.
30892
30893 2002-09-21  Martin Baulig  <martin@gnome.org>
30894
30895         * icall.c
30896         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
30897         New interncall.
30898
30899         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
30900         New interncall to get a method from its metadata token.
30901
30902 2002-09-21  Martin Baulig  <martin@gnome.org>
30903
30904         * debug-mono-symfile.c: Create type table.
30905
30906 2002-09-20  Martin Baulig  <martin@gnome.org>
30907
30908         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
30909
30910 2002-09-20  Martin Baulig  <martin@gnome.org>
30911
30912         * debug-mono-symfile.c: Provide information about params and locals.
30913
30914 2002-09-20  Martin Baulig  <martin@gnome.org>
30915
30916         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
30917         New interncall.
30918
30919         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
30920         interncall to get a method from its metadata token.
30921
30922 2002-09-20  Martin Baulig  <martin@gnome.org>
30923
30924         * debug-mono-symfile.c: Added a few checks for method->header
30925         being non-NULL.  This should never happen, but for the moment
30926         let's use a g_warning() rather than a g_assert().
30927
30928 2002-09-19  Mark Crichton  <crichton@gimp.org>
30929
30930         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
30931         even if support for it isn't present.  Added an #ifdef to fix this.
30932
30933         * socket-io.c: Added checks back for Solaris support.
30934
30935 2002-09-19  Martin Baulig  <martin@gnome.org>
30936
30937         * debug-mono-symfile.c (read_string, write_string): Reflect latest
30938         changes in the symbol file format.
30939
30940 2002-09-18  Martin Baulig  <martin@gnome.org>
30941
30942         * debug-mono-symfile.c: Set version number to 21.
30943
30944 2002-09-18  Dick Porter  <dick@ximian.com>
30945
30946         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
30947         on netbsd.  Fixes bug 30051.
30948
30949 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30950
30951         * reflection.c:
30952         (set_version_from_string): little fix.
30953
30954 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
30955
30956         * monosn.c, Makefile.am: added strong name utility.
30957         * reflection.h, reflection.c: implemented delayed signing,
30958         locale, version and hash id assembly attributes.
30959
30960 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
30961
30962         * loader.c, metadata.c: load param attributes in signatures.
30963
30964 2002-09-16  Martin Baulig  <martin@gnome.org>
30965
30966         * debug-mono-symfile.c: Added string table with all method names.
30967
30968 2002-09-14  Martin Baulig  <martin@gnome.org>
30969
30970         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
30971         fast method lookup.
30972
30973 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
30974
30975         * reflection.c: record the public key token of referenced assemblies.
30976
30977 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
30978
30979         * image.c, image.h: added functions to get the strong name and the
30980         public key of an assembly.
30981         * pedump.c: use them.
30982
30983 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
30984
30985         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
30986
30987 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
30988
30989         * marshal.c (mono_marshal_get_managed_wrapper): Added
30990         MONO_TYPE_BOOLEAN 
30991
30992 2002-09-11  Martin Baulig  <martin@gnome.org>
30993
30994         * gc.c: Call GC_unregister_disappearing_link() on all links when
30995         finalizing them, this is necessary to aviod a crash in boehm's
30996         finalize handler.
30997
30998 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
30999
31000         * gc.c: handle GetTarget for finalized objects spotted and fixed by
31001         nick@chemlab.org.
31002
31003 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
31004
31005         * icall.c: implemented MonoType::Module.
31006         * reflection.c, reflection.h: mono_module_get_object () from
31007         Tomi Pakarinen <tomi.pakarinen@welho.com>.
31008
31009 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
31010
31011         * icall.c: ignore overridden methods in GetMethods ().
31012         Fix for FieldInfo::SetValue().
31013         * object.c: handle float/double in runtime invoke.
31014
31015 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31016
31017         * object.c: allow a constructor to be called again on an object.
31018
31019 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31020
31021         * class.h, class.c: move field layout code to it's own function and
31022         export it. Get an interface id earlier. Move fields in MonoClass
31023         so they are more cache friendly and align the bitfields.
31024         * loader.c: temporary handle get_param_names() for a runtime method.
31025         * reflection.c, reflection.h: more code to handle runtime creation of
31026         types.
31027
31028 2002-09-09  Martin Baulig  <martin@gnome.org>
31029
31030         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
31031         signature with the pinvoke field being set for the actual call.
31032
31033 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31034
31035         * icall.c: removed some unused icalls. Start of map of glib charsets
31036         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
31037
31038 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31039
31040         * debug-helpers.c: break infinite loop (found and fixed by
31041         Holger Arnold <harnold@gmx.de>).
31042
31043 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31044
31045         * icall.c: target may be null in create_delegate.
31046
31047 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31048
31049         * marshal.c: handle a boolean return type.
31050
31051 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
31052
31053         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
31054
31055 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
31056
31057         * gc.c: fix weakreferences.
31058
31059 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
31060
31061         * icall.c: added icall to get default codepage.
31062
31063 2002-09-03  Dick Porter  <dick@ximian.com>
31064
31065         * threads.h: 
31066         * threads.c: Use MonoThread instead of MonoObject where
31067         apropriate.
31068
31069         Store running thread objects in a hash table, so that we have all
31070         the info to hand when waiting for them to finish
31071         (means we don't need OpenThread() any more, so mingw builds should
31072         be fully functional again.)
31073
31074         * verify.c:
31075         * object.h: Added thread ID to MonoThread
31076
31077 2002-09-03  Martin Baulig  <martin@gnome.org>
31078
31079         * icall.c (System.Reflection.Assembly::get_location): New interncall.
31080
31081 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31082
31083         * icall.c: fixed leak in get_temp_path. Thanks lupus.
31084
31085 2002-09-03  Martin Baulig  <martin@gnome.org>
31086
31087         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
31088         argument to store the end address of the disassembled instruction.
31089
31090         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
31091         here from debug-symfile.h.
31092         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
31093         JIT into this struct.
31094         (MonoSymbolFile): Added `char *image_file' field.
31095         (MonoDebugGetMethodFunc): Removed.
31096         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
31097         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
31098         (mono_debug_find_method): New method.
31099
31100         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
31101         create a full symbol file.
31102         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
31103         and static symbol files.
31104         (mono_debug_find_method): The symbol file keeps an internal method hash,
31105         call this to get a MonoDebugMethodInfo from a MonoMethod.
31106
31107         * debug-symfile.[ch]: Removed.
31108
31109 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
31110
31111         * image.c (do_mono_image_open): Remove linker version check.
31112
31113 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
31114
31115         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
31116         wrappers for instance methods.
31117         
31118 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31119
31120         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
31121
31122 2002-08-28  Dick Porter  <dick@ximian.com>
31123
31124         * Makefile.am: Export HOST_CC for w32 builds
31125
31126 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31127
31128         * file-io.c process.c: MonoString are null terminated, no
31129         need for mono_string_to_utf16() anymore.
31130
31131 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31132
31133         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
31134
31135 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
31136
31137         * icall.c, reflection.h: speedup System.MonoType.
31138
31139 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
31140
31141         * reflection.c: allow null as the value of a string argument in
31142         custom attributes constructors.
31143
31144 2002-08-27  Martin Baulig  <martin@gnome.org>
31145
31146         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
31147         `trampoline_address' field.
31148
31149 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
31150
31151         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
31152         check (fixes bug #29486) 
31153
31154 2002-08-27  Martin Baulig  <martin@gnome.org>
31155
31156         * debug-mono-symfile.c: Changed the file format in a way that allows us
31157         open it read-only and to use a specially malloced area for all the
31158         dynamic data.  We can now also generate a symbol file on-the-fly if we're
31159         debugging IL code and there is no MCS generated symbol file for it.
31160
31161 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
31162
31163         * object.c: added a define for a good string and array
31164         creation speedup (not enabled by default because we need to deal with
31165         the synch stuff).
31166
31167 2002-08-26  Martin Baulig  <martin@gnome.org>
31168
31169         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
31170         function to create a dynamic symbol file.  This is used by the
31171         debugger to create a symbol file for IL code on-the-fly.
31172
31173 2002-08-26  Martin Baulig  <martin@gnome.org>
31174
31175         * loader.c (mono_lookup_pinvoke_call): Include the error message
31176         from g_module_error() in the error message.
31177
31178 2002-08-24  Martin Baulig  <martin@gnome.org>
31179
31180         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
31181         function to update the symbol file.  The symbol file is mmap()ed
31182         writable, but private.  This allows us to install the symbol file
31183         together with the assembly.
31184
31185 2002-08-24  Martin Baulig  <martin@gnome.org>
31186
31187         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
31188         but they can read the new symbol file format which mcs is now creating.
31189
31190         * debug-symfile.c (mono_debug_find_source_location): Moved to
31191         debug-mono-symfile.c; this is now operating on the new symbol file.
31192
31193 2002-08-23  Martin Baulig  <martin@gnome.org>
31194
31195         * debug-helpers.c (mono_method_desc_from_method): New function to get
31196         a MonoMethodDesc from a MonoMethod.
31197
31198 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
31199
31200         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
31201         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
31202
31203 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
31204
31205         * string-icalls.[ch]: make helper methods static.
31206
31207 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31208
31209         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
31210         types to it and to SetValueInternal.
31211
31212         * object.c: Moved handle_enum label to its proper place. This was the
31213         f... bug! ;-)
31214
31215         This time i compiled mcs and gtk-sharp and they both work.
31216
31217 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31218
31219         * icall.c: reverted partially my previous patch until 
31220         object.c:set_value handles enums correcly.
31221
31222 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31223
31224         * icall.c:
31225         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
31226         (ves_icall_System_Environment_get_MachineName): removed warning when
31227         compiling under cygwin.
31228
31229 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
31230
31231         * object.c: fixed field_get_value() for reference types.
31232
31233 2002-08-22  Dick Porter  <dick@ximian.com>
31234
31235         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
31236         Don't free a buffer while it's still needed.  Patch from Jonathan
31237         Liger <Jonathan.liger@wanadoo.fr>
31238
31239 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
31240
31241         * icall.c (ves_icall_System_Environment_get_Platform): Add new
31242         internal call.
31243
31244 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
31245
31246         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
31247         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
31248
31249         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
31250         we call unmanaged code which throws exceptions.
31251
31252 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31253
31254         * appdomain.h: added per-domain entry_assembly.
31255         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
31256         arguments.
31257         * icall.c: Assembly::GetEntryAssembly icall.
31258         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
31259         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
31260
31261 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31262
31263         * appdomain.h, gc.c: added mono_domain_finalize ().
31264
31265 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31266
31267         * object.c:
31268         (mono_print_unhandled_exception): changed g_warning by g_printerr
31269         because g_log has a 1024 characters limit (yeah, i got a big stack
31270         trace). Don't print exception name, that should be in ToString 
31271         returned string.
31272
31273 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31274
31275         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
31276         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
31277
31278 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31279
31280         * object.c:
31281         (mono_print_unhandled_exception): after previous commit, i realized
31282         that MS calls ToString on the exception. I changed this function to
31283         do that. This way we get stack_trace for free.
31284
31285 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31286
31287         * object.c:
31288         (mono_print_unhandled_exception): invoke Message property instead of
31289         getting 'message' field from Exception. Don't allocate memory for
31290         'trace' and 'message' if not needed.
31291
31292 2002-08-18  Dick Porter  <dick@ximian.com>
31293
31294         * unicode.c: Fix asserts to match Encoder.cs checks
31295
31296 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31297
31298         * marshal.c: fix unaligned store issue and a few wrong
31299         opcode argument types.
31300
31301 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31302
31303         * icall.c: added GetUninitializedObjectInternal internal call.
31304
31305 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
31306
31307         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
31308         to the right domain.
31309
31310 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
31311
31312         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
31313
31314         * class.c (class_compute_field_layout): set blittable to false for Strings
31315
31316         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
31317
31318 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31319
31320         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
31321         first chunk of code to create types at runtime. Code to
31322         handle ReflectedType/DeclaringType. Make reflection handles
31323         domain specific.
31324
31325 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
31326
31327         * class.c: set correct name in arrays.
31328
31329 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
31330
31331         * appdomain.c (mono_domain_transfer_object): make it work with
31332         valuetypes. bug fixes.
31333
31334 2002-08-12  Dick Porter  <dick@ximian.com>
31335
31336         * object.h: Rename some parameters to avoid c++ keywords (Patch
31337         from Joseph Wenninger <kde@jowenn.at>)
31338
31339 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
31340
31341         * icall.c: added icall to implement Assembly.GetFile*.
31342
31343 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31344
31345         * reflection.h, reflection.c: code to embed managed resources.
31346
31347 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
31348
31349         * class.c: move all the type size stuff into
31350         class_compute_field_layout().
31351
31352 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
31353
31354         * class.c: ensure enums have always the correct instance size.
31355         * unicode.c: remove wrong assert.
31356
31357 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
31358
31359         * assembly.c: fix mem corruption issue.
31360         * image.h, image.c: added mono_image_get_resource () to access
31361         managed resources.
31362         * icall.c: implemented Assembly.EntryPoint property and some
31363         Managed Resources related internalcalls.
31364
31365
31366 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31367
31368         * image.c, image.h: impemented mono_image_get_entry_point ().
31369         * appdomain.c: use mono_image_get_entry_point.
31370
31371 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31372
31373         * reflection.c: support the object type argument when loading
31374         custom attributes.
31375
31376 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
31377
31378         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
31379         String as return type.
31380
31381 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
31382
31383         * reflection.c: fix encoding of named args for custom attrs to match
31384         the ms implementation. Read them back when instantiating custom
31385         attributes.
31386
31387 2002-08-02  Radek Doulik  <rodo@ximian.com>
31388
31389         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
31390         by Dietmar as quick fix
31391         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
31392         16 as stack size, used on more places as quick fix before Dietmar
31393         will fix it properly
31394
31395 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
31396
31397         * object.h, object.c: added accessors for fields and properties.
31398
31399 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
31400
31401         * class.c, class.h: made mono_class_get_field_from_name ()
31402         loop on parent types.
31403         Added mono_class_get_property_from_name ().
31404
31405 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31406
31407         * class.c, class.h: move the code to setup the type vtable in its own
31408         function so that it can be reused also for types created at runtime.
31409         Eliminate the "class" identifier from the header file.
31410         * reflection.c: setup the vtable for enums so that we can create
31411         objects for use in SetConstant ().
31412
31413 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
31414
31415         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
31416         instead of the delegate itself as this pointer (bug #28383)
31417
31418 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
31419
31420         * marshal.c (mono_marshal_get_managed_wrapper): added return type
31421         conversions.
31422
31423 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31424
31425         * loader.c: don't set the pinvoke bit on icalls.
31426
31427 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
31428
31429         * debug-helpers.c (mono_method_full_name): only print a number to
31430         indicate wrapper type (so that the output is more readable in traces).
31431
31432 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
31433
31434         * class.c (mono_class_init): include method override patch from Paolo
31435
31436 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
31437
31438         * icall.c: fixed GetTypeCode().
31439
31440 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
31441
31442         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
31443         use real delegate invoke function to make it work with multicast
31444         delegates (fix bug# 28291).
31445
31446 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
31447
31448         * object.c: load constant strings.
31449
31450 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
31451
31452         * reflection.c: no magic numbers.
31453         * tabledefs.h: security action enum.
31454
31455 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
31456
31457         * assembly.c: fix possible memory corruption.
31458
31459 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
31460
31461         * reflection.h, reflection.c: added support for linking resources.
31462         * verify.c: check we have an updated corlib.
31463
31464 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
31465
31466         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
31467         string arrays.
31468         (mono_marshal_string_array): null terminate unmanaged string arrays.
31469         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
31470
31471 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
31472
31473         * icall.c: Type.GetType () can now return also types from the
31474         calling assembly.
31475
31476 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
31477
31478         * loader.h, loader.c: stack walking support.
31479         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
31480         GetCallingAssembly.
31481
31482 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
31483
31484         * marshal.c: added optimisations for blittable types 
31485
31486         * class.c (mono_array_class_get): do not set blittable attribute on arrays
31487         (mono_class_setup_mono_type): set blittable attribute for single
31488         and double.
31489
31490         * marshal.c (mono_string_utf8_to_builder): impl.
31491         (mono_string_builder_to_utf8): impl.
31492         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
31493
31494 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
31495
31496         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
31497         (mono_marshal_get_managed_wrapper): impl. byref types
31498
31499 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31500
31501         * icall.c:
31502         (search_method): don't display debug message. 
31503
31504 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
31505
31506         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
31507
31508 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
31509
31510         * appdomain.c: set the missing filename when throwing exception.
31511
31512 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
31513
31514         * metadata.c (mono_type_size): code cleanup
31515         (mono_type_stack_size): removed some test code
31516
31517 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
31518
31519         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
31520         mono_get_exception_file_not_found now.
31521
31522         * exception.c (mono_exception_from_name_two_strings): New version
31523         that will call a constructor with two string arguments. 
31524         (mono_get_exception_file_not_found): New helper routine, used to
31525         report file-not-found errors.
31526
31527 2002-07-20  Dick Porter  <dick@ximian.com>
31528
31529         * process.h:
31530         * process.c: Pass file handles to CreateProcess
31531         
31532         * icall.c:
31533         * file-io.h:
31534         * file-io.c: Implemented CreatePipe
31535
31536 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
31537
31538         * metadata.c (mono_get_param_info): set alignment for value types
31539
31540 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
31541
31542         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
31543         Constify mono_domain_assembly_open().
31544         * loader.c: handle null namespace in icalls.
31545
31546 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
31547
31548         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
31549         (emit_str_to_ptr_conv): marshal object as structs
31550
31551         * metadata.c (mono_type_to_unmanaged): marshal object as structs
31552
31553         * marshal.c (mono_marshal_get_runtime_invoke): support value types
31554
31555 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
31556
31557         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
31558         (mono_marshal_get_native_wrapper): we an now return value types
31559
31560 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31561
31562         * verify.c: more checks implemented.
31563
31564 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
31565
31566         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
31567         (fix bug #27695)
31568         (mono_marshal_get_native_wrapper): allow byref arguments
31569         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
31570         impl. PtrToStringXXX methods
31571         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
31572         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
31573         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
31574         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
31575         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
31576
31577 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31578
31579         * reflection.c: fix buglet in parsing an assembly name.
31580
31581 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
31582
31583         * marshal.c (emit_ptr_to_str_conv): first impl.
31584
31585 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
31586
31587         * object.c, class.h: cache the vtable in the class as suggested by
31588         vargaz@freemail.hu (Zoltan Varga).
31589
31590 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31591
31592         * class.h, loader.c: added mono_field_from_token().
31593         * verify.c: first cut of type checking code.
31594
31595 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
31596
31597         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
31598
31599 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
31600
31601         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
31602         (fix bug #27782)
31603         (mono_marshal_get_remoting_invoke): impl.
31604         (mono_delegate_begin_invoke): impl.
31605         (mono_mb_emit_save_args): impl.
31606         (mono_delegate_end_invoke): impl.
31607         (mono_marshal_get_delegate_begin_invoke):
31608         (mono_marshal_get_delegate_end_invoke):
31609         (mono_marshal_get_delegate_invoke): generate a special name for
31610         those methods (including the signature) and associate them whith
31611         the delegate class. 
31612
31613 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
31614
31615         * reflection.[ch]: 
31616         (mono_reflection_type_from_name): now it has a MonoImage parameter
31617         which is used as the default image to search the type in. If the image
31618         is NULL or getting the type from it fails, it defaults to corlib.
31619
31620         * icall.c: changed 1 call to mono_reflection_type_from_name to match
31621         new parameter.
31622
31623 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31624
31625         * reflection.c: update the parameter table index.
31626
31627 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31628
31629         * domain.c: don't include the mark byte in the string hash.
31630
31631 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31632
31633         * icall.cs: icall for Type.GetTypeCode ().
31634         * verify: a couple of fixes and disabled local initialization checks.
31635
31636 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
31637
31638         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
31639
31640         * debug-helpers.c (mono_method_full_name): print the type of the
31641         runtime wrapper
31642
31643         * metadata.c (mono_signature_hash): a hash function for signatures
31644         (mono_signature_hash): better hash algorithm
31645
31646         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
31647
31648         * debug-helpers.c (mono_method_full_name): this can now generate
31649         method names with signatures
31650
31651         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
31652         method dont have this pointers.
31653
31654 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
31655
31656         * reflection.c: fixup typebuilder tokens.
31657         * image.c: fix buglet.
31658         * marshal.h: remove whitespace.
31659         * metadata.h, metadata.c: reinstate code that was removed.
31660         * verify.c: handle catch directives and fix another couple of bugs.
31661
31662 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
31663
31664         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
31665         (mono_marshal_get_native_wrapper): make it comp. with the old code
31666         (mono_marshal_get_native_wrapper): support boolean
31667         (mono_marshal_get_managed_wrapper): support more types
31668
31669 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
31670
31671         * class.c (class_compute_field_layout): compute class->blittable attribute.
31672
31673 2002-07-09  Dick Porter  <dick@ximian.com>
31674
31675         * threads.c: Make the thread cleaning up cope with threads that
31676         call ExitThread()
31677
31678 2002-07-08  Radek Doulik  <rodo@ximian.com>
31679
31680         * reflection.c (method_encode_code): use non-translated values to
31681         compute finally_start, this fixes exception handling on ppc, yay!
31682
31683         * decimal.h (struct signscale): fix endianess
31684
31685 2002-07-07  Radek Doulik  <rodo@ximian.com>
31686
31687         * reflection.c: swap box_val and not val
31688
31689 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
31690
31691         * reflection.c, reflection.h: handle full assembly info in type name.
31692         Handle Type arguments when loading custom attributes.
31693         * icall.c: updated to use new mono_reflection_type_from_name () method.
31694
31695 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31696
31697         * loader.c:
31698         (method_from_memberref): also print assembly name when method not found.
31699
31700 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31701
31702         * icall.c:
31703         (ves_icall_TypeGetProperties): fixed bug #27473. 
31704
31705 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31706
31707         * reflection.c: display image name and token when cannot find the
31708         .ctor for an attribute.
31709
31710 2002-07-05  Martin Baulig  <martin@gnome.org>
31711
31712         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
31713
31714 2002-07-04  Dick Porter  <dick@ximian.com>
31715
31716         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
31717         compile on mingw.  This will cause mingw builds to not wait for
31718         subthreads to terminate after the main thread does.  I've lodged a
31719         bug with the mingw developers for them to wrap OpenThread().
31720
31721 2002-07-03  Dick Porter  <dick@ximian.com>
31722
31723         * threads.c: Store thread IDs instead of handles, because
31724         GetCurrentThread() returns a pseudohandle and therefore stores
31725         useless values.  mono_thread_cleanup() continues checking the
31726         array of threads until it is empty, to cope with subthreads
31727         spawning new threads after the main thread has finished.
31728
31729         * profiler.h:
31730         * profiler.c:
31731         * profiler-private.h: Pass the thread ID to thread profiler
31732         functions, instead of a handle
31733
31734 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
31735
31736         * verify.c: fixes to make it more usable.
31737         * pedump.c: added --verify code to verify IL code in an assembly.
31738
31739 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31740
31741         * reflection.c: turn errors into warnings to allow compiling corlib.
31742
31743 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
31744
31745         * reflection.c: add special cases to compile corlib.
31746
31747 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31748
31749         * reflection.c: handle properties with only a set method.
31750
31751 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
31752
31753         * opcodes.h: add enum with opcodes in opval order.
31754
31755 2002-07-01  Dick Porter  <dick@ximian.com>
31756         
31757         * object.h:
31758         * object.c (mono_runtime_run_main): Removed unneeded argument
31759
31760 2002-06-28  Martin Baulig  <martin@gnome.org>
31761
31762         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
31763
31764 2002-06-27  Dick Porter  <dick@ximian.com>
31765
31766         * threads.c: Store the handle in both the parent thread and in the
31767         subthread, to minimise the time between starting a new thread and
31768         storing its ID.
31769
31770 2002-06-26  Dick Porter  <dick@ximian.com>
31771
31772         * appdomain.c (mono_runtime_cleanup): Close the socket library
31773         after all the threads have finished, not before
31774
31775 2002-06-26  Martin Baulig  <martin@gnome.org>
31776
31777         * debug-symfile.c (mono_debug_find_source_location): Added
31778         `guint32 *line_number' argument.  If it's not NULL, store the line number
31779         there and return the file name without the line number.
31780
31781 2002-06-25  Dick Porter  <dick@ximian.com>
31782
31783         * icall.c:
31784         * process.h:
31785         * process.c: Process forking and other support functions
31786
31787 2002-06-25  Dick Porter  <dick@ximian.com>
31788
31789         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
31790         things dont happen when the image is closed.
31791         (mono_image_lookup_resource): Walk the resource section looking
31792         for a particular entry
31793
31794         * cil-coff.h: PE resource section decoding
31795
31796 2002-06-25  Dick Porter  <dick@ximian.com>
31797         
31798         * assembly.h:
31799         * assembly.c: 
31800         (mono_assembly_foreach): Accessor functions to walk the list of
31801         loaded assemblies
31802         (mono_assembly_set_main):
31803         (mono_assembly_get_main): Process methods need to know which
31804         assembly is the "main" one
31805
31806         * object.c (mono_runtime_run_main): Record the main assembly
31807
31808         * debug-helpers.c: Fix typo
31809
31810 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
31811
31812         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
31813         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
31814
31815 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31816
31817         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
31818
31819 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
31820
31821         * image.c (do_mono_image_open): Initialize reference count,
31822         otherwise we leak the MonoImage.
31823
31824 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31825
31826         * reflection.c: small tweak to handle self-hosting.
31827
31828 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
31829
31830         * reflection.c: fix type name parse code.
31831
31832 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31833
31834         * reflection.c: break out of the loop.
31835         * image.c: special case corlib.
31836
31837 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
31838
31839         * reflection.c: add all the custom attrs at the end to ensure the
31840         ctors have been properly initialized when the attributes are defined
31841         in the current assembly.
31842
31843 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31844
31845         * reflection.c: handle correctly multiple-nested types.
31846
31847 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
31848
31849         * row-indexes.h: fix typos.
31850         * reflection.c: adjust for typos and fix method_def_or_ref
31851         encoding in MethodImpl table.
31852
31853 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
31854
31855         * reflection.c: fix entry point patching (thanks Serge!).
31856
31857 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
31858
31859         * verify.c: add check for System.Exception
31860
31861 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
31862
31863         * image.c, class.c: minifix for code just c&p'ed.
31864         * reflection.c: warning fix.
31865         * object.h, loader.h, domain.c: load also StringBuilder.
31866
31867 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
31868
31869         * marshal.h, marshal.c: some support code to handle complex marshaling.
31870
31871 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31872
31873         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
31874         Better signatures with vtable error dump.
31875
31876 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
31877
31878         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
31879
31880 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
31881
31882         * icall.c (ves_icall_Type_GetField): impl.
31883
31884 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31885
31886         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
31887         to retrieve a marshal description blob for a field or param.
31888
31889 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
31890
31891         * reflection.h, reflection.c: change order of nested type emission
31892         to avoid table corruption. The NestedTypes table is sorted.
31893         * icall.c: change order of GetConstructor results to workaround mcs bug.
31894
31895 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
31896
31897         * reflection.h, reflection.c: handle field and param marshal
31898         information.
31899
31900 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
31901
31902         * icall.c, marshal.c marshal.h: more Marshal class implementation.
31903
31904 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31905
31906         * reflection.c: fix call convention.
31907
31908 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31909
31910         * reflection.h, reflection.c: mono_image_get_memberref_token()
31911         takes a type instead of a class, now. Added
31912         mono_image_get_array_token() to create tokens for the special
31913         multi-dim array methods.
31914
31915 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
31916
31917         * assembly.c: handle modules (no assembly table). Split
31918         loading references in its own function.
31919         * class.c: handle moduleref resolution scope.
31920         * image.c, image.h: cache module name in image.
31921
31922 2002-06-07  Martin Baulig  <martin@gnome.org>
31923
31924         * reflection.c (mono_image_get_type_info): Only add a class layout entry
31925         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
31926
31927 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31928
31929         * icall.c: more signature fixes that used uint instead of int.
31930
31931 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31932
31933         * reflection.c: fixed signature of field refs.
31934
31935 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
31936
31937         * class.c, reflection.c: handle typerefs of nested types
31938         (both on read and when writing files).
31939
31940 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
31941
31942         * icall.c: fix method signatures that tried to workaround the previous
31943         typo, d'oh!
31944
31945 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
31946
31947         * debug-helpers.c: fix typo.
31948
31949 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
31950
31951         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
31952         rewrote the PE/COFF writing code (our programs are understood by the
31953         ms runtime, now).
31954
31955 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
31956
31957         * gc.c, gc.h, icall.c: weakreference support.
31958
31959 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
31960
31961         * Makefile.am, mono-config.c: use $(sysconfdir).
31962
31963 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
31964
31965         * icall.c: changed default precision of Double.ToString() to 15.
31966         Fixed memory leak. Unified with Single.ToString.
31967
31968 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
31969
31970         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
31971
31972 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
31973
31974         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
31975         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
31976         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
31977         and myself.
31978
31979 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
31980
31981         * debug-symfile.c, sysmath.c: yet more compilation fixes.
31982
31983 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
31984
31985         * reflection.c, socket-io.c: more compilation fixes.
31986
31987 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
31988
31989         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
31990         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
31991         unicode.c: warning and compiler compatibility fixes.
31992
31993 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
31994
31995         * class.h, metadata.c: fixed warnings/compilation errors.
31996
31997 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
31998
31999         * Makefile.am, mono-config.c, mono-config.h: configuration file
32000         support routines.
32001         * loader.c, loader.h: make Dll mapping configurable at runtime in the
32002         config file. Export methods to insert and lookup mappings.
32003
32004 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32005
32006         * reflection.c: handle types and boxed objects in custom attr
32007         constructors.
32008
32009 2002-05-30  Martin Baulig  <martin@gnome.org>
32010
32011         * debug-symfile.c
32012         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
32013
32014 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
32015
32016         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
32017         to lookup the implmap row for a P/Invoke method.
32018         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
32019         P/Invoke method from the runtime on an as needed basis.
32020
32021 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
32022
32023         * metadata.c (mono_metadata_parse_signature): impl.
32024
32025 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32026
32027         * class.c: handle .pack directive.
32028
32029 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32030
32031         * object.c: initialize static fields with RVA data.
32032
32033 2002-05-25  Martin Baulig  <martin@gnome.org>
32034
32035         * debug-symfile.c
32036         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
32037
32038 2002-05-24  Martin Baulig  <martin@gnome.org>
32039
32040         * debug-symfile.c
32041         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
32042         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
32043         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
32044
32045 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32046
32047         * object.c: special case string ctros in invoke.
32048         * gc.c: silly whitespace changes.
32049
32050 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
32051
32052         * threadpool.[ch]: impl. a threadpool that can
32053         be used by mint and mono.
32054
32055 2002-05-22  Martin Baulig  <martin@gnome.org>
32056
32057         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
32058         The first argument is now a `MonoReflectionModuleBuilder *', the return
32059         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
32060         `methods' field to get the method builder.  The `token' argument is the
32061         unfixed token.
32062
32063         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
32064         invalid characters instead of g_assert_not_reached()ing.  This seems
32065         to be the behaviour of mscorlib.
32066
32067 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
32068
32069         * object.c (mono_runtime_invoke_array): applied patch from Rachel
32070         Hestilow to fix bug #25104
32071
32072 2002-05-21  Martin Baulig  <martin@gnome.org>
32073
32074         * debug-symfile.c (mono_debug_find_source_location): New function.
32075         Looks up an IL offset in the line number table and returns the source
32076         location as a string.
32077
32078 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32079
32080         * icall.c:
32081         (mono_double_ToStringImpl): changed %f by %g until we have something
32082         better.
32083
32084 2002-05-21  Nick Drochak  <ndrochak@gol.com>
32085
32086         * icall.c : Use different name for Math.Pow's icall.  Needed to check
32087         parameters first in C#.
32088
32089 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32090
32091         * icall.c, reflection.h: added icall to get info about an event.
32092
32093 2002-05-20  Radek Doulik  <rodo@ximian.com>
32094
32095         * object.c (mono_value_box): don't use memcpy for boxing on BIG
32096         endian
32097         (mono_value_box): don't use memcpy for small sizes on
32098         architectures with unaligned access
32099
32100 2002-05-20  Martin Baulig  <martin@gnome.org>
32101
32102         * reflection.c (mono_reflection_setup_internal_class): Don't crash
32103         if `tb->parent == NULL'.
32104         (mono_reflection_create_internal_class): New function.  This is
32105         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
32106         for enum types.
32107
32108         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
32109         New interncall.
32110
32111 2002-05-19  Martin Baulig  <martin@gnome.org>
32112
32113         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
32114         argument to get the length, don't default to the array length.
32115
32116 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
32117
32118         * assembly.c (mono_assembly_setrootdir): New function used to
32119         override the MONO_ASSEMBLIES directory.
32120
32121 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32122
32123         * icall.c: ValueType_GetHashCode() initialize local var.
32124
32125 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32126
32127         * reflection.c: sort custom attributes table.
32128
32129 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32130
32131         * reflection.c: support named args in custom attributes (write support).
32132
32133 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
32134
32135         * reflection.c: fix finally position calculation.
32136
32137 2002-05-15  Radek Doulik  <rodo@ximian.com>
32138
32139         * reflection.c: fixed endianess at many places
32140
32141         * icall.c (ves_icall_InitializeArray): comment out debug msg
32142
32143 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
32144
32145         * object.c (mono_unhandled_exception): new function to handle
32146         unhandled exceptions.
32147         (mono_unhandled_exception): call the UnhandledException event.
32148         (mono_runtime_delegate_invoke): impl.
32149
32150 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
32151
32152         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
32153         returns the RVA, not the direct pointer to the data. Handle the case
32154         when the class size is fixed.
32155
32156 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
32157
32158         * reflection.c: fix some endianess issues.
32159
32160 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
32161
32162         * object.c (mono_runtime_invoke): is now able to catch exceptions.
32163
32164         * threads.c (mono_thread_init): added a callback which is invoked
32165         at thread start.
32166
32167 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
32168         
32169         * icall.c: make GetHashCode return non-negative values.
32170
32171 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
32172
32173         * object.c, icall.c, gc.c: revert to address-based hashcode.
32174
32175 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
32176
32177         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
32178
32179 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32180
32181         * icall.c, class.c: special case <Module>.
32182
32183 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
32184
32185         * icall.c: fix bug in GetNow().
32186
32187 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
32188
32189         * object.c (mono_runtime_class_init): make sure that we call all
32190         static class constructors.
32191
32192 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
32193
32194         * reflection.c: sort methodsemantics table.
32195
32196 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
32197
32198         * reflection.h, reflection.c: honour init locals setting.
32199
32200 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
32201
32202         * icall.c: copied Double ToStringImpl for Single ToStringImpl
32203
32204 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
32205
32206         * reflection.c: support ContructorBuilders in attribute blob creation.
32207
32208 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32209
32210         * reflection.c: some changes to build a binary that can be run
32211         directly in windows.
32212
32213 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
32214
32215         * loader.c: print a big message when an icall can't be found.
32216
32217 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32218
32219         * string-icalls.c: fix bug 24248.
32220
32221 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
32222
32223         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
32224         icall.c, reflection.h: separate assembly loading by pathname and by
32225         assembly name. Use the MONO_PATH env var to search for assemblies.
32226
32227 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32228
32229         * assembly.c, image.h: add some support for assemblies
32230         with multiple modules.
32231         * class.c, class.h: export mono_class_from_typeref().
32232         * loader.c: remove duplicated code and use mono_class_from_typeref(),
32233         instead.
32234
32235 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32236
32237         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
32238         documentation says (the ECMA one is correct).
32239
32240 2002-05-02  Dick Porter  <dick@ximian.com>
32241
32242         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
32243         Don't name the synchronisation mutex.
32244
32245 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
32246
32247         * rand.c
32248         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
32249         Make the prototypes match.
32250         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
32251         Same.
32252
32253         * icall.c
32254         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
32255         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
32256         all systems have tm.tm_zone, so use strftime() with %Z to print
32257         the timezone abreviation into a temp string.
32258
32259         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
32260         rather than mono_array_addr() on a MonoString on Big Endian
32261         machines.
32262
32263 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
32264
32265         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
32266         fix bug 24041
32267
32268 2002-04-30  Dick Porter  <dick@ximian.com>
32269
32270         * socket-io.c: Cope with SOCKET being an integer rather than a
32271         pointer now.
32272
32273         * threads.c: Added Thread_free_internal, to deal with thread
32274         handle cleanup.  Moved calls to handle_store() and handle_remove()
32275         to start_wrapper(), so each can only be called once.  Allocate
32276         synchronisation blocks with GC_malloc(), and use GC finalisation
32277         to close the handles.
32278
32279         * icall.c: added System.Threading.Thread::Thread_free_internal
32280
32281 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32282
32283         * icall.c: support Environment.Exit, CommandLineArgs().
32284
32285 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
32286
32287         * object.c, object.h: added mono_runtime_run_main () and
32288         mono_runtime_get_main_args () for use in System.Environment.
32289
32290 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
32291
32292         * gc.c: fix thinko, enable actual finalization since the jit is now
32293         fixed.
32294
32295 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32296
32297         * gc.c, object.c: take into account that an object may be offset wrt the address
32298         returned by GC_malloc().
32299
32300 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
32301
32302         * image.c: handle files without entries in the assembly table (modules).
32303
32304 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
32305
32306         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
32307         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
32308         allowed to be null when it's System.Object class setup.
32309
32310 2002-04-27  Martin Baulig  <martin@gnome.org>
32311
32312         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
32313         if `tb->parent == NULL' rather than crashing.
32314
32315 2002-04-28  Nick Drochak  <ndrochak@gol.com>
32316
32317         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
32318         calling acos() where asin() should have been called.
32319
32320 2002-04-26  Martin Baulig  <martin@gnome.org>
32321
32322         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
32323         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
32324         there's a subdirectory called `System', but we don't want to read that
32325         subdirectory as an assembly.
32326
32327 2002-04-25  Martin Baulig  <martin@gnome.org>
32328
32329         * debug-symfile.c: Reflect latest MonoString changes.
32330
32331 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32332
32333         * rand.c, rand.h: instance method icalls need to have an explicit
32334         this pointer as first argument in the C implementation.
32335
32336 2002-04-25  Nick Drochak <ndrochak@gol.com>
32337
32338         * icall.c: Fix typo in map for GetNonZeroBytes
32339
32340 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32341
32342         * string-icalls.c : String does now passes unit tests without any 
32343         errors, the following changes has been made:
32344         
32345         Implemented replace methods.
32346         Renaming of methods to (try) follow the standard.
32347         Fixed compare ordinal
32348         Made all memory allocated directly to function instead of via icall function.
32349         Small performance fix in is_in_array function
32350                         
32351  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
32352
32353         c (mono_string_Internal_ctor_charp_int_int):
32354         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
32355         sindex < 0, throw ArgumentOutOfRangeException instead of
32356         ArgumentNullException.
32357
32358         Added new check for length == 0, however
32359         I need to make it return String.Empty from the C code.
32360         
32361         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
32362         that calculate the length for us here.
32363         
32364         (mono_string_Internal_ctor_sbytep_int_int): Replaced
32365         mono_string_new_utf16 with mono_string_new, since value is utf8.
32366
32367 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32368
32369         * object.c: register the object for finalization if needed.
32370         Allocate one more char in the string for the terminating 0 char.
32371
32372 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
32373
32374         * class.c, class.h, image.c: check if a type implemenst a destructor.
32375         Use the proper key for array class lookups.
32376         * icall.c: register the icalls in the System.GC class.
32377         * gc.c, gc.h: GC-related functions and icalls.
32378
32379 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32380
32381         * icall.c:
32382         * socket-io.c:
32383         * unicode.c: free some strings gotten from mono_string_to_utf8 and
32384         changed a couple of free () by g_free ().
32385
32386         * decimal.c: one-liner in the comments for decimal2string ().
32387
32388 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32389
32390         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
32391
32392 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
32393
32394         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
32395         * object.c (mono_runtime_invoke_array) : handle null in params
32396
32397 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32398
32399         * string-icalls.c: fixed bug in split (one off bug)
32400
32401 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32402
32403         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
32404         * icalls.c: added String::Equals as internal method
32405
32406 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
32407
32408         * threads.c: fixed bug in the double interlocked functions
32409
32410 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
32411
32412         * threads.c: implemented all of the new interlocked icalls.
32413         * string-icalls.c: fix a bug in insert.
32414         * icalls.c: added the icalls for interlocked, removed old string functions.
32415         
32416 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32417
32418         * loader.c: fix off-by-one error when reading argument names.
32419
32420 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32421
32422         * profiler.c: win32 counter implementation (untested).
32423         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
32424         (the latter needs testing and more complete impl. from win32 folks).
32425
32426 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
32427
32428         * object.c: mono_array_new_full workaround mono_array_class_get
32429         problem.
32430
32431 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32432
32433         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
32434         * object.h (mono_string_chars): Changed casting type.
32435
32436 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32437
32438         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
32439                            method signatures to use gunichar2 instead of gint16.
32440
32441 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
32442
32443         * object.h, object.c: domain-specific versions of mono_object_new and
32444         mono_array_new.
32445
32446 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
32447
32448         * object.c: changed String layout
32449
32450         * string-icalls.c (mono_string_Internal_ctor_chara): added
32451         internal string constructors.
32452
32453 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
32454
32455         * threads.c: pass 'this' to the thread start routine.
32456
32457 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32458
32459         * string-icalls.c: fix IndexOf and LastIndexOf. Now
32460         InternalCompareStr don't call twice mono_string_cmp_char for the last
32461         character. Improved performance in mono_string_cmp_char.
32462
32463 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
32464
32465         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
32466         code into its own library: libmonoruntime.
32467
32468 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
32469
32470         * object.h, object.c: changed array format so that szarrays do not
32471         require a bounds structure.
32472         * icall.c, appdomain.c: support for new szarray format.
32473
32474 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
32475
32476         * metadata.c: compare also the retuns type when comparing signatures:
32477         we didn't do this as an optimization since really overloaded methods
32478         must differ also in the arguments, but this doesn't work with
32479         low-level IL code (or when using explicit conversion operators: see
32480         bug#23498 for an example).
32481
32482 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
32483
32484         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
32485
32486 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
32487
32488         * icall.c: make MonoType::GetElementType its own icall.
32489
32490 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
32491
32492         * icall.c: remove MonoMethod_get_Name().
32493         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
32494         object.
32495
32496 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32497
32498         * string-icalls.c: optimized a few methods.
32499
32500 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
32501
32502         * icall.c: added all new string internal calls
32503         * string-icalls.c: added, new string internal call implementation.
32504         * object.c: added mono_string_new_size for allocating a string a size
32505
32506 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
32507
32508         * object.c (mono_object_isinst): use the same code as in the
32509         optimized x86 version.
32510
32511 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
32512
32513         * profiler.c: TSC-based timer code (faster and more accurate).
32514         Not hooked up in configure, yet (set USE_X86TSC to 1).
32515
32516 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
32517
32518         * profiler.c, profiler.h: track time spent compiling methods.
32519         * threads.c: track thread creation/destruction.
32520
32521 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
32522
32523         * profiler.c, profiler.h, profiler-private.h: profiling interface
32524         and sample implementation. Moved here so that it can be used also by
32525         the jit.
32526
32527 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
32528
32529         * reflection.c, reflection.h: keep types and other handles separate in
32530         the hash tables for referred tokens. Add guid for modules.
32531
32532 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
32533
32534         * assembly.c: fix bugs found with valgrind.
32535         * metadata.h, metadata.c: added mono_metadata_guid_heap().
32536
32537 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
32538
32539         * threads: added icall support for getting current domain for
32540                    the thread.
32541  
32542 2002-04-13  Martin Baulig  <martin@gnome.org>
32543
32544         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
32545         (MonoDebugVarInfo): Added `index' field for register based addresses.
32546         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
32547         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
32548         `MonoDebugVarInfo *params' and `guint32 this_offset' with
32549         `MonoDebugVarInfo *this_var'.
32550
32551         * debug-symfile.c (relocate_variable): New static function to write
32552         a location description for a local variable or method parameter.
32553
32554 2002-04-12  Martin Baulig  <martin@gnome.org>
32555
32556         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
32557         stack offset and begin/end scope address of a local variable.
32558         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
32559         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
32560         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
32561
32562         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
32563         Added new relocation types for start/end scope of a local variable.
32564
32565 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
32566
32567         * object.h: add mono_object_domain() macro.
32568         * reflection.c: handle typespecs.
32569         * icall.c: MonoMethod::get_Name() implementation.
32570
32571 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32572
32573         * icall.c: String::GetHashCode() icall implementation.
32574
32575 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32576
32577         * icall.c: String::IndexOfAny icall.
32578         * object.c, object.h: make array->max_length more useful.
32579         Intrduced mono_object_class() and mono_string_length() macros.
32580
32581 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32582
32583         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
32584         instead of g_unichar_isdigit.
32585
32586 2002-04-11  Nick Drochak  <ndrochak@gol.com>
32587
32588         * icall.c: Implement a simple Double.ToString().
32589
32590 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32591
32592         * appdomain.h: only io-layer.h is supposed to be included.
32593         * icall.c: explicitly import environ. Fix warning.
32594
32595 2002-04-10  Nick Drochak  <ndrochak@gol.com>
32596
32597         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
32598                 return true even if it's not Daylight Savings time.
32599                 Only return false for the case where the function isn't
32600                 implemented for a plaform (read Windows).
32601
32602 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32603
32604         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
32605         data with a mutex.
32606
32607 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
32608
32609         * mempool.c (mono_mempool_alloc): only use g_malloc when
32610         absolutely necessary.
32611
32612 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
32613
32614         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
32615
32616         * class.c (mono_class_vtable): use domain mempool to allocate vtable
32617         (mono_class_proxy_vtable): use domain mempool
32618
32619 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
32620
32621         * appdomain.h, appdomain.c: split initialization that requires the
32622         execution engine support into mono_runtime_init().
32623
32624 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
32625
32626         * class.c (mono_class_init): don't include vtable inside MonoClass
32627         to save some memory, gather some statistics.
32628         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
32629
32630 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32631
32632         * icall.c: internalcall implementation for ValueType.Equals().
32633
32634 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
32635
32636         * object.c (mono_message_init): moved 
32637         (mono_runtime_exec_main): new arch. independent impl.
32638         (mono_runtime_invoke_array): new method - like
32639         mono_runtime_invoke, but you can pass an array of objects.
32640         (mono_remoting_invoke): new arch. independent impl.
32641         (mono_message_invoke): new arch. independent impl.
32642         (mono_runtime_class_init): new arch. independent impl.
32643         (mono_runtime_object_init): new arch. independent impl.
32644
32645 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
32646
32647         * metadata.c, object.c, reflection.c: documented the exported
32648         functions.
32649
32650 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
32651
32652         * icall.c: simpler code to pass the assembly builder data to corlib.
32653         Implement GetNestedTypes() internalcall.
32654
32655 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
32656
32657         * class.c: warn if a type can't be loaded.
32658
32659 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
32660
32661         * image.h: typedef MonoImageOpenStatus
32662         * types.h: removed unused file
32663         
32664 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
32665
32666         * icall.c: Enum_ToObject accepts enum value arguments.
32667
32668 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
32669
32670         * class.c: move initialization of properties, events and nested
32671         classes, so that they happen for interfaces, too.
32672
32673 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
32674
32675         * icall.c: cleanup some ugly casts in Array_SetValue*.
32676
32677 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
32678
32679         * icall.c: the values array fro enums is of the correct type, now.
32680         Implement (correctly) getFullName instead of assQualifiedName for
32681         MonoType.
32682         * reflection.h, reflection.c: added mono_type_get_name ().
32683
32684 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
32685
32686         * assembly.c, image.h: for each MonoImage, record from wich assembly
32687         it was loaded.
32688         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
32689         Make Type.Assembly work.
32690
32691 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
32692
32693         * debug-symfile.h: use char* instead of gpointer to avoid
32694         unnecessary casts.
32695
32696         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
32697
32698         * icall.c (ves_icall_InternalExecute): impl. FielSetter
32699         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
32700
32701 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
32702
32703         * icall.c (mono_message_init): impl. (code cleanup)
32704         (ves_icall_InternalExecute): impl. FieldGetter
32705
32706         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
32707         defined we call all (non-static)methods through the vtable. 
32708
32709 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
32710
32711         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
32712         finalizer even though the memory is still referenced (and the chunk of
32713         memory is not freed).
32714
32715 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
32716
32717         * assembly.c: fix brokeness.
32718
32719 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
32720
32721         * class.c: kill some warnings. Check explicit interface method
32722         implementation also without considering the namespace.
32723         Load also literal strings in static class data.
32724
32725 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
32726
32727         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
32728         (default_assembly_name_resolver): Make the resolver take the
32729         "base" directory where the assembly was originally defined, so we
32730         can load DLLs that are in the same directory as the assembly that
32731         is being referenced.
32732
32733 2002-03-28  Dick Porter  <dick@ximian.com>
32734
32735         * file-io.h: 
32736         * file-io.c:
32737         * socket-io.c: 
32738         * unicode.h: 
32739         * unicode.c: Warning cleanups
32740
32741 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
32742
32743         * object.h, reflection.h: use the correct type instead of MonoObject.
32744
32745 2002-03-28  Martin Baulig  <martin@gnome.org>
32746
32747         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
32748         (mono_debug_update_symbol_file): Initialize classes if necessary.
32749
32750 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
32751
32752         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
32753         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
32754
32755 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
32756
32757         * assembly.h: fix function prototype.
32758         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
32759         * mono-endian.h: use const cast.
32760
32761 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
32762
32763         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
32764
32765 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
32766
32767         * loader.c: don't assert when a typeref can't be loaded, give
32768         a chance to the runtime to trow an exception instead.
32769         * loader.h: fix warning.
32770
32771 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
32772
32773         * class.c (mono_class_proxy_vtable): added proxy support
32774
32775 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
32776
32777         * icall.c: removed last of PAL calls, added System.Environment
32778         * file-io.h, file-io.c: MonoIO implementation
32779         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
32780
32781 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
32782
32783         * appdomain.c: do not use the byte marker in ldstr table lookup.
32784         * debug-helpers.c: allow two ':' to separate class and method name.
32785         * object.c: allocate arrays bounds with the GC, too.
32786         * verify: add a few more checks.
32787
32788 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
32789
32790         * reflection.c: output also literal strings. Allocate parameter data
32791         with GC_malloc() (thanks, Martin, for catching this!).
32792
32793 2002-03-26  Martin Baulig  <martin@gnome.org>
32794
32795         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
32796         include the `this' offset in the `param_offsets'.
32797
32798 2002-03-25  Martin Baulig  <martin@gnome.org>
32799
32800         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
32801         mono_debug_get_class() function to get the classes. Added new
32802         relocation types for arrays and strings.
32803         (mono_debug_get_class): New static function to search in all
32804         referenced assemblies for a metadata token.
32805
32806         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
32807
32808 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32809
32810         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
32811         hold gc-allocated objects. Make the string heap a stream like the
32812         others. Removed duplicated code when writing stream info.
32813         Added asserts to catch possible buffer overflows. Set the sorted map
32814         for tables that need sorting. Added some documentation.
32815
32816 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
32817
32818         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
32819         for interned strings and vtables.
32820
32821 2002-03-24  Martin Baulig  <martin@gnome.org>
32822
32823         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
32824         it in the array since it was created with g_slist_prepend().
32825
32826 2002-03-24  Martin Baulig  <martin@gnome.org>
32827
32828         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
32829         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
32830         (mono_debug_method_from_token): Renamed to
32831         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
32832         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
32833
32834         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
32835         relocation types.
32836
32837         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
32838
32839 2002-03-24  Martin Baulig  <martin@gnome.org>
32840
32841         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
32842         (mono_debug_method_from_token): New func.
32843
32844         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
32845         New interncall, calls mono_debug_local_type_from_signature().
32846         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
32847         calls mono_debug_method_from_token().
32848
32849 2002-03-23  Martin Baulig  <martin@gnome.org>
32850
32851         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
32852         specifies the number of bytes to be converted, not the array size.
32853         Return the number of chars, not the number of bytes.
32854         (ves_icall_iconv_get_chars): The `byteCount' argument
32855         specifies the number of bytes to be converted, not the array size.
32856
32857 2002-03-23  Martin Baulig  <martin@gnome.org>
32858
32859         * reflection.h (MonoReflectionSigHelper): New type.
32860
32861         * reflection.c (mono_reflection_sighelper_get_signature_local),
32862         (mono_reflection_sighelper_get_signature_local): New functions.
32863
32864         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
32865         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
32866         interncalls.
32867
32868 2002-03-23  Martin Baulig  <martin@gnome.org>
32869
32870         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
32871         is_writeable is set.
32872         (mono_raw_buffer_update): New function to write the modified map
32873         back to disk.
32874
32875         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
32876
32877         * debug-symfile.c (mono_debug_update_symbol_file): Call
32878         mono_raw_buffer_update() when done writing.
32879
32880 2002-03-23  Martin Baulig  <martin@gnome.org>
32881
32882         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
32883
32884         * debug-symfile.c: Added support for arguments and local variables.
32885
32886 2002-03-23  Dick Porter  <dick@ximian.com>
32887
32888         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
32889         protected by ifdefs, hence breaking the w32 build.
32890
32891 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32892
32893         * object.c: implement is_interned() the right way.
32894
32895 2002-03-21  Martin Baulig  <martin@gnome.org>
32896
32897         * debug-symfile.[ch]: New files to handle debugging information
32898         files. There's also support to dynamically update these symbol
32899         files to include machine dependent information.
32900
32901 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
32902
32903         * threads.c (mono_thread_create): new function to create thread
32904         from C
32905
32906 2002-03-20  Martin Baulig  <martin@gnome.org>
32907
32908         * icall.c (ves_icall_InternalInvoke): Create a new object if the
32909         method is a constructor.
32910         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
32911         points to ves_icall_InternalInvoke().
32912
32913 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
32914
32915         * file-io.c: Flush shouldn't throw exceptions.
32916
32917 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
32918
32919         * file-io.c: FileStream flush support; FileSetLength now
32920         restores file pointer.
32921
32922 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
32923
32924         * class.c: set image for pointer classes.
32925
32926 2002/03/19  Nick Drochak <ndrochak@gol.com>
32927
32928         * sysmath.c: Forgot one.
32929
32930 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
32931
32932         * sysmath.c: Avoid redefining existing names.
32933
32934 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
32935
32936         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
32937         handled by runtime as icall rather than dllimport from libm.so
32938         * file-io.c, file-io.h: fixed handle argument type.
32939
32940 2002-03-18  Dick Porter  <dick@ximian.com>
32941
32942         * reflection.c (mono_image_get_type_info): rename interface to
32943         iface, because of "#define interface struct" on windows.
32944
32945 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
32946
32947         * class.c, class.h: rename and export mono_ptr_class_get().
32948         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
32949         * reflection.c, reflection.h, icall.c: better/saner type name
32950         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
32951         method signatures.
32952
32953 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
32954
32955         * class.c (mono_class_init): removed hardcoded GHC_SLOT
32956
32957         * icall.c (ves_icall_InternalInvoke): impl.
32958
32959 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
32960
32961         * reflection.c: output the interface map table, too.
32962
32963 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
32964
32965         * class.c (class_compute_field_layout): separate computation of 
32966         static field layout
32967
32968 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
32969
32970         * icall.c: added System.Buffer support.
32971         * file-io.c: moved file icalls from PAL to FileStream.
32972
32973 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
32974
32975         * icall.c (ves_icall_System_Object_GetHashCode): impl.
32976
32977 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
32978
32979         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
32980
32981 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
32982
32983         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
32984
32985 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
32986
32987         * debug-helpers.{c,h}: moved here from monograph some useful functions
32988         to locate a method by name/signature in a class or image. Included
32989         also a small and flexible IL disassembler.
32990
32991 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
32992
32993         * reflection.c: fixup tokens in methods with small header size, too.
32994
32995 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
32996
32997         * object.c (mono_string_to_utf8): remove assert(!error), instead
32998         print a warning. 
32999
33000 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
33001
33002         * icall.c: update to the new mono_Array_class_get interface.
33003
33004 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33005
33006         * appdomain.c, object.c: Boehm-GC enable.
33007         * icall.c: make get_data_chunk() support split data requests.
33008         Ensure a class is initialized in more cases. Return only the first
33009         property found in GetProperties() or the compiler gets confused. 
33010         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
33011         * reflection.h, reflection.c: add fixup mechanism for field and method
33012         tokens. Initialize assembly->typeref in a single place. Output
33013         properties after events. Support custom attributes for events, too.
33014         Typo fix for paramter custom attrs.
33015
33016 2002-03-07  Martin Baulig  <martin@gnome.org>
33017
33018         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
33019
33020 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
33021
33022         * class.c (mono_array_class_get): fix. for multi. dim. arrays
33023
33024 2002-03-06  Martin Baulig  <martin@gnome.org>
33025
33026         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
33027         non-zero lower bounds. See testcases #F10-#F13.
33028
33029 2002-03-05  Martin Baulig  <martin@gnome.org>
33030
33031         * exception.c (mono_get_exception_argument_out_of_range): New exception.
33032
33033         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
33034         ves_icall_System_Array_GetValue(), only calculate the absolute array position
33035         here.
33036         (ves_icall_System_Array_SetValue): Likewise.
33037         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
33038         as argument and does the actual work. This function is used when copying a
33039         multi-dimensional array.
33040         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
33041         now do all the widening conversions of value types.
33042         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
33043
33044 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33045
33046         * class.c: remove some magic numbers and use the smbolic names,
33047         instead. Added init_events() to load event info at class init time.
33048         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
33049         and mono_metadata_methods_from_event().
33050         * reflection.h, reflection.c: added support for writing out the evnets
33051         related information.
33052
33053 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
33054
33055         * reflection.h, icall.c: use a different method (GetInterfaces)
33056         to gather interface info and add isbyref, isprimitive and
33057         ispointer to the ves_icall_get_type_info() return value.
33058
33059 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
33060
33061         * class.h: stared adding support for events.
33062         * icall.c: split find_members implementation. Added debug icall to get
33063         the address of an object.
33064         * reflection.c: handle TypeBuilders in mono_type_get_object().
33065
33066 2002-03-01  Martin Baulig  <martin@gnome.org>
33067
33068         * icall.c (ves_icall_System_Array_GetLength): This must throw an
33069         ArgumentOutOfRangeException(), not an ArgumentException().
33070         (ves_icall_System_Array_GetLowerBound): Likewise.
33071         (ves_icall_System_Array_GetValue): Improved argument checking.
33072         (ves_icall_System_Array_SetValue): Improved argument checking.
33073
33074 2002-03-01  Martin Baulig  <martin@gnome.org>
33075
33076         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
33077         called with invalid arguments rather than just dying with g_assert().
33078         (ves_icall_System_Array_SetValue): Likewise.
33079         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
33080         raise a NotImplementedException instead.
33081         (ves_icall_System_Array_GetLength): Added argument checking.
33082         (ves_icall_System_Array_GetLowerBound): Added argument checking.
33083
33084 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
33085
33086         * object.h (mono_assert): new macros mono_assert and
33087         mono_assert_not_reached
33088
33089 2002-02-28  Martin Baulig  <martin@gnome.org>
33090
33091         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
33092         and "System::String::IsInterned" to "System::String::_IsInterned".
33093
33094 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
33095
33096         * icall.c: remove hacks for typebuilder. Added icall to create a
33097         modified type from a tybebuilder.
33098         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
33099         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
33100         to create a backing MonoClass for a TypeBuilder.
33101
33102 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33103
33104         * class.c, class.h: more refactoring of class init.
33105         Export mono_class_setup_mono_type() and mono_class_setup_parent().
33106
33107 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
33108
33109         * marshal.c, marshal.h: start of marshaling interface.
33110
33111 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
33112
33113         * icall.c: fix order in assembly qualified name icall.
33114
33115 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
33116
33117         * class.c: do not free str, since we store it in the hash table.
33118         * reflection.h: add label field to MonoILExceptionInfo.
33119         * reflection.c: handle references to more than one assembly. Handle
33120         case when there isn't a module created in the assembly.
33121
33122 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
33123
33124         * class.c: Fix typo. Start refactoring of class init code.
33125
33126 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
33127
33128         * appdomain.c: exit with 1 on error.
33129         * class.c: we already have the name in MonoClassField.
33130         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
33131         MonoStreamHeader instead of an offset of image->raw_metadata.
33132
33133 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
33134
33135         * appdomain.c (mono_init): Be even more descriptive about the error.
33136
33137 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
33138
33139         * appdomain.c: give the user an informative message when corlib can't
33140         be loaded.
33141
33142 2002-02-26  Martin Baulig  <martin@gnome.org>
33143
33144         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
33145         New icall to get the time zone data.
33146
33147 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33148
33149         * reflection.c: set virtual and raw size of section correctly.
33150         * threads.c: transfer domain information to newly created threads.
33151
33152 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
33153
33154         * class.c: when instancing a class in a domain, load the default
33155         vaules for static fields from the constant table. Fix System.Enum to
33156         not be an enum.
33157         * icall.c: implement Object::GetType() internalcall. Implemented
33158         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
33159         Fixed checking of binding flags in find_members().
33160         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
33161         * reflection.c: handle enumerations when writing to the constant
33162         table. Use a different object cache for types.
33163
33164
33165 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
33166
33167         * object.c (mono_object_isinst): fix for arrays
33168
33169         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
33170
33171 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
33172
33173         * object.c: don't use mprotect ()  and fix intern pool hash table
33174         lookup for big endian systems.
33175
33176 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
33177
33178         * icall.c: change type_is_subtype_of () signature.
33179
33180 2002-02-21  Mark Crichton  <crichton@gimp.org>
33181
33182         * rand.c, rand.h: Added random number generator for
33183         System.Security.Cryptography classes.
33184
33185         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
33186
33187         * icall.c: Added System.Security.Cryptography calls.
33188
33189 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
33190
33191         * class.c, icall.c, metadata.c: better support for pointer types.
33192         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
33193         * reflection.c: Add support for getting custom attrs for properties
33194         and simplify some code.
33195
33196 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
33197
33198         * icall.c: change getToken () and add custom attribute GetBlob()helper
33199         method.
33200         * reflection.h: add custom attrs array to the reflection builder structures.
33201         * reflection.c: encode and emit custom attributes for all the relevant
33202         reflection objects. Cache fieldref and methodref tokens. Change
33203         mono_image_create_token() interface to take a MonoDynamicAssembly.
33204         More complete custom attributes decoder. Load custom attributes for
33205         Assembly, Field, Method and Constructor objects, too. Make the
33206         returned array an Attribute[] one, not object[]. Added
33207         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
33208         custom attribute constructor.
33209
33210 2002-02-20  Dick Porter  <dick@ximian.com>
33211
33212         * icall.c:
33213         * rawbuffer.c:
33214         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
33215         problem code out for now).
33216
33217 2002-02-19  Radek Doulik  <rodo@ximian.com>
33218
33219         * object.c (mono_ldstr): use hash table to avoid multiple swapping
33220
33221 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
33222
33223         * icall.c: register the GetCustomAttributes method.
33224         * object.c, object.h: add mono_string_new_len ().
33225         * reflection.h, reflection.c: added mono_runtime_invoke(),
33226         mono_install_runtime_invoke(). Added
33227         mono_reflection_get_custom_attrs () to load custom attributes and
33228         create the attribute objects.
33229
33230 2002-02-19  Dick Porter  <dick@ximian.com>
33231         * threads-dummy-types.c:
33232         * threads-dummy-types.h:
33233         * threads-dummy.c:
33234         * threads-dummy.h:
33235         * threads-pthread-types.c:
33236         * threads-pthread-types.h:
33237         * threads-pthread.c:
33238         * threads-pthread.h:  Deleted obsolete files
33239
33240 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
33241
33242         * class.c (mono_class_vtable): runtime init the class when we
33243         allocate static class data.
33244
33245         * icall.c (ves_icall_System_Array_SetValue): check for null values.
33246
33247         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
33248         and String - but we will need generic marshalling support in the
33249         future. 
33250         (mono_init): set the domain name in a ms compatible way
33251
33252         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
33253         String[].
33254
33255 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
33256
33257         * object.c (mono_array_clone): use alloca() instead of g_malloc  
33258         for sizes
33259
33260         * appdomain.c (mono_domain_unload): impl.
33261
33262 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
33263
33264         * appdomain.c, object.c: fix intern pool implementation.
33265         * class.c: fix alignment code.
33266
33267 2002-02-16  Radek Doulik  <rodo@ximian.com>
33268
33269         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
33270         and s2 > s1, just copy lower bytes to be compatible with little
33271         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
33272         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
33273
33274         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
33275         force big_endian to be 1 for big endian machines 
33276         (ves_icall_iconv_new_decoder): ditto
33277
33278 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
33279
33280         * socket-io.c (convert_sockopt_level_and_name): If the system
33281         doesn't define SOL_IP or SOL_TCP, get them by hand using
33282         getprotobyname() and caching the values (because this could be a
33283         slow operation).
33284         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
33285         Use the appropriate struct when the system does support it. Ie,
33286         not all systems have struct ip_mreqn so use struct ip_mreq when
33287         appropriate.
33288
33289 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
33290
33291         * reflection.c: handle finally clauses.
33292
33293 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
33294
33295         * socket-io.c: use g_snprintf() instead of snprintf.
33296
33297 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
33298
33299         * reflection.c (mono_param_get_objects): Cast second argument to
33300         mono_method_get_param_names to a const char** to silence the
33301         compiler warning.
33302
33303         * appdomain.c (mono_domain_assembly_open): Put parens around the
33304         truth statement in the for-loop.
33305
33306         * unicode.c (iconv_convert): Got rid of a compiler warning about
33307         int i being unused when the system has a new iconv.
33308         (iconv_get_length): Same.
33309
33310         * image.c (load_class_names): Cast the second argument to
33311         g_hash_table_insert() to char* to hush compiler warnings about the
33312         arg being a const.
33313         (mono_image_open): Same here.
33314
33315         * socket-io.c: Don't conditionally include sys/filio.h or
33316         sys/sockio.h here anymore since we now get them from
33317         io-layer/io-layer.h
33318         (inet_pton): If the system doesn't support inet_aton, implement
33319         using inet_addr and also #define INADDR_NONE if it isn't defined
33320         by the system.
33321
33322 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
33323
33324         * metadata.c, metadata.h: added function to get packing and size info
33325         of a typedef.
33326         * reflection.h, reflection.c: handle field RVA data. Save info about
33327         the table layout if needed. Assign typedef indexes to all the types
33328         before dumping the info about them to avoid forward reference problems.
33329
33330 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
33331
33332         * socket-io.c (convert_sockopt_level_and_name): ifdef
33333         SO_ACCEPTCONN because it is not defined on my system (old debian)
33334
33335 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
33336
33337         * opcode.c: use stddef.h to get NULL.
33338
33339 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
33340
33341         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
33342         for FIONBIO, FIONREAD and SIOCATMARK.
33343         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
33344         define INADDR_NONE and besides, inet_addr() is deprecated and
33345         should not be used. Use inet_pton() instead - it also has the
33346         added bonus that it can easily handle IPv6 addresses as well.
33347         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
33348
33349 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
33350
33351         * decimal.c: remove _MSC_VER conditional.
33352
33353 2002-02-13  Dick Porter  <dick@ximian.com>
33354
33355         * socket-io.c: 
33356         * icall.c: Internal calls for Blocking, Select, Shutdown,
33357         GetSocketOption and SetSocketOption
33358
33359 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33360
33361         * assembly.cs: better resolver: use it instead of some kludgy
33362         code.
33363
33364 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
33365
33366         * reflection.c: the best way to speed-up the compiler is to avoid
33367         infinite loops.
33368
33369 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
33370
33371         * class.c (mono_class_vtable): changed the object layout
33372         (obj->vtable->class). 
33373         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
33374
33375 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
33376
33377         * assembly.c: look for assemblies in the assembly dir, too.
33378
33379 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33380
33381         * class.c: fix thinko in mono_class_from_type().
33382
33383 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
33384
33385         * exception.h, exception.c: added TypeLoadException.
33386         * object.h, object.c: added mono_array_clone ().
33387         * icall.c: handle throwOnError in AssemblyGetType().
33388         Added Array.Clone().
33389         * opcode.h, opcode.c: use a single value for the opcode val.
33390         Compile fix for non-gcc compilers.
33391
33392 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
33393
33394         * opcodes.c, opcodes.h: export interesting info about opcodes.
33395
33396 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
33397
33398         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
33399         icalls. 
33400
33401         * class.c (class_compute_field_layout): set element_class for enums
33402         (mono_class_create_from_typedef): set element_class for normal classes
33403
33404         * icall.c (ves_icall_System_Enum_get_value): impl.
33405
33406         * class.c (mono_class_create_from_typedef): do not set valuetype
33407         flag for System.ValueType and System.Enum
33408
33409 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
33410
33411         * unicode.c (iconv_convert): fix big endian problem.
33412
33413 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
33414
33415         * class.c: add asserts if we are ever going to scribble over memory.
33416         * socket-io.c: not all systems have AF_IRDA defined.
33417
33418 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
33419
33420         * class.c (class_compute_field_layout): do not consider static
33421         fields to compute alignment
33422
33423 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
33424
33425         * appdomain.c (mono_appdomain_get): impl.
33426         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
33427
33428 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
33429
33430         * icall.c: ignore "file://" prefix when loading an assembly.
33431
33432 2002-01-23  Dick Porter  <dick@ximian.com>
33433
33434         * socket-io.c:
33435         * icall.c:
33436         * Makefile.am: Added socket support
33437
33438 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
33439
33440         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
33441         code back.  This should return the assemblies that are loaded by
33442         the runtime on behalf of an application domain. 
33443
33444         The current implementation is still broken, it just returns every
33445         assembly loaded, but until we get real applications domain this
33446         will do.
33447
33448 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
33449
33450         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
33451         AppDomain object.
33452
33453 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
33454
33455         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
33456         the mono_class_from_name lookup.
33457         (ves_icall_get_parameter_info): ditto.
33458         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
33459         method.
33460         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
33461
33462 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
33463
33464         * class.c: load also nested classes on class init.
33465         System.ValueType instance methods gets passed boxed
33466         values, unless methods in derived classed that get a pointer to the
33467         data.
33468         * icall.c: use better name parsing code in GetType().
33469         * image.c, image.h: add mono_image_loaded ().
33470         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
33471         * reflection.c, reflection.h: added mono_reflection_parse_type().
33472
33473 2002-01-22  Veronica De Santis <veron78@interfree.it>
33474
33475         * icall.c : Added mapping of internal calls for Manual and Auto reset events
33476         * threads.c : Added the implementation of internal calls for events
33477         * threads.h : Added prototypes of internal calls for events
33478         
33479 2002-01-21  Radek Doulik  <rodo@ximian.com>
33480
33481         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
33482
33483 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
33484
33485         * class.c (mono_class_init): set min_align to 1 (instead of 0)
33486         (mono_class_value_size): use min_align
33487
33488 2002-01-20  Dick Porter  <dick@ximian.com>
33489
33490         * threads.h:
33491         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
33492         so it compiles on w32.
33493
33494 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
33495
33496         * metadata.c (mono_type_stack_size): impl.
33497
33498         * class.c (mono_class_get_field): impl. memberref token
33499
33500 2002-01-16 Veronica De Santis <veron78@@interfree.it>
33501
33502         * icall.h : Added the internal calls mapping for CreateMutex_internal
33503                     and ReleaseMutex_internal.
33504         * threads.h : Added the prototype of mutexes internal calls.
33505         * threads.c : Added the implementations of mutexes internal calls.
33506
33507 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
33508
33509         * metaparse.h: removed unused file.
33510         * reflection.c, reflection.h: added stream_data_align () function 
33511         to align data in streams and keep stream aligned. Add support for
33512         exception support in method headers.
33513
33514 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
33515
33516         * unicode.c: make iconv_convert () return the number of bytess written
33517         in the output buffer.
33518
33519 2002-01-15  Dick Porter  <dick@ximian.com>
33520         * threads.c: Make the runtime's idea of infinite timeouts coincide
33521         with the class library's
33522
33523         Fix a particularly egregious bug in mono_thread_cleanup(). That
33524         code was so utterly bogus it must have been written on a Monday.
33525
33526 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
33527
33528         * reflection.h: add subtypes field to TypeBuilder.
33529         * reflection.c: encode constants for literal fields.
33530         Handle subtypes. Fix user string token (and add a zero byte)
33531         at the end.
33532         
33533 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
33534
33535         * class.c (mono_class_init): bug fix: assign slot numbers for
33536         abstract methods.
33537
33538 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
33539
33540         * reflection.c: don't try to output a code RVA for abstract methods.
33541         Small fixes for method header format. Output parameter info to the
33542         ParamDef table. Save method overriding info to MethodImpl table.
33543         Fix property support. Allow typedef.extends to be a type in the
33544         building assembly.
33545         * verify.c: fix off-by-one error.
33546
33547 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
33548
33549         * class.c: fix mono_class_from_mono_type () for szarray types.
33550         Remove unused cache check in mono_class_from_type_spec().
33551         * icall.c: *type_from_name () functions handle simple arrays and byref.
33552         * reflection.c: handle byref and szarray types. Handle methods without
33553         body (gets P/Invoke compilation working). Handle types and fields in
33554         get_token ().
33555         * reflection.h: add rank to MonoTypeInfo.
33556
33557 2002-01-10  Dick Porter  <dick@ximian.com>
33558
33559         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
33560         internal calls
33561
33562 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
33563
33564         * icall.c: initialize class in type_from_handle ().
33565         Loop also in parent classes for get_method ().
33566         * reflection.c: properly encode class and valuetype types.
33567         Start on encoding TypeBuilder types. Handle fieldrefs.
33568         Use correct length when registering a user string.
33569         Handle ConstructorBuilder and MonoMethod in get_token ().
33570         Make mono_type_get_object () aware of cached types.
33571         * object.c: back out change to mono_string_new ().
33572
33573 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
33574         * object.c: mono_string_new should return a NULL when the string 
33575         passed in is NULL -- not try to deference it.
33576         
33577 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
33578
33579         * icall.c: hack to make IsSubType work for TypeBuilders.
33580         * reflection.c: emit constructors before methods.
33581         Retrieve param names in mono_param_get_objects().
33582
33583 2002/01/05  Nick Drochak  <ndrochak@gol.com>
33584
33585         * Makefile.am: fix list of headers and sources so automake 1.5
33586         doesn't complain. Removed \# at end of list.
33587
33588 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
33589
33590         * reflection.c: get token for a method ref. Set return type of
33591         constructor to void.
33592         * loader.c: debug message.
33593         * class.c: typo fix.
33594
33595 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
33596
33597         * icall.c: fix array init with rank > 1. FindMembers
33598         loops in parent class as well.
33599         * image.c: do not insert nested types in name cache.
33600         * reflection.c: warning fix.
33601         * reflection.h: add override method (for interface impl).
33602
33603 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
33604
33605         * metadata.c: fix customattr decoding.
33606
33607 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
33608
33609         * rawbuffer.cs: Added native Win32 implementation, avoids using
33610         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
33611
33612 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
33613
33614         * class.c: make the low-level routines handle the cache.
33615
33616 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
33617
33618         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
33619
33620 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
33621
33622         * class.c: fix mono_array_element_size() for objects.
33623         * class.h, class.c: add properties to MonoClass and load them
33624         at init time.
33625         * icall.c: check with isinst() when assigning a value to an array
33626         instead of requiring the classes to match exactly.
33627         Implemented icall for System.Type::GetType().
33628         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
33629         enums. Handle bindingflags when looking for methods and fields.
33630         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
33631         and mono_metadata_methods_from_property().
33632         * reflection.h, reflection.c: added structures for propreties,
33633         parameters and enums. Implemented mono_property_get_object() and
33634         mono_param_get_objects().
33635
33636 2001-12-18  Dick Porter  <dick@ximian.com>
33637
33638         * file-io.c: Use mono_string_to_utf16() instead of
33639         mono_string_chars()
33640
33641         * object.c: Added mono_string_to_utf16(), which copies the non
33642         NULL-terminated MonoString into a new double-null-terminated
33643         buffer.
33644
33645 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
33646
33647         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
33648
33649 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
33650
33651         * file-io.c: raise exceptions if handle is invalid.
33652
33653 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
33654
33655         * assembly.c: yet another check for mscorlib.
33656         * class.c, class.h: load nesting info for classes.
33657         * icall.c: many new functions to support the Reflection classes.
33658         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
33659         * reflection.h, reflection.c: mono_image_create_token(),
33660         mono_assembly_get_object(), mono_type_get_object(),
33661         mono_method_get_object(), mono_field_get_object(): methods to return
33662         objects that parallel the C representation of assemblies, types,
33663         methods, fields.
33664
33665 2001-12-11  Dick Porter  <dick@ximian.com>
33666
33667         * icall.c:
33668         * file-io.c: Internal calls for file IO.
33669
33670 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
33671
33672         * tabledefs.h: missing FileAttributes.
33673         * verify.h, verify.c: use is_valid_string () to simplify and check for
33674         valid strings more correctly. Fix warnings and speeling.
33675         Check more tables: Filed, File, ModuleRef, StandAloneSig.
33676         Check code: branches, maxstack, method calls.
33677
33678 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
33679
33680         * object.c (mono_object_allocate): removed static, so that the jit
33681         can allocate value types.
33682
33683         * icall.c (ves_icall_System_DateTime_GetNow): impl.
33684
33685 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33686
33687         * class.c: init enum types right away and register the
33688         token->MonoClass map in mono_class_create_from_typedef ().
33689         * verify.h, verify.c: first cut of the verifier.
33690         * pedump.c: add --verify switch to verify metadata tables.
33691         * tabledefs.h: add some missing enums.
33692
33693 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
33694
33695         * class.c (mono_install_runtime_class_init): impl.
33696         (mono_class_init): renamed mono_class_metadata_init to
33697         mono_class_init, also removed the metadata_inited flag
33698
33699         * object.c (mono_object_isinst): use faster algorithm
33700
33701 2001-11-30  Radek Doulik  <rodo@ximian.com>
33702
33703         * mono-endian.h: reverted last change
33704         added function prototypes
33705
33706         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
33707         add mono-endian.c back
33708
33709         * mono-endian.c: returned back, as Paolo pointed out, it's needed
33710         for unaligned access, I've mistaked it with endianess. I am
33711         sorry.
33712         (mono_read16): fix reverted endianess
33713         (mono_read64): ditto
33714         (mono_read32): ditto
33715
33716 2001-11-30  Dick Porter  <dick@ximian.com>
33717
33718         * exception.c: Implement mono_exception_from_name()
33719
33720 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
33721
33722         * metadata.h, metadata.c: remove params_size and locals_size and their
33723         calculation from the metadata code: they are only usefult to the
33724         interp.
33725
33726 2001-11-29  Radek Doulik  <rodo@ximian.com>
33727
33728         * object.c (mono_ldstr): swap bytes here, it's probably not the
33729         best place, but works for me now, I'll redo it once I know mono
33730         better, also note that I add PROT_WRITE and don't reset back, also
33731         note that it's only affects big endians, so x86 should be OK
33732
33733         * mono-endian.h (read16): use just glib macros for both endians
33734
33735         * mono-endian.c: removed as glib macros are used in in
33736         mono-endian.h so we don't need to care about endianess for read
33737         macros as glib does that for us already
33738
33739 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
33740
33741         * class.h, class.h: take minimum alignment into consideration so
33742         that the fields of a class remain aligned also when in an array.
33743
33744 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33745
33746         * loader.h, loader.c: add mono_method_get_param_names().
33747         * class.c: 0-init class fields.
33748
33749 2001-11-26  Dick Porter  <dick@ximian.com>
33750
33751         * icall.c:
33752         * threads-types.h:
33753         * threads.c: New file that handles System.Threading on all platforms
33754
33755         * object.c: 
33756         * object.h: Remove the synchronisation struct from MonoObject,
33757         replace it with a pointer that gets initialised on demand
33758
33759         * Makefile.am: Replace all the system-specific threading code with
33760         a single file that uses the new wrapper library
33761
33762 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
33763
33764         * class.c, class.h: add mono_install_trampoline() so that the runtime
33765         can register a function to create a trampoline: removes the ugly
33766         requirement that a runtime needed to export arch_create_jit_trampoline.
33767         * object.h, object.c: added mono_install_handler() so that the runtime
33768         can install an handler for exceptions generated in C code (with
33769         mono_raise_exception()). Added C struct for System.Delegate.
33770         * pedump.c: removed arch_create_jit_trampoline.
33771         * reflection.c: some cleanups to allow registering user strings and
33772         later getting a token for methodrefs and fieldrefs before the assembly
33773         is built.
33774         * row-indexes.h: updates and fixes from the new ECMA specs.
33775
33776 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
33777
33778         * class.h, class.c: add enum_basetype field to MonoClass.
33779         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
33780         to get index in the constant table reated to a field, param or
33781         property.
33782         * reflection.h, reflection.c: handle constructors. Set public-key and
33783         version number of the built assembly to 0.
33784         * row-indexes.h: update from new ECMA spec.
33785
33786 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
33787
33788         * class.h, class.c: add a max_interface_id to MonoClass.
33789         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
33790         since it's used to do that. Added mono_type_type_from_obj().
33791         Make GetType() return NULL instead of segfaulting if the type was not
33792         found. Handle simple arrays in assQualifiedName.
33793         * object.h: add a struct to represent an Exception.
33794         * reflection.c: output call convention in method signature.
33795         Add code to support P/Invoke methods and fixed offsets for fields.
33796
33797 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
33798
33799         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
33800         the value.
33801         * icall.c: use mono_array_addr instead of array->vector: fixes the
33802         reflection image writing.
33803         * reflection.c: init call convention byte to 0 in method signature.
33804         Encode the property signature. Don't output property-related methods
33805         twice. Really process the properties for a type (don't cast a field to
33806         a property, my mom always told me that).
33807         Fix 64 bit issues in pointer alignment in a different and more
33808         readable way.
33809
33810 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
33811
33812         * loader.h: Removed type class from MonoDefaults, added monotype
33813
33814         * loader.c: Loaded MonoType, removed loading of Type
33815
33816         * icall.c (my_mono_new_object): Now returns a System.MonoType,
33817         and fills in System.Type._impl with a RuntimeTypeHandle rather
33818         than the actual MonoClass *
33819
33820         (ves_icall_type_from_handle): change from type_class to
33821         monotype_class
33822
33823         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
33824         implemented
33825
33826         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
33827         implemented
33828
33829         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
33830
33831         (ves_icall_System_Reflection_Assembly_GetType): implemented
33832
33833         (ves_icall_System_MonoType_assQualifiedName): implemented
33834
33835         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
33836
33837 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
33838
33839         * assembly.c (mono_assembly_open): Implement a cache for the
33840         assemblies. 
33841
33842         (mono_assembly_close): only destroy the assembly when the last
33843         reference is gone.
33844         
33845 2001-11-09  Dick Porter  <dick@ximian.com>
33846
33847         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
33848
33849 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
33850
33851         * class.c (mono_class_metadata_init): bug fix: compute the right slot
33852
33853 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
33854
33855         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
33856         from Martin Weindel.
33857         * object.h: add mono_string_chars ().
33858
33859 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
33860
33861         * reflection.c (build_compressed_metadata): Eliminates warnings
33862         and uses 64-bit clean code.
33863
33864         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
33865         (mono_type_equal): Change signature to eliminate warnings.
33866
33867 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
33868
33869         * icall.c, loader.c: remove the internalcall array constructors.
33870         Changes to match the new MonoArray structure.
33871         * object.h, object.c: an array object doesn't allocate an extra
33872         vector. Add mono_array_new_full () to create jagged arrays easily.
33873
33874 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
33875
33876         * metadata.h, metadata.c: add mono_metadata_field_info () to
33877         retreive all the info about a field from vairous tables.
33878         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
33879         * class.h, class.c: augment MonoClassField with more info.
33880         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
33881         policy and load a field's RVA if needed.
33882
33883 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
33884
33885         * class.c (mono_class_metadata_init): create a trampoline for all
33886         virtual functions instead of actually compiling them.
33887
33888 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
33889
33890         * class.h, class.c: include name in MonoClassField.
33891         * class.c: fix fundamental type of System.Object and System.String.
33892         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
33893         tokens in ldtoken.
33894         * icall.c: remove internalcalls for the Reflection stuff that is now
33895         done in C# code.
33896         * loader.c: mono_field_from_memberref () implementation.
33897         * mono-endian.c: thinko (s/struct/union/g).
33898         * object.c, object.h: make the mono_string_* prototypes actually use
33899         MonoString instead of MonoObject.
33900         * reflection.c, reflection.h: updates for changes in the reflection
33901         code in corlib: we use C structures that map to the actual C# classes.
33902         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
33903         fat method header if needed and use the info from the ILGenerator for
33904         methods. Handle fields in types. Misc fixes.
33905
33906 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
33907
33908         * class.c (mono_class_metadata_init): bug fix: always allocate
33909         space for static class data
33910
33911 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
33912
33913         * class.c (mono_compute_relative_numbering): use relative
33914         numbering to support fast runtime type checks.
33915
33916 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
33917
33918         * class.c (mono_class_create_from_typeref): added debugging output
33919         to print class name when MonoDummy is returned instead of real class
33920
33921 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
33922
33923         * class.c (mono_class_metadata_init): interface offset table now
33924         contains pointers into the vtable - this is more efficient for the jit
33925
33926 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
33927
33928         * class.c (mono_class_metadata_init): use a temporary vtable (the
33929         old algorithm only worked for the interpreter, but not for the jit)
33930
33931 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
33932
33933         * loader.c (method_from_memberref): use mono_class_get to get the
33934         class of an array instead of using System.Array directly.
33935         (mono_get_method): also add MEMBERREF methods to the method cache
33936         which usefull for arrays.
33937
33938 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
33939
33940         * pedump.c (arch_compile_method): added to compute vtable entry
33941
33942         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
33943         number of interfaces.
33944         
33945         * class.h: merged MonoArrayClass into MonoClass
33946
33947         * class.c (mono_class_create_from_typedef): compute the vtable size and
33948         allocate space to include the vtable inside MonoClass
33949         (mono_class_metadata_init): initialize the vtable
33950
33951 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
33952
33953         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
33954         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
33955         * image.c: endian fixes by Laurent Rioux.
33956         * object.h, object.c: rename MonoStringObject to MonoString and
33957         MonoArrayObject to MonoArray. Change some function names to conform to
33958         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
33959         guint16* as first argument, so don't use char*.
33960         Provide macros to do the interesting things on arrays in a portable way.
33961         * threads-pthread.c: updates for the API changes and #include <sched.h>
33962         (required for sched_yield()).
33963         * icall.c: updates for the API changes above.
33964         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
33965         platforms that need them.
33966
33967 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
33968
33969         * class.c: set the correct type for all the fundamental
33970         type when loading the class.
33971
33972 2001-10-05  Dick Porter  <dick@ximian.com>
33973
33974         * threads-pthread.c (pthread_mutex_timedlock): Simple
33975         compatibility version for C libraries that lack this call.
33976
33977 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
33978
33979         * class.c: MonoTypes stored in MonoClass are stored as
33980         fundamental MonoTypes when the class represents a
33981         fundamental type (System.Int32, ...).
33982         The TypeHandle return by ldtoken is a MonoType*.
33983         * icall.c: ves_icall_get_data_chunk () write out all the
33984         PE/COFF stuff. Implement ves_icall_define_method (),
33985         ves_icall_set_method_body (), ves_icall_type_from_handle ().
33986         * image.c: properly skip unknown streams.
33987         * loader.h, loader.c: add type_class to mono_defaults.
33988         * metadata.c, metadata.h: export compute_size () as
33989         mono_metadata_compute_size () with a better interface.
33990         Typo and C&P fixes.
33991         * pedump.c: don't try to print the entry point RVA if there is no entry point.
33992         * reflection.c, reflection.h: many cleanups, fixes, output method
33993         signatures and headers, typedef and typeref info, compress the metadata
33994         tables, output all the heap streams, cli header etc.
33995         * row-indexes.h: typo fixes.
33996
33997 2001-10-04  Dick Porter  <dick@ximian.com>
33998
33999         * object.h: Add a synchronisation mutex struct to MonoObject
34000
34001         * object.c (mono_new_object): Initialise the object
34002         synchronisation mutexes
34003
34004         * icall.c: System.Threading.Monitor internal calls
34005         
34006         * threads-pthread.h:
34007         * threads-pthread.c: System.Threading.Monitor internal calls
34008
34009         * threads-types.h: New file, includes the system-specific thread
34010         structures
34011         
34012         * threads-pthread-types.h:
34013         * threads-pthread-types.c: New files, handle pthread-specific
34014         synchronisation types
34015
34016         * threads-dummy-types.h: 
34017         * threads-dummy-types.c: New files of dummy support for
34018         thread-specific types
34019
34020         * metadata.c:
34021         * image.c:
34022         * pedump.c: include mono-endian.h not endian.h
34023         
34024         * Makefile.am: More threads files.
34025         Name mono-endian.h not endian.h
34026
34027 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
34028
34029         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
34030         stuff and implement a few more bits.
34031         * icall.c: a field needs to be dereferenced twice. Do not use the same
34032         name for two variables in the same scope.
34033         * image.c, image.h: cleanups.
34034
34035 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
34036
34037         * class.c (mono_class_metadata_init): bug fix: compute the right size
34038
34039 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
34040
34041         * icall.c: implemented some of the Reflection internalcalls.
34042         * image.c, image.h: start writing out the PE/COFF image.
34043         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
34044         that does the reverse than decode_blob_size ().
34045         * object.c: use mono_metadata_encode_value (). Move here
34046         temporary implementation of mono_string_to_utf8 ().
34047         * rawbuffer.c: make malloc_map static.
34048
34049 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34050
34051         * metadata.c: fix type comparison for arrays.
34052         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
34053         Added a couple of new classes to monodefaults.
34054         * icall.c: added a couple of Reflection-related internalcalls.
34055         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
34056         Added a byval_arg MonoType to MonoClass.
34057
34058 2001-09-28  Dick Porter  <dick@ximian.com>
34059
34060         * icall.c:
34061         * threads-pthread.h: 
34062         * threads-pthread.c: Implemented internal calls for
34063         LocalDataStoreSlot operations.  Applied mutexes around all shared
34064         data.  Reworked the thread creation and Start() operations to
34065         avoid a race condition.
34066         
34067         * threads-dummy.h:
34068         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
34069
34070 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
34071
34072         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
34073
34074 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
34075
34076         * class.c, loader.c: warn and return NULL instead of erroring out.
34077         * icall.c: added System.AppDomain::getCurDomain().
34078         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
34079
34080 2001-09-25  Dick Porter  <dick@ximian.com>
34081
34082         * threads-pthread.h:
34083         * threads-pthread.c: Implemented timed thread joining and added
34084         System.Threading.Thread::Join_internal internal call
34085
34086         * icall.c: Added System.Threading.Thread::Join_internal internal call
34087
34088         * threads-dummy.h:
34089         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
34090
34091 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
34092
34093         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
34094         mono_string_intern () to implement the semantics of the ldstr opcode
34095         and the interning of System.Strings.
34096         * icall.c: provide hooks to make String::IsIntern and String::Intern
34097         internalcalls.
34098
34099 2001-09-23  Dick Porter  <dick@ximian.com>
34100
34101         * threads-dummy.c: 
34102         * threads-dummy.h: New files of dummy threading routines
34103
34104         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
34105         support code based on system specifics
34106
34107         Rename PTHREAD_LIBS to THREAD_LIBS
34108         
34109 2001-09-23  Dick Porter  <dick@ximian.com>
34110
34111         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
34112         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
34113         internal calls.
34114         (mono_thread_init): Set up a Thread object instance to return when
34115         the main thread calls Thread.CurrentThread
34116         (mono_thread_cleanup): Wait for all subthreads to exit
34117
34118         * icall.c: New internal calls for System.Threading.Thread::Sleep
34119         (including Schedule) and CurrentThread
34120
34121         * threads.h: New file, to insulate thread-specific stuff from the
34122         rest of the code
34123
34124 2001-09-21  Dick Porter  <dick@ximian.com>
34125
34126         * threads-pthread.h: 
34127         * threads-pthread.c: New file, for handling pthreads-style
34128         threading support.  Start() now starts a new thread and executes
34129         the ThreadStart delegate instance.
34130
34131         * icall.c: Added the internalcall for
34132         System.Threading.Thread::Start_internal
34133
34134         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
34135
34136 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
34137
34138         * loader.c: work around the different signatures for delegates
34139         constructors csc generates in compiled code vs the ones compiled in mscorlib.
34140
34141 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
34142
34143         * class.h, class.c: add mono_class_get_field_from_name ().
34144         * *: Fix C comments and other ANSI C issues.
34145
34146 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
34147
34148         * endian.h, assembly.c: fix some endianness issues.
34149
34150 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
34151
34152         * loader.h, load.c: add delegate_class to mono_defaults.
34153         Handle runtime provided methods in mono_get_method ().
34154
34155 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
34156
34157         * loader.c (mono_get_method): use pinvoke for internal call
34158
34159         * icall.c: use pinvoke for internal call
34160
34161         * loader.c (method_from_memberref): set the method name
34162
34163 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
34164
34165         * metadata.c: help the compiler generate better code for
34166         mono_class_from_mono_type ().
34167
34168 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
34169
34170         * class.c (mono_class_metadata_init): delayed computing of the
34171         class size to mono_class_metadata_init ()
34172
34173 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
34174
34175         * class.c, class.h: add an interfaces member to MonoClass.
34176         * image.c, image.h: add assembly_name field to MonoImage
34177         from the assembly table.
34178         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
34179
34180 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
34181
34182         * class.c: Handle Array in mono_class_from_mono_type ().
34183         * metadata.c, pedump.c: some endian fixes.
34184
34185 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
34186
34187         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
34188         * metadata.c: fix small problem introduced with the latest commit.
34189
34190 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
34191
34192         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
34193         We don't need a MonoMetadata pointer anymore to compare signatures in
34194         mono_metadata_signature_equal (), update callers.
34195         Reduced memory usage an number of allocations for MonoMethodHeader and
34196         MonoMethodSignature.
34197
34198 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
34199
34200         * metadata.c: added compare for szarray.
34201
34202 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
34203
34204         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
34205         and add a couple more types to it and mono_defaults. Give an hint on
34206         classes that need implementing in our corlib and are referenced
34207         in mscorlib.
34208
34209 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
34210
34211         * class.h, class.c: keep track if a class is also an Enum.
34212         * loader.c: Implement a couple more types for use in libffi
34213         marshalling. Gives better diagnostics when failing to dlopen
34214         a library. Set method->klass for P/Invoke methods, too.
34215
34216 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
34217
34218         * class.c, class.h: add a MonoType this_arg to MonoClass that
34219         represents a pointer to an object of the class' type that
34220         can be used by the interpreter and later the type cache.
34221         Add best guess alignment info for valuetype objects.
34222
34223 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
34224
34225         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
34226         into MonoType: one less level of indirection and allocation and
34227         simplifies quite a bit of code. Added cache for MonoTypes that are
34228         used frequently, so that we don't need to allocate them all the time.
34229
34230 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
34231
34232         * class.c (mono_class_create_from_typedef): System.Enum is also a
34233         value type, although it does not derive from System.ValueType
34234         (maybe a bug in the ms compiler?)
34235
34236         * metadata.c (mono_type_size): return the right size for value types
34237
34238         * loader.c (mono_get_method): only initialize method header if not abstract
34239
34240         * class.c (mono_class_from_mono_type): use mono_default values. 
34241
34242 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
34243
34244         * *: use MonoClass pointers instead of <type_tokens>
34245         
34246         * class.h: new flag: metadata_inited.
34247
34248         * class.c (mono_class_metadata_init): impl.
34249         (mono_class_instance_size): impl.
34250         (mono_class_data_size): impl.
34251
34252 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
34253
34254         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
34255         MonoClass now has the name and name_space fields. 
34256         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
34257         mono_get_method () takes and optional MonoClass as argument.
34258         Removed mono_typedef_from_name() and added mono_class_token_from_name()
34259         instead that takes advantage of a map from class names to typedef
34260         tokens in MonoImage.
34261
34262 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
34263
34264         * metadata.c: zero is not a valid alignment boundary.
34265         Merge MONO_TYPE_VOID in default decoding code.
34266
34267 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
34268
34269         * image.h: merged MonoMetadata into MonoImage
34270
34271         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
34272         identify the type of elements.
34273
34274 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
34275
34276         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
34277         * cil-coff.h: split MonoMSDOSHeader and add size info.
34278         * image.c: add some consistency checks.
34279         * metadata.c: fix row size computation: one programmer
34280         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
34281         add explanation for the locator routine.
34282         Fix decoding of size in method header.
34283         
34284 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
34285
34286         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
34287         (g_concat_dir_and_file): Bring g_concat_dir_and_file
34288         function from gnome-libs.  This uses the right path separator
34289         based on the OS, and also works around a bug in some systems where
34290         a double slash is not allowed. 
34291         (default_assembly_name_resolver): Use g_concat_dir_and_file
34292         (mono_assembly_open): ditto.
34293
34294 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
34295
34296         * metadata.c (mono_metadata_signature_equal): impl.
34297
34298         * *: void is now a realy MonoType (instead of using NULL)
34299         
34300         * metadata.c (do_mono_metadata_parse_type): use
34301         mono_metadata_parse_type to parse void value.
34302
34303 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
34304
34305         * metadata.c, metadata.h: in the signature and method header store
34306         only the space required for holding the loca vars and incoming arguments.
34307
34308 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
34309
34310         * metadata.c (do_mono_metadata_parse_type): treat void like any
34311         other type (instead of assigning NULL);
34312
34313 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
34314
34315         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
34316
34317 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
34318
34319         * image.c (do_mono_image_open): added a cache for arrays.
34320
34321 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
34322
34323         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
34324         decode a single column from a row in a metadata table and changes
34325         to take advantage of it in the typedef locator (gives a nice speed up).
34326         Store offset info for function params.
34327
34328 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
34329
34330         * image.h (MONO_IMAGE_IS_CORLIB): removed 
34331
34332 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
34333
34334         * assembly.c: how could mono_assembly_close () had ever worked?
34335         * metadata.c, metadata.h: provide offset info for local vars.
34336         Implement mono_type_size () to take care of alignment as well
34337         as size (it was mono_field_type_size in cli/class.c before).
34338
34339 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
34340
34341         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
34342
34343         * assembly.h (CORLIB_NAME): set to corlib.dll
34344
34345         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
34346
34347 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
34348
34349         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
34350         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
34351         tokentype.h: massive namespace cleanup.
34352
34353 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
34354
34355         * metadata.h, metadata.c: decode exception clauses when parsing method header.
34356
34357 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
34358
34359         * metadata.c (mono_metadata_free_type): added check for type !=
34360         NULL (void) before calling mono_metadata_free_type()
34361
34362 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
34363
34364         * metadata.h, row_indexes.h: added header with enumerations to use
34365         to index in the columns from tables in metadata and to decode coded
34366         tokens: we should start using this instead of embedding magic numbers
34367         all over the code.
34368
34369 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
34370
34371         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
34372         Move metadata_t info from cli_image_info_t to MonoImage, where
34373         it's easily accessible. Changed all the uses accordingly.
34374         Added the method and class caches to MonoImage.
34375         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
34376         and mono_metadata_decode_value () signature to be more consistent
34377         with the other parse functions (and simplify code). Taken advantage
34378         of zero-length array allocation with GCC. Removed reduntant (and
34379         wrong) MonoFieldType struct and use MonoParam instead. Changed
34380         mono_metadata_parse_field_type () to use common code for parsing.
34381         Added mono_metadata_typedef_from_field () and
34382         mono_metadata_typedef_from_method () to lookup a typedef index from a
34383         field or method token.
34384         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
34385
34386 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
34387
34388         * metadata.c (mono_metadata_parse_field_type): Implement. 
34389         (do_mono_metadata_parse_type): Split engine from
34390         mono_metadata_parse_type, so that we can create smaller structures
34391         for things that just have one pointer to the MonoType (look at
34392         the MonoFieldType)
34393
34394 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
34395
34396         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
34397         as Jan Gray found out, it is incorrect. 
34398
34399 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
34400
34401         * assembly.c: Implement asssembly loading.  This loads an image
34402         and loads all the referenced assemblies.  Come to think of it, we
34403         could always do lazy loading of the assemblies. 
34404
34405         * image.c (mono_image_open): Keep loaded images in a hashtable.
34406
34407         * image.h (MonoImage): Add reference count.
34408
34409 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
34410
34411         * assembly.c (mono_assembly_open): Keep track of the file name in
34412         case the assembly has no ASSEMBLY table.
34413
34414         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
34415         from get.c here.
34416
34417 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
34418
34419         * metadata.c, metadata.h: decode local vars in method header
34420         parse function. Change callers accordingly.
34421
34422 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
34423
34424         * metadata.h, cil-coff.h: protect against multiple inclusion.
34425         Added some new structures to hold information decoded from metadata:
34426         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
34427         and relevant decoding/free functions.
34428         * metadata.c: implement decoding functions. Add warning for out of bounds
34429         index in mono_metadata_locate(). Implement mono_get_method () to retreive
34430         all the info about a method signature and invocation. Remove check on
34431         uninitialized local var in parse_mh() and fix memory leak.
34432
34433 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
34434
34435         * metadata.h: More macros.
34436
34437         * tokentype.h: New file.
34438
34439 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
34440
34441         * assembly.c: added a consistency check and initialize
34442         some structures with g_new0().
34443         * metadata.c: fixed a couple more bugs in table size computation
34444         and add other checks for out-of bound access to metadata.
34445
34446 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
34447
34448         * metatada.c: fix bugs computing table sizes. Spew a
34449         warning when index in string heap is out of bounds.
34450
34451 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
34452
34453         * metadata.h: Add a couple of macros to manipulate tokens. 
34454
34455 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
34456
34457         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
34458         cli_section_tables).
34459
34460 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
34461
34462         * metadata.c (mono_metadata_user_string): New function, provides
34463         access to the UserString heap. 
34464
34465 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
34466
34467         * metadata.c: Add inline documentation.
34468
34469 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
34470
34471         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
34472         files. 
34473
34474 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
34475
34476         * typeattr.h: New file, TypeAttribute flags. 
34477
34478 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
34479
34480         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
34481         mono_assembly_ensure_section): Section loading code.
34482         (load_section_tables): Load the sections.
34483
34484         * mono/metadata/metadata.c (mono_metadata_locate_token,
34485         mono_metadata_locate): Functions to locate the information
34486         definition given a token or a table and an index.
34487         (mono_metadata_compute_table_bases): New.
34488         (compute_size): New function to compute the sizes of the various
34489         tables.
34490
34491         * mono/metadata/metadata.h: Finish listing the different index
34492         types. 
34493
34494         * mono/metadata/pedump.c: Improve to dump new information.
34495
34496 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
34497
34498         * mono/metadata/metadata.c: Entered all the tables matching
34499         Beta2. 
34500
34501         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
34502
34503
34504
34505