New test.
[mono.git] / mono / metadata / ChangeLog
1 2010-03-26  Andreas Färber  <andreas.faerber@web.de>
2
3         * null-gc.c (mono_gc_invoke_with_gc_lock): Fix function name.
4
5         Code is contributed under MIT/X11 license.
6
7 Fri Mar 26 11:33:17 CET 2010 Paolo Molaro <lupus@ximian.com>
8
9         * object.c, threads.c, threads-types.h, threads.h: make the
10         managed thread local storage references precisely tracked.
11
12 2010-03-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
13
14         * threadpool.[ch]: reworked the threadpool:
15                 -Threadpool threads use a work-stealing queue. Adding a work
16                 item from a threadpool thread will queue it in the thread
17                 local queue without locking (in most cases).
18                 -epoll events are coalesced before being added to the IO
19                 queue.
20                 -Dynamically change the number of active threads
21                 -Changed the global queue to be more GC friendly
22
23         * class-internals.h: add 2 new performance counters for the number of
24         threads in the threadpool and the IO threadpool.
25
26         * object-internals.h: new field in MonoAsyncResult.
27         * icall-def.h: new internal call for queueing work items.
28
29         * Makefile.am: add 2 new files.
30
31         * appdomain.c: bump up corlib version.
32
33         * mono-wsq.[ch]: an implementation of a work-stealing queue.
34
35         * mono-perfcounters-def.h:
36         * mono-perfcounters.c: added 2 new performance counters.
37
38 2010-03-26  Mark Probst  <mark.probst@gmail.com>
39
40         * sgen-gc.c: More FIXME/TODO updates.
41
42 2010-03-25  Mark Probst  <mark.probst@gmail.com>
43
44         * gc-internal.h, sgen-gc.c, sgen-gc.h, boehm-gc.c, null-gc.c: New
45         function mono_gc_invoke_with_gc_lock() which invokes a function
46         with the guarantee that no collection will occur during its execution.
47
48 2010-03-25  Mark Probst  <mark.probst@gmail.com>
49
50         * sgen-gc.c: Update a few comments.
51
52 2010-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
53
54         * reflection.c: Add support for new v4 type
55         System.Reflection.MonoAssembly that is the concrete version
56         of Assembly which is abstract unver v4.
57
58 2010-03-24  U-anarquia\miguel  <miguel@anarquia>
59
60         * reflection.c (mono_reflection_get_custom_attrs_info): Protect
61         code that uses System.Reflection.Emit in DISABLE_REFLECTION_EMIT.
62
63         Expose a few macros that are needed for SR but not SRE to the
64         world (previous inside the SRE ifdef)
65
66 2010-03-24  Mark Probst  <mark.probst@gmail.com>
67
68         * sgen-gc.c (gc_register_current_thread): We need
69         stack_start_limit as well in the non-attribute pthread case.
70
71 2010-03-23 Rodrigo Kumpera  <rkumpera@novell.com>
72
73         * threads.c: Fix windows build.
74
75 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
76
77         * thread-types.h: Add mono_thread_resume_interruption.
78
79         * threads.c: Add mono_thread_resume_interruption, this
80         function should be called after the last protected handler
81         found at interruption time has finished.
82
83 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
84
85         * threads.c (ves_icall_System_Threading_Thread_ResetAbort):
86         Check MonoInternalThread's ::state instead of ::abort_exc
87         since the later can be lazily created.
88
89         This is specially problematic when running a finally block
90         under AbortRequested state. ResetAbort must work, but the
91         abort_exc object has not been created because interruption
92         has not began.
93
94 2010-03-22  Geoff Norton  <gnorton@novell.com>
95
96         * locales.c: Its possible for CFStringGetCStringPtr
97         to return null and not convert encodings.  Use
98         CFStringGetCString instead.
99
100 Mon Mar 22 18:06:38 CET 2010 Paolo Molaro <lupus@ximian.com>
101
102         * class-internals.h, class.c, object.c: introduce compressed
103         interface bitmaps (for now only under small config): this saves
104         about 600 KB of runtime memory on gmcs bootstraps or monodevelop
105         startups.
106
107 Mon Mar 22 16:03:34 CET 2010 Paolo Molaro <lupus@ximian.com>
108
109         * mono-debug.c: don't try to get the method header, it causes a
110         deadlock and it is not used for anything anymore.
111
112 2010-03-22  Zoltan Varga  <vargaz@gmail.com>
113
114         * loader.c (mono_method_get_marshal_info): Fix the handling of dynamic methods
115         broken by the last change.
116
117 2010-03-21  Andreas Färber  <andreas.faerber@web.de>
118
119         * socket-io.c: Don't depend on AF_SNA, AF_DECnet,
120         SOCK_RDM.
121         
122         Code is contributed under MIT/X11 license.
123
124 2010-03-20  Sanjoy Das <sanjoy@playingwithpointers.com>
125
126         * sgen-gc.c (mono_gc_get_write_barrier): Handle non-aligned
127         nursery.
128
129         Code is contributed under MIT/X11 license.
130
131 2010-03-19  Martin Baulig  <martin@ximian.com>
132
133         * mono-debug.c (MonoDebugWrapperData): Replace `cil_code' with a
134         dummy field, containing an empty string.
135         (mono_debug_add_method): Don't call mono_disasm_code() for wrappers.
136
137
138 Fri Mar 19 17:26:43 CET 2010 Paolo Molaro <lupus@ximian.com>
139
140         * class.c: setup_interface_offsets() refactor to not call
141         mono_class_get_implemented_interfaces () more times than needed and
142         to reduce the runtime memory requirements to be O(num_interfaces)
143         instead of O(max_interface_id).
144
145 2010-03-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
146
147         * mono-mlist.[ch]: add mono_mlist_set_next ().
148
149 2010-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
150
151         * domain-internals.h: Add MonoTryBlockHoleJitInfo struct and
152         associated changes to support holes in the protected range of a
153         try block.
154
155         * domain.c: Add mono_jit_info_get_try_block_hole_table_info, which
156         retrieves the holes table from a given MonoJitInfo.
157
158 Tue Mar 16 13:11:15 CET 2010 Paolo Molaro <lupus@ximian.com>
159
160         * object.h, object-internals.h, object.c, icall.c, gc-internal.h,
161         debug-helpers.c, cominterop.c, process.c, sgen-gc.c, socket-io.c:
162         hide the contents of the MonoString and MonoArray structs from the
163         public API. Change the accessor macros to accessors functions where
164         needed. Adjusted the array API to allow for pointer-sized lengths and
165         starting positions, so 64 bit arrays can be optionally provided in an
166         API compatible way if needed on 64 bit systems.
167
168 Tue Mar 16 10:18:07 CET 2010 Paolo Molaro <lupus@ximian.com>
169
170         * class-internals.h, class.c, loader.c, marshal.c, metadata.c,
171         reflection.c: the MonoMethodNormal struct is now unused, so remove it.
172
173 Mon Mar 15 18:28:00 CET 2010 Paolo Molaro <lupus@ximian.com>
174
175         * class-internals.h: remove the method header from MonoMethod since
176         from now on it will be transient. We have a header pointer for method
177         wrappers, since in that case we need to keep track of it. For this
178         reason, all the Reflection.Emit generated methods use MonoMethodWrapper
179         structs now. The same happens with MonoMethodInflated.
180         * class.c: reset the sre_method flag for inflated method structures:
181         this makes the code that cares look at the header in the MonoMethodInflated
182         structure.
183         * loader.c: lookup the method header in the appropriate field now that
184         it is removed from MonoMethod.
185         * metadata-internals.h: add a flag to the method header to know if it
186         can be freed inside mono_metadata_free_mh ().
187         * method-builder.c: updates after moving the header field from
188         MonoMethod to MonoMethodWrapper.
189         * reflection.c: MonoMethods generated from Reflection.Emit use
190         MonoMethodWrapper structs if they need a method header now (later take
191         advantage of this and remove all the current unsafe uses of method_aux_hash).
192         * metadata.c: make method header parsing not leak when verification
193         fails. Alloc it with g_malloc() and free it in mono_metadata_free_mh().
194         These changes save a few hundred KB of runtime memory in a mcs
195         bootstrap or a monodevelop startup.
196
197 2010-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
198
199         * verify.c: Improve error message.
200
201 2010-03-12  Jb Evain  <jbevain@novell.com>
202
203         * reflection.c (add_exported_type): populate the exported
204         table with the type's nested type.
205
206 2010-03-10  Mark Probst  <mark.probst@gmail.com>
207
208         * sgen-gc.c (STRING_SIZE): Semi-revert r153342.  I'm an idiot who
209         can't read parentheses.
210
211 2010-03-10  Mark Probst  <mark.probst@gmail.com>
212
213         * threads.c (thread_cleanup): Add a guard to dereferencing
214         "thread" to avoid an unlikely race condition.
215
216 2010-03-09  Sebastien Pouliot  <sebastien@ximian.com>
217
218         * assembly.c: Fix crash in moon-unit when aname->culture is NULL
219         instead of an empty string.
220
221 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
222
223         * object-internals.h (_G_BOOLEAN_EXPR): Fix the definition of this to explicitly
224         convert to a boolean, recent gcc versions compile this differently.
225
226 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
227
228        * sgen-gc.c (safe_object_get_size): Avoid a function call so this can really be
229        inlined.
230
231 2010-03-09  Mark Probst  <mark.probst@gmail.com>
232
233         * sgen-gc.c (STRING_SIZE): Off by one.
234
235 2010-03-09  Mark Probst  <mark.probst@gmail.com>
236
237         * sgen-archdep.h: Fix the signal context register access for
238         AMD64.
239
240 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
241
242         * sgen-gray.c: Get rid of the unused 'start' field in GrayQueueSection.
243
244 2010-03-08  Rodrigo Kumpera  <rkumpera@novell.com>
245
246         * verify.c: Store the initial basic block returned by mono_basic_block_split
247         so we can release the whole list and not just the first one.
248
249 Mon Mar 8 17:30:44 CET 2010 Paolo Molaro <lupus@ximian.com>
250
251         * verify.c, debug-helpers.c, profiler.c, loader.c,
252         mono-basic-block.c, mono-debug.c, reflection.c: prepare to make
253         MonoMethodHeader a transient entity.
254
255 2010-03-08  Zoltan Varga  <vargaz@gmail.com>
256
257         * sgen-gc.c (scan_needed_big_objects): Call drain_gray_stack () to avoid
258         uncontrolled growth of the gray stack.
259
260         * sgen-gray.c: Rewrite this so it behaves like a stack, not a queue, so recently
261         added items are removed first, improving cache locality. Avoid freeing queue
262         segments in the fast path, use the list of segments as the free list, truncate
263         it to its max size at the start of collection.
264
265 Mon Mar 8 10:13:52 CET 2010 Paolo Molaro <lupus@ximian.com>
266
267         * metadata-internals.h: more memory savings, both with small config and without.
268
269
270 Sat Mar 6 19:12:12 CET 2010 Paolo Molaro <lupus@ximian.com>
271
272         * appdomain.c, domain-internals.h, domain.c, object.c:
273         make class_vtable_hash into an array to reduce memory usage.
274
275 Sat Mar 6 18:16:35 CET 2010 Paolo Molaro <lupus@ximian.com>
276
277         * mempool.c, class-internals.h, class.c, icall.c, metadata.c,
278         object-internals.h, object.c, reflection.c, threadpool.c:
279         reduce resource usage when the small config is selected.
280         In particular, up to 64K of methods/fields/properties/events
281         are allowed and "other" methods in events are ignored.
282
283 Fri Mar 5 19:05:47 CET 2010 Paolo Molaro <lupus@ximian.com>
284
285         * threads.c: reduce resource usage when compiled for a small config.
286
287 2010-03-05  Mark Probst  <mark.probst@gmail.com>
288
289         * sgen-gc.c: Also collect number of degraded-alloced objects with
290         heavy statistics.
291
292 2010-03-04  Geoff Norton  <gnorton@novell.com>
293
294         * assembly.c: Only support OSX bundling if the bundle is 
295         actually detectable.
296
297 2010-03-04  Geoff Norton  <gnorton@novell.com>
298
299         * loader.c: The marshal specs are freed at the end of the call
300         but it explicitly frees the strings as well as the container,
301         so we need to dup them too to avoid referencing free'd memory.
302
303 2010-03-04  Geoff Norton  <gnorton@novell.com>
304
305         * icall-def.h:
306         * icall.c: Add a new private internal icall to construct
307         an object from its type without running the ctor.
308
309 Thu Mar 4 15:37:09 CET 2010 Paolo Molaro <lupus@ximian.com>
310
311         * profiler.c: allow multiple profiler engines to be loaded
312         at the same time.
313
314 Wed Mar 3 20:19:45 CET 2010 Paolo Molaro <lupus@ximian.com>
315
316         * profiler-private.h, profiler.c, profiler.h, sgen-gc.c: introduce
317         profiler event to track object moves.
318
319 Wed Mar 3 19:20:39 CET 2010 Paolo Molaro <lupus@ximian.com>
320
321         * object.c, profiler.c, profiler.h, string-icalls.c:
322         remove the reduntant MONO_PROFILE_STRING_ALLOC profiler event.
323
324 2010-03-03  Miguel de Icaza  <miguel@novell.com>
325
326         * decimal.c (mono_double2decimal): Add support for reducing the
327         scale of a decimal.  It turns the 0.6000000000000 into 0.6 as
328         expected.
329
330 2010-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
331
332         * icall-def.h:
333         * icall.c: Implement System.MonoType::get_core_clr_security_level icall.
334
335 2010-03-03  Marek Habersack  <mhabersack@novell.com>
336
337         * mono-config.c (mono_config_parse_assembly_bindings): added -
338         parses assembly binding redirections from appdomain's config
339         file.
340
341         * metadata-internals.h: added definition of a new function -
342         mono_config_parse_assembly_bindings - to support parsing assembly
343         binding redirections defined in appdomain's config file.
344
345         * domain-internals.h: added two new fields to _MonoDomain - a list
346         of assembly bindings and a flag to parse the config file only
347         once.
348
349         * assembly.c (assembly_binding_maps_name): empty culture name and
350         NULL culture name are considered equal.
351         (mono_assembly_apply_binding): added support for domain specific
352         assembly binding redirections, read from the appdomain's
353         configuration file. Fixes bug #580185
354
355 Wed Mar 3 11:46:06 CET 2010 Paolo Molaro <lupus@ximian.com>
356
357         * appdomain.c, domain.c, icall.c, image.c, marshal.c, object.c,
358         reflection.c, socket-io.c, threadpool.c, threads.c: removed 1.1/1.0
359         support.
360
361 2010-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
362
363         * reflection.c (mono_image_get_memberref_token): Extract mono_image_add_memberef_row
364         from this function. The new function receive the parent token instead of a type.
365
366         * reflection.c (mono_image_get_methodref_token_for_methodbuilder):
367         * reflection.c (mono_image_get_ctorbuilder_token): Use new function to encode
368         typebuilders. This make it possible to properly encode generic type builders since
369         their unmanaged type don't have generics data while unfinished.
370
371         Fixes #583655.
372
373 2010-03-02  Mark Probst  <mark.probst@gmail.com>
374
375         * sgen-gc.c, sgen-protocol.c, sgen-protocol.h: New facility for
376         writing binary log files (can be enabled by #define'ing
377         BINARY_PROTOCOL) for better debugging of timing-dependent bugs or
378         bugs in longer running programs.
379
380 Mon Mar 1 19:35:32 CET 2010 Paolo Molaro <lupus@ximian.com>
381
382         * metadata.c: added some API documentation.
383
384 2010-03-01  Robert Jordan  <robertj@gmx.net>
385
386         * filewatcher.h: Include glib.h to fix the MSVC build.
387
388 2010-03-01  Zoltan Varga  <vargaz@gmail.com>
389
390         * class-internals.h (MonoClass): Get rid of the reflection_info field, add
391         a GC handle instead. This is a bit slower to access, but avoids burdening the
392         GC with 100s of individual roots.
393
394         * reflection.c (mono_class_get_ref_info):
395         (mono_class_set_ref_info):
396         (mono_class_free_ref_info): New internal helper fuctions.
397
398         * reflection.c appdomain.c icall.c class.c: Use the new helper functions instead
399         of accessing klass->reflection_info directly.
400
401         * sgen-gc.c (alloc_complex_descriptor): Fix the computation of the number of
402         words.
403
404         * gc.c (alloc_handle): Create a GC descriptor for the 'entries' array, free
405         the previous array.
406
407 2010-02-28  Zoltan Varga  <vargaz@gmail.com>
408
409         * marshal.c (get_runtime_invoke_type): Avoid sharing byref with I, as the latter
410         needs an indirection.
411
412 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
413
414         * generic-sharing.c: Removed, moved its contents to mini/mini-generic-sharing.c,
415         so all generic sharing code is in one place.
416
417         * class.c (get_implicit_generic_array_interfaces): Fix the last change so
418         we don't call setup_interface_offsets () for unfinished types.
419
420 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
421
422         * class.c (mono_class_generic_sharing_enabled): Move this to
423         generic-sharing.c.
424
425         * image.c: Add an unload hook which is called before an image is unloaded.
426
427         * generic-sharing.c: Use the unload hook to unregister per-image data, to avoid
428         metadata.c having to depend on generic sharing.
429
430 Fri Feb 26 19:23:18 CET 2010 Paolo Molaro <lupus@ximian.com>
431
432         * class.c: reduce size of ridiculously large cache.
433
434 2010-02-26  Martin Baulig  <martin@ximian.com>
435
436         * mono-debug.h
437         (MONO_DEBUGGER_MINOR_VERSION): Bump to 5.
438
439         * threads.c (mono_thread_internal_reset_abort): New method; resets
440         the abort, but doesn't throw any exception if no abort was requested.
441
442 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
443
444         * class.c (get_implicit_generic_array_interfaces): Call
445         mono_class_setup_interface_offsets () before accessing
446         eclass->interface_offsets_count. This only shows up on platforms without IMT for
447         some reason.
448
449 Thu Feb 25 12:12:44 CET 2010 Paolo Molaro <lupus@ximian.com>
450
451         * environment.c, environment.h, icall.c: make the GetOSVersionString()
452         icall internal.
453
454 Thu Feb 25 11:37:50 CET 2010 Paolo Molaro <lupus@ximian.com>
455
456         * metadata.c, metadata.h: make MONO_TYPE_IS* functional without
457         direct access to the MonoType fields.
458
459 2010-02-25  Zoltan Varga  <vargaz@gmail.com>
460
461         * threads.h: Move some internal functions which were added to this header by
462         mistake to threads-types.h.
463
464         * class.c (mono_class_init): Get rid of mono_setup_vtable_in_class_init.
465
466 Wed Feb 24 17:45:27 CET 2010 Paolo Molaro <lupus@ximian.com>
467
468         * class-internals.h, class.h, object.h: make MonoRemoteClass
469         and mono_remote_class() internal.
470
471 Wed Feb 24 17:05:18 CET 2010 Paolo Molaro <lupus@ximian.com>
472
473         * metadata-internals.h, class-internals.h, metadata.h: make the
474         MonoType guts internal as well.
475
476 Wed Feb 24 16:02:42 CET 2010 Paolo Molaro <lupus@ximian.com>
477
478         * reflection.h: the MonoTypeNameParse guts are internal now.
479         * assembly.c, assembly.h, image.h: the MonoAssemblyName guts
480         are internal now, provide accessors as needed.
481         * metadata.h, metadata-internals.h: the MonoMethodSignature
482         guts are internal now.
483         * Makefile.am: mempool.h is an internal header now.
484         * *.h, *.c: remove glib.h usage from the public headers.
485
486 2010-02-24  Atsushi Enomoto  <atsushi@ximian.com>
487
488         * culture-info-table.h : regenerated.
489
490 2010-02-22  Rodrigo Kumpera  <rkumpera@novell.com>
491
492         * metadata.c: Add mono_method_get_header_summary which returns minimal
493         information about the header of a method. This is the information used
494         by the inline oracle to reject methods.
495
496         This method doesn't decode local variables and doesn't cache it's result,
497         so it should cause a minimal reduction in memory usage.
498
499         * metadata-internals.h: Add MonoMethodHeaderSummary structure and
500         mono_method_get_header_summary.
501
502 2010-02-22  Jeffrey Stedfast  <fejj@novell.com>
503
504         * threads.c (mono_thread_exit): Make sure that the main thread is
505         non-null before dereferencing it.
506
507 2010-02-21  Geoff Norton  <gnorton@novell.com>
508
509         * Makefile.am: Add CoreFoundation linkage on darwin to properly get the current
510         locale.
511         * locaes.c: When running on darwin, try to get the local from CoreFoundation 
512         before falling back to the posix lookup.
513
514 2010-02-19  Zoltan Varga  <vargaz@gmail.com>
515
516         * threads.c (mono_thread_suspend_all_other_threads): Ignore threads which have
517         the DONT_MANAGE flag set.
518
519 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
520
521         * domain.c: Remove old v1 version strings. Let the runtime
522         default to 2.0 instead of failing because it can't find a
523         working 1.0 instalation.
524
525 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
526
527         * domain.c: Add v4 RC version string.
528
529 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
530
531         * mono-basic-block.c (mono_opcode_value_and_size): Use pointer variant
532         of overflow checking function.
533
534 2010-02-18  Rodrigo Kumpera  <rkumpera@novell.com>
535
536         * reflection.c (mono_reflection_method_on_tb_inst_get_handle): Handle non
537         generic methods.
538
539         * reflection.c (mono_reflection_get_custom_attrs_info): Handle compiler context
540         cases for ParameterInfo.
541
542         Fixes #579493.
543
544 2010-02-18  Zoltan Varga  <vargaz@gmail.com>
545
546         * class.c (mono_class_get_cctor): Fix support for dynamic classes, which doesn't
547         have has_cctor set. Fixes #575946.
548
549 2010-02-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
550
551         * appdomain.c: display a warning if the parsing the config file
552         produces any error.
553         Skip the BOM in UTF-8 files.
554         Copy the AppDomainSetup before setting the privateBinPath so that the
555         correct configuration file is read.
556
557 2010-02-15  Zoltan Varga  <vargaz@gmail.com>
558
559         * object.c: Instead of using one vtable trampoline, allow the JIT to use one
560         vtable trampoline per vtable slot index. Not used yet.
561
562 2010-02-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
563
564         * icall-def.h:
565         * icall.c: add internal call that returns the system page size.
566
567 2010-02-13  Zoltan Varga  <vargaz@gmail.com>
568
569         * debug-helpers.c (mono_method_desc_search_in_image): Handle short names like
570         'int' for system classes.
571
572 Fri Feb 12 18:36:02 CET 2010 Paolo Molaro <lupus@ximian.com>
573
574         * icall.c, icall-def.h: new icall to check for sufficient
575         stack space.
576
577 2010-02-12  Mark Probst  <mark.probst@gmail.com>
578
579         * reflection.c (ensure_complete_type): Check that reflection_info
580         is set, too.  Fixes crash of corlib testsuite with -O=-all.
581
582 2010-02-11  Rodrigo Kumpera  <rkumpera@novell.com>
583
584         * attrdefs.h:
585         * tabledefs.h: Add NoOptimization flag.
586
587 2010-02-10  Mark Probst  <mark.probst@gmail.com>
588
589         * sgen-gc.c: Don't consider it a missing remset if the target
590         object is pinned - we might have done the store but not added the
591         remset yet.
592
593 2010-02-10  Mark Probst  <mark.probst@gmail.com>
594
595         * sgen-gc.c: When checking for missing remsets, don't assert on
596         the first one, but print them all and then assert.
597
598 2010-02-10  Mark Probst  <mark.probst@gmail.com>
599
600         * sgen-gc.c (find_in_remset_loc): Handle the small bitmap case.
601
602 2010-02-09  Miguel de Icaza  <miguel@novell.com>
603
604         * console-unix.c: On OSX Control-Y is assigned to
605         VDSUSP (non-Posix), the
606         suspend-program-next-time-it-tries-to-read-input command (this is
607         different than C-z, which suspends immediately).
608
609         Do the same thing that bash does and ignore this setting,
610         making our repl/getline support pasting.
611
612 2010-02-10  Mark Probst  <mark.probst@gmail.com>
613
614         * sgen-gc.c: Simple plausibility check for scan_starts.
615
616 2010-02-10  Mark Probst  <mark.probst@gmail.com>
617
618         * sgen-gc.c: Round up when calculating the number of scan starts.
619
620 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
621
622         * reflection.c: Export mono_get_object_from_blob.
623
624         * object-internals.h: Ditto.
625
626         * icall.c: New icall property_info_get_default_value to get the default
627         value of a property. Since using this is not common, no caching is done.
628
629         * icall-def.h: Add new icall.
630
631 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
632
633         * class.c: Add mono_class_get_property_default_value.
634
635         * class-internal.h: Export mono_class_get_property_default_value.
636
637 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
638
639         * reflection.c (mono_image_get_property_info): Encode the default value of a property.
640
641 Wed Feb 10 14:48:45 CET 2010 Paolo Molaro <lupus@ximian.com>
642
643         * sgen-gc.c: introduced critical regions to allow some lockless
644         operations and increase scalability.
645
646 2010-02-10  Geoff Norton  <gnorton@novell.com>
647
648         * reflection.c: Support building with DISABLE_REFLECTION
649
650 2010-02-09 Gonzalo Paniagua Javier <gonzalo@novell.com>
651
652         * threadpool.c: Fixes for SetMinThreads and SetMaxThreads.
653         Closes bug #566057.
654
655         * exception.c: fix typo in comment.
656
657 2010-02-09  Rodrigo Kumpera  <rkumpera@novell.com>
658
659         * icall.c (param_info_get_type_modifiers): Handle the case when the member object is a
660         property. This happens which instances returned by PropertyInfo::GetIndexParameters ().
661
662         * reflection.c (mono_reflection_get_custom_attrs_info): Ditto.
663
664         * object-internals.h: Export mono_class_is_reflection_method_or_constructor as part of
665         the internal API.
666
667         Fixes #574434.
668
669 2010-02-09  Mark Probst  <mark.probst@gmail.com>
670
671         * threads.c: Removed two assertions that were too strict.  Added a
672         clarifying comment.  Fixes #577090.
673
674 2010-02-08  Zoltan Varga  <vargaz@gmail.com>
675
676         * domain.c (mono_jit_info_table_find): Avoid looking in the root domain, since
677         the caller has no way of knowing the domain which owns the returned MonoJitInfo.
678
679         * appdomain.c (create_exceptions): Call mono_thread_push/popappdomain_ref ().
680
681         * verify.c (mono_type_get_stack_name): Fix a warning.
682
683 2010-02-07  Zoltan Varga  <vargaz@gmail.com>
684
685         * marshal.c (mono_marshal_get_wrapper_info): Rename from
686         mono_marshal_wrapper_info_from_wrapper.
687
688         * marshal.c (mono_marshal_set_wrapper_info): Rename from
689         mono_marshal_method_set_wrapper_data, and export.
690
691         * boehm-gc.c sgen-gc.c null-gc.c: Get rid of mono_gc_get_allocator_type, store
692         the allocator type in a AllocatorWrapperInfo structure instead, which is accesible
693         by calling mono_marshal_get_wrapper_info ().
694
695         * sgen-gc.c (mono_gc_get_managed_allocator): Add a specialized allocator for
696         small objects which does no size checks.
697
698 2010-02-05  Rodrigo Kumpera  <rkumpera@novell.com>
699
700         * icall-def.h: Rename get_MetadataToken to GetMetadataToken.
701
702 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
703
704         * verify.c (mono_method_verify): Use the new basic block formation pass
705         to avoid verifying dead basic blocks. This is the same behavior as the
706         runtime MS verifier.
707
708 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
709
710         * mono-basic-block.c:
711         * mono-basic-block.h: New implementation of a basic block formation pass.
712         The formation pass does static liveness analysis as well to detect dead
713         basic blocks.
714
715 2010-02-04  Zoltan Varga  <vargaz@gmail.com>
716
717         * marshal.c (mono_marshal_get_native_wrapper): Emit a null check for the
718         'this' argument in icalls.
719
720 2010-02-02  Zoltan Varga  <vargaz@gmail.com>
721
722         * reflection.c (resolve_object): Handle MonoArrayMethod. Fixes #575955.
723
724 2010-02-01  Mark Probst  <mark.probst@gmail.com>
725
726         * object.c, domain.c: When using SGen, we must register
727         vtable->type as a root if it's not a MonoType, because then it
728         wasn't pin-alloced.
729
730 2010-02-01  Mark Probst  <mark.probst@gmail.com>
731
732         * sgen-gc.c: Reset to_space_bumper to to_space_section->next_data
733         at the start of nursery collections, because we might have had
734         degraded allocations which changed next_data.
735
736 2010-01-30  Zoltan Varga  <vargaz@gmail.com>
737
738         * marshal.c (mono_marshal_get_managed_wrapper): Avoid constructing the
739         custom attr so this function works in cross-compiling mode.
740
741 2010-01-29  Zoltan Varga  <vargaz@gmail.com>
742
743         * class.c (make_generic_param_class): Initialize interface offsets since we
744         set klass->inited. Fixes #574819.
745
746 2010-01-28  Zoltan Varga  <vargaz@gmail.com>
747
748         * domain.c (mono_domain_free): Send the END_UNLOAD profiler event before
749         calling the JIT domain cleanup hook.
750
751 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
752
753         * pedump.c (main): Properly set the verifier mode when running the metadata
754         verifier.
755
756 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
757
758         * verify.c (verify_class_for_overlapping_reference_fields): Properly verify
759         overlapping fields now that we're called before has_references is set.
760
761         * pedump.c (dump_verify_info): Clear any loader error before verifying another
762         method. Otherwise all sort of weird stuff happens.
763
764 2010-01-27  Zoltan Varga  <vargaz@gmail.com>
765
766         * object.c (mono_field_get_value_object): Handle nullable types correctly.
767         Fixes #572874.
768
769 2010-01-25  Zoltan Varga  <vargaz@gmail.com>
770
771         * icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
772         Fixes #573322.
773
774 2010-01-23  Mark Probst  <mark.probst@gmail.com>
775
776         * sgen-pinning.c (evacuate_pin_staging_area): Don't assume
777         pin_staging_area_index is greater than 0.
778
779 2010-01-22 Miguel de Icaza (miguel@novell.com)
780
781         * loader.c: Since we do nothing with the error returned, pass NULL
782         to ignore the error.
783
784 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
785
786         * reflection.c (typebuilder_setup_fields): Pretend field setup already
787         happened before starting to encode the actual fields. This avoid ciclic
788         dependencies and eventual crashes.
789
790         Fixes #572660.
791
792 2010-01-21  Mark Probst  <mark.probst@gmail.com>
793
794         * sgen-gc.c, gc-internal.h, object.c: Make string allocation
795         atomic and remove the half-constructed hack in SGen.
796
797 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
798
799         * metadata-verify.c (parse_generic_inst): Fail a type signature if it 
800         has a recursive reference to itself.
801
802         Fixes #571863.
803
804 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
805
806         * loader.c (mono_method_signature): Fix error message.
807
808 2010-01-21  Mark Probst  <mark.probst@gmail.com>
809
810         * sgen-gc.c: Reuse to-space sections between nursery collections.
811
812 2010-01-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
813
814         * icall.c: don't raise AppDomain.TypeResolve when the type is loaded
815         from the current assembly or mscorlib. Fixes bug #322957.
816
817 2010-01-20  Zoltan Varga  <vargaz@gmail.com>
818
819         * marshal.c: Calculate the target class of the delegete invoke wrappers using
820         get_wrapper_target_class.
821
822 2010-01-19  Mark Probst  <mark.probst@gmail.com>
823
824         * sgen-gc.c: Fix warnings.
825
826 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
827
828         * verify.c (store_local): Better error message.
829
830 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
831
832         * object.c (mono_object_get_virtual_method): Handle generic interfaces with variant
833         arguments.
834
835 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
836
837         * icall.c (ves_icall_Remoting_RemotingServices_GetVirtualMethod): This
838         function is generics variance aware.
839
840 2010-01-19  Sebastien Pouliot  <sebastien@ximian.com>
841
842         * security-core-clr.c (mono_security_core_clr_can_access_internals):
843         Handle the case where 'basedir' can be NULL (e.g. SRE assemblies)
844
845 2010-01-19  Sylvain Dupont <duposyl@gmail.com>
846
847         * cominterop.c marshal.c: Added support for marshalling in, in/byref,
848           in/out, in/out/byref parameters of type SAFEARRAY[VARIANT].
849
850         Code is contributed under MIT/X11 license.
851
852 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
853
854         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Handle inflated generic methods
855         on a GTD.
856
857 2010-01-19  Zoltan Varga  <vargaz@gmail.com>
858
859         * marshal.c (mono_marshal_wrapper_info_from_wrapper): New helper function to
860         return a point to a wrapper specific info structure describing the wrapper.
861         (mono_marshal_get_array_address): Store the rank+elem_size in the wrapper info.
862  
863 2010-01-18  Mark Probst  <mark.probst@gmail.com>
864  
865         * sgen-gc.c: Make minor collection section allowance adaptive,
866         depending on the amount of memory reclaimed in the last major
867         collection.  If more memory was reclaimed (i.e. more garbage
868         produced), do the next collection earlier.
869
870 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
871
872         * metadata-verify.c (parse_type): Fail a type signature if it has a recursive reference
873         to itself.
874
875         * metadata-verify.c (mono_verifier_verify_typespec_signature): Change signature to take
876         the token as parameter.
877
878         * verify-internals.h: Ditto.
879
880         * metadata.c (mono_type_create_from_typespec): Pass token to verifier.
881
882         Fixes #571460.
883
884 2010-01-18  Mark Probst  <mark.probst@gmail.com>
885
886         * sgen-gc.c: Make store_remset_buffer_index long.
887
888 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
889
890         * class.c (mono_class_from_typeref): Fail loading of self-referencing typeref tokens.
891
892         Fixes #569579.
893
894 2010-01-18  Zoltan Varga  <vargaz@gmail.com>
895
896         * sgen-gc.c (mono_gc_base_init): Add 'conservative_stack_mark' option to turn
897         off precise marking if it is available.
898         (mono_gc_get_bitmap_for_descr): Fix the handling of run length descriptors.
899
900 2010-01-17  Zoltan Varga  <vargaz@gmail.com>
901
902         * sgen-gc.c (mono_gc_conservatively_scan_area): Resurrect this.
903
904         * sgen-pinning.c (evacuate_pin_staging_area): Don't assert if there are no
905         pinned objects.
906
907         * sgen-gc.c (create_allocator): Add the missing n > MONO_ARRAY_MAX_INDEX check
908         to the array allocator.
909
910 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
911
912         * generic-sharing.c (instantiate_other_info): Don't create ftnptr's from the
913         result of mono_compile_method (), it already includes an ftnptr.
914
915 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
916
917         * metadata.c (get_image_set): Remove an assert which can happen in normal use.
918
919 2010-01-15  Zoltan Varga  <vargaz@gmail.com>
920
921         * metadata.c (mono_metadata_str_hash): New helper function to compute a stable
922         hash value which doesn't depend on glib/eglib versions.
923         (mono_metadata_type_hash): Use it.
924
925         * object.c (mono_method_get_imt_slot): Ditto.
926
927 2010-01-14  Rodrigo Kumpera  <rkumpera@novell.com>
928
929         * class.c (mono_type_has_exceptions): Check the generic instance. It can fail
930         independently of the GTD.
931
932         * class.c (mono_class_setup_fields): Fail if field has negative offset.
933
934         * class.c (mono_class_setup_fields): Fail if valuetype has zero size. Add sizeof(MonoObject)
935         to the upper limit since instance_size includes this amount.
936
937         * class.c (mono_class_layout_fields): Check if the types of the static fields have failed.
938
939         Fixes #569544.
940
941 2010-01-14  Zoltan Varga  <vargaz@gmail.com>
942
943         * object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
944         with static methods.
945
946         * object.c (build_imt_slots): Avoid asserting when static methods are
947         encountered in an interface.
948
949 2010-01-13  Mark Probst  <mark.probst@gmail.com>
950
951         * sgen-gc.c (to_space_expand): Fix assertion.
952
953 Wed Jan 13 15:42:28 CET 2010 Paolo Molaro <lupus@ximian.com>
954
955         * string-icalls.c: missing declaration fixes.
956         * sgen-gc.c: portability fixes.
957
958 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
959
960         * class.c (mono_class_get_implemented_interfaces): Now take a MonoError argument.
961
962         * class.c:
963         * cominterop.c:
964         * icall.c:
965         * object.c: 
966         * class-internals.h: Adjust for new signature of mono_class_get_implemented_interfaces.
967
968 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
969
970         * class.c (mono_class_setup_interfaces): Now take a MonoError argument and
971         it can fail loading the type.
972
973         * class.c: Add mono_class_inflate_generic_class_checked.
974
975         * class.c:
976         * verify.c:
977         * class-internals.h: Adjust for new signature of mono_class_setup_interfaces.
978
979 2010-01-11  Zoltan Varga  <vargaz@gmail.com>
980
981         * loader.c (mono_method_signature_checked): New internal function taking an
982         MonoError argument.
983
984         * socket-io.c (AI_ADDRCONFIG): Applied patch from John Lightsey (jd@cpanel.net).
985         Fixes build on rh 7.3.
986
987 2010-01-10  Aaron Bockover  <abockover@novell.com>
988
989         * assembly.c (mono_set_rootdir): Support finding the mono paths on OS X
990         at runtime in the same way as on Windows, which yields a relocatable
991         Mono. Uses dyld's _NSGetExecutablePath and realpath to resolve the path
992         of the running mono process.
993
994         On TARGET_ARM, fallback () will always be executed.
995
996 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
997
998         * icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.
999
1000 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1001
1002         * class.c (mono_class_is_assignable_from_slow): Support variant
1003         generic delegates.
1004
1005         * class.c (mono_class_implement_interface_slow): Support types with
1006         variant generic arguments.
1007
1008 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1009
1010         * verify.c: Remove some code duplication.
1011
1012 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1013
1014         * object.c: Update docs.
1015
1016 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1017
1018         * object.c (add_imt_builder_entry): Improve DEBUG_IMT spew.
1019
1020         * object.c (build_imt_slots): Interfaces with variant generic arguments use the
1021         fallback trampoline as well.
1022
1023         * class.c (mono_class_interface_offset_with_variance): Add new non_exact_match
1024         out argument that is set to TRUE if the match was direct. 
1025
1026         * class.c (mono_class_is_assignable_from): Delegates require variance testing as well.
1027
1028         * class-internal.h: Update prototype of mono_class_interface_offset_with_variance.
1029
1030 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1031
1032         * class.c: Add mono_class_interface_offset_with_variance function that does same
1033         as mono_class_interface_offset but takes variance into account.
1034
1035         * class-internal.h: Export mono_class_interface_offset_with_variance.
1036
1037         * object.c: Fix and improve DEBUG_IMT. Added an assert for IMT thunk building.
1038
1039 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1040
1041         * object.c:
1042         * icall.c:
1043         * class.c: Add some FIXME for due to variant generic arguments.
1044
1045         object.c (mono_object_isinst_mbyref): Interfaces with variant generic arguments
1046         can't use the simple bitfield check, so call mono_class_is_assignable_from if
1047         the bitfield check fails.
1048
1049 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1050
1051         * class.c (mono_class_is_assignable_from): Rework the generics variance code
1052         to be easier to read and fix bugs in the case a non generic type implements a variant
1053         interface.
1054
1055         * class.c (mono_class_has_variant_generic_params): Make non static.
1056
1057         * class-internals.h: Export mono_class_has_variant_generic_params as part of
1058         the private API.
1059
1060 2010-01-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1061
1062         * assembly.c: fix MONO_PATH debug output.
1063
1064 2010-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1065
1066         * culture-info-table.h : regenerated.
1067
1068 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1069
1070         * verify.c (mono_verifier_verify_class): Properly check for broken parent. Ignore
1071         types that are meant to not have a parent.
1072
1073 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1074
1075         * marshal.c (mono_marshal_get_runtime_invoke): Make a copy of the signature
1076         from the image mempool, so it is not leaked.
1077
1078 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1079
1080         * metadata-internals.h (_MonoImage): Remove unused generic_class_cache field.
1081
1082 2010-01-04  Sebastien Pouliot  <sebastien@ximian.com>
1083
1084         * verify.c (verify_valuetype_layout_with_target): Fix case
1085         that can lead to infinite recursion. Fix bug #567861
1086
1087 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1088
1089         * pedump.c: Run code verifier even if image verification fails
1090         due to a failed type we. This allows more errors to be shown.
1091
1092 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1093
1094         * class.c (count_virtual_methods): Remove the assert and now
1095         fail properly.
1096         
1097         * class.c (setup_interface_offsets): This can fail now.
1098
1099         * class.c (mono_class_setup_vtable_general): Check for parent vtable
1100         errors. Check setup_interface_offsets errors.
1101
1102         * class.c (setup_interface_offsets): Simplify the return error logic
1103         and remove class_init_ok.
1104
1105         Fixes #560327.
1106
1107 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1108
1109         * class.c (mono_class_init): Do class verification at the beginning. Add
1110         some asserts to avoid tripping into invalid memory.
1111
1112         * object.c (compute_class_bitmap): Replace a g_assert_not_reached with a
1113         g_error and a decent message.
1114
1115         * verify.c (mono_verifier_verify_class): Verify for invalid super type.
1116
1117         Fixes #567548.
1118
1119 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1120
1121         * mempool-internals.h (g_list_prepend_mempool): Define this and related functions
1122         as inline functions instead of defining them in mempool.c.
1123
1124         * metadata-internals.h (MonoImageSet): New structure representing a set of
1125         MonoImages, which own a collection of generic instances.
1126
1127         * metadata.c: Get rid of the global generic caches, instead assign each generic
1128         instance to the image set which consists of all the images referenced by the
1129         instance. This greatly speeds up mono_metadata_clean_for_image (), and allows
1130         the memory used by generic instances to be allocated from a per image-set mempool
1131         later.
1132
1133 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1134
1135         * marshal.c (mono_marshal_get_runtime_invoke): Fix a memory leak.
1136
1137 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1138
1139         * appdomain.c (zero_static_data): Fix a warning.
1140
1141         * locales.c (construct_culture_from_specific_name): Applied patch from
1142         José Antonio Sánchez Lázaro <jasl@darcysoft.es>. Fix a crash if a culture was
1143         not found. Fixes #567900.
1144
1145 2009-12-31  Sebastien Pouliot  <sebastien@ximian.com>
1146
1147         * loader.c (mono_method_get_signature_full): Remove two asserts.
1148         Return NULL instead so that the verifier can handle both cases 
1149         gracefully.
1150
1151 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1152
1153         * class.c (mono_class_setup_methods): Use checked version of mono_class_inflate_generic_method_full
1154         so we can properly fail types instead of crashing.
1155
1156         Fixes #567676.
1157
1158 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1159
1160         * reflection.c (reflection_methodbuilder_to_mono_method): Assert in case of a broken
1161         generic method.
1162
1163 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1164
1165         * marshal.c (mono_mb_emit_restore_result): Properly handle generic enums.
1166
1167 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1168
1169         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait): Don't close the
1170         wait handle if the wait is interrupted, since it is still in mon->wait_list, and
1171         we can't remove it from it since we don't hold the lock.
1172         (mon_new): Free the orphaned events here when a mon structure is added to the
1173         freelist. Fixes #561239. Thanks to Mike Rieker <wmrieker@nii.net> for tracking
1174         this down.
1175
1176 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1177
1178         * verify.c (init_stack_with_value_at_exception_boundary): Do stack overflow checking here
1179         as max stack might be zero.
1180
1181         Fixes #562320.
1182
1183 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1184
1185         Rework all uses of mono_class_setup_methods to accept that it can fail now.
1186
1187         * class.c (mono_class_setup_methods): This function now can fail the class. Do so for generic
1188         instances if the GTD did.
1189
1190         * class.c (mono_class_setup_properties): Ditto.
1191
1192         * class.c (mono_class_setup_events): Ditto.
1193
1194         * class.c (mono_class_setup_vtable): Fail early if the type is already broken.
1195
1196         * class.c (mono_class_setup_vtable_general): Add a few more missing broken type checks. Sanitize
1197         error setting.
1198
1199         * class.c (mono_class_init): Fail if GTD did.
1200
1201         * cominterop.c:
1202         * generic-sharing.c:
1203         * icall.c:
1204         * loader.c:
1205         * object.c:
1206         * verify.c: Properly handle failure of mono_class_setup_methods.
1207
1208 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1209
1210         * class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
1211         mono_class_inflate_generic_method_full internal.
1212
1213         * class.c (inflate_generic_context): Now takes a MonoError argument.
1214
1215         * class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
1216         errors.
1217
1218 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1219
1220         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
1221         they cannot be patched. Partly fixes #564408.
1222
1223 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1224
1225         * metadata-internals.h, reflection.c: Use the
1226         MonoDynamicImage.handleref hash table only with unmanaged keys,
1227         and add a managed hash table handleref_managed for managed keys.
1228
1229 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1230
1231         * sgen-gc.c: Unset to-space bumper between collections.  It might
1232         become invalid due to degraded allocations.
1233
1234 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
1235
1236         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
1237         with the one from the original method.
1238
1239         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
1240         compatibility.
1241
1242         * verify-internals.h: Add new function to the internal API.
1243
1244 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
1245
1246         * culture-info-tables.h: regenerated it to include the Georgian culture.
1247
1248 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1249
1250         * sgen-gc.c: Include mono/utils/memcheck.h.
1251
1252         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
1253         instead of the current domain, since the two might not match if this is called
1254         from the debugger.
1255
1256         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
1257         domain which created this assembly.
1258
1259 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1260
1261         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
1262
1263 2009-12-17  Mark Probst  <mark.probst@gmail.com>
1264
1265         * sgen-gc.c: Managed implementation of the specialized generic
1266         store write barrier.
1267
1268 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
1269
1270         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
1271         A private virtual newslot method is used to implement an interface method without exposing
1272         it to users. When querying for public instance methods, such method would hide a public one
1273         on a parent type.
1274
1275         Fixes #564379.
1276
1277 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
1278
1279         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
1280         conventions.
1281
1282 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1283
1284         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
1285
1286 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1287
1288         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
1289         as they are no longer used.
1290         
1291          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
1292
1293         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
1294
1295 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1296
1297         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
1298         if the owner class has not been finished before returning reflection_info.      
1299
1300         Fixes #565127.
1301
1302 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
1303
1304         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
1305         param doesn't have custom attributes. Fixes #565117.
1306
1307         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
1308         #565120.
1309
1310 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1311
1312         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
1313
1314 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1315
1316         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
1317         same amount done by a core-clr enabled runtime.
1318
1319 2009-12-15  Marek Habersack  <mhabersack@novell.com>
1320
1321         * appdomain.c (mono_make_shadow_copy): make sure access mode of
1322         the target files is reset to writable by owner and readable by
1323         everyone else to prevent problems when updating shadow copies of
1324         files whose source is read-only. Fixes bug #556884
1325
1326 2009-12-15  Mark Probst  <mark.probst@gmail.com>
1327
1328         * class.c (mono_generic_class_get_class): Allocate the generic
1329         class via malloc again, so that it can be freed when any one of
1330         the images of its constituent types is closed.
1331
1332         * metadata.c: When closing an image, don't free generic insts and
1333         generic classes right away, but put them into a list for later
1334         freeing.
1335
1336         * image.c, metadata-internals.h: Store the free list and in the
1337         second pass of closing an image, free it.
1338
1339 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1340
1341         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
1342
1343         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
1344         types in type_hash.
1345
1346         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
1347
1348 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1349
1350         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
1351         user type.
1352
1353         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
1354         is used.
1355
1356 2009-12-14  Miguel de Icaza  <miguel@novell.com>
1357
1358         * verify.c (mono_method_verify): The Unused opcodes produce an
1359         InvalidProgramException on .NET
1360
1361 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
1362
1363         * loader.c (mono_method_get_header): Move assert after the verifier
1364         has been called on the method header.
1365
1366 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1367
1368         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
1369
1370         * appdomain.c: Bump corlib version.
1371
1372 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1373
1374         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
1375         types as well since otherwise generic instances would not return UT as arguments but
1376         their undelying system type.
1377
1378         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
1379         to reflect the fact that they can have now multiple different types.
1380
1381         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
1382
1383         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
1384
1385         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
1386
1387         * reflection.c (mono_reflection_register_with_runtime): Init super types
1388         if the image is not dynamic.
1389
1390         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
1391         check if the generic type definition is a TypeBuilder.
1392
1393         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
1394         doesn't belong to a dynamic image, skip initialization.
1395
1396         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
1397         base definition is not a dynamic type.
1398
1399 2009-12-11  Marek Habersack  <mhabersack@novell.com>
1400
1401         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
1402         mono_profiler_string_allocation
1403
1404         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
1405         if string profiling is enabled, call
1406         mono_profiler_string_allocation
1407
1408         * profiler.h: added two MonoProfileFlags -
1409         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
1410         installation functions for the hooks below.
1411
1412         * profiler-private.h, profiler.c: added two hooks:
1413         mono_profiler_string_allocation called whenever a string is
1414         allocated by InternalAllocateStr and mono_profiler_iomap called
1415         whenever IOMAP code performs an adjustement on a file path.
1416
1417 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
1418
1419         * boehm-gc.c: fixed race condition while getting the target of a
1420         disappearing link (bug #522233).
1421
1422 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1423
1424         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
1425         the error.
1426
1427 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1428
1429         * reflection.c: Add mono_reflection_register_with_runtime icall to
1430         allow a MonoGenericClass to register itself as the managed mirror of
1431         a given generic instance.
1432         This is a temporary workaround until all MGC instantiation happens in
1433         managed code.
1434
1435         * object-internals.h: Ditto.
1436
1437         * icall-def.h: Ditto.
1438
1439 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1440
1441         * sgen-gc.c (find_in_remsets): Also search the generic store
1442         remsets.
1443
1444 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1445
1446         * sgen-gc.c: Don't access class names in debugging code when
1447         unloading a domain, because they might not be valid anymore.
1448
1449 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1450
1451         * domain.c, domain-internals.h: New function mono_domain_unset().
1452
1453         * appdomain.c (unload_thread_main): Detach the thread again at the
1454         end.
1455
1456         * threads.c: When a thread exists or is detached, unset its domain
1457         so that it's NULL when, for example, a pthread destructor runs.
1458
1459         * sgen-gc.c: Assert that there is no domain set after a thread is
1460         done.
1461
1462 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1463
1464         * class.c (mono_generic_class_get_class),
1465         metadata.c (free_generic_class): Allocate generic MonoClass's from
1466         the image mempool, not via malloc.  The problem with malloc is
1467         that when unloading a domain those classes are freed before
1468         clearing the heap and SGen needs the classes.  Rewriting the
1469         unloading code to do the free later would be more work and there's
1470         no point in using malloc anyway.
1471
1472 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
1473
1474         * loader.c (mono_method_signature): Always call mono_loader_unlock 
1475         before returning.
1476
1477 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1478
1479         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
1480         user string blobs.
1481
1482         * verify-internals.h: Add new function to the internal API.
1483
1484         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
1485         check if it's a valid string.
1486
1487         * object.c (mono_ldstr): Ditto.
1488
1489         Fixes #561943.
1490
1491 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1492
1493         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
1494         from a method before returning it. This is the expected behavior.
1495
1496 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
1497
1498         * reflection.c (inflate_method): Handle the case of a regular system type.
1499
1500 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1501
1502         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
1503         gathering code.
1504
1505         * mempool.c, mempool-internals.h: New function
1506         mono_mempool_get_bytes_allocated().
1507
1508         * Makefile.am: sgen-pinning-stats.c added.
1509
1510 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1511
1512         * sgen-gc.c (create_allocator): Only use the fast path if the
1513         object size is within the small object size limit.
1514
1515 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1516
1517         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
1518         possibly adding padding to sizeof (GCMemSection).
1519
1520 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1521
1522         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
1523         reference is not in the nursery.
1524
1525 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
1526
1527         * class.c (mono_class_from_typeref): Bounds check idx against the 
1528         assemblyref table.
1529
1530 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1531
1532         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
1533         through the potential roots, then sort the results and find the
1534         pinned objects from there.
1535
1536         * Makefile.am: sgen-pinning.c added.
1537
1538 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1539
1540         * sgen-gc.c: Record generic stores in specialized remset buffers.
1541
1542 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1543
1544         * sgen-gc.c: Make pinned chunks the same size as major heap
1545         sections, and align them as well, so that we can check whether an
1546         object is in a pinned chunk or a major section in constant time.
1547
1548 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1549
1550         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
1551
1552 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1553
1554         * sgen-gc.c: Make all major heap sections the same size (currently
1555         128k) and allocate them on aligned addresses.  Small heap sections
1556         give us better granularity with pinned objects - we can free up
1557         much more memory.
1558
1559 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1560
1561         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
1562         output removed.
1563
1564 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1565
1566         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
1567
1568         * mono/metadata/assembly.c: When opening an assembly image, pass the real
1569         names in addition to the runtime generated one.
1570
1571         * mono/metadata/image.h: Add a function to take the real name of the assembly
1572         image.
1573
1574         * mono/metadata/image.c: If a real name has been passed to load an assembly,
1575         use it instead of the runtime generated one.
1576
1577         Code is contributed under MIT/X11 license.
1578
1579 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1580
1581         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
1582         before the other checks to prevent problems if the DateTime class is blittable.
1583         Hopefully fixes #559600.
1584
1585 2009-12-05  Mark Probst  <mark.probst@gmail.com>
1586
1587         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
1588         returns the largest string length that will not be put into the
1589         LOS.
1590
1591         * sgen-gc.c, gc-internal.h: New function that returns the largest
1592         object size that will not be put into the LOS.
1593
1594         * appdomain.c: Bump corlib version.
1595
1596 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1597
1598         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1599
1600         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1601
1602 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1603
1604         * reflection.c (inflate_method): Fix signature.
1605
1606         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
1607         in managed code.
1608
1609 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1610
1611         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
1612
1613 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1614
1615         * sgen-gc.c: Abstract to-space handling.
1616
1617 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
1618
1619         * loader.c (find_method_in_class): Ignore methods with broken signatures.
1620
1621         Fixes #559906.
1622
1623 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1624
1625         * sgen-gc.c: Only add references from outside the nursery to
1626         within the nursery to the global remset list.
1627
1628 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1629
1630         * appdomain.c (create_exceptions): Set the domain temporarily if
1631         necessary to avoid cross-domain references.
1632
1633 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1634
1635         * verify.c (get_stack_type): Return that the type is invalid instead of
1636         asserting.
1637
1638         * verify.c (mono_method_verify): Verify that all locals and arguments
1639         have valid stack types.
1640
1641         Fixes #559913.
1642
1643 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1644
1645         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
1646         bounds checking overflow aware.
1647
1648         Fixes #559910.
1649
1650 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1651
1652         * verify.c (do_invoke_method): Check for invalid method signatures.
1653
1654         Fixes #553450.
1655
1656 2009-12-02  Jb Evain  <jbevain@novell.com>
1657
1658         * appdomain.c (MONO_CORLIB_VERSION): bump.
1659         * icall-def.h (get_base_definition): renamed to get_base_method
1660         and add a boolean argument indicating we want the original
1661         method definition, or the immediate base method.
1662         * icall.c: apply the get_base_definition to get_base_method change.
1663
1664 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1665
1666         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
1667
1668         Fixes #558042.
1669
1670 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
1671
1672         * class.c: remove asserts for invalid type token in
1673         mono_class_name_from_token(), mono_assembly_name_from_token() and
1674         mono_class_create_from_typedef () (fixes bug #553318).
1675
1676 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
1677
1678         * metadata.c, class.c, loader.c: remove assert after bsearch() for
1679         incorrect assemblies (bug #553322).
1680
1681 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1682
1683         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
1684
1685         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
1686
1687         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
1688
1689         * class.c (inflate_generic_context): Ditto.
1690
1691         * loader.c (method_from_methodspec): Ditto.
1692
1693         Fixes #558230.
1694
1695 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1696
1697         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
1698
1699         * class.c (mono_class_create_from_typespec): Ditto.
1700
1701         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
1702
1703         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
1704
1705         Fixes #558184.
1706
1707 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1708
1709         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
1710
1711         * verify.c (verify_delegate_compatibility): Ditto.
1712
1713         * verify.c (do_newobj): Ditto.
1714
1715         Fixes #558046.
1716
1717 2009-12-02  Mark Probst  <mark.probst@gmail.com>
1718
1719         * sgen-gc.c: Use a gray queue instead of requiring that gray
1720         objects are in a contiguous region.
1721
1722         * sgen-gray.c: The gray queue implementation.
1723
1724         * Makefile.am: sgen-gray.c added.
1725
1726 2009-12-02  Mark Probst  <mark.probst@gmail.com>
1727
1728         * appdomain.c: When unloading a domain, zero its static data and
1729         perform a minor collection when using SGen.  That will get rid of
1730         all the remsets pointing into that domain's static data.
1731
1732         * sgen-gc.c: Allow remsets into static data.  By doing this we
1733         need less checks so we're more efficient.
1734
1735 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1736
1737         * verify.c (mono_method_verify): Check for catch clauses with broken
1738         types.
1739
1740         Fixes #558465.
1741
1742 2009-12-01  Jb Evain  <jbevain@novell.com>
1743
1744         * class.c (make_generic_param_class): set the namespace of
1745         the generic parameter class from its owner, if available.
1746
1747 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1748
1749         * verify.c (code_bounds_check): Do proper overflow checking.
1750
1751         * verify.c (mono_method_verify): The number of switch entries is
1752         an unsigned int. Properly bounds check it.
1753
1754         Fixes #558594.
1755
1756 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1757
1758         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
1759         mono_metadata_method_has_param_attrs which only checks if a given param
1760         list has a non zero flags entry.
1761
1762         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
1763         to inform how many params should we expect to decode.
1764
1765         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
1766         as it's faster than mono_metadata_get_param_attrs.
1767
1768         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
1769         add mono_metadata_method_has_param_attrs.
1770
1771 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1772
1773         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
1774         failures.
1775
1776         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
1777         is -1 but its class is broken.
1778
1779         Fixes #558522.
1780
1781 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1782
1783         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
1784         for parameter overflow.
1785
1786         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
1787         of mono_metadata_get_param_attrs.
1788
1789         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
1790         API.
1791
1792         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
1793
1794 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1795
1796         * class.c (mono_class_setup_fields): Check for fields with broken types.
1797
1798         Fixes #558741.
1799
1800 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
1801
1802         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
1803         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
1804         its TypeBuilder::CreateType ().
1805
1806         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
1807         if not needed.
1808
1809         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
1810         to make setup_interface_offsets happy.
1811
1812         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
1813         compilation now works.
1814
1815 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
1816
1817         * appdomain.c (create_exceptions): New helper function extracted from
1818         mono_runtime_init () to precreate objects used during exception handling.
1819         (mono_runtime_init): Call it.
1820         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
1821
1822 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
1823
1824         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
1825         compilation until the proper one is found.
1826
1827 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
1828
1829         * class.c (mono_class_setup_vtable_general): Cache the result of
1830         get_virtual_methods () since it can be slow because of the metadata
1831         optimization.
1832
1833         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
1834         from a MonoValueHashTable for now, since the later is based on an earlier
1835         version of hpj's internal probing code and seems to have serious collision
1836         issues.
1837
1838         * loader.c (mono_get_method_full): Update after the change above.
1839
1840 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
1841
1842         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
1843
1844 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
1845
1846         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
1847         the GTD instead of the DGC instead of crashing.
1848
1849         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
1850         required. Inflate fields if needed.
1851
1852         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
1853         finished. Renamed.
1854
1855 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
1856
1857         * class.c (check_interface_method_override): Check for NULL signatures and fail
1858         the type.
1859
1860         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
1861
1862         Fixes #553428.
1863
1864 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
1865
1866         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
1867         the MONO_METHOD_FLAGS column instead of decoding the whole row.
1868
1869 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
1870
1871         * loader.c (field_from_memberref): Resolve the class first then the field
1872         signature. Remove a lot of duplicated code and make sure we don't pass valid
1873         values to mono_loader_set_error_field_load.
1874
1875         Fixes #553306.
1876
1877 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
1878
1879         * class.c (inflate_generic_type): Change code to use new signature of
1880         mono_error_set_bad_image.
1881
1882         Fixes #558124.
1883
1884 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
1885
1886         * verify.c (mono_method_verify): Don't free ctx.params items if 
1887         we aborted while inflating the ctx.locals. Complete previous fix
1888
1889 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
1890
1891         * verify.c (mono_method_verify): Use the uninflated type name, 
1892         when the inflated is null, to report errors. Also take care when
1893         freeing, not to free everything since, in case of an error, some
1894         stuff would be copies (i.e. not allocated by the function itself)
1895         Fix bug #558145
1896
1897 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
1898
1899         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
1900         or overflow. The caller must have done this check explicitly. This guard us
1901         from accessing invalid memory.
1902
1903         * verify.c (do_push_static_field): Check for stack overflow.
1904
1905         Fixes #553333.
1906
1907 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
1908
1909         * loader.c (find_method_in_class): Don't crash if the signature cannot
1910         be resolved.
1911
1912         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
1913         of asserting for the case of invalid params.
1914
1915         Fixes #553304.
1916
1917 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
1918
1919         * image.c (mono_image_load_module): Fix crash when a bad assembly
1920         has no module at all (fix bug #553412) and also replace the 
1921         g_assert with a return NULL (documented return value for failure)
1922
1923 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
1924
1925         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
1926
1927 2009-11-23  Miguel de Icaza  <miguel@novell.com>
1928
1929         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
1930         file attribute to managed code and avoid doing the mask/attribute
1931         checks here. 
1932
1933 2009-11-22  Miguel de Icaza  <miguel@novell.com>
1934
1935         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
1936         the managed world.
1937
1938         * icall-def.h: New entry points.
1939         
1940 2009-11-19  Mark Probst  <mark.probst@gmail.com>
1941
1942         * process.c: Don't put references to managed objects into a
1943         g_ptr_array.
1944
1945 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
1946
1947         * class.c (can_access_internals): Allow CoreCLR to participate in
1948         allowing (or not) [InternalsVisibleTo] between assemblies.
1949         * security-core-clr.c|h: Make sure that only trusted code (a 
1950         superset of platform code) can access the internals of platform
1951         code.
1952
1953 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
1954
1955         * reflection.c: use the correct base class to get the virtual method
1956         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
1957
1958 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
1959
1960         * security-core-clr.c (get_caller_no_reflection_related): 
1961         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
1962         it's still reflection and must be filtered correctly.
1963
1964 2009-11-16  Mark Probst  <mark.probst@gmail.com>
1965
1966         * object.c (compute_class_bitmap): Fix for large bitmaps.
1967
1968 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
1969
1970         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
1971
1972         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
1973         koush@koushikdutta.com). Disable GC_no_dls on android.
1974
1975 2009-11-12  Mark Probst  <mark.probst@gmail.com>
1976
1977         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
1978         tlab_next points outside the TLAB because the allocator was
1979         interrupted.
1980
1981 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1982
1983         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
1984
1985 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1986
1987         * object-internals.h: Change signature for mono_string_to_utf8_image.
1988
1989         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
1990         argument.
1991
1992         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
1993         exceptions due to mono_string_to_utf8.
1994
1995 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
1996
1997         * object-internals.h: Change signature for mono_string_to_utf8_mp.
1998
1999         * object.c (mono_remote_class): Make sure all resources are released before
2000         raising an exception.
2001
2002         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
2003
2004 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2005
2006         * mono-perfcounters.c (network_get_impl): Change variable initialization
2007         ordering to fix potential memory leak in case of exceptions.
2008
2009         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
2010         encoded strings.
2011         
2012 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2013
2014         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
2015         variable initialization ordering to fix potential memory leak in case
2016         of exceptions.
2017
2018 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
2019
2020         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
2021         needed.
2022
2023 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2024
2025         * appdomain.c: Fix shadow path code to better deal with exceptions.
2026
2027 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2028
2029         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
2030         exception in the middle of the runtime code.
2031
2032 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2033
2034         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
2035         leak memory with broken envvar value.
2036
2037 2009-11-06  Mark Probst  <mark.probst@gmail.com>
2038
2039         * reflection.c (mono_reflection_setup_internal_class): Because
2040         nested classes are not added to the name cache, we must put them
2041         in the reflection_info_unregister_classes list.
2042
2043 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
2044
2045         * class.c: When CoreCLR is enabled don't call mono_init_com_types
2046         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
2047         platform (trusted) code. Instead we return a TypeLoadException to
2048         be thrown later. This is the exception thrown by Silverlight 2 if
2049         a type, inside application (user) code is marked with [ComImport]
2050
2051 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
2052
2053         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
2054         mono_is_debugger_attached () too.
2055
2056         * mono-debug.c (mono_is_debugger_attached): New helper function.
2057         (mono_set_is_debugger_attached): Ditto.
2058
2059 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2060
2061         * object-internals.h: Add mono_string_to_utf8_checked.
2062
2063         * object.c: Implement mono_string_to_utf8_checked.
2064
2065 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2066
2067         * class.c: Add missing check for load errors after every
2068         call to mono_class_setup_fields
2069
2070         Fixes #552282.
2071
2072 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2073
2074         metadata-verify.c (verify_tables_schema): Fix the error message.
2075
2076 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2077
2078         * metadata.c: Change event table schema to use TDOR for event type
2079         as this is what it's meant to be.
2080
2081         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
2082         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
2083         entry.
2084
2085         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
2086         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
2087         rows in MONO_TABLE_GENERICPARAM.
2088
2089         Fixes #552289.
2090
2091 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2092
2093         * class.c (mono_image_add_to_name_cache): Assert on duplicate
2094         insertion.
2095
2096         * reflection.c (mono_reflection_setup_internal_class): Avoid
2097         registering a gc root the same MonoClass multiple times.
2098         Don't register nested types on the global scope as they should
2099         not be available there.
2100
2101 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2102
2103         * culture-info-tables.h: regenerated.
2104
2105 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
2106
2107         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
2108
2109 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
2110
2111         * string-icalls.c|h: Remove string internal calls that are not 
2112         used anymore by the class libraries.
2113         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
2114         which is not used in the class librairies.
2115         * icall-def.h: Update tables.
2116
2117 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2118
2119         * class.h: Move mono_class_inflate_generic_type_checked...
2120
2121         * class-internals.h: to here and make it internal. We don't want to
2122         further expose MonoGenericContext. 
2123
2124 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2125
2126         * verify.c (mono_method_verify): Improve error message.
2127
2128 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2129
2130         * reflection.c (fieldref_encode_signature): If field_image is NULL then
2131         the token is already properly encoded. Fixs 4.0 build.
2132
2133 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2134
2135         * locales.c (construct_number_format): Check if the number index is
2136         valid before trying to use it, if not, just return.
2137         
2138 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
2139
2140         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
2141         since that loses the abort state. Fixes #539394.
2142
2143 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
2144
2145         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
2146         explicit this argument to the call signature.
2147         (mono_marshal_get_icall_wrapper): Ditto.
2148
2149 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2150
2151         * reflection.c (fieldref_encode_signature): Add new field_image parameter
2152         to indicate which assembly to use when resolving a custom-mod.
2153
2154         Fixes handling of volatile fields used across assemblies as reported in #551513.
2155
2156 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2157
2158         * loader.c: Improve error messages.
2159
2160 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2161
2162         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
2163         of interfaces. Fixes IKVM.
2164
2165         * class.c (mono_class_setup_vtable_general): Improve debug spew.
2166
2167 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2168
2169         * verify.c (verifier_inflate_type): Return the inflated type on success.
2170
2171 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
2172
2173         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
2174
2175         * threads.c (mono_thread_attach): Call the profiler thread start callback.
2176
2177         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
2178
2179         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
2180         flag set.
2181
2182         * profiler.c: Add new profiler callbacks for runtime invoke.
2183
2184         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
2185
2186 2009-11-01  Mark Probst  <mark.probst@gmail.com>
2187
2188         * sgen-gc.c: Keep track of the reason for a major collection and
2189         write it to the heap-dump file.
2190
2191 2009-10-31  Miguel de Icaza  <miguel@novell.com>
2192
2193         * threads.c: refactor the code that initializes the
2194         thread_start_args into a reusable function and use this in the two
2195         methods that start up threads.
2196
2197 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
2198
2199         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
2200         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
2201
2202 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
2203
2204         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
2205         Until now, we only had the per-cpu(core) counters.
2206
2207 2009-10-28  Mark Probst  <mark.probst@gmail.com>
2208
2209         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
2210         mono_gc_get_suspend_signal(), which returns the suspend signal
2211         number used by the GC.
2212
2213 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
2214
2215         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
2216
2217         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
2218         signalling start_notify.
2219
2220 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2221
2222         * appdomain.c: do not test the st_mode field for shadow-copies.
2223         Fixes bug #545276.
2224
2225 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2226
2227         * threadpool.[ch]: added hooks for thread start/finish and item
2228         processing begin/end. For monotouch use only.
2229
2230 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
2231
2232         * threads.c (mono_thread_get_name): New helper function.
2233
2234         * reflection.c (resolve_object): Set handle_class for strings too.
2235         (mono_reflection_create_custom_attr_data_args): New helper function to decode
2236         a cattr blob into a set of arrays and structures without creating the custom
2237         attributes themselves.
2238         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
2239
2240         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
2241
2242         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
2243         function.
2244
2245 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2246
2247         * verify.c: Replace calls to mono_class_inflate_generic_type with
2248         mono_class_inflate_generic_type_checked. Fixes #480005.
2249
2250 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2251
2252         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
2253         object since not all paths lead to callees initing it.
2254
2255 2009-10-23  Alp Toker  <alp@nuanti.com>
2256
2257         Fix embedding API breakage from r144688. mono-compiler.h is an internal
2258         header and should not be shipped:
2259
2260         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
2261         which is specific to the mono build. Not going to work.
2262
2263 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
2264
2265         * security-manager.c: Report if core-clr is active from
2266         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
2267         to allow Moonlight BCL to behave appropriately (both in browser
2268         and outside, e.g. smcs)
2269
2270 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
2271
2272         * mono-config.c: ignore UTF-8 BOM and report parser errors.
2273         Fixes bug #549108.
2274
2275 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2276
2277         * class.c: fix typo.
2278
2279 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
2280
2281         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
2282         a MonoError parameter.
2283
2284         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
2285         version that can does proper error handling.
2286
2287         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
2288
2289         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
2290
2291         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
2292
2293 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2294
2295         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
2296         NO_UNALIGNED_ACCESS is defined.
2297
2298 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
2299
2300         * marshal.c (mono_string_builder_to_utf16): Applied patch from
2301         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
2302         Fixes #549173.
2303
2304 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2305
2306         * sgen-gc.c: Shorten sections whenever possible.
2307
2308 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2309
2310         * sgen-gc.c: Use our portable semaphore #defines.
2311
2312 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2313
2314         * sgen-gc.c: A debug option for dumping the heap layout to a file
2315         after each collection.
2316
2317 2009-10-21  Mark Probst  <mark.probst@gmail.com>
2318
2319         * sgen-gc.c: Make managed write barriers atomic via
2320         thread-restarts.
2321
2322 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
2323
2324         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
2325         methods. Fixes #543021.
2326
2327 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2328
2329         * socket-io.[ch]: fix VS build.
2330
2331 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2332
2333         * icall-def.h:
2334         * socket-io.[ch]: implemented SendFile.
2335
2336 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2337
2338         * class.c (mono_class_create_from_typedef): Initialize class->element_class
2339         before the interfaces to avoid crashes later if class initialization fails.
2340         Fixes #548417.
2341
2342         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
2343         Fixes #548276.
2344
2345 2009-10-20  Marek Safar  <marek.safar@gmail.com>
2346
2347         * domain.c: Bump 4.0 version.
2348
2349 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
2350
2351         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
2352         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
2353         check since 'pubkey' can't be NULL at this stage
2354         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
2355         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
2356         initialization of 'iter'
2357
2358 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
2359
2360         * cominterop.c : Search the interface parts of vtable to find 
2361           method matches.  Fixes 547030.
2362
2363         Code is contributed under MIT/X11 license.
2364
2365 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
2366
2367         * marshal.c: BeginInvoke cannot be called on multicast delegates with
2368         multiple targets. Fixes bug #574426.
2369
2370 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2371
2372         * profiler.h: Put here the definition of
2373         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
2374         (and fix the build...).
2375
2376 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2377
2378         * profiler.c, profiler.h, profiler-private.h:
2379         Added support for different ways of getting call chains in stat mode.
2380
2381 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2382
2383         * object.c, object-internals.h: New function for computing the
2384         size of an array, factored out of mono_array_new_full().  Use
2385         SGen's functions for allocating arrays and vectors.
2386
2387         * sgen-gc.c, gc-internal.h: Special functions for allocating
2388         arrays and vectors without race conditions.  A managed array
2389         allocator method.
2390
2391         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
2392
2393 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2394
2395         * object.c, object.h, icall.c: Write barriers do the copying now,
2396         as well, so no need for an additional memcpy.
2397
2398         * sgen-gc.c: Lock when storing remsets.  Do the memory
2399         copying/moving in the write barriers.
2400
2401         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
2402
2403         * reflection.c: Added an assert.
2404
2405 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2406
2407         * threads.c, process.c: A few missing write barriers.
2408
2409 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
2410
2411         * mono-perfcounters.c, mono-perfcounters-def.h: Add
2412         network performance counters for bytes sent per second, bytes
2413         received per second, and bytes total per second.
2414
2415         Code is contributed under MIT/X11 license.
2416
2417 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2418
2419         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
2420         Fix warning.
2421
2422 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2423
2424         * threads.c, object-internals.h, object.c: Move code for
2425         transferring an object to a different domain (via
2426         serialization/remoting) to object.c.
2427
2428         * object.c (call_unhandled_exception_delegate): If the exception
2429         is in a different domain than the delegate, transfer the exception
2430         to that domain.
2431
2432 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
2433
2434         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
2435         Fixes #322934.
2436
2437 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
2438
2439         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
2440
2441 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2442
2443         * object.c (mono_method_return_message_restore): Handle the case
2444         where the argument is an instance of a generic type.  Fixes
2445         #544446.
2446
2447 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2448
2449         * object.c (set_value): Write barrier fix - we must pass the
2450         count, not the size.
2451
2452 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
2453
2454         * domain.c (mono_init_internal): Print a useful error message when encountering
2455         an old mscorlib, instead of crashing. Fixes #544307.
2456
2457 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
2458
2459         * appdomain.c (copy_app_domain_setup): Fix a warning.
2460
2461         * debug-helpers.c (dis_one): Ditto.
2462
2463 2009-10-04  Mark Probst  <mark.probst@gmail.com>
2464
2465         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
2466         into the new domain, instead of referencing the original one.
2467
2468         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
2469         non-static.
2470
2471         * appdomain.c: Corlib version bump.
2472
2473 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2474
2475         * threadpool.c: one more...
2476
2477 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2478
2479         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
2480         threads to die because we're shutting down. delgate5.exe works again.
2481
2482 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
2483
2484         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
2485           ccw_interface_hash table when a ccw is finalized.
2486
2487         Code is contributed under MIT/X11 license.
2488
2489 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2490
2491         * assembly.c, domain.c, image.c, metadata-internals.h: Split
2492         domain and image unloading into two steps.  We must do this
2493         because clearing the domain in SGen requires the class metadata to
2494         be intact, but we need to free the mono_g_hash_tables in case a
2495         collection occurs during domain unloading and the roots would trip
2496         up the GC.
2497
2498 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2499
2500         * object-internals.h: Remove serialized culture fields from
2501         MonoInternalThread.
2502
2503         * icall-def.h, thread-types.h, threads.c: Remove serialized
2504         culture icalls.
2505
2506         * appdomain.c: Corlib version bump.
2507
2508 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
2509
2510         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
2511         Fixes #543133.
2512
2513 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2514
2515         * sgen-gc.c: Try to shorten the new section after a major
2516         allocation to avoid ever-growing sections.
2517
2518 2009-10-13  Martin Baulig  <martin@ximian.com>
2519
2520         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
2521         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
2522         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
2523         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
2524
2525         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
2526
2527 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
2528
2529         * threadpool.c: fixed the order in which 'completed' and the wait
2530         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
2531         No need to use the wait_handle field of ASyncCall. Make sure the
2532         threadpool is active when adding a job or queueing an idle thread.
2533
2534 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
2535
2536         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
2537
2538         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
2539         when using --compile-all.
2540
2541 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2542
2543         * metadata.c (free_generic_class): Unregister the field_objects
2544         roots if we're using SGen.
2545
2546 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2547
2548         * reflection.c (mono_dynamic_image_free): Deregister the GC root
2549         for GenericParamTableEntry.gparam.
2550
2551 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2552
2553         * marshal.c: don't create the handle when calling. It is created later
2554         if needed.
2555
2556 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2557
2558         * sgen-gc.c: Warning fixes.
2559
2560 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2561
2562         * sgen-gc.c: New debug option "xdomain-checks", which scans the
2563         whole heap for cross-domain references before each collection.
2564
2565         * sgen-scan-object.h: The scan action can now use SCAN to scan the
2566         object.
2567
2568         * threadpool-internals.h, threadpool.c: New function
2569         mono_thread_pool_is_queue_array() for checking whether a given
2570         array is used as a (cross-domain) queue by the thread pool code.
2571
2572 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2573
2574         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
2575         searches the whole heap for objects containing a specific
2576         reference.  Only for debugging.
2577
2578 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2579
2580         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
2581
2582         * icall-def.h, threads.c, threads-types.h: New icalls for copying
2583         byte arrays between domains.
2584
2585 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2586
2587         * threadpool.c:
2588         * class-internals.h:
2589         * mono-perfcounters-def.h:
2590         * mono-perfcounters.c:
2591         -There is a list of idle threads
2592         -Each of those idle threads wait on their own WaitHandle instead
2593         of all of them using the same semaphore. When a new work item is
2594         added, the job is assigned directly to an idle thread or a newly
2595         created one if possible and then the handle for that thread is
2596         signaled. Compare that to the current approach where all the
2597         threads in the pool compete to dequeue a job from the same
2598         queue.
2599         -New struct ThreadPool that brings together the bunch of static
2600         variable for each threadpool (IO and regular).
2601         -New performance counters: # of items added and its rate per
2602         threadpool. The rate will be used later, perhaps together with
2603         other perf. counters, to decide when idle threads should exit.
2604
2605 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
2606
2607         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
2608         Fix typo on Windows build.      
2609         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
2610         
2611         Code is contributed under MIT/X11 license.
2612
2613 2009-09-25  Mark Probst  <mark.probst@gmail.com>
2614
2615         * object-internals.h: The Thread class is split up into Thread and
2616         InternalThread now.  We have exactly one InternalThread per
2617         thread, and at most one Thread per appdomain per thread.  Most
2618         data is stored in InternalThread.  All InternalThread objects live
2619         in the root domain.
2620
2621         * class-internals.h: Add internal_thread_class to MonoDefaults.
2622
2623         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
2624         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
2625         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
2626         resulting from the split of the Thread class.
2627
2628         * gc-internal.h: Prototype for new function for checking whether a
2629         thread is the finalizer thread.
2630
2631         * appdomain.c: Corlib version bump.
2632
2633 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2634
2635         * appdomain.c|h: Add a mono_domain_try_unload method which is
2636         equivalent to mono_domain_unload, except that it returns an exception
2637         instead of throwing it. Make mono_domain_unload use the
2638         mono_domain_try_unload method to avoid code-duplication.
2639
2640 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
2641
2642         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
2643         a problem.
2644
2645 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
2646
2647         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
2648         aborting when a conversion is not implemented.
2649
2650 2009-09-23  Miguel de Icaza  <miguel@novell.com>
2651
2652         * verify.c: when comparing culture strings, use g_ascii_strcmp
2653
2654         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
2655         when comparing public key tokens to use memcmp on 16 bytes.   I do
2656         not believe this ever worked as advertised in the past.
2657
2658         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
2659         which would have always failed earlier.
2660
2661 2009-06-25  Miguel de Icaza  <miguel@novell.com>
2662
2663         * gc.c: Raise a NullArgumentException if the object passed is
2664         null.
2665
2666 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
2667
2668         * image.c (mono_image_close): Atomically decrement the reference count and
2669         remove the image from the hash tables, to prevent another thread from seeing a
2670         dying MonoImage. Fixes #541194.
2671
2672 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2673
2674         * threadpool.c: actually use the minimum number of 'completion ports'
2675         (for us is just a potential worker thread).
2676
2677 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2678
2679         * threadpool.c: remove ares_htable. It does not make sense any more
2680         since the same objects are now stored in GC-tracked arrays while they are
2681         in the queue.
2682
2683 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2684
2685         * threadpool.c: increase the minimum length of the queues to 128.
2686         Remove warning.
2687
2688 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
2689
2690         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
2691         return the modified signature used by string ctors.
2692
2693 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
2694
2695         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
2696         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
2697         method, to be used by full-aot.
2698
2699 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
2700
2701         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
2702         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
2703         be known to be good.
2704
2705         * class.c (mono_class_init): Fail array types if their element type fails initialization
2706         as well.
2707
2708         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
2709         initialization, additionally we request the element_type vtable to be initialized as well.
2710
2711         This is fine and should not increase the working set in any meaningful way since it's reasonable
2712         to assume       that most code will create an array and eventually populate it, which will require the
2713         type's vtable to be initialized.
2714
2715         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
2716
2717 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
2718
2719         * normalization-tables.h : regenerated.
2720
2721 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
2722
2723         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
2724         a leb128 encoding can take up to 5 bytes.
2725
2726 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
2727
2728         * class.c (verify_class_overrides): Remove useless argument.
2729
2730         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
2731         before interface enumeration as this is no longer required.
2732
2733 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
2734
2735         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
2736         used under mono_class_init context. This functions avoid any code path that
2737         calls mono_class_init, which leads it to be slow as some things like the interface
2738         bitmap are not available.
2739
2740         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
2741         of it's own broken version. Fixes the verifier part of #538588.
2742
2743         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
2744         API.
2745
2746 2009-09-15  Mark Probst  <mark.probst@gmail.com>
2747
2748         * class.c (mono_class_init): Always set an exception in a class if
2749         vtable setup fails.  Fixes #538577.
2750
2751         * generic-sharing.c: Raise an exception if mono_class_vtable()
2752         returns NULL.
2753
2754 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
2755
2756         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
2757         methods of vtypes, as they could be incorrectly shared with static methods
2758         taking an IntPtr argument.
2759
2760 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
2761
2762         * domain.c:
2763         * object.c:
2764         * class-internals.h: renamed waithandle_class to
2765         manualresetevent_class.
2766         * marshal.c: propagate the exception if a remoting BeginInvoke call
2767         fails.
2768
2769 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2770
2771         * object.c: Properly handle vtable failures.
2772
2773 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2774
2775         * socket-io.c: Assert on vtable failure.
2776
2777         * mono-mlist.c: Assert on vtable failure.
2778
2779 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2780
2781         * marshal.c: Assert on vtable failure.
2782
2783 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2784
2785         * icall.c: Properly handle vtable failures.
2786
2787 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2788
2789         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
2790
2791 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2792
2793         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
2794
2795         * console-unix.c (do_console_cancel_event): Same.
2796
2797 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2798
2799         * class-internals.h: Add mono_class_vtable_full function that allows control
2800         if an exception should be raised or not.
2801
2802         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
2803         to do what its documentation say, that is to return NULL and set exception_type on
2804         failure.
2805
2806         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
2807         and change the code to honor it.
2808
2809 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
2810
2811         * verify.c: Fix typo in error message.
2812
2813 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
2814
2815         * security-core-clr.c: Fix default_platform_check so it can run
2816         the runtime coreclr tests (without an infinite recursion when
2817         throwing an exception).
2818
2819 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2820
2821         object.c (mono_delegate_ctor_with_method): Guard against null method.
2822
2823 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2824
2825         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
2826         that should be replaced with error handling later.
2827
2828 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2829
2830         * marshal.c (mono_delegate_end_invoke): Fix warning.
2831
2832 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2833
2834         * loader.c (mono_field_from_token): Properly handle invalid
2835         dynamic tokens.
2836
2837 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2838
2839         * pedump.c (verify_image_file): Skip types that can't be
2840         decoded.
2841
2842 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2843
2844         * verify.c: Look for recursive valuetypes only against the
2845         type been initialized as this is a lot simpler and works.
2846
2847 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
2848
2849         * verify.c: Ensure that fields are properly loaded before
2850         checking them.
2851
2852 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
2853
2854         * object.c (mono_object_get_virtual_method) : Call 
2855           mono_cominterop_get_invoke if the object is a COM object.
2856
2857         Code is contributed under MIT/X11 license.
2858
2859 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
2860
2861         * verify.c: Check for recursive valuetype definitions.
2862
2863 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
2864
2865         Use inheritance-aware interface offsets. Inherited types use the same offsets
2866         of their parents. This reduce offset duplication in case more than one type in
2867         the inheritance tree explicitly implements the same interface.
2868
2869         This also removes a source of vtable bubbles found in #532409. An abstract type
2870         isn't required to provide abstract methods to all interfaces it implements, which
2871         resulted in a bubble with the previous scheme as the child would get a non-full
2872         vtable from its parent. We fail all concrete types with vtable bubbles, so this
2873         should be fixed.
2874
2875         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
2876         it's expected to not cause any significant increase beyond that.
2877
2878         * class.c (setup_interface_offsets): Compute super class iface offsets
2879         first to force sharing.
2880
2881         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
2882         dumping only the relevant ones.
2883
2884         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
2885         methods a new slot regardless if they belong to an interface or not. This allows
2886         an inherited type to override the iface method separately from the class one.
2887
2888 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
2889
2890         * threadpool.c: make the Sleep() alertable to prevent delays exiting
2891         applications that take less than 2s to execute.
2892         Bug #524984 fixed.
2893
2894 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
2895
2896         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
2897
2898         * object.c (mono_get_runtime_callbacks): New helper function to return
2899         the runtime callbacks.
2900
2901         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
2902         mono_get_runtime_build_info () as the display name.
2903         
2904 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
2905
2906         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
2907         argument, since NEWARR expects a native int. Fixes #481559.
2908
2909 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2910
2911         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
2912         against broken SRE methods.
2913
2914 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2915
2916         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
2917         a NULL variable. Abort early on failure.
2918
2919 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
2920
2921         * class.c (can_access_type): Fail visibility test for non nested
2922         types with nested visibility.
2923
2924 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
2925
2926         * assembly.c (parse_public_key): Avoid allocating (and not 
2927         freeing) the public key array when it's not requested by the 
2928         caller.
2929         * threads.c (mono_thread_manage, mono_thread_create_internal, 
2930         ves_icall_System_Threading_Thread_Thread_internal): Free 
2931         allocated memory on error.
2932
2933 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2934
2935         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
2936
2937 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2938
2939         * class.c (mono_class_setup_fields): Remove duplicated local variable
2940         named gklass.
2941         Rename gklass to gtd to reflect the fact that it points to the generic
2942         type definition.
2943         Remove the duplicated call to mono_class_setup_fields on gtd and move
2944         the error check to the beginning.
2945
2946 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
2947
2948         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
2949         Remove cruft of the previous patch.
2950
2951 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2952
2953         * metadata-verify.c (verify_method_table): Check for abstract + final.
2954         Fixes #534175.
2955
2956 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2957
2958         * verify.c (verify_class_fields): Check for duplicate fields.
2959
2960 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2961
2962         * metadata-verify.c: Verify the typeref table for duplicates.
2963
2964 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
2965
2966         This reverts r140936 and properly handles interfaces with static methods. The
2967         right fix is to ensure vtables without bubles which is an easier to verify
2968         constraint. We should avoid such special cases as of the reverted patch as those
2969         only make the runtime more brittle.
2970
2971         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
2972         static methods on interfaces.
2973
2974         * class.c (setup_interface_offsets): Use the number of virtual methods when
2975         calculating interface offsets instead of the number of methods. This way we
2976         avoid bubles on the layout.
2977
2978 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
2979
2980         * metadata-verify.c (verify_metadata_header): Some very smart
2981         obfuscators like to add extra stream headers. Ignore them.
2982
2983 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
2984
2985         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
2986         methods correctly.
2987
2988 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
2989
2990         * metadata-verify.c: Verify for duplicated types.
2991
2992 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
2993
2994         * metadata-verify.c (verify_typedef_table): Verify for nested types
2995         without an entry on the nested class table.
2996
2997 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
2998
2999         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
3000         <tom_hindle@sil.org>. Add locking around hash table accesses.
3001
3002 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3003
3004         * verify.c (mono_verifier_verify_class): Verify all interface if
3005         really are interfaces. Fixes #534184.
3006
3007 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
3008
3009         * pedump.c: Initialize all types during metadata validation so we report
3010         errors only detected as part of class initialization.
3011
3012 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
3013
3014         * metadata-verify.c (verify_method_table): PInvoke requires method to
3015         be static. Fixes #534189
3016
3017 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
3018
3019         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
3020         being NULL.
3021
3022 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3023
3024         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
3025         for holes or bad methods. Fixes #525314.
3026
3027 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3028
3029         * class.c (setup_interface_offsets): Don't allocate slot
3030         for the same interface multiple times. This creates bubbles
3031         that waster space and make vtable verification harder.
3032
3033         The same interface get a slot multiple times since we need
3034         to get the closure of all implemented interfaces, which means
3035         the same interface is reported multiple times.
3036
3037 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3038
3039         * verify.c (mono_verifier_verify_class): Don't check the fields
3040         of generic instances since the context on which they got expanded
3041         might lead to false positives.
3042
3043         Such thing happens when a generic type is inflated in the context
3044         of a generic method and the inflated type of a field turns into a
3045         generic method argument, which causes the checking code to think
3046         it's an invalid class when it's not.
3047
3048 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3049
3050         * verify.c (mono_type_is_valid_in_context): Verify if type
3051         is NULL and remove duplicate test.
3052
3053 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3054
3055         * verify.c (mono_verifier_verify_class): Check fields for
3056         invalid generic arguments.
3057
3058 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3059
3060         * class.c (verify_class_overrides): Verify if for static
3061         and non virtual methods.
3062
3063 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3064
3065         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
3066         Check for errors after retrieving the vtable.
3067
3068 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3069
3070         * class.c (mono_class_setup_vtable_general): Verify
3071         if method overrides are valid before processing them.
3072
3073 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3074
3075         * marshal.c (mono_array_to_lparray): Fix minimal build with
3076         cominterop disabled.
3077
3078         * marshal.c (mono_free_lparray): Same.
3079
3080 2009-08-21  Mark Probst  <mark.probst@gmail.com>
3081
3082         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
3083         the hash function for the ares_htable.
3084
3085 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
3086
3087         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
3088         bit for assembly flags. MS is ok with it but there is no spec anywhere
3089         on its mean
3090
3091 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3092
3093         * class.c (mono_class_create_from_typedef): Emit profiler events
3094         in all cases.
3095
3096 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3097
3098         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
3099         Release memory on failure.
3100
3101 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3102
3103         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
3104         to the internal API.
3105
3106         * metadata.c (get_constraints): Use a single-linked table as we don't
3107         traverse it backward. Fail and return FALSE if only of the contraint types
3108         is not found.
3109
3110         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
3111         to mono_metadata_load_generic_param_constraints except for having a return value.
3112         This has to be done since the later is part of the public API.
3113
3114         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
3115         and fail the type.
3116
3117         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
3118         and fail the method.
3119
3120 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3121
3122         * metadata-verify.c (is_valid_method_header): Add work-around to deal
3123         with MS broken behavior of emmitting EH section sizes without the
3124         header size added.
3125
3126 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3127
3128         * metadata.c (mono_type_create_from_typespec): Don't allocate image
3129         memory until we're sure that we'll need it. This avoids leaking for
3130         broken types or duplicated instantiation.
3131
3132 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3133
3134         * metadata-verify.c (is_valid_method_header): Fix stupid formating
3135         mistake.
3136
3137 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3138
3139         * metadata-verify.c (is_valid_method_header): Fix number of clauses
3140         and expected size calculation.
3141
3142 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3143
3144         * class.c (mono_class_get_field_idx): Add fixme for broken
3145         behavior for types with multiple fields with the same name.
3146         I would rather fix it, but have no idea on how to generate
3147         such artifact for testing.
3148
3149 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3150
3151         * verify.c (verifier_load_field): We should allow references to
3152         fields to be made using the generic type definition. It's up to
3153         the loader system to fail invalid ops.
3154
3155         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
3156         are invalid.
3157
3158 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3159
3160         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
3161
3162         * metadata-internals.h: Fix declaration of 
3163         mono_metadata_interfaces_from_typedef_full.
3164
3165         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
3166         heap_alloc_result parameter that controls if the result should be
3167         g_malloc'd.
3168
3169         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
3170         array be g_malloc'd and properly document this public API function.
3171
3172 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3173
3174         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
3175         remove METHOD_HEADER_TINY_FORMAT1.
3176
3177         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
3178
3179         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
3180
3181         Both spec and MS uses only 2 bits to enumerate the kind of header.
3182         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
3183         is superfluous, only used for tiny headers with odd code lengths.
3184
3185         This change also make sure that mono doesn't wronly interpret bit 2
3186         of fat header flags, which is currently reserved.
3187
3188 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3189
3190         * metadata.c (do_mono_metadata_parse_type): Do error
3191         checking for element types. Don't abort if presented
3192         with a broken type kind.
3193
3194 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3195
3196         * metadata.c (mono_metadata_parse_method_signature_full):
3197         Gracefully fail bad vararg signatures.
3198
3199 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3200
3201         * profiler.c:
3202         * class.c: Fix warnings for uninitialized variables.
3203
3204 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3205
3206         * icall.c: Fix _NSGetEnviron method declaration warning.
3207
3208 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3209
3210         * icall.c:
3211         * reflection.c: Make bitwise checks explicit.
3212
3213 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3214
3215         * debug-helpers.c:
3216         * marshal.c: Fix printf warnings.
3217
3218 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
3219
3220         * reflection.c (encode_cattr_value): Fix a warning.
3221
3222 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3223
3224         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
3225         of array bounds.
3226
3227 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3228
3229         * loader.c (mono_method_signature): Don't assert on broken
3230         signature. Print a more useful error message.
3231
3232 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3233
3234         * loader.c (mono_method_get_marshal_info): Assert if
3235         signature is invalid. Bounds check stores to the
3236         mspecs array;
3237
3238 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3239
3240         * loader.c (field_from_memberref): Fix warning.
3241
3242 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3243
3244         * loader.c (mono_method_get_param_names): Check if signature
3245         is null. Don't store beyond the size of the name array.
3246
3247 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3248
3249         * loader.c (mono_get_method_constrained): Check if signature
3250         is null.
3251
3252 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3253
3254         * loader.c (mono_loader_set_error_bad_image): Improve
3255         error messages.
3256
3257 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3258
3259         * loader.c (mono_get_method_full): Convert an assertion
3260         into a loader error.
3261
3262 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3263
3264         * class-internals.h, class.c: Better naming and documentation.
3265
3266 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
3267
3268         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
3269         obj is NULL.
3270
3271 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3272
3273         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
3274         parsing fails.
3275
3276 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3277
3278         * loader.c (mono_loader_error_prepare_exception): Handle missing field
3279         errors with no class set.
3280
3281         * loader.c (field_from_memberref): If the field signature is of the wrong
3282         type fail with a MissingFieldException instead of a BadImageException as
3283         this is the behavior observed on MS. 
3284
3285 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3286
3287         * loader.c (field_from_memberref): Don't crash if either the field
3288         signature or the typespec class are invalid.
3289
3290 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3291
3292         * verify.c (verifier_load_field): Don't allow field related
3293         ops to reference fields on generic type definition.
3294
3295 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3296
3297         * metadata-verify.c: Add new warning level for errors specified
3298         by ECMA 335 but that MS ignores.
3299
3300         * metadata-verify.c (verify_method_table): Make compiler controled
3301         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
3302         this check is safe because the end result will only be some visibility
3303         exceptions been thrown.
3304
3305 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3306
3307         * verify.c (get_boxable_mono_type): Don't allow the
3308         use of the generic type definition on boxed type positions.
3309
3310         Fixes #531237.
3311
3312 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3313
3314         * threadpool.c: Make sure no cross-domain references remain in
3315         ares_htable or the arrays that are thrown away when resizing.
3316
3317 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3318
3319         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
3320         list of classes for which we have to unregister reflection_info
3321         with the GC and which are not in the namespace cache.
3322
3323         * reflection.c (mono_reflection_initialize_generic_parameter): Add
3324         the class to the list.
3325
3326 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3327
3328         * domain.c (mono_domain_free): Unregister the GC roots in
3329         MonoDomain.
3330
3331 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3332
3333         * reflection.c (mono_reflection_type_get_handle): Fix typo.
3334
3335 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3336
3337         * class.c: Add mono_class_get_field_from_name_full which does
3338         the same as mono_class_get_field_from_name but does check field
3339         signature as well.
3340
3341         * class-internals.h: Export mono_class_get_field_from_name_full as
3342         part of the internal API.
3343
3344         * loader.c (field_from_memberref): Search fields by name and signature
3345         as it's valid to have two fields with same name but different types.
3346
3347         Fixes #528055.
3348
3349 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
3350
3351         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
3352
3353         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
3354
3355         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
3356         System.Type.
3357
3358 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
3359
3360         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
3361
3362         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
3363
3364 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3365
3366         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
3367         to sgen-scan-object.h, which can be included and parameterized via
3368         macros.
3369
3370         * Makefile.am: sgen-scan-object.h added.
3371
3372 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3373
3374         * gc.c: #define GC_dont_gc if we're compiling with SGen.
3375
3376 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3377
3378         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
3379         before clearing a domain in the GC.
3380
3381 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3382
3383         * exception.c (mono_exception_from_name_domain): Actually create
3384         the exception in the specified domain.
3385
3386         * appdomain.c (mono_domain_create_appdomain_internal): Create the
3387         OutOfMemoryException a bit later so that the domain is inialized
3388         "enough" that it works.
3389
3390 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3391
3392         * threads.c (thread_cleanup): Clean up the cached_culture_info
3393         array to prevent cross-domain references.
3394
3395 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
3396
3397         * metadata.c: more documentation for MonoType accessors.
3398
3399 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
3400
3401         Fix incorrect size definitions where the tail array isn't a list
3402         of pointers
3403         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
3404         define size.
3405         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
3406         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
3407         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
3408
3409 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3410
3411         * reflection.h:
3412         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
3413
3414 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3415
3416         * metadata.c:
3417         * loader.c:
3418         * metadata-internals.h:
3419         * method-builder.c:
3420         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
3421
3422 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3423
3424         * cominterop.c:
3425         * metadata.c:
3426         * metadata.h:
3427         * loader.c:
3428         * marshal.c:
3429         * reflection.c: #define for sizeof in MonoType and
3430         MonoMethodSignature.
3431
3432 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3433
3434         * domain.c:
3435         * domain-internals.h: add and use #define's instead of sizeof()
3436         for MonoJitInfo and MonoJitInfoTable.
3437
3438 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3439
3440         * object.c:
3441         * class.h: use #define instead of sizeof() for MonoRemoteClass.
3442
3443 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
3444
3445         * metadata.c:
3446         * metadata.h:
3447         * object.c:
3448         * class-internals.h:
3449         * generic-sharing.c:
3450         * marshal.c: use a #define instead of sizeof() for a few
3451         structures that use a zero-length array.
3452
3453 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
3454
3455         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
3456         to handle inflated generic methods.
3457
3458         * appdomain.c: Bump corlib version.
3459
3460         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
3461         instances.
3462
3463         * reflection.c (fixup_method): Same
3464
3465         * reflection.c (resolve_object): Same.
3466
3467         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
3468         g_error and a decent message.
3469
3470 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
3471
3472         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
3473         from the object because it could not yet be available globally
3474         (it happens if the profiler tries to create a gchandle on the
3475         MonoThread object of a thread that is still registering itself
3476         with the runtime).
3477
3478 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
3479
3480         * reflection.c (mono_generic_class_get_object): Initialized the
3481         managed type arguments array.
3482
3483         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
3484
3485         * appdomain.c: Bump corlib version.
3486
3487 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
3488
3489         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
3490         #527902.
3491
3492 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
3493
3494         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3495         Avoid a crash if synch_cs is not set.
3496         
3497         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3498         Handle the case when the handle is 0.
3499
3500         * appdomain.c: Bump corlib version.
3501
3502 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
3503
3504         * reflection.c (mono_type_get_object): Fix a warning.
3505
3506 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3507
3508         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
3509         descriptor here.  We assume it's already been computed.
3510
3511         * generic-sharing.c (instantiate_other_info): Compute the GC
3512         descriptor for info type MONO_RGCTX_INFO_KLASS.
3513
3514 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3515
3516         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
3517         type, so don't use MONO_OBJECT_SETREF to set a field.
3518
3519 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3520
3521         * gc.c: We were missing one case where invoking a finalizer would
3522         not reset the domain.  Also, in the finalizer thread loop, assert
3523         that we're in the root domain.
3524
3525 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3526
3527         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
3528         if the type is not an array.
3529
3530 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3531
3532         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
3533         method bound to the declaring type of the method. Raise an exception
3534         if the type is not a generic param.
3535
3536 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3537
3538         * class.c (print_unimplemented_interface_method_info): Print the
3539         full type name.
3540
3541         * class.c (mono_class_setup_vtable_general): When dealing with a
3542         generic instance first check if the generic type definition is
3543         not broken.
3544
3545 2009-02-11 Tom Hindke <tom_hindle@sil.org>
3546
3547         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
3548
3549         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
3550
3551         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
3552
3553         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
3554
3555         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
3556
3557         Code is contributed under MIT/X11 license
3558
3559 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
3560
3561         * verify.c: Fix naming of stelem and ldelem.
3562
3563 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3564
3565         * generic-sharing.c: Replace the templates lock with the loader
3566         lock because of very hard to resolve deadlock issues.
3567
3568 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
3569
3570         * icall.c (ves_icall_Type_GetMethodsByName): Use 
3571         mono_class_get_vtable_size () instead of accessing klass->vtable_size
3572         directly. Fixes #525338.
3573
3574         * class.c (mono_class_get_vtable_size): New helper function.
3575
3576         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
3577         the field belongs to the type. Fixes #525733.
3578
3579 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3580
3581         * sgen-gc.c: When we stop a thread and its stack top is not within
3582         its allocated stack (because it's in an altstack signal handler),
3583         restart it and stop it again, until it is.
3584
3585 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3586
3587         * sgen-gc.c: Take a thread's stack top and registers from the
3588         sigcontext in the suspend signal handler.
3589
3590         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
3591         stuff to sgen-archdep.h.
3592
3593         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
3594         caller, because have code in sgen-archdep.h to acquire that data.
3595
3596 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
3597
3598         * profiler.c, profiler.h, profiler-private.h:
3599         Added support for keeping track of code chunks and buffers.
3600
3601 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
3602
3603         * metadata-verify.c: Fix endianness problems on decoding functions.
3604         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
3605
3606 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3607
3608         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
3609         schema for vectors and one dimension SZARRAY.
3610
3611 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3612
3613         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
3614         schema for vectors and one dimension SZARRAY.
3615
3616 2009-07-27  Mark Probst  <mark.probst@gmail.com>
3617
3618         * icall-def.h, thread-types.h, threads.c: New separate icalls for
3619         Interlocked.(Compare)Exchange with object arguments, which invoke
3620         write barriers.
3621
3622 2009-07-26  Miguel de Icaza  <miguel@novell.com>
3623
3624         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
3625         passed invalid arguments.   Fixes another crasher in the
3626         Silverlight test suite.
3627
3628         * class.c (mono_class_array_element_size): Return 0 for the size
3629         of the class;  This fixes the crasher exposed by :
3630
3631         typeof (void).MakeArrayType ();
3632
3633         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
3634         if there is no method to dereference.    Put all the code that
3635         depends on this inside the if (method) block.
3636
3637         This fixes the crasher exposed by Microsoft's Silvelright CLR test
3638         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
3639
3640         With this change, we pass the test.
3641         
3642         * reflection.c (mono_reflection_sighelper_get_signature_local):
3643         Only dereference the assembly if it has been set.    Fixes a
3644         crasher exposed by #525328
3645
3646 2009-07-25  Mark Probst  <mark.probst@gmail.com>
3647
3648         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
3649         don't perform the store in mono_gc_wbarrier_generic_nostore().
3650         Remove the second argument (value), which is not needed.
3651
3652 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
3653
3654         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
3655         the build.
3656
3657         * boehm-gc.c: Ditto.
3658         
3659 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3660
3661         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
3662         not perform the store itself.  Introduce
3663         mono_gc_wbarrier_generic_nostore(), which is the same as
3664         mono_gc_wbarrier_generic_store(), except it doesn't perform the
3665         store.
3666
3667 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3668
3669         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
3670         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
3671         we still need the memcpy().
3672
3673 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3674
3675         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
3676         so that big arrays are handled correctly.  Always use
3677         safe_object_get_size() to calculate array object sizes, which
3678         takes bounds into account.
3679
3680 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3681
3682         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
3683         GC descriptor is computed before we use it.
3684
3685 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3686
3687         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
3688         write barrier if necessary.
3689
3690 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3691
3692         * icall-def.h, icall.c, thread-types.h: New separate icall for
3693         VolatileWrite(object&,object) that uses a write barrier.
3694
3695         * console-unix.c, file-io.c, icall.c, threads.c: Use write
3696         barriers in icalls which write to "ref" or "out" arguments.
3697
3698 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
3699
3700         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
3701         handler in a separate icall, to reduce the size of the wrappers.
3702
3703 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3704
3705         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
3706
3707 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3708
3709         * metadata-verify.c (parse_field): Allow byref field.
3710
3711         * metadata-verify.c (parse_locals_signature): Allow byref locals.
3712
3713         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
3714
3715 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3716
3717         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
3718         Fixes #522784.
3719
3720 2009-07-20  Robert Jordan  <robertj@gmx.net>
3721
3722         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
3723         Fix invalid IL in valuetype handling (STOBJ must push the
3724         corresponding class). Fixes bug #523149.
3725
3726         Code is contributed under MIT/X11 license.
3727
3728 2009-07-20  Geoff Norton  <gnorton@novell.com>
3729
3730         * gc.c: Use proper semaphores where available on posix and darwin.
3731
3732 2009-07-19  Geoff Norton  <gnorton@novell.com>
3733
3734         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
3735
3736 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
3737
3738         * refletion.c (is_sre_usertype): Change name to is_usertype and
3739         invert it's result so it returns true if the type is an user type
3740         and not the opposite.
3741
3742         * reflection.c (is_*_type): Change all of those to use new macro
3743         check_corlib_type_cached that cached the type lookup so we don't
3744         need to do string comparisons all the type. Changed the signature
3745         to take a MonoClass instead.
3746
3747         * reflection.c: Change mono_image_create_token and resolve_object
3748         to use is_sre_* functions.
3749
3750 2009-07-18  Mark Probst  <mark.probst@gmail.com>
3751
3752         * sgen-gc.c: Check for writes to the stack in the managed
3753         wbarrier as well.
3754
3755 2009-07-18  Mark Probst  <mark.probst@gmail.com>
3756
3757         * sgen-gc.c: When a thread is unregistered, don't free its remsets
3758         but put them on a list which is processed with the other thread's
3759         remsets.
3760
3761 2009-07-18  Mark Probst  <mark.probst@gmail.com>
3762
3763         * sgen-gc.c: Fix and enable the internal allocator instead of
3764         using malloc/free (which causes deadlocks).
3765
3766 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
3767
3768         * refletion.c: Fix builds with SRE disabled by adding a minimal
3769         implementation of mono_reflection_type_get_handle.
3770
3771 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
3772
3773         * refletion.c: Make mono_reflection_type_get_handle non static.
3774
3775         * object-internals.h: Export mono_reflection_type_get_handle.
3776
3777         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
3778         unmanaged handle using mono_reflection_type_get_handle.
3779
3780 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
3781
3782         * refletion.c: Replace all reads of MonoReflectionType::type with
3783         calls to mono_reflection_type_get_handle. Only the functions that
3784         deal with constructing TypeBuilder::type have not been changed
3785         because they have to deal with NULL values.
3786
3787         This is a first step into supporting reflection types that don't
3788         map directly into their unmanaged counterpart.
3789
3790 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
3791
3792         * metadata-verify.c (parse_locals_signature): Don't complain
3793         on signature with zero locals since MS generates it and doesn't
3794         bother with.
3795
3796 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
3797
3798         * reflection.c (mono_image_get_array_token): Resolve return
3799         type using mono_reflection_type_get_handle.
3800
3801         * reflection.c (mono_image_get_array_token): Resolve array method
3802         parent type using mono_reflection_type_get_handle.
3803
3804 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
3805
3806         * reflection.c (mono_image_basic_init): Applied patch from
3807         <Dax@daxxfiles.net>. Set the public key token from the assembly
3808         builder. Fixes #518909.
3809
3810         * appdomain.c: Bump corlib version.
3811
3812 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
3813
3814         * class.c (mono_class_needs_cctor_run): Make this return false if
3815         the class has no cctor.
3816
3817 2009-07-13  Mark Probst  <mark.probst@gmail.com>
3818
3819         * sgen-gc.c: When the minor GC needs to allocate a new section,
3820         invoke the major GC afterwards.
3821
3822 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
3823
3824         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
3825           Applying the window_style field to the SHELLEXECUTEINFO struct.
3826
3827         Code is contributed under MIT/X11 license.
3828
3829 2009-07-13  Mark Probst  <mark.probst@gmail.com>
3830
3831         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
3832         locking earlier.  Fix it in the managed allocator by making sure
3833         that no thread is stopped there before the GC runs.  If we do stop
3834         a thread there, we restart it and let it run a but, until it stops
3835         somewhere else.
3836
3837         * gc-internal.h, gc.c: Function for getting the IP from a signal
3838         context via a function registered by mini.
3839
3840 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
3841
3842         * object-internals.h (MonoIntPtr): New structure describing a boxed
3843         IntPtr.
3844
3845         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
3846         returns. Fixes #519953.
3847
3848         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
3849
3850 2009-07-09  Mark Probst  <mark.probst@gmail.com>
3851
3852         * class-internals.h, generic-sharing.c: New RGCTX info type for
3853         getting a remoting invoke with check wrapper.
3854
3855 2009-07-07  Geoff Norton  <gnorton@novell.com>
3856
3857         * icall-def.h: Fix the enable-minimal build.
3858
3859 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3860
3861         * object-internals.h: Add MonoReflectionDerivedType.
3862
3863         * reflection.c: Implement support for PointerType.
3864         Fixed tons of warnings.
3865
3866 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3867
3868         * object-internals.h: Add MonoReflectionByRefType.
3869
3870         * reflection.c: Implement support for ByRefType.
3871
3872 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3873
3874         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
3875
3876         * object-internals.h: Add MonoReflectionArrayType and
3877         mono_reflection_create_unmanaged_type.
3878
3879         * reflection.c: Implement support for ArrayType.
3880
3881 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
3882
3883         * metadata-verify.c (is_valid_method_header): Parse EH block
3884         flags correctly.
3885
3886 2009-07-03  Mark Probst  <mark.probst@gmail.com>
3887
3888         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
3889         processing the disappearing links, and process disappearing links
3890         in a loop until no new objects are copied.
3891
3892 2009-07-03  Mark Probst  <mark.probst@gmail.com>
3893
3894         * object.c (handle_enum): Invoke the write barrier when copying
3895         value type instances.
3896
3897         * sgen-gc.c: Register remsets for unmanaged write barriers only
3898         when the address written to is actually on the heap.  This makes
3899         set_value() in object.c work without requiring that the result be
3900         on the heap.
3901
3902 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
3903
3904         The runtime wrappers are all bound to a given type that must
3905         exist in the same image. For regular images we use the <Module>
3906         type, which is required to exist for all images.
3907
3908         The <Module> type can't be used for dynamic images because it
3909         might not exist at the time the wrapper is required, so we create
3910         a synthetic type to use instead.
3911
3912         The current code works because of the 2 stage setup of MonoClass,
3913         but once this is gone it will no longer work.
3914
3915         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
3916
3917         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
3918
3919         * object-internals.h: Export mono_image_set_wrappers_type icall
3920         as part of the internal API.
3921
3922         * marshal.c (get_wrapper_target_class): If the image is dynamic,
3923         use MonoDynamicImage::wrappers_type instead of the <Module> type.
3924
3925         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
3926         image wrappers_type to the provided value.
3927
3928 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
3929
3930         * appdomain.c (deregister_reflection_info_roots): No need
3931         to use the image lock here.
3932
3933 2009-07-02  Mark Probst  <mark.probst@gmail.com>
3934
3935         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
3936
3937 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
3938
3939         * threads.c: Store the thread start argument in a hash table instead of
3940         registering it as a root, as libgc doesn't support unregistering roots
3941         under windows, leading to 'too many root sets' errors when many threads
3942         are created.
3943
3944         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
3945         shutdown, they can still be referenced by the other dying objects.
3946         Fixes #514506.
3947
3948 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
3949
3950         * socket-io.c: DontLinger does not allow LingerOptions.
3951
3952 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3953
3954         * metadata-verify.c: The spec doesn't mention that it's possible to add
3955         custom attribute to a generic parameter. Fixed.
3956
3957 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3958
3959         * class.c (inflate_generic_type): Don't crash while trying to output a message
3960         on why we're aborting.
3961
3962 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
3963
3964         * socket-io.c: DontLinger can take an int or a boolean too.
3965
3966 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
3967
3968         * gc.c: check for a null argument to SuppressFinalize () and
3969         ReRegisterForFinalize ().
3970
3971 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
3972
3973         * loader.c (method_from_methodspec): Call into the verifier to check
3974         the signature.
3975
3976         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
3977
3978         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
3979         part of the internal API.
3980
3981 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3982
3983         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
3984         the signature.
3985
3986         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
3987
3988         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
3989         part of the internal API.
3990
3991 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
3992
3993         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
3994         the signature.
3995
3996         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
3997         blob verification.
3998
3999         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4000         part of the internal API.
4001
4002 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4003
4004         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
4005         when doing basic verification. 
4006
4007         This check must be done since the runtime peeks into signatures in much
4008         more places than it does decoding so it makes sense to ensure that all
4009         pointers to blob objects are well formed.
4010
4011 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4012
4013         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
4014         Use proper overflow dectection. Fix usage of it.
4015
4016 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4017
4018         * loader.c (field_from_memberref): Call into the verifier to check
4019         the signature.
4020
4021         * loader.c (mono_method_get_signature_full): Same.
4022
4023         * loader.c (method_from_memberref): Same.
4024
4025         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
4026
4027         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4028         part of the internal API.
4029
4030 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4031
4032         * threadpool.c (mono_thread_pool_add): If the domain is unloading
4033         or unloaded, still return an AsyncResult, but don't add it to the
4034         threadpool.
4035
4036 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
4037
4038         * threads.c: fix missing colon when DEBUG is defined.
4039
4040 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4041
4042         * threadpool.c: Don't add new calls to a threadpool if the domain
4043         of the call is unloading or unloaded.  When dequeuing a job, null
4044         the reference in the queue.
4045
4046 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4047
4048         * sgen-gc.c (null_link_in_range): Add the dislink for the old
4049         generation if an object was moved.
4050
4051 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
4052
4053         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
4054           parameters of type SAFEARRAY[VARIANT].
4055
4056         * reflection.c (encode_marshal_blob): Properly generate element type
4057           (SafeArraySubType marshal attribute option).
4058
4059         Code is contributed under MIT/X11 license.
4060
4061 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
4062
4063         * reflection.c: in mono_method_clear_object () really ensure all the
4064         objects are removed.
4065
4066 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4067
4068         * loader.c (mono_method_signature): Call into the verifier to check
4069         the method signature.
4070
4071         * metadata-verify.c (verify_method_table): Move signature verification
4072         to verify_method_table_full.
4073
4074         * metadata-verify.c: Add mono_verifier_verify_method_signature.
4075
4076         * verify-internals.h: Export mono_verifier_verify_method_signature as
4077         part of the internal API.
4078
4079 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4080
4081         * loader.c (mono_method_get_header): Call into the verifier to
4082         check the method header.
4083
4084         * metadata-verify.c: Add mono_verifier_verify_method_header.
4085
4086         * verify-internals.h: Export mono_verifier_verify_method_header as
4087         part of the internal API.
4088
4089 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4090
4091         * class.c (mono_class_find_enum_basetype): Call into the verifier to
4092         check the field signature. Replace an assert with an explicit check.
4093
4094         * class.c (mono_class_setup_fields): Call into the verifier to check
4095         the field signature.
4096
4097         * metadata-verify.c: Add mono_verifier_verify_field_signature.
4098
4099         * verify-internals.h: Export mono_verifier_verify_field_signature as
4100         part of the internal API.
4101
4102 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4103
4104         * class.c (mono_class_find_enum_basetype): Simplify this function
4105         by moving code outside of the loop and not decoding static fields.
4106
4107 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4108
4109         * metadata-verify.c (verify_typedef_table): Check the extends
4110         token here. Move to here a flags check from verify_typedef_table_full.
4111
4112 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
4113
4114         * metadata-verify.c (is_valid_method_header): Fix a warning.
4115
4116         * metadata-internals.h (MonoImage): Remove the unused 
4117         static_rgctx_invoke_wrapper_cache.
4118
4119         * image.c marshal.c: Ditto.
4120
4121 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4122
4123         * image.c (do_mono_image_load): Enable table data verification.
4124
4125 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4126
4127         * metadata-verify.c (is_valid_constant): Fix nullref check.
4128
4129 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4130
4131         * metadata-verify.c (is_valid_constant): Fix string bounds check.
4132
4133 2009-06-22  Mark Probst  <mark.probst@gmail.com>
4134
4135         * sgen-gc.c: Managed allocation with pthreads TLS.
4136
4137         * threads.c, threads-types.h: Functions for the JIT to tell the
4138         runtime whether it supports the MONO_TLS opcode.
4139
4140 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4141
4142         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
4143         without methods.
4144
4145 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4146
4147         * metadata-verify.c (is_valid_constant): Fix the string length check.
4148         Use safe overflow checking. Add decent error messages.
4149
4150 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4151
4152         * metadata-verify.c: Move remaininh blob checks to the offline
4153         verification path.
4154
4155 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4156
4157         * metadata-verify.c: Move more blob checks to the offline verification
4158         path.
4159
4160 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
4161
4162         * object-internals.h : Adding interrupt_on_stop field.
4163
4164         * threads.c (mono_thread_request_interruption) : On Windows exit the
4165           thread if interrupt_on_stop is set.
4166
4167         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
4168          Removing old interrupt logic and setting the interrupt_on_stop for the
4169          thread when calling accept.
4170
4171         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
4172          setting the interrupt_on_stop for the thread when calling accept.
4173
4174         Contributed under MIT/X11 license.
4175
4176 2009-06-20  Martin Baulig  <martin@ximian.com>
4177
4178         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
4179
4180 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
4181
4182         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
4183         running in no-exec mode.
4184
4185 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4186
4187         * metadata-verify.c (verify_method_table): Move header
4188         checking to verify_method_table_full.
4189
4190         * metata-verify.c (mono_verifier_verify_full_table_data):
4191         Call verify_method_table_full.
4192
4193 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4194
4195         * metadata-verify.c (verify_field_table): Move signature
4196         checking to verify_field_table_full.
4197
4198         * metata-verify.c (mono_verifier_verify_full_table_data):
4199         Call verify_field_table_full.
4200
4201 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4202
4203         * metadata-verify.c (verify_typedef_table): Move remaining
4204         stuff to verify_typedef_table_full.
4205
4206 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4207
4208         * metadata-verify.c: Kill is_corlib from VerifyContext.
4209         It is only used by the offline mode.
4210         So we better remove it from the runtime path.
4211
4212 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4213
4214         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
4215         function that perform the offline metadata verification steps.
4216
4217         * metadata-verify.c (verify_typedef_table): Move some checks to
4218         verify_typedef_table_full and make it been called by new function
4219         mono_verifier_verify_full_table_data.
4220
4221         * pedump.c: Call mono_verifier_verify_full_table_data.
4222
4223         * verify-internals.h: Export mono_verifier_verify_full_table_data as
4224         part of the internal API.
4225
4226 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4227
4228         * metadata-verify.c (typedef_is_system_object): Fix System.Object
4229         check.
4230
4231         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
4232         flags bits. SupportLastError was confused as bit 7 instead of 6.
4233
4234         * metadata-verify.c (verify_implmap_table): Fix import scope verification
4235         to check against the module ref table instead of module.
4236
4237         * metadata-verify.c (verify_implmap_table): Fix corlib check.
4238
4239         * pedump.c: Call mono_image_load_names.
4240
4241 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4242
4243         * image.c: Extract mono_image_load_names from do_mono_image_load.
4244
4245         * metadata-internals.h: Export mono_image_load_names as part of
4246         the internal API.
4247         
4248 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
4249
4250         * metadata.c (mono_metadata_cleanup): Free the generic method cache
4251         first, as it could reference data in the other caches.
4252
4253 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4254
4255         * metadata-verify.c: Finished with method header verification.
4256
4257 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4258
4259         * metadata-verify.c: Added more header verification code.
4260         Now only EH clauses are missing.
4261
4262 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
4263
4264         * marshal.c (get_runtime_invoke_type): Don't share primitive types
4265         for return values.
4266
4267 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4268
4269         * metadata-verify.c: Initial method header verification.
4270
4271 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4272
4273         * metadata-verify.c (verify_import_table): The IAT contents
4274         might end been patched by the windows DL when running with
4275         coree enabled.
4276
4277 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
4278
4279         * class.c (mono_class_from_typeref): If the enclosing type is not
4280         found return null instead of crashing. Fixes #508487.
4281
4282 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
4283
4284         * normalization-tables.h : updated to the latest unicode charcter
4285           data.
4286         * appdomain.c : bump corlib version.
4287
4288 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
4289
4290         * class.c (mono_class_from_name): Fix support for assembly references
4291         in the EXPORTEDTYPE table. Fixes #511704.
4292
4293 2009-06-13  Geoff Norton  <gnorton@novell.com>
4294
4295         * domain.c: Ensure that mono_domain_assembly_open actually opens the
4296         assembly in the target domain.
4297
4298 2009-06-12  Robert Jordan  <robertj@gmx.net>
4299
4300         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
4301         because "this" of the managed signature has become an
4302         ordinary parameter in the unmanaged signature.
4303
4304 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
4305
4306         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
4307         field for owner-less generic containers.
4308
4309         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
4310         image field of the owner-less generic containers created here.
4311
4312         * metadata.c (mono_metadata_load_generic_params): Ditto, the
4313         contain is ownerless until the caller sets its owner.
4314
4315         * metadata.c (type_in_image): Handle owner-less generic containers
4316         correctly.
4317         
4318 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4319
4320         * image.c (mono_image_close): Support debug_assembly_unload for
4321         dynamic images too.
4322
4323 2009-06-11 Andrés G. Aragoneses  <aaragoneses@novell.com>
4324
4325         * class.c: Fix some typos in comments.
4326
4327 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4328
4329         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
4330
4331         * threads.c (mono_thread_execute_interruption): Avoid creating the
4332         abort exception object while holding the synch_cs lock.
4333
4334 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4335
4336         * metadata-verify.c: Verify basic cattr content.
4337
4338 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
4339
4340         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
4341         nested types.
4342         
4343         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
4344         support for nested types. Fixes #511704.
4345
4346 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4347
4348         * metadata-verify.c: Verify methodspec signatures.
4349
4350 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4351
4352         * metadata-verify.c: Verify typespec signatures.
4353
4354 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
4355
4356         * metadata.c (free_inflated_method): Call 
4357         mono_marshal_free_inflated_wrappers (), which was missed earlier.
4358
4359 2009-06-08  Miguel de Icaza  <miguel@novell.com>
4360
4361         * mono-config.c: Small change to report the PPC64/ILP32 model.
4362
4363 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4364
4365         * metadata-verify.c (parse_type): Check szarray.
4366
4367 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4368
4369         * metadata-verify.c (parse_type): Check fnptr.
4370
4371 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4372
4373         * metadata-verify.c (parse_type): Check generic instances.
4374
4375 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4376
4377         * metadata-verify.c (parse_type): Check array shape.
4378
4379 2009-06-05  Robert Jordan  <robertj@gmx.net>
4380
4381         * class.c (mono_class_create_from_typedef): Check only for
4382         mscorlib's System.Array.
4383
4384 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4385
4386         * metadata-verify.c (parse_type): Check pointer, class/valuetype
4387         and generic params. 
4388
4389         * metadata-verify.c (parse_field): Check the signature.
4390
4391 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4392
4393         * metadata-verify.c: Implement locals signature check.
4394
4395 2009-06-04  Marek Safar  <marek.safar@gmail.com>
4396
4397         * domain.c: Add .NET 4.0 Beta 1 version.
4398
4399 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
4400
4401         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
4402           For QueryInterface on CCWs consider the base class
4403           interfaces as well.
4404
4405         Code is contributed under MIT/X11 license.
4406
4407 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4408
4409         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
4410
4411         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
4412         used.
4413
4414         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
4415         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
4416
4417         * generic-sharing.c (inflate_other_data): Ditto.
4418         
4419 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
4420
4421         * metadata-verify.c: Implement property signature check.
4422
4423 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4424
4425         * sgen-gc.h: Register saving support for PPC.
4426
4427 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4428
4429         * sgen-gc.c: Fixed a pthread TLS screwup.
4430
4431 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4432
4433         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
4434         supported.
4435
4436 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4437
4438         * sgen-gc.c: Disable TLA and managed allocation if the __thread
4439         keyword is not supported.
4440
4441 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4442
4443         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
4444         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
4445         the inflated method is freed. Fixes #508389.
4446
4447         The code is contributed under the MIT/X11 license.
4448         
4449 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
4450
4451         * marshal.c (get_wrapper_target_class): New helper function.
4452         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
4453         the <Module> class of the image. Fixes #509049.
4454
4455 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4456
4457         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
4458         Check if the thread was interrupted and proccess it straight away.
4459         Makes abortion much more responsive.
4460
4461 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4462
4463         * threads.c (mono_thread_execute_interruption): Use atomic cas with
4464         MonoThread::interruption_requested to match it's counterpart.
4465
4466         Fixes a hang in abort-stress-1 on a 2 core x86.
4467
4468         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
4469         Fix warning.
4470
4471 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4472
4473         Change MonoImage::name_cache to be protected by the image lock
4474         instead of the loader lock.
4475
4476         * appdomain.c (deregister_reflection_info_roots): Protect access
4477         to name_cache.
4478
4479         * class.c (mono_image_init_name_cache): Change from the loader lock
4480         to the image lock. Check if the cache wasn't already created.
4481
4482         * class.c: Change from the loader to the image lock.
4483
4484         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
4485         the code to hold the image lock while iterating over name_cache and
4486         not go into mono_array_new holding it.
4487
4488         * metadata-internals.h: Add a comment about this change.
4489
4490 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4491
4492         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
4493         Under the 2.0 profile raise the loader error.
4494
4495         Fixes #508532.
4496
4497 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4498
4499         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
4500         of ldind opcode for generic instances so we don't fail for direct wrappers.
4501         This only affect direct calls.
4502
4503 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
4504
4505         * reflection.c (create_dynamic_mono_image): Fix warnings.
4506
4507         * generic-sharing.c (other_info_equal): Ditto.
4508         
4509 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4510
4511         * metadata-verify.c: Implement field signature check.
4512
4513 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4514
4515         * metadata-verify.c: Implement standalone signature check.
4516
4517 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
4518
4519         * metadata-verify.c: Implement methodref signature check.
4520
4521 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
4522
4523         * object-internals.h (MonoRuntimeCallbacks): New structure containing
4524         callbacks supplied by the runtime.
4525
4526         * object.c (mono_install_callbacks): New internal function to install
4527         the callbacks.
4528
4529         * object.c (mono_create_ftnptr): Move the implementation of this to
4530         mini/.
4531
4532         * object.c (mono_get_addr_from_ftnptr): Ditto.  
4533
4534 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4535
4536         * metadata-verify.c (parse_return_type): Proper byref check.
4537         * metadata-verify.c (is_valid_method_signature): Check for zero arity
4538         generic signatures and method params.
4539
4540 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4541
4542         * metadata-verify.c (decode_signature_header): Fix bounds check.
4543
4544         * metadata-verify.c (parse_custom_mods): Check custom mods.
4545
4546         * metadata-verify.c (parse_type): Do initial basic verification
4547         of valid values.
4548         
4549         * metadata-verify.c (is_valid_method_signature): Parse the generic
4550         param count.
4551
4552 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
4553
4554         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
4555         discarded based on their most specific definition so we set the method_slots
4556         array before checking if the method is acceptable or not.
4557
4558         Fixes #506757.
4559
4560 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4561
4562         * icall.c: Free the old array when resizing a mono_ptr_array.
4563
4564 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4565
4566         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
4567         for the hashes whose keys are managed objects.
4568
4569 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4570
4571         * object-internals.h, threads.c: Set the execution context on
4572         thread start here, not in corlib.
4573
4574         * appdomain.c: Bump corlib version.
4575
4576 2009-05-27  Martin Baulig  <martin@ximian.com>
4577
4578         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
4579         if `_mono_debug_using_mono_debugger' is set to make things work
4580         properly when embedding Mono.
4581
4582 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4583
4584         * class.c (mono_class_setup_fields): Don't mark simd types as having
4585         16 bytes alignment as the whole runtime doesn't support.
4586
4587 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4588
4589         * metadata-verify.c (safe_read): Use endian safe read macros.
4590
4591 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
4592
4593         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
4594         it is read-only when using full aot.
4595
4596 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4597
4598         * metadata-verify.c (is_valid_method_signature): Verify parts
4599         of the return type. Provide an error message in case of failure.
4600
4601 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4602
4603         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
4604
4605 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4606
4607         * metadata-verify.c: Include the size prefix in the bounds check.
4608
4609 2009-05-22  Miguel de Icaza  <miguel@novell.com>
4610
4611         * icall.c: Remove warnings.
4612
4613         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
4614         prevent auto-detection based on GCC defines.
4615
4616         Add PS3
4617
4618         * metadata-verify.c: Do not include signal.h
4619
4620         * generic-sharing.c, marshal.c: Add returns to avoid some warning
4621         messages.  Not sure why the g_assert_not_reached is not enough to
4622         quiet the compiler.
4623         
4624
4625         * appdomain.c: Remove code that is not used when
4626         DISABLE_SHADOW_COPY is set.
4627
4628         * image.c: use g_getenv
4629
4630 2009-05-21  Miguel de Icaza  <miguel@novell.com>
4631
4632         * reflection.c: Remove code that it not used with
4633         DISABLE_REFLECTION_EMIT is defined.
4634
4635 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
4636
4637         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
4638         invoke wrappers.
4639
4640 2009-05-20  Miguel de Icaza  <miguel@novell.com>
4641
4642         * socket-io.c
4643         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
4644         the ifdef here and instead put that on io-layer
4645
4646 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4647
4648         * metadata-verify.c: Verify the generic param constraint table.
4649
4650 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4651
4652         * metadata-verify.c (verify_generic_param_table): Fix
4653         thinko on the valid flags bits for generic params.
4654
4655 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4656
4657         * metadata-verify.c: Verify the methodspec table.
4658
4659 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4660
4661         * metadata-verify.c: Verify the generic param table.
4662
4663 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4664
4665         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
4666
4667 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4668
4669         * sgen-gc.c: Use generation enum more consistently and use the
4670         correct generation in mono_gc_register_for_finalization().
4671
4672 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4673
4674         * metadata-verify.c: Verify the nested class table.
4675
4676 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4677
4678         * metadata-verify.c: Verify the manifest resource table.
4679
4680 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
4681
4682         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
4683
4684 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
4685
4686         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
4687         wrappers, this is now done in the JIT.
4688         
4689         * class.c (mono_set_generic_sharing_supported): New internal function.
4690         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
4691
4692 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4693
4694         * metadata-verify.c: Verify the exported type table.
4695
4696 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4697
4698         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
4699
4700 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4701
4702         * metadata-verify.c: Verify the file table.
4703
4704 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4705
4706         * metadata-verify.c (verify_assembly_table): Fix an error message.
4707
4708         * metadata-verify.c: Verify the assemblyref table.
4709
4710 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4711
4712         * metadata-verify.c (verify_assembly_table): Fix the valid
4713         bits mask for flags.
4714
4715 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
4716
4717         * debug-helpers.c (mono_method_full_name): Print generic parameters of
4718         generic methods as well.
4719
4720 2009-05-15  Geoff Norton  <gnorton@novell.com>
4721
4722         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
4723         use-case and is significantly more performant than the wapi layer.
4724
4725 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4726
4727         * metadata-verify.c: Verify the assembly table.
4728
4729 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4730
4731         * metadata-verify.c: Fix rows limit check.
4732
4733 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4734
4735         * metadata-verify.c: Verify the fieldrva table.
4736
4737 2009-05-13  Mark Probst  <mark.probst@gmail.com>
4738
4739         * sgen.c: Speed up weak links and finalizers by grouping them by
4740         generation.
4741
4742 2009-05-13  Mark Probst  <mark.probst@gmail.com>
4743
4744         * marshal.c (delegate_hash_table_add): When overwriting an entry,
4745         free the old GCHandle (only applies to SGen).
4746
4747 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
4748
4749         * loader.c (mono_get_method_from_token): Avoid the expensive call to
4750         mono_metadata_load_generic_params () for non-generic methods.
4751
4752 2009-05-12  Mark Probst  <mark.probst@gmail.com>
4753
4754         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
4755         New function for returning a monitor's weak link if it has one.
4756
4757         * sgen-gc.c: Remove an object's monitor's weak link (if it has
4758         one) when clearing a domain.  These can still be around because
4759         the object might not have been collected.
4760
4761 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
4762
4763         * gc.c: Fix a warning.
4764
4765 2009-05-12  Kornél Pál  <kornelpal@gmail.com>
4766
4767         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
4768         prevous wait that resulted in a deadlock on Windows when initializing
4769         the runtime form DllMain. Also results in improved startup time.
4770         (finalizer_thread): Get rid of thread_started_event.
4771         * threads.c, threads-types.h (mono_thread_create_internal): Return the
4772         resulting MonoThread.
4773
4774         Contributed under MIT/X11 license.
4775
4776 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
4777
4778         * metadata-verify.c: Verify the implmap table.
4779         Don't require that #US and #Strings be present.
4780
4781 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
4782
4783         * security-core-clr.c: Delegate checks are done at creation time,
4784         not a invocation time. Fix exception for Telerik Silverlight demo
4785
4786 2009-05-11  Mark Probst  <mark.probst@gmail.com>
4787
4788         * sgen-gc.c (need_remove_object_for_domain): Remove the special
4789         case for the Thread class.
4790
4791         * threads.c: Do clean-up of abort exception/state in
4792         thread_cleanup() instead of Thread.free_internal().  Also clean up
4793         current_appcontext.  The reason we have to do that is because
4794         those references might point into another domain and if that
4795         domain is unloaded before the thread is finalized, they point to
4796         invalid data.
4797
4798 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
4799
4800         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
4801         stub signatures.
4802         
4803         Contributed unter MIT/X11 license.
4804
4805 2009-05-09  Miguel de Icaza  <miguel@novell.com>
4806
4807         * verify.c, metadata-verifier.c: Add support for disabling the
4808         verifier in some builds.
4809
4810         [ Sorry, my previous commit accidentally commited some work in
4811         progress ]
4812
4813 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
4814
4815         * class.c (mono_class_setup_fields): Set class->field.first for
4816         generic instances.
4817
4818 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
4819
4820         * metadata-verify.c: Verify the typespec table.
4821
4822 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
4823
4824         * metadata-verify.c: Verify the module table.
4825
4826 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4827
4828         * metadata-verify.c: Verify the methodimpl table.
4829
4830 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
4831
4832         * metadata-verify.c: Verify the property table.
4833
4834 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
4835
4836         * debug-helpers.c (mono_method_desc_match): Add support for generic
4837         glob patterns.
4838
4839 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
4840
4841         * metadata-verify.c: Verify the propertymap table.
4842
4843 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
4844
4845         * metadata-verify.c: Verify the event table.
4846
4847         * metadata-verify.c (search_sorted_table): Fix offset
4848         calculation.
4849
4850 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
4851
4852         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
4853
4854 2009-05-01  Mark Probst  <mark.probst@gmail.com>
4855
4856         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
4857         because mono_delegate_free_ftnptr() needs it.
4858
4859 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4860
4861         * metadata-verify.c: Verify the eventmap table.
4862
4863 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4864
4865         * metadata-verify.c: Verify the standalonesig table.
4866
4867 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4868
4869         * metadata-verify.c: Verify the field layout table.
4870
4871 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4872
4873         * class.c (mono_type_get_name_recurse): Don't crash
4874         for ownerless generic params.
4875
4876         * debug-helpers.c (mono_type_get_desc): Correct the format
4877         for ownerless generic params.
4878
4879 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4880
4881         * metadata-verify.c: Verify the class layout table.
4882
4883 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
4884
4885         * metadata-verify.c: Verify the decl security table.
4886
4887 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4888
4889         * domain.c (mono_domain_set_internal_with_options): Don't do
4890         anything if the old domain is the same as the old one.  Fixes
4891         #499326.
4892
4893 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4894
4895         * appdomain.c: Deregister the reflection_info roots when unloading
4896         a domain.
4897
4898         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
4899         memory allocated by a domain and frees its disappearing links.
4900
4901         * boehm-gc.c, null-gc.c: Empty implementation of
4902         mono_gc_clear_domain().
4903
4904 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4905
4906         * appdomain.c (clear_cached_vtable): Free the static fields memory
4907         block.
4908
4909 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4910
4911         * gc.c: Set the correct domain when invoking finalizers.
4912
4913         * appdomain.c: Set the correct domain when creating threads.
4914
4915 2009-04-30  Mark Probst  <mark.probst@gmail.com>
4916
4917         * sgen-gc.c: Fix skip size for vectors.
4918
4919 2009-05-03  Martin Baulig  <martin@ximian.com>
4920
4921         * mono-debug-debugger.c
4922         (mono_debugger_check_breakpoints): Check class init handlers even
4923         if we don't have any method load handers.
4924
4925 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
4926
4927         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
4928         returning refonly assemblies if refonly is FALSE. Fixes #499013.
4929
4930 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
4931
4932         * metadata-verify.c: Verify the field marshal table.
4933
4934 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
4935
4936         * metadata-verify.c: Verify the custom attribute table.
4937
4938 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4939
4940         * metadata-verify.c: Verify the constant table.
4941
4942 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4943
4944         * metadata-verify.c: Verify the memberef table.
4945
4946 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4947
4948         * metadata-verify.c (get_coded_index_token): Remove
4949         dead argument.
4950
4951 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4952
4953         * metadata-verify.c: Verify the interfaceimpl table.
4954
4955 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
4956
4957         * verify.c: Improve error message.
4958
4959         * debug-helpers.c (mono_type_get_desc): Harden the code that
4960         deals with VAR and MVAR.
4961
4962 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
4963
4964         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
4965         part of #498692.
4966
4967 2009-04-23 Tom Hindle <tom_hindle@sil.org>
4968
4969         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
4970         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
4971
4972 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
4973
4974         * security-core-clr.c: Avoid redundant checks for platform code, 
4975         e.g. check for method and for class (very common) and check
4976         for class and outer class (less common)...
4977
4978 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
4979
4980         * reflection.c: Avoid returning random cattrs for synthetic methods.
4981         Fixes #498545.
4982
4983 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4984
4985         * assembly.c: assemblies in the GAC should never be shadow-copied.
4986
4987 2009-04-26  Mark Probst  <mark.probst@gmail.com>
4988
4989         * domain.c, domain-internals.h: Disable
4990         track_resurrection_{objects,handles}_hash in MonoDomain if using
4991         SGen.
4992
4993 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4994
4995         * metadata-verify.c: Verify the param table.
4996
4997 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
4998
4999         * metadata-verify.c (verify_typedef_table): Range check FieldList and
5000         MethodList.
5001
5002         * metadata-verify.c (verify_method_table): Proper check the ParamList
5003         field.
5004
5005 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5006
5007         * metadata-verify.c (verify_method_table): Check for runtime
5008         implemented functions such as delegate .ctors. Remove spurious
5009         printf.
5010         
5011 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5012
5013         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
5014
5015 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5016
5017         Don't allocate MonoGenericInfo for ownerless generic params.
5018         * class-internals.h (MonoGenericParam::info): Move field to ...
5019         (MonoGenericParamFull): ... this.  New struct.
5020         (MonoGenericContainer::type_params): Change type to
5021         MonoGenericParamFull.
5022         (MonoGenericParam, MonoGenericContainer): Update accessors.
5023         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
5024         'info' field for ownerless generic param.
5025         (mono_metadata_load_generic_params): Update to changes.
5026         * reflection.c (mono_reflection_create_generic_class): Likewise.
5027         (reflection_methodbuilder_to_mono_method): Likewise.
5028         (mono_reflection_initialize_generic_parameter): Likewise.
5029
5030 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5031
5032         Don't use MonoGenericParamInfo for ownerless generic params.
5033         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
5034         use ParamInfo class at all.
5035         (mono_class_from_generic_parameter): Use them.
5036         (make_generic_param_class): Fix a couple of instances where 'pinfo
5037         == NULL' wasn't handle.
5038
5039 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5040
5041         * class.c (make_generic_param_class): Carve out of ...
5042         (mono_class_from_generic_parameter): ... here.
5043
5044 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5045
5046         Simplify mono_class_from_generic_parameter
5047         * class-internals.h (MonoGenericParamInfo::token): New field.
5048         * metadata.c (mono_metadata_load_generic_params): Initialize it
5049         from metadata.
5050         * class.c (mono_class_from_generic_parameter): Use it instead of
5051         searching through metadata.
5052
5053 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5054
5055         * metadata-verify.c: Add verification of the method table.
5056
5057 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5058
5059         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
5060         Delegate::Invoke optimization.
5061
5062 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5063
5064         * appdomain.c (mono_domain_create_appdomain_internal): Free the
5065         string returned by get_shadow_assembly_location_base.
5066
5067         * appdomain.c (get_shadow_assembly_location_base): Add a comment
5068         about caller's ownership.
5069
5070 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5071
5072         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
5073         reflection memory on domain unload.
5074
5075         * domain.c (mono_domain_free): Don't free refobject_hash, let the
5076         reflection cleanup code do it.
5077
5078         * domain-internals.h: Add mono_reflection_cleanup_domain.
5079
5080         This fixes a memory leak for managed mirrors of reflection objects
5081         on domain unload. 
5082
5083 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5084
5085         * metadata-verify.c: Implement more verification of the field table.
5086
5087 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5088
5089         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
5090         doesn't try to parse the input assembly, which can be broken.
5091
5092 2009-04-23  Mark Probst  <mark.probst@gmail.com>
5093
5094         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
5095         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
5096         by using the lowest bit in the link to store whether the link is
5097         tracked.  Move the track_resurrection hashes into boehm-gc.c.
5098
5099 2009-04-22  Miguel de Icaza  <miguel@novell.com>
5100
5101         * Makefile.am: Split the console support in platform specific code
5102         and put together a framework for making this easy in the future so
5103         that we can start splitting code instead of having a mess of PLATFORM_WIN32
5104
5105 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5106
5107         * pedump.c: Fix a warning.
5108
5109 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5110
5111         * verify.c (mono_delegate_type_equal): Compare valuetypes using
5112         mono_class_from_mono_type to avoid bad interactions with the dual representation
5113         of the generic type definition.
5114
5115 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5116
5117         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
5118         get the MonoClass for the call context type as it might be a generic
5119         instance.
5120
5121         Fixes #491483.
5122
5123 2009-04-21  Mark Probst  <mark.probst@gmail.com>
5124
5125         * object-internals.h: The Thread object has no execution_context
5126         member anymore.
5127
5128         * threads.c, threadpool.c, threads-types.h: Accessor functions for
5129         the execution context.
5130
5131         * appdomain.c: Bump corlib version.
5132
5133 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5134
5135         * verify.c (do_newobj): Improve error message.
5136
5137 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5138
5139         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
5140         is nested in the filter block.
5141
5142         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
5143         block is not fully nested.
5144
5145         Fixes #495656.
5146
5147 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5148
5149         * verify.c (verify_type_compatibility_full): Compare MonoClass and
5150         not MonoType to check for equality of valuetypes as the generic type
5151         definition allows for two different encodings: the generic type definition
5152         class or a generic instance over the GTD arguments.
5153
5154         Fixes #496175.
5155
5156 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5157
5158         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
5159
5160         * verify.c (do_initobj): Improve error message.
5161
5162 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5163
5164         * metadata-verify.c: Enable pe verification as the issue with #496453
5165         is that the authenticode data directory have a different unspecified
5166         format. Ignore it for now.
5167
5168         * pedump.c: Run the metadata verifier together with the IL verifier.
5169
5170         Fixes ##496453.
5171
5172 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
5173
5174         * metadata-verify.c: Temporarily disable pe verification due to #496453.
5175
5176 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5177
5178         * class.c (can_access_type): Check visibility against
5179         the element type for pointers and arrays.
5180
5181         Fixes #496150.
5182
5183 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5184
5185         * metadata-verify.c: Fix cli and table verification to use information
5186         from the MonoImage. A lot of duplicated code got killed.
5187
5188 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5189
5190
5191         This patch starts to integrate the metadata verifier with the runtime code.
5192
5193         This patch causes major regression in functionality for the metadata verifier
5194         as cli and table verification are disabled since they require to be ported to
5195         use MonoImage information.
5196
5197         * image.c (do_mono_image_load): Split the code in this function
5198         into mono_image_load_pe_data and mono_image_load_cli_data.
5199         Add     care_about_pecoff parameter to not load pecoff data.
5200         Call into the metadata verifier for pecoff and cli verification.
5201
5202         * image.c (mono_image_open_raw): New function that doesn't perform
5203         any parsing of the image contents.
5204         
5205         The reason for the 3 new functions is to give pedump better control
5206         into the interaction with the verifier.
5207
5208         * metadata-internals.h: Add new functions from image.c as part of the
5209         internal mono API.
5210
5211         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
5212         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
5213         to make those functions work together with the runtime.
5214
5215         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
5216         true if the image needs to be verified.
5217
5218         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
5219
5220         * pedump.c: Use new metadata verifier API.
5221
5222 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
5223
5224         * object.c (mono_install_vtable_trampoline): Make this receive a
5225         trampoline creation function instead of trampoline, allowing the JIT
5226         to use a different trampoline for each vtable.
5227
5228 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5229
5230         * object.c (mono_raise_exception): Don't reset the thread abort
5231         exception state here.
5232
5233 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5234
5235         * icall-def.h: New icall for getting the thread abort exception
5236         state for a thread.
5237
5238         * object.c, thread.c, object-internals.h: A thread's abort
5239         exception state is now a GC handle.  To get the object it stands
5240         for, we must move it into the current app domain, if it's
5241         different than the one where it originated from.
5242
5243         * appdomain.c: Bump corlib version.
5244
5245         * domain.c, domain-internals.h: New function for setting the
5246         domain and migrate the thread abort exception or not.
5247
5248 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5249
5250         * metadata-verify.c: Add initial verification of the
5251         field table.
5252
5253 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5254
5255         * metadata-verify.c: Add a macro to conditionally enable
5256         dumping of verification information. Add  make_coded_token
5257         and search_sorted_table to enable search sorted tables
5258         by a given coded token.
5259
5260 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5261
5262         * metadata-verify.c: Add array mapping from table index
5263         to description offset. Add get_col_offset and get_col_size
5264         functions.
5265
5266 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5267
5268         * metadata-verify.c: Add remaining table descriptions offsets.
5269         Add remaining coded index descriptions.
5270
5271 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5272
5273         * metadata-verify.c: Fixed constant table description.
5274         Fixed calculation of HasCustomAttribute coded index size.
5275         Fixed calculation of size for many table indexes. 
5276
5277 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5278
5279         * pedump.c (dump_metadata): Dump table offset instead
5280         of useless pointer in memory.
5281
5282 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5283
5284         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
5285
5286 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5287
5288         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
5289         a missing of for interface types.
5290
5291 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5292
5293         * metadata-verify.c (verify_pe_optional_header): Add comment of why
5294         the code is commented.
5295
5296         * metadata-verify.c (verify_resources_table): Remove spurious printf
5297         and don't fail if there are unmanaged resources. Gmcs generates a useless
5298         one     for all assemblies - I bet it's some MS compatibility junk.
5299
5300 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5301
5302         * metadata-verify.c (verify_typedef_table): Verify the extends field.
5303
5304         * metadata-verify.c (mono_image_verify): Add a is_corlib.
5305
5306         * verify-internals.h: Same.
5307
5308         * pedump.c: Fix for mono_image_verify new signature.
5309
5310 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5311
5312         * metadata-verify.c (verify_typedef_table): Verify for some invalid
5313         flags combinations.
5314
5315 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5316
5317         * metadata-verify.c (verify_module_table): Ignore the generation field.
5318
5319 2009-04-15  Martin Baulig  <martin@ximian.com>
5320
5321         * debug-mono-symfile.c
5322         (mono_debug_symfile_lookup_location): Don't print a warning for
5323         unknown extended opcodes if they're within 0x40 and 0x7f.
5324
5325 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
5326
5327         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
5328         invoke signatures returning an enum. Fixes #494847.
5329
5330 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5331
5332         * metadata-verify.c: Initial code to verify the typedef table.
5333
5334 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5335
5336         * verify.c (mono_method_verify): Don't fail if an unconditional branch
5337         with non empty stack happens before the beginning of a try block.
5338
5339         Fixes #494812.
5340
5341 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5342
5343         * metadata-verify.c: Verify typename and typenamespace fields of
5344         the typeref table.
5345
5346 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5347
5348         * metadata-verify.c: Initial code to verify the typeref table.
5349
5350 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5351
5352         * verify.c (verify_delegate_compatibility): Fix error message.
5353
5354 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
5355
5356         * security-core-clr.c: Fix typo
5357
5358 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5359
5360         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
5361         a MonoGHashTable to keep its values alive.
5362         (emit_marshal_boolean): Fix a warning.
5363
5364 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5365
5366         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
5367         not have any interface configured for IPv4/IPv6.
5368
5369 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5370
5371         * assembly.c: fix typo in error message.
5372
5373 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5374
5375         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
5376         allocating the location holding the this argument to prevent
5377         'too many root sets' errors.
5378
5379         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
5380         to mark fields as special static.
5381         (mono_field_static_get_value): Handle special static fields.
5382         (mono_field_static_set_value): Ditto.
5383
5384         * class-internals.h (struct _MonoClassField): Document this.
5385
5386 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5387
5388         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
5389           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
5390           case.  This will handle when managed code returns null to native code.
5391
5392         Code is contributed under MIT/X11 license.
5393
5394 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5395
5396         * object.c (build_imt_slots): Changing a free to a g_free to match
5397           the g_malloc0 in add_imt_builder_entry that allocated this memory.
5398
5399         Code is contributed under MIT/X11 license.
5400
5401 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5402
5403         * marshal.c (emit_marshal_boolean): Adding code to ensure that
5404           the correct TRUE value is passed through the marshaling layer.
5405
5406         Code is contributed under MIT/X11 license.
5407
5408 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
5409
5410         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
5411         correctly. Fixes #492330.
5412         
5413         * marshal.c: Fix the embedding of object pointers into JITted code in
5414         the native-to-managed wrappers by allocating some GC tracked memory, and
5415         embedding the address of that.
5416
5417 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
5418
5419         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
5420         pointers into the vtable.
5421
5422 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
5423
5424         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
5425
5426         * verify.c (verify_ldftn_delegate): Improve error message.
5427
5428 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5429
5430         * reflection.c (my_mono_class_from_mono_type): Remove.
5431
5432 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5433
5434         Prepare to reduce memory usage of owner-less generic parameters (1/n)
5435         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
5436         and constraints fields into ...
5437         (MonoGenericParamInfo): ... this.
5438         (mono_generic_param_info, mono_generic_container_get_param_info):
5439         New accessors.
5440         * class.c, debug-helpers.c, icall.c: Update to changes.
5441         * metadata.c, reflection.c, verify.c: Likewise.
5442
5443 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
5444
5445         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
5446
5447         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
5448         
5449         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
5450         booleans with sbytes.
5451
5452 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5453
5454         * class.c (can_access_instantiation): Verify accesibility of element types
5455         for arrays and pointers.
5456
5457         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
5458
5459         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
5460
5461         Fixes #493068.
5462
5463 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5464
5465         * verify.c (do_invoke_method): Improve error messages.
5466
5467 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
5468
5469         * verify.c:  Fixing the MSVC build.
5470
5471         Code is contributed under MIT/X11 license.
5472
5473 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5474
5475         * security-core-clr.c: Simplify get_reflection_caller not to call
5476         mono_method_get_last_managed (another stack walk) and adjust the
5477         callers to handle a (should not happen) NULL return value.
5478
5479 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5480
5481         Add accessors to some MonoGenericParam fields
5482         * class-internals.h (mono_generic_param_owner): New accessor.
5483         (mono_generic_param_num): Likewise.
5484         (mono_type_get_generic_param_owner): New helper.
5485         (mono_type_get_generic_param_num): New helper.
5486         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
5487
5488 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5489
5490         * class-internals.h (mono_generic_container_get_param): New wrapper.
5491         * class.c, icall.c, metadata.c, verify.c: Use it.
5492
5493 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5494
5495         Fix gtest-252.cs
5496         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
5497         the standard case/loop.  In particular, don't complain about
5498         references to generic type definitions.
5499
5500 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
5501
5502         * debug-helpers.c (dis_one): Decode string arguments.
5503
5504 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5505
5506         * pedump.c (dump_verify_info): Dump type name correctly.
5507
5508 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5509
5510         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
5511         are larger than code size.
5512
5513         This can happen in valid code if the try/catch block is not followed by any instruction
5514         and do a backward branch on the leave instruction.
5515
5516         Fixes #492494.
5517
5518 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
5519
5520         * security-core-clr.c: Fix typo while comparing second method names
5521         in can_avoid_corlib_reflection_delegate_optimization
5522
5523 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5524
5525         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
5526
5527         Fixes #487738.
5528
5529 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5530
5531         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
5532         a MVAR using a class context.
5533
5534         Fixes #490335.
5535
5536 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
5537
5538         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
5539
5540         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
5541
5542         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
5543         functions supplied by the JIT for the SGEN GC.
5544
5545         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
5546         
5547 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5548
5549         monitor.c (mono_monitor_try_enter_internal):
5550         Added calls to profile monitor contentions.
5551         Also duplicated a small piece of code (the "get the monitor" logic)
5552         from the fast path to the slow path, and changed the relevant goto
5553         statements, so that monitor acquisition events can be emitted from the
5554         slow path (this is by Paolo Molaro).
5555
5556 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5557
5558         * profiler.c, profiler.h, profiler-private.h:
5559         Added support for profiling monitor contentions.
5560
5561 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
5562
5563         * metadata-verify.c: Verify the modules table.
5564
5565 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
5566
5567         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
5568         using the context of the method been verifier and not of the method been called.
5569
5570         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
5571         safely inflate generic types. 
5572
5573 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
5574
5575         * security-core-clr.c: Change the strategy for checking the 
5576         "reflection using delegates optimization" to avoid unneeded 
5577         attributes in multiple class libraries.
5578
5579 2009-04-02  Mark Probst  <mark.probst@gmail.com>
5580
5581         * sgen-gc.c: Remove object element in the disappearing link struct
5582         by storing the object pointer in the link.
5583
5584 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5585
5586         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
5587
5588 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5589
5590         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
5591
5592         * verify.c (mono_method_verify): Do proper bounds checking of exception
5593         clause ranges.
5594
5595 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5596
5597         * loader.c (mono_field_from_token): Don't crash if the field parent could
5598         not be decoded.
5599
5600 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5601
5602         * sgen-gc.c: Execute critical finalizers after ordinary
5603         finalizers.
5604
5605         * class-internals.h, domain.c: Add CriticalFinalizerObject to
5606         mono_defaults.
5607
5608 2009-03-31 Jb Evain <jbevain@novell.com>
5609
5610         * verify.c (do_ldstr): don't check if a string is in the user strings
5611         heap if the current image is dynamic.
5612
5613 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5614
5615         * sgen-gc.c: Wait until the last finalizer has executed when
5616         returning from WaitForPendingFinalizers.
5617
5618 2009-03-31  Martin Baulig  <martin@ximian.com>
5619
5620         * mono-debug-debugger.h (MonoDebuggerEvent): Add
5621         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
5622         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
5623         (mono_debugger_event_create_appdomain): New function.
5624         (mono_debugger_event_unload_appdomain): New function.
5625
5626         * appdomain.c (mono_domain_create_appdomain_internal): Call
5627         mono_debugger_event_create_appdomain().
5628
5629 2009-03-31  Martin Baulig  <martin@ximian.com>
5630
5631         * mono-debug-debugger.c
5632         (mono_debugger_register_class_init_callback): Also register the
5633         class init callback if the class is already initialized to make
5634         things work with shadow copied assemblies.
5635
5636 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
5637
5638         * security-core-clr.c
5639         (mono_security_core_clr_ensure_reflection_access_field): Let 
5640         critical code access the field (just like we do for methods). Use
5641         check_field_access helper.
5642         (mono_security_core_clr_ensure_reflection_access_method): Use 
5643         check_field_access helper.
5644
5645 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5646
5647         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
5648         call the run-finalize function directly.
5649
5650         * gc.c, gc-internal.h: Make run_finalize() non-static.
5651
5652 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5653
5654         * sgen-gc.c: Use a separate struct for disappearing links.
5655
5656 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5657
5658         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
5659         * MaxIOVectorLength enabled, just ignore them.
5660         Fixes bug #349688.
5661
5662 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
5663
5664         * metadata-verify.c: Fix eglib build.
5665
5666 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
5667
5668         * threads-types.h: Fix the win32 build.
5669
5670 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
5671
5672         * class.c: move coreclr inheritance/override checks to 
5673         security-core.clr.c
5674         * security-core.clr.c|h: add code from class.c with additional
5675         documentation. Fix override check when the method is not critical.
5676
5677 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
5678
5679         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
5680         (match_class): Ditto.
5681
5682 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5683
5684         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
5685
5686         * metadata-verify.c: Implement table layout row size calculation. Verify
5687         the total size of the tables.
5688
5689 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5690
5691         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
5692
5693 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5694
5695         * appdomain.c:
5696         * console-io.[ch]: added new mono_console_init() to make sure that
5697         file descriptors 0, 1 and 2 are opened.
5698         Bug #489019 fixed.
5699
5700 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
5701
5702         * appdomain.h: Export a new callback type and a new function to
5703         set this callback. This allow a mono host to provide it's own
5704         definition for "platform code".
5705         * metadata-internals.h: Add a core_clr_platform_code flag on 
5706         _MonoImage to (cache and) know if it is representing platform 
5707         code.
5708         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
5709         on platform code images.
5710         * security-core-clr.c|h 
5711         (mono_security_set_core_clr_platform_callback): Allow the host
5712         to provide it's own platform check definition.
5713         (mono_security_core_clr_determine_platform_image): Detect if an 
5714         image is platform code (using the specified callback).
5715         (mono_security_core_clr_is_platform_image): Return cached value 
5716         for platform code.
5717
5718 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
5719
5720         * threads.c (mono_create_thread): New helper function to wrap CreateThread
5721         which has different parameter types for the 'tid' argument in windows and
5722         the io-layer.
5723
5724         * appdomain.c attach.c threads.c: Use the new helper.
5725
5726 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
5727
5728         * metadata-verify.c: Verify valid table bits.
5729
5730 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
5731
5732         * metadata-verify.c (verify_metadata_header): Store size in the size field.
5733
5734         * metadata-verify.c: Add initial table schema verification.
5735
5736 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
5737
5738         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
5739         obtain the refclass argument needed by mono_param_get_objects (). Fixes
5740         #488383.
5741
5742         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
5743
5744         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
5745
5746 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
5747
5748         * security-core-clr.c: Add/update documentation
5749
5750 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
5751
5752         * marshal.c (emit_marshal_object): Generate code to throw an exception
5753         instead of throwing it. Fixes #488670.
5754
5755 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5756
5757         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
5758         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
5759         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
5760         and add a call to mono_security_core_clr_ensure_delegate_creation
5761         to do the extra checks required by CoreCLR.
5762         * security-core-clr.c|h: Add function to check delegate creation,
5763         both in the binding and accessibility, under CoreCLR.
5764
5765 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
5766
5767         * reflection.c (mono_reflection_create_dynamic_method): when 
5768         coreclr is enabled make sure that every resolved object are
5769         checked (e.g. field and method access).
5770         * security-core-clr.c|h: Add function to check objects resolved
5771         when a dynamic method is created.
5772
5773 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
5774
5775         * metadata-verify.c: Cache directory rva translations.
5776
5777         * metadata-verify.c: Add cli-header and streams verification.
5778
5779 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
5780
5781         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
5782         the wrong offset (8 instead of 6).
5783
5784 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
5785
5786         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
5787         methods, return the native function address itself. Fixes
5788         #487758.
5789
5790 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
5791
5792         * console-io.c: some of the values for control characters might not be
5793         present.
5794
5795 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
5796
5797         * exception.c|h: Add helpers to create [Field|Method]AccessException
5798         * icall.c: Add required coreclr check calls for field reflection.
5799         Move the existing (method) check logic into security-core-clr.c
5800         * security-core-clr.c: Add functions to check if the access of a
5801         field or method is allowed when reflecting under coreclr. This is
5802         mostly done using a stack walk to find the "real" caller: i.e. the
5803         code that is calling the reflection
5804
5805 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
5806
5807         * gc-internal.h: Change location of gc_wrapper.h
5808
5809 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
5810
5811         * class.c: Simplification to coreclr checks for overrides that
5812         makes it easier to set breakpoints.
5813
5814 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
5815
5816         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
5817         mono_security_core_clr_method_level): Avoid potential 
5818         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
5819         user/application code) and make it easier to set breakpoints
5820
5821 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
5822
5823         * metadata-verify.c: Reject cli header tables that mono don't handle.
5824
5825 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
5826
5827         * pedump.c: Fix CLI header dumping.
5828
5829 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
5830
5831         * metadata-verify.c: More CLI header verification.
5832
5833 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
5834
5835         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
5836
5837 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
5838
5839         * metadata-verify.c: Initial verification of the CLI header.
5840
5841 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
5842
5843         * metadata-verify.c (verify_resources_table): Fix verification of zero
5844         sized resource section and id entries count.
5845
5846 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
5847
5848         * icall.c: Handle user types in many Type icalls. Fixes #486303.
5849
5850 2009-03-17  Jb Evain  <jbevain@novell.com>
5851
5852         * profiler.c: call mono_gc_base_init from mono_profiler_load.
5853
5854 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
5855
5856         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
5857         (mono_gc_make_descr_for_array): Ditto.
5858
5859 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
5860
5861         * verify.c (mono_verifier_is_class_full_trust): Add support for
5862         CoreCLR security mode where trusted assemblies are defined as
5863         "platform code".
5864
5865 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5866
5867         * metadata-verify.c: Add minimal PECOFF resource verification.
5868
5869 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5870
5871         * metadata-verify.c: Be less restrictive with some coff fields.
5872
5873 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
5874
5875         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
5876         params as boxed values on stack. Fixes #485706.
5877
5878 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
5879
5880         * console-io.c: the termios values may vary in different flavors of unix.
5881
5882 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
5883
5884         * console-io.[ch]: return the entire set of control characters when
5885         initializing the terminal.
5886         * appdomain.c: bump corlib version.
5887
5888 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
5889
5890         * mono-perfcounters.c: added support for in-process custom
5891         performance counters.
5892
5893 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5894
5895         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
5896
5897 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5898
5899         * metadata-verify.c: Verify the data pointed by the import table. 
5900
5901 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
5902
5903         * metadata-verify.c (load_data_directories): Store data
5904         directory contents.
5905
5906         * metadata-verify.c: Verify the import table. 
5907
5908 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
5909
5910         * metadata-verify.c: Verify data directories.
5911
5912 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
5913
5914         * metadata-verify.c: Check section header flags.
5915
5916 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
5917
5918         * appdomain.c: if the assembly name is a shadow-copied file, return
5919         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
5920         in mono_make_shadow_copy.
5921         * icall.c: if the assembly name is a shadow-copied file, replace it
5922         with the original assembly path.
5923
5924         Bug #484244 fixed. NUnit tests for corlib can be run without
5925         --noshadow now.
5926
5927 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
5928
5929         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
5930         entries when the table is reallocated.
5931
5932         * icall.c: Allocate the memory used by the mono_ptr_array macros using
5933         mono_gc_alloc_fixed () since it contains GC refs.
5934
5935 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
5936
5937         * reflection.c (ensure_complete_type): New helper function to call
5938         type resolve handlers for unfinished dynamic types.
5939         (resolve_object): Call it for MonoClassFields. Fixes #483852.
5940
5941 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
5942
5943         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
5944         #483247.
5945
5946 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
5947
5948         * appdomain.c (get_shadow_assembly_location): Fix memleak.
5949
5950 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
5951
5952         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
5953         between GCHandles of type WeakTrackResurrection and the objects they
5954         point to.
5955
5956         * gc.c: Partly implement the sematics of GCHandles of type 
5957         WeakTrackResurrection: these handles should only be cleared after the
5958         finalizer of the object they are pointing to has ran.
5959
5960 2009-03-06  Mark Probst  <mark.probst@gmail.com>
5961
5962         * icall.c: Partially revert r126631 because using the jump
5963         trampolines for generic shared methods makes it superfluous.
5964
5965 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
5966
5967         * threads.c (handle_store): Create the 'threads' hash table with the proper
5968         MONO_HASH_VALUE_GC type.
5969
5970 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
5971
5972         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
5973         FIRST_GC_TRACKED.
5974
5975         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
5976         and LAST_GC_TRACKED as a GC root.
5977
5978         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
5979
5980         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
5981         the static data even if it consists of 1 reference.
5982
5983         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
5984         if there is a GC descriptor.
5985
5986         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
5987         instead of through the GC since they contain no object references.
5988
5989 2009-03-05  Mark Probst  <mark.probst@gmail.com>
5990
5991         * generic-sharing.c (instantiate_other_info): Always return a jump
5992         trampoline for method code.
5993
5994 2009-03-05  Marek Habersack  <mhabersack@novell.com>
5995
5996         * culture-info-tables.h: generated to include the en-tt culture.
5997
5998 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
5999
6000         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
6001         capture the thread context.
6002
6003         * object.c (mono_async_result_new): Cache the invoke wrappers to
6004         ExecutionContext::Capture.
6005
6006 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
6007
6008         * marshal.h: Add a prototype for what mono_compile_method returns
6009         for invoke wrappers.
6010
6011         * gc.c: Use the new prototype declaration.
6012
6013 2009-03-04  Geoff Norton  <gnorton@novell.com>
6014
6015         * boehm-gc.c: Add some MONO_LOG tracing for the GC
6016         * gc-internal.h:
6017         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
6018
6019 2009-03-04  Martin Baulig  <martin@ximian.com>
6020
6021         * mono-debug.h
6022         (mono_debugger_runtime_invoke): Removed.
6023
6024         * mono-debug-debugger.c
6025         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
6026
6027 2009-03-02  Martin Baulig  <martin@ximian.com>
6028
6029         * mono-debug.h
6030         (mono_debugger_unhandled_exception): Removed.
6031         (mono_debugger_handle_exception): Removed.
6032         (mono_debugger_throw_exception): Removed.
6033
6034         * mono-debug.c
6035         (mono_debug_debugger_version): Bump to 5.
6036
6037         * mono-debug-debugger.c: Moved the exception handling code to
6038         ../mini/debug-mini.c
6039
6040 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6041
6042         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
6043         finalize_objects_hash.
6044
6045         * gc.c: Use the separate lock to access the finalize_objects_hash field.
6046         
6047         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
6048         field.
6049
6050         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
6051         cache.
6052
6053         * image.c (mono_image_close): Free it.
6054         
6055         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
6056         allowing a creation of a wrapper which invokes its method using a CALLVIRT
6057         on the this argument.
6058
6059         * gc.c (run_finalize): Optimize the calling of the finalizers.
6060
6061 2009-03-03  Martin Baulig  <martin@ximian.com>
6062
6063         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
6064         of the `MonoGenericInst' changes.
6065
6066 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6067
6068         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
6069         mono_array_class_get_cached to reduce locking contention. Extract
6070         a domain var.
6071
6072         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
6073         intermediary managed arrays. Use caching version of mono_array_new
6074         to allocate the result array.
6075
6076         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
6077
6078         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
6079
6080         * locales.c (create_names_array_idx):  Use mono_array_new_cached
6081         to reduce locking contention.
6082
6083 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6084                 
6085         * object.c (mono_method_add_generic_virtual_invocation): Put back the
6086         thunk builder code for the non-interface case.
6087
6088 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
6089
6090         * object.c (get_generic_virtual_entries): New helper function to collect
6091         the virtual generic method instances which need to be added to an IMT
6092         thunk.
6093         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
6094         Instead of creating a new IMT thunk, reset the vtable slot to the
6095         trampoline, the thunk will be created the next time the trampoline is called.
6096         (build_imt_slots): Add support for virtual generic methods in interfaces by
6097         adding to the IMT thunk all the methods registered using 
6098         mono_method_add_generic_virtual_invocation ().
6099
6100         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
6101         (struct _MonoIMTCheckItem): Ditto.
6102
6103         * object.c (mono_method_add_generic_virtual_invocation): Take a
6104         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
6105         the IMT thunk to include all items.
6106         
6107         * object.c (mono_class_create_runtime_vtable): Add a missing
6108         mono_loader_unlock ().
6109
6110 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6111
6112         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6113
6114         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
6115
6116 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6117
6118         * object-internals.h: Rename _MonoReflectionEvent to
6119         MonoReflectionMonoEvent so it reflects the right managed type.
6120         Add a MonoReflectionEvent that correctly represents System.EventInfo.
6121
6122         * icall.c:
6123         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
6124         type.
6125
6126 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6127
6128         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
6129         intermediary managed arrays. Use caching version of mono_array_new
6130         to allocate the result array.
6131
6132 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6133
6134         * reflection.c: Use cached version of mono_array_new alongside
6135         the mono_reflection_get_custom_attrs_by_type call path.
6136
6137 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6138
6139         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
6140         intermediary managed arrays. Use caching version of mono_array_new
6141         to allocate the result array.
6142
6143         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
6144
6145 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6146
6147         * icall.c: Add small implementation of a growable stack bound array.
6148
6149         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
6150
6151         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
6152         intermediary managed arrays. Use caching version of mono_array_new
6153         to allocate the result array.
6154
6155 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
6156
6157         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
6158         helps Enum::CompareTo to be implemented without reboxing all enums
6159         to their underlying type.
6160 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
6161
6162         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
6163         since it acquires a global lock leading to scalability problems.
6164
6165         * profiler.c: Make the stat profiler work with multiple appdomains, this
6166         currently only works when no appdomains are unloaded.
6167
6168 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
6169
6170         * appdomain.c: make the check to avoid copying when the assembly is
6171         already shadow copied actually work.
6172
6173 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
6174
6175         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6176
6177         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
6178         changes to the managed side.
6179
6180 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
6181
6182         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
6183         classes + a separate lock for it, as it is used frequently at runtime, not
6184         just during metadata loading/JIT compilation.
6185
6186         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
6187         for szarrays.
6188         
6189         * object-internals.h (mono_class_from_name_cached): New macro to cache
6190         the results of the lookup locally without having to declare a static
6191         variable to hold it.
6192         (mono_class_get_field_from_name_cached): Ditto.
6193         (mono_array_class_get_cached): Ditto.
6194
6195         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
6196         the new macros.
6197         
6198         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
6199         slower search in metadata.
6200
6201         * pedump.c: Fix a warning.
6202
6203 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
6204
6205         * reflection.c (encode_locals): Add checks for user types.
6206         (method_encode_clauses): Ditto.
6207         (method_encode_code): Ditto.
6208         (mono_image_create_token): Ditto.
6209
6210         * object-internals.h: Change the type of more fields from MonoReflectionType*
6211         to MonoObject*.
6212
6213 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
6214
6215         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
6216         the a thread does not suspend within 100ms.
6217
6218         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
6219         in addition to StopRequested as well.
6220
6221         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
6222
6223         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
6224         search the method_hash before inserting a new entry, to avoid crashes when
6225         the same method is inserted multiple times, causing the old 
6226         MonoDebugMethodInfo structure to be freed by the value dtor function.
6227
6228 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6229
6230         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
6231         SO_EXLUSIVEADDRUSE where available.
6232
6233 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
6234
6235         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
6236         runtime invoke wrappers, this time it is string ctor wrappers, which
6237         pass a dummy string as 'this' instead of their obj argument. Fixes
6238         #478473.
6239
6240 2009-02-21  Jb Evain  <jbevain@novell.com>
6241
6242         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
6243         only get create_culture once.
6244
6245 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
6246
6247         * reflection.c (mono_reflection_setup_internal_class): Move the user type
6248         check before the locking.
6249         
6250         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
6251         (mono_reflection_create_runtime_class): Ditto.
6252         (mono_reflection_sighelper_get_signature_local): Ditto.
6253         (mono_reflection_sighelper_get_signature_field): Ditto.
6254
6255         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
6256         is a System.MonoType object or similar.
6257         (monotype_cast): New helper function to cast a MonoObject to a 
6258         MonoReflectionType object.
6259
6260         * object-internals.h: Change MonoReflectionType* members in structures to
6261         MonoObject* members to force the usage of the monotype_cast () function.
6262
6263         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
6264         structures/arrays. This causes us to assert instead of crashing when 
6265         instances of user defined subclasses of System.Type are encountered.
6266
6267 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6268
6269         * cil-coff.h:
6270         * icall-def.h:
6271         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
6272         win32 resource loaded from a PE file.
6273
6274         * image.c: fix mono_image_lookup_resource.
6275
6276 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6277
6278         * icall-def.h:
6279         * threads-types.h:
6280         * threads.c: added internal call for WaitHandle.SignalAndWait.
6281
6282 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
6283
6284         * cominterop.c : Adding cominterop_type_from_handle and 
6285           registering it as an icall.  Replacing all references
6286           to type_from_handle.
6287
6288         Code is contributed under MIT/X11 license.
6289
6290 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6291
6292         * Makefile.am: Add lock-tracer.h and lock-trace.c.
6293
6294         * appdomain.c: Call the tracer init function.
6295
6296         * domain-internals.h: Enable the tracer for the domain locks.
6297
6298         * image.c: Enable the tracer for image locks.
6299
6300         * loader.c: Enable the trace for the loader lock.
6301
6302         * lock-tracer.h:
6303         * lock-tracer.c: Initial implementation of the lock trace utility.
6304         The tracer requires a compile time define to be enabled and a env var
6305         to be enabled at runtime.
6306
6307 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6308
6309         * domain.c (mono_domain_code_foreach): Improve documentation.
6310
6311 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6312
6313         * appdomain.c:
6314         * generic-sharing.c:
6315         * object.c:
6316         * reflection.c:  Adjust locking order to the new semantics where the loader lock
6317         comes first.
6318
6319 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
6320
6321         * domain.c: Add mono_domain_code_* functions that perform locking
6322         around the domain codeman.
6323
6324         * domain-internals.h: Export those functions.
6325
6326         * object.c: Use new functions instead of acquiring the domain lock.
6327
6328 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
6329
6330         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
6331         delegate. Fixes #477396.
6332
6333 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6334
6335         * reflection.c (create_custom_attr): Get rid of alloca.
6336
6337 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
6338
6339         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
6340           Adding exception handling for all CCW calls.
6341
6342         Code is contributed under MIT/X11 license.
6343
6344 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6345
6346         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
6347
6348         * marshal.c (emit_marshal_boolean): Add null checks to the new 
6349         native->managed marshalling code. Fixes #476247.
6350
6351 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6352
6353         * class.c (mono_class_get_vtable_entry): Move the addition of
6354         static rgctx invoke wrappers for vtable methods here, this simplifies
6355         a lot of code and causes fewer rgctx wrappers to be created.
6356
6357         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
6358         name of the statistics to begin with an uppercase.
6359
6360 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6361
6362         * reflection.c: Revert previous change as it breaks the build.
6363         
6364 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6365
6366         * verify.c: Properly handle SZARRAY element type.
6367
6368         Fixes #474271.
6369
6370 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6371
6372         * reflection.c (mono_image_create_method_token): Correctly encode
6373         MethodDef MemberRefParent token.
6374
6375         Fixes #472845.
6376
6377 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6378
6379         * image.c (mono_image_close): Delete the critical section before
6380         freeing the memory holding it.
6381
6382 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6383
6384         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
6385         Fixes #476257.
6386
6387 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6388
6389         * pedump.c (main): Call mono_marshal_init so pedump
6390         doesn't crash.
6391
6392 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6393
6394         * loader.c (method_from_memberref): Properly fix #474271 and
6395         don't break the runtime bad.
6396
6397 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6398
6399         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
6400         (mono_domain_alloc0): Ditto.
6401
6402 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6403
6404         * loader.c (method_from_memberref): Don't abort if the array
6405         method is not found. A regular loader failure is more informative
6406         and correct.
6407
6408         Fixes #474271.
6409
6410 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6411
6412         *loader.c: Guard MonoImage::method_cache/methodref_cache
6413         using the image lock instead of the loader lock.
6414
6415         * metadata.h: Add comments about which fields are protected by
6416         the image lock.
6417
6418 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6419
6420         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
6421
6422         * generic-sharing.c (mono_method_construct_object_context): Remove the
6423         wrapper_type == NONE assert, it is not needed.
6424
6425 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
6426
6427         * reflection.c (clear_cached_object): New helper function.
6428         (mono_method_clear_object): New function to clear the cached reflection
6429         objects for a dynamic method.
6430
6431         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
6432         Partly fixes # 463323.
6433         
6434 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6435
6436         * class.c:
6437         * loader.c:
6438         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
6439
6440 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6441
6442         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
6443         take the image lock instead of the loader lock.
6444
6445         * metadata-internals.h: Export new functions.
6446
6447 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6448
6449         * domain.c (app_config_parse): Remove another use of stat that is
6450         not necessary as g_file_get_contents already does the presence
6451         check. 
6452
6453 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6454
6455         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
6456
6457         * marshal.c: Move the bstr handling code to cominterop.c.
6458
6459         * marshal.c: Remove some COM interop code missed previously.
6460
6461 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6462
6463         More Paolo patches from the Wii port:
6464         
6465         * security.c: Remove ves_icall_System_Environment_get_UserName
6466         from here.
6467
6468         * icall.c: And put ves_icall_System_Environment_get_UserName
6469         here. 
6470
6471         * appdomain.c (mono_set_private_bin_path_from_config): Remove
6472         redundant call to stat that was only used to test for the file
6473         existence.   Patch from Paolo.
6474
6475         * gc.c (run_finalize): If COM is disabled, do not link in
6476         mono_marshal_free_ccw.
6477
6478         * generic-sharing.c: Use alloca.h here as well.
6479
6480 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
6481
6482         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
6483
6484 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6485
6486         * cominterop.c cominterop.h: New files.
6487
6488         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
6489         function/typedefs which are needed by cominterop.c global.
6490
6491 2009-02-12  Mark Probst  <mark.probst@gmail.com>
6492
6493         * generic-sharing.c: Don't take the loader lock to guard image
6494         mempool allocs.
6495
6496 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6497
6498         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
6499         called without the loader lock which is required to guard MonoImage:tokens.
6500
6501 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6502
6503         * class.c:
6504         * metadata.c:
6505         * method-builder.c:
6506         * marshal.c:
6507         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
6508
6509 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6510
6511         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6512         Rework the code to use regular mono_image_alloc/0.
6513
6514         * loader.c: Rework the code to use regular mono_image_alloc/0.
6515
6516         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6517
6518 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
6519
6520         * object-internals.h : Fixing a typo in the 
6521           MonoReflectionComVisibleAttribute struct.
6522
6523         * marshal.c (cominterop_com_visible): Check the implemented 
6524           interfaces for ComImport.
6525
6526         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
6527           assume that bools should be treated as VARIANTBOOLs.
6528
6529         * marshal.c (emit_marshal_boolean): Adding cases for 
6530           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
6531
6532         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
6533           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
6534
6535         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
6536           should be treated as VARIANTBOOLs.    
6537
6538         Code is contributed under MIT/X11 license.
6539
6540 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6541
6542         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
6543         allocation with the image lock.
6544
6545 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6546
6547         This patch is the last of a series to remove explicit reference of MonoImage::mempool
6548         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
6549
6550         * object.c: Add mono_string_to_utf8_image.
6551
6552         * object-internals.h: Export mono_string_to_utf8_image.
6553
6554         * reflection.c: Rework all explicit references to the the image mempool to go thought
6555         the mono_image_alloc set of functions.
6556
6557 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6558
6559         This patch is the third of a series to remove explicit reference of MonoImage::mempool
6560         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
6561         and generics-sharing.c.
6562
6563         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
6564         as first argument. Note that this function remains broken as it doesn't perform locking around the
6565         mempool allocation.
6566
6567         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
6568
6569         * image.c: Add g_slist_append_image.
6570
6571         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
6572         the supplied image for allocation. Move code into mono_metadata_field_info_full.
6573
6574         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
6575         Fix all related code to do the same.
6576
6577         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
6578
6579         * metadata-internals.h: Fix the signatures.
6580
6581 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6582
6583         This patch is the second of a series to remove explicit reference of MonoImage::mempool
6584         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
6585         and similar to work using MonoImage.
6586
6587         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
6588         MonoMemPool.
6589
6590         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
6591
6592         * class.c (mono_metadata_signature_deep_dup): Same.
6593
6594         * class.c (inflate_generic_type): Same.
6595
6596         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
6597
6598         * metadata.c (mono_metadata_signature_dup_full): Same.
6599
6600         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
6601         mono_metadata_signature_dup_full.
6602
6603         * metadata.c (mono_metadata_type_dup): Same.
6604
6605         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
6606
6607         * reflection.c: Same.
6608
6609         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
6610
6611         * metadata-internals.h: Fix the signatures.
6612
6613         * class-internals.h: Same.
6614
6615 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6616
6617         This patch is the first of a series to remove explicit reference of MonoImage::mempool
6618         and use mono_image_alloc set of functions instead. 
6619
6620         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
6621         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
6622         of a MonoMemPool.
6623
6624         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
6625
6626         * class.c (g_list_prepend_mempool): Removed.
6627
6628         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
6629
6630         * image.c: Add g_list_prepend_image.
6631
6632         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
6633
6634         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
6635
6636
6637 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6638
6639         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
6640         mono_image_unlock.
6641
6642         * image.c (mono_image_init): Init the lock field.
6643  
6644         * image.c (mono_image_init): Cleanup the lock field.
6645
6646         * image.c: Add mono_image_(un)lock functions.
6647
6648 2009-02-11  Mark Probst  <mark.probst@gmail.com>
6649
6650         * class.c, class-internals.h: mono_method_get_context_general()
6651         combines the functionality of mono_method_get_context() and
6652         mini_method_get_context().
6653
6654         * generic-sharing.c, domain-internals.h:
6655         mono_method_construct_object_context() and
6656         mono_domain_lookup_shared_generic() moved from mini.
6657
6658         * icall.c (ves_icall_InternalInvoke): Handle the case where the
6659         method doesn't have the correct instantiation because it's shared
6660         generic code.  Fixes #473999.
6661
6662 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
6663
6664         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
6665
6666         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
6667         
6668 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6669
6670         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
6671
6672         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
6673
6674         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
6675         and recheck the cache for dups after it.
6676
6677         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
6678
6679         Fixes one of the deadlocks found in #473150.
6680
6681 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
6682
6683         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
6684           For Win32, add additional break conditions for accept.
6685
6686         Code is contributed under MIT/X11 license.
6687
6688 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
6689
6690         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
6691         lazily initialize the native wrapper cache.
6692         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
6693         cache, since they are different from the normal wrappers.
6694
6695         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
6696
6697         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
6698         AOT compiled native wrappers.
6699
6700 2009-02-09  Geoff Norton  <gnorton@novell.com>
6701
6702         * appdomain.h:
6703         * security-core-clr.c: Allow enabling core-clr from the embedding
6704         API.
6705
6706 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6707
6708         * socket-io.c: when requesting all the local ips, if there are no
6709         interfaces up and running, MS returns 127.0.0.1.
6710
6711 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6712
6713         * mono-perfcounters-def.h: processor time is an inverse time.
6714         Fixes bug #468625.
6715
6716 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6717
6718         * socket-io.c: an empty host name returns the list of local IPs.
6719         Fixes bug #386637 part 1/2.
6720
6721 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
6722
6723         * verify.c (mono_class_interface_implements_interface): Call
6724         mono_class_setup_interfaces ().
6725         (merge_stacks): Ditto.
6726
6727 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
6728
6729         * class.c (mono_class_setup_interfaces): New function to lazily initalize
6730         klass->interfaces.
6731         (mono_generic_class_get_class): Don't initalize klass->interfaces.
6732         (mono_generic_class_get_class): Ditto.
6733
6734 2009-02-06  U-QUACK\miguel  <miguel@quack>
6735
6736         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
6737         they live in security.c
6738
6739         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
6740         another bit from Paolo's code.
6741
6742 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
6743
6744         * object.c (build_imt_slots): Add a small optimization to avoid inflating
6745         methods which will be discarded by add_imt_builder_entry ().
6746
6747         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
6748         need to be boxed.
6749
6750         * loader.c: Add a statistics for the size of the memberref signature cache.
6751         
6752         * loader.c (find_cached_memberref_sig): New helper function.
6753         (cache_memberref_sig): Ditto.
6754
6755         * loader.c: Cache the result of parsing memberref signatures, since otherwise
6756         they will be parsed again for every generic instantiation, leading to unbounded
6757         memory growth.
6758
6759 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
6760
6761         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
6762         parameters of generic methods.
6763
6764         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
6765         after the original method is copied to the inflated method.
6766         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
6767
6768         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
6769         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
6770
6771         * class.c metadata.c: Update after the changes above.
6772
6773 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
6774
6775         * metadata-verify.c: Simplified error handling and added
6776         section table validation.
6777
6778 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
6779
6780         * class-internals.h (MonoClassExt): New structure containing rarely used
6781         fields of MonoClass.
6782         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
6783         through a new 'ext' field.
6784
6785         * class.c (mono_class_alloc_ext): New helper function to allocate 
6786         class->ext.
6787
6788         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
6789
6790 2009-02-05  Mark Probst  <mark.probst@gmail.com>
6791
6792         * object.c (mono_object_get_virtual_method): Properly inflate
6793         generic methods.  Fixes #472692.
6794
6795 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
6796
6797         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
6798         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
6799         for the parent type, the created type must be ready to be used on a generic
6800         instantiation.
6801         We fill this_arg/byval_arg if the parent is a generic instance to make sure
6802         we won't have duplicated entries in generic_inst_cache.
6803
6804         Fixes #469553.
6805
6806 2009-02-05  Miguel De Icaza  <miguel@novell.com>
6807
6808         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
6809         replace with plain BSD per the comments on the bug MONO77637.
6810
6811 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
6812
6813         * class.c (mono_class_get_generic_class): New accessor function.
6814         (mono_class_get_generic_container): Ditto.
6815
6816         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
6817         fields, similar to the ones in MonoMethod.
6818
6819         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
6820         (mono_class_create_from_typedef): Set klass->is_generic if needed.
6821
6822         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
6823         
6824         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
6825         the same information as element_class->byval_arg.
6826
6827         * class.c reflection.c: Remove references to class->byval_arg.
6828
6829         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
6830         klass->enum_basetype directly.
6831
6832         * verify.c metadata.c object.c icall.c reflection.c: Use 
6833         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
6834         directly.
6835
6836 2009-02-04  Miguel de Icaza  <miguel@novell.com>
6837
6838         * icall-def.h: Remove internal calls for sockets when
6839         DISABLE_SOCKET is defined, file system writing features when the
6840         OS only support reading and not writing data and Policy support if
6841         the Policy is disabled.
6842         
6843         * image.c (do_mono_image_open): Apply Paolo's patches for using
6844         mono_file_map_ APIs here.
6845
6846         * assembly.c: Add support for platforms to avoid prefix
6847         auto-detection. 
6848
6849 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
6850
6851         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
6852         warning.
6853
6854         * class.c (mono_class_inflate_generic_class): New helper function.
6855
6856         * class.c: Use mono_class_inflate_generic_class in a few places. Add
6857         statistics for inflated methods/classes.
6858
6859         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
6860
6861         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
6862         the call is made from Delegate.CreateDelegate () for the invoke method of
6863         a delegate.
6864
6865         * loader.c: Add a statistics for the memory occupied by inflated signatures.
6866
6867         * metadata.c (mono_metadata_signature_size): New helper function.
6868
6869         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
6870         generic instances.
6871
6872         * metadata.c (inflated_method_in_image): Avoid calling 
6873         mono_method_signature () if the method does not already have a signature.
6874
6875 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6876
6877         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
6878         valuetype is compatible with target type, check by inheritance as a
6879         VT is not really compatible with System.ValueType, for example.
6880
6881         * verify.c (do_invoke_method): Improve error message.
6882
6883         * verify.c (do_box_value): If boxing a nullable, use the type argument
6884         on stack instead.
6885
6886         * verify.c (do_newobj): Improve error message.  
6887
6888         Fixes #469549.
6889
6890 2009-02-03  Miguel de Icaza  <miguel@novell.com>
6891
6892         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
6893
6894 2009-02-03  Mark Probst  <mark.probst@gmail.com>
6895
6896         * generic-sharing.c: Don't hold domain lock when calling
6897         instantiate_other_info().  Fixes #471958.
6898
6899         * domain-internals.h, loader.c: Describe locking policy of domain
6900         lock vs loader lock.
6901
6902 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6903
6904         * verify.c (mono_delegate_signature_equal): Make it possible to check
6905         first-arg-bound delegates to static method.
6906
6907         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
6908         static methods with the first arg bound.
6909
6910         Fixes #469529.
6911
6912 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6913
6914         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
6915         errors.
6916
6917         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
6918         under strict mode. Any type, when boxed can be seen as a reference type.
6919
6920         Fixes #469528.
6921
6922 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
6923
6924         * object.h: The lower bound of an array is a signed integer value.
6925         Introduce mono_array_lower_bound_t typedef. It should be used instead of
6926         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
6927
6928         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
6929         calculate the upper bound.
6930         
6931         Fixes #471252.
6932
6933 2009-02-02  Miguel de Icaza  <miguel@novell.com>
6934
6935         From Paolo's work, refactored, cleared up:
6936         
6937         * threadpool.c, icall.c: ifdef code that requires a working socket
6938         stack.
6939
6940         * metadata.c (mono_metadata_field_info): Do not attempt to return
6941         a value from a function declared as void.
6942
6943         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
6944         from the console stack.
6945
6946         * assembly.c: use strrchr instead of rindex.
6947
6948         * class.c, object.c, marshal.c, icall.c, reflection.c: include
6949         alloca.h on systems that have it.
6950
6951         * environment.c: Avoid code that uses stuff from
6952         HAVE_SYS_UTSNAME_H
6953         
6954         * appdomain.c: Include sys/time.h.
6955
6956         * console-io.c: include sys/ioctl.h if it is available.
6957
6958 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
6959
6960         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
6961
6962         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
6963         the method builder.
6964
6965         * marshal.c: Set mb->skip_visibility instead of setting it on the method
6966         after it was created and cached, as the later is not thread safe.
6967         
6968 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
6969
6970         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
6971         called while the debugging module is not initialized. Fixes #471669.
6972
6973 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
6974
6975         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
6976
6977         Fixes #471255.
6978
6979 2009-02-02  Mark Probst  <mark.probst@gmail.com>
6980
6981         * generic-sharing.c (lookup_or_register_other_info): Make sure the
6982         loader lock is not taken while the templates lock is held.  Fixes
6983         #471089.
6984
6985 2009-02-02  Mark Probst  <mark.probst@gmail.com>
6986
6987         * metadata.c (type_in_image): Added a check to fix a monodis
6988         crash.
6989
6990 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
6991
6992         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
6993         nullable arguments.
6994
6995         * object.c (mono_runtime_invoke_array): Ditto.
6996         
6997         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
6998         freeing wrappers of dynamic methods.
6999
7000         * loader.c (mono_free_method): Call it. Fixes #463323.
7001         
7002         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
7003         methods taking vtype/byref arguments, to fix yet another bug caused by
7004         the sharing of runtime invoke wrappers. Partly fixes #471259.
7005
7006 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
7007
7008         * debug-mono-symfile.c (check_line): Return NULL instead of returning
7009         <first file in file table>:1 when the IL offset does not have an associated
7010         line number.
7011
7012 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
7013
7014         * mono-debug.c (mono_debug_lookup_locals): New function to return local
7015         variable info for a method.
7016
7017         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
7018         
7019 2009-01-30  Jb Evain  <jbevain@novell.com>
7020
7021         * pedump.c: reuse code from monodis to make sure pedump honors
7022         MONO_PATH, which is needed to verify net_2_1 assemblies.
7023
7024 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
7025
7026         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
7027         there is no line number info.
7028
7029 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
7030
7031         Avoid some MonoType allocations
7032         * reflection.c (mono_reflection_initialize_generic_parameter):
7033         Reuse MonoType from param->pklass rather than allocating one.
7034         (mono_dynamic_image_free): Update to changes.
7035
7036 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7037
7038         Rearrange some code to improve consistency
7039         * reflection.c (mono_reflection_setup_generic_class): Move body ...
7040         (mono_reflection_initialize_generic_parameter): ... here.
7041
7042 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
7043
7044         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
7045         with type constraints as an experiment.
7046
7047         * boehm-gc.c (on_gc_notification): Update mono_stats.
7048
7049 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7050
7051         Avoid some allocations
7052         * class-internals.h (_MonoGenericInst::type_argv): Convert from
7053         pointer to tail array to avoid extra allocation.
7054         * metadata.c (free_generic_inst): Update to changes.
7055         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
7056         on-stack struct.
7057
7058 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
7059
7060         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
7061         return TRUE if the two type objects are the same.
7062
7063 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7064
7065         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
7066         (mono_class_native_size): Use klass->marshal_info->min_align instead of
7067         klass->min_align, since klass->min_align contains the managed alignment,
7068         while the native alignment can be different, like for longs on x86.
7069         Fixes #469135.
7070
7071         * class-internals.h (MonoMarshalType): Add a min_align field.
7072
7073 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
7074
7075         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
7076         the 1.0 format.
7077
7078 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7079
7080         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
7081         some comments about the usage of the used_regs field.
7082
7083         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
7084         Fixes #469217.
7085
7086 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
7087
7088         * appdomain.c: return NULL instead of throwing FileNotFoundException
7089         when LoadAssembly() fails.
7090
7091 2009-01-23  Mark Probst  <mark.probst@gmail.com>
7092
7093         * metadata.c (mono_metadata_generic_param_equal): Only compare the
7094         image if the owner is NULL.  Fixes the AOT failures.
7095
7096 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
7097
7098         * metadata.c (mono_metadata_load_generic_params): Initialize the 
7099         MonoGenericParam structure using memset so the image field is initialized
7100         as well.
7101
7102 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7103
7104         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
7105         a plain store.
7106
7107 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
7108
7109         * class.c (mono_class_setup_vtable_general): In the generic instance
7110         optimization, set method->slot for abstract virtual methods. Fixes part of
7111         #467834.
7112
7113 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7114
7115         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
7116         which signals that the unloading has started but all appdomain services must
7117         remain operational.
7118
7119         * appdomain.c (mono_domain_unload): The initial state for unloading now
7120         is unloading_start and we switch to unloading after the managed call to
7121         AppDomain::DomainUnload has finished.
7122
7123         The new unloading state has to be created because managed code in the
7124         DomainUnload event can depend on things like the threadpool still working.
7125         The domain must remain fully functional while the event executes.
7126
7127         This shown as an issue due to Process::WaitForExit, which waits for
7128         async reads of stdout and stderr to complete. Since those are processed
7129         in the threadpool the code deadlocks because the DomainUnload callback 
7130         waits for the async read finished event, which should have been set by a
7131         threadpool job but has been discarded due to the domain been in unload
7132         state.
7133
7134 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7135
7136         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
7137         image must match.
7138
7139 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7140
7141         * reflection.c (resolve_object): For fields, inflate the class and
7142         then get the field in the inflated class.
7143
7144 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7145
7146         * object-internals.h (struct _MonoException): Added a comment
7147         explaining the new use of trace_ips.
7148
7149 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7150
7151         * generic-sharing.c (inflate_other_data): Inflate array methods
7152         correctly.
7153
7154         * loader.c, class-internals.h: Rename search_in_array_class() to
7155         mono_method_search_in_array_class() and make it non-static.
7156
7157 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7158
7159         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
7160         Hopefully fixes #458168.
7161
7162 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7163
7164         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
7165         as it is performed elsewhere.
7166
7167         Code is contributed under MIT/X11 license
7168
7169 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7170
7171         * mono-perfcounters-def.h: Add counters for asp.net requests total and
7172         requests queued.
7173         * object.c (mono_raise_exception): Increment the exceptions total
7174         counter when an exception is thrown.
7175         * class-internals.h: Add a location for storing the total number of
7176         asp.net requests served.
7177         * mono-perfcounters.c: Implement update support for asp.net counters
7178         from the class libraries. Implement read support for asp.net counters
7179         and exceptions total counter.
7180
7181 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7182
7183         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
7184         accessing klass->methods. Fixes #467385.
7185
7186 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7187
7188         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
7189         for byval arguments without an [Out] attribute. Fixes #467212.
7190
7191         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
7192         Fix compilation under android.
7193         
7194         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
7195         processed, scan them directly after they are copied, to achieve better locality
7196         and cache usage.
7197
7198         * socket-io.c: Applied patch from Koushik Dutta
7199         (koush@koushikdutta.com). Disable IPV6 when running under android.
7200
7201 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7202
7203         * icall.c (ves_icall_InternalExecute): Add write barriers.
7204
7205         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
7206         the GC code.
7207
7208         * sgen-gc.c: Implement write barriers in IL code.
7209
7210 2009-01-17  Geoff Norton  <gnorton@novell.com>
7211
7212         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
7213
7214 2009-01-17  Geoff Norton  <gnorton@novell.com>
7215
7216         * image.c: When unloading the image->references table, there can be gaps
7217         in it.  Ensure that we iterate every entry to avoid leaking assembly references
7218         when unloading an appdomain.
7219
7220 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
7221
7222         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
7223         speed up ptr-in-nursery checks.
7224
7225         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
7226         threads_lock () to prevent deadlocks.
7227
7228         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
7229         does not need to be scanned during minor collections, since writes to it
7230         must use write barriers.
7231
7232 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
7233
7234         * metadata-verify.c: Add pe nt header verification.
7235         
7236 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7237
7238         * gc.c: Fix a few warnings when using SGEN.
7239
7240 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
7241
7242         * metadata-verify.c: Add pe optional header verification.
7243
7244 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7245
7246         * sgen-gc.c: Add support for user defined marker functions, used by
7247         MonoGHashTable to avoid registering a GC root for every hash node.
7248
7249 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7250
7251         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
7252         non-pinned roots into separate hashes to avoid having to traverse them
7253         in functions which are only interested in one kind.
7254
7255 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7256
7257         * metadata-verify.c: Add pe header machine field verification.
7258         
7259 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7260
7261         * metadata-verify.c: Add pe header size verification.
7262
7263 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7264
7265         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
7266         using the GC, they don't contain references.
7267
7268         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
7269
7270 2009-01-13  Geoff Norton  <gnorton@novell.com>
7271
7272         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
7273         AppDomains created on the native side can be cleaned up on the native side.
7274
7275 2009-01-13  Geoff Norton  <gnorton@novell.com>
7276
7277         * appdomain.c: Ensure that we call mono_context_init for the embedding api
7278         as well as the managed api.
7279
7280 2009-01-13  Geoff Norton  <gnorton@novell.com>
7281
7282         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
7283         with a MonoAppDomain initialized against it.
7284
7285 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7286
7287         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
7288         
7289         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
7290
7291         * marshal.c: Avoid setting the exception clauses after a method has been entered 
7292         into the wrapper caches. Fixes #465700.
7293
7294         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
7295         method builder.
7296         (mono_mb_create_method): Set the clauses from the method builder.
7297
7298 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
7299
7300         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
7301         Patch from Makoto Kishimoto.
7302
7303 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7304
7305         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
7306         encoding them as ROOT_DESC_COMPLEX.
7307         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
7308
7309 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
7310
7311         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
7312         no longer point to the nursery.
7313
7314         * sgen-gc.c: Add a few comments/FIXMEs.
7315         
7316         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
7317
7318         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
7319         initialization of the various _method variables thread safe. Fixes
7320         #465377.
7321
7322 2009-01-12  Mark Probst  <mark.probst@gmail.com>
7323
7324         * domain.c, domain-internals.h: Remove the shared_generics_hash
7325         and its lookup functions.
7326
7327 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
7328
7329         * socket-io.c:  Fixing the MSVC build. 
7330
7331         Code is contributed under MIT/X11 license.
7332
7333 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
7334
7335         * metadata-verify.c: Add pe header watermark verification.
7336
7337 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7338
7339         * metadata-verify.c: Add lfanew verification.
7340
7341 2009-01-12  Jb Evain  <jbevain@novell.com>
7342
7343         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
7344         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
7345
7346 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
7347
7348         * socket-io.c: Fix the build.
7349
7350         * environment.c: Fix an #ifdef.
7351
7352 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7353
7354         * threadpool.c (async_invoke_thread): Handle the wait function returning
7355         WAIT_IO_COMPLETION as well.
7356         (async_invoke_io_thread): Ditto.
7357
7358 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
7359
7360         * threads.c: Fixing the Windows build.
7361
7362         Code is contributed under MIT/X11 license.
7363
7364 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7365  
7366         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
7367         interrupt a wait.
7368         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
7369         the thread to wait again.
7370
7371 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7372
7373         * metadata-verify.c: Initial skeleton of the metadata verifier.
7374
7375         * pedump.c: Add support for the metadata verifier.
7376
7377         * verify-internal.h: Export the whole assembly metadata verifier function.
7378
7379 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7380
7381         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
7382
7383 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7384
7385         * Makefile.am: Upgrade dtrace-prelink.sh location.
7386
7387 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7388
7389         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
7390         well. Otherwise the shutdown deadlock that happens on unix will can happen
7391         as well.
7392         If the main thread code finishes too fast it's possible that the finalizer
7393         thread won't have executed yet, won't record itself as the finalizer thread
7394         and the shutdown sequence will wait on it forever.
7395
7396 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7397
7398         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
7399         with MSVC.
7400
7401 2009-01-08  Miguel de Icaza  <miguel@novell.com>
7402
7403         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
7404         Robert Jordan for pointing this out.
7405
7406 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
7407
7408         * icall.c
7409         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
7410         ves_icall_System_IO_DriveInfo_GetDriveType.
7411
7412 2009-01-07  Miguel de Icaza  <miguel@novell.com>
7413
7414         * icall.c: Wrap calls to mono_strtod in CriticalSection
7415         invocations when using eglib, to work around #464316.
7416
7417 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7418
7419         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
7420         return value of GetCurrentDirectory to never access unitialized memory.
7421
7422 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7423
7424         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
7425         return value of GetCurrentDirectory and expand the buffer if needed.
7426
7427         Fixes #459094.
7428
7429 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
7430
7431         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
7432           Adding a call to mono_init_com_types.
7433
7434         Code is contributed under MIT/X11 license.
7435
7436 2009-01-07  Geoff Norton  <gnorton@novell.com>
7437
7438         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
7439         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
7440         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
7441         be the value of the ip buffer.
7442
7443 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7444
7445         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
7446         interfaces_packed here.
7447
7448         Fixes part of #463294.
7449
7450 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7451
7452         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
7453
7454         Fixes part of #463294.
7455
7456 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7457
7458         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
7459         is a boxed complex as well.
7460
7461         Fixes part of #463294.
7462
7463 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7464
7465         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
7466         control if a methodspec should be created for the generic method definition from external assemblies.
7467         Caching of methodspec is done using the handleref hash table.
7468
7469         Fixes #462592.
7470
7471 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
7472
7473         * loader.c (find_method): When searching the interfaces of a class
7474         check the transitive closure of implemented interfaces.
7475
7476         Fixes #463303.
7477
7478 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7479
7480         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
7481         
7482 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7483
7484         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
7485         interfaces calculation to fill_valuetype_array_derived_types.
7486
7487         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
7488         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
7489         for example.
7490
7491         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
7492         interfaces for valuetypes if needed.    
7493
7494         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
7495         for their basetype as well. Types are array expanded if rank is > 0.
7496
7497         Fixes #400716.
7498
7499 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
7500
7501         * socket-io.h : Changing the signature of
7502           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
7503           the blocking state.
7504
7505         * icall-def.h :  Changing the signature of
7506           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
7507
7508         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
7509           For Windows only.  Avoid blocking when calling accept by
7510           querying for a connection via select.  The loop also queries
7511           the thread state every 1000 micro seconds for the thread
7512           stop state.  This will avoid the process hanging on shutdown
7513           when using a TcpChannel that is never connected to.
7514
7515         Code is contributed under MIT/X11 license.
7516
7517 2008-12-30  Marek Safar  <marek.safar@gmail.com>
7518
7519         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
7520
7521 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7522
7523         * class.c (get_implicit_generic_array_interfaces): Extract common
7524         code to a helper function making it a lot easier on the eyes.
7525
7526 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7527
7528         * class.c (get_implicit_generic_array_interfaces): If the internal
7529         enumerator is an interface inflate System.Object instead of itself.
7530
7531         Fixes #461261.
7532
7533 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
7534
7535         * object.c (mono_runtime_invoke_array): Don't assert with
7536         byref nullable types.
7537
7538         * marshal.c (mono_marshal_get_runtime_invoke): To handle
7539         byref nullables we unbox the object and store it on the
7540         stack. 
7541         We can't use the boxed object since it is the T of Nullable<T>
7542         and the boxed representation of a nullable it's underlying type
7543         or null.
7544         We could cheat and create a boxed nullable and use the same
7545         machinery of other byref VTs but this feels like a hack and
7546         using the stack has the bonus of reducing heap pressure.
7547
7548         Fixes #461941.
7549
7550 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
7551
7552         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
7553         return value.
7554
7555         Fixes #461867.
7556
7557 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
7558
7559         * icall-def.h : Adding an internal call definition for 
7560           System.Environment.internalBroadcastSettingChange.
7561
7562         * icall.c : Adding a Windows only implementation to broadcast a 
7563           WM_SETTINGCHANGE when an environment variable has changed.
7564
7565         Code is contributed under MIT/X11 license.
7566
7567 2008-12-19  Mark Probst  <mark.probst@gmail.com>
7568
7569         * class.c, class-internals.h: Made
7570         mono_class_has_parent_and_ignore_generics() non-static.
7571
7572 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
7573
7574         * image.c: deal with the mmap failing when loading an image.
7575
7576 2008-12-17  Geoff Norton  <gnorton@novell.com>
7577
7578         * threadpool.c: Ensure that the io_queue_lock is initialized
7579         in all circumstances, as we always attempt to cleanup against it.
7580
7581 2008-12-17  Miguel de Icaza  <miguel@novell.com>
7582
7583         * icall.c (ves_icall_System_Environment_get_Platform): For
7584         compatibility reasons for existing client code we will keep
7585         returning 4 for a while.   
7586
7587         For how long will depend on the documentation being updated, and
7588         for us to give client code a chance to be updated.
7589
7590         This reverts the original decison on #433108 since we did not
7591         catch roughly 33 instances of the broken code in our own source
7592         code base, we did not catch failures on the buildbots, and QA did
7593         not bring this as a problem.
7594
7595         Only today I found some customer's code breaking due to our own
7596         class libraries not being fully updated and tracked it down to
7597         this change.  I am reverting it because if we could not even get
7598         our story straight in our own code base, how can we hope that our
7599         end user code be fixed?
7600
7601         As of this morning, our Wiki page that documents how to detect
7602         Unix had not been fixed.    
7603
7604 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
7605
7606         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
7607
7608         * class.c (mono_class_get_fields): Handle loading errors.
7609
7610 2008-12-12 Mark Mason <mmason@upwardaccess.com>
7611
7612         * 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.
7613         
7614 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
7615
7616         * mono-perfcounters.c: avoid warning.
7617
7618 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7619
7620         * reflection.c (ensure_runtime_vtable): Work on generic instances and
7621         make sure all interfaces have MonoClass::interface_id set.
7622
7623         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
7624         method table is property set.
7625
7626 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7627
7628         * class.c: New function mono_class_setup_interface_id that setup
7629         MonoClass::interface_id if needed.
7630
7631         * class-internals.h: Export new function.
7632
7633 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7634
7635         * class.c: Add code to sanity check the vtable after setup_vtable_general
7636         has done it's work.
7637
7638 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
7639
7640         * icall.c: make Assembly.GetExecutingAssembly work properly when
7641         reflection is used to invoke the method.
7642         Bug #321781 fixed.
7643
7644 2008-12-11  Mark Probst  <mark.probst@gmail.com>
7645
7646         * metadata/generic-sharing.c: Look for constraints in all type
7647         arguments, not just the first one.
7648
7649 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7650
7651         * appdomain.c: return the correct CodeBase for an Assembly instance
7652         that was loaded from the shadow-copy directories.
7653         Bug #458190 fixed.
7654
7655 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
7656
7657         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
7658
7659         * sgen-gc.c (check_object): New debugging helper function.
7660
7661         * object.c: Fix calls to mono_value_copy_array ().
7662
7663 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7664
7665         * class.c (mono_class_setup_fields): If working on an inflated class
7666         first check if the generic definition did init with success.
7667
7668         Fixes #445361.
7669
7670 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7671
7672         pedump.c (main): Fix a warning.
7673
7674 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
7675
7676         * object-internals.h : Adding a definition for 
7677           MonoReflectionComVisibleAttribute.
7678
7679         * marshal.c (cominterop_com_visible) :  Method added to check the 
7680           ComVisible attribute of a class.
7681
7682         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
7683           cominterop_raise_hr_exception added to consolidate common code 
7684           to raise hr exceptions.
7685
7686         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
7687           if a managed class should support IDispatch.
7688
7689         * marshal.c 
7690           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
7691           Added additional checks for managed object when getting 
7692           an IDispatch interface.
7693
7694         Code is contributed under MIT/X11 license.
7695
7696 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7697
7698         pedump.c (main): Handle mono_get_method () returning NULL. 
7699
7700 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7701
7702         * marshal.h: Fix a warning.
7703
7704 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
7705
7706         * marshal.c : Adding cominterop_release_all_rcws to release all
7707           runtime callable wrappers held by the runtime.
7708
7709         * marshal.h : Adding declaration for cominterop_release_all_rcws.
7710           
7711         Code is contributed under MIT/X11 license.
7712
7713 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7714
7715         * metadata.c (mono_image_alloc_lock): New helper function.
7716         (mono_image_alloc0_lock): Ditto.
7717
7718         * metadata.c: Use the alloc_lock () helper functions for allocating
7719         memory from the image mempool.
7720
7721 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
7722
7723         * class.c (mono_class_from_generic_parameter): Document it's
7724         locking behavior. Fix double checked locking here, we stored in
7725         param->pklass a partially initialized MonoClass and no membar was used.
7726
7727 2008-12-05  Marek Habersack  <mhabersack@novell.com>
7728
7729         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
7730         (3) functions are present in the C library use them to do the
7731         job. If they are absent, make sure that the sum of int_part and
7732         dec_part is rounded before returning. This is necessary due to the
7733         division of dec_part by the power of 10 before the final addition
7734         is performed - if the result is not rounded in some cases it will
7735         yield invalid results.
7736
7737 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
7738
7739         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
7740         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
7741         instruction instead of a pointer constant.
7742
7743 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
7744
7745         * loader.c (mono_method_get_header): Do most of the work outside the
7746         loader lock, to avoid assembly load hook deadlocks.
7747
7748         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
7749         (mono_metadata_parse_type_full): Ditto.
7750
7751 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
7752
7753         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
7754         Make the stack depth fixed. Ensure proper argument passing to the backtrace
7755         funtions. Finally, use a lock to produce well ordered output.
7756
7757         The lock looks silly, as all calls to the corlib mempool should be guarded
7758         with the loader lock, but for some reason this fact doesn't help. 
7759
7760         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
7761
7762 2008-12-02  Mark Probst  <mark.probst@gmail.com>
7763
7764         * socket-io.c: 64 bit big-endian fixes.
7765
7766 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
7767
7768         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
7769         targets that require strict compatibility between the types.
7770
7771         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
7772         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
7773         Kill the strict argument and create a new one valuetype_must_be_boxed.
7774
7775         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
7776         state that all valuetypes must be boxed.
7777
7778         Fixes #448560.
7779
7780 2008-11-29  Kornél Pál  <kornelpal@gmail.com>
7781
7782         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
7783         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
7784
7785         Contributed under MIT/X11 license.
7786
7787 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
7788
7789         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
7790         the inflate_generic_type machinery should handle it.
7791
7792         This avoids a crash when the field's flags is zero and it's type is
7793         a primitive.
7794         What happens is that mono_metadata_parse_type_full will see that opt_attrs
7795         is zero and will return one of the cached built-in primitive types. Since
7796         those types live in read-only memory, the code that copies it crashes.  
7797
7798 2008-11-28  Mark Probst  <mark.probst@gmail.com>
7799
7800         * object.c: Don't put function descriptors into generalized IMT
7801         thunks.
7802
7803 2008-11-28  Mark Probst  <mark.probst@gmail.com>
7804
7805         * class.c: Enable generic code sharing on PPC64.
7806
7807 2008-11-27  Mark Probst  <mark.probst@gmail.com>
7808
7809         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
7810         from mini/mini.c.
7811
7812         * generic-sharing.c: Allocate the method template slists from the
7813         image mempool so it doesn't leak.
7814
7815 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
7816
7817         * class.c (generic_array_methods): Release the linked list.
7818
7819 2008-11-27  Mark Probst  <mark.probst@gmail.com>
7820
7821         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
7822         invocation to g_utf16_to_utf8().
7823
7824 2008-11-26  Mark Probst  <mark.probst@gmail.com>
7825
7826         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
7827         arguments on big endian archs.
7828
7829 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
7830
7831         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
7832         the type name (test added in corlib).
7833
7834 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
7835
7836         * pedump.c: initialize perf. counters. Fixes a segv.
7837
7838 2008-11-25  Martin Baulig  <martin@ximian.com>
7839
7840         * mono-debug-debugger.c
7841         (mono_debugger_runtime_invoke): Return the exception object if an
7842         exception was thrown.  Visual Studio displays the exception object
7843         in the locals window.
7844
7845 2008-11-24  Mark Probst  <mark.probst@gmail.com>
7846
7847         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
7848         ftnptr.
7849
7850 2008-11-24  Mark Probst  <mark.probst@gmail.com>
7851
7852         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
7853         MONO_TYPE_U are sizeof (gpointer), too.
7854
7855 2008-11-24  Mark Probst  <mark.probst@gmail.com>
7856
7857         * marshal.c (mono_type_native_stack_size): Fixed size and
7858         alignment for reference types.
7859
7860 2008-11-23  Mark Probst  <mark.probst@gmail.com>
7861
7862         * class.c (mono_class_generic_sharing_enabled): Disable generic
7863         code sharing for PPC64.
7864
7865 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
7866
7867         * icall.c (mono_method_get_equivalent_method): Make sure
7868         method->klass->methods is inited before looping over it.
7869
7870 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
7871
7872         * object.c: when calling ExecuteAssembly in a newly created domain,
7873         the configuration file and application base are already set up.
7874         Bug #446353 take 2 fixed.
7875
7876 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
7877
7878         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
7879         Fixes #444715. Fix a warning.
7880
7881 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
7882
7883         * appdomain.c: write the full path of the assembly to the .ini file
7884         created when "shadow-copying"
7885         Bug #446353 fixed.
7886
7887 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
7888
7889         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
7890         if signature==FALSE.
7891
7892 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
7893
7894         * marshal.h : Fix the cygwin build.
7895            marshal.c:12442: undefined reference to `_IID_IMarshal'
7896           
7897         Code is contributed under MIT/X11 license.
7898
7899 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
7900
7901         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
7902           free threaded marshaler when QueryInterface is called on a COM callable
7903           wrapper requesting the IMarshal interface.
7904           
7905         Code is contributed under MIT/X11 license.
7906
7907 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
7908
7909         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
7910
7911         * reflection.c (mono_type_get_object): Special case the very common
7912         void type.
7913
7914         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
7915         hold typeof(void).
7916
7917 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
7918
7919         * process.h : Adding method declaration for
7920           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7921           
7922         * process.c : Adding implementation for
7923           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7924           
7925         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
7926           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
7927
7928         Code is contributed under MIT/X11 license.
7929
7930 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
7931
7932         * appdomain.c (unload_thread_main): Clean up threadpool by
7933         calling mono_thread_pool_remove_domain_jobs.
7934
7935         * domain-internals.h (struct _MonoDomain): Add new fields to
7936         help coordinate the cleanup of the threadpool.
7937
7938         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
7939         that cleans up the threadpool of all jobs associated with an appdomain.
7940         It does that by cleaning up the queues and making sure all active
7941         threads are accounted.
7942
7943         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
7944         unloaded or in the process of. Take this is such way that there is
7945         no race condition between another thread starting the unload and the
7946         current thread acknowledging it.
7947
7948         * threadpool.c (async_invoke_thread): Same.
7949
7950         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
7951         firing the new thread.
7952
7953         * threadpool.c (start_tpthread): Same.
7954
7955         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
7956
7957         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
7958
7959 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
7960
7961         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7962         Add support for DuplicateHandle.
7963         
7964         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7965         Add support for DuplicateHandle.
7966         
7967         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
7968         Add support for DuplicateHandle.
7969
7970         Code is contributed under MIT/X11 license.
7971
7972 2008-11-06  Mark Probst  <mark.probst@gmail.com>
7973
7974         * class-internals.h: Make min_align into a whole byte.
7975
7976         * class.c: Set min_align for SIMD types to 16.
7977
7978 2008-11-05  Geoff Norton  <gnorton@novell.com>
7979
7980         * attach.c: Default the attacher to enabled for all cases including
7981         embedded.
7982
7983 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
7984
7985         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
7986         change r117650.
7987
7988 2008-11-04  Mark Probst  <mark.probst@gmail.com>
7989
7990         * monitor.c, monitor.h: New function for querying offsets of
7991         members of MonoThreadsSync.
7992
7993 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
7994
7995         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
7996         to speed up this function and to avoid the boundless memory growth caused by
7997         the signature_dup () calls.
7998
7999 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
8000
8001         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
8002         wrapper.
8003
8004         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
8005         by 1 bit.
8006
8007         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
8008
8009 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8010
8011         * appdomain.c:
8012         * domain-internals.h: made mono_set_private_bin_path_from_config()
8013         "internal".
8014         * object.c: call the above function after setting the configuration
8015         file path for the root domain.
8016         Fixes bug #314478.
8017
8018 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8019
8020         * assembly.c: when the assembly is loaded from an absolute path, end
8021         basedir with a directory separator.
8022         Bug #440781 fixed.
8023
8024 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8025
8026         * monitor.c (mono_monitor_get_fast_enter_method): If
8027         CompareExchange is not available, don't create the fastpath
8028         instead of asserting.  (The method is missing in the 1.1 profile.)
8029
8030 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8031
8032         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
8033
8034         * monitor.c, monitor.h: Code for generating Monitor.Enter and
8035         Monitor.Exit IL fastpaths.
8036
8037 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8038
8039         * class.c (mono_class_create_from_typedef): Added Vector2ul.
8040
8041 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8042
8043         * class.c (mono_class_create_from_typedef): Added Vector2l.
8044
8045 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
8046
8047         * class.c (mono_class_create_from_typedef): Added Vector2d.
8048
8049 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
8050
8051         * appdomain.c: translate \ into / for cache_path.
8052         * domain-internals.h: new mono_is_shadow_copy_enabled().
8053         * icall.c: (fill_reflection_assembly_name) do the same path
8054         manipulations that get_code_base does.
8055         (get_code_base) use mono_is_shadow_copy_enabled.
8056
8057 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
8058
8059         * appdomain.c: shadow-copied assemblies go to CachePath +
8060         ApplicationName when both are set. DynamicBase has nothing to do with
8061         shadow copies.
8062         Bug #406877 fixed.
8063
8064 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
8065
8066         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
8067         STANDALONESIG table.
8068
8069         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
8070         standalone signatures.
8071
8072         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
8073         comparison code: instead of comparing the signatures using a custom
8074         equals function, transform them to a common signature and compare that. This
8075         works better with AOT.
8076
8077 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
8078
8079         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
8080
8081         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
8082         call for generic instances.
8083         (mono_class_setup_properties): Call setup_properties () before accessing
8084         gklass->properties.
8085
8086         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8087         over the virtual methods of a class using metadata if possible, avoiding the
8088         creation of MonoMethod's for non-virtual methods.
8089         
8090         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8091         get_virtual_methods () to iterate over the virtual methods of classes.
8092
8093 2008-10-25  Martin Baulig  <martin@ximian.com>
8094
8095         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
8096
8097 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8098
8099         * class.c (mono_class_create_from_typedef): Added Vector4i.
8100
8101 2008-10-24  Mark Probst  <mark.probst@gmail.com>
8102
8103         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
8104         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
8105         special-casing applies to eliminate the call completely.
8106
8107 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8108
8109         * class.c (mono_class_create_from_typedef): Added Vector8s.
8110
8111 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
8112
8113         * class.c (mono_class_create_from_typedef): Added Vector16sb.
8114
8115 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8116
8117         * icall.c: get rid of annoying warning.
8118
8119 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8120
8121         * threadpool.c: in 1.x, if you change the background status of the
8122         threadpool thread, it's not reset.
8123         Remove unnecessary calls to SetState.
8124
8125 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8126
8127         * threadpool.c: asynchronously create a set of idle threads upon first
8128         use of the threadpool. SetMinThreads will now start the appropriate
8129         number of idle threads if they are not already running. The default is
8130         1 threadpool thread per CPU. Increased the maximum number of threads
8131         per CPU to 10.
8132
8133 2008-10-22  Martin Baulig  <martin@ximian.com>
8134
8135         Revert r116521 from Zoltan, it breaks the debugger:
8136
8137         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8138         over the virtual methods of a class using metadata if possible, avoiding the
8139         creation of MonoMethod's for non-virtual methods.
8140         
8141         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8142         get_virtual_methods () to iterate over the virtual methods of classes.
8143
8144 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8145
8146         * threads.c: when creating a threadpool thread, set its state to
8147         'background'.
8148         * threadpool.c: reset the background state of a threadpool thread
8149         after finishing each work item
8150         Bug #437888 fixed.
8151
8152 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8153
8154         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
8155         
8156         * class.c (mono_class_setup_vtable_general): Add an optimized version for
8157         generic instances which works by inflating the methods in the container
8158         class's vtable.
8159
8160         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
8161         variant which doesn't make a copy if no inflation was done.
8162         (mono_class_setup_fields): Use it.
8163
8164         * metadata.c (mono_metadata_get_shared_type): New helper function to
8165         return a shared instance of a given MonoType.
8166
8167         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
8168         a copy of most non-generic types.
8169
8170 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
8171
8172         * threadpool.c: remove one more GetSystemInfo () call.
8173
8174 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
8175
8176         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
8177         use the code in mono-proclib.h to get processor information.
8178
8179 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8180
8181         * appdomain.c: fixed the logic that determines whether assemblies in a
8182         directory are "shadow-copied" or not. Bug #433483 fixed.
8183
8184 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8185
8186         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
8187         warning.
8188
8189 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8190
8191         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
8192         returning a vtype.
8193
8194         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
8195         reflection.c: Use mono_field_get_name () for accessing a field's name.
8196
8197         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
8198         class.c
8199
8200         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
8201         field.
8202
8203         * loader.c (find_method_in_class): Reenable the metadata optimization by
8204         not using it for generic instances.
8205
8206         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
8207         data/def_type fields from MonoClassField into a separate structure.
8208         (struct MonoClassField): Remove data/def_type fields.
8209         (struct _MonoClass): Add a 'field_def_values' array to store the default
8210         values/RVA for fields.
8211
8212         * class.c reflection.c: Update after the changes.
8213         
8214         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
8215         for accessing field->data.
8216
8217         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
8218
8219         * loader.c (find_method_in_class): Revert the last change for now as
8220         it breaks Mono.C5 unit tests.
8221
8222         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
8223         'field_generic_types' and 'field_objects' which contain the information
8224         previously stored in MonoInflatedField.
8225         (MonoInflatedField): Delete.
8226         (struct _MonoClassField): Delete 'generic_info' field.
8227
8228         * reflection.c: Store the information which was previously in 
8229         field->generic_info in MonoDynamicGenericClass instead.
8230
8231         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
8232         MonoClassField changes.
8233
8234 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
8235
8236         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
8237         store the value inside the data array of the MonoMethodWrapper.
8238         This saves memory, is faster and fixes the lifetime issues (methods
8239         were never removed from the hash previously). May also fix bug#436996.
8240
8241 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8242
8243         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
8244         generic instances, compute the type from the generic definition instead of
8245         looking in field->generic_info.
8246
8247         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
8248         for inflated fields, the only user was get_fieldref_token () which no
8249         longer needs it.
8250
8251         * class.c (mono_class_init): Revert the last change as it seems to cause
8252         crashes.
8253
8254         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
8255         bytes on 64 bit platforms.
8256
8257         * object.c (mono_class_create_runtime_vtable): Fix a warning.
8258         
8259         * object.c (mono_class_create_runtime_vtable): Don't initalize
8260         field->data/field->def_type here, it is done lazily by 
8261         mono_class_get_field_default_value ().
8262
8263         * icall.c (ves_icall_get_enum_info): Call 
8264         mono_class_get_field_default_value () instead of directly accessing
8265         field->data and field->def_type.
8266
8267         * object.c (get_default_field_value): Ditto.
8268
8269         * class.c (mono_field_get_data): Ditto.
8270         
8271         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
8272         call for generic instances.
8273
8274         * loader.c (find_method_in_class): If klass != from_class, then inflate
8275         the method with the context of from_class, since the caller assumes this.
8276
8277 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
8278
8279         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
8280         for accessing method->slot.
8281
8282 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
8283
8284         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
8285
8286 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
8287
8288         * class.c (mono_method_get_vtable_index): Use
8289         mono_method_get_vtable_slot () for accessing method->slot.
8290
8291         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
8292         accessing klass->methods.
8293
8294         * class.c (mono_method_get_vtable_slot): New helper function.
8295         (mono_class_get_vtable_entry): Ditto.
8296         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
8297         accessing method->slot.
8298
8299         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
8300         method to get_inflated_method ().
8301
8302         * class.c (mono_class_get_inflated_method): New helper method to obtain
8303         a method of an inflated class without calling setup_methods ().
8304         (mono_class_get_cctor): Use get_inflated_method.
8305
8306         * generic-sharing.c (mono_class_get_method_generic): Ditto.
8307         
8308         * marshal.c image.c: Lazily create all the marshal caches.
8309
8310         * image.c (mono_image_init): Move initialization of runtime_invoke
8311         caches to marshal.c.
8312
8313         * marshal.c (get_cache): New helper function to lazily initialize a 
8314         wrapper cache.
8315         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
8316
8317         * debug-helpers.c (mono_method_full_name): Include generic arguments.
8318
8319 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
8320
8321         * loader.c: fixed check for interface type.
8322
8323 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
8324
8325         * appdomain.c: check for NULL setup before it's referenced.
8326
8327 p
8328 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
8329
8330         * class.c: remove the unused old vtable setup code.
8331
8332 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
8333
8334         * class.c: don't depend on interface order in
8335         setup_interface_offsets (bug #435777).
8336         * reflection.c: sort the InterfaceImpl table (patch from
8337         Jb Evain  <jbevain@novell.com>).
8338
8339 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
8340
8341         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
8342         the low level assemblies lock.
8343
8344 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
8345
8346         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
8347         object.c, reflection.c, socket-io.c, threads.c: introduced
8348         mono_framework_version () to return the major framewrok version,
8349         changed the code that was using more complex patterns to use it.
8350         Return the correct value for PlatformID for OSX.
8351
8352 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
8353
8354         * icall-def.h, process.h, process.c: added an icall to get info about
8355         processes using mono-proclib.
8356
8357 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
8358
8359         * mono-perfcounters.c: use the mono-proclib functions to
8360         access process information.
8361
8362 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
8363
8364         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
8365         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
8366         reflection.c: remove rawbuffer usage: mmap support is more sanely
8367         provided by utils/mono-mmap.
8368
8369 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
8370
8371         * gc.c: use posix semaphores when possible so that
8372         mono_gc_finalize_notify() is signal safe.
8373
8374 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
8375
8376         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
8377         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
8378         be #ifdef-ed out, the linker will remove the rest.
8379
8380         * marshal.c: Implement DISABLE_COM.
8381
8382         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
8383
8384 2008-10-11  Miguel de Icaza  <miguel@novell.com>
8385
8386         * locales.c (string_invariant_compare_char): Optimization: do not
8387         call g_unichar_type unless we actually need the information.
8388
8389 2008-10-10  Mark Probst  <mark.probst@gmail.com>
8390
8391         * object.c, class-internals.h: Also create remoting trampolines
8392         for generic methods.  Pass the domain to the remoting trampoline
8393         creation function, too.
8394
8395 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
8396
8397         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
8398
8399 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8400
8401         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
8402         Vector4ui.
8403
8404 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
8405
8406         * assembly.c:
8407         * locales.c: remove the use of g_strdown. Fixes bug #322313.
8408
8409 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
8410
8411         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
8412         for the least possible amount of time (extending the fix in r113458).
8413
8414 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8415
8416         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
8417
8418 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
8419
8420         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
8421         as possible simd intrinsic types.
8422         Optimized the test to check for the common prefix first.
8423
8424 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
8425
8426         * class.c: back out part of a broken optimization committed on
8427         May 23th (bug #433908).
8428
8429 2008-10-09  Mark Probst  <mark.probst@gmail.com>
8430
8431         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
8432         Win32.  Should fix #432388 for most cases until we have the new
8433         profiler on Win32.
8434
8435 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
8436
8437         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
8438         instead of using inst->id so the hash is stable for AOT.
8439
8440 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
8441
8442         * appdomain.c:
8443         * icall.c: create a .ini file for shadow-copied assemblies that
8444         contains the location of the original assembly. Use this to return the
8445         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
8446         Also fix the number of '/' for windows when returning the CodeBase.
8447         Fixes bug #430920.
8448
8449 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8450
8451         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
8452
8453         Code is contributed under MIT/X11 license.
8454
8455 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8456
8457         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
8458           if if the class vtable needs initialized.
8459
8460         Code is contributed under MIT/X11 license.
8461
8462 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8463
8464         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
8465           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
8466           STRING->BSTR, and CLASS->INTERFACE.
8467
8468         Code is contributed under MIT/X11 license.
8469
8470 2008-10-07  Marek Habersack  <mhabersack@novell.com>
8471
8472         * sysmath.h: changed the declaration of the
8473         ves_icall_System_Math_Round2 icall by adding an extra
8474         away_from_zero parameter.
8475
8476         * sysmath.c (ves_icall_System_Math_Round2): added support for
8477         away from zero rounding. The icall now takes an extra boolean
8478         parameter to signal that away from zero operation is requested.
8479
8480 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
8481
8482         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
8483         the delegate klass so it can work with full-aot.
8484         (mono_marshal_get_delegate_end_invoke): Ditto.
8485         (mono_marshal_get_delegate_invoke): Ditto.
8486
8487 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
8488
8489         * gc.c, attach.h, attach.c: remove a bad pattern:
8490         add_finalizer_callback () is not implemented correctly, it can't
8491         without adding more overhead to the finalizer loop and it's not
8492         even needed, since we know exactly what we need to call, so there is
8493         no need to do so through an expensive function pointer.
8494
8495 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
8496
8497         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
8498         for the no-gc case.
8499         * attach.c (mono_attach_init): Remove the #ifdef.
8500
8501 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
8502
8503         * attach.c (mono_attach_init): Don't use
8504         mono_gc_add_finalizer_thread_callback when compiling without GC.
8505         Fixes #432306.
8506         
8507         Code is contributed under MIT/X11 license.
8508
8509 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
8510
8511         * class.c (mono_class_create_from_typedef): Remove the 
8512         #ifndef DISABLE_SIMD stuff.
8513
8514 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
8515
8516         * class-internals.h (MonoClass): Added simd_type bit field.
8517
8518         * class.c (mono_class_create_from_typedef): Check if type is a simd
8519         intrinsic.
8520
8521 2008-10-03  Mark Probst  <mark.probst@gmail.com>
8522
8523         * object.c (mono_method_add_generic_virtual_invocation): Only add
8524         instantiations to the thunk whose count is at least as large as
8525         the threshold.
8526
8527 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
8528
8529         * icall.c: changed the Type of the exception thrown when trying to
8530         invoke a constructor on an abstract class. Part of the fix for bug
8531         #324185.
8532
8533 2008-10-02  Mark Probst  <mark.probst@gmail.com>
8534
8535         * class.c, class-internals.h (mono_method_get_vtable_index): New
8536         function which returns the index into the vtable and properly
8537         handles inflated virtual generic methods.
8538
8539 2008-10-01  Mark Probst  <mark.probst@gmail.com>
8540
8541         * object.c, domain.c, object-internals.h, domain-internals.h:
8542         Generalize IMT thunk machinery to also handle thunks for virtual
8543         generic method invokes.  When a virtual generic method is invoked
8544         more than a number of times we insert it into the thunk so that it
8545         can be called without lookup in unmanaged code.
8546
8547         * generic-sharing.c, class-internals.h: Fetching a
8548         MonoGenericInst* for a method from an (M)RGCTX.
8549
8550 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
8551
8552         * marshal.c (emit_marshal_string): Applied a variant of a patch by
8553         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
8554         marshalling. Fixes #431304.
8555
8556 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
8557
8558         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8559           handle when ref is specified without In or Out.
8560
8561         Code is contributed under MIT/X11 license.
8562
8563 2008-09-30  Mark Probst  <mark.probst@gmail.com>
8564
8565         * loader.c (mono_get_method_constrained): Don't expand method with
8566         the class's context, because it's already a method of that class.
8567
8568 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
8569
8570         * attach.c : should be correct build fix.
8571
8572 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
8573
8574         * attach.c: Fix the previous change.
8575
8576 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
8577
8578         * attach.c : quick w32 build fix.
8579
8580 2008-09-27  Miguel de Icaza  <miguel@novell.com>
8581
8582         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
8583         crashes MonoDevelop: #430455.
8584
8585 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
8586
8587         * domain-internals.h (struct _MonoDomain): Move most fields used only by
8588         the JIT do MonoJitDomainInfo in ../mini/mini.h.
8589
8590         * domain.c: Remove initialization/cleanup of the removed fields.
8591
8592 2008-09-27  Mark Probst  <mark.probst@gmail.com>
8593
8594         * class.c (mono_class_generic_sharing_enabled): Enable generic
8595         code sharing for PPC.
8596
8597 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
8598
8599         * attach.c : Fixing the Windows builds.
8600
8601         Code is contributed under MIT/X11 license.
8602
8603 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8604
8605         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
8606         the default generic sharing mode to 'all'.
8607
8608 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8609
8610         * generic-sharing.c, class-internals.h: New function for checking
8611         whether a method needs a static RGCTX invoke wrapper.  A few
8612         funtions moved from mini/generic-sharing.c.
8613
8614         * icall.c: New function used.
8615
8616 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8617
8618         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8619         Static RGCTX invoke wrapping applies to value type methods, too.
8620
8621         * class.c (mono_class_setup_vtable_general): In generic-shared
8622         value types, wrap methods with a static RGCTX invoke wrapper.
8623
8624 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8625
8626         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
8627         osx build.
8628
8629 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
8630
8631         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
8632         register a callback which is called when the finalizer thread is woken
8633         up.
8634         (finalizer_thread): Call the callback if it exists.
8635
8636         * attach.h attach.c: New files, implementing the attach mechanism.
8637
8638         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
8639         
8640         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
8641         by the previous change.
8642
8643 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
8644
8645         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
8646         loader.c, marshal.c, metadata-internals.h, metadata.c,
8647         method-builder.c, object.c, reflection.c: introduced specific functions
8648         to allocate from the domain and image mempools and cleaned up most of
8649         the code to use them (still missing a few in reflection.c).
8650         Keep the loader bytes counter updated.
8651
8652 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
8653
8654         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
8655         loader-related counters.
8656
8657 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
8658
8659         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
8660         added more MS-compatible counters.
8661
8662 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
8663
8664         * class.c (mono_class_setup_fields): Call setup_fields before accessing
8665         class->blittable. Fixes #428217.
8666
8667 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
8668
8669         * reflection.c (mono_image_get_field_on_inst_token): Call 
8670         field_encode_signature () since that handles custom modifiers too.
8671         Fixes #424663.
8672
8673 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
8674
8675         * reflection.c (add_custom_modifiers): New helper function to merge custom
8676         modifiers stored in objects to a MonoType.
8677         (fieldref_encode_signature): Encode custom modifiers.
8678         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
8679         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
8680
8681 2008-09-19  Kornél Pál  <kornelpal@gmail.com>
8682
8683         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
8684         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
8685         64-bit IL only images because imports are not resolved for IL only images.
8686         Special thanks to Bill Holmes for finding this bug and testing the patch.
8687         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
8688
8689         Contributed under MIT/X11 license.
8690
8691 2008-09-19  Miguel de Icaza  <miguel@novell.com>
8692
8693         * mono-config.c (dllmap_start): Add support for the bits keyword
8694         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
8695
8696 2008-09-19  Mark Probst  <mark.probst@gmail.com>
8697
8698         * reflection.c (inflate_mono_method): When the class the method is
8699         to be inflated for is itself not inflated, just return the method.
8700
8701 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
8702
8703         * mono-perfcounters.c: use more user friendly process instance names.
8704
8705 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
8706
8707         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8708           handle "[in] ref" and "[in][out] ref" cases.
8709
8710         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
8711           to mono_mb_create_method.  This was causing problems calling native to
8712           managed passing Variants by value.
8713
8714         Code is contributed under MIT/X11 license.
8715
8716 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
8717
8718         * class.c (can_access_internals): Call mono_assembly_load_friends ()
8719         before accessing the friend_assembly_names field.
8720
8721         * assembly.c (mono_assembly_load_friends): Make this callable multiple
8722         times.
8723         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
8724         called lazily when it is needed.
8725
8726         * metadata-internals.h (struct _MonoAssembly): Add 
8727         'friend_assembly_names_inited' flag.
8728
8729 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
8730
8731         * mono-perfcounters-def.h: fix the types of a few counters.
8732         * mono-perfcounters.c: implemented the instance names getter
8733         and a few bugfixes.
8734
8735 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
8736
8737         * culture-info-table.h : regenerated.
8738
8739 2008-09-17  Robert Jordan  <robertj@gmx.net>
8740
8741         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
8742         context bound objects. Fixes #415577.
8743
8744         Code is contributed under MIT/X11 license.
8745
8746 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
8747
8748         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
8749         implementation (bug #423582).
8750
8751 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
8752
8753         * object.c (mono_object_get_virtual_method): Handle the case method->slot
8754         is not set. Fixes #426309.
8755
8756 2008-09-16  Jb Evain  <jbevain@novell.com>
8757
8758         * class.c (mono_class_from_name): fix the exported type look up
8759         when the type is defined in a referenced assembly.
8760
8761 2008-09-16  Jb Evain  <jbevain@novell.com>
8762
8763         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
8764         increment the next index counter on each iteration to make that work
8765         for more than one type forwarder. Unmanaged part to fix #422929.
8766
8767 2008-09-15  Mark Probst  <mark.probst@gmail.com>
8768
8769         * object-internals.h: enum ComInterfaceType in
8770         MonoInterfaceTypeAttribute is guint32, not guint16.
8771
8772 2008-09-12  Mark Probst  <mark.probst@gmail.com>
8773
8774         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
8775         writing code.
8776
8777 2008-09-11  Mark Probst  <mark.probst@gmail.com>
8778
8779         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
8780         not gboolean.
8781
8782 2008-09-11  Mark Probst  <mark.probst@gmail.com>
8783
8784         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
8785         Endianness fixes for MonoSymbolFileOffsetTable.
8786
8787 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
8788
8789         * process.c (complete_path) : Removing quotes from the 
8790           input path.  The glib file routines do not handle file paths
8791           that have quotes around them.
8792
8793         Code is contributed under MIT/X11 license.
8794
8795 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
8796
8797         * socket-io.h : Adding a comment to provide locations where 
8798           changes to MonoSocketAsyncResult need to be synced.
8799
8800         Code is contributed under MIT/X11 license.
8801
8802 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
8803
8804         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
8805         parameters as well. Fixes #425001.
8806
8807 2008-09-08  Miguel de Icaza  <miguel@novell.com>
8808
8809         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
8810         windows build.
8811
8812 2008-09-07  Miguel de Icaza  <miguel@novell.com>
8813
8814         * console-io.c: Add support for tracking the window size if it
8815         changes.
8816
8817         The setup is very simple: the TtySetup function will now return a
8818         pointer to a location in memory that tracks the current console
8819         size.  The managed code checks its current value every time its
8820         queried against the last value set, and updates accordingly.
8821
8822         With this setup we can work with multiple consoles, and we do not
8823         require to poke into managed code from a signal handler.
8824
8825         Additionally, the environment for COLUMNS and LINES is now handled
8826         in unmanaged code.
8827
8828         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
8829
8830 2008-09-07  Mark Probst  <mark.probst@gmail.com>
8831
8832         * marshal.c (mono_type_native_stack_size): Treat
8833         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
8834
8835 2008-09-04  Jb Evain  <jbevain@novell.com>
8836
8837         * class.c (mono_class_is_assignable_from): fix assignability of nullables
8838         to nullables.
8839
8840 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
8841
8842         * verify.c (verify_type_compatibility_full): Revert change
8843         to allow converting a native int to unmanaged pointer be verifiable
8844         under non-strict mode.
8845         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
8846
8847         * verify.c: Added some TODOs.
8848
8849 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
8850
8851         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
8852           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
8853           Changed to use GlobalAlloc for the memory returned on Windows platforms.
8854
8855         Code is contributed under MIT/X11 license.
8856
8857 2008-09-02  Jb Evain  <jbevain@novell.com>
8858
8859         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
8860
8861 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
8862
8863         reflection.c (typebuilder_setup_fields): Handle classes with
8864         explicit size.
8865
8866 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
8867
8868         class.c (mono_class_setup_events): Add memory barrier due to
8869         double checked locking.
8870         
8871         class.c (mono_class_setup_properties): Same.
8872
8873 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
8874
8875         * class.c (mono_class_is_assignable_from): Fix the build.
8876         
8877         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
8878         before accessing klass->interface_bitmap. Fixes #421744.
8879
8880 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
8881
8882         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
8883         the runtime into no-exec mode, useful when running the AOT compiler.
8884
8885         * appdomain.c gc.c object.c: Avoid executing managed code when running
8886         in no-exec mode.
8887         
8888         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
8889
8890         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
8891         special case when the mono_assembly_loaded () returns NULL because the 
8892         search hook is not installed.
8893
8894 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
8895
8896         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
8897         crashes in bstr marshalling on linux.
8898
8899 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
8900
8901         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
8902         with more than one parameter.
8903
8904 2008-08-24  Miguel de Icaza  <miguel@novell.com>
8905
8906         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
8907         start/stop flow control as well when turning off ICANON (allows
8908         C-s and C-q to be read by Console.ReadKey).
8909
8910 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
8911
8912         * class.c (mono_class_init): Move the initialization of nested classes
8913         into mono_class_get_nested_types (). Fixes #418433.
8914
8915         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
8916         flag.
8917
8918         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
8919         iterating tough the nested classes of a class.
8920
8921 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
8922
8923         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
8924         on arm.
8925
8926 2008-08-22  Miguel de Icaza  <miguel@novell.com>
8927
8928         * console-io.c (sigcont_handler): Support signal chaining for
8929         SIGCONT.
8930
8931         (console_set_signal_handlers): Use best practices with sigaction,
8932         clear the structure before using it. 
8933
8934 2008-08-22  Robert Jordan  <robertj@gmx.net>
8935
8936         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
8937         Fix the Windows build.
8938
8939 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
8940
8941         * class.c (mono_class_generic_sharing_enabled): Make the default
8942         sharing mode 'corlib'.
8943
8944 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
8945
8946         * console-io.c (console_set_signal_handlers): Fix a warning.
8947
8948         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
8949         method normally, the JIT will take care of avoiding recursion.
8950
8951 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
8952
8953         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
8954
8955         Code is contributed under MIT/X11 license.
8956
8957 2008-08-20  Miguel de Icaza  <miguel@novell.com>
8958
8959         * console-io.c (sigcont_handler): We need to restore the entire
8960         termios state, not only the original settings, as things like echo
8961         can be controlled after this (Booish exposes this issue with its
8962         own ReadLine implementation).
8963
8964         Additionally, we need to set the terminal back into keypad_xmit
8965         mode.
8966         
8967         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
8968         string as a paramter as well.   Otherwise we get different
8969         keyboard sequences.
8970
8971 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
8972
8973         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
8974         delegates with byref out parameter passing. Fixes #351520.
8975
8976         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
8977         a generic context.
8978         (mono_type_get_desc): Add the type arguments for GENERICINST.
8979         (mono_method_full_name): Stringify the class name using mono_type_full_name
8980         so it picks up generic arguments.
8981
8982 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
8983
8984         * console-io.c: Removed debug output.
8985
8986 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
8987
8988         reflection.c (mono_reflection_create_runtime_class): Alloc
8989         the nested classes linked list using the dynamic image mempool.
8990         Fixes leak in corlib compilation.
8991
8992 2008-08-19  Miguel de Icaza  <miguel@novell.com>
8993
8994         * console-io.c: Fix incredibly annoying behavior on the console
8995         after resuming execution after control-z.   This affected every
8996         console application.
8997
8998 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
8999
9000         * mempool-internals.h: Header for mono private mempool functions. The first
9001         two function are for allocating glib linked lists using pools.
9002
9003         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
9004
9005         * Makefile.am: Added mempool-internals.h.
9006
9007 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
9008
9009         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
9010         (mono_domain_free): Ditto.
9011
9012         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
9013         be used by the JIT to store its domain-specific information, instead of putting
9014         it directly into MonoDomain.
9015
9016         * domain.c (mono_install_create_domain_hook): New helper function to install
9017         a hook which initializes domain->runtime_info.
9018
9019         * domain.c (mono_install_free_domain_hook): Ditto.
9020         
9021 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
9022
9023         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
9024         asserting if the ares parameter is null.
9025
9026         * mono-perfcounters.c: Fix warnings.
9027
9028         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
9029         is not needed, don't check for interruptions either.
9030         (mono_marshal_get_delegate_end_invoke): Ditto.
9031
9032 2008-08-15  Marek Habersack  <mhabersack@novell.com>
9033
9034         * mono-perfcounters.c (predef_readonly_counter): added support for
9035         reading the ASP.NET Requests Queued counter from another process.
9036
9037 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
9038
9039         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
9040         MonoImage to simplify the AOT code.
9041
9042 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
9043
9044         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
9045         marshalling. Fixes #416078.
9046
9047 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9048         
9049         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
9050         it is set, looking up the icall address is deferred to the JIT, since 
9051         in embedded scenarios, the icall might not be registered in the runtime
9052         doing the AOT compilation. Backported from the 2.0 branch.
9053
9054 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9055
9056         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
9057         Fixes #415621.
9058
9059 2008-08-05  Marek Habersack  <mhabersack@novell.com>
9060
9061         * Makefile.am: added support for cross-compilation.
9062
9063 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
9064
9065         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
9066
9067 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
9068
9069         * mono-perfcounters.c: jitted methods and jitted bytes counters.
9070
9071 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
9072
9073         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
9074         mono-perfcounters.c: performance counters implementation.
9075
9076 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
9077
9078         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
9079         to gpointer, letting the AOT code decide what to store in it.
9080
9081 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
9082
9083         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
9084           mono_class_setup_methods if the methods are not initialized.
9085
9086         Code is contributed under MIT/X11 license.
9087
9088 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9089
9090         * verify.c: Remove some debug code I commited by accident.
9091
9092         * verify.c (mono_method_is_valid_in_context): Change the return value
9093         to make possible to distinguish between invalid and unverifiable.
9094
9095         * verify.c (verifier_load_method): Don't return NULL for unverifiable
9096         methods.
9097
9098 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9099
9100         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
9101         constraints. Fixes regression in gtest-253.
9102
9103 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9104
9105         * verify.c (mono_verifier_verify_class): Don't allow generic types
9106         with explicit layout.
9107
9108         * verify.c (mono_method_verify): Check locals and argument types.
9109
9110 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
9111
9112         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
9113         wait if the thread is in StopRequested state.
9114
9115         * class.c (mono_class_from_name): Refactor the module searching code into
9116         a separate function so it can be reused in the AOT case too.
9117
9118 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
9119
9120         * verify.c (mono_type_is_valid_in_context): Improve the error message.
9121         Check both the type and it's generic type definition for loader errors.
9122         
9123         * verify.c (mono_method_is_valid_in_context): Don't generate another
9124         error when a type errors occur, this leads to the wrong exception been
9125         thrown.
9126
9127 2008-07-28  Dick Porter  <dick@ximian.com>
9128
9129         * icall-def.h
9130         * process.c
9131         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
9132         New internal calls to duplicate and close a process handle.
9133
9134 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
9135
9136         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
9137
9138 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
9139
9140         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
9141
9142 2008-07-27  Robert Jordan  <robertj@gmx.net>
9143
9144         * class.c (mono_class_init): Don't compute class.has_finalize for
9145         valuetypes. Fixes #412477.
9146
9147 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
9148
9149         * verify.c: Implement constraint equivalence checking.
9150         This is required when a generic parameter is used as
9151         argument to a constrained one.
9152
9153         Fixes #410637.
9154
9155 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
9156
9157         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9158
9159         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
9160
9161         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
9162         synch with managed object layout.
9163
9164 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9165
9166         * verify.c (do_branch_op): Handle valuetypes and generic
9167         arguments properly.
9168
9169         * verify.c (do_cmp_op): Same.
9170
9171         Fixes #410383.
9172
9173 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9174
9175         * generic-sharing.c: Fix memory leaks.
9176
9177         * class.c, class-internals.h: Make
9178         mono_class_inflate_generic_type_with_mempool() non-static.
9179
9180 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9181
9182         * pedump.c (dump_verify_info): Dump full class name.
9183
9184 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9185
9186         * generic-sharing.c: Removed some old code that didn't do anything.
9187
9188 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
9189         * profiler.c: Added runtime_initialized_event,
9190         mono_profiler_install_runtime_initialized and
9191         mono_profiler_runtime_initialized. This new hook tells the profiler
9192         when the runtime is sufficiently initialized to be able to call
9193         mono_thread_attach on the root appdomain.
9194         * profiler.h, profiler-private.h: Likewise.
9195
9196 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9197
9198         * verify.c (do_cast): Do boxing for generic arguments as well.
9199
9200         * class.c (is_nesting_type): Drop generic instantiations before
9201         checking for nesting.
9202
9203         * class.c (can_access_instantiation): Allow access to generic
9204         arguments.
9205
9206 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9207
9208         * verify.c (verify_class_for_overlapping_reference_fields):
9209         On some cases, the field size might be zero, guard against that.
9210         Fix the explicit layout check to work as expected.
9211
9212 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
9213
9214         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
9215         mono_thread_resume () during shutdown, since the thread we want to abort
9216         might be suspended.
9217
9218 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
9219
9220         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
9221         warning.
9222
9223         * debug-mono-symfile.c: Fix a warning.
9224
9225         * mono-perfcounters.c (get_cpu_times): Fix a warning.
9226
9227         * object.c (mono_class_vtable): Check if exception_type is set, and return
9228         NULL as defined by the function comments.
9229
9230 2008-07-22  Mark Probst  <mark.probst@gmail.com>
9231
9232         * mempool.c: Use malloc for every single mempool allocation if the
9233         configure option is set.  This makes it easier to track mempool
9234         allocations with tools like Valgrind.
9235
9236 2008-07-22  Jb Evain  <jbevain@novell.com>
9237
9238         * reflection.c (create_dynamic_mono_image): emit the same
9239         metadata version that SL2 does when creating a SL2 image.
9240
9241 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
9242
9243         * icall-def.h:
9244         * icall.c: New icall System.Enum:get_hashcode. This function
9245         avoids the overhead of boxing the enum to the underlying type.
9246
9247 2008-07-21  Mark Probst  <mark.probst@gmail.com>
9248
9249         * reflection.c (mono_method_get_object): Don't let static RGCTX
9250         invoke wrappers get into MonoReflectionMethods.
9251
9252 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
9253
9254         * object-internals.h:
9255         * object.c: New mono_runtime_class_init_full function
9256         that makes throwing the exception optinal.
9257
9258         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
9259         for the case where the exception object is supplied.
9260
9261 2008-07-16  Kornél Pál  <kornelpal@gmail.com>
9262
9263         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
9264         old ld versions.
9265
9266         Contributed under MIT/X11 license.
9267
9268 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9269
9270         * string-icalls.c (ves_icall_System_String_InternalSplit):
9271         Optimize array allocation by caching the MonoClass of the
9272         array type.
9273
9274         * icall.c (ves_icall_Type_GetMethodsByName): Same.
9275
9276         * reflection.c (mono_param_get_objects): Same.
9277
9278 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9279
9280         * icall-def.h:
9281         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
9282         It inflates the given type using the class context.
9283
9284 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
9285
9286         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
9287         the vtable if it already exists.
9288
9289         * object-internals.h: Add mono_class_try_get_vtable as part of the
9290         internal API.
9291
9292         * reflection.c (mono_type_get_object): Use the MonoObject from the
9293         vtable when possible. Reduces locking contention on reflection heavy
9294         code.
9295
9296 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
9297
9298         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
9299         g_bit_nth_msf () since that macro is not implemented in eglib.
9300
9301 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
9302
9303         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
9304         on platforms which do not support it.
9305
9306 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
9307
9308         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
9309
9310 2008-07-11  Martin Baulig  <martin@ximian.com>
9311
9312         * mono-debug-debugger.h
9313         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
9314
9315         * mono-debug-debugger.c
9316         (_mono_debugger_interruption_request): New global volatile variable.
9317         (mono_debugger_check_interruption): New public function.
9318
9319         * threads.c
9320         (mono_thread_current_check_pending_interrupt): Call
9321         mono_debugger_check_interruption().
9322         (mono_thread_interruption_checkpoint_request): Likewise.
9323
9324 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9325
9326         * verify.c: Add more type checks for loaded types. Verify the result
9327         handle from ldtoken.
9328
9329 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9330
9331         * loader.c (field_from_memberref): Don't crash if the field
9332         wasn't found.
9333
9334 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9335
9336         * verify.c: Verify if type and method instantiations
9337         don't have invalid VAR or MVAR arguments.
9338
9339 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9340
9341         * verify.c: Fix double free of function pointer list.
9342
9343 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9344
9345         * object.c (mono_string_to_utf8): Comment the new code as it
9346         breaks under eglib.
9347
9348 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
9349
9350         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
9351
9352 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
9353
9354         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
9355           is not throw too many times.
9356
9357         Code is contributed under MIT/X11 license.
9358
9359 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
9360
9361         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
9362         debugging is turned off.
9363
9364 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
9365
9366         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
9367
9368 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9369
9370         * class-internals.h, class.c: Added new generic sharing option:
9371         Share only stuff in System.Collections.Generic, which is now the
9372         default.
9373
9374 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9375
9376         * generic-sharing.c, class-internals.h: New function for getting a
9377         generic method in a generic class given the corresponding method
9378         for a different instantiation of the class.  Partly refactored
9379         from mini-trampolines.c.
9380
9381         * class.c: Make sure generic methods have a class_inst if they are
9382         part of a generic class.
9383
9384         * metadata.c (mono_type_stack_size_internal): Handle type
9385         variables.
9386
9387 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9388
9389         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
9390         Signifies whether information on the this/vtable/mrgctx variable
9391         is available.
9392
9393 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9394
9395         * object.c, object-internals.h, icall.c: New function
9396         mono_delegate_ctor_with_method(), which does the same as
9397         mono_delegate_ctor(), but takes an explicit method argument
9398         instead of taking the method from the jit info.
9399
9400         * marshal.c: When creating a delegate with an inflated method take
9401         the "this" argument as the target class for the castclass.
9402
9403 2008-07-03  Mark Probst  <mark.probst@gmail.com>
9404
9405         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
9406         mono_jit_info_table_find() to perform very badly in some cases.
9407
9408 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
9409
9410         * icall.c (type_from_typename): Handle 'string'.
9411
9412         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
9413         wrappers into the wrapper_hash, since the key is not a MonoMethod.
9414
9415 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
9416
9417         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
9418
9419         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
9420         number of available managed allocator types.
9421
9422         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
9423         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
9424
9425 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
9426
9427         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
9428         which is a low level lock protecting just the 'jit_code_hash' hash table.
9429
9430         * domain.c: Initialize+cleanup jit_code_hash_lock.
9431         
9432 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
9433
9434         * coree.c (mono_load_coree): Set coree_module_handle global variable only
9435         after initialization.
9436
9437         * coree.h: Make MonoFixupExe internal.
9438
9439         Contributed under MIT/X11 license.
9440
9441 2008-06-30  Kornél Pál  <kornelpal@gmail.com>
9442
9443         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
9444         because that is platform independent. Check NumberOfRvaAndSizes in PE32
9445         as well.
9446         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
9447         image being loaded is a CLI image and _CorValidateImage gets called.
9448
9449         * coree.h: Add MonoLoadImage.
9450
9451         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
9452         instead of LoadLibrary.
9453
9454         Contributed under MIT/X11 license.
9455
9456 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
9457
9458         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
9459         for any primitive type.
9460
9461 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
9462
9463         * object.c (mono_array_new_specific): Optimize this and the other allocation
9464         functions a bit.
9465         
9466         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
9467         domains too if mono_dont_free_domains is set.
9468
9469         * domain-internals.h (mono_dont_free_domains): New internal option controlling
9470         whenever to free appdomain data after it has been unloaded.
9471
9472         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
9473         
9474 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
9475
9476         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
9477         (mono_method_get_equivalent_method): Fix a warning.
9478
9479         * object.c (mono_message_init): Avoid looking up array types for each call.
9480
9481 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
9482
9483         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
9484         call.
9485
9486         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
9487         even more.
9488
9489         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
9490         each iteration.
9491
9492         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
9493         fields of an enum.
9494
9495 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
9496
9497         * object.c (mono_value_box): Fix boxing of nullables.
9498
9499 2008-06-26  Kornél Pál  <kornelpal@gmail.com>
9500
9501         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
9502         mono_module_handle that is defined by the linker; no initialization required.
9503         * coree.h: Remove mono_module_handle, add __ImageBase, update
9504         mono_image_open_from_module_handle.
9505         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
9506         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
9507         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
9508         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
9509         to 4 GB away from image base address. IA64 version is not tested but was very
9510         easy to implement and should work if we ever need it.
9511         * domain.c (mono_init_internal): Avoid system error message boxes.
9512         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
9513         with has_entry_point. Handle do_mono_image_load fauilre correctly.
9514         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
9515         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
9516         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
9517
9518         Contributed under MIT/X11 license.
9519
9520 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9521
9522         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
9523         as part of the private mono API.
9524         
9525         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
9526         Do proper argument checking for methods that belong to generic classes.
9527         Do proper type resolution for GMFH/2.
9528         Fixes #377324.
9529         
9530 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9531
9532         * verify.c (do_switch): Fix a memory corruption bug with
9533         the jump index is out of bound.
9534
9535 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9536
9537         * verify.c: Disable debug code.
9538
9539 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9540
9541         * reflection.c (mono_image_get_methodbuilder_token): Use
9542         mono_image_get_methodspec_token_for_generic_method_definition
9543         instead of mono_image_get_memberref_token. We cache more memberef
9544         entries now.
9545
9546 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9547
9548         * verify.c: Inflate exception clause types.
9549         Fixes #402606.
9550         
9551 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9552
9553         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
9554         name.
9555
9556         * reflection.c (mono_image_get_ctorbuilder_token): Same.
9557
9558         * reflection.c (mono_image_create_method_token): Same.
9559
9560 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9561
9562         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
9563         It does the same as mono_image_get_methodref_token but works on
9564         MethodBuilder.
9565
9566         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
9567         and always generate a methodspec. This follows the old behavior and fixes
9568         the regressions in System.Core. 
9569
9570 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
9571
9572         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
9573         don't event mono_class_get () succeeds. Fixes #402182.
9574
9575 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9576
9577         * metadata-internals.h: Added MonoDynamicImage::methodspec
9578         hashtable to store methodspec tokens created for MethodBuilders.
9579
9580         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
9581         MethodBuilders as open instantiations if a methodspec was requested.
9582
9583         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
9584
9585         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
9586
9587         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
9588
9589         Fixes bug #349190.
9590
9591 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9592
9593         * loader.c (method_from_methodspec): Avoid crashing if the
9594         method lookup fails.
9595
9596 2008-06-20  Dick Porter  <dick@ximian.com>
9597
9598         * socket-io.c (get_socket_assembly): Cope with Moonlight network
9599         classes being in a different assembly.  Fixes bug 399184.
9600
9601 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
9602
9603         * loader.c (mono_loader_init): Make this callable multiple times.
9604         (mono_dllmap_insert): Call mono_loader_init () so this works even before
9605         the runtime is initialized. Fixes #401755.
9606
9607 2008-06-19  Dick Porter  <dick@ximian.com>
9608
9609         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
9610         Fixes bug 349688.
9611
9612 2008-06-19  Dick Porter  <dick@ximian.com>
9613
9614         * socket-io.c:
9615         * icall-def.h: Implement Socket generic Send() and Receive()
9616         methods.  Fixes bug 395168.
9617
9618 2008-06-19  Kornél Pál  <kornelpal@gmail.com>
9619
9620         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
9621
9622         Contributed under MIT/X11 license.
9623
9624 2008-06-18  Martin Baulig  <martin@ximian.com>
9625
9626         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
9627         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
9628         set to 80.0.  The debugger <-> runtime interface is now frozen as
9629         well.   
9630
9631         * mono-debug.c
9632         (mono_debug_debugger_version): Bump to 4.
9633
9634 2008-06-18  Martin Baulig  <martin@ximian.com>
9635
9636         * debug-mono-symfile.c
9637         (load_symfile): Don't check the minor version.
9638
9639         * debug-mono-symfile.h: Bump the version number to 50.0.
9640
9641 2008-06-18  Martin Baulig  <martin@ximian.com>
9642
9643         * debug-mono-symfile.c
9644         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
9645         minimum required version.
9646
9647 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9648
9649         * reflection.c (mono_custom_attrs_from_property): Fix support for
9650         retriveving cattrs of dynamic inflated generic types.
9651
9652         * reflection.c (mono_custom_attrs_from_event): Same.
9653
9654         * reflection.c (mono_custom_attrs_from_field): Same;
9655
9656         * reflection.c (typebuilder_setup_events): Same cattrs of events.
9657
9658         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
9659         Moved to metadata.c.
9660
9661         * metadata.c: New functions to retrive the equivalent field, event
9662         of property from the generic type definition.
9663
9664         * metadata-internals.h: Added new functions from metadata.c.
9665
9666 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9667
9668         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
9669         to cached in a mempool is used.
9670
9671         * metadata.c (free_generic_class): In some situations field generic_info type
9672         is not properly dup'ed and leads to double free'ing.
9673
9674         Fixes #400643.
9675
9676 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9677
9678         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
9679         this arguments (will be needed later for generic methods).
9680         Collect stats.
9681
9682 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9683
9684         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
9685         Create a static RGCTX invoke wrapper for methods which require it.
9686
9687 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9688
9689         * object.c, class-internals.h: New function for checking whether
9690         an individual field is special static.
9691
9692 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
9693
9694         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
9695         linear search since the table is sorted.
9696
9697         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
9698         Fixes #324180.
9699
9700 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
9701
9702         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
9703         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
9704
9705         * gc.c (mono_domain_finalize): Allow an infinite timeout.
9706
9707         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
9708         
9709         * threads.c (mono_thread_request_interruption): Get rid of locking, use
9710         InterlockedCompareExchange to query and modify 
9711         thread->interruption_requested.
9712
9713         * object-internals.h (struct _MonoThread): Change interruption_requested
9714         to a gint32 so it can be modified by atomic operations. Add 
9715         'critical_region_level' from the managed side, change small_id to a guint32,
9716         add new set of 'unused' fields.
9717
9718         * appdomain.c: Bump corlib version.
9719
9720 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
9721
9722         * class.c (mono_class_from_name): Search modules as well. Fixes
9723         #322332.
9724
9725 2008-06-13  Mark Probst  <mark.probst@gmail.com>
9726
9727         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
9728         templates.  Templates are generalized with an additional type_argc
9729         argument.  RGCTX templates have type_argc==0, MRGCTX templates
9730         have type_argc>0.
9731
9732         * domain-internals.h, domain.c: New hash table for looking up
9733         MRGCTXs.
9734
9735         * metadata.c, metadata-internals.h: Rename hash and equal
9736         functions for MonoGenericInst's and make them public.
9737
9738         * class-internals.h: New data structures for the MRGCTX.  Macros
9739         for distinguishing slots in the RGCTX and the MRGCTX.
9740
9741 2008-06-13  Mark Probst  <mark.probst@gmail.com>
9742
9743         * object.c (mono_method_get_imt_slot): Put the same methods of
9744         different instantiations of the same generic interface in the same
9745         IMT slots, to make generic sharing simpler.
9746
9747 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
9748
9749         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
9750
9751         * metadata.c (mono_metadata_field_info_with_mempool): Added.
9752         This function works just like mono_metadata_field_info, but
9753         accept a mempool as argument to be used allocating memory.
9754
9755         * marshal.c (mono_marshal_load_type_info): Use new function
9756         to load marshal data into image mempool.
9757
9758 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
9759
9760         * class.c (mono_class_inflate_generic_type_with_mempool):
9761         This function allows to inflate a generic type using
9762         a mempool.
9763
9764         * class.c (inflate_generic_type): Take a mempool as argument
9765         and use it to do type dup'ing.
9766
9767         * class.c (mono_class_setup_fields): Field type for generic
9768         generic classes are allocated from the image mempool.
9769
9770         * metadata.c (free_generic_class): Inflated field type is
9771         now allocated in the image mempool.
9772
9773 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
9774
9775         * threads.c (thread_cleanup): Free MonoThread::name.
9776
9777 2008-06-12  Marek Habersack  <mhabersack@novell.com>
9778
9779         * appdomain.c (ensure_directory_exists): avoid unnecessary
9780         mkdir(2) calls when the shadow directory already exists.
9781         (mono_make_shadow_copy): copy also satellite assemblies from the
9782         private bin directories.
9783
9784 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
9785
9786         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
9787         
9788         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
9789         a page boundary. Fixes #396219.
9790
9791 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9792
9793         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
9794         due to double-checked locking.
9795
9796 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9797
9798         * assembly.c (build_assembly_name): Release memory on failure.
9799
9800         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
9801
9802 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9803
9804         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
9805         memory on failure.
9806
9807 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9808
9809         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
9810         memory on failure.
9811
9812 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9813
9814         * loader.c (field_from_memberref): Check if field signature type is equal
9815         to the non-inflated type of the field. Fixes #398980.
9816
9817 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
9818
9819         * assembly.c (mono_assembly_load_from_full): Call 
9820         mono_assembly_load_friends () outside the assemblies lock, since it can
9821         acquire the loader lock. Fixes #323696.
9822
9823         * reflection.c (resolve_object): Inflate the inst with the context for
9824         FieldOnTypeBuilderInst. Fixes #399010.
9825
9826 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9827
9828         * reflection.c (mono_image_get_field_on_inst_token): Don't
9829         inflate the field to encode it's signature. If it's a
9830         VAR or MVAR it should stay that way in the signature.
9831         Fixes #399047.
9832
9833 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9834
9835         * reflection.c (resolve_object): Release memory of inflated types.
9836
9837 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9838
9839         * loader.c (mono_method_get_signature_full): Remove assert about
9840         loading a methodspec to a generic method. We have such methods, such as
9841         System.Threading.Interlocked::CompareExchange<T>.
9842         This assert was removed since it crashes the verifier when it checks
9843         methods calling CompareExchange<T>.
9844
9845 2008-06-10  Marek Safar  <marek.safar@gmail.com>
9846
9847         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
9848         of Type array and not MonoType.
9849
9850 2008-06-10  Marek Habersack  <mhabersack@novell.com>
9851
9852         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
9853         <lupus@ximian.com>
9854
9855 2008-06-10  Martin Baulig  <martin@ximian.com>
9856
9857         * debug-mono-symfile.h
9858         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
9859         changes to the file format, but we were generating incorrect
9860         source file indices in the line number table due to a bug, which
9861         made backtraces report an incorrect source file.
9862
9863 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
9864
9865         * mono-debug.c: Moved mono_debug_free_method_jit_info from
9866         mini/debug-mini.c to here.
9867
9868         * mono-debug.c (il_offset_from_address): Free memory from find_method.
9869
9870         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
9871         use it to release structs returned by mono_debug_find_method.
9872
9873 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
9874
9875         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
9876         since it needs to set method->slot for all interface methods.
9877
9878 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9879
9880         * class-internals.h: Forgot to add.
9881
9882 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9883
9884         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
9885
9886         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
9887         Lookup the custom attributes from property_hash.
9888
9889         * reflection.c (mono_save_custom_attrs): Save the custom attributes
9890         in property_hash. Allocate all data using the image mempool.
9891
9892         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
9893         for dynamic_custom_attrs to checks if the image is dynamic.
9894
9895 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
9896
9897         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
9898         assemblies array.
9899         
9900         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
9901         runtime functions while holding the domain assemblies lock.
9902
9903 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9904
9905         * verify.c: Reapplied the last bit of the reverted changes.
9906
9907 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
9908
9909         * verify.c: Reapplied more of the reverted changes.
9910
9911 2008-06-09  Martin Baulig  <martin@ximian.com>
9912
9913         * debug-mono-symfile.c (load_symfile): Check the major version
9914         first; if it's wrong, don't print the minor version in the error message.
9915
9916 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
9917
9918         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
9919         lock instead of the domain lock to avoid deadlocks, since the thread might
9920         already hold the loader lock.
9921
9922         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
9923         (mono_thread_attach): Ditto.
9924
9925         * monitor.c: Use a TLS variable for holding the current thread id instead
9926         of calling pthread_self ().
9927         (mono_monitor_init_tls): New internal function to initialize the TLS
9928         variable.
9929         (mono_monitor_try_enter_internal): Put the owner == id check after the
9930         owner == 0 check.
9931
9932         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
9933         missed optimizations when using gcc-4.3.
9934
9935 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
9936
9937         * reflection.c (mono_dynamic_image_free): Free the memory
9938         used by MonoGenericParam in MonoDynamicImage::gen_param.
9939
9940         * reflection.c (mono_reflection_setup_generic_class): Allocate
9941         container from mempool.
9942
9943         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
9944         container from mempool.
9945
9946 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
9947
9948         * threads.c (mono_set_pending_exception): New internal function to set the
9949         pending exception of the current thread.
9950         (mono_thread_get_and_clear_pending_exception): Check for 
9951         thread->pending_exception as well.
9952
9953         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
9954
9955         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
9956         it can trigger a collection.
9957
9958 2008-06-06  Martin Baulig  <martin@ximian.com>
9959
9960         Merged the `debugger-kahalo' branch.
9961
9962         * mono-debug.h
9963         (MONO_DEBUGGER_VERSION): Bumped to 72.
9964
9965         * debug-mono-symfile.h
9966         (MonoSymbolFileMethodIndexEntry): Removed.
9967         (MonoSymbolFileMethodEntry): New public typedef.
9968         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
9969         (MonoSymbolFileSourceEntry): Remove everything except `index' and
9970         `data_offset'.
9971         (MonoSymbolFileMethodEntry): Removed.
9972         (MonoSymbolFileLexicalBlockEntry): Removed.
9973         (MonoSymbolFileLineNumberEntry): Removed.
9974         (MonoDebugLexicalBlockEntry): Removed.
9975         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
9976         removed `num_il_offsets' and `il_offsets'.
9977         (MonoSymbolFile): Replace `version' with `major_version' and
9978         `minor_version'.
9979         (MONO_SYMBOL_FILE_VERSION): Replace with
9980         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
9981         `MONO_SYMBOL_FILE_MINOR_VERSION'.
9982
9983         * debug-mono-symfile.c
9984         (mono_debug_symfile_lookup_location): Add support for the new line
9985         number table format.
9986
9987 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9988
9989         * metadata.c (free_generic_class): Release the inflated
9990         MonoClass of dynamic generic classes if it's not a generic
9991         type definition.
9992
9993 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9994
9995         * verify.c: Reapplied more of the reverted changes.
9996
9997 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
9998
9999         * reflection.c (lookup_custom_attr): Clean the cached flag or
10000         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
10001         for SRE types.
10002
10003 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10004
10005         * verify.c: Reapplied a small part of the reverted changes.
10006
10007 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
10008
10009         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10010
10011         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
10012         previously in managed code.
10013         (mono_monitor_exit): Ditto.
10014         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
10015
10016         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
10017         the managed definition.
10018
10019 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10020
10021         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
10022
10023 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10024
10025         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
10026         
10027         * monitor.c: Add some micro optimizations.
10028
10029         * icall.c (type_from_typename): Handle 'bool'.
10030
10031 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10032
10033         * verify.c: Implement constructor verification per P III 1.8.1.4.
10034         Fixes #396716.
10035
10036 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10037
10038         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
10039         holding the assemblies lock here too.
10040
10041 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10042
10043         * verify.c: Kill stack_top function.
10044
10045 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10046
10047         * verify.c: Kill stack_get function.
10048
10049 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10050
10051         * verify.c (mono_method_verify): Last change broke the build. Fixed.
10052
10053 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10054
10055         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
10056         more reliable.
10057
10058         * verify.c (mono_method_verify): Inflate params and locals to avoid
10059         mismatch when checking for compatibility.
10060
10061 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
10062
10063         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
10064         Length prefix should be size in bytes. Fix bug #339530.
10065         
10066         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
10067         Length prefix should be size in bytes. Fix bug #339530.
10068
10069         Code is contributed under MIT/X11 license.
10070
10071 2008-06-05  Bill Holmes <billholmes54@gmail.com>
10072
10073         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
10074
10075         Contributed under MIT/X11 license.
10076
10077 2008-06-05  Martin Baulig  <martin@ximian.com>
10078
10079         * mono-debug-debugger.c
10080         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
10081
10082 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
10083
10084         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
10085         while holding the assemblies lock to prevent deadlocks. Handle the case
10086         where the search hook returns NULL but the assembly was still loaded.
10087         Fixes #323696.
10088
10089         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
10090         modify domain state.
10091
10092 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
10093
10094         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
10095         * Makefile.am (pedump_LDADD): Post-process object files and
10096         add dtrace-generated object file, if necessary.
10097
10098         Code is contributed under MIT/X11 license.
10099
10100 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10101
10102         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
10103
10104 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10105
10106         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
10107
10108 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10109
10110         * threads.c: Try to free everything from the delayed free table
10111         when shutting down threads, and set the variable to NULL after the
10112         table is freed so that calling
10113         mono_thread_hazardous_try_free_all() when shutting down the root
10114         domain doesn't crash.
10115
10116 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10117
10118         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
10119         the caller if resulting type was inflated.
10120
10121         * class.c (mono_class_create_from_typespec): Free the MonoType if it
10122         was inflated.
10123
10124         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
10125
10126
10127 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
10128
10129         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
10130         class library tests.
10131
10132         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
10133         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
10134         #396989.
10135
10136 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10137
10138         * domain.c, domain-internals.h: The JIT infos are now freed by the
10139         JIT info table code.  They are freed immediately if there only a
10140         single JIT info table in circulation.  If there is more, the free
10141         is delayed via a queue.
10142
10143         * threads.c, threads-types.h: New hazard pointer function for
10144         freeing all freeable delayed items in one sitting.
10145
10146 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10147
10148         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
10149
10150         * reflection.c (typebuilder_setup_properties): Same.
10151
10152         * reflection.c (typebuilder_setup_events): Same.
10153
10154 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10155
10156         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
10157         and use it for allocating memory.
10158
10159         * reflection.c (mono_marshal_spec_from_builder): Same.
10160
10161         * reflection.c: Change code to use new signatures.
10162
10163         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
10164
10165 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10166
10167         * decimal.c (rescale128): Put back one line which was accidently commented
10168         out.
10169         
10170         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
10171         to cause crashes.
10172
10173 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10174
10175         * reflection.c (mono_reflection_generic_class_initialize): Name must
10176         be always malloc'ed so we can free it later on. Do this for field, property
10177         and event.
10178
10179         * metadata.c (free_generic_class): Free field, property and event names.
10180
10181 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10182
10183         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
10184         instead of g_memdup.
10185
10186         * reflection.c (typebuilder_setup_fields): Same.
10187
10188 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10189
10190         * decimal.c (rescale128): Optimize this function a bit more.
10191
10192 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10193
10194         * metadata.c (free_generic_class): Release some memory from
10195         SRE generic classes.
10196
10197 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10198
10199         * reflection.c (mono_image_get_generic_field_token): No reference
10200         to name is kept, free it.
10201
10202         * reflection.c (mono_reflection_generic_class_initialize): Free
10203         more memory of the inflated field.
10204
10205 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10206
10207         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
10208         code.
10209
10210 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10211
10212         * reflection.c (mono_dynamic_image_free): Release memory used by
10213         MonoDynamicImage::array_methods elements.
10214
10215         * reflection.c (assembly_add_win32_resources): Release memory after
10216         encoding.
10217
10218 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10219
10220         * decimal.c (log2_32): Use an optimized version for this function too.
10221         
10222         * decimal.c (log2_64): Fix this on 32 bit machines.
10223
10224 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10225
10226         * class.c (mono_dup_array_type): Implement allocation using a mempool.
10227
10228         * class.c (mono_metadata_signature_deep_dup): Same.
10229
10230         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
10231         a mempool.
10232
10233         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
10234
10235         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
10236
10237         * metadata-internals.h: Added mono_metadata_signature_dup_full.
10238
10239         * class-internals.h: Update signatures to take a MonoMemPool.
10240
10241 2008-06-02  Dick Porter  <dick@ximian.com>
10242
10243         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
10244         * icall-def.h: Add
10245         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
10246         FormatMessage API to get the error text.  Fixes bug 321827.
10247
10248 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10249
10250         * decimal.c: Add some micro optimizations to make decimal operations faster.
10251
10252 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
10253
10254         * reflection.c (method_encode_clauses): Take a mempool
10255         as parameter and use it to allocate the clause array.
10256
10257         * reflection.c (mono_image_get_field_on_inst_token): Free
10258         the inflated type after encoding it.
10259
10260         * reflection.c (mono_dynamic_image_free): Free each element
10261         of MonoDynamicImage::gen_params.
10262
10263         * reflection.c (reflection_methodbuilder_to_mono_method):
10264         Allocate the generic param array from the mempool.
10265         Allocate signature params from the mempool.
10266
10267         * reflection.c (mono_reflection_generic_class_initialize):
10268         Free inflated fields after been used.
10269
10270 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10271
10272         * icall.c: Reapply the memory leak fixes as they no
10273         longer make mono crash.
10274
10275 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10276
10277         * reflection.c (mono_type_get_object): Don't store the suplied
10278         MonoType with type_hash. A caller which pass a type that
10279         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
10280         might end with a pointer to freed memory.
10281         The solution is to use byval_arg or this_arg from the associated
10282         MonoClass of the supplied type.
10283
10284 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
10285
10286         * icall.c: Revert the rest of the last change as it breaks the build too.
10287
10288 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10289
10290         * icall.c: Revert a leak fix as it's breaking the build.
10291
10292 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10293
10294         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
10295
10296 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10297
10298         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
10299
10300 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10301
10302         * icall.c: Fix some memory leaks.
10303
10304 2008-05-29  Dick Porter  <dick@ximian.com>
10305
10306         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
10307         async socket operations from the pending list when a socket
10308         closes.  Leaving it until the threadpool services the event
10309         exposes a race condition when a socket descriptor is reused.
10310         Fixes bug 377589.
10311
10312 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10313
10314         * object.c: Fix negative index check for array alocation.
10315
10316 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10317
10318         * icall.c, marshal.c: Delegate wrappers should skip visibility.
10319         This check is performed by the verifier for IL created delegates
10320         and by Delegate::CreateDelegate for programatically created ones.
10321         Fixes #372406.
10322
10323 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10324
10325         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
10326         Fix code to use mono_array_size_t instead of int.
10327
10328         Based on patch by Luis F. Ortiz.
10329         Contributed under X11 license.
10330         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10331
10332 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10333
10334         * icall.c: Added ves_icall_System_Array_GetLongLength and
10335         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
10336         arrays.
10337
10338         * icall.h: Export both new functions.
10339
10340         Based on patch by Luis F. Ortiz.
10341         Contributed under X11 license.
10342         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10343
10344 2008-05-28  Martin Baulig  <martin@ximian.com>
10345
10346         The debugger now requires exactly r103463.
10347
10348         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
10349         This version is not supported by the debugger, wait for 72.
10350
10351 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10352
10353         * object.h: Changed array related functions to use
10354         mono_array_size_t instead of guint32. Forgot to commit this file.
10355
10356         Patch by Luis F. Ortiz.
10357         Contributed under X11 license.
10358         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10359
10360
10361 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10362
10363         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
10364         don't define it. Use the number literal instead.
10365
10366 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10367
10368         * icall.c: Changed array related functions to use
10369         mono_array_size_t instead of guint32.
10370
10371         * icall.c (ves_icall_System_Array_GetLength): Check for length
10372         overflow under MONO_BIG_ARRAYS.
10373
10374         Based on patch by Luis F. Ortiz.
10375         Contributed under X11 license.
10376         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10377
10378 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10379
10380         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
10381
10382         Based on patch by Luis F. Ortiz.
10383         Contributed under X11 license.
10384         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10385
10386 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10387
10388         * object.c, object.h: Changed array related functions to use
10389         mono_array_size_t instead of guint32.
10390
10391         Patch by Luis F. Ortiz.
10392         Contributed under X11 license.
10393         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10394
10395 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10396
10397         * object.h: Introduced mono_array_size_t typedef. This must be used
10398         in all places an array length is expected. This is 64bits wide if
10399         MONO_BIG_ARRAYS is enabled.
10400
10401         Patch by Luis F. Ortiz.
10402         Contributed under X11 license.
10403         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10404
10405 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
10406
10407         * security-manager.c class.c: Set the class exception info by calling
10408         mono_class_set_failure ().
10409
10410         * class.c (mono_class_get_exception_data): New accessor function.
10411         (mono_class_set_failure): Store exception_data in the property hash.
10412
10413         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
10414         the struct as a property.
10415
10416         * loader.c (mono_get_method_full): Store the lookup result for method
10417         tokens in method_cache, the others in methodref_cache to decrease the memory
10418         usage of hash tables.
10419
10420         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
10421         (mono_image_init): method_cache is lazy inited now.
10422
10423         * metadata-internals.h (struct _MonoImage): Change method_cache to
10424         a MonoValueHashTable, add a separate methodref_cache.
10425
10426 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
10427
10428         * number-formatter.h: Fix tables to avoid arithemtic overflow in
10429           Double.ToString as exposed by Bug #383531.
10430
10431 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
10432
10433         * number-formatter.h: Make some tables static.
10434
10435         * class.c (mono_method_set_generic_container): New accessor function.
10436         (mono_method_get_generic_container): Ditto.
10437
10438         * class-internals.h (struct _MonoMethod): Remove rarely used 
10439         'generic_container' field, store it in the property hash instead. Add 
10440         'is_generic' boolean field instead.
10441
10442         * image.c (mono_image_init): Initialize property_hash.
10443         (mono_image_close): Destroy property_hash.
10444
10445         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
10446         hold rarely used fields of runtime structures belonging to this image.
10447
10448         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
10449         to get/set method->generic_container.
10450
10451         * loader.c (mono_get_method_from_token): Avoid loading the method header for
10452         generic methods.
10453
10454 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
10455
10456         * class.c (mono_class_inflate_generic_method_full): Don't increase
10457         mono_stats.inflated_method_count for methods found in the cache.
10458
10459         * threads.c (mono_thread_request_interruption): Add a comment about 
10460         QueueUserAPC ().
10461
10462 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
10463
10464         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
10465         interface_offsets_packed table.
10466         
10467         * class.c (mono_class_init): Remove some dead code.
10468
10469         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
10470         mono_class_setup_vtable () when CAS is active to detect security problems.
10471
10472 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
10473
10474         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
10475
10476         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
10477         parameters as it's irrelevant for delegate checking.
10478
10479 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
10480
10481         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
10482
10483         * class.c (mono_class_init): Control the creation of a generic vtable using
10484         a global which is true by default, but set to false by the runtime startup code.
10485         
10486         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
10487         Disabled for now since it breaks the embedding API.
10488         Move the setup of class->methods for arrays to mono_class_setup_methods ().
10489         (mono_class_setup_methods): Add a memory barrier.
10490
10491         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
10492         when mono_class_init () doesn't compute the generic vtable.
10493         
10494 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
10495         * profiler.c: Added mono_profiler_install_statistical_call_chain,
10496         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
10497         to support call chains (backtrace) in the stat profiler.
10498         * profiler.c, profiler-private.h: Likewise.
10499
10500 2008-05-22  Mark Probst  <mark.probst@gmail.com>
10501
10502         * generic-sharing.c: Init generic class when a method of it is
10503         requested via a runtime generic context.
10504
10505 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
10506
10507         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
10508
10509         * reflection.c (mono_type_get_object): Add a FIXME.
10510
10511         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
10512
10513         * class.c (mono_class_get_method_by_index): New helper function, returning an
10514         entry in the class->methods array.
10515
10516 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10517
10518         * class.c (mono_class_init): Only do the array optimization for szarrays. 
10519         Avoid creating a generic vtable for generic instances as well.
10520         (mono_class_get_method_from_name_flags): Don't search in the metadata for
10521         generic instances.
10522
10523 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
10524
10525         * loader.c (mono_get_method_constrained): Inflate the signature
10526         with class context. Fix #325283.
10527
10528 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10529
10530         * object.c (mono_class_create_runtime_vtable): Add a comment.
10531
10532         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
10533         where needed.
10534         (setup_interface_offsets): Handle the case when this is called twice for arrays.
10535         (mono_class_setup_vtable_general): Add an assert.
10536         (mono_class_init): Avoid creating a generic vtable for arrays.
10537
10538         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
10539         here, let mono_class_init () do that.
10540
10541         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
10542         interfaces in mscorlib.
10543
10544         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
10545         interfaces. Add some comments.
10546         (mono_class_init): Call mono_class_setup_methods () here since it is no
10547         longer called by mono_class_setup_vtable ().
10548
10549         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
10550         not set in class->vtable.
10551         (mono_class_create_runtime_vtable): Reenable the disabled code.
10552
10553         * object.c (mono_class_create_runtime_vtable): Disable the last change for
10554         now as it causes some test failures.
10555
10556         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
10557         if using the vtable trampoline. Also remove some strange code which put the
10558         generic methods themselves into the vtable slots. Remove the AOT init_vtable
10559         stuff as it is no longer needed.
10560
10561 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
10562
10563         * pedump.c: Give make --verify all option check code as well.
10564         Using --verify code won't check for metadata now.
10565
10566 2008-05-19  Martin Baulig  <martin@ximian.com>
10567
10568         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
10569
10570         * mono-debug.c
10571         (_mono_debug_using_mono_debugger): New global variable; it's set
10572         directly by the debugger, so mono_debug_using_mono_debugger() also
10573         works after attaching.
10574
10575 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
10576
10577         * object.c (mono_class_create_runtime_vtable): Use memory barriers
10578         as we do double checked locking on MonoClass::runtime_info and
10579         MonoClassRuntimeInfo::domain_vtables.
10580
10581 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
10582
10583         * debug-helpers.c (print_field_value): Fix a warning.
10584
10585 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
10586
10587         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
10588         set in the AOT case.
10589
10590 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10591
10592         * class.c (mono_class_setup_vtable_general): Use memory barriers
10593         as we do double checked locking on MonoClass::vtable.
10594
10595 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10596
10597         * reflection.c (resolve_object): Inflate only if the generic context
10598         is not null. Fixes #389886.
10599
10600 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
10601
10602         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
10603         instead of g_free.
10604
10605         Code is contributed under MIT/X11 license.
10606
10607 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10608
10609         * class.c: Revert unrelated change.
10610
10611 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10612
10613         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
10614         a generic instantiation, use mono_class_from_mono_type instead of playing
10615         with MonoType directly.
10616
10617 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10618
10619         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
10620         checks must ignore generic instantiations, so mono_class_has_parent is not
10621         suitable. Fixes #390128.
10622
10623 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
10624
10625         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
10626         it to avoid registering tokens during metadata generation. Fixes #390023.
10627
10628 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
10629
10630         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
10631         consistent.
10632
10633         Contributed under MIT/X11 license.
10634
10635 2008-05-14  Kornél Pál  <kornelpal@gmail.com>
10636
10637         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
10638         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
10639         to fixup the EXE image.
10640         (mono_cleanup): Use mono_close_exe_image.
10641         (mono_close_exe_image): New function.
10642         * image.c: Include "marshal.h".
10643         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
10644         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
10645         counting when the image is loaded outside of mono_image_open_full. Set status
10646         based on GetLastError.
10647         * coree.c: Include required headers. Add init_from_coree.
10648         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
10649         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
10650         (_CorExeMain): Set init_from_coree.
10651         (CorExitProcess): Only call ExitProcess for now.
10652         (CorBindToRuntimeEx): New stub implementation.
10653         (CorBindToRuntime): New function.
10654         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
10655         (MonoFixupExe): ILONLY executables require no fixups.
10656         (mono_set_act_ctx): New function to set activation context.
10657         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
10658         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
10659         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
10660         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
10661         as MONO_INTERNAL.
10662         * domain-internals.h: Add mono_close_exe_image.
10663
10664         Contributed under MIT/X11 license.
10665
10666 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
10667
10668         * metadata.c (mono_metadata_compute_size): Correctly calculate field
10669         size for generic param and event tables. Fixes #388977.
10670
10671 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
10672
10673         * loader.c (mono_method_signature): Use memory barriers because of the double
10674         checked locking pattern.
10675
10676         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
10677         aborting or aborted as well. Fixes #376391.
10678         
10679         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
10680         existing runtime state in the Suspend handler during shutdown.
10681
10682 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
10683
10684         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
10685
10686         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
10687         which are starting up or shutting down.
10688
10689         * threads.c (mono_threads_set_shutting_down): Don't return a value since
10690         this function never returns if the runtime is already shutting down.
10691
10692         * icall.c (ves_icall_System_Environment_Exit): Update after 
10693         mono_threads_set_shutting_down () signature change.
10694         
10695 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
10696
10697         * class.c: Added can_access_instantiation to verify if the instantiation
10698         is visible. Fix access check for nested types as they returned TRUE
10699         before doing type and generic instantiation visibility checks.
10700
10701 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10702
10703         * reflection.c (mono_reflection_create_generic_class): The created type
10704         must have a different container from its TypeBuilder. Otherwise they
10705         will end sharing generic arguments, which is wrong.
10706
10707         Due to the sharing, making a generic instance of the created type using
10708         the TypeBuider generic arguments resulted in the generic type definition
10709         been returned, which is wrong as well.
10710
10711         As a bonus the code was leaking the type_params array. This memory should
10712         be allocated from the image mempool.
10713
10714         This fixes bug #354047.
10715
10716 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10717
10718         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
10719         to here         as they are now used in assembly.c new code.
10720         Added a skipverification flag to MonoAssembly.
10721         New internal function mono_assembly_has_skip_verification.
10722
10723         * assembly.c: New function mono_assembly_has_skip_verification. It checks
10724         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
10725         part of #387274.
10726
10727 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
10728
10729         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
10730         needed. Fixes #387034.
10731
10732         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
10733
10734 2008-05-06  Miguel de Icaza  <miguel@novell.com>
10735
10736         * assembly.c (mono_assembly_load_reference): Prevent crash while
10737         disassembling Silverlight 2.0 executables while we still do not
10738         have GACed libraries.
10739
10740 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
10741
10742         * reflection.c: Special case generic type definitions as well. Fixes #383444.
10743
10744 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
10745
10746         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
10747         of the dynamic case. Fixes #387404.
10748
10749 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
10750
10751         *verify.c (mono_verifier_is_class_full_trust): If under
10752         verify_all and the verifier mode was not set, only
10753         gac and corlib types are fulltrust. This makes --verify-all
10754         usable to detect unverifiable code, which is the expected
10755         use case.
10756
10757 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
10758
10759         * verify.h: Ops, commited the header with debug
10760         enabled.
10761
10762 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
10763
10764         * verify.c (merge_stack): Use the new value on unverifiable
10765         stack merges.
10766
10767         * verify.c (verify_type_compatibility_full): Comparison
10768         of nullable types can't use mono_class_is_assignable_from.
10769
10770         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
10771         that makes all verification errors be reported.
10772
10773         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
10774         mono_method_verify.
10775
10776 2008-05-05  Robert Jordan  <robertj@gmx.net>
10777
10778         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
10779         support for value types. See #386415.
10780
10781         * object.c: comments.
10782
10783         Code is contributed under MIT/X11 license.
10784
10785 2008-05-05  Martin Baulig  <martin@ximian.com>
10786
10787         * debug-mono-symfile.h
10788         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
10789         for old pre-terrania symbol files.
10790
10791 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
10792
10793         * mono-config.c: Add ppc64 architecture.
10794
10795         Code is contributed under MIT/X11 license.
10796
10797 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
10798
10799         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
10800           PPC64 uses function descriptors as well.
10801
10802         Code is contributed under MIT/X11 license.
10803
10804 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
10805
10806         * object.c (compute_class_bitmap): Ignore literal static fields.
10807
10808         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
10809         var has an invalid format.
10810         (describe_ptr): Add some sanity checks for the vtable.
10811         (add_nursery_frag): Clear unused nursery fragments.
10812         (major_collection): Clear all remaining nursery fragments.
10813
10814 2008-05-03  Robert Jordan  <robertj@gmx.net>
10815
10816         * image.c, metadata-internals.h: add thunk_invoke_cache.
10817
10818         * marshal.c, marshal.h: implement
10819         mono_marshal_get_thunk_invoke_wrapper ().
10820
10821         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
10822
10823         Code is contributed under MIT/X11 license.
10824
10825 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
10826
10827         * verify.c (do_leave): Empty the stack.
10828
10829 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
10830
10831         * class.c (mono_class_is_assignable_from): Variance
10832         doesn't work between reference and value types. For example,
10833         given type C<T+>, C<int32> is not assignable to C<object>.
10834         Break the argument checking loop on first error. 
10835
10836 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
10837
10838         * icall.c : base64_to_byte_array() needs some more strict
10839           check for sequence of '=' characters. Patch by Santa
10840           Marta (http://deee.g.hatena.ne.jp/santamarta).
10841
10842           Contributed under MIT/X11 license.
10843           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
10844
10845 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
10846
10847         * domain.c: Disable LoadLibrary support to fix Win32 build.
10848
10849         Code is contributed under MIT/X11 license.
10850
10851 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
10852
10853         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
10854         to help with cache behaviour.
10855
10856 2008-05-01  Miguel de Icaza  <miguel@novell.com>
10857
10858         * appdomain.c (mono_domain_from_appdomain): Add new accessor
10859         method. 
10860
10861 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
10862
10863         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
10864
10865 2008-05-01  Dick Porter  <dick@ximian.com>
10866
10867         * process.c (process_get_fileversion): Only pass 16 bits of
10868         language ID to VerLanguageName.  Fixes bug 381204.
10869
10870 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
10871
10872         * verify.c (mono_method_verify): Fix the comparison
10873         operator for code bounds check.
10874
10875 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
10876
10877         * verify.c (mono_method_verify): Check the bounds of
10878         all access of the code array.
10879
10880 2008-04-29  Kornél Pál  <kornelpal@gmail.com>
10881
10882         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
10883
10884 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
10885
10886         * image.c (mono_image_strong_name_position): Fix return value when the rva is
10887         not valid.
10888
10889 2008-04-28  Kornél Pál  <kornelpal@gmail.com>
10890
10891         * loader.c (mono_get_method_from_token, mono_method_signature): Add
10892         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
10893         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
10894         fixup main EXE images when using mono.exe for mixed-mode assembly support.
10895         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
10896         mono_runtime_load.
10897         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
10898         runtime initialization from metadata.
10899         * assembly.c: Remove obsolete ceGetModuleFileNameA.
10900         (mono_set_rootdir): Use mono_get_module_file_name.
10901         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
10902         handles.
10903         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
10904         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
10905         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
10906         MonoCLIImageInfo. Add support for module handles.
10907         (load_cli_header): Update mono_cli_rva_image_map signature.
10908         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
10909         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
10910         (mono_image_rva_map): Add support for module handles.
10911         (mono_image_ensure_section_idx): Add support for module handles.
10912         (mono_image_close): Add support for module handles.
10913         (do_load_header): Add support for module handles.
10914         (mono_image_open_from_module_handle): New function for internal use.
10915         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
10916         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
10917         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
10918         handles.
10919         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
10920         * image.h: Add mono_image_fixup_vtable.
10921         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
10922         support.
10923         * coree.h: New file.
10924         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
10925         unsupported native code.
10926         (mono_marshal_set_callconv_from_modopt): New function splitted from
10927         mono_marshal_get_managed_wrapper.
10928         (mono_marshal_get_managed_wrapper): Use
10929         mono_marshal_set_callconv_from_modopt.
10930         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
10931         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
10932         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
10933         that results in a deadlock when the runtime is loaded in _CorDllMain.
10934         * Makefile.am: Add coree.c and coree.h.
10935
10936         Contributed under MIT/X11 license.
10937
10938 2008-04-28  Mark Probst  <mark.probst@gmail.com>
10939
10940         * generic-sharing.c: Search for type arguments in array element
10941         types as well.
10942
10943 2008-04-28  Mark Probst  <mark.probst@gmail.com>
10944
10945         * class-internals.h, generic-sharing.c: New, small runtime generic context.
10946
10947         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
10948
10949         * object.c: Don't setup the RGCTX when the vtable is created,
10950         because we're setting it up lazily now.
10951
10952 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
10953
10954         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
10955         64 bit support.
10956
10957 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
10958
10959         * verify.c (verify_class_for_overlapping_reference_fields): 
10960         If class is under fulltrust allow reference types to overllap
10961         if they have the same RVA.
10962
10963 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
10964
10965         * pedump.c: Added new flag valid-only, that makes the verifier
10966         behaves just like --security=validil. It won't fail type load
10967         due to unverifiable restrictions.
10968
10969 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
10970
10971         * class-internals.h (struct MonoMethod): Added a verification_success
10972         field to cache verifier executions. Reduced MonoMethod:slot size by
10973         one bit.
10974
10975 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
10976
10977         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
10978         instead of a 'vt' argument to save an indirection and to allow these to be used
10979         for valuetypes.
10980         (scan_vtype): New helper function to scan an area using a gc descriptor.
10981         (mono_gc_wbarrier_value_copy): Implement this.
10982         (handle_remset): Add support for REMSET_VTYPE.
10983         (find_in_remset_loc): Ditto.
10984         (mono_gc_base_init): Allow some debugging options to be controlled through the
10985         use of the MONO_GC_DEBUG env variable.
10986         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
10987         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
10988
10989 2008-04-23  Martin Baulig  <martin@ximian.com>
10990
10991         * domain.c (mono_domain_create): Move the call to
10992         mono_debug_domain_create() down, after allocating the domain id.
10993
10994 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
10995
10996         verify.c (verify_class_for_overlapping_reference_fields): Skip
10997         static fields while verifying for overlapping fields as they
10998         don't matter at all.
10999
11000 2008-04-23  Marek Habersack  <mhabersack@novell.com>
11001
11002         * domain-internals.h: added a declaration of
11003         mono_make_shadow_copy.
11004
11005         * assembly.c (mono_assembly_open_full): shadow copying of
11006         assemblies moved to here, so that all the assemblies within the
11007         application domain's private binary directories can be
11008         processed. Fixes bug #380546
11009
11010         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
11011         mono_make_shadow_copy and made non-static. The decision whether
11012         to shadow-copy an assembly is made based on its location - it's
11013         copied if it's in one of the private application domain binary
11014         directories and its different to the target file in the shadow
11015         directory. Fixes bug #380546
11016
11017 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
11018
11019         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
11020
11021         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
11022         types.
11023
11024         * reflection.c (mono_image_create_token): Handle 
11025         Method/ConstructorOnTypeBuilderInst.
11026         (resolve_object): Ditto.
11027         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
11028         so it can be called from resolve_object. Also handle the case when the inflated
11029         class already has its methods setup.
11030
11031 2008-04-21  Martin Baulig  <martin@ximian.com>
11032
11033         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
11034
11035 2008-04-20  Geoff Norton  <gnorton@novell.com>
11036
11037         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
11038         pointer dereference.
11039
11040 2008-04-15  Marek Habersack  <mhabersack@novell.com>
11041
11042         * appdomain.c (try_load_from): if IOMAP is in effect, call the
11043         portability API to look up the assembly file. Fixes behavior in
11044         situations when the application has a bin/ directory, but the
11045         assembly search patch refers to Bin/ (and thus the requested file
11046         name is Bin/SomeLibrary.dll). Fixes bug #379888
11047
11048 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
11049
11050         verify.c (mono_type_is_generic_argument): Extracted this check
11051         from a dozen places to here.
11052
11053         verify.c: Fixed all issues related to boxing generic arguments
11054         and their constraints.
11055
11056 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
11057
11058         verify.c (mono_class_interface_implements_interface): Fix win32 build.
11059
11060 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
11061
11062         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
11063         isn't finished yet. Fixes #363447.
11064
11065 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
11066
11067         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
11068         Fixes #346419.
11069
11070 2008-04-13  Jb Evain  <jbevain@novell.com>
11071
11072         * domain.c: update the 2.1 profile versions.
11073         Merged from the Moonlight 2 branch.
11074
11075 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
11076
11077         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
11078         mscorlibs for the non-refonly case as well.
11079
11080         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
11081         in mono_assembly_load_from_full (). Fixes #378924.
11082
11083 2008-04-11  Geoff Norton  <gnorton@novell.com>
11084
11085         * icall.c: The global extern environ doesn't exist on Mac.  We
11086         need to call NSGetEnviron instead.
11087
11088 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11089
11090         verify.c: Add generic method constraint verification.
11091
11092 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11093
11094         class.c (mono_class_inflate_generic_method_full): Add a long
11095         explanation to the is_mb_open hack. Remove the FIXME.
11096
11097 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11098
11099         * verify.c (mono_method_verify): Mark all unknown opcodes
11100         as invalid. Mark jmp as unverifiable.
11101
11102 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11103
11104         * verify.c: Add code to do type constraint verification on class instances.
11105
11106         * verify.c (mono_verifier_verify_class): Use the type constraint 
11107         verification code.
11108
11109 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11110
11111         * class.c (mono_class_get_field_default_value): Don't pass cindex
11112         as hint to mono_metadata_get_constant_index. The local is not initialized
11113         and should contain garbage most of the time. This could only work
11114         with a lot of luck.
11115
11116 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11117
11118         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
11119
11120 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11121
11122         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
11123
11124         * class.c (mono_class_from_generic_parameter): Save the token of the
11125         generic param in MonoClass::sizes.generic_param_token.
11126
11127         * reflection.c (mono_custom_attrs_from_class): If the class type is
11128         VAR or MVAR retrieve the attributes of the generic param.
11129
11130 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11131
11132         * class.c (mono_class_init): Do class verification if the verifier
11133         is enabled.
11134
11135 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11136
11137         * verify-internal.h: Added mono_verifier_verify_class.
11138
11139         * verify.c: Added mono_verifier_verify_class. It checks for
11140         classes with explicit layout that have overlapping reference fields.
11141
11142         * pedump.c: Init the verifier state prior to verification. Fixed
11143         command line arguments.
11144
11145 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11146
11147         * Makefile.am: Added verify-internals.h, hopefully fix the build.
11148
11149 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
11150
11151         * verify-internals.h: Fix a warning.
11152
11153 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11154
11155         * verify-internals.h: New header with the verifier configuration
11156         extracted from mini.c.
11157
11158         * verify.c: Implemented the new functions exported by verify-internals.h.
11159
11160 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11161
11162         * verify.c: Add proper verification of ckfinite.
11163
11164 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11165
11166         * verify.c (do_conversion): Improved error message to something
11167         more meanfull.
11168
11169         * verify.c (check_is_valid_type_for_field_ops): Fix to work
11170         with primitive types.
11171
11172 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11173
11174         * verify.c: Added tail prefix checking. Marked icall
11175         as unverifible.
11176
11177 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11178
11179         * verify.c: Fix the detection of branches to the middle
11180         of an instruction.
11181
11182 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
11183
11184         * verify.c: Implemented verification of volatile. and
11185         unaligned. prefix. Check if a type is valid after retrieving it.
11186
11187 2008-04-01  Dick Porter  <dick@ximian.com>
11188
11189         * process.c (process_get_fileversion): If there's no string block,
11190         set the file language to en_US.  Fixes the other new part of bug
11191         374600.
11192
11193 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
11194
11195         * class.c: New functions mono_method_can_access_field_full and
11196         mono_method_can_access_method_full. They perform type visibility
11197         and type site check.
11198
11199         * class-internal.h: Added exported functions.
11200
11201         * verify.c: Use new functions to implement proper visibility checks.
11202
11203 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
11204
11205         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
11206
11207 2008-03-28  Dick Porter  <dick@ximian.com>
11208
11209         * process.c (process_get_fileversion): Use the first language ID
11210         we see, rather than insisting on an invariant language.  Fixes bug
11211         374600.
11212
11213 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
11214
11215         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
11216         the streams to fix reading of invalid memory later.
11217
11218         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
11219         to ease debugging.
11220
11221 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
11222
11223         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
11224         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
11225
11226 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
11227         * threads.h: Added MonoThreadManageCallback type and
11228         mono_thread_set_manage_callback prototype
11229         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
11230         (used to store the mono_thread_manage callback).
11231         * threads.c: Added mono_thread_set_manage_callback, and handle
11232         "MonoThread->manage_callback" in build_wait_tids.
11233
11234 2008-03-26  Dick Porter  <dick@ximian.com>
11235
11236         * process.c (process_get_fileversion): Set FileVersionInfo strings
11237         to Empty when the resource doesn't have the particular info.
11238         Fixes bug 355717.
11239
11240 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
11241
11242         * verify.c (mono_method_verify): Proper prefix validation.
11243
11244 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
11245
11246         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
11247         itself in a separate argument instead of throwing them. Fixes #373448.
11248
11249         * appdomain.c: Bump corlib version.
11250
11251 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
11252
11253         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
11254
11255 2008-03-20  Kornél Pál  <kornelpal@gmail.com>
11256
11257         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
11258         version macros.
11259
11260 2008-03-20  Mark Probst  <mark.probst@gmail.com>
11261
11262         * generic-sharing.c, class-internals.h: Code for putting
11263         reflection types into the runtime generic context.
11264
11265 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
11266
11267         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
11268         Fixes #340662. 
11269
11270
11271 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
11272
11273         * verify.c (VerifyContext): Added instruction prefix data to the struct.
11274
11275         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
11276
11277         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
11278
11279         * verify.c (do_cast): Let the result value keep the boxed status.
11280
11281         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
11282
11283 2008-03-17  Jb Evain  <jbevain@novell.com>
11284
11285         * reflection.c: when running on a 2.0 runtime, emit
11286         unconditionally the #~ header version as 2.0, and the
11287         CLI header version as 2.5, for symmetry's sake with csc.
11288
11289 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11290
11291         * class.c: Remove the unused cache_interface_offsets stuff.
11292
11293         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
11294         profiler.c: Fix warnings.
11295
11296 2008-03-16  Mark Probst  <mark.probst@gmail.com>
11297
11298         * generic-sharing.c, class-internals.h: Support for putting
11299         methods into the runtime generic context.
11300
11301 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11302
11303         * class.c (mono_class_setup_fields): Ignore calls made to this function for
11304         classes which are generic instances of not-yet finished typebuilders. Fixes
11305         #351172.
11306
11307         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
11308
11309 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
11310
11311         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
11312
11313         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
11314         field, replace it with a hash table in MonoDynamicImage.
11315
11316         * reflection.c (inflate_mono_method): Access the generic definition object from
11317         image->generic_def_objects instead of imethod->reflection_info.
11318
11319         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
11320
11321         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
11322         
11323         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
11324         function in reflection.c so it is easier to keep in sync with the dynamic image
11325         creation code.
11326
11327         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
11328         mono_image_close ().
11329
11330 2008-03-15  Mark Probst  <mark.probst@gmail.com>
11331
11332         * class.c (mono_class_generic_sharing_enabled): Disable generic
11333         sharing for all architectures except AMD64 and x86 to fix build.
11334
11335 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11336
11337         * verify.c: Use the generic definition MonoGenericContext when available.
11338         Remove code for checking generics instance compatibility in favor of
11339         mono_class_is_assignable_from.
11340
11341 2008-03-14  Mark Probst  <mark.probst@gmail.com>
11342
11343         * marshal.c, marshal.h, metadata-internals.h, image.c,
11344         wrapper-types.h: New wrapper for invoking a shared static method
11345         without having to pass the runtime generic context argument.
11346
11347 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11348
11349         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
11350
11351 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
11352
11353         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
11354         
11355         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
11356         create a token from a FieldOnTypeBuilderInst.
11357         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
11358         (resolve_object): Ditto.
11359
11360         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
11361         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
11362
11363 2008-03-14  Martin Baulig  <martin@ximian.com>
11364
11365         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
11366
11367         * debug-mono-symfile.h
11368         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
11369         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
11370
11371 2008-03-10  Martin Baulig  <martin@ximian.com>
11372
11373         * debug-mono-symfile.h
11374         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
11375         `lexical_block_table_offset'.
11376         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
11377         `lexical_blocks'.
11378         (MonoSymbolFile): Added `version'.
11379
11380         * mono-debug.h
11381         (MonoDebugLexicalBlockEntry): Removed.
11382         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
11383         `lexical_blocks'.
11384
11385         * mono-debug.c (mono_debug_add_method): Don't compute lexical
11386         blocks here; the debugger now does this internally.
11387
11388 2008-02-27  Martin Baulig  <martin@ximian.com>
11389
11390         * object.c (mono_runtime_exec_main): Call
11391         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
11392         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
11393
11394 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11395
11396         * verify.c (verify_type_compatibility_full): Allow native int to be converted
11397         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
11398
11399 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11400
11401         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
11402         ldftn with a virtual method.
11403
11404 2008-03-13  Geoff Norton  <gnorton@novell.com>
11405
11406         * decimal.c:  Only include memory.h if the platform has it.
11407
11408 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
11409
11410         * assembly.c, class.c, metadata-internals.h: make sure public key
11411         tokesns are compared in a case-insensitive way. Also, all
11412         the lookups in the GAC use a lowercase public key token
11413         (gaacutil already does the lowercasing on install). Fixes
11414         bug #369541.
11415
11416 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
11417
11418         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
11419         and return value.
11420
11421 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
11422
11423         * image.c: when someone loads a mscorlib from a file, return the
11424         currently loaded mscorlib (fixes bug #369253).
11425
11426 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11427
11428         * class.c: handle types with no parents by forcing them to have
11429         System.Object as a parent and marking them as broken (this currently
11430         allows the first part of bug #369173 to work as well, likely because
11431         we don't check for typeload exceptions everywhere yet).
11432
11433 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
11434
11435         * class.c: more complete check that types belong to corlib
11436         (fixes second part of bug #369173).
11437
11438 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
11439
11440         * generic-sharing.c:  Including glib.h for the MSVC builds to define
11441           "inline" to "__inline" before including mono-membar.h.
11442           
11443         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
11444           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
11445           MSVC builds.
11446
11447         Contributed under MIT/X11 license.
11448
11449 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11450
11451         * verify.c (do_invoke_method): Remove return type validation.
11452
11453         * verify.c (do_ret): Do return type validation at return site instead of
11454         call site.
11455
11456 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11457
11458         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
11459
11460         * verify.c: Some todos cleaned and improved a few error messages.
11461
11462 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
11463
11464         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
11465
11466 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
11467
11468         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
11469         system types correctly.
11470
11471         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
11472         function.
11473
11474 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11475
11476         * assembly.c (build_assembly_name): Fix a warning.
11477
11478 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
11479
11480         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
11481         the called function takes an object type argument. Fixes storing or
11482         valuetypes across remoting as well as reducing memory usage.
11483         * image.c, metadata-internals.h: remove now unused ldfld_remote and
11484         stfld_remote wrapper caches.
11485
11486 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11487
11488         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
11489         is not found.
11490
11491         * reflection.c (mono_image_register_token): New helper function to save
11492         a token->object mapping.        
11493
11494         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
11495         managed code.
11496
11497         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
11498         one dimension arrays. Fixes #367670.
11499         (mono_reflection_get_type_internal): Ditto.
11500
11501 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
11502
11503         * marshal.c: mono_load_remote_field_new() always returns object.
11504         so use the proper signature (fixes bug #366445).
11505
11506 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11507         
11508         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
11509         add an 'inline_failure' flag instead.
11510
11511 2008-03-04  Mark Probst  <mark.probst@gmail.com>
11512
11513         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
11514         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
11515         contains the location of "this", used for exception handling.
11516
11517 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11518
11519         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
11520         their size on all platforms for perf reasons.
11521
11522 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11523
11524         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
11525         object-internal.h
11526
11527         * object-internal.h: Same.
11528
11529 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11530
11531         * reflection.h: Fix the build I just broke.
11532
11533 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11534
11535         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
11536         Test if a token is valid, this remove explicit usage of 
11537         MonoDynamicImage::tokens from the verifier code.
11538
11539         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
11540
11541         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
11542         instead of direct access to MonoDynamicImage::tokens.
11543
11544 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11545
11546         * verify.c (token_bounds_check): Fix the build I just broke.
11547
11548 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11549
11550         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
11551
11552         * verify.c (verifier_load_method): Fixed the errors message.
11553
11554         * verify.c (mono_method_verify): Fixed a debug message.
11555
11556 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
11557
11558         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
11559         mono-perfcounters.h, class-internals.h: support for predefined
11560         writable counters, query of categories and counters, bugfixes.
11561
11562 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11563
11564         * verify.c (do_refanytype): Verify the refanytype opcode.
11565
11566         * verify.c (mono_method_verify): Use do_refanytype.
11567
11568 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11569
11570         * verify.c (do_mkrefany): Verify the mkrefany opcode.
11571
11572         * verify.c (mono_method_verify): Use do_mkrefany.
11573
11574 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
11575
11576         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
11577         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
11578         implementation.
11579
11580 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11581
11582         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
11583         the type load exception.
11584
11585 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
11586
11587         * verify.c: Added a few FIXME for method signatures
11588
11589         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
11590         of mono_method_get_signature and get vararg call working. Removed unused
11591         checks for return value.
11592
11593         * verify.c (do_refanyval): Verify the refanyval opcode.
11594
11595         * verify.c (mono_method_verify): Implemented verification of arglist and
11596         use do_refanyval.
11597
11598 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11599
11600         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
11601         vtypes to marshal.c.
11602
11603         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
11604         it works for AOT as well.
11605
11606 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11607
11608         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
11609         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
11610         the system time is adjusted.
11611
11612 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
11613
11614         * icall.c, icall-def.h: use the new time functions (fixes the
11615         non-monotonic behaviour of TickCount).
11616
11617 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
11618
11619         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
11620         it breaks the build.
11621         
11622         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
11623         cattr is not finished yet.
11624
11625 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11626
11627         * verify.c: Proper token validation for field, method and type.
11628
11629 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11630
11631         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
11632
11633         * loader.c (method_from_memberref): Generate type load error instead of method missing
11634         if the type is not found.
11635
11636 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
11637
11638         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
11639         some of the conversions caused the generation of a marshal directive exception.
11640
11641 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11642
11643         verify.c: Report which exception should be thrown by the JIT.
11644         Added a lot of FIXME notes.
11645
11646 2008-02-22  Mark Probst  <mark.probst@gmail.com>
11647
11648         * generic-sharing.c: Runtime generic context slots are not
11649         instantiated on init anymore.  Instead, provide function to do the
11650         instantiating on demand.
11651
11652         * class-internals.h: Added vtable to runtime generic context.
11653         Macros for encoding direct and indirect slot offsets in one
11654         guint32.
11655
11656 2008-02-21  Mark Probst  <mark.probst@gmail.com>
11657
11658         * object.c, generic-sharing.c: Moved some generic sharing code
11659         from object.c to generic-sharing.c.
11660
11661         * generic-sharing.c: Added support for extensible runtime generic
11662         context.
11663
11664         * metadata-internals.h: Two new hash tables in MonoImage for
11665         extensible runtime generic context support.
11666
11667         * domain.c: Unregister generic vtables upon domain unloading.
11668
11669         * image.c: Destroy new hash tables upon image unloading.
11670
11671         * metadata.c: Unregister generic subclasses upon image unloading.
11672
11673         * class-internals.h: New data structure for runtime generic
11674         context template.  New fields in the runtime generic context for
11675         extensible part.
11676
11677         * Makefile.am: Added generic-sharing.c.
11678
11679 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11680
11681         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
11682         there is a pending loader exception, raise it.
11683
11684         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
11685         same.
11686
11687         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
11688         same.
11689
11690         Fixes #363450.
11691
11692 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
11693
11694         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
11695
11696         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
11697         
11698         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
11699         ref-only requests for compatibility with MS.
11700
11701 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11702
11703         * reflection.c (mono_custom_attrs_from_method): Don't silently
11704         return an empty list for generic method instances.
11705         (mono_custom_attrs_from_param): Likewise.
11706
11707 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
11708             Raja R Harinath  <harinath@hurrynot.org>
11709
11710         Fix #354757
11711         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
11712         * class.c (mono_class_inflate_generic_method_full): Initialize it
11713         when a fully-open method is instantiated.
11714         * metadata.c (inflated_method_equal, inflated_method_hash): Update
11715         to new field.
11716         * reflection.c (inflate_mono_method): Don't create a temporary context.
11717
11718 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11719
11720         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
11721         Compute correct value, to prepare for imethod->reflection_info going away.
11722
11723 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
11724
11725         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
11726
11727 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
11728
11729         * verify.c: Implement skip visibility flag.
11730
11731 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
11732
11733         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
11734         which contains an extra field to tell the kind of exception that should be thrown.
11735
11736         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
11737
11738 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
11739
11740         * loader.c (mono_method_get_param_names): Initialize 'klass' after
11741         'method' is updated.
11742
11743 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
11744
11745         * class.c (mono_class_layout_fields): Set class->min_align for classes using
11746         explicit layout as well. Fixes #360375.
11747
11748 2008-02-11  Geoff Norton  <gnorton@novell.com>
11749
11750         * loader.c: Guard and dereference against inflated generic methods
11751
11752 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
11753
11754         * class.c: Include Retargetable spec in assembly name.
11755         * assembly.c: Always include PublicKeyToken spec in assembly name
11756         (with value "null" if assembly is not signed), and include
11757         Retargetable spec.
11758         * icall-def.h: Added icall for Assembly.get_fullname.
11759         * icall.c: Added icall returning the fullname of an assembly.
11760
11761 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
11762
11763         * class.c (mono_class_setup_vtable_general): Add a missing call to
11764         mono_class_setup_methods () which is needed in the AOT case.
11765
11766 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
11767
11768         * verify.c (mono_type_get_stack_name): Added. Return the name for the
11769         stack type of the given MonoType.
11770
11771         * verify.c (verify_type_compatibility_full): Handle the void type.
11772
11773         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
11774         way stack merging works.
11775
11776         * verify.c (store_local): Improved verification message.
11777
11778         * verify.c (do_branch_op): If the merging is invalid, the method
11779         is unverifiable and not invalid. Improved error message.
11780
11781         * verify.c (merge_stacks): Properly merge a boxed valuetype and
11782         a reference type diferent than System.Object. Improved error
11783         message.
11784
11785 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
11786
11787         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
11788
11789         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
11790         type of an enum even if the argument is byref.
11791
11792         * verify.c: Replace all explicit uses of enumtype and enum_basetype
11793         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
11794
11795         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
11796
11797         *verify.c (verify_type_compatibility_full): Make enum types
11798         compatible with their base types.
11799
11800         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
11801         types are compatible for the special case of a boxed valuetype and
11802         System.Object.
11803
11804         * verify.c (verify_stack_type_compatibility): The function
11805         is_compatible_boxed_valuetype was extracted from here.
11806
11807         * verify.c (push_arg): Only set ctx->has_this_store if the method
11808         is not static.
11809
11810         * verify.c (do_ldelem): Fixed a typo in an error message and added
11811         strict check for mixing int32 and native int as the array type
11812         and ldelem type.
11813
11814         * verify.c (merge_stacks): Consider boxed valuetypes in the
11815         compatibility checks.
11816
11817 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
11818         * profiler.h: (MonoGCEvent): Added start-stop the world events.
11819
11820 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
11821         *class.c: use_new_interface_vtable_code: renamed the env var to have
11822         a "MONO_" prefix, and fix the logic to enable it by default.
11823
11824 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
11825         *class.c:
11826         mono_class_setup_vtable_general: rewrote the way in which interface
11827         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
11828         makes the code more maintainable.
11829         For now the old code is still there, and can be activated setting
11830         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
11831
11832 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
11833
11834         * verify.c: guarded some debug functions around and #ifdef.
11835
11836         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
11837
11838 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
11839
11840         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
11841         changes for now since they seem to break too many things.
11842
11843 2008-02-05  Mark Probst  <mark.probst@gmail.com>
11844
11845         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
11846         mono_marshal_find_nonzero_bit_offset): Added macro and function
11847         for finding the byte- and bit-offset of a bitfield within a
11848         struct.
11849
11850 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
11851
11852         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
11853         (mono_marshal_get_struct_to_ptr): Ditto.
11854
11855         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
11856         cctor_signature.
11857
11858 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
11859
11860         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
11861         between methods for non-corlib types.
11862
11863 2008-02-02  Geoff Norton  <gnorton@novell.com>
11864
11865         * loader.c (mono_method_get_param_names): Populate the parameter name for 
11866         generic parameters as well. (Fixes #342536)
11867
11868 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
11869
11870         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
11871
11872         * verify.c (do_invoke_method): Fix for calling with byref structs.
11873
11874         * verify.c (do_cast): push a boxed value type based on the type token and not
11875         the type of stack.
11876
11877 2008-01-31  William Holmes  <billholmes54@gmail.com>
11878
11879         * process.c (process_module_string_read): Check the size returned form 
11880           VerQueryValue to avoid out of memory exception. 
11881
11882 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
11883
11884         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
11885         Handle properly modules which are not in the moduleref table. Fixes
11886         #356938.
11887
11888 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
11889
11890         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
11891         the dynamic case which is now in managed code.
11892         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
11893
11894         * marshal.c (mono_string_to_bstr): Fix a warning.
11895         (init_com_provider_ms): Ditto.
11896
11897         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
11898
11899         * exception.c (mono_get_exception_out_of_memory): New helper function.
11900
11901 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
11902
11903         * marshal.c: Add support for BSTR marshalling
11904         using other COM systems.
11905
11906         Code is contributed under MIT/X11 license.
11907
11908 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11909
11910         * object.c (mono_runtime_invoke_array): reverted previous
11911         commit as it breaks the build.
11912
11913 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11914
11915         * object.c (mono_runtime_invoke_array): Verify arguments for
11916         invalid types. Fixes #348522.
11917
11918 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
11919
11920         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
11921         non-final virtual calls using call. 
11922
11923         * verify.c (do_invoke): fixed some TODOs.
11924
11925         * verify.c (push_arg): set has_this_store for "ldarga 0".
11926
11927 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
11928
11929         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
11930         which belong to an inflated class. Fixes #356531.
11931
11932 2008-01-26  Robert Jordan  <robertj@gmx.net>
11933
11934         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
11935         which resort to FindFirstFile when a certain error condition
11936         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
11937         Code is contributed under MIT/X11 license.
11938
11939 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
11940
11941         * marshal.c (emit_marshal_string): Fix out string marshalling
11942         to use specified encoding. Fixes #323900.
11943
11944         Code is contributed under MIT/X11 license.
11945
11946 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
11947
11948         * class.c (mono_class_inflate_generic_method_full): Don't modify
11949         iresult->context after cache check.
11950
11951 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
11952
11953         * class.c (mono_class_inflate_generic_method_full): Change the
11954         struct assignments to memcpy for better visibility and add some comments.
11955
11956 2008-01-23  Dick Porter  <dick@ximian.com>
11957
11958         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
11959         procedure, and make it work on windows.
11960
11961 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
11962
11963         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
11964         a MonoReflectionTypeBuilder since it is always of that type.
11965
11966         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
11967
11968         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
11969
11970         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
11971         
11972         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
11973
11974         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
11975
11976         * reflection.c (mono_reflection_create_runtime_class): Remove already created
11977         instantiations from the type cache.
11978
11979 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11980
11981         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
11982
11983         * verify.c (do_unbox_value): push a controled mutability managed pointer.
11984
11985 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11986
11987         * verify.c (do_ldstr): added, verifies if the #US token is valid.
11988
11989         * verify.c (mono_method_verify): removed old TODO
11990
11991 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11992
11993         * verify.c (do_newobj): add visibility check.
11994
11995 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
11996
11997         * verify.c (do_load_function_ptr): add visibility check.
11998
11999 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
12000         *class.c:
12001         mono_generic_class_get_class: hook profiler events.
12002         mono_field_get_offset: added to support heap-shot in the new profiler.
12003         *class.h: exported mono_field_get_offset.
12004         * reflection.c:
12005         mono_reflection_setup_internal_class: hook profiler events.
12006
12007 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
12008
12009         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
12010         argument here too and use it to avoid checking for pending exceptions if 
12011         possible.
12012
12013 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
12014
12015         * assembly.c (build_assembly_name): add arg for passing the assembly
12016         flags. Do not consider a PublicKey with value "null" valid.
12017         (mono_assembly_name_parse_full): added boolean argument that will be
12018         set if the assembly name contains a PublicKeyToken spec. Added support
12019         for the Retargetable spec for which only Yes or No are allowed as valid
12020         value. Consider assembly name invalid if Retargetable spec is set, but
12021         either version, culture or public key (token) are not specified.
12022         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
12023         with implementation in assembly.c.
12024         * icall.c (fill_reflection_assembly_name): also copy assembly flags
12025         from MonoAssemblyName.
12026         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
12027         introduced argument for mono_assembly_name_parse_full to know if the
12028         assembly name has a PublicKeyToken spec, and if it has instruct
12029         fill_reflection_assembly_name to use default value for keyToken (if
12030         PublicKeyToken is null).
12031
12032 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12033
12034         * verify.c (mono_method_verify): fixed ovf ops with
12035         float values. They are unverifiable now.
12036
12037 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12038
12039         * class.c (set_failure_from_loader_error): add BadImageException to the
12040         list of exceptions that can cause a type to fail to load.
12041
12042         * class.c (mono_class_get_exception_for_failure): same.
12043
12044 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
12045
12046         * verify.c (in_any_exception_block): added, check if offset
12047         is part of any exception handling clause.
12048
12049         * verify.c (get_stack_type): added VAR and MVAR types.
12050
12051         * verify.c (do_stobj): better error messages.
12052
12053         * verify.c (do_cpobj): added, check cpobj.
12054
12055         * verify.c (do_initobj): added, check initobj.
12056
12057         * verify.c (do_sizeof): added, check sizeof.
12058
12059         * verify.c (do_localloc): added, check localloc.
12060
12061         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
12062
12063 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
12064
12065         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
12066         save_lmf/restore_lmf opcodes.
12067
12068         * threads.c (mono_threads_install_notify_pending_exc): New function to
12069         install a callback notifying the JIT there is a pending exception on a thread.
12070         (mono_thread_request_interruption): Call the new callback.
12071         (mono_thread_get_and_clear_pending_exception): New function to return the
12072         exception pending on a thread.
12073
12074         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
12075         to turn off checking for pending exceptions.
12076         (mono_marshal_get_native_wrapper): Ditto.
12077
12078 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12079
12080         * threads-types.h: Get rid of the unnecessary extern declarations.
12081
12082 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
12083
12084         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
12085         return field from parent class if not private.
12086         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
12087         returns fields from parent class if they are not private.
12088         (method_nonpublic): added function to determine if a given method
12089         should be considered non-public. Returns false for private methods
12090         on parent class, and internal methods from parent on the 1.0 profile.
12091         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
12092         use method_nonpublic function to determine whether method should be
12093         returned.
12094         (property_accessor_public): use newly introduced method_nonpublic
12095         function to determine whether accessor is non-public. 
12096         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
12097         event from parent class if not private. Only return static event if
12098         Static flag is set, and only return static event from parent class if
12099         FlattenHierarchy flag is set.
12100         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
12101         include non-private events from parent class.
12102
12103 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12104
12105         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
12106         warning.
12107
12108 2008-01-16  Wade Berrier <wberrier@novell.com>
12109
12110         * security.c: Add assembly.h header to appease some warnings
12111
12112 2008-01-16  Dick Porter  <dick@ximian.com>
12113
12114         * process.c (process_module_string_read): Remove trailing null
12115         when saving string.
12116
12117 2008-01-16  Mark Probst  <mark.probst@gmail.com>
12118
12119         * class-internals.h: A new data structure describing the layout of
12120         a runtime generic context (MonoRuntimeGenericContextTemplate).
12121
12122         * metadata-internals.h: Added a hash table to MonoDomain that maps
12123         from open generic classes to their runtime generic context
12124         templates.
12125
12126         * object.c: Building of the runtime generic context, including
12127         proper handling of generic type arguments of superclasses.
12128         Building of the runtime generic context according to the template.
12129
12130 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
12131
12132         * class.c (mono_class_setup_fields): Set field.count for generic instances.
12133         Fixes #350856.
12134
12135         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
12136         mono_portability_find_file (). Fixes #325466.
12137         (mono_image_get_public_key): Fix a warning.
12138
12139 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
12140
12141         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
12142         Fixes #353550.
12143         (mono_class_from_name_case): Ditto.
12144
12145 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
12146
12147         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
12148           common storage for the tables used in the System/NumberFormatter class.
12149
12150 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
12151
12152         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
12153
12154 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
12155
12156         * verify.c (get_boxable_mono_type): check if the token is valid.
12157
12158         * verify.c (set_stack_value): changed to add an error if an
12159         invalid type is set on stack. Changed all callers due to signature change.
12160
12161         * verify.c (do_stobj): implement stobj validation.
12162
12163 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
12164
12165         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
12166         set container->is_method, it was set earlier.
12167
12168         * metadata.c (type_in_image): Handle MVARs which belong to not finished
12169         generic methods.
12170
12171         * reflection.c (mono_reflection_initialize_generic_parameter): Set
12172         is_method of the generic container to TRUE for methods.
12173
12174 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12175
12176         * metadata.c (type_in_image): Handle type parameters properly.
12177
12178         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
12179         memory ownership of this structure.
12180
12181 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
12182
12183         * verify.c (get_boxable_mono_type): make typedref types been just
12184         unverifiable. check for void type.
12185
12186         * verify.c (do_unbox_any): added, verify opcode unbox.any.
12187
12188         * verify.c (do_load_function_ptr): accept method spec tokens.
12189
12190 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12191
12192         * marshal.c (mono_class_native_size): Always set *align even if this is called
12193         recursively.
12194
12195 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
12196
12197         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
12198         out-of-date.
12199
12200 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
12201
12202         * verify.c: removed some old unused tables. A huge bunch of small fixes
12203         to things found while testing the verifier with mono basic.
12204
12205         * verify.c (dump_stack_value): dump null literal flag to.
12206
12207         * verify.c (verify_type_compatibility_full): fix comparison
12208         for types that have a generic super type.
12209
12210         * verify.c (verify_stack_type_compatibility): fix compatibility
12211         between null literals and reference types. fix compatibility between
12212         boxed valuetypes and object. fix corner case test for enums.
12213
12214         * verify.c (do_cmp_op): proper verification of cgt.un in case
12215         of reference types.
12216
12217         * verify.c (do_invoke_method): fix error message.
12218
12219         * verify.c (do_store_indirect
12220
12221         * verify.c (check_is_valid_type_for_field_ops): proper verification
12222         of managed pointers to valuetypes and boxed valuetypes. proper verification
12223         of null literals.
12224
12225         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
12226         allow token to be a reference type.
12227
12228         * verify.c (do_cast): proper handling of boxes valuetypes.
12229
12230         * verify.c (do_stelem): proper handling of storing a boxed valuetype
12231         in object[].
12232
12233         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
12234         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
12235         fixed the decoding of unbox_any
12236
12237 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
12238
12239         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
12240
12241 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
12242
12243         * verify.c (do_newobj): do delegate verification.
12244
12245         * verify.c (verify_delegate_compatibility): perform delegate
12246         verification.
12247
12248         * verify.c (verify_ldftn_delegate): perform tests related to
12249         ldftn delegates.
12250
12251         * verify.c (mono_delegate_signature_equal): perform the
12252         slightly diferent signature comparison required by delegates.
12253
12254         * metadata.c (mono_metadata_type_equal_full): added and exported
12255         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
12256         allows signature only comparison.
12257
12258         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
12259         as MONO_INTERNAL.
12260
12261 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
12262
12263         * verify.c: added a bunch of stack_slot_* functions to
12264         make access to stack slot type easier. This is required to
12265         allow optional flags, like null literal, boxed value and
12266         this pointer.
12267         All access paths to IlStackDesc::stype have been changed 
12268         to use these new funcions.
12269         Removed a bunch of unused functions and cleared all warnings.
12270         This patch introduces the usage of the this pointer and 
12271         boxed value flags.
12272
12273 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
12274
12275         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
12276
12277 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
12278
12279         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
12280         match managed version.
12281
12282         * appdomain.c: Bump corlib version.
12283         
12284         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
12285         argument.
12286
12287 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
12288
12289         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
12290         Set public key token to zero-length byte array if assembly is not
12291         strongnamed.
12292
12293 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12294
12295         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
12296         writing a vtype array elem.
12297
12298 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
12299
12300         * assembly.c (build_assembly_name): return FALSE if length of token is
12301         not 16 (if not "null").
12302         (mono_assembly_name_parse_full): return FALSE if value of version,
12303         culture, token or key is 0.
12304         * icall.c (fill_reflection_assembly_name): add boolean arguments to
12305         specify whether public key and public key token must be set to default
12306         value (zero-length byte array) if not available. Set versioncompat to
12307         SameMachine. If public key is available or the default is set, then
12308         set PublicKey flag.
12309         (ves_icall_System_Reflection_Assembly_FillName): if no public key
12310         is available, use empty byte array as default value. On the 2.0
12311         profile, use default value for public key token if not set.
12312         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
12313         profile, use default value for public key if not set. On the 2.0
12314         profile, use default value for public key token if not set.
12315         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
12316         default values for public key and public key token.
12317
12318 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12319
12320         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
12321         field to keep it in synch with the managed object.
12322
12323         * marshal.c (emit_marshal_object): Add support for byref marshalling of
12324         delegates. Fixes #351520.
12325
12326         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
12327         contains defined memory.
12328         
12329         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
12330
12331         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
12332         
12333         * sgen-gc.c (check_consistency): New helper function to do a consistency check
12334         of the GC data structures.
12335
12336         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
12337
12338         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
12339         
12340         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
12341         barrier.
12342         (mono_array_clone_in_domain): Ditto.
12343         (mono_array_clone_in_domain): Ditto.
12344
12345         * threads.c (start_wrapper): Register the thread start argument as a GC root.
12346         (cache_culture): Use a write barrier.
12347
12348         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
12349         (ves_icall_get_property_info): Ditto.
12350
12351         * object.h (MONO_STRUCT_SETREF): New macro.
12352
12353         * class-internals.h (MonoStats): Add some GC statistics.
12354
12355         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
12356
12357 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
12358
12359         * exception.c (mono_exception_from_name_two_strings):
12360         Break from loop after method is found.
12361
12362 2008-01-04  Dick Porter  <dick@ximian.com>
12363
12364         * process.c (process_module_string_read): Rename variable to
12365         reflect correct usage, after fixing bug 345972.
12366
12367 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
12368
12369         * verify.c (mono_type_create_fnptr_from_mono_method): 
12370         created a MonoType function pointer instance to be used during
12371         verification. The verifier releases this memory at end.
12372
12373         * verify.c (mono_method_is_constructor): extracted repeated
12374         checks for constructor into a single class.
12375
12376         * verify.c (do_push_field): use new extracted method
12377         for constructor check.
12378
12379         * verify.c (do_newobj): same.
12380
12381         * verify.c (do_ldftn): renamed to do_load_function_ptr
12382         and make it verify ldvirtftn too.
12383
12384         * verify.c (mono_method_verify: proper verification
12385         of ldvirtftn. release created MonoMethod instances.
12386
12387 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12388
12389         * verify.c (token_bounds_check): added.
12390
12391         * verify.c (do_ldftn): added.
12392
12393         * verify.c (mono_method_verify): proper verificartion of ldftn.
12394
12395 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12396
12397         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
12398         than the table row count. It's the resposibility of the caller to
12399         make the bounds check and raise the correct error.
12400
12401         * metadata.c (mono_metadata_decode_row_col): Same.
12402
12403         * loader.c (mono_get_method_from_token): perform bounds check
12404         on token for methoddef table.
12405
12406 2007-12-29  Miguel de Icaza  <miguel@novell.com>
12407
12408         * icall.c
12409         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
12410         assert into a negative result, the managed code already coped with
12411         that.
12412
12413         Some folks on Windows reported this error. 
12414
12415 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
12416
12417         * appdomain.c: Bump corlib version.
12418         * icall.c:
12419         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
12420         CultureInfo.CreateCulture to create CultureInfo for name.
12421         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
12422         create CultureInfo for name. Fixes bug #347174.
12423
12424 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12425
12426         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
12427         flags.
12428
12429         * verify.c (is_valid_branch_instruction): allow branching to the
12430         first instruction of the protected block.
12431
12432         * verify.c (is_valid_cmp_branch_instruction): same.
12433
12434         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
12435         avoid double initialization.
12436
12437         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
12438         detect which cases the eval stack should just be copied.
12439
12440         * verify.c (mono_method_verify): check if the eval stack
12441         is empty when entering a protected block.
12442
12443 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12444
12445         * verify.c: added is_clause_in_range, is_clause_inside_range,
12446         is_clause_nested and verify_clause_relationship. They perform
12447         the verifications stated in P1 12.4.2.7.
12448
12449         * verify.c (mono_method_verify): remove some unused variables,
12450         add the new exception clause checks, add instruction border
12451         checks for protected block start/end, improved some error 
12452         messages and fixed a bug in the way invalid instruction access
12453         is detected.
12454
12455 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
12456
12457         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
12458         from GC 7.0 if available.
12459
12460         * object.c: Remove an unused define.
12461         
12462         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
12463
12464         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
12465
12466         * null-gc.c (mono_gc_make_descr_for_array): Implement.
12467
12468         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
12469
12470         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
12471         to take the same arguments as the other make_descr functions.
12472
12473         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
12474
12475         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
12476         directly.
12477
12478         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
12479         mini.c.
12480
12481         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
12482         call to boehm-gc.c.
12483
12484         * boehm-gc.c (mono_gc_register_root): Fix a warning.
12485
12486         * null-gc.c (mono_gc_register_root): Fix a warning.
12487
12488         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
12489
12490         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
12491         (mono_gc_base_init): Call GC_init ().
12492
12493         * null-gc.c: Define mono_gc_register_root () as a no-op.
12494
12495         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
12496
12497 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
12498
12499         * verify.c: add prototype for merge_stacks at top
12500
12501         * verify.c (do_switch): added.
12502
12503         * verify.c (merge_stacks): on some cases the stack merging
12504         was not happening properly. Unequal stack sizes at merge
12505         points should be invalid.
12506
12507         * verify.c (mono_method_verify): added more debug info on stack state.
12508         verify switch properly.
12509
12510 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
12511
12512         * method-builder.h: New file, moved the mono_mb_ declarations here from 
12513         marshal.h.
12514
12515         * boehm-gc.c marshal.c: Include method-builder.h.
12516
12517         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
12518
12519         * marshal.c: Remove some code which is now in method-builder.c.
12520
12521 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
12522
12523         * method-builder.c: New file, extraction of the method builder functionality 
12524         from marshal.c.
12525
12526         * marshal.c: Move the mb functions into method-builder.c.
12527
12528         * marshal.h marshal.c: Export some mono_mb_... functions.
12529
12530         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
12531
12532         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
12533         the caller.
12534
12535         * class.c (mono_class_get_full): Check the token type in the dynamic case.
12536
12537         * loader.c (mono_field_from_token): Ditto.      
12538
12539         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
12540         type as well.
12541         
12542         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
12543         Fixes #342565.
12544
12545         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
12546         a helper function for setting it.
12547
12548         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
12549
12550         
12551         * assembly.c: Significally simplify code now that referenced assemblies are 
12552         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
12553
12554         * threads.h: Don't include  the internal threads-types.h header file. Fixes
12555         #349952.
12556
12557 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
12558
12559         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
12560         instructions that were target of branches or are at protected block boundaries.
12561
12562         * verify.c (in_same_block): handle filter clauses.
12563
12564         * verify.c (is_valid_branch_instruction): added. checks the target of
12565         instructions br or brtrue/false.
12566
12567         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
12568         binary branch instructions such as beq and bge.
12569
12570         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
12571         and made it pin the instruction as been part of the exception block.
12572
12573         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
12574         of in_same_block.
12575
12576         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
12577         of in_same_block.
12578
12579         * verify.c (do_ret): ret from a protected block is unverifiable and
12580         not invalid.
12581
12582         * verify.c (do_static_branch): verify br and br.s instructions.
12583
12584         * verify.c (merge_stacks): add extra param to support detection
12585         of branches in the middle of instructions.
12586         
12587         * verify.c (mono_method_verify): verify branches and exception blocks
12588         that target the middle of instructions. Proper verification of br and br.s.
12589
12590 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
12591
12592         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
12593         skip_visibility field.
12594         (reflection_methodbuilder_from_dynamic_method): Ditto.
12595
12596         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
12597         registrations. Fixes #348193.
12598
12599         * threads.h: Move the internal mono_thread_get_pending_exception () to
12600         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
12601
12602 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
12603
12604         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
12605         icall registration. Fixes #348193.
12606
12607         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
12608         for corlib classes into object. Fixes #349621.
12609
12610 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
12611
12612         * icall.c (property_accessor_nonpublic): new function to determine
12613         whether an accessor allows a property to be considered non-public.
12614         Returns false for private accessor(s) from parent class, and internal
12615         accessor(s) from parent on 2.0 profile (and higher).
12616         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
12617         to determine whether property should be included if NonPublic flag
12618         is set. Fixes bug #349078.
12619
12620 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
12621
12622         * verify.c (init_stack_with_value): added.
12623
12624         * verify.c (mono_method_verify): extracted common
12625         code for exception initialization into init_stack_with_value.
12626
12627         * verify.c (mono_method_verify): initialize the exception
12628         for handler clauses as well.
12629
12630         * verify.c (mono_method_verify): fix the exception clause
12631         ordering rules, it should use handler end offset and not
12632         start offset.
12633
12634 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
12635
12636         * rawbuffer.c: remove useless warning.
12637
12638 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
12639
12640         * threads.h, threads-types.h: move functions to the correct header
12641         (fixes bug#349952).
12642
12643 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12644
12645         * verify.c (mono_method_verify): proper verification
12646         of exception handling clauses ranges and fallthru in
12647         and out of protected blocks.
12648
12649 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12650
12651         * verify.c (mono_method_verify): fixed compilation issue.
12652
12653 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12654
12655         * verify.c (mono_method_verify): a printf slipped in, changed
12656         to use verifier debug macro.
12657
12658 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
12659
12660         * verify.c (is_correct_leave): check for filter clauses.
12661
12662         * verify.c (do_filter): added.
12663
12664         * verify.c (mono_method_verify): property verification of leave.
12665
12666
12667 2007-12-18  Mark Probst  <mark.probst@gmail.com>
12668
12669         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
12670         Win32 build, until we figure out how to do the proper thing on
12671         Win32.
12672
12673 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
12674
12675         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
12676         by the previous patch.
12677         
12678         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
12679         the assembly resolve handler for refonly assemblies.
12680
12681 2007-12-17  Mark Probst  <mark.probst@gmail.com>
12682
12683         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
12684         Make sure only one thread is allowed to commence shutdown, and
12685         don't allow new threads to be started once shutdown is in
12686         progress.
12687
12688 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
12689
12690         * verify.c (is_correct_endfilter): added.
12691
12692         * verify.c (is_unverifiable_endfilter): added.
12693
12694         * verify.c (do_endfilter): added.
12695
12696         * verify.c (mono_method_verify): property verification of endfilter
12697         and fixed a corner case or endfinally.
12698
12699 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
12700
12701         * verify.h: new flags to support fail fast of unverifiable code and
12702         do non-strict verification. Non-strict verification is required to
12703         have MS runtime compatibility. There are a huge amount of unverifiable
12704         code that it accepts as verifiable. The strict mode verifies the code
12705         as the specs says.
12706         Non-strict mode will be required in cases where code needs to be
12707         accepted as verifiable but fails under strict mode.
12708
12709         * pedump.c: added support to fail fast and non-strict verification.
12710
12711         * verify.c: added support for both fail fast and non-strict verification.
12712
12713 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
12714
12715         * verify.c (is_correct_endfinally): added.
12716
12717         * verify.c (mono_method_verify): property verification of endfinally.
12718
12719 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
12720
12721         * verify.c (in_any_block): check for filter clauses.
12722
12723         * verify.c (is_correct_rethrow): added.
12724
12725         * verify.c (mono_method_verify): property verification of rethrow.
12726
12727         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
12728
12729 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
12730
12731         * verify.c (do_throw): added.
12732
12733         * verify.c (mono_method_verify): property verification of throw
12734
12735 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
12736
12737         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
12738         assemblies. Fixes #346425.
12739
12740 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
12741
12742         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
12743         FieldBuilders.
12744
12745         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
12746
12747         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
12748         prevent asserts when this is called with a token which might not be valid.
12749
12750         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
12751         lookup_dynamic_token_class with valid_token == FALSE.
12752
12753         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
12754
12755         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
12756
12757         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
12758         
12759 2007-12-10  Mark Probst  <mark.probst@gmail.com>
12760
12761         * gc.c: Don't delay threadpool thread finalization unless Mono is
12762         shutting down.
12763
12764 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
12765
12766         * threads.c: turn an assert into a non-fatal warning.
12767
12768 2007-12-09  Robert Jordan  <robertj@gmx.net>
12769
12770         * icall.c (GetVirtualMethod): Add missing argument validation.
12771
12772 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
12773
12774         * verify.c (do_cast): added.
12775
12776         * verify.c (mono_method_verify): property verification of castclass and isinst.
12777
12778
12779 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
12780
12781         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
12782
12783         * verify.c (do_stelem): added.
12784
12785         * verify.c (mono_method_verify): property verification of stelem.X.
12786
12787 2007-12-07  Mark Probst  <mark.probst@gmail.com>
12788
12789         * class.c, class-internals.h: Introduce an environment variable
12790         (MONO_GENERIC_SHARING) through which the extent of generic code
12791         sharing can be controlled (share all classes, share only corlib
12792         classes, or share nothing).
12793
12794         * object.c: Only create runtime generic context for classes for
12795         which sharing is enabled.
12796
12797 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
12798
12799         * verify.c (do_ldelem): refactor it to work with ldelem.any.
12800
12801         * verify.c (mono_method_verify): property verification of ldelem.any.
12802
12803 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
12804
12805         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
12806         added ldelem.X opcodes.
12807
12808         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
12809
12810         * verify.c: proper verification of ldelem.X 
12811
12812 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
12813
12814         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
12815
12816 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
12817
12818         * verify.c (mono_method_verify): null literal requires special handling,
12819         the value pushed on stack need to be flagged as so.
12820
12821         * verify.c (do_ldelema): Verify ldelema properly.
12822
12823 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
12824
12825         * verify.c: Verify ldlen properly.
12826
12827 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
12828
12829         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
12830         to the target object's type. Fixes #346160.
12831
12832 2007-12-05  Dick Porter  <dick@ximian.com>
12833
12834         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
12835         Solaris needs the same workaround as BSD-derived systems.  Fixes
12836         bug 323524, patch by Burkhard Linke
12837         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
12838
12839 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
12840
12841         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
12842         handle to use when error dialog is shown; otherwise, update mask
12843         to show no error dialog when an error occurs.
12844
12845 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
12846
12847         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
12848
12849         * class.c (mono_class_get_field_default_value): New helper function to initialize
12850         field->def_type and field->data.
12851
12852 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
12853
12854         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
12855         the general one.
12856
12857         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
12858
12859         * marshal.c: Avoid depending on delegate->method_info being set.
12860
12861         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
12862         
12863         * object.c (mono_delegate_ctor): Set delegate->method.
12864
12865         * object-internals.h (struct _MonoDelegate): Add 'method' field.
12866
12867         * appdomain.c: Bump corlib version.
12868
12869 2007-11-27  Raja R Harinath  <harinath@gmail.com>
12870
12871         * metadata.c (mono_generic_inst_equal_full): Short-circuit
12872         equality check if we're comparing canonicalized MonoGenericInsts.
12873
12874 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
12875
12876         * class.c (generic_array_methods): Call mono_class_setup_methods () before
12877         accessing class->methods.
12878
12879 2007-11-22  Dick Porter  <dick@ximian.com>
12880
12881         * threads.c: Ensure that the synch_cs is set before trying to use
12882         it.
12883
12884 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
12885
12886         * profiler.c: r89126 broke the statistial profiler, unbreak.
12887
12888 2007-11-22  Martin Baulig  <martin@ximian.com>
12889
12890         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
12891
12892         * mono-debug.c
12893         (mono_debug_debugger_version): Bump to 3.
12894         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
12895         -> mono_debugger_class_initialized().
12896
12897         * mono-debug-debugger.c
12898         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
12899
12900         * class.c
12901         (mono_debugger_start_class_init_func): Removed.
12902         (mono_debugger_class_loaded_methods_func): Added.
12903         (mono_class_setup_methods): Call it here.
12904
12905 2007-11-22  Martin Baulig  <martin@ximian.com>
12906
12907         * mono-debug.c
12908         (mono_debug_add_delegate_trampoline): New public method.
12909         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
12910
12911         * mono-debug.h
12912         (MonoSymbolTable): Added `global_data_table'.
12913         (MonoDebuggerTypeKind): Removed.
12914
12915 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
12916
12917         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
12918         these methods.
12919
12920         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
12921         
12922 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
12923
12924         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
12925
12926 2007-11-20  Martin Baulig  <martin@ximian.com>
12927
12928         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
12929
12930         * mono-debug-debugger.c
12931         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
12932         (mono_debugger_remove_breakpoint): Likewise.
12933         (mono_debugger_check_breakpoints): Likewise.
12934         (mono_debugger_register_class_init_callback): New public method.
12935         (mono_debugger_remove_class_init_callback): Likewise.
12936         (mono_debugger_add_type): Likewise.
12937
12938         * mono-debug-debugger.h
12939         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
12940
12941 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
12942
12943         * class.c: more interface implementations needed for the
12944         array enumerator (fixes bug #341112).
12945
12946 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
12947
12948         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
12949         fix ParamName of ArgumentNullExceptions.
12950
12951 2007-11-17  Miguel de Icaza  <miguel@novell.com>
12952
12953         * reflection.c (mono_reflection_encode_sighelper): Generate the
12954         modopts and modreqs.   I have a useless test that crashes monodis,
12955         but that shows the code working.
12956
12957 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
12958
12959         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
12960         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
12961
12962 2007-11-15  Dick Porter  <dick@ximian.com>
12963
12964         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
12965         When joining a thread, it's the thread that's calling Join that
12966         gets WaitSleepJoin state not the target.  Fixes the standalone
12967         test case in bug 334740, and hopefully the whole bug too.
12968
12969 2007-11-15  Dick Porter  <dick@ximian.com>
12970
12971         * process.c: Read file version info from the files pointed at by
12972         process modules, not the current process.  Fixes bug 315969.
12973
12974         Use windows typedef names in some places to fix warnings on the
12975         windows build.
12976
12977 2007-11-15  Mark Probst  <mark.probst@gmail.com>
12978
12979         * image.c, metadata-internals.h: Added a generic_class_cache hash
12980         to MonoImage for looking up generic classes when sharing generics.
12981
12982 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
12983
12984         * sgen-gc.c: warning cleanups.
12985
12986 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
12987
12988         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
12989         inherited properties.
12990
12991 2007-11-14  Mark Probst  <mark.probst@gmail.com>
12992
12993         * object.c, class-internals.h: Added more information to the
12994         runtime generic context.
12995
12996 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
12997
12998         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
12999         instead of just the target method. Generalize the abstract method handling to
13000         handle any non-static method.
13001
13002         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13003         mono_marshal_get_delegate_invoke () signature change.
13004
13005 2007-11-13  Mark Probst  <mark.probst@gmail.com>
13006
13007         * class.c, class-internals.h: Made
13008         mono_type_get_basic_type_from_generic () public.  Fixed member
13009         access check for shared generics.
13010
13011         * loader.c: Don't insert field into field cache if it's part of a
13012         non-inflated generic class.
13013
13014         * domain.c, domain-internals.h: The generic sharing context is now
13015         part of the jit info data structure.  Added two accessor
13016         functions.
13017
13018 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
13019
13020         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
13021         the array Get/Set/Address methods, since the JIT inlines them.
13022
13023         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
13024
13025         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
13026         (mono_image_init): Initialize runtime_invoke_direct_cache.      
13027
13028         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13029         mono_marshal_get_delegate_invoke signature change.
13030
13031         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
13032         an additional argument. Add support for invoking abstract methods.
13033
13034         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
13035
13036         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
13037
13038 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13039
13040         * class.c: Do field layout for open generic classes as well.
13041
13042 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13043
13044         * gc.c, gc-internal.h: Don't finalize threadpool threads with
13045         other objects, because the threadpool is still around.  Put them
13046         in a list instead and after finalizing all other objects in the
13047         root domain shut down the thread pool and then finalize the
13048         threads.  Fixes bug #337383.
13049
13050         * threads.c, thread-types.h: New mono_thread_create_internal()
13051         function for marking a thread with the threadpool flag before it
13052         started.  Set synch_cs to NULL after freeing it.
13053
13054         * threadpool.c: Mark threadpool threads before they start.
13055
13056 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
13057
13058         * reflection.h, reflection.c: don't export random functions
13059         and lazy load dbnull and missing objects.
13060
13061 2007-11-07  Jonathan Chambers <joncham@gmail.com>
13062
13063         * class.c: Initialize COM types if COM interfaces
13064         are present (not just COM classes).
13065         
13066         Code is contributed under MIT/X11 license.
13067
13068 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13069         * reflection.c:
13070         create_dynamic_mono_image: hook module profiler events (dynamic case).
13071         mono_image_basic_init: hook assembly profiler events (dynamic case).
13072
13073 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13074         * profiler.c:
13075         simple_appdomain_unload: completely terminate the profiler
13076         instead of only processing the statistical samples.
13077         simple_shutdown: make sure this is really called exactly once,
13078         even in multithreaded applications, and always listen to
13079         appdomain events.
13080         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
13081         here, the "[un]load" functions will do it.
13082         Fixes bugs #333791 and #325261.
13083
13084 2007-11-07  Geoff Norton  <gnorton@novell.com>
13085
13086         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
13087         rather than depend on __APPLE__.
13088
13089 2007-11-07  Mark Probst  <mark.probst@gmail.com>
13090
13091         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
13092
13093 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
13094
13095         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
13096         UTF16 MonoString. Fix the crash from bug #335488
13097
13098 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
13099
13100         * marshal.c: Correct (for non-Win32 OS) length != size in 
13101         mono_string_from_bstr. Fix #339530.
13102
13103 2007-11-06  Geoff Norton  <gnorton@novell.com>
13104
13105         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
13106         to succeed
13107
13108 2007-11-05  Kornél Pál  <kornelpal@gmail.com>
13109
13110         * process.c: Added run-time GetProcessId API detection for Windows.
13111
13112 2007-11-04  Miguel de Icaza  <miguel@novell.com>
13113
13114         * reflection.c  (mono_param_get_objects): If a parameter has the
13115         attribute [System.Runtime.InteropServices.Optional] we should
13116         set the DefaultValue of the ParameterInfo to be
13117         System.Reflection.Missing instead of DBNull.
13118
13119         See bug #339013.
13120
13121         (mono_get_reflection_missing_object): New method,
13122         returns the System.Reflection.Missing.Value singleton instance.
13123
13124 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
13125
13126         * culture-info-table.h : regenerated.
13127
13128 2007-11-02  Jonathan Chambers <joncham@gmail.com>
13129
13130         * icall.c: Use GetEnvironmentStrings on windows
13131         so we are using the same environment block as 
13132         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
13133         #333740.
13134         
13135         Code is contributed under MIT/X11 license.
13136
13137 2007-10-31  Martin Baulig  <martin@ximian.com>
13138
13139         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
13140
13141         * mono-debug-debugger.h
13142         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
13143
13144 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
13145
13146         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
13147         classes.
13148
13149 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
13150
13151         * culture-info-table.h : regenerated.
13152
13153 2007-10-30  Robert Jordan  <robertj@gmx.net>
13154
13155         * icall-def.h, icall.c:
13156         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
13157
13158         Code is contributed under MIT/X11 license.
13159
13160 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13161
13162         * class.c (mono_class_setup_vtable): Find the inflated methods in the
13163         inflated class instead of inflating them again.
13164         
13165         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
13166         dynamic case.
13167
13168         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
13169         Call setup_supertypes () after klass->parent is set.
13170         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
13171
13172         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
13173         for inflated instances of not yet created dynamic generic classes.
13174         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
13175         times from inflated_method.
13176         (methodbuilder_to_mono_method): Ditto.
13177
13178 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
13179
13180         * gc.c: code cleanup and removed old untested option of not creating the
13181         finalizer thread.
13182
13183 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13184
13185         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
13186         creating a jump trampoline for dynamic methods.
13187
13188 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
13189
13190         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
13191         generic TypeBuilders when called from another method of the same type (bug #335131).
13192
13193
13194 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
13195
13196         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
13197         doesn't seem to work perfectly.
13198         
13199         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
13200         called multiple times.
13201         (methodbuilder_to_mono_method): Ditto.
13202         (resolve_object): Inflate FieldBuilder's.
13203
13204 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13205
13206         * string-icalls.c, string-icalls.h, appdomain.c: patch from
13207         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
13208         RemoveEmptyEntries in the string.Split implementation (bug #322375).
13209
13210 2007-10-26  Dick Porter  <dick@ximian.com>
13211
13212         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
13213         Thread initialisation changes
13214
13215 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
13216
13217         * verify.c: fix compatibility check between arrays and System.Array
13218
13219 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
13220
13221         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
13222         too. Fixes #336999.
13223
13224 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
13225
13226         * object.c (mono_value_box): Use typed allocation here.
13227
13228 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
13229
13230         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
13231         trampoline instead of compiling the method right away.
13232
13233         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
13234
13235 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
13236
13237         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
13238         related fields for dynamic classes. Fixes #334493.
13239
13240 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
13241
13242         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
13243         
13244         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
13245
13246         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
13247         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
13248
13249         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
13250
13251         * reflection.c (create_generic_typespec): Initialize klass->generic_container
13252         if needed.
13253         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
13254
13255 2007-10-18  Jonathan Chambers <joncham@gmail.com>
13256
13257         * marshal.c: Use correct key when removing item
13258         from ccw_hash.
13259         
13260         Code is contributed under MIT/X11 license.
13261
13262 2007-10-17  William Holmes  <billholmes54@gmail.com>
13263
13264         *marshal.c: Adding a case to marshal booleans to U1
13265
13266         Code is contributed under MIT/X11 license.
13267
13268 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
13269
13270         * class.c (mono_class_from_name): Search the modules compromising dynamic
13271         assemblies. Fixes #331601.
13272
13273 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
13274
13275         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
13276         exception if the type name contains an assembly component. Fixes #334203.
13277
13278         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
13279         modules inside dynamic assemblies. Fixes #334200.
13280         
13281         * reflection.c: Set image->public_key and image->public_key_length;
13282
13283         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
13284         fields.
13285
13286         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
13287         
13288 2007-10-16  Mark Probst  <mark.probst@gmail.com>
13289
13290         * metadata.c: Implemented correct comparing of generic classes.
13291         An inflated generic class can be equal to a non-inflated one if it
13292         is inflated with generic type variables as type arguments.  Fixes
13293         bug #333798.
13294
13295 2007-10-15  Dick Porter  <dick@ximian.com>
13296
13297         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
13298         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
13299         81646.
13300
13301         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
13302         instead of a monitor lock.  This means that monitor_try_enter and
13303         co can set the thread state safely.
13304         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
13305         thread_interrupt_requested, so interrupt actually works.
13306
13307         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
13308         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
13309         state accessor function
13310
13311 2007-10-15  Martin Baulig  <martin@ximian.com>
13312
13313         * mono-debug.h
13314         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
13315         the debugger with the current runtime.
13316
13317 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
13318
13319         * object.c, object-internals.h: added the ability to set a single
13320         trampoline for all the slots in a vtable.
13321
13322 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13323
13324         * marshal.c: deal with a possible race condition during multicast
13325         delegate invocation.
13326
13327 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13328
13329         * class.c: ensure value type methods don't have the synchronized
13330         flag set.
13331
13332 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
13333
13334         * string-icalls.c, string-icalls.h: reverted unapproved patch that
13335         breaks the build.
13336
13337 2007-10-11  Joel Reed  <joelwreed@comcast.com>
13338
13339         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
13340         to take an options parameter so that empty entries can be removed during
13341         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
13342
13343 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13344
13345         * marshal.c: make sure we don't store the signature from a dynamic
13346         method into the runtime invoke cache (bug #327189).
13347
13348 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13349
13350         * marshal.c: make sure the wrapper methods are properly initialized.
13351
13352 2007-10-11  Mark Probst  <mark.probst@gmail.com>
13353
13354         * metadata.c, metadata-internals.h: Generalized
13355         mono_type_stack_size() to mono_type_stack_size_internal() which
13356         takes an additional argument specifying whether it allows open
13357         types.
13358
13359 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
13360
13361         * verify.c (do_invoke_method): handle typedbyref params
13362         correctly and check for unverifiable return values.
13363
13364         * verify.c (do_newobj): fix a warning.
13365
13366 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13367
13368         * verify.c: don't tread typedbyref as allways unverifable,
13369         so uses, like (ld/st)loc.0 are valid. verify for the cases
13370         that it matters, like boxing related operations.
13371
13372 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13373
13374         * verify.c: add verification of the newobj opcode. verification
13375         of delegate instantation still missing due ldftn and virldftn not
13376         pushing the function type on stack
13377
13378 2007-10-08  Mark Probst  <mark.probst@gmail.com>
13379
13380         * class-internals.h: Runtime generic context data structure
13381         definition.
13382
13383         * object.c: Initialization of runtime generic context at runtime
13384         vtable creation time.
13385
13386 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
13387         * class.c (mono_class_create_from_typedef,
13388         mono_class_from_generic_parameter, mono_ptr_class_get,
13389         mono_fnptr_class_get, mono_bounded_array_class_get)
13390         * domain.c (mono_domain_create, mono_domain_free)
13391         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
13392         * image.c (do_mono_image_load, mono_image_close):
13393         Hooked up load-unload profiler events.
13394
13395 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
13396
13397         * domain.c: track statistics about the actual amount of native code
13398         allocated.
13399
13400 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13401
13402         * class.c: the valuetype enumerators don't have the additional
13403         supertypes interfaces.
13404
13405 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13406
13407         * class.c: need more interfaces setup for the IEnumerator<T>
13408         object created for arrays (tests/ienumerator-interfaces.2.cs).
13409
13410 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
13411
13412         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
13413
13414 2007-10-05  Alp Toker  <alp@atoker.com>
13415
13416         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
13417         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
13418         #315863.
13419
13420 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13421
13422         * verify.c (verify_type_compatibility_full): verification of
13423         compatibility improved, validates correctly non-strict checks between
13424         native int and I4 types different than (unsigned)int32.
13425
13426         * verify.c (do_store_indirect): added, do all verification of
13427         ldind.X opcodes. 
13428
13429         * verify.c (get_load_indirect_mono_type): renamed to
13430         get_indirect_op_mono_type, as it now returns the MonoType for 
13431         ldind.X and stind.X opcodes.
13432
13433 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13434
13435         * reflection.c: Fix the encoding of generic type definition for
13436         TypeBuilders.
13437
13438         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
13439         mono_image_typedef_or_ref but allows to specify if typespec lookups should
13440         be made. Typespec check is done prior to typeref cache lookup.
13441
13442         * reflection.c (mono_image_typedef_or_ref): now just delegate to
13443         mono_image_typedef_or_ref_full.
13444
13445         * reflection.c (encode_generic_class): encode the generic class
13446         directly instead of calling encode_type.
13447
13448         * reflection.c (encode_type): encode the generic type definition
13449         MonoClass as a generic instantiation.
13450
13451         * reflection.c (create_typespec): cache typespec tokens in
13452         the assembly->typespec cache. Don't create typespec for a generic
13453         instance MonoClass. Create typespec for the generic type defintion.
13454
13455         * reflection.c (create_generic_typespec): encode the generic
13456         class directly instead of calling encode_type.
13457
13458         * reflection.c (mono_image_create_token): encode the generic
13459         type definition not using a typespec for MonoType instances.
13460
13461
13462 2007-10-04  Raja R Harinath  <rharinath@novell.com>
13463
13464         Fix #328812
13465         * class.c (mono_image_init_name_cache): Don't return nested
13466         'protected internal' classes.
13467         (mono_class_from_name_case): Likewise.
13468
13469 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
13470
13471         * icall-def.h, icall.c : get_bundled_machine_config() is now the
13472           common function used by both DefaultConfig in System.dll and
13473           InternalConfigurationHost in System.Configuration.dll.
13474
13475 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13476
13477         * class.c: automatically add to vectors only a few essential explicit
13478         generic interfaces. The rest of the interfaces that arrays should
13479         provide are currently implicitly added (but still not lazily, see the
13480         design in the discussion of bug#325495 for the details of what is
13481         needed for that). Additionally, implicit interfaces are assigned the
13482         same vtable slot as the explicit interfaces (as they are compatible):
13483         this enables huge memory savings since we don't need to instantiate
13484         as many memthods and as large vtables anymore. Also, Since
13485         GetEnumerator<T> returns an instance of a type that is required to
13486         support a similarly large set of interfaces as arrays, we add
13487         implicit interfaces and interface offset sharing support to those
13488         types, too. This change adds all the required interfaces so that
13489         the anonarray.cs test case in the bug report works (we don't add
13490         all the interfaces to arrays of arrays 3-level deep and more because
13491         of the memory requirements explained in the bug and since they are much
13492         less common: the lazy-loading support will enabled them to work, too).
13493
13494 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13495
13496         * verify.c (merge_stacks): major clean up, all type compatibility
13497         checks are done by verify_type_compatibility. This fix my earlier lack
13498         of understanding of the CLR type system and merge_stacks no longer looks
13499         scary.
13500
13501         * verify.c: fixed some bad spelling.
13502
13503 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13504
13505         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
13506         a given stack slock.
13507         
13508         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
13509         verify_type_compatibility_full. This removed a near indentical function and fixed
13510         handling of Int32 and IntPtr across all opcodes.
13511
13512 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
13513
13514         * class.c: only vectors have the additional generic interfaces.
13515
13516 2007-10-01  Jonathan Chambers <joncham@gmail.com>
13517
13518         * mono-config.c: Use g_strcasecmp instead of
13519         strcasecmp like everywhere else to fix
13520         compilation with MSVC.
13521         
13522         Code is contributed under MIT/X11 license.
13523
13524 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13525
13526         * object.c, object-internals.h: refactored the IMT code to enable
13527         building a single slot at a time and lazily creating the IMT trampolines
13528         and thunks.
13529
13530 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
13531
13532         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
13533
13534         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
13535         Fixes #328501.
13536         
13537 2007-09-29  Raja R Harinath  <harinath@gmail.com>
13538
13539         * loader.c (method_from_methodspec): Rearrange to avoid
13540         un-necessary exposition.  Don't assert out if the method's
13541         declaring type is a generic type definition.
13542
13543 2007-09-28  Martin Baulig  <martin@ximian.com>
13544
13545         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
13546
13547 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
13548
13549         * class-internals.h: optimize field layout of MonoClass to
13550         requires less cachelines at runtime and save a few bytes on 64 bit
13551         systems.
13552
13553 2007-09-28  Jb Evain  <jbevain@novell.com>
13554
13555         * reflection.c: when encoding type names in custom attributes,
13556         if the type is a closed generic type, its generic arguments
13557         have to be serialized as AssemblyQualifiedName, so that when
13558         they are deserialized, it's possible to re-create them properly.
13559         Fixes #329450.
13560
13561
13562 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
13563
13564         * object.c, class-internals.h: added delegate-creation counter.
13565
13566 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
13567
13568         * class.c: cleanup of the code that synthetizes interfaces for
13569         arrays in 2.0: saves quit a bit of corlib mempool memory.
13570         Code to fix bug #325495 ifdeffed out for now until the issues
13571         with memory usage and O(n^2) behaviour are fixed.
13572
13573 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13574
13575         * marshal.c: when possible, do not duplicate the name of the methods
13576         in the method builder and in the generated MonoMethod.
13577
13578 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13579         * verify.c: added support for type checking ldind_* opcodes.
13580
13581 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13582
13583         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
13584         which is used to distinguish the fully open instantiation of a TypeBuilder
13585         with the rest. This temporary hack is required to restore the property that
13586         the fully open instantiation is the same type of the generic type definition.
13587
13588         * class-internals.h (mono_generic_class_is_generic_type_definition):
13589         new function as part of the internal API.
13590
13591         * class.c (inflate_generic_type): return NULL when the generic inst is
13592         fully open. The fully open generic type is now the same as the generic type
13593         definition for non TypeBuilder types.
13594
13595         * class.c (mono_generic_class_get_class): removed assert since it is
13596         no longer valid, gklass->cached_class can point to the generic type definition.
13597
13598         * class.c (mono_generic_class_is_generic_type_definition): new.
13599
13600         * metadata.c (mono_generic_class_hash): added is_tb_open field
13601         to the hash calculation.
13602
13603         * metadata.c (free_generic_class): if the generic class is associated
13604         with the generic type definition, its field will come from the mempool and
13605         must not be freed.
13606
13607         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
13608         new, this function identifies the corner case of a TypeBuilder fully open
13609         instantiation.
13610
13611         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
13612         for lookup. Set gclass->cached_class to be the container class in case of
13613         the fully open instantiation of non TypeBuilder types.
13614
13615         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
13616         to compare generic classes.
13617
13618         * reflection.c (method_encode_methodspec): remove assert that
13619         no longer is valid.
13620
13621         * reflection.c (mono_reflection_generic_class_initialize): add
13622         an aditional assert to ensure the proper type is used.
13623
13624 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
13625
13626         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
13627         to enjoy it.
13628
13629 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13630
13631         * verify.c (push_arg): Fixed support for ldarga
13632         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
13633         MonoType used as first arg in case of instance calls.
13634
13635 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13636
13637         * verify.c: Support for verifying VAR and MVAR types, 
13638
13639 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
13640
13641         * icall.c (ves_icall_get_property_info): Set the reflected type of the
13642         accessors correctly.
13643
13644 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
13645
13646         * threads.c: support OSX and other systems in
13647         mono_thread_get_stack_bounds (bug #328026).
13648
13649 2007-09-25  Martin Baulig  <martin@ximian.com>
13650
13651         * mono-debug.h
13652         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
13653
13654 2007-09-24  Martin Baulig  <martin@ximian.com>
13655
13656         * mono-debug.h
13657         (MonoDebugClassEntry): Moved the definition of this struct into
13658         mono-debug.c to make it private.
13659
13660         * mono-debug.c
13661         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
13662         type table per symbol file, we don't need to store the symfile id
13663         any longer.
13664
13665 2007-09-24  Martin Baulig  <martin@ximian.com>
13666
13667         Create one type table per symbol file, since a `MonoClass *' gets
13668         invalid when its image is unloaded.
13669
13670         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
13671         (MonoDebugHandle): Added `type_table'.
13672
13673 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13674
13675         * mempool.c, mempool.h: added mono_mempool_new_size () API
13676         to be able to specify a smaller initial size for the pool.
13677         Adjusted the code to slowly increase pool size before using
13678         the previous default size.
13679         * image.c: use a small initial size for image mempools.
13680
13681 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
13682
13683         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
13684         Fixes ##320990.
13685
13686         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
13687         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
13688
13689 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
13690
13691         * metadata.c (mono_type_create_from_typespec): Remove an invalid
13692         free. Fixes #327438.
13693
13694 2007-09-21  Raja R Harinath  <harinath@gmail.com>
13695
13696         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
13697         generic instantiations, etc.
13698         <MONO_TYPE_ARRAY>: Likewise.
13699
13700 2007-09-21  Martin Baulig  <martin@ximian.com>
13701
13702         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
13703         these structs were never defined.
13704         (MonoDebugHandle): Removed the `_priv' field, it was never used.
13705
13706 2007-09-21  Martin Baulig  <martin@ximian.com>
13707
13708         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
13709
13710 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
13711
13712         * image.c: removed the guid hash tables: we can get the same info
13713         without the additional memory usage hit (partially fixes also bug #327052).
13714
13715 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13716
13717         * profiler.h, profiler-private.h, profiler.c: add a new profiler
13718         event to handle unloading methods. After the event is called, the
13719         corresponding MonoMethod* must be considered invalid.
13720         * loader.c (mono_free_method): call the new mono_profiler_method_free
13721         event.
13722
13723 2007-09-20  Mark Probst  <mark.probst@gmail.com>
13724
13725         * domain-internals.h: New flag in MonoJitInfo which marks shared
13726         generic methods.  New hash table (shared_generics_hash) in
13727         MonoDomain to keep track of shared generic methods.  Prototypes
13728         for functions to register and lookup shared generic methods.
13729
13730         * domain.c: Support for registering and looking up shared generic
13731         methods via a hash table (shared_generics_hash) in MonoDomain.
13732
13733         * class-internals.h: New exception to signal failure of shared
13734         compilation of a generic method.  New counters for generics
13735         sharing in MonoStats.
13736
13737 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
13738
13739         * image.c, metadata-internals.h: don't keep a file descriptor open
13740         for loaded assemblies (bug#325988).
13741
13742 2007-09-19  Raja R Harinath  <rharinath@novell.com>
13743
13744         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
13745         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
13746         use the corresponding datatypes.
13747         (type_in_image): Update to changes.
13748         (CleanForImageUserData): Simplify.
13749         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
13750         Avoid quadratic behaviour in handling the "stolen" list by
13751         separating the filter predicate out, and by prepending the stolen
13752         items rather than appending them.
13753         (steal_ginst_in_image): Likewise.
13754         (mono_metadata_clean_for_image): Update to changes.
13755
13756 2007-09-19  Martin Baulig  <martin@ximian.com>
13757
13758         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
13759
13760 2007-09-19  Martin Baulig  <martin@ximian.com>
13761
13762         * mono-debug.c (mono_debug_cleanup): Don't call
13763         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
13764
13765 2007-09-19  Raja R Harinath  <harinath@gmail.com>
13766
13767         Fix crash on 'make run-test' in mcs/errors
13768         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
13769         Avoid more potential allocations in mono_class_from_mono_type.
13770         (ginst_in_image): Update to changes.
13771         (gclass_in_image): Rearrange slightly.
13772
13773 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
13774
13775         * class.c (mono_class_init): Move the code that sets up class->methods to 
13776         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
13777
13778         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
13779         canonical instance of an inflated generic signature.
13780         (mono_type_create_from_typespec): Remove an invalid free.
13781
13782         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
13783
13784 2007-09-18  Marek Habersack  <mhabersack@novell.com>
13785
13786         * domain-internals.h: added a declaration of the
13787         mono_assembly_load_full_nosearch internal function.
13788
13789         * assembly.c (mono_assembly_load_with_partial_name): use
13790         mono_try_assembly_resolve return value properly.
13791         (mono_assembly_load_full_nosearch): copied the function body from
13792         mono_assembly_load_full, without the code to invoke assembly
13793         search hooks.
13794         (mono_assembly_load_full): calls the above new function and if the
13795         assembly is not resolved, invokes the search hooks.
13796
13797         * appdomain.c (mono_runtime_init): restore the global postload
13798         assembly search handlers.
13799
13800 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
13801
13802         * class.c (mono_class_init): Make sure class->methods and class->properties
13803         are never NULL in the generics case.
13804
13805         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
13806
13807 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
13808
13809         * metadata.c (free_generic_class): Disable some code to fix the build.
13810
13811         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
13812
13813         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
13814         from the image mempool.
13815
13816         * metadata.c (free_generic_class): Free more data from the inflated class.
13817
13818         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
13819
13820         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
13821         mempool.
13822         (mono_type_create_from_typespec): Ditto.
13823
13824         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
13825         MonoImage to the caller.
13826         (mono_init_internal): Save the opened image in a global variable.
13827         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
13828
13829         * reflection.c (resolve_object): Fix a leak.
13830
13831         * metadata.c: Fix the freeing of data in the generics caches.
13832         
13833         * metadata.c (free_generic_inst): Comment this out to fix the build.
13834         (free_generic_class): Ditto.
13835
13836         * metadata.c: Free cached generic methods, instantinations and classes when
13837         they are removed from the caches.
13838         (mono_metadata_free_type): Free the type itself.
13839
13840         * class.c: Free the result of mono_class_inflate_generic_type () in a few
13841         places.
13842
13843 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
13844
13845         * boehm-gc.c: restrict managed allocs to __thread supporting
13846         architectures.
13847
13848 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
13849
13850         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
13851         (mono_generic_class_get_class): Fix a leak.
13852
13853         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
13854         mono_metadata_free_type ().
13855         (mono_metadata_inflate_generic_inst): Fix a leak.
13856
13857 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
13858
13859         * mono-debug.c (free_header_data): Fix a leak missed earlier.
13860
13861         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
13862         mempool.
13863
13864         * mono-debug.c (mono_debug_close_image): Fix call to 
13865         g_hash_table_remove ().
13866
13867 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
13868
13869         * icall-def.h: redirect all the string ctor to the managed
13870         CreateString () methods.
13871         * string-icalls.c, string-icalls.h: removed dead code for string
13872         ctors and icalls.
13873
13874 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
13875
13876         * mono-debug.c: Fix memory leaks.
13877
13878 2007-09-14  Jonathan Chambers <joncham@gmail.com>
13879
13880         * threads-types.h: Implement mono_hazard_pointer_set and 
13881         mono_hazard_pointer_clear macros using do/while(0) to fix
13882         compilation with MSVC.
13883         
13884         Code is contributed under MIT/X11 license.
13885
13886 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
13887
13888         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
13889         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
13890
13891 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13892
13893         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
13894         icalls.
13895
13896 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13897
13898         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
13899         managed-code allocated as well.
13900
13901 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
13902
13903         * class.c (mono_class_is_assignable_from): Add support for generic variance.
13904
13905 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
13906
13907         * boehm-gc.c: fixed the build after the AOT changes.
13908
13909 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
13910
13911         * wrapper-types.h: Add an ALLOC wrapper type.
13912
13913         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
13914         reference managed allocator methods.
13915
13916 2007-09-12  Marek Safar  <marek.safar@gmail.com>
13917
13918         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
13919         of Type array and not MonoType, a fix suggested by Hari.
13920         
13921 2007-09-12  Jonathan Chambers <joncham@gmail.com>
13922
13923         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
13924         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
13925         
13926         Code is contributed under MIT/X11 license.
13927
13928 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13929
13930         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
13931
13932 2007-09-12  Marek Habersack  <mhabersack@novell.com>
13933
13934         * image.c (do_mono_image_open): if assembly file fails to open and
13935         MONO_IOMAP is in effect, try to find the path in a
13936         case-insensitive way.
13937
13938         * appdomain.c (mono_runtime_init): do not install postload hooks -
13939         tests show that MS.NET doesn't use anything of that sort to
13940         trigger the AppDomain.AssemblyResolve event.
13941         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
13942         made non-static.
13943         (mono_runtime_init): init portability helpers here.
13944
13945         * assembly.c (mono_assembly_load_with_partial_name): if other   
13946         attempts fail, trigger the AppDomain.AssemblyResolve event handler
13947         to resolve the assembly.
13948
13949         * domain-internals.h: added mono_try_assembly_resolve and marked
13950         it as internal.
13951
13952 2007-09-11  Jb Evain  <jbevain@novell.com>
13953
13954         * object-internals.h (MonoReflectionDynamicMethod): add
13955         a `MonoReflectionType *owner` field. The owner is used
13956         * reflection.c:
13957         (mono_reflection_create_dynamic_method): use the owner of the dynamic
13958         method as the class declaring the dynamic method.
13959         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
13960         dynamic method to the declaring type of the methodbuilder.
13961
13962 2007-09-11  Mark Probst  <mark.probst@gmail.com>
13963
13964         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
13965         rules for calling methods via reflection.
13966
13967 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
13968
13969         * reflection.c (resolve_object): Add support for MonoGenericClass. 
13970         Inflate MonoType's.
13971
13972 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
13973
13974         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
13975         provide a managed method that does fast allocations without needing
13976         a managed->unmanaged transition. Boehm GC implementation currently
13977         enabled for ptrfree objects on sane architectures.
13978
13979 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
13980
13981         * marshal.c, marshal.h: exported a couple of useful functions and
13982         added mono_mb_get_label () to easily handle backward branches.
13983
13984 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
13985
13986         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
13987
13988 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13989
13990         * loader.c (find_method): Fixed the regression introduced while
13991         fixing bug #81466.
13992
13993 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
13994
13995         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
13996         well.
13997         
13998         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
13999         icall.c reflection.c: Pass a MonoGenericContext argument to 
14000         mono_lookup_dynamic_token ().
14001
14002         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
14003         #82744.
14004         
14005 2007-09-09  Robert Jordan  <robertj@gmx.net>
14006
14007         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
14008         for generic methods.
14009
14010         * object.c (mono_object_get_virtual_method): Handle generic methods.
14011         Fixes bug #78882.
14012
14013         Code is contributed under MIT/X11 license.
14014
14015 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
14016
14017         * image.c: fix locking in mono_image_load_file_for_image ().
14018
14019 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
14020
14021         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
14022         used only as a cache: added an icall to fill it.
14023
14024 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
14025
14026         * reflection.h: exposed mono_reflection_free_type_info
14027         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
14028         since mono_reflection_bind_generic_parameters makes a copy of it.
14029         * reflection.c (free_type_info): subinfos should be freed.
14030         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
14031         made non static.
14032         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
14033         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
14034         this fixes #82695 and #81726.
14035    
14036
14037 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
14038
14039         * process.h, process.c:  added support for user profile/info in
14040           ProcessStartInfo. For now only Windows works.
14041
14042 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
14043
14044         * metadata.c: consider the generic arguments when comparing
14045         signatures (bug #82614).
14046
14047 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14048
14049         * cil-coff.h, image.c: updated assembly loader to cope with the
14050         PE32+ 64 bit file format.
14051
14052 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14053
14054         * assembly.c, class.c, domain.c, loader.c: remove useless
14055         inclusion of cil-coff.h.
14056
14057 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
14058
14059         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
14060         if interface is marked with CoClassAttribute. 
14061    
14062         Code is contributed under MIT/X11 license.
14063
14064 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14065
14066         * sgen-gc.c: ensure no object from the to space is copied again or finalized
14067         if it's seen twice in major collections.
14068
14069 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
14070
14071         * sgen-gc.c: big objects are not copied to the gray area, but they
14072         need to be considered for scanning, too, if they are brought alive
14073         by an object ready for finalizations or a survived one.
14074
14075 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
14076
14077         * sgen-gc.c: properly account the number of disappearing links when
14078         they are nullified.
14079
14080 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
14081
14082         * sgen-gc.c: share the code to scan the registered roots between the
14083         different types of collections.
14084
14085 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14086
14087         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
14088
14089 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14090
14091         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
14092         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
14093
14094 2007-08-28  Mark Probst  <mark.probst@gmail.com>
14095
14096         * security-manager.c (mono_security_manager_get_methods):
14097         LinkDemandSecurityException now has 2 arguments instead of 3.
14098
14099 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
14100
14101         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
14102         platforms which need it.
14103
14104 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14105
14106         * sgen-gc.c: unregister thread data structures with a pthread_key_t
14107         dtor.
14108
14109 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
14110
14111         * threads.c: free the thread static data on thread exit.
14112
14113 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
14114
14115         * class.c: walk the hierarchy to find the generic definition for
14116         a class (fixes runtime part of bug #82498).
14117
14118 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14119
14120         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
14121         ...
14122
14123         * image.c (mono_image_close): Here. Hopefully fixes #82510.
14124
14125 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14126
14127         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
14128
14129 2007-08-24  Robert Jordan  <robertj@gmx.net>
14130
14131         * appdomain.c: don't perform the ':'->';' substitution on Win32.
14132
14133 2007-08-24  Jb Evain  <jbevain@novell.com>
14134
14135         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
14136         for byref types.
14137
14138 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14139
14140         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
14141         #82286.
14142
14143 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14144
14145         * assembly.c: Fix a warning.
14146         
14147 2007-08-23  Marek Habersack  <mhabersack@novell.com>
14148
14149         * appdomain.c: parse the <runtime> section looking for the probing
14150         element with the 'privatePath' attribute, which sets additional
14151         directories in which the runtime should look for assemblies.
14152
14153 2007-08-23  Robert Jordan  <robertj@gmx.net>
14154
14155         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
14156         Fixes #82499.
14157
14158 2007-08-23  Martin Baulig  <martin@ximian.com>
14159
14160         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
14161         _mono_debug_init_corlib() and remove it from the header file.
14162
14163 2007-08-23  Martin Baulig  <martin@ximian.com>
14164
14165         * mono-debug-debugger.c
14166         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
14167         don't notify the debugger about it.
14168
14169         * mono-debug-debugger.h
14170         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
14171
14172 2007-08-23  Robert Jordan  <robertj@gmx.net>
14173
14174         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
14175         Code is contributed under MIT/X11 license.
14176
14177 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14178
14179         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
14180
14181 2007-08-22  Martin Baulig  <martin@ximian.com>
14182
14183         * mono-debug.c: Store debugging info on a per-domain basis and
14184         free it on domain unload.  Add support for unloading symbol files.
14185
14186         * mono-debug.h
14187         (MonoDebugList): New typedef.
14188         (MonoSymbolTable):
14189         - add `data_tables and `type_table'.
14190         - replace 'symbol_files' and `num_symbol_files' with a
14191           `MonoDebugList *'.
14192         (mono_debug_data_table): Removed.
14193         (mono_debug_list_add): New public function.
14194         (mono_debug_list_remove): New public function.
14195         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
14196         (mono_debug_init_2_memory): Renamed into
14197         mono_debug_open_image_from_memory().
14198         (mono_debug_close_image): New public function.
14199         (mono_debug_domain_create): Likewise.
14200         (mono_debug_domain_unload): Likewise.
14201         (MONO_DEBUGGER_VERSION): Bump to 60.
14202
14203         * mono-debug-debugger.h
14204         (MonoDebuggerEvent):
14205         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
14206         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
14207         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
14208         - rename `THREAD_CREATED' and `THREAD_EXITED' into
14209           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
14210         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
14211           meaning.
14212         (mono_debugger_add_symbol_file): Removed.
14213         (mono_debugger_add_type): Removed.
14214         (mono_debugger_lookup_type): Removed.
14215         (mono_debugger_lookup_assembly): Removed.
14216
14217         * domain.c
14218         (mono_domain_create): Call mono_debug_domain_create().
14219         (mono_init_internal): Call mono_debug_init_corlib().
14220
14221         * assembly.c
14222         (mono_assembly_close): Call mono_debug_close_image().
14223
14224 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
14225
14226         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
14227         mmap call.
14228
14229 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14230
14231         * sgen-gc.c: ensure section->pin_queue_end is initialized
14232         correctly when non pinning objects in the section have been found.
14233
14234 2007-08-22  Marek Habersack  <mhabersack@novell.com>
14235
14236         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
14237         containing a list of directories separated by ':'. MSDN docs say
14238         the directories should be separated with ';'. Part of a bugfix for
14239         bug #81446
14240
14241 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
14242
14243         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
14244         it should MonoType and not MonoClass.
14245
14246 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
14247
14248         * culture-info-table.h : regenerated.
14249
14250 2007-08-20  William Holmes  <billholmes54@gmail.com>
14251
14252         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
14253          to call ReplaceFile Kernel32 on windows or in io-layer.
14254         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
14255         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
14256          as an internal call.
14257
14258         Code is contributed under MIT/X11 license.
14259
14260 2007-08-20  Jb Evain  <jbevain@novell.com>
14261
14262         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
14263         and MONO_EXCEPTION_FIELD_ACCESS.
14264
14265         * debug-helpers.[c|h]: new mono_field_full_name function.
14266
14267 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14268
14269         * class.c: Removed class_security_level() and moved it to
14270         security-core-clr.c.
14271
14272         * security-core-clr.c, security-core-clr.h: class_security_level()
14273         is now public and renamed to mono_security_core_clr_class_level().
14274         It also looks for security attributes in the classes a class is
14275         nested in.
14276
14277 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14278
14279         * security-core-clr.c, security-core-clr.h: CoreCLR security
14280         utility functions.
14281
14282         * Makefile.am: Added security-core-clr.[ch].
14283
14284         * security-manager.c, security-manager.h: Functions and enum for
14285         setting and getting the security mode.
14286
14287         * class.c: CoreCLR security checks.
14288
14289 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
14290
14291         * icall-def.h, process.c, process.h: implemented icall to get
14292         user/system processor times.
14293
14294 2007-08-17  Mark Probst  <mark.probst@gmail.com>
14295
14296         * domain.c, threads.c, class-internals.h, domain-internals.h: New
14297         reader-lock-free jit_info_table.
14298
14299 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
14300
14301         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
14302
14303         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
14304
14305         * object-internals.h (MonoException): Add missing _data member.
14306
14307 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14308
14309         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
14310         checking that only methods with matching qname or fqname are picked
14311         from implemented interfaces.
14312
14313 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14314
14315         * verify.c (do_newarr):added, do type verification of
14316         newarr ops, push the right value on the eval stack.
14317         * verify.c (mono_method_verify): use do_newarr
14318
14319
14320 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14321
14322         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
14323         factored the common code into get_boxable_mono_type, which
14324         is now using mono_type_get_full, this fixed byref related tests.
14325
14326 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14327
14328         * class.c: added mono_type_get_full, this function has the same
14329         behavior of mono_class_get_full but the returned MonoType has
14330         all metadata of the associated token in case of a typespec token.
14331         * class.c: added mono_type_retrieve_from_typespec, used by 
14332         mono_type_get_full to retrieve the token type.
14333         * class.c (mono_class_create_from_typespec): changed to use
14334         mono_type_retrieve_from_typespec.
14335         * class.c (mono_ldtoken): changed to use mono_type_get_full
14336         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
14337         * class-internals.h: exported mono_type_get_full for internal use.
14338
14339 2007-08-16  Jb Evain  <jbevain@novell.com>
14340
14341         * domain.c (supported_runtimes): add entry for
14342         the 'moonlight' runtime version.
14343
14344 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14345
14346         * verify.c (mono_method_verify): small typo sliped in.  
14347
14348 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14349
14350         * verify.c (do_unbox_value): added, do type verification of
14351         unboxing ops
14352         * verify.c (mono_method_verify): use do_unbox_value
14353
14354
14355 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14356
14357         * verify.c (dump_stack_value): fixed typo, was printing string
14358         instead of object on stack.
14359         * verify.c (do_box_value): moved the byref check up as it leads
14360         to invalid code and should be done earlier.
14361         * verify.c: improved error messages for and ldobj
14362
14363 2007-08-15  William Holmes  <billholmes54@gmail.com>
14364
14365         * marshal.c (emit_marshal_custom): Omit the call to 
14366           marshal_native_to_managed when calling native to managed 
14367           and the argument is specified as an out argument.
14368
14369         Code is contributed under MIT/X11 license.
14370
14371 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14372
14373         * verify.c: fixed the type checks for generics, function pointers and vectors.
14374         Added type verification for ldobj and ldtoken. The verifier
14375         would segfault if header or signature of a method contained references
14376         to non-existant types.
14377
14378 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14379
14380         * marshal.c (cominterop_get_ccw): Patch from
14381         Bill Holmes to no walk up interface hierarchy. 
14382         All parent methods should be present in the interface for COM.
14383    
14384         Code is contributed under MIT/X11 license.
14385
14386 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14387
14388         * marshal.c (emit_marshal_com_interface): Patch from
14389         Bill Holmes to handle COM Interfaces as return values
14390         for native->managed calls.
14391    
14392         Code is contributed under MIT/X11 license.
14393
14394 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
14395
14396         * marshal.c (cominterop_get_idispatch_for_object): Implement
14397         for runtime callable wrappers.
14398    
14399         Code is contributed under MIT/X11 license.
14400
14401 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
14402
14403         * pedump.c (main): changed from mono_init to mono_init_from_assembly
14404         so 2.0 types are accessible
14405
14406
14407 2007-08-13  Miguel de Icaza  <miguel@novell.com>
14408
14409         * domain.c (mono_init_internal): Call mono_assembly_load_friends
14410         once we load mscorlib.   Due to the order in which we initialize,
14411         the mono_assembly_load_full routine that loads mscorlib did not
14412         load friends.   We now load it once we load the
14413         mono_defaults.internals_visible_class class. 
14414
14415         * assembly.c: Expose the mono_load_friend_assemblies method.
14416
14417 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
14418
14419         * verify.c: improved the handling of boxing, better
14420         type checking for unary ops and conversion. Fix bug
14421         regarding managed pointer compatibility checking
14422
14423 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
14424
14425         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
14426
14427         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
14428
14429 2007-08-09  Raja R Harinath  <rharinath@novell.com>
14430
14431         * reflection.c (dup_type): Remove.
14432         * class.c (dup_type): Remove.
14433         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
14434         instead of the dodgy 'dup_type'.
14435         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
14436         handle the case where 'dup_type' needed the second argument.
14437
14438 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
14439
14440         * domain.c: Fix a warning.
14441
14442 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14443
14444         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
14445         checking that methods with the same fqname are not overridden
14446         with a method from an ancestor.
14447
14448 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
14449
14450         * threads.c (free_thread_static_data_helper): Avoid a crash if
14451         thread->static_data is not yet set.
14452
14453 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
14454
14455         * marshal.c: Use correct image when emitting
14456         native wrapper for COM calls.
14457    
14458         Code is contributed under MIT/X11 license.
14459
14460 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
14461
14462         * icall-def.h, security.c, security.h :
14463           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
14464
14465 2007-08-07  Martin Baulig  <martin@ximian.com>
14466
14467         * mono-debug-debugger.h
14468         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
14469
14470         * domain.c (mono_domain_free): Call
14471         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
14472
14473 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
14474
14475         * verify.c (check_underflow, check_overflow): error message now returns IL offset
14476         * verify.c (in_same_block): code should test if either offset is inside the clauses
14477         * verify.c (mono_method_verify): push the exception into the eval stack of exception
14478         and filter blocks
14479
14480 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14481
14482         * image.c (mono_image_close): Fix a leak.
14483
14484         * object.c (mono_runtime_invoke_array): Avoid using alloca.
14485
14486         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
14487
14488 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
14489
14490         * domain.c, threads.c, threads-types.h: fix memory retention issue
14491         with thread static variables not being cleared on domain unload.
14492         Reuse thread static slots after domain unload.
14493
14494 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14495
14496         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
14497         nullable type.
14498
14499         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
14500         now done in mono_runtime_invoke_array.
14501
14502         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
14503         receiver is a nullable type.
14504
14505         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
14506         generic parameter.
14507
14508 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
14509
14510         * marshal.c: Implement COM Objects as return type for 
14511         managed->unmanaged calls. Added Release calls for COM Object
14512         out/return values in managed->unmanaged calls.
14513
14514         Code is contributed under MIT/X11 license.
14515
14516 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
14517
14518         * threads.h, threads-type.h: move the hazard pointer declarations
14519         to the private header.
14520
14521 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
14522
14523         * file-io.c, appdomain.c: memory leak fixes.
14524
14525 2007-08-02  Dick Porter  <dick@ximian.com>
14526
14527         * socket-io.c
14528         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
14529         SO_REUSEADDR setting into io-layer/sockets.c.
14530
14531 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
14532
14533         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
14534         from Object when called on a generic parameter. Fixes #82211.
14535
14536 2007-08-01  Dick Porter  <dick@ximian.com>
14537
14538         * file-io.c (convert_share): Test FileShare values bit-by-bit.
14539         Fixes bug 79250 yet again.
14540
14541 2007-07-30  Martin Baulig  <martin@ximian.com>
14542
14543         Merged the `debugger-dublin' branch.
14544
14545         * mono-debug.h
14546         (MonoDebugDataTable): New typedef.
14547         (MonoDebugMethodAddressList): New typedef.
14548         (MonoDebugWrapperData): Removed.
14549         (MonoDebugSymbolTable): Removed `current_data_table',
14550         `current_data_table_size', `current_data_table_offset'.
14551         (MonoDebugDataItemType): Moved into mono-debug.c.
14552         (MonoDebugMethodJitInfo): Remove `address'.
14553         (mono_debug_data_table): New global variable.
14554         (mono_debug_lookup_method_addresses): New public function.
14555         (mono_debug_find_method): Take a `MonoMethod *', not a
14556         `MonoDebugMethodInfo *'.
14557
14558         * mono-debug.c: Drop support for the old symbol tables.
14559
14560 2007-06-28  Martin Baulig  <martin@ximian.com>
14561
14562         * mono-debug.c (mono_debug_debugger_version): New public variable.
14563
14564 2007-07-31  William Holmes  <billholmes54@gmail.com>
14565
14566         * metadata.c Changed mono_type_create_from_typespec to not insert
14567           the type into the hash map until after
14568           do_mono_metadata_parse_type has completed.
14569         Fixes Bug #82194
14570         Code is contributed under MIT/X11 license.
14571
14572 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
14573
14574         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
14575         generic parameter. Fixes #82211.
14576
14577 2007-07-27  Jb Evain  <jbevain@novell.com>
14578
14579         * pedump.c (dump_metadata, dump_metadata_header): dump
14580         versions contained in the metadata header.
14581
14582 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
14583
14584         * threads.c: register small_id_table with the GC.
14585
14586 2007-07-27  Mark Probst  <mark.probst@gmail.com>
14587
14588         * threads.c, threads.h, class-internals.h, object-internals.h:
14589         Hazard pointers, to be used by lock-free parallel algorithms.
14590
14591 2007-07-26  Dick Porter  <dick@ximian.com>
14592
14593         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
14594         routine on non-windows platforms, as I've not managed to think of
14595         a non-kludgy way of doing this.  Finishes off bug 78739.
14596
14597 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
14598
14599         * object.c: properly setup interface_bitmap in proxy vtables.
14600
14601 2007-07-25  Marek Habersack  <mhabersack@novell.com>
14602
14603         * appdomain.c (get_shadow_assembly_location): do not use TickCount
14604         to create unique shadow copy target directories, use the domain's
14605         serial number instead. Each domain gets a unique target directory
14606         that way.
14607
14608         * domain.c (mono_domain_create): added code to increment domain
14609         shadow copy serial number and cache the value in the current
14610         domain structure.
14611
14612         * domain-internals.h (struct _MonoDomain): added a new field -
14613         shadow_serial to hold the serial number used in generation of
14614         shadow-copy directories. This is to make sure that the directory
14615         name is unique for each and every domain created. We avoid a race
14616         condition with overriding assemblies already in use by other app
14617         domains.
14618
14619 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
14620
14621         * class.c (mono_bounded_array_class_get): fixed memory leak when 
14622         binding generic parameters.
14623
14624 2007-07-24  Raja R Harinath  <rharinath@novell.com>
14625
14626         * metadata.c (do_mono_metadata_parse_generic_class): Use
14627         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
14628         error.
14629
14630 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
14631
14632         * loader.c, class-internals.h, reflection.c: removed the per-method
14633         generics hashtable: we use the global one through the call of
14634         mono_class_inflate_generic_method ().
14635
14636 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14637
14638         * class.c, metadata.c, class-internals.h: introduce yet another
14639         generics global cache for inflated methods (fixes 98% of the perf
14640         issue in bug #81806).
14641
14642 2007-07-23  Raja R Harinath  <rharinath@novell.com>
14643
14644         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
14645         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
14646         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
14647         return a MonoGenericInst containing (a copy) of those types.
14648         (mono_metadata_inflate_generic_inst): Update to changes.
14649         (mono_metadata_parse_generic_inst): Likewise.
14650         (mono_get_shared_generic_inst): Likewise.
14651         * reflection.c (mono_class_bind_generic_parameters): Likewise.
14652         (mono_reflection_bind_generic_method_parameters): Likewise.
14653         * metadata-internals.h: Likewise.
14654         * icall.c (free_generic_context): Kill.
14655         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
14656
14657         * reflection.c (reflection_methodbuilder_to_mono_method): Use
14658         mono_metadata_type_dup.
14659         * marshal.c (mono_mb_create_method): Likewise.
14660
14661         * metadata.c (mono_metadata_type_dup): Rename from
14662         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
14663         MonoImage.  Handle a few more cases, esp. when no mempool is given.
14664         * marshal.c, metadata-internals.h: Update to changes.
14665
14666 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14667
14668         * class.c: fixed a small leak for array classes and removed warning.
14669
14670 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
14671
14672         * loader.c (mono_method_get_param_token): Make this work on generic methods.
14673         Return 0x8000000 for return parameters. Fixes #82161.
14674
14675 2007-07-21  Marek Habersack  <grendello@gmail.com>
14676
14677         * appdomain.c (get_shadow_assembly_location): append the current
14678         ticks value to the path. Avoids overwriting the same assemblies by
14679         several threads at the same time.
14680
14681 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14682         and Raja R Harinath  <rharinath@novell.com>
14683
14684         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
14685         Simplify slightly.
14686         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
14687         property for testing if a method is a generic method definition.
14688
14689 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14690
14691         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
14692
14693 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14694
14695         * verify.c: used function from private branch, reverted to the one in class.h 
14696
14697 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14698
14699         * verify.c: a typo slipped in and the code wont compile
14700
14701 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14702
14703         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
14704         disabled box instruction as it is doing the wrong thing
14705         improved stack dump messages, now it is easier to debug type related issues
14706
14707
14708 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
14709
14710         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
14711
14712 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14713
14714         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
14715         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
14716         grouped with class and valuetype. This change will simply 
14717         the code as it should be handled just like unmanaged pointers.
14718
14719 2007-07-19  Mark Probst  <mark.probst@gmail.com>
14720
14721         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
14722
14723 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14724
14725         * verify.c: several stack merge issues fixed, reference comparisons now
14726         check the type size. strict type check now works correctly.
14727         added more uses of IS_MANAGED_POINTER macro.
14728         fixed issues pointed by running the test suite against .net.
14729         
14730
14731 2007-07-19  Mark Probst  <mark.probst@gmail.com>
14732
14733         * class.c, loader.c, class-internals.h: Removed the
14734         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
14735         defines.
14736
14737         * icall.c: Better error checking in some internal reflection
14738         methods.
14739
14740 2007-07-18  William Holmes  <billholmes54@gmail.com>
14741
14742         * filewatcher.c : removed unused variable 'filename' in 
14743           ves_icall_System_IO_FSW_SupportsFSW
14744
14745 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
14746
14747         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
14748         obsolete, removed.
14749
14750 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
14751
14752         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
14753         
14754         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
14755
14756 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
14757
14758         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
14759         Implement generics support.
14760         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
14761
14762         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
14763         type_args and method_args arguments.
14764         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
14765         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
14766         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
14767
14768 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
14769
14770         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
14771           It adds a rootimage parameter to mono_reflection_get_type_internal,
14772           adds new function mono_reflection_get_type_with_rootimage and use
14773           the rootimage to resolve the types instead of the current image
14774
14775 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
14776
14777         * culture-info-table.h: Forgot to update after r78304.
14778
14779 2007-07-13  Raja R Harinath  <rharinath@novell.com>
14780
14781         * class.c (mono_class_is_open_constructed_type)
14782         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
14783
14784 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
14785
14786         * class.c (mono_bounded_array_class_get):  method fails if used with
14787         an incomplete TypeBuilder enum (no basetype field), fixed it by 
14788         avoiding calculating the size for such array as it cannot be instantiated.
14789         Fix bug #82015
14790
14791 2007-07-12  Raja R Harinath  <rharinath@novell.com>
14792
14793         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
14794         field.
14795         * metadata.c, reflection.c: Update to changes.
14796
14797 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
14798
14799         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
14800         mono_class_is_valid_enum, they are used to valide a enum when loading.
14801         * reflection.c: used new functions to throw TypeLoadException when and
14802         invalid enum is build with TypeBuilder. Fixes #82018
14803   
14804 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14805
14806         * object.c: forgot commit of mono_class_setup_methods () to access
14807         iface->methods.
14808         * object-internals.h: added a few more handy fields to
14809         MonoIMTCheckItem.
14810
14811 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
14812
14813         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
14814         iface->methods.
14815
14816 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
14817
14818         * class-internals.h, object-internals.h, object.c: IMT-based
14819         interface invocation core from Massimiliano Mantione
14820         (massi@ximian.com) with a reworked arch-specific interface,
14821         bsearch implementation and a few bugfixes and memory savings by me.
14822
14823 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
14824
14825         * class.c (mono_class_create_from_typedef): mono would segfault if 
14826         an enum did not have a __value field. It now throws a TypeLoadException
14827         for such cases. Fix bug #82022
14828
14829 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
14830
14831         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
14832
14833 2007-07-09  Mark Probst  <mark.probst@gmail.com>
14834
14835         * class.c (mono_class_init): If a class is already inited but has
14836         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
14837
14838 2007-07-09  Mark Probst  <mark.probst@gmail.com>
14839
14840         * class.c: Properly handle the case of an unimplemented interface
14841         method.  Fixes: 81673.
14842
14843 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
14844
14845         * class-internals.h, object.c: cleanup patch from massi: use
14846         MonoVTable->interface_bitmap since the vtable interfaces offset array
14847         is going away.
14848
14849 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
14850
14851         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
14852         GetMDStreamVersion icall instead.
14853
14854 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
14855
14856         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
14857         not use mono_dl_build_path() with a full library name: makes
14858         fallbacks to libgaim and libfam work.
14859
14860 2007-07-06  William Holmes  <billholmes54@gmail.com>
14861
14862         * assembly.c: Added a continue statement in probe_for_partial_name when
14863          parse_assembly_directory_name fails.  Fixes : 82002
14864
14865 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
14866
14867         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
14868         and added a verification  for TYPEDBYREF.
14869         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
14870         make native int interchangeable with int32 and some small cleanup and formating.
14871         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
14872         handle byref of byref.
14873         * verify.c (push_local): handle byref of byref.
14874         * verify.c (do_binop): invalid mix of values is unverifiable
14875         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
14876         added visibility checks
14877         * verify.c (field related method): added visibility checks
14878         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
14879
14880 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
14881
14882         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
14883         string.
14884
14885 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
14886
14887         * profiler.c (mono_profiler_load): Fix an off-by-one error.
14888
14889         * marshal.c (emit_marshal_string): When returning a string from managed code,
14890         allways make a copy even for unicode strings. Fixes #81990.
14891
14892 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
14893
14894         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
14895         of byref generic inst types (bug #81997).
14896
14897 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
14898
14899         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
14900         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
14901
14902 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
14903
14904         * marshal.c (emit_marshal_string): Add support for unicode strings in
14905         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
14906
14907 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
14908
14909         * verify.c: field load/store are now verified, missing only access checks now
14910
14911 2007-06-28  Martin Baulig  <martin@ximian.com>
14912
14913         * mono-debug.c (mono_debug_debugger_version): New public variable.
14914
14915 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
14916
14917         * locales.c: When constructing DateTimeFormat or NumberFormat for
14918         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
14919         MonoCultureInfo contructed from the current locale is always
14920         read-only and has UseUserOverride set to true. All MonoCultureInfo
14921         instances returned for GetCultures have both IsReadOnly and
14922         UseUserOverride set to true. Fixes part of bug #81930.
14923
14924 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
14925
14926        * icall-def.h: Update System.__ComObject icalls
14927        * marshal.c: Avoid managed transition (and object creation)
14928        when looking up COM interface in RCW.
14929        * marshal.h: Ditto.
14930        
14931        Code is contributed under MIT/X11 license.
14932
14933 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
14934
14935         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
14936         to avoid crashes during assembly unloading.
14937
14938 2007-06-22  Raja R Harinath  <rharinath@novell.com>
14939
14940         Fix MethodInfo.IsGenericMethodDefinition
14941         * reflection.c (mono_reflection_bind_generic_method_parameters):
14942         Rearrange code to ensure we always uses a generic method definition.
14943         * class.c (mono_class_inflate_generic_method_full): Set
14944         'generic_container' field only for generic method definitions.
14945         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
14946         Use presense of 'generic_container' field as indication of being a
14947         generic method definition.
14948
14949 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
14950
14951         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
14952
14953         * object-internals.h: Reflect changes in the layout of the managed Delegate
14954         class.
14955         
14956         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
14957         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
14958         runtime memory used by the dynamic method. Fixes #77146.
14959
14960 2007-06-21  Dick Porter  <dick@ximian.com>
14961
14962         * file-io.h: 
14963         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
14964         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
14965         81767.
14966
14967 2007-06-21  Raja R Harinath  <rharinath@novell.com>
14968
14969         * reflection.c (method_encode_methodspec): Add a tripwire.
14970         * class.c (inflate_generic_type): The fully open generic type is
14971         not the same as the generic type definition.
14972
14973 2007-06-21  Martin Baulig  <martin@ximian.com>
14974
14975         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
14976
14977         * mono-debug-debugger.h
14978         (MonoDebuggerBreakpointInfo): Removed.
14979         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
14980         (mono_debugger_remove_breakpoint): Likewise.
14981         (mono_debugger_breakpoint_callback): Likewise.
14982         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
14983
14984 2007-06-21  Raja R Harinath  <rharinath@novell.com>
14985
14986         * metadata.c (mono_metadata_lookup_generic_class): The fully open
14987         generic type is not the same as the generic type definition.
14988         * class.c (mono_generic_class_get_class): Likewise.
14989
14990 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
14991
14992         * icall.c: The second argument to 
14993         System.Reflection.MethodBase.GetMethodFromHandleInternalType
14994         is a MonoType not a MonoClass.
14995
14996 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
14997
14998         * verify.c: support for function pointers in the verifier
14999
15000 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
15001
15002         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
15003
15004 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
15005
15006         * assembly.c: removed Mono.Data.SqliteClient from the list of
15007         forward-compatible assemblies as it breaks the ABI (bug #81899).
15008
15009 2007-06-19  Raja R Harinath  <rharinath@novell.com>
15010
15011         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
15012         lookup/update with the loader lock.
15013         * reflection.c (mono_class_bind_generic_parameters): No need to
15014         protect mono_metadata_lookup_* with the loader lock.
15015         * class.c (inflate_generic_type): Likewise.
15016         
15017         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
15018         on a generic instantiated type.
15019
15020 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
15021
15022         *verify.c: produce meanfull error messages on verification error
15023         *verify.c: fixed some cases of verification errors reported as validation errors
15024         *pedump.c: fixed the error name array, now it shows validation errors properly
15025         *verify.h: fixed the contant that should be used for verification errors
15026
15027 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
15028
15029         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
15030         for bug #77596, 81858 and 80743 (generics data structures on domain
15031         unload).
15032
15033 2007-06-15  Raja R Harinath  <rharinath@novell.com>
15034
15035         Avoid allocating 'MonoGenericContext' on the heap.
15036         * class-internals (_MonoMethodInflated::context): Make field
15037         inline, not a pointer.
15038         * loader.c (method_from_methodspec): Allocate 'new_context' on the
15039         stack.  Use the context embedded within the inflated method as the
15040         hash key, rather than 'new_context'.
15041         * class.c (inflate_generic_context): Simplify.  Return a struct
15042         rather than allocating on the heap.
15043         (mono_class_inflate_generic_method_full): Update to changes.  Now,
15044         doesn't salt away a copy of the context -- simplifying the
15045         lifetime rules of a 'MonoGenericContext *'.
15046         (mono_method_get_context): Return pointer to embedded context.
15047         (setup_generic_array_ifaces): Allocate temporary context on stack.
15048         * reflection.c (inflate_mono_method): Likewise.
15049         (mono_reflection_bind_generic_method_parameters): Likewise.
15050         Use the context embedded within the inflated method as the hash key.
15051
15052         Avoid a source of allocation of 'MonoGenericContext'.
15053         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
15054         and 'cached_context' fields into embedded 'MonoGenericContext' field.
15055         * class.c: Update to changes.
15056         (mono_generic_class_get_context): Simplify drastically.  Now just
15057         returns a pointer to the field.
15058         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
15059         argument as a const pointer.
15060         (mono_metadata_generic_context_equal): Likewise.
15061         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
15062         Update to changes.
15063
15064 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
15065
15066         * verify.c improved the handling of brtrue/brfalse, factored out common code
15067
15068 2007-06-14  Raja R Harinath  <rharinath@novell.com>
15069
15070         Kill MonoGenericMethod.
15071         * class-internals.h (MonoGenericContext::method_inst): Rename from
15072         'gmethod' and convert to a MonoGenericInst.
15073         (MonoGenericMethod): Remove.
15074         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
15075         * loader.c (method_from_methodspec): Update to changes.  Use a
15076         MonoGenericContext as the key to the hashtable.
15077         * metadata.c (mono_metadata_generic_context_equal): Rename from 
15078         'mono_metadata_generic_method_equal' and take MonoGenericContext.
15079         (mono_metadata_generic_context_hash): Likewise from
15080         'mono_metadata_generic_method_hash'.  Change hash function.
15081         (mono_metadata_load_generic_params): Update to changes.
15082         (mono_get_shared_generic_method): Remove.
15083         * metadata-internals.h (mono_get_shared_generic_method): Remove.
15084         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
15085         (inflate_generic_context): Likewise.
15086         (mono_class_inflate_generic_method_full): Likewise.
15087         (setup_generic_array_ifaces): Likewise.
15088         (mono_class_create_from_typespec): Likewise.
15089         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
15090         (method_encode_methodspec): Update callsite.
15091         (reflection_methodbuilder_to_mono_method): Update to changes.
15092         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
15093         MonoGenericContext as the key to the hashtable.
15094         (inflate_mono_method): Update to changes.
15095
15096         * class-internals.h (MonoGenericMethod::container): Remove.
15097         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
15098
15099 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
15100
15101         * profiler-private.h, profiler.c, profiler.h: added API to profile
15102         exception events.
15103
15104 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15105
15106         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
15107
15108 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15109
15110         * verify.c: method invocation is now validated, now we verify parameter types on stack.
15111         Fixed overflow and underflow not aborting the verification process.
15112
15113 2007-06-13  Mark Probst  <mark.probst@gmail.com>
15114
15115         * class-internals.h (MonoStats): Added stats entries for dynamic
15116         code allocations.
15117
15118 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
15119
15120         * loader.c (mono_free_method): Free header->locals and header->clauses.
15121
15122         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
15123         dynamic case.
15124
15125         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
15126
15127         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
15128
15129 2007-06-12  Raja R Harinath  <rharinath@novell.com>
15130
15131         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
15132         the tables.
15133
15134 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15135
15136         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
15137
15138 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15139
15140         MonoGenericMethod on a diet
15141         * class-internals.h (_MonoMethodInflated::reflection_info): Move
15142         here ...
15143         (_MonoGenericMethod::reflection_info): ... from here.
15144         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
15145         Update to changes.
15146         * reflection.c (inflate_mono_method): Likewise.
15147         (mono_reflection_bind_generic_method_parameters): Likewise.
15148
15149 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15150
15151         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
15152         *verify.c: factored long ldarg forms to share code with short forms
15153
15154 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15155
15156         *verify.c: fixed code formating factored some duplicate code
15157         into a new function
15158
15159         *verify.h: fixed binary incompatibility introduced earlier
15160
15161         *pedump.c: fixed formating
15162
15163 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15164
15165         Fix assertion when disassembling Mono.C5.dll
15166         * loader.c (method_from_methodspec): Avoid inflating a method
15167         twice with the same context.  If the methodref is inflated, use
15168         the declaring method instead.
15169
15170         * class.c (mono_class_from_generic_parameter): Fix case similar to
15171         bug #81830 handled below, but for method containers.
15172
15173 2007-06-10  Raja R Harinath  <harinath@gmail.com>
15174
15175         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
15176         get_shared_generic_class.  Directly inflate the instance.
15177         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
15178         (inflate_generic_class): Delete.
15179         (get_shared_generic_class): Delete.  Move setting of
15180         'cached_class' and 'cached_context' ...
15181         * metadata.c (mono_metadata_lookup_generic_class): ... here.
15182
15183         * metadata.c (mono_metadata_lookup_generic_class): Change
15184         signature to take the components of a MonoGenericClass rather than
15185         an allocated MonoGenericClass.  Change semantics to be intern-like.
15186         * reflection.c (mono_class_bind_generic_parameters): Update to
15187         changes.  Make locking region tighter.
15188         * class.c (inflate_generic_class): Update to changes.
15189         (get_shared_generic_class): Likewise.
15190         * metadata-internals.h: Likewise.
15191
15192         * reflection.c (mono_class_bind_generic_parameters): Take and
15193         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
15194         (mono_reflection_bind_generic_parameters): Use
15195         'mono_class_bind_generic_parameters' rather than duplicate the code.
15196         * class.c (mono_bounded_array_class_get): Update to changes.
15197         * object-internals.h: Likewise.
15198
15199         * reflection.c (mono_class_bind_generic_parameters): Only support
15200         parameterizing generic type definitions.  Remove support for other
15201         open types.
15202
15203 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
15204
15205         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
15206
15207         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
15208         in the dynamic case.
15209
15210 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
15211
15212         * threads.c: When cleaning up thread, reset the Background bit.
15213         Fixes bug #81720.
15214
15215 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
15216
15217        * metadata.c: Move variable declarations to top of scope.
15218        * verify.c: Move variable declarations to top of scope.
15219
15220        Code is contributed under MIT/X11 license.
15221
15222 2007-06-08  Raja R Harinath  <rharinath@novell.com>
15223
15224         * reflection.c (mono_class_bind_generic_parameters): Replace
15225         open-coded loop with mono_metadata_inflate_generic_inst.
15226
15227         * class.c (get_shared_generic_class): Don't call
15228         mono_get_shared_generic_inst.  Use the container's own
15229         'class_inst'.
15230
15231         * metadata.c (mono_metadata_load_generic_params): Move
15232         initialization of 'context' field here from ...
15233         * class.c (mono_class_create_from_typedef): ... here, and ...
15234         * loader.c (mono_get_method_from_token): ... here.
15235
15236         * class.c (get_shared_generic_class): Rename from
15237         mono_get_shared_generic_class and make static.
15238         (mono_get_shared_generic_inst): Move to metadata.c.
15239         * loader.c (mono_get_shared_generic_method): Likewise.
15240         * class-internals.h, metadata-internals.h: Update to changes.
15241
15242         Fix #81830
15243         * class.c (mono_class_from_generic_parameter): Don't assume a
15244         generic container owner exists.  Generic containers from monodis
15245         don't have any.
15246
15247 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
15248
15249         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
15250         * verify.h: new typedefs to returns the non-verifiable status
15251         * verify.c: initial implementation of generics, stack merging and object compatibility check
15252
15253 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15254
15255         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15256         a MonoInternalHashTable again (fixed bug in internal hash table
15257         code).
15258
15259 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15260
15261         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15262         MonoInternalHashTable again (fixed bug in internal hash table
15263         code).
15264
15265 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15266
15267         * class.c, image.c, class-internals.h, domain.c,
15268         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
15269         changes.  Have to figure out what makes them break the SWF
15270         regression.
15271
15272 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15273
15274         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15275         a MonoInternalHashTable now.
15276
15277 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15278
15279         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15280         MonoInternalHashTable now.
15281
15282 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
15283
15284         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
15285         invoke_impl code.
15286
15287         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
15288
15289         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
15290         dependent trampoline.
15291
15292         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15293
15294         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
15295
15296 2007-05-29  Robert Jordan  <robertj@gmx.net>
15297
15298         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
15299
15300 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
15301
15302         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
15303
15304 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
15305
15306        * marshal.c: Fix interface lookup loops for
15307        cominterop_get_com_slot_for_method and 
15308        cominterop_get_method_interface. Only need to lookup
15309        if type is a class, else use interface type method is on.
15310
15311        Code is contributed under MIT/X11 license.
15312
15313 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
15314
15315         * reflection.c: HasSecurity can be present even if no specially 
15316         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
15317         SecurityAttribute). Fix CAS regression tests on buildbot.
15318
15319 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
15320
15321        * appdomain.c: Add configure checks for header files.
15322        * image.c: Add configure checks for header files.
15323        * file-io.c: Add configure checks for header files.
15324        * debug-mono-symfile.c: Add configure checks for header files.
15325        * threadpool.c: Add configure checks for header files.
15326        * console-io.c: Add configure checks for header files.
15327        * profiler.c: Add configure checks for header files.
15328        * rawbuffer.c: Add configure checks for header files.
15329        * icall.c: Add configure checks for header files.
15330        * rand.c: Add configure checks for header files.
15331        * socket-io.c: Add configure checks for header files.
15332
15333        Code is contributed under MIT/X11 license.
15334
15335 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
15336
15337         * reflection.c (mono_custom_attrs_from_builders): Remove the 
15338         assertion as it breaks the build.
15339         
15340         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
15341
15342         * reflection.c (lookup_custom_attr): Make a copy here too.
15343
15344         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
15345         dynamic images.
15346
15347         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
15348         images.
15349
15350         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
15351         info.
15352
15353 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
15354
15355         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
15356         (load_cattr_value): Ditto.
15357
15358 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
15359
15360         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
15361
15362 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
15363
15364         * threads.c: In "start_wrapper", set apartment_state to MTA if
15365         apartment_state is Unknown and we're running on 2.0 profile or
15366         higher.
15367         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
15368         to main method, then set apartment_state to Unknown on 1.0 profile,
15369         and MTA on 2.0 profile.
15370
15371 2007-05-16  Jb Evain  <jb@nurv.fr>
15372
15373         * class-internals.h (MonoDefaults): Add an attribute_class and
15374           customattribute_data_class.
15375         * domain.c (mono_init_internal): Populate them.
15376         * reflection.c: Use them to remove duplicates. Make a vew
15377         MonoClass variables `static'.
15378
15379 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
15380
15381         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
15382         step in implementing IMT, so that all isinst checks now can go
15383         through the bitmap.
15384         This was needed because vtables for TransparentProxy need to look
15385         like the vtable of the "target" class, so they need to point to
15386         its interface bitmap directly.
15387
15388         * object.c: inside "mono_class_create_runtime_vtable" and
15389         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
15390
15391 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
15392
15393         * object-internals.h
15394           culture-info.h : added territory field in MonoCulture and
15395           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
15396         * locales.c : fill territory field above too.
15397         * culture-info-table.h : regenerated.
15398
15399 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
15400
15401         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
15402         Fixes #81599.
15403
15404 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
15405
15406         * object.c: Always initialize apartment, even if 
15407         there is no custom attributes on entry point.
15408         
15409         Code is contributed under MIT/X11 license.
15410
15411 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
15412
15413         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
15414         * metadata.c: If no encoding is set, check for unicode
15415         on class.
15416         
15417         Code is contributed under MIT/X11 license.
15418
15419 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15420
15421         * threads.c: Handle if mono_thread_current returns NULL 
15422         
15423         Code is contributed under MIT/X11 license.
15424
15425 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15426
15427         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
15428         in start_wrapper. Added mono_thread_init_apartment_state and
15429         mono_thread_cleanup_apartment_state.
15430         * object.c: Initialize thread apartment state on main thread
15431         by checking for STAThreadAttribute on entry point.
15432         * object-internals.h: Add apartment_state field to MonoThread.
15433         * threads-types.h: Add unmanaged definition of 
15434         System.Threading.ApartmentState, MonoThreadApartmentState.
15435         
15436         Code is contributed under MIT/X11 license.
15437         
15438 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
15439
15440         * class.c: Fix windows build.
15441         * class-internals.h: Fix windows build.
15442         
15443         Code is contributed under MIT/X11 license.
15444
15445 2007-05-08  Robert Jordan  <robertj@gmx.net>
15446
15447         * process.c (CreateProcess_internal):
15448         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
15449         .CreateNoWindow was specified. Fixes #81496.
15450
15451 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15452
15453         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
15454         step in implementing IMT, replaced it with two compact arrays
15455         (interfaces_packed and interface_offsets_packed) and a bitmap that
15456         is used for isinst checks (interface_bitmap).
15457
15458         * class.c: (compare_interface_ids): compare function to pass to
15459         bsearch when looking for an interface with a given id.
15460         (mono_class_interface_offset): reimplemented using bsearch on
15461         interfaces_packed, getting the offset from interface_offsets_packed.
15462         (print_implemented_interfaces): utility debugging function.
15463         (setup_interface_offsets): reworked to initialize interfaces_packed,
15464         interface_offsets_packed and interface_bitmap.
15465
15466         * object.c: replaced all accesses to "MonoClass.interface_offsets"
15467         with uses of interfaces_packed and interface_offsets_packed.
15468
15469 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15470
15471         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
15472         mono_class_interface_offset prototype to wrap all accesses to
15473         "MonoClass.interface_offsets".
15474
15475         * class.c: Implemented mono_class_interface_offset, and wrapped all
15476         accesses to "MonoClass.interface_offsets".
15477
15478         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
15479         "MonoClass.interface_offsets".
15480
15481 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
15482
15483         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
15484         GetMethodFromHandle overloads (bug #78637).
15485
15486 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
15487
15488         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
15489         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
15490
15491 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
15492
15493         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
15494         #81498.
15495
15496         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
15497         gracefully.
15498         (mono_custom_attrs_from_index): Ditto.
15499
15500         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
15501         Fixes #81501.
15502
15503 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
15504
15505         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
15506         is now allocated from a mempool.
15507
15508 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
15509
15510         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
15511         caller holds threads_lock, leading to deadlocks. Fixes #81476.
15512
15513 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
15514
15515         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
15516         mono_loader_clear_error () too late. Fixes #81463.
15517
15518 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
15519
15520         * culture-info-table.h : regenerated.
15521
15522 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
15523
15524         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
15525         is missing.
15526
15527 2007-04-25  Dick Porter  <dick@ximian.com>
15528
15529         * Makefile.am: Put the mingw enforced-optimisation back into the
15530         PLATFORM_WIN32 section.
15531
15532 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
15533
15534         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
15535         patch.
15536
15537         * image.c (mono_image_load_module): New API function to load a module reference.
15538
15539         * image.c (load_modules): Load modules lazily. Fixes #80812.
15540
15541         * class.c (mono_class_from_typeref): Use mono_image_load_module.
15542         
15543         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
15544
15545         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
15546         to mono_image_load_module_dynamic.
15547
15548 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
15549
15550         * marshal.c: Fix calling convention for CCW on non-windows
15551         platforms. STDCALL on windows, CDECL everywhere else to work 
15552         with XPCOM and MainWin COM.
15553         
15554         Code is contributed under MIT/X11 license.
15555
15556 2007-04-23  Martin Baulig  <martin@ximian.com>
15557
15558         Fix #80969.
15559
15560         * loader.c
15561         (method_from_memberref): Added `gboolean *used_context' argument.
15562         (mono_get_method_from_token): Likewise.
15563         (mono_get_method_full): Don't insert the method in the cache when
15564         `used_context' is true.
15565
15566 2007-04-23  Raja R Harinath  <rharinath@novell.com>
15567
15568         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
15569
15570         * reflection.c (mono_reflection_bind_generic_parameters): Don't
15571         create new MonoTypes for returned types.
15572         * class.c (mono_generic_class_get_class): Export mono-internal.
15573         * class-internals.h: Update to changes.
15574
15575 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
15576
15577         * threadpool.c, threadpool.h, icall-def.h: patch from
15578         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
15579
15580 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
15581
15582         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
15583         
15584         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
15585
15586         * threads.c (mono_thread_get_stack_bounds): New helper function.
15587
15588         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
15589         Correctly compute stack bounds when attaching. Fixes #81394.
15590
15591 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
15592
15593         * reflection.c: fix handling of doubles in custom attributes
15594         for the arm-fpa format (bug #81368).
15595
15596 2007-04-18  Raja R Harinath  <rharinath@novell.com>
15597
15598         * reflection.c (assembly_add_win32_resources): Mildly relax an
15599         bounds check to let the end pointer point just past the end of the
15600         allocated buffer.  (may fix #81384)
15601
15602 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
15603
15604         * culture-info-table.h : regenerated.
15605
15606 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
15607
15608         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
15609         the thread is aborted early.
15610
15611 2007-04-05  Dick Porter  <dick@ximian.com>
15612
15613         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
15614         FindFirstFile()/FindNextFile() to find entries.  This lets the
15615         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
15616         81038.
15617
15618         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
15619         the parameters of
15620         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
15621
15622 2007-04-04  Martin Baulig  <martin@ximian.com>
15623
15624         * debug-helpers.c
15625         (mono_method_desc_full_match): Add support for nested classes.
15626
15627 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
15628
15629         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
15630
15631 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
15632
15633         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
15634         waiting for too many threads.
15635
15636 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
15637
15638         * environment.c: Fix return value check on uname so we can get the 
15639         executing version on Solaris operating systems.
15640
15641 2007-03-28  Jb Evain  <jbevain@gmail.com>
15642
15643         * class.c (mono_type_get_name_recurse): Complete the
15644         fix for the creation of assembly qualified names for
15645         pointer types. Fixes #81208.
15646
15647 2007-03-27  Dick Porter  <dick@ximian.com>
15648
15649         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
15650         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
15651         changed.
15652
15653         * threads.c
15654         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
15655         the value of ReleaseMutex().
15656
15657 2007-03-27  Dick Porter  <dick@ximian.com>
15658
15659         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
15660         in little-endian order, not network endian, so must be converted
15661         to host endian here.  Fixes bug 80593.
15662
15663 2007-03-22  Jb Evain  <jbevain@gmail.com>
15664
15665         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
15666         qualified names for pointer types. Fixes #81208.
15667
15668 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
15669
15670         * marshal.c: Add support for PreserveSigAttribute. 
15671         
15672         Code is contributed under MIT/X11 license.
15673
15674 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
15675
15676         * process.c: Fix endianness issues. Fixes #81126.
15677
15678         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
15679         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
15680
15681         * image.c (mono_image_lookup_resource): Make this work on big-endian
15682         machines.Change API contract so the caller needs to free the return value.
15683         
15684         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
15685         API change.
15686         
15687 2007-03-14  Martin Baulig  <martin@ximian.com>
15688
15689         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
15690         mono_type_get_desc() as well.
15691
15692 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
15693
15694         * icall.c:  Fix environ access in VS.  
15695         
15696 2007-03-13  Alp Toker  <alp@atoker.com>
15697
15698         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
15699         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
15700         #63841.
15701
15702 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
15703
15704         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
15705         circular references among dynamic methods. Fixes #81091.
15706
15707         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
15708
15709 2007-03-09  Martin Baulig  <martin@ximian.com>
15710
15711         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
15712
15713 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
15714
15715         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
15716         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
15717         
15718         Code is contributed under MIT/X11 license.
15719         
15720 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
15721
15722         * loader.c: Reapply patch for bug #79424.
15723
15724 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
15725
15726         * metadata.c (mono_type_to_unmanaged): Only convert object to
15727         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
15728
15729 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
15730
15731         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
15732         (and incorrectly set) is_reference field from MonoGenericInst.
15733
15734 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
15735
15736         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
15737         a little earlier.
15738
15739         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
15740
15741         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
15742
15743 2007-03-05  Miguel de Icaza  <miguel@novell.com>
15744
15745         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
15746         FileOptions.1 value to mean "temporary", map that to
15747         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
15748
15749         Fixes 80688
15750
15751 2007-03-03  Marek Habersack  <mhabersack@novell.com>
15752
15753         * appdomain.c: implement MS .Net style shadow copying. Copies of
15754         the assemblies are made in a subdirectory of the dynamic base
15755         directory, the assembly names are preserved.
15756         Copy .mdb and .config files along with the assemblies being shadowed.
15757
15758 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
15759
15760         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
15761         (emit_marshal_handleref): Ditto.
15762
15763         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
15764         on Visual C++. Fixes #80671.
15765
15766 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
15767
15768         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
15769         for clone operations.
15770
15771 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
15772
15773         * marshal.c: Fix warnings.
15774
15775 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
15776
15777         * loader.c: allow case-insensitive matching of the dll name
15778         in dllmap handling when prefixed with "i:".
15779
15780 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
15781
15782         * threads.c: Fix #ifdef for dummy_apc function for VS.
15783
15784 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
15785
15786         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
15787
15788 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
15789         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
15790         giving precedence to the methods with a fully qualified name
15791         (InterfaceName.MethodName) when building the interface sections
15792         of the vtable.
15793
15794 2007-02-16  Dick Porter  <dick@ximian.com>
15795
15796         * threadpool.c (append_job): Fix fast-path array handling, so it's
15797         less likely the array will grow exponentially when the load is
15798         heavy.
15799
15800 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
15801
15802         * metadata-internals.h, loader.c: fix dllmap lookup order
15803         for non-function maps, too, and prepare for fallback code.
15804
15805 2007-02-12  Robert Jordan  <robertj@gmx.net>
15806
15807         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
15808         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
15809         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
15810         GlobalFree. Fixes a part of bug #77075.
15811
15812 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
15813
15814         * loader.c: implemented typedef parent in field memberref.
15815
15816 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
15817
15818         * marshal.c: Fix warnings and remember to call Release on
15819         IUnknown of RCW.
15820         
15821         Code is contributed under MIT/X11 license.
15822
15823 2007-02-10  Miguel de Icaza  <miguel@novell.com>
15824
15825         * class-internals.h: Add MonoHandleRef definition, and
15826         handleref_class to mono_defaults. 
15827
15828         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
15829         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
15830
15831         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
15832         (do nothing on this stage)
15833         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
15834         (emit_marshal_handleref): New method, used for argument handling
15835         of HandleRefs. 
15836
15837 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
15838
15839         * class.c (mono_class_setup_parent): Lazily init com types.
15840         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
15841         init com types.
15842         * object.c (mono_remote_class_vtable): Lazily init com types.
15843         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
15844         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
15845         * domain-internals.h: Expose mono_init_com_types.
15846         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
15847         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
15848         Add support for COM Callable Wrapper marshalling.
15849         * marshal.h: Add icall definitions.
15850         * gc.c: Handle freeing of CCWs in finalizer code.
15851         
15852         Code is contributed under MIT/X11 license.
15853
15854 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
15855
15856         * reflection.c: changed all the signature encoding code to use
15857         a variable-sized buffer.
15858
15859 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
15860
15861         * marshal.c: locking fixes: never take the loader lock
15862         or other runtime locks when holding the marshal lock
15863         (fixes bug#80664).
15864
15865 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
15866
15867         * marshal.c: make the delegate function pointer mapping
15868         work for the moving GC.
15869
15870 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
15871
15872         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
15873         for bug #80618.
15874
15875 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
15876
15877         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
15878         gmodule.
15879
15880 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
15881
15882         * threadpool.c: made the code moving-GC safe.
15883
15884 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
15885
15886         * assembly.c, boehm-gc.c, class-internals.h, class.c,
15887         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
15888         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
15889         warning cleanup.
15890         * reflection.c: warning cleanup, some threading and moving GC fixes.
15891
15892 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
15893
15894         * class.c, loader.c: create the needed Set/Get/Address array methods
15895         as well as the .ctors in mono_class_init (), fixes bug #80567.
15896
15897 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
15898
15899         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
15900         we doesn't decrease its alignment. Should fix the sparc build.
15901
15902 2007-01-24  Dick Porter  <dick@ximian.com>
15903
15904         * socket-io.c
15905         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
15906         Create the returned object if we need to ignore an unsupported
15907         socket option.  Fixes a segfault reported by Atsushi.
15908
15909 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
15910
15911         * class.c, object.c: restrict GC-tracked fields to
15912         UIntPtr fields used inside corlib, so we provide better
15913         type info to the GC and also allow broken packing as in
15914         bug #80580.
15915
15916 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
15917
15918         * sgen-gc.c: removed duplicated function.
15919
15920 2007-01-19  Miguel de Icaza  <miguel@novell.com>
15921
15922         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
15923         value that means that the value is not supported, but that we
15924         should not return a failure, but instead report this as a
15925         successful operation.
15926
15927 2007-01-19  Raja R Harinath  <rharinath@novell.com>
15928
15929         Fix tests/bug79956.2.il
15930         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
15931         (mono_generic_class_get_class): If the generic definition in an
15932         enum, copy over other fields related to it.
15933
15934 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
15935
15936         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
15937         genericinst enums (bug #79215).
15938
15939 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
15940         * class.c: Fix bug 80307.
15941
15942 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
15943
15944         * image.c: if the file table is not present, try to load
15945         all the modules, since we don't have info about them
15946         having or not metadata (bug #80517).
15947         * assembly.c: allow mono_assembly_load_references () to
15948         work for netmodules.
15949
15950 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
15951
15952         * image.c, metadata-internals.h, object.c: execute module
15953         cctors when running on the 2 runtime if present (bug #80487).
15954
15955 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
15956
15957         * icall.c: optimized InitializeArray() on bigendian.
15958
15959 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
15960
15961         * icall.c: fix for the broken ARM FPA double format.
15962
15963 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
15964
15965         * icall.c: handle endian issues for r4 and r8 types, too, in
15966         the InitializeArray() icall.
15967
15968 2007-01-15  Miguel de Icaza  <miguel@novell.com>
15969
15970         * loader.c (mono_loader_error_prepare_exception): Clear the error
15971         once we have extracted the information from it, do this before we
15972         call into the JIT's class loading mechanisms.
15973
15974         * object.c (mono_class_create_runtime_vtable): Do not clear the
15975         loader error before calling mono_class_get_exception_for_failure
15976         as the loader error is needed inside
15977         mono_class_get_exception_for_failure to throw the error (thinko).
15978
15979         Fixes #80521
15980         
15981 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
15982
15983         * reflection.c: align fields rva data so it's faster to load at
15984         runtime.
15985
15986 2007-01-12  Raja R Harinath  <rharinath@novell.com>
15987
15988         Prepare to simplify GenericMethod handling.
15989         * class-internals.h (mono_method_get_context): New accessor function.
15990         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
15991         rather than directly accessing '->context' field.
15992
15993         * class-internals.h (_MonoGenericParam.method): Move ...
15994         (_MonoGenericContainer): ... here.  Add into union with klass field.
15995         * class.c, icall.c, loader.c, metadata.c, reflection.c:
15996         Update to changes.
15997
15998 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
15999
16000         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
16001         the wrapper type enum and reduce relocations.
16002
16003 2007-01-12  Raja R Harinath  <rharinath@novell.com>
16004
16005         * reflection.c (inflate_mono_method): Reuse method instantiation
16006         from the generic method, if available.
16007
16008 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16009
16010         * marshal.c (emit_marshal_variant): Fix conv_arg
16011         type in last commit, based on whether parameter is byref.
16012         
16013 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16014
16015         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
16016         marshalling.
16017         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
16018         MONO_TYPE_OBJECT back for VARIANT support.
16019
16020 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16021
16022         * marshal.c, marshal.h, icall-def.h: Implement 
16023         Marshal.ReAllocCoTaskMem.
16024
16025 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
16026
16027         * marshal.c: memory retention fixes: use the proper
16028         image cache for runtime_invoke method lookups.
16029
16030 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
16031
16032         * mempool.c: added code to help debug mempool allocations.
16033
16034 2007-01-11  Dick Porter  <dick@ximian.com>
16035
16036         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
16037         support (experimenting with faking it with IP_MTU_DISCOVER for
16038         systems that don't have IP_DONTFRAGMENT.)
16039         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
16040         icall.
16041
16042         * icall-def.h: new System.Net.Sockets.Disconnect icall.
16043
16044         * socket-io.h: Add new fields to MonoSocketAsyncResult
16045         corresponding to the new ones in Socket.cs.
16046
16047 2007-01-11  Raja R Harinath  <rharinath@novell.com>
16048
16049         Fix IronPython regression mentioned in #80249
16050         * metadata.c (do_mono_metadata_parse_generic_class): Clear
16051         'cached_context' field, since it may have been initialized as a
16052         side-effect of metadata parsing.
16053
16054         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
16055         (_MonoGenericClass.cached_class): Move here and rename from lone
16056         remaining field of ...
16057         (_MonoInflatedGenericClass): ... this.  Remove.
16058         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
16059         to changes.
16060
16061         Fix mcs/tests/test-128.cs regression.
16062         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
16063         2007-01-10 change below.
16064         [MONO_TYPE_OBJECT]: Recurse into array case.
16065
16066 2007-01-11  Raja R Harinath  <harinath@gmail.com>
16067
16068         * class-internals.h (mono_get_inflated_generic_class): Remove.
16069         * class.c (mono_get_inflated_generic_class): Remove.
16070         (mono_generic_class_get_class): Rename from
16071         mono_class_create_generic.
16072         (mono_class_from_mono_type) [GENERICINST]: Use it.
16073         * reflection.c, metadata.c: Update to changes.  Use
16074         'mono_class_from_mono_type'.
16075
16076 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
16077
16078         * reflection.c: use passed type when encoding an array element
16079         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
16080
16081 2007-01-09  Robert Jordan  <robertj@gmx.net>
16082
16083         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
16084         result arguments (someDelegate.EndInvoke (unrelatedAres)).
16085         Fixes bug #80392.
16086
16087 2007-01-09  Raja R Harinath  <rharinath@novell.com>
16088
16089         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
16090
16091         * object.c (set_value): Avoid aliasing between type->data.klass
16092         and type->data.generic_class.
16093
16094         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
16095
16096 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16097
16098         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
16099         between type->data.klass and type->data.generic_class.
16100
16101 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
16102
16103         * marshal.c: In MS.NET, StringBuilder objects are not copied by
16104         value in out parameters.
16105
16106 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16107
16108         Simplify invariant for MonoGenericClass::klass field.
16109         * class.c (mono_class_create_generic): Verify 'klass' is null.
16110         * metadata.c (do_mono_metadata_parse_generic_class): Don't
16111         initialize 'klass' field.
16112
16113 2007-01-05  Raja R Harinath  <rharinath@novell.com>
16114
16115         Ongoing work to avoid redundant data and simplify invariants.
16116         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
16117         'generic_class', and change type to a GenericInst.
16118         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
16119         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
16120
16121 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
16122
16123         * class.c : skip io-layer under PLATFORM_WIN32.
16124
16125 2007-01-03  Tor Lillqvist  <tml@novell.com>
16126
16127         Fix #80305: In a bundled executable, look in the bundled exe
16128         assembly to determine the runtime version. Add the possibility to
16129         bundle also the machine.config file.
16130         
16131         * assembly.c (mono_assembly_open_from_bundle): Make
16132         non-static. Allow being called even if we have no bundled
16133         assemblies, and return NULL right away in that case.
16134
16135         * domain-internals.h: Declare mono_assembly_open_from_bundle()
16136         here.
16137
16138         * domain.c (app_config_parse): Take an assembly exe file name as
16139         parameter instead of a config file name. Check for a bundled
16140         config file for that assembly by calling
16141         mono_config_string_for_assembly_file() (see below) before looking
16142         for one in the file system.
16143         (get_runtimes_from_exe): Corrsponding change to call of
16144         app_config_parse().
16145         (get_runtimes_from_exe): Check for bundled assembly exe file first
16146         by calling mono_assembly_open_from_bundle(). If no bundled
16147         assembly exe file is found, call mono_image_open() as before to
16148         look it up in the file system.
16149
16150         * mono-config.c: Add variable bundled_machinec_onfig.
16151         (mono_config_string_for_assembly_file): New function.
16152         (mono_config_for_assembly): Move code snippet that looks for a
16153         bundled assembly .config file into the above new function. Call
16154         it.
16155         (mono_register_machine_config, mono_get_machine_config): New
16156         functions to set and retrieve
16157
16158         * assembly.h: Declare mono_register_machine_config().
16159
16160         * mono-config.h: Declare mono_get_machine_config() and
16161         mono_config_string_for_assembly_file().
16162
16163         * icall.c: No declaration of environ necessary on Win32. It is
16164         declared (as a macro expanding to a function call) in stdlib.h.
16165         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
16166         New internal mono function. Returns the value of
16167         mono_get_machine_config() as a Mono string.
16168
16169         * icall-def.h: Add get_bundled_machine_config().
16170
16171 2007-01-04  Raja R Harinath  <rharinath@novell.com>
16172
16173         Remove redundant field
16174         * class-internals.h (_MonoGenericContext.container): Remove field.
16175         * loader.c (mono_method_get_signature_full): Don't parse a
16176         "container" for a signature parse when the signature is inflated
16177         immediately.
16178         (method_from_methodspec): Likewise, for a generic_inst.
16179         * class.c, metadata.c, reflection.c: Update to changes.
16180
16181 2006-01-04  Raja R Harinath  <rharinath@novell.com>
16182
16183         * class-internals.h (_MonoGenericClass): Rename 'context' field to
16184         'cached_context', and change semantics -- it starts off NULL, and
16185         is initialized on demand.
16186         * class.c (mono_generic_class_get_context): New accessor to
16187         replace 'context' field accesses.
16188         (mono_class_get_context): New helper.
16189         (*): Update to changes.
16190         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
16191
16192 2007-01-03  Miguel de Icaza  <miguel@novell.com>
16193
16194         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
16195         before the memcpy.   Fixes Marshal2 regression.
16196
16197 2007-01-02  Jb Evain  <jbevain@gmail.com>
16198
16199         * blob.h: add a MONO_TYPE_ENUM definition
16200         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
16201         fix the encoding of arrays of enums in custom attributes.
16202
16203         Fixes #79666.
16204
16205 2007-01-01  Miguel de Icaza  <miguel@novell.com>
16206
16207         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
16208         string is null terminated, but only cut the string short if it
16209         overflows the buffer.   
16210         
16211         (mono_string_to_byvalstr): Also fix this routine.   The code here
16212         was not properly terminating a string (it was only terminated
16213         because of the previous catch-all memset). 
16214
16215         I left the memset, because I do not know if applications expect
16216         the runtime to clear this region. 
16217
16218         Fixes #79944.
16219
16220         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
16221         Clear the error before returning to unmanaged code to prevent the
16222         runtime from being confused later on (fixes  80420).
16223         (ves_icall_type_from_name): Always call mono_loader_clear_error
16224         after parsing a type that could have failed.
16225         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
16226
16227         * loader.c (mono_loader_clear_error): Fix indentation.
16228
16229 2006-12-28  Martin Baulig  <martin@ximian.com>
16230
16231         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
16232
16233 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
16234
16235         * reflection.c: patch from Rolf Bjarne Kvinge to fix
16236         getting a token for an EnumBuilder.
16237
16238 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
16239
16240         * reflection.c: be more careful in case resource generation
16241         fails to create the data array.
16242
16243 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
16244
16245         * sgen-gc.c: write barrier for clone and fix unregister handles.
16246
16247 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
16248
16249         * reflection.c: some fixes needed in the generics code for the moving GC.
16250
16251 2006-12-22  Robert Jordan  <robertj@gmx.net>
16252
16253         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
16254         account. Fixes bug #80299.
16255
16256 2006-12-21  Raja R Harinath  <rharinath@novell.com>
16257
16258         Fix WaitHandle usage in delegates.
16259         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
16260         * object.c (mono_wait_handle_new): Use the property set method to
16261         initialize the handle.
16262         (mono_wait_handle_get_handle): New.
16263         * threadpool.c (mono_async_invoke): Use it.
16264         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
16265         Likewise.
16266         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
16267
16268 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
16269
16270         * marshal.c (emit_marshal): Call emit_marshal_variant and
16271         emit_marshal_com_interface when applicable.
16272         (emit_marshal_variant, emit_marshal_com_interface): Add
16273         methods for this case and remove if's from emit_marshal_object.
16274         
16275 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
16276
16277         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
16278
16279 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
16280
16281         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
16282         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
16283         and GlobalFree on Windows. Remove FIXME.
16284
16285 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
16286
16287         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
16288         implementation for managed objects.
16289
16290 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
16291
16292         * object.c: implemented code to be used for checking
16293         that no reference field overlaps with non-references.
16294
16295 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16296
16297         * threadpool.c: fix queue code to be compatible with the
16298         moving GC.
16299
16300 2006-12-18  Miguel de Icaza  <miguel@novell.com>
16301
16302         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
16303         in structures by throwing ArgumentNullException.
16304
16305         (emit_marshal_safehandle): Also when they are null parameters.
16306
16307         (emit_marshal_safehandle): Add support for ref
16308         SafeHandles parameters
16309
16310 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16311
16312         * profiler.c: updated to use the mono-dl API instead of
16313         gmodule.
16314
16315 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16316
16317         * profiler.c: updated to use the mono-dl dynamic loading
16318         API instead of gmodule.
16319
16320 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
16321
16322         * profiler.c: use readlink, older versions of glib don't have
16323         g_file_read_link ().
16324
16325 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16326
16327         * profiler.c: try to detect the path to mono if libc fails to provide
16328         a useful name (bug #80286).
16329
16330 2006-12-16  Raja R Harinath  <rharinath@novell.com>
16331
16332         Fix #80242
16333         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
16334         instance, use the generic type definition instead.
16335         (ves_icall_Type_GetNestedTypes): Likewise.
16336         * class.c (mono_class_create_generic): Always set the
16337         nested_classes of a generic instance to NULL, even if the generic
16338         type definition has nested types.
16339
16340 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
16341
16342         * marshal.c (mono_string_from_bstr): Revert previous Windows change
16343         and fix on Linux.
16344         
16345 2006-12-15  Miguel de Icaza  <miguel@novell.com>
16346
16347         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
16348         my arguments were in the wrong order.   I also fixed the Windows
16349         version which seems to have had the same issue.
16350
16351         (mono_free_bstr): On Unix, this is g_free.
16352         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
16353         conversions (for the tests in corlib to pass).
16354
16355 2006-12-14  Miguel de Icaza  <miguel@novell.com>
16356
16357         * marshal.c (emit_ptr_to_object_conv): For now, ignore
16358         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
16359         exception if a ref SafeHandle in a struct has changed).
16360         
16361         (emit_struct_conv): Do not perform layout checks for classes
16362         derived from SafeHandle, as those are specially handled. 
16363
16364         (emit_object_to_ptr_conv): Add support for
16365         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
16366
16367         (emit_marshal_safehandle): Implement conversion of return values
16368         of safehandles (MARSHAL_ACTION_CONV_RESULT).
16369         
16370         * threads.c: WaitHandle now is compiled with two different handles
16371         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
16372         for 2.0.
16373         
16374         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
16375         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
16376         these routines to cope with both kinds of fields.
16377
16378 2006-12-12  Miguel de Icaza  <miguel@novell.com>
16379
16380         * metadata.c (mono_type_to_unmanaged): Handle the case where
16381         type->data.klass is a SafeHandle, and in that case, return the
16382         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
16383         MONO_MARSHAL_CONV_SAFEHANDLE. 
16384
16385 2006-12-11  Miguel de Icaza  <miguel@novell.com>
16386
16387         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
16388         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
16389         calling emit_marshal_object.
16390
16391         (emit_marshal_safehandle): Implement marshalling of
16392         SafeHandle parameters (no ref support yet).
16393
16394         (MarshalAction): Document the defines as I implement
16395         them for SafeHandle.
16396
16397         (emit_marshal_object): indentation police.
16398
16399         * class-internals.h: Define MonoSafeHandle.
16400         Add safehandle_class to MonoDefaults type.
16401
16402         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
16403         list of classes to check for fields. 
16404
16405         * domain.c (mono_init_internal): Add SafeHandle to the list of
16406         mono_defaults loaded.
16407
16408 2006-12-15  Raja R Harinath  <rharinath@novell.com>
16409
16410         Fix #80253
16411         * reflection.c (mono_reflection_bind_generic_parameters): If the
16412         generic type definition is a type builder, ensure that it is fully
16413         initialized before instantiating it.  Kill some dead code.
16414
16415 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
16416
16417         * object.c: clear the loader_error () before loading
16418         more metadata stuff (bug #80258).
16419
16420 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
16421
16422         * icall.c, icall-defs.h: type modifiers icalls for
16423         parameters and properties.
16424
16425 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
16426
16427         * object.c, icall.c: fixed warnings.
16428
16429 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16430
16431         * marshal.c: fixed a couple of leaks and coding style in a few places.
16432
16433 2006-12-08  Dick Porter  <dick@ximian.com>
16434
16435         * process.c: Cope with NULL ProcessStartInfo arguments on windows
16436         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
16437         80173.
16438
16439 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
16440
16441         * process.c: ProcessStartInfo may have only filename set and
16442         arguments can be NULL.
16443
16444 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16445
16446         * icall.c: fix leak found by Robert Jordan.
16447
16448 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16449
16450         * marshal.c, marshal.h: generate managed method to access an element
16451         of a multi-dimensional array.
16452
16453 2006-11-30  Paolo Molaro (lupus@ximian.com)
16454
16455         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
16456
16457 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16458
16459         * icall.c: back out GetFields () fix until the serialization code is
16460         fixed to not depend on the incorrect behaviour.
16461
16462 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
16463
16464         * profiler.c: provide defaults if none are set.
16465
16466 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
16467
16468         * Makefile.am, attrdefs.h: new public header file with
16469         constants for attributes for use by embedders.
16470
16471 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
16472
16473         * icall.c: GetFields () fix for bug #80064.
16474
16475 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
16476
16477         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
16478         removed long unused icalls.
16479
16480 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
16481   
16482         * marshal.c: 
16483                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
16484                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
16485                 can be generated without a delegate class.
16486                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
16487         
16488         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16489
16490 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16491
16492         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
16493         #80069.
16494
16495 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16496
16497         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
16498         icall-def.h: added icalls needed by System.GC.
16499
16500 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
16501
16502         * loader.c: ensure the class in catch clauses is handled
16503         correctly for generics methods (fixes bug#79980).
16504
16505 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
16506
16507         * monitor.h, monitor.c: added mono_locks_dump () function
16508         to help debug deadlocks involving managed locks.
16509
16510 2006-11-13  Dick Porter  <dick@ximian.com>
16511
16512         * file-io.c (get_file_attributes): If the file is a symlink try
16513         and get the stat data for the target, but also add the
16514         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
16515         the specs for the windows symlink support, but will probably have
16516         to be reworked when I have test data from a vista machine.  Fixes
16517         bug 79887.
16518
16519 2006-11-13  Dick Porter  <dick@ximian.com>
16520
16521         * gc.c (mono_domain_finalize): 
16522         * marshal.c (mono_delegate_begin_invoke): 
16523         * threadpool.c (socket_io_init, mono_thread_pool_init)
16524         (mono_thread_pool_finish): 
16525         * monitor.c (mono_monitor_try_enter_internal): 
16526         * threads.c (mono_thread_resume, mono_thread_init)
16527         (mono_thread_suspend_all_other_threads)
16528         (mono_thread_execute_interruption): 
16529         * appdomain.c (mono_domain_unload): Check for NULL error returns
16530         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
16531         75733.
16532
16533 2006-11-11  Miguel de Icaza  <miguel@novell.com>
16534
16535         * process.c
16536         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
16537         Only close the handle if the value of the handle is not
16538         INVALID_HANDLE_VALUE.  This just makes the process a bit more
16539         robust.
16540
16541         Improvement for #75733, so that we do not run into this problem. 
16542
16543         
16544         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
16545         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
16546         internal variables.  Fixes #79462 
16547         
16548
16549 2006-11-09  Dick Porter  <dick@ximian.com>
16550
16551         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16552         Use poll() not select().  Fixes bug 79397.
16553
16554 2006-11-09  Raja R Harinath  <rharinath@novell.com>
16555
16556         Fix #79872
16557         * assembly.c (mono_assembly_load_from_full): Check that the given
16558         image has an assembly manifest.
16559
16560 2006-11-09  Ankit Jain  <jankit@novell.com>
16561
16562         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
16563         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
16564         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
16565
16566 2006-11-07  Dick Porter  <dick@ximian.com>
16567
16568         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16569         Put the old resolver behaviour back for pre-2.0 profiles.
16570
16571 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
16572
16573         * threadpool.c: precise GC and locking fixes.
16574
16575 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
16576
16577         * class.c: don't load types that have an explicit unaligned
16578         managed reference. Provide better info in the TypeLoad exception.
16579         Part of the fix for bug #79744.
16580         * object.c: use the correct check for class type load issues.
16581
16582 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
16583
16584         * class.c: enforce alignment of fields with managed references
16585         even when Pack=1 is forced by the user (bug #77788).
16586
16587 2006-11-03  Dick Porter  <dick@ximian.com>
16588
16589         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16590         If the address reverse lookup fails, return it as the hostname
16591         anyway.  Fixes bug 79721.
16592
16593 2006-11-03  Dick Porter  <dick@ximian.com>
16594
16595         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
16596         Fix build on Windows.
16597
16598 2006-11-02  Dick Porter  <dick@ximian.com>
16599
16600         * icall-def.h: 
16601         * object-internals.h: 
16602         * exception.c (mono_get_exception_thread_interrupted): 
16603         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
16604         Fixes bug 74525.
16605
16606         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
16607         Check for pending Thread.Interrupt.
16608
16609 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
16610         * loader.c: Fixed bug 79684.
16611
16612 2006-10-27  Dick Porter  <dick@ximian.com>
16613
16614         * file-io.c (get_file_attributes): Force symlinks to directories
16615         to be returned as a regular file.  Fixes bug 79733.
16616 2006-10-26  Dick Porter  <dick@ximian.com>
16617
16618         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
16619         CreateFile to open a directory then we need to set the
16620         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
16621
16622 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
16623
16624         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
16625         friends.
16626
16627 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16628
16629         * sgengc.c: small cleanup of timer code.
16630
16631 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16632
16633         * sgen-gc.c: fix some warnings and start adding support for
16634         complete object removal on domain unload.
16635
16636 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
16637
16638         * assembly.c: build_assembly_name should not consider a version
16639         number without build or revision number invalid. Fixes bug #79715.
16640
16641 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
16642
16643         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
16644         call kernel32 function OutputDebugString directly.
16645         
16646         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16647         
16648 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
16649
16650         * reflection.c: small cleanup, using a function to insert a MonoString
16651         in the string heap.
16652
16653 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
16654
16655         * reflection.c: moving GC fixes.
16656
16657 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
16658
16659         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
16660         all the objects with finalizers belonging to an unloading appdomain.
16661
16662 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
16663
16664         * sgen-gc.c: added ability to allocate even when the nursery is fully
16665         pinned and fixed a couple of bugs.
16666
16667 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16668
16669         * threads.h: Revert the last change for now.
16670
16671         * threads.h (mono_thread_get_pending_exception): Rename this to
16672         mono_thread_get_undeniable_exception ().
16673
16674 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
16675
16676         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
16677         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
16678         when fname does not refer to valid assembly. This result in a more
16679         meaningful error message.
16680         * exception.c: added mono_get_exception_bad_image_format2 which 
16681         constructs a BadImageFormatException using the ctor taking a custom
16682         message and the file name. Passing in a NULL msg results in a default
16683         message.
16684         * exception.h: define mono_get_exception_bad_image_format2 function.
16685         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
16686         when file name pointed to an invalid IL image. Use 
16687         mono_get_exception_file_not_found2 to construct FileNotFoundException,
16688         as this results in a more meaningful error message.
16689
16690 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16691
16692         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
16693         #79465.
16694
16695 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
16696
16697         * metadata.c (mono_type_size): Change the align parameter to guint32 for
16698         consistency with the other _size functions.
16699         (mono_type_stack_size): Ditto.
16700
16701         * class.c object.c icall.c: Fix warnings caused by the above change.
16702
16703         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
16704
16705         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
16706
16707         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
16708
16709 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
16710
16711         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
16712         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
16713         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
16714         threadpool.h, threads-types.h: mark more internal functions.
16715
16716 2006-10-11  Dick Porter  <dick@ximian.com>
16717
16718         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16719         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
16720         reproduce the bug even before applying the fix.)
16721
16722 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
16723
16724         * reflection.c: allow retrieving attributes for arguments in generic
16725         methods (bug #79241).
16726
16727 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
16728
16729         * debug-mono-symfile.c: properly check fopen () result (found by
16730         coverity).
16731
16732 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
16733
16734         * reflection.c: make error message clearer and fixed two
16735         issuelets found by Coverity.
16736
16737 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
16738
16739         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
16740
16741 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
16742
16743         * object-internals.h, gc-internal.h, profiler-private.h:
16744         mark internal functions.
16745
16746 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
16747
16748         * reflection.c: put data in the text section.
16749         * icall.c: recognize more types in type_from_typename ().
16750         * process.c, marshal.c: added some GC FIXMEs.
16751
16752 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
16753
16754         * loader.c: check for NULL before initializing.
16755
16756 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
16757
16758         * gc.c (finalizer_thread): Use a non-alertable wait here.
16759
16760         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
16761         until the correct solution is found.
16762
16763 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
16764
16765         * reflection.c (mono_module_get_object): Avoid an assert when operating on
16766         modules with no metadata. Fixes #79596.
16767
16768         * image.c (load_metadata_ptrs): Put back the error message when
16769         the #- heap is encountered since the support is not complete yet.
16770
16771 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
16772
16773         * gc.c: do not allow the user to SuppressFinalize () a
16774         delegate because it would leak the trampoline if present.
16775
16776 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
16777
16778         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
16779         PropertyPtr table.
16780
16781 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
16782
16783         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
16784
16785         * metadata.c (mono_metadata_get_param_attrs): Ditto.
16786
16787         * row-indexes.h: Add definitions for *Ptr tables.
16788
16789         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
16790
16791         * metadata.c (mono_metadata_translate_token_index): New helper function to
16792         translate table indexes used in uncompressed metadata.
16793         (mono_metadata_decode_table_row): Ditto.
16794         (mono_metadata_decode_table_row_col): Ditto.
16795
16796         * metadata.c: Add table schema for *Ptr tables.
16797
16798         * class.c loader.c: Use the new helper function to access the affected metadata
16799         tables.
16800         
16801         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
16802         #38532.
16803         
16804 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
16805
16806         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
16807         sequences which can be unbounded in size. Fixes #79583.
16808
16809 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
16810
16811         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
16812         static initialization.
16813
16814         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
16815
16816         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
16817
16818         * domain.c (mono_domain_free): Free up type_init_exception_hash.
16819
16820         * object.c (mono_runtime_class_init): Implement correct semantics when a static
16821         ctor fails, i.e. throw the same exception on subsequent accesses.
16822         
16823 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
16824
16825         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
16826         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
16827         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
16828         Handle marshalling of interfaces and VARIANTs contained in structs.
16829         
16830         Code is contributed under MIT/X11 license.
16831         
16832 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
16833
16834         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
16835         
16836         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
16837         mempool.
16838
16839 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16840
16841         * console-io.c: ignore previous SIGINT handler.
16842
16843 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
16844
16845         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
16846         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
16847         #79460, #79461, #79485.
16848
16849         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
16850
16851         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
16852         #79217.
16853
16854 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
16855
16856         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
16857         could be generated from it.
16858
16859 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
16860
16861         * rand.c: fix read loop to correctly handle EINTR.
16862
16863 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16864
16865         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
16866         internal calls are defined to keep methods closer to the declaring
16867         type and allow a significant reduction in runtime relocations and
16868         memory usage.
16869
16870 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
16871
16872         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
16873         exception message to have FileNotFoundException use the default
16874         assembly load error message. Fixes bug #79426.
16875         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
16876
16877 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16878
16879         * threadpool.c: (start_thread_or_queue) use the root domain when
16880         creating the thread instead of the async object one.
16881
16882 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
16883
16884         * class.c, object.c, class-internals.h, reflection.c:
16885         for arrays, store element_size inside MonoClass (speedup
16886         for array object creation).
16887
16888 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
16889
16890         * icall.c: fixed CodeBase to use the file name and not the module
16891         name (bug #79365).
16892
16893 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
16894
16895         * mono-debug.c, mono-debug.h: export find_method as
16896         mono_debug_find_method ().
16897
16898 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16899
16900         * debug-helpers.c, class-internals.h: added a few functions useful
16901         when debugging under gdb.
16902
16903 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16904
16905         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
16906         characters that need special handling.
16907
16908 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
16909
16910         * mono-config.c: make the os/cpu specification more flexible,
16911         allowing lists and negation.
16912
16913 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
16914
16915         * marshal.c: COM Interop fixes. Handle case where method->klass.
16916         is interface. Handle BSTR/MonoString when null. Use CDECL as 
16917         calling convention on non-windows platforms. This is for
16918         compatibility with XPCOM and MainWin COM.
16919         
16920         Code is contributed under MIT/X11 license.
16921         
16922
16923 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
16924
16925         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
16926         correctly. Fixes #79217.
16927
16928         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
16929
16930 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
16931
16932         * mono-config.c: allow both an os and cpu attribute for dllmap
16933         and dllentry elemnets to enable a single config file to be used
16934         for multiple architectures.
16935
16936 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
16937
16938         * loader.c: MonoLoaderError was cleared too soon on load failure.
16939         Fixes bug #79424.
16940
16941 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
16942
16943         * icall.c: use the defining class vtable when accessing a
16944         static field, not a pobblibly derived class.
16945
16946 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
16947
16948         * icall.c string-icalls.c: Remove references to unicode.h.
16949
16950         * unicode.h unicode.c Makefile.am: Remove these unused source files.
16951
16952         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
16953
16954         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
16955         indicating the image where custom marshaller types should be looked up.
16956         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
16957         custom marshallers, instead of corlib. Fixes #79425.
16958
16959 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
16960
16961         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
16962
16963 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
16964
16965         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
16966         Implement Environment.ProcessorCount.
16967         
16968         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
16969         Implement Environment.ProcessorCount.
16970         
16971         * icall.c: 
16972         Add Environment.ProcessorCount icall.
16973         
16974         Patch by Jason McFall.
16975
16976 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16977
16978         * assembly.c: don't append .exe/.dll when the filename already contains
16979         one of those extensions.
16980
16981 2006-09-12  Martin Baulig  <martin@ximian.com>
16982
16983         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
16984         to array interfaces.
16985
16986 2006-09-11  Martin Baulig  <martin@ximian.com>
16987
16988         * reflection.c (mono_image_build_metadata): Create the
16989         MethodImpl's after emitting all types and methods, so we don't
16990         need another fixup pass for them.
16991
16992 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
16993
16994         * class.c (mono_class_from_name_case): Fix regression introduced by the last
16995         change.
16996
16997 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
16998
16999         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
17000         unload.
17001
17002 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
17003
17004         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
17005         args is not set. Fixes #78926.
17006
17007 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
17008
17009         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
17010
17011         * image.c (load_class_names): Move this to class.c, and rename it to 
17012         'mono_image_init_name_cache'.
17013         (load_modules): Fix a warning.
17014
17015         * class.c icall.c image.c: Initialize image->name_cache lazily.
17016
17017         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
17018         on its name using information in the AOT file.
17019
17020         * class.c (mono_class_from_name): Use the new hook function.
17021
17022 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
17023
17024         * reflection.c (mono_param_get_objects): Handle enum default parameter values
17025         correctly.
17026
17027         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
17028         Fixes #79289.
17029         
17030 2006-09-06  Martin Baulig  <martin@ximian.com>
17031
17032         * icall.c (mono_lookup_internal_call): Small fix.
17033
17034 2006-09-05  Raja R Harinath  <rharinath@novell.com>
17035
17036         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
17037         double g_free.
17038
17039 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
17040
17041         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
17042         when --debug is specified.
17043
17044 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
17045
17046         * class.c (setup_generic_array_ifaces): Fix a warning.
17047
17048 2006-09-04  Miguel de Icaza  <miguel@novell.com>
17049
17050         * Temporarily remove the patch to assemly.c that checks the
17051         assembly versions as it breaks our gacutil.
17052
17053 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
17054
17055         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
17056
17057         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
17058         a net 1.0 runtime.
17059
17060         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
17061         created using the default ctor. Fixes #79152.
17062         (mono_string_builder_to_utf16): Ditto.
17063
17064 2006-09-01  Martin Baulig  <martin@ximian.com>
17065
17066         Fix handling of the generic array interfaces.
17067
17068         * class-internals.h
17069         (MonoDefaults): Removed `generic_array_class' and added
17070         `generic_ilist' class.
17071
17072         * class.c
17073         (mono_bounded_array_class_get): Add the new generic array interfaces.
17074         (setup_generic_array_ifaces): New static method; create vtable
17075         entries for each method in the generic array interfaces.
17076
17077         * metadata.c
17078         (select_container): Allow "parent-less" generic methods.
17079
17080         * marshal.c
17081         (mono_marshal_get_generic_array_helper): New public method.
17082
17083         * icall.c
17084         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
17085         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
17086         moved the interncall into System.Array.
17087
17088 2006-09-01  Raja R Harinath  <rharinath@novell.com>
17089
17090         A few more cases of avoiding work on types with ->byref set.
17091         Has the real fix for #79238
17092         * icall.c (is_generic_parameter): New helper.
17093         (ves_icall_Type_GetGenericParameterPosition): Use it.
17094         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
17095         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
17096         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17097         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
17098         reference types.
17099         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
17100         reference types.
17101         (ves_icall_Type_get_IsGenericInstance): Likewise.
17102         (ves_icall_Type_get_IsGenericType): Likewise.
17103
17104 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
17105
17106         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
17107         class if possible.
17108
17109         * mempool.h (mono_mempool_get_allocated): New helper function.
17110
17111         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
17112         change.
17113
17114         * mempool.c: Fix warnings and the calculation of stats.
17115
17116         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
17117
17118         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
17119
17120         * loader.c (mono_get_method_from_token): Update method_count stat.
17121
17122         * class-internals.h (MonoStats): Add some stats.
17123
17124 2006-08-31 Robert Jordan  <robertj@gmx.net>
17125
17126         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
17127         with managed variants.
17128         All code is contributed under the MIT/X11 license.
17129         
17130 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
17131
17132         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
17133         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
17134
17135         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
17136
17137         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
17138         with cycles in classes.
17139
17140         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
17141
17142         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
17143         missing a [MarshalAs] directive. Fixes #79203.
17144
17145         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
17146         klass->marshal_info. Fixes #79217.
17147
17148 2006-08-30  Martin Baulig  <martin@ximian.com>
17149
17150         Committing a patch from Joachim Ante <joe@otee.dk>:
17151         Add support for binary data symbol stores.
17152
17153         * debug-mono-symfile.c
17154         (mono_debug_open_mono_symbol_file): Renamed into
17155         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
17156         arguments.
17157
17158         * mono-debug.c
17159         (mono_debug_open_image): Added `raw_contents' and `size' args.
17160         (mono_debug_init_2_memory): New public function.
17161
17162 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
17163
17164         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
17165
17166 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17167
17168         * appdomain.c: implement support for ShadowCopyFiles.
17169
17170 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
17171
17172         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
17173         when value is NULL (and should remove CID #51).
17174
17175 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17176
17177         * image.c: moved 2 functions to ../utils.
17178
17179 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
17180
17181         * gc.c: cope with the target object of a GC handle being NULL
17182         (bug #78877).
17183
17184 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
17185
17186         * class.c: recursively check parent's explicit implementations
17187         of interface methods (fixes bug #79125).
17188
17189 2006-08-19  Miguel de Icaza  <miguel@novell.com>
17190
17191         * filewatcher.c: Avoid warnings when building, do not redefine
17192         constants that are defined.
17193
17194         Remove warnings.
17195
17196 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17197
17198         * image.c: don't fail when the link points to an absolute path.
17199
17200 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
17201
17202         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
17203         Fix CID #3.
17204
17205 2006-08-17  Miguel de Icaza  <miguel@novell.com>
17206
17207         * image.c (full_path): A new method used to obtain the actual path
17208         of an assembly even in the presence of symbolic links.  
17209
17210         This is necessary for the case where we are running a binary that
17211         has been GACed, but we are using the "published" path name
17212         ($prefix/mono/1.0/blah.exe) which happens to point to the real
17213         file in the GAC.
17214
17215         This was the source of the failure for the `xsp' command with the
17216         recent AppDomain changes, as far as the runtime was concerned,
17217         there were two different assemblies: $prefix/mono/1.0/blah.exe and
17218         $prefix/mono/gac/blah/version/blah.exe.
17219
17220         (do_mono_image_open): use full path
17221
17222 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17223
17224         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
17225
17226 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
17227
17228         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
17229         domain_id is supplied. Fix CID #241 and corlib's unit tests.
17230
17231 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17232
17233         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
17234         small structures. Fixes #78990.
17235
17236 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17237
17238         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
17239
17240         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
17241
17242 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17243
17244         * appdomain.c:
17245         * marshal.c: don't load all the assemblies from a domain into newly
17246         created ones. The new domains might have different rules and load
17247         assemblies from different locations. Fixes bug #76757.
17248
17249         Patch by Lluis. Conflicts resolved by Brian Crowell.
17250
17251 2006-08-16  Alp Toker  <alp@atoker.com>
17252
17253         * socket-io.c: First half of the fix for #79084.
17254         Set sa_size to the length of the content, not that of the struct.
17255         Don't add NULL suffix to the content, this should be done in
17256         managed code if needed.
17257
17258 2006-08-14  Raja R Harinath  <rharinath@novell.com>
17259
17260         Fix part of #79012
17261         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
17262         mono_metadata_parse_type returns NULL.
17263
17264 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
17265
17266         * normalization-tables.h : new file for string normalization data.
17267         * locales.c, locales.h, icall.c :
17268           added load_normalization_resource() for string normalization,
17269           and icall as well.
17270         * Makefile.am : added normalization-tables.h to the sources.
17271
17272 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
17273
17274         * marshal.c: Add more helper functions to reduce code duplication and use them
17275         everywhere.
17276
17277 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
17278
17279         * marshal.c: Fix non-x86 stdcall warnings.
17280         
17281         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
17282         them everywhere.
17283
17284 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
17285
17286         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
17287         type check on multi-dimensional arrays. Fixes #79000.
17288
17289 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
17290
17291         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
17292         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
17293         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
17294         * class-internals.h: add is_com_object to class structure.
17295         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
17296         null checks to COM object marshalling. Fix .ctor call on RCW.
17297         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
17298         
17299         All code is contributed under the MIT/X11 license.
17300
17301 2006-08-09  Dick Porter  <dick@ximian.com>
17302
17303         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
17304         racing mono_monitor_allocator_lock() somewhere, so don't delete
17305         the critical section for now.  Found by running and exiting
17306         monodevelop.
17307
17308 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
17309
17310         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
17311         (ves_icall_System_ComObject_FindInterface): Ditto.
17312         (ves_icall_System_ComObject_CacheInterface): Ditto.
17313
17314         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
17315         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
17316
17317 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17318
17319         * threadpool.c: treat pipes from process asynchronous reads as sockets
17320         when reading from them, so we get select/poll or epoll to wait for
17321         data.
17322
17323 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
17324
17325         * loader.c: Fix a typo (CID #233) in the null check.
17326
17327 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
17328
17329         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
17330         Hopefully fixes #78949.
17331         
17332         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
17333         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
17334         bytes. Fixes #78972.
17335
17336 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17337
17338         * filewatcher.c: we need to set errno here.
17339
17340 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17341
17342         * filewatcher.c: let Win32Exception get the error value.
17343
17344 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17345
17346         * filewatcher.c: translate errno into win32 errors for Win32Exception
17347         to know what happened.
17348
17349 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
17350
17351         * threadpool.c: Fix more warnings.
17352
17353         * assembly.c (search_loaded): Fix warnings.
17354
17355         * threadpool.c (mono_thread_pool_finish): Fix warnings.
17356         (mono_async_invoke): Ditto.
17357
17358 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
17359
17360         * object.c (mono_remote_class_vtable): Need to create proxy vtable
17361         entries for __ComObject type in addition to ComImport types.
17362         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
17363         about hash table.
17364         
17365         All code is contributed under the MIT/X11 license.
17366
17367 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
17368
17369         * image.c: avoid tentative loading of modulerefs that contain
17370         no metadata (P/Invoke library names).
17371
17372 2006-07-28  Dick Porter  <dick@ximian.com>
17373
17374         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
17375         mono_loader_lock() somewhere, so don't delete the critical section
17376         for now.  Found by running and exiting monodevelop.
17377
17378 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17379
17380         * filewatcher.c: define the inotify syscalls when we're building on
17381         linux and have sys/syscall.h. The build system might not have support
17382         for inotify but the target system might have it.
17383
17384 2006-07-26  Miguel de Icaza  <miguel@novell.com>
17385
17386         * domain.c: Documentation updates.
17387
17388         * loader.c (mono_free_method): Do not release the method
17389         information if we are being profiled, as profilers will use this
17390         information at shut down to present some data to the user.
17391
17392         This is needed so that the profiler does not crash, as the
17393         profiler tends to keep MonoMethods around, and they might become
17394         invalid if we free these.
17395
17396         (mono_get_method_constrained): Return the original CIL stream
17397         method as well, so verification can be performed against it.
17398
17399 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17400
17401         * filewatcher.[ch]: support for inotify file system watcher.
17402         * icall.c: add new internal calls for the inotify file system watcher.
17403
17404 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17405
17406         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
17407         #78888.
17408
17409 2006-07-20  Dick Porter  <dick@ximian.com>
17410
17411         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
17412         warning.
17413
17414 2006-07-20  Dick Porter  <dick@ximian.com>
17415
17416         * threads.c (start_wrapper): Do the thread cleanup while we still
17417         hold a reference to its object.  Fixes bug 78123.
17418
17419 2006-07-18  Kornél Pál  <kornelpal@gmail.com>
17420
17421         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
17422         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
17423           "managed-to-managed".
17424         * icall.c: Redirect string constructors that take sbyte* to
17425           ves_icall_System_String_ctor_RedirectToCreateString.
17426         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
17427           to CreateString () methods with matching signature.
17428         * reflection.c: Use original security informations for
17429           MONO_WRAPPER_MANAGED_TO_MANAGED.
17430         * security-manager.c: Use original security informations for
17431           MONO_WRAPPER_MANAGED_TO_MANAGED.
17432         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
17433           that is a placeholder and only its address should be used.
17434         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
17435           that is a placeholder and only its address should be used.
17436
17437 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
17438
17439         Begin implementing COM Interop.
17440         * appdomain.c: Increment corlib version.
17441         * class.c: Set ComImport classes' parent to __ComObject.
17442         * loader.c: Mark cominterop methods as such.
17443         * domain.c: Add __ComObject class to MonoDefaults structure.
17444         * image.c: Add 2 hashtables to the image for COM Interop related methods
17445         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
17446         using the mempool allocator
17447         
17448         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
17449         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
17450         declaration for mono_metadata_type_dup_mp.
17451         
17452         * debug-helpers.c: Added strings for two additional wrapper types
17453         * object.c: Create proxy objects for ComImport classes
17454         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
17455         and added __ComObject class to MonoDefaults structure.
17456         
17457         * object-internals.h: Finish MonoRealProxy definition, and add definition of
17458         MonoComInteropProxy and MonoComObject.
17459         
17460         * marshal.c: Added support for COM Interop
17461         (signature_cominterop): Converts managed signature to corresponding
17462         unmanaged COM signature.
17463         (cominterop_get_function_pointer): gets unmanaged function pointer via
17464         COM object vtable
17465         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
17466         (cominterop_get_method_interface): returns interface type that method is defined on
17467         (mono_mb_emit_cominterop_call): emits native call to function pointer
17468         gotten from vtable
17469         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
17470         that matches signature of unmanaged function.
17471         (cominterop_get_native_wrapper): wrapper around adjusted method call.
17472         (cominterop_get_invoke): forwards call from proxy to __ComObject
17473         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
17474         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
17475         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
17476         
17477         * marshal.h: Added Marshal icall declarations.
17478         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
17479         so we can access them in finalizer
17480         
17481 2006-07-14  Dick Porter  <dick@ximian.com>
17482
17483         * object.c (mono_type_initialization_cleanup): Fix a race
17484         condition by temporarily commenting out the critical section
17485         deletion.
17486
17487 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
17488
17489         * reflection.c (create_custom_attr): Fix some warnings.
17490         (create_custom_attr_data): Ditto.
17491         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
17492         types. Fixes #78855.
17493
17494 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
17495
17496         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
17497
17498         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
17499
17500 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
17501
17502         * reflection.c (resolve_object): Add support for DynamicMethod.
17503
17504         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
17505         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
17506
17507 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
17508
17509         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
17510         don't leak GPtrArray's pdata has we have no use (nor free) for it.
17511
17512 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
17513
17514         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
17515         Fixes #77888.
17516
17517 2006-06-30  Raja R Harinath  <rharinath@novell.com>
17518
17519         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
17520         slightly: remove a shadow local variable.
17521
17522 2006-06-29  Raja R Harinath  <rharinath@novell.com>
17523
17524         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
17525         definition that introduces the virtual function slot.
17526         Also fix Coverity #105.
17527
17528 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
17529
17530         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
17531         for dynamic assemblies. Fixes #78724.
17532
17533 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
17534
17535         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
17536         Fixes #78722.
17537
17538 2006-06-21  Martin Baulig  <martin@ximian.com>
17539
17540         * reflection.c
17541         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
17542         fixes #76484.
17543
17544 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
17545
17546         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
17547
17548 2006-06-20  Raja R Harinath  <rharinath@novell.com>
17549
17550         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
17551         nor TYPEREFs.
17552         * class.c (mono_class_create_from_typespec): Add 'context' argument.
17553         Inflate result if necessary.
17554         (mono_class_get_full): Remove old version.  Rename from
17555         'mono_class_get' and add 'context' argument.  Pass it to
17556         ..._create_from_typespec.
17557         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
17558         (mono_ldtoken): Revert change below.
17559
17560 2006-06-20  Martin Baulig  <martin@ximian.com>
17561
17562         * class.c (mono_ldtoken): Don't pass the generic context to
17563         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
17564
17565 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
17566
17567         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
17568         and later freeing it. Fixes #78638.
17569
17570 2006-06-15  Miguel de Icaza  <miguel@novell.com>
17571
17572         * icall.c (mono_class_get_throw): Revert over-zealous error
17573         throwing, the caller for mono_class_get_throw will cope with
17574         errors when classes are not properly initialized already.
17575
17576         The code still copes with loader exceptions though.
17577
17578         Fixes the regression in reftype1 and reftype3 from the CAS tests.
17579         
17580 2006-06-14  Miguel de Icaza  <miguel@novell.com>
17581
17582         Fixes the `make run1' version of RuntimeAbort (to be commited,
17583         source is in Bugzilla).
17584         
17585         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
17586         FALSE on class loading failure instead of returning true.
17587
17588         * class.c (mono_class_create_from_typedef): It is possible for
17589         mono_metadata_interfaces_from_typedef_full to fail if a class is
17590         not found, cope with this.
17591         
17592
17593 2006-06-14  Dick Porter  <dick@ximian.com>
17594
17595         * socket-io.c: 
17596         * process.c: Fix a bunch of signed/unsigned warnings from gcc
17597         4.1.1
17598
17599 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
17600
17601         * culture-info-table.h : oops, forgot to make it nsync with r61548.
17602
17603 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17604
17605         * icall.c: Another fix for building mono in Visual Studio.
17606
17607 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17608
17609         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
17610         
17611 2006-06-09  Martin Baulig  <martin@ximian.com>
17612
17613         * debug-mono-symfile.c: Put this back and really fix it this
17614         time. Sorry for all the trouble.
17615
17616 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
17617
17618         * icall.c (mono_class_get_throw): Fix a warning.
17619         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
17620         ReflectionTypeLoadException if needed. Fixes #78606.
17621
17622         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
17623         (mono_class_init): Ditto.
17624
17625         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
17626         ref_only exceptions.
17627         (mono_loader_clear_error): Make this work even if there is no error.
17628
17629 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
17630
17631         * object-internals.h marshal.c marshal.h icall.c: Implement method 
17632         Marshal.GetComSlotForMethodInfo using internal call.
17633
17634 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
17635
17636         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
17637         a function for signalling it.
17638
17639         * class.c (mono_class_from_typeref): Use the new kind of loader error when
17640         a referenced assembly is not found.
17641
17642         * loader.c (mono_loader_error_prepare_exception): Add support for 
17643         LOADER_ERROR_ASSEMBLY. Fix formatting.
17644
17645 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
17646
17647         * domain.c appdomain.c class-internals.h marshal.c: Add support 
17648         for VARIANT marshalling on windows and increment corlib version
17649         since Variant struct was added.
17650
17651 2006-06-03  Miguel de Icaza  <miguel@novell.com>
17652
17653         * debug-mono-symfile.c: Revert Martin's previous patch which broke
17654         stack trace line information:
17655
17656         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
17657         (Martin) when looking up B which is between A and C, return A not C.
17658
17659         Bug is #78573.
17660
17661         Thanks to Alexander Olk for tracking this down.
17662
17663 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
17664
17665         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
17666         
17667         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
17668         avoid clobbering its value.
17669         (mono_string_to_lpstr): Fix a warning on windows.
17670
17671 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17672
17673         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
17674
17675         * reflection.c loader.c: Removed references to 'dummy' flag.
17676
17677         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
17678
17679         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
17680         it gets GC tracking.
17681
17682         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
17683         GC tracking.
17684         
17685         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
17686
17687         * marshal.c threadpool.c: Update callers of mono_async_result_new.
17688
17689         * appdomain.c: Bump corlib version.
17690
17691 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17692
17693         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17694         CEE_STIND_REF when working with object references.
17695
17696 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17697
17698         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
17699         Fixes #78539.
17700
17701 2006-05-30  Miguel de Icaza  <miguel@novell.com>
17702
17703         * loader.c (method_from_memberref): Fix argument value for
17704         mono_loader_set_error_method_load (I was passing the MonoClass
17705         instead of the class name char *).
17706
17707 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17708
17709         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17710         CEE_STIND_REF when working with object references.
17711
17712 2006-05-30  Martin Baulig  <martin@ximian.com>
17713
17714         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
17715         mono_method_full_name() change and replace the ':' with a '.'
17716         here.
17717
17718 2006-05-30  Martin Baulig  <martin@ximian.com>
17719
17720         * debug-mono-symfile.c
17721         (mono_debug_symfile_lookup_location): Fix the algorithm:
17722         when looking up B which is between A and C, return A not C.
17723
17724 2006-05-29  Martin Baulig  <martin@ximian.com>
17725
17726         * mono-debug.h
17727         (MonoDebugMethodInfo): Make the typedef public.
17728         (MonoDebugSourceLocation): New public struct.
17729
17730         * mono-debug.c
17731         (mono_debug_source_location_from_address): Removed.
17732         (mono_debug_source_location_from_il_offset): Removed.
17733         (mono_debug_il_offset_from_address): Removed.
17734         (mono_debug_address_from_il_offset): Removed.
17735         (mono_debug_lookup_method): New public function.
17736         (mono_debug_lookup_source_location): New public function; replaces
17737         the old mono_debug_source_location_from_*() functions; see the
17738         inline documentation.
17739         (mono_debug_free_source_location): New public function.
17740         (mono_debug_print_stack_frame): New public function; see the
17741         inline documentation.
17742
17743         * debug-mono-symfile.c
17744         (mono_debug_find_source_location): Renamed into
17745         mono_debug_symfile_lookup_location(); only take a
17746         `MonoDebugMethodInfo *' and an `offset' argument; added inline
17747         documentation.
17748         (mono_debug_find_method): Renamed into
17749         mono_debug_symfile_lookup_method().
17750
17751 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
17752
17753         * assembly.c (mono_assembly_open_full): Dont overwrite the status
17754         returned by mono_image_open_full ().
17755
17756         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
17757         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
17758         #78517.
17759
17760         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
17761         #78518.
17762
17763 2006-05-27  Miguel de Icaza  <miguel@novell.com>
17764
17765         * class.c (mono_class_from_typeref): handle missing images
17766         earlier, deals with bug #78418.   Refactor code; 
17767
17768         Fix a warning introduced in my previous commit (some stale code
17769         from before I revisited my patch).
17770
17771         * class.c (mono_class_create_from_typedef): On failure, remove the
17772         class from the MonoImage->class_cache as the class is not
17773         initialized;   Fixes the leak pointed out by Paolo.
17774
17775 2006-05-25  Dick Porter  <dick@ximian.com>
17776
17777         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
17778         DeleteCriticalSections until I figure out which one may still be
17779         sometimes locked when mono_thread_cleanup is called.
17780
17781 2006-05-24  Dick Porter  <dick@ximian.com>
17782
17783         * threads.c (mono_thread_cleanup): Move the threading cleanup out
17784         of mono_thread_manage and back into its own function, so it can be
17785         called after the finalizer thread has finished.
17786
17787         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
17788
17789 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
17790
17791         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
17792         Fixes #78495.
17793
17794         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
17795         with non-blittable elements.
17796         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
17797
17798 2006-05-24  Martin Baulig  <martin@ximian.com>
17799
17800         * mono-debug-debugger.h (MonoDebuggerEvent): Added
17801         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
17802
17803         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
17804         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
17805         `mono_debugger_event_handler' to NULL.
17806
17807 2006-05-24  Martin Baulig  <martin@ximian.com>
17808
17809         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
17810
17811 2006-05-24  Martin Baulig  <martin@ximian.com>
17812
17813         * mono-debug-debugger.h
17814         (mono_debugger_create_notification_function): Added
17815         `MonoCodeManager *' argument.
17816
17817 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
17818
17819         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
17820
17821 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
17822
17823         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
17824         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
17825         implementation.
17826
17827 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
17828
17829         * icall.c: precise GC support: objects can't be stored in unmanaged
17830         memory anymore, even if they are kept alive by other references: since
17831         they can move the GC needs to be able to always find them.
17832
17833 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
17834
17835         * object.c: precise GC support for static fields. Support
17836         for moving GCs: write barriers and pinned allocation for interned
17837         strings.
17838
17839 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
17840
17841         * domain.c, domain-internals.h: precise GC support for the MonoDomain
17842         structure.
17843
17844 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
17845
17846         * class.c, gc.c: sgen and precise GC updates.
17847
17848 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
17849
17850         * marshal.h, marshal.c: added write barrier wrapper and precise type
17851         fixes.
17852
17853 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
17854
17855         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
17856         support.
17857
17858 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
17859
17860         * reflection.c: precise and sgen GC updates.
17861
17862 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
17863
17864         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
17865
17866 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
17867
17868         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
17869
17870 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
17871
17872         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
17873         MONO_TYPE_OBJECT. Fixes #78462.
17874
17875 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
17876
17877         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
17878         and blittable types.
17879
17880 2006-05-17  Miguel de Icaza  <miguel@novell.com>
17881
17882         * class.c (mono_class_get_exception_for_failure): Implement parts
17883         of a TODO: if the loader error is set (instead of the class
17884         error), we return a Loader exception that can be properly thrown
17885         elsewhere.
17886
17887         This was exposed by some Winforms 2.0 code that I tried to run
17888         (Atsushi pointed me to it).
17889
17890 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
17891
17892         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
17893         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
17894         
17895         * marshal.c (emit_marshal_vtype): Add limited support for 
17896         UnmanagedType.LPStruct. Fixes #78427.
17897
17898         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
17899         Applied a patch from kangaroo to fix #77523.
17900
17901 2006-05-17  Martin Baulig  <martin@ximian.com>
17902
17903         * threads.c
17904         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
17905         (debugger_thread_created): Removed.
17906         (debugger_thread_exited): Removed.
17907
17908 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
17909
17910         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
17911
17912         * object-internals.h (MonoReflectionResource): Sync with managed version.
17913
17914 2006-05-12  Wade Berrier <wberrier@novell.com>
17915
17916         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
17917
17918 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
17919
17920         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
17921         functions try to allocate from the image mempool.
17922
17923 2006-05-12  Dick Porter  <dick@ximian.com>
17924
17925         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
17926
17927 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
17928
17929         * object.c: The FieldGetter and FieldSetter methods require the full
17930         name of the class, not only the name. Fixes bug #78277.
17931
17932 2006-05-11  Miguel de Icaza  <miguel@novell.com>
17933
17934         * loader.c (method_from_memberref): Do not pass the NULL klass to
17935         mono_loader_set_error_() methods.  Pass the non-NULL value
17936         (class). 
17937
17938 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
17939
17940         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
17941         (mono_assembly_close): Null out assembly->image->references after freeing it.
17942
17943         * image.c (mono_image_close): Free image->references.
17944         
17945         * reflection.c (mono_image_basic_init): Fix a small memory leak.
17946
17947 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
17948
17949         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
17950         before checking if it's NULL (g_assert).
17951
17952 2006-05-10  Martin Baulig  <martin@ximian.com>
17953
17954         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
17955         I thought I already killed that two months ago, but now it somehow reappeared.
17956
17957 2006-05-10  Martin Baulig  <martin@ximian.com>
17958
17959         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
17960
17961 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
17962
17963         * reflection.c: Allocate memory for dynamically created methods in the image
17964         mempools.
17965
17966 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
17967
17968         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
17969         don't use the ad pointer before checking if it's NULL (g_assert).
17970
17971 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
17972
17973         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
17974         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
17975
17976         * marshal.c: Allocate all signatures from mempools.
17977
17978         * marshal.c: Allocate some more signatures from mempools.
17979
17980 2006-05-09  Miguel de Icaza  <miguel@novell.com>
17981
17982         * object.c (mono_load_remote_field): The code used to provide a
17983         temporary variable for returning results if the user did not
17984         provide a result pointer.  But our temporary variable was allocted
17985         on the satck.
17986
17987         Fix calling code to always pass a result area.   Coverity ID 103.
17988
17989 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
17990
17991         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
17992         value, not the old. Fixes #78312.
17993         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
17994
17995         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
17996         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
17997         per-image cache.
17998
17999         * assembly.c (mono_assembly_close): Free image->references.
18000
18001         * assembly.c (mono_assembly_names_equal): Fix a warning.
18002         (mono_assemblies_cleanup): Cleanup more global data.
18003
18004         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
18005
18006         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
18007         ptr_cache and image->modules.
18008
18009         * image.c (mono_image_init): Allocate array_cache lazily.
18010         
18011 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18012
18013         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
18014         behavior was changed recently and has bad side effects.
18015
18016 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
18017
18018         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
18019         
18020         * assembly.c (mono_assembly_close): Remove a debug printf.
18021
18022         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
18023
18024         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
18025         to also allow for temporary references between mono_image_open ()/close ().
18026
18027         * domain.c (get_runtimes_from_exe): Add a FIXME.        
18028
18029 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
18030
18031         * marshal.c: Fix support for dynamic methods.
18032
18033         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
18034
18035         * marshal.c (mono_marshal_cleanup): New cleanup function.
18036
18037         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
18038         image mempools.
18039
18040         * class.c (mono_class_init): Fix leaking class->nested_classes.
18041
18042         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
18043
18044         * image.c (mono_image_init): Initialize the new cashes.
18045
18046         * image.c (mono_image_close): Destroy the new cashes.
18047
18048         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
18049
18050         * mempool.c (mono_mempool_strdup): New helper function.
18051
18052         * class-internals.h: Add prototype for mono_loader_unlock ().
18053
18054         * domain.c (mono_jit_info_table_find): Fix a warning.
18055         (mono_debugger_check_runtime_version): Ditto.
18056
18057         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
18058         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
18059         functions to these modules.
18060
18061         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
18062         metadata modules.
18063         
18064         * marshal.c (mono_free_bstr): Fix a warning.
18065
18066         * assembly.c (mono_assembly_open_full): Fix another small leak.
18067
18068         * object.c: Fix some unload leaks in the remoting code.
18069
18070         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
18071         function.
18072
18073         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
18074
18075         * reflection.c: Fix some unload leaks in dynamic assemblies.
18076
18077 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
18078
18079         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
18080         * marshal.h: Add BSTR support on Win32
18081         * icall.c: Add BSTR icalls
18082         * metadata.h: Add BSTR enums
18083
18084 2006-04-28  Miguel de Icaza  <miguel@novell.com>
18085
18086         Work to catch the crash from #76795 and turn it into an
18087         exception.   As I stubbed out pieces of the VisualBasic support,
18088         I found a number of places where the code was failing and I added
18089         checks to those places. 
18090         
18091         * metadata.c (do_mono_metadata_parse_generic_class): Make this
18092         function return a status code.  If we fail to parse the signature
18093         from mono_metadata_parse_generic_inst, return FALSE.
18094
18095         * loader.c (mono_get_method_from_token): If we fail to load the
18096         method (mono_class_get) return NULL.   
18097
18098         * (method_from_memberref): Return NULL if we are unable to parse
18099         the method signature
18100
18101         (mono_loader_error_prepare_exception): Since we now use the
18102         loader_error flag internally to stop processing, and obtaining
18103         exceptions that might be thrown will walk this code path the
18104         proper way of going from a MonoLoaderError into a
18105         MonoException was convoluted.   This new routine encapsulates the
18106         process of turning the error into an exception and *clearing* the
18107         error afterwards.
18108         
18109 2006-04-27  Miguel de Icaza  <miguel@novell.com>
18110
18111         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
18112         with missing assemblies), and to cope with:
18113
18114                 * Missing fieldref from a non-existing assembly.
18115                 * Missing methodref from a non-existing assembly.
18116
18117         The first batch of work to address *some* of the issues from 76661.
18118         
18119         * object.c (mono_class_create_runtime_vtable): If we fail to
18120         initialize the class raise the exception here. 
18121
18122         * metadata.c (mono_class_get_overrides_full): If any methods fail
18123         to load return the failure to the caller.
18124
18125         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
18126         flagging assemblies that failed to load.   
18127
18128         Do not crash if we are unable to load the assembly.
18129
18130         (mono_assembly_close): Do nothing with REFERENCE_MISSING
18131         assemblies. 
18132
18133         * loader.c (mono_loader_set_error_type_load): Change the
18134         convention to always pass unallocated strings, so we make our own
18135         copies (I know our own code had duplicated strings before, but
18136         this keeps the normal conventions).
18137         (method_from_memberref): Call mono_loader_set_error_method_load
18138         for all possible failures of loading the class. 
18139         Remove assert, turn into a loader error.
18140
18141         (mono_loader_error_to_exception): Move this routine from mini
18142         (mini_loader_error_to_exception) there was no need to have that in
18143         mini. 
18144
18145         * class.c (mono_class_from_typeref): If we were not able to load
18146         the assembly with mono_assembly_load_reference, call the
18147         mono_loader_set_error_type_load to register the problem.
18148
18149         (mono_class_setup_fields): If we fail to load the type from
18150         mono_metadata_parse_type_full, call mono_class_set_failure and
18151         break from the loop.
18152
18153         If class->exception_type is set, we do not layout the fields as
18154         that might crash the runtime, and instead return (from breaking
18155         from the previous loop).
18156
18157         (mono_class_setup_vtable): This now returns a boolean indicating
18158         whether the table was properly setup.   The decision is driven by
18159         mono_class_get_overrides_full which might run into non-existing
18160         methods. 
18161         
18162         (mono_class_init): Returns TRUE on success or FALSE if there was a
18163         problem in loading the type (incorrect assemblies, missing
18164         assemblies, methods, etc).
18165
18166         When we call mono_class_setup_fields we also check for a potential
18167         error inside this call (either a class exception or a general
18168         loader exception).
18169
18170         (mono_class_create_from_typedef): If the parent fails to load
18171         (calling mono_class_get_full) return NULL.
18172         
18173         ** Important **
18174
18175         calls to mono_metadata_parse_type_full should be checked
18176         everywhere and set the mono_class_set_failure
18177         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
18178
18179         The current patch checks the places where my manually constructed
18180         tests show the errors are showing up, but we should do it
18181         everywhere. 
18182
18183         ** Important2 **
18184
18185         mono_class_init return values should be tested everywhere, like
18186         the previous case this is something that we should audit
18187         everywhere and not only on the cases exposed by the tests I
18188         created. 
18189
18190 2006-04-26  Miguel de Icaza  <miguel@novell.com>
18191
18192         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
18193         boolean parameter and instead pass the information on `options'
18194         parameter (FileOptions).
18195
18196         * icall.c: Register the new signature for MonoIO.Open.
18197
18198         * debug-helpers.c (dis_one): Trying to understand how coverity
18199         works.  Fix Run 5, item 78.
18200
18201 2006-04-26  Dick Porter  <dick@ximian.com>
18202
18203         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
18204         dereference.
18205
18206 2006-04-25  Martin Baulig  <martin@ximian.com>
18207
18208         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
18209
18210         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
18211         debugger_thread_created().
18212         (debugger_gc_push_all_stacks): Don't handle the main thread in any
18213         special way.
18214         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
18215         (mono_debugger_finalize_threads): New function; undo the effects
18216         of mono_debugger_init_threads().
18217         (mono_debugger_create_all_threads): Removed.
18218
18219 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
18220
18221         * image.c (mono_image_close): Tidy up trace messages.
18222
18223         * assembly.c (mono_assembly_close): Ditto.
18224
18225         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
18226         no longer references an already freed assembly. Fixes #78168.
18227
18228 2006-04-21  Dick Porter  <dick@ximian.com>
18229
18230         * threads.c (mono_thread_detach): Fix reference counting when
18231         detaching threads.
18232
18233 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
18234
18235         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
18236         #78155.
18237
18238 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
18239
18240         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
18241         (mono_type_to_stind): Ditto.
18242
18243         * marshal.c: Use the new helper functions to simplify code.
18244
18245         * image.c (mono_image_close): Add some code for help debug assembly unloading
18246         problems.
18247
18248         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
18249         image mempool.
18250
18251         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
18252         assembly was already loaded in another appdomain. Fixes #78083.
18253
18254 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
18255
18256         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
18257         referenced assemblies.
18258         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
18259
18260         * domain.c (mono_domain_free): Add a trace message.
18261
18262         * appdomain.c (add_assemblies_to_domain): Ditto.        
18263
18264         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
18265         field.  
18266
18267 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18268
18269         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
18270
18271 2006-04-12  Martin Baulig  <martin@ximian.com>
18272
18273         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
18274         `USE_INCLUDED_LIBGC'.   
18275
18276 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18277
18278         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
18279         the patch contains ../ and a small directory name later. Hopefully fixes
18280         #78035.
18281
18282 2006-04-10  Martin Baulig  <martin@ximian.com>
18283
18284         Clean up the debugger's thread-handling code.
18285
18286         The debugger's thread-handling code has been moved from
18287         ../mini/debug-debugger.c to threads.c.  We now iterate directly
18288         over the `threads' hash, keep track of exiting threads and also
18289         use proper locking.
18290
18291         We can now debug XSP and XSP based applications with the debugger.
18292
18293         * object-internals.h (MonoThread): Added `gpointer end_stack'.
18294
18295         * threads.h
18296         (MonoThreadCallbacks): Removed; this was only used by the debugger.
18297         (mono_install_thread_callbacks): Likewise.      
18298
18299         * threads.c (mono_thread_callbacks): Removed.
18300         (debugger_thread_created, debugger_thread_exited): New static functions.
18301         (start_wrapper): Call debugger_thread_created().
18302         (thread_cleanup): Call debugger_thread_exited().
18303         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
18304         (mono_debugger_init_threads): New public function.
18305         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
18306         iterate directly over the `threads' hash and also use proper locking.
18307
18308         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
18309
18310         * mono-debug-debugger.h
18311         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
18312
18313 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
18314
18315         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
18316         argument type=array. Fixes #78057.
18317
18318 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
18319
18320         * culture-info-table.h : regenerated. Fixed bug #69652.
18321
18322 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
18323
18324         * loader.c metadata.c: Reapply a variant r59116.
18325         
18326         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
18327
18328         * class.c (mono_class_setup_interface_offsets): New internal function.
18329
18330         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
18331         interfaces too. Fixes #77398.
18332
18333         * reflection.c (encode_cattr_value): Add support for 
18334         parameter type=object, argument type=array.
18335         (load_cattr_value): Ditto. Fixes #77916.
18336
18337         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
18338         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
18339
18340         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
18341         a byval char array and CharSet is Ansi.
18342
18343         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
18344
18345 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
18346
18347         * metadata.c: Add some locking comments.
18348         
18349         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
18350         mempool.
18351         (mono_metadata_free_method_signature): Don't free the signature itself.
18352
18353         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
18354
18355         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
18356         reference the same MonoImage.
18357         (mono_assembly_load_from_full): Add an assert.
18358
18359 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
18360
18361         * image.c (mono_image_close): Don't put the image we are about to free into the
18362         loaded_images_guid_hash.
18363
18364         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
18365         to reduce code duplication.
18366
18367         * marshal.c: Register the native functions called by this module as icalls, to
18368         somewhat centralize the creation of MonoMethodSignature's.
18369
18370         * loader.c (mono_method_signature): Add a cache for method signatures.
18371
18372         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
18373         the parameter attributes of a method.
18374         (mono_metadata_parse_method_signature_full): Refactored the computation of
18375         parameter attributes into a separate function. Also avoid one allocation in
18376         most cases.
18377
18378         * assembly.c (mono_assembly_close): Ditto.
18379
18380         * image.c (mono_image_close): Log trace messages with INFO level.
18381
18382         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
18383
18384         * image.c reflection.c: Correct reference counting of image modules.
18385         
18386         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
18387         of this function from the image mempool.
18388         
18389         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
18390         to allow more cached types to be used.
18391
18392         * mono-debug.c (mono_debug_add_method): Appled patch from
18393         David S. Miller  <davem@sunset.davemloft.net>: Access 
18394         minfo->lexical_blocks[] entry elements using read32().
18395
18396 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
18397
18398         * loader.c (mono_free_method): No longer free the method header for non-dynamic
18399         methods as it is allocated from the mempool.
18400
18401         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
18402         image mempool.
18403
18404         * metadata-internals.h: Add comments describing the reference counting scheme
18405         used for MonoImage and MonoAssembly.
18406
18407         * image.c assembly.c reflection.c: Rework reference counting of images and 
18408         assemblies so they are freed when the runtime is shut down. Free some 
18409         additional memory structures when an image is unloaded.
18410         
18411 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
18412
18413         * class.c loader.c reflection.c: Allocate more data structures in
18414         the image mempool.
18415
18416 2006-03-31  Miguel de Icaza  <miguel@novell.com>
18417
18418         * icall.c
18419         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
18420         build on pre glib 2.4 systems.
18421
18422 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
18423
18424         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
18425
18426         * icall.c: Fix some warnings.
18427
18428 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
18429
18430         * culture-info-table.h : regenerated.
18431
18432 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
18433
18434         * threads.c, object-internals.h, verify.c: changed the culture caching
18435         code to use a normal MonoArray for storage so the GC can keep track of
18436         them easily. Fixed bits of the cache logic, too and simplified the
18437         code.
18438
18439 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
18440
18441         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
18442         thread for non-Boehm GCs.
18443
18444 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
18445
18446         * domain.c, object.c, domain-internals.h: reduce the amount of memory
18447         needed to keep track of the data for static fields.
18448
18449 2006-03-29  Raja R Harinath  <rharinath@novell.com>
18450
18451         Fix #75172
18452         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
18453         for interface classes.  Use 'num_methods' instead.
18454         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
18455         before using '->vtable_size' field.
18456
18457 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
18458
18459         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
18460         doesn't contain managed pointers, so use a normal hashtable.
18461
18462 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
18463
18464         * reflection.c, class-internals.h, domain.c: fixed handling of types
18465         used as values for objects in custom attributes (bug #77915):
18466
18467 2006-03-24  Martin Baulig  <martin@ximian.com>
18468
18469         * class.c (mono_class_setup_fields): Added support for generic
18470         instances; fixes #77580.
18471
18472 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18473
18474         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
18475
18476 2006-03-24  Dick Porter  <dick@ximian.com>
18477
18478         * file-io.c (get_file_attributes): More stat macro breakage.
18479         Fixes bug 77759.
18480
18481 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
18482
18483         * profiler.c: added the file=filename option in the default profiler
18484         to output the profile data to filename.
18485
18486 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18487
18488         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
18489         bug #77877.
18490
18491 2006-03-22  Martin Baulig  <martin@ximian.com>
18492
18493         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
18494         allocated `MonoClassField *' in `fb->handle'.
18495
18496 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
18497
18498         * class.c, image.c, metadata-internals.h: implemented new mechanism to
18499         allocate interface ID to save memory and allow better ID reuse on
18500         appdomain unload. setup_generic_vtable () removal from Martin.
18501
18502 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
18503
18504         * object.h, appdomain.c, domain.c, exception.c, icall.c,
18505         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
18506         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
18507         write barriers for reference stores with managed objects accessed with
18508         C structures in the runtime and in embedding programs.
18509
18510 2006-03-20  Raja R Harinath  <rharinath@novell.com>
18511
18512         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
18513         'interface_id' and 'max_interface_id' fields of MonoClasses
18514         representing open generic types.
18515
18516 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
18517
18518         * object.h, object.c, icall.c: added functions to deal with
18519         storing valuetypes that contain references in managed objects.
18520         * reflection.c, string-icalls.c, threads.c, marshal.c: small
18521         fixes and comments around uses of mono_array_addr ().
18522
18523 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
18524
18525         * object.h, icall.c, monitor.c: object.GetHashCode ()
18526         implementation that supports the moving garbage collector.
18527
18528 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
18529
18530         * icall.c, threads-types.h, threads.c: implemented finalizer for
18531         LocalDataStoreSlot.
18532
18533 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
18534
18535         * metadata.c (mono_type_size): Add a fixme.
18536         (mono_type_stack_size): Ditto.
18537
18538         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
18539         'type_forwarders' field.
18540
18541         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
18542         attribute from net 2.0.
18543
18544         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
18545         from class.c.
18546
18547         * class.c (mono_class_setup_fields): Fix a warning.
18548         
18549         * class.c (mono_class_from_name): Add support for assemblyref entries
18550         in the EXPORTEDTYPE table.
18551
18552         * reflection.c: Add support for handling type forwarders under net 2.0.
18553
18554         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
18555         
18556 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
18557
18558         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
18559         overwriting entries in ModuleBuild->types, also clean up the code
18560         a little. Fixes #77774.
18561
18562 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
18563
18564         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
18565         load friend assembly info when present.
18566
18567 2006-03-14  Raja R Harinath  <rharinath@novell.com>
18568
18569         Fix crasher on gtest-158.cs.
18570         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
18571         the return value if the MonoClass we want is yet in an
18572         inconsistent state.
18573         * class.c (mono_class_create_from_typedef): Add an comment
18574         explaining an order dependency between mono_class_setup_parent and
18575         mono_class_setup_mono_type.
18576
18577 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
18578
18579         * class.c: documentation updates and events bug fix.
18580
18581 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
18582
18583         * class.c: some cleanup, locking fixes.
18584
18585 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
18586
18587         * class.c: fix the generics code to setup nested
18588         type info to the instantiated type (bug #77770).
18589
18590 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
18591
18592         * marshal.c: fixed a few type correctness issues.
18593
18594 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
18595
18596         * loader.c: the Set/Get/Addrtess array methods should be public.
18597
18598 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
18599
18600         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
18601         
18602         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
18603         info->wrapper.
18604
18605 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
18606
18607         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
18608
18609         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
18610
18611         * mempool.c (mono_mempool_alloc): Speed this up a bit.
18612         (mono_mempool_alloc0): Ditto.
18613
18614 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18615
18616         * socket-io.c:
18617         (create_object_from_sockaddr): it was allocating 4 extra bytes
18618         for the AF_UNIX data. Fixes bug #77747.
18619
18620 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
18621
18622         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
18623
18624 2006-03-09  Dick Porter  <dick@ximian.com>
18625
18626         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
18627         Fixes bug 76966 again.
18628
18629 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
18630
18631         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
18632         names from r57532
18633         * appdomain.c: Bumped corlib version to 48 (due to r57532)
18634
18635 2006-03-07  Martin Baulig  <martin@ximian.com>
18636
18637         * object.c
18638         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
18639
18640 2006-03-07  Martin Baulig  <martin@ximian.com>
18641
18642         * class.c
18643         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
18644         regression introduced in r56970; see gtest-252.cs.
18645
18646         * loader.c (mono_get_method_constrained): Correctly handle generic
18647         methods; see gtest-253.cs.
18648
18649 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
18650
18651         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
18652
18653 2006-03-04  Martin Baulig  <martin@ximian.com>
18654
18655         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
18656         compute the parent type at runtime, just like we're already doing
18657         it for interfaces.
18658
18659         * reflection.c
18660         (mono_reflection_bind_generic_parameters): Don't compute the
18661         parent type anymore.
18662
18663         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
18664
18665 2006-03-04  Martin Baulig  <martin@ximian.com>
18666
18667         * mono-debug-debugger.h
18668         (mono_debugger_create_notification_function): Allocate memory at
18669         runtime and return a pointer to it.
18670
18671 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
18672
18673         * assembly.c: Fix windows build.
18674         
18675         * assembly.c: Fix build.
18676
18677         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
18678
18679         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
18680         
18681 2006-03-03  Dick Porter  <dick@ximian.com>
18682
18683         * process.c
18684         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18685         Check parameters before dereferencing them.  Fixes Aaron's part of
18686         bug 77393.
18687
18688 2006-03-03  Raja R Harinath  <rharinath@novell.com>
18689
18690         Fix performance regression.
18691         * loader.c (find_method_in_class): Add 'from_class' argument.
18692         Rename 'klass' argument to 'in_class'.  The signature is compared
18693         against the method in 'in_class', and the corresponding method is
18694         returned from 'from_class'.
18695         (find_method): Walk both 'in_class' and 'from_class' in parallel.
18696         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
18697         type definition and generic instantiation in parallel.
18698         (mono_get_method_constrained): Update to changes.
18699
18700 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
18701
18702         * threads.c: make sure the domain is correct, too when doing
18703         mono_thread_attach ().
18704
18705 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
18706
18707         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
18708         windows. Fixes #77683.
18709
18710 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
18711
18712         * object.h, *: introduced specific way to set elements of an array
18713         of references to be used as write barrier. Still need to audit the
18714         uses of mono_array_addr.
18715
18716 2006-03-01  Miguel de Icaza  <miguel@novell.com>
18717
18718         * object-internals.h: New field to cache the assmebly name, patch
18719         from Tambet Ingo (tambet@ximian.com)
18720
18721 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
18722
18723         * decimal.h, class-internals.h, metadata-internals.h,
18724         file-io.h: mark a few function declarations as internal, to
18725         reduce the number of PLT entries.
18726
18727 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18728
18729         * file-io.c: fix typo in warning message.
18730
18731 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
18732
18733         * loader.c: on unix, lookup the "*A" version of a function
18734         if charset is auto as a second option before failing.
18735
18736 2006-02-28  Raja R Harinath  <rharinath@novell.com>
18737
18738         * class.h (mono_class_inflate_generic_method): Revert to two
18739         argument version.
18740         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
18741         (mono_class_inflate_generic_method_full): Add.
18742         * class.c (mono_class_inflate_generic_method_full): Rename from
18743         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
18744         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
18745         * loader.c, reflection.c: Update to changes.
18746
18747 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
18748
18749         * icall.c: const fixes and small improvements.
18750
18751 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18752
18753         * threadpool.c: for asynchronous connect(), enable the same workaround
18754         for BSD 6 as for the Mac. Fixes bug #77637.
18755
18756 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
18757
18758         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
18759         formatted classes. Fixes #77524.
18760
18761 2006-02-24  Raja R Harinath  <rharinath@novell.com>
18762
18763         * class.c (inflate_generic_type): Add a couple more
18764         micro-optimizations.
18765         (inflate_generic_context): Don't use the 'gmethod' from
18766         'inflate_with'.
18767         (mono_class_inflate_generic_method): If the method has generic
18768         parameters, but the passed-in context doesn't have a 'gmethod',
18769         create one.  Use the possibly simplified generic instantiation
18770         from the declaring class instead of the one passed in.
18771
18772 2006-02-24  Raja R Harinath  <harinath@gmail.com>
18773
18774         Make generic method signature and method header handling lazy.
18775         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
18776         (inflate_generic_header): Likewise.
18777         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
18778         parameter to avoid inflating types.
18779         (mono_get_inflated_method): Empty out.
18780         * class.h (mono_class_inflate_generic_method): Update to changes.
18781         * loader.c (mono_get_method_from_token): Don't parse signature for
18782         generic methods, nor methods of generic classes.
18783         (mono_method_signature): Rename from 'mono_method_signature'.
18784         Inflate signature on demand.
18785         (mono_method_get_header): Inflate method header on demand.
18786         * reflection.c: Update to changes.
18787
18788 2006-02-23  Raja R Harinath  <rharinath@novell.com>
18789
18790         * metadata.c (mono_metadata_inflate_generic_inst): If the
18791         instantiation is closed, don't bother expanding it in the new
18792         context.
18793         * class.c (inflate_generic_class): If the generic instantiation
18794         doesn't change after inflation, return the argument itself.
18795         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
18796         Add bounds checks.
18797         (inflate_generic_context): If neither the generic class nor the
18798         generic method instantiations change, return the original context.
18799         * reflection.c (mono_method_get_object): Do
18800         'mono_get_inflated_method' before accessing the ->klass field.
18801         (inflate_mono_method): Don't create a MonoGenericMethod unless
18802         necessary.
18803         (inflate_method): Don't pass a constructed type as the declaring
18804         type of a methodbuilder.
18805
18806 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
18807
18808         * object.c: fix memory overwrite.
18809
18810 2006-02-22  Dick Porter  <dick@ximian.com>
18811
18812         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
18813         it doesn't work any more.
18814         (mono_threads_request_thread_dump): Fix unused variable warnings.
18815
18816 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
18817
18818         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
18819         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
18820         the public header file.
18821
18822 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
18823
18824         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
18825
18826 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
18827
18828         * class-internals.h, object.c: reduce the size of MonoVTable
18829         and store the interface_offsets array at negative offsets.
18830
18831 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
18832
18833         * metadata.c: tweak table descriptors data structures to reduce
18834         size and runtime relocations.
18835
18836 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
18837
18838         * marshal.c: fix some types and opcodes to be type-safe
18839         in marshaling wrappers.
18840
18841 2006-02-21  Ankit Jain  <jankit@novell.com>
18842
18843         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
18844
18845 2006-02-21  Raja R Harinath  <rharinath@novell.com>
18846
18847         * metadata.c (get_constraints): Relax debugging checks for monodis.
18848
18849 2006-02-21  Ankit Jain  <jankit@novell.com>
18850
18851         * metadata.c (mono_metadata_load_generic_params): Move the code
18852         checking for ambiguous generic params from here to mono/dis/get.c
18853         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
18854
18855 2006-02-21  Raja R Harinath  <harinath@gmail.com>
18856
18857         Fix assertion triggered when compiling nemerle.
18858         * class.c (mono_get_shared_generic_inst): Rename from
18859         get_shared_inst and make non-static.
18860         * loader.c (mono_get_shared_generic_method): New.  Used to create
18861         the MonoGenericContext-equivalent of a MonoGenericContainer.
18862         (mono_get_method_from_token): Initialize the 'context' field of
18863         the created MonoGenericContainer.
18864         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
18865         * metadata.c (get_constraints): Add sanity check.
18866         * class-internals.h: Add new internal methods.
18867
18868         * reflection.c (verify_safe_for_managed_space): New sanity check.
18869         Currently checks that owner-less generic parameters aren't allowed
18870         in managed space.
18871         (mono_type_get_object): Use it.
18872         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
18873         that are now in mono_type_get_object.
18874         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
18875
18876 2006-02-19  Raja R Harinath  <harinath@gmail.com>
18877
18878         * metadata.c (mono_type_create_from_typespec): Rename from
18879         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
18880         argument and caching of types in the generic container.
18881         (unwrap_arrays, find_generic_param): Remove.
18882         * metadata-internals.h: Update.
18883         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
18884
18885 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
18886
18887         * class.c (mono_class_get_exception_for_failure): Fix a warning.
18888
18889         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
18890         return values. Fixes #77581.
18891
18892         * class.c (mono_fnptr_class_get): Switch name and name_space.
18893
18894         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
18895         classes and add support for [In, Out] attributes.
18896         (mono_marshal_free_asany): Ditto. Fixes #77524.
18897
18898 2006-02-18  Raja R Harinath  <harinath@gmail.com>
18899
18900         * class.c (mono_class_from_generic_parameter): Make more robust to
18901         incomplete MonoGenericContainers from monodis.
18902
18903 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
18904
18905         * class-internals.h: added some more exception types.
18906         * class.c, metadata.c: added a few checks to handle missing
18907         types.
18908
18909 2006-02-17  Raja R Harinath  <rharinath@novell.com>
18910
18911         Use owner-less generic-params some more.
18912         * class.c (my_mono_class_from_generic_parameter): Remove.
18913         (mono_class_from_generic_parameter): Handle null image,
18914         param->name and param->owner.
18915         (mono_class_from_mono_type): Update.
18916         (mono_class_create_from_typespec): Remove 'container' parameter.
18917         If that parameter is non-null, the result is always inflated by
18918         'mono_class_get_full' anyway.
18919         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
18920         parameter.
18921         (mono_class_get_full): Update.
18922
18923         * class.c (inflate_generic_type) [GENERICINST]: If the generic
18924         instance is not open, don't bother inflating.
18925         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
18926         parse metadata for inflated classes.
18927         (_mono_class_get): Change GenericContext* parameter to
18928         GenericContainer*.
18929         (mono_class_create_from_typespec): Likewise.  Simplify, and
18930         implement trivially.  All the cases are handled in
18931         mono_class_from_mono_type.  Don't inflate returned class.
18932         (mono_class_get_full): Delegate GENERICINST optimization to
18933         inflate_generic_type.
18934         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
18935
18936 2006-02-16  Dick Porter  <dick@ximian.com>
18937
18938         * socket-io.c (create_object_from_sockaddr): Fix typo.
18939         (create_sockaddr_from_object): Check array lengths before
18940         potentially accessing items off the end.
18941         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
18942         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
18943         (ves_icall_System_Net_Sockets_Socket_Send_internal)
18944         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
18945         length checks to avoid wraparound overflows.
18946         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
18947         contents of the array of sockets
18948         (hostent_to_IPHostEntry2)
18949         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
18950         Check return value of inet_ntop ().
18951         (addrinfo_to_IPHostEntry): Fix typo
18952
18953 2006-02-16  Raja R Harinath  <rharinath@novell.com>
18954
18955         Type metadata parsing doesn't use generic-instantiation information.
18956         * metadata.c (mono_metadata_parse_array_full): Change
18957         MonoGenericContext* parameter to MonoGenericContainer*.
18958         (mono_metadata_parse_type_full): Likewise.
18959         (mono_type_create_from_typespec_full): Likewise.
18960         (mono_metadata_parse_mh_full): Likewise.
18961         (mono_metadata_parse_generic_inst): Likewise.
18962         (do_mono_metadata_parse_generic_class): Likewise.
18963         (do_mono_metadata_parse_type): Likewise.
18964         * metadata-internals.h: Update to changes.
18965         * class.c (mono_class_find_enum_basetype): Likewise.
18966         (mono_class_setup_fields): Likewise.
18967         (mono_class_create_from_typespec): Likewise.
18968         * loader.c (method_from_methodspec): Likewise.
18969         (mono_get_method_from_token): Likewise.
18970         (mono_method_get_header): Likewise.
18971
18972 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
18973
18974         * marshal.c: handle additional GENERICINST case (patch from
18975         Thong Nguyen <tum@veridicus.com>).
18976         Fix a few cases where LDIND_I/STIND_I was used for references.
18977
18978 2006-02-16  Raja R Harinath  <rharinath@novell.com>
18979
18980         * reflection.c (mono_reflection_get_token): Remove unused variable.
18981
18982 2006-02-16  Martin Baulig  <martin@ximian.com>
18983
18984         * reflection.c (mono_reflection_get_token): Add support for fields
18985         in instantiated generic types.
18986
18987         * icall.c
18988         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
18989
18990 2006-02-15  Martin Baulig  <martin@ximian.com>
18991
18992         * icall.c
18993         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
18994         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
18995         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
18996         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
18997
18998 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
18999
19000         * class.c, metadata.c, metadata.h, object.c, icall.c,
19001         marshal.c: changed mono_type_get_underlying_type () to do
19002         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
19003         Fixed handling of instantiated generic valuetypes (bug #75479).
19004
19005 2006-02-15  Raja R Harinath  <rharinath@novell.com>
19006
19007         * metadata.c (mono_metadata_decode_signed_value): Simplify.
19008         Delegate to mono_metadata_decode_value, and work on the returned value.
19009
19010         * icall.c (ves_icall_MonoType_GetGenericArguments):
19011         Add consistency check here too.
19012         
19013 2006-02-15  Ankit Jain  <jankit@novell.com>
19014
19015         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
19016         char/short etc.
19017
19018 2006-02-15  Ankit Jain  <jankit@novell.com>
19019
19020         * metadata.c (mono_metadata_decode_signed_value): New function to decode
19021         signed values, used only for representing lower bounds of arrays.
19022         (mono_metadata_parse_array_full): Use new
19023         mono_metadata_decode_signed_value to decode lower bounds.
19024
19025 2006-02-14  Martin Baulig  <martin@ximian.com>
19026
19027         * reflection.c
19028         (mono_reflection_get_token): Support "MonoGenericMethod" and
19029         "MonoGenericCMethod" and allow generic instances / methods.
19030
19031 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
19032
19033         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
19034         to obtain the terminal size using an ioctl.
19035
19036         * object.c (mono_nullable_init): Revert this as nullable reference
19037         types are not valid.
19038         (mono_nullable_box): Ditto.
19039
19040 2006-02-09  Dick Porter  <dick@ximian.com>
19041
19042         * threads.c (mono_thread_detach): Drop a reference to the thread
19043         we're detaching.
19044
19045 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
19046
19047         * object.c (mono_nullable_init): Handle nullable reference types.
19048         (mono_nullable_box): Ditto. Fixes #77446.
19049
19050 2006-02-07  Martin Baulig  <martin@ximian.com>
19051
19052         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
19053
19054 2006-02-07  Ankit Jain  <jankit@novell.com>
19055
19056         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
19057         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
19058         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
19059         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
19060         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
19061         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
19062
19063 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
19064
19065         * class.c (mono_class_create_generic): Set type_token as well.
19066
19067         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
19068         compatible with MS.
19069
19070 2006-02-02  Martin Baulig  <martin@ximian.com>
19071
19072         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
19073         has never been used so far.
19074
19075 2006-02-02  Martin Baulig  <martin@ximian.com>
19076
19077         * mono-debug-debugger.h: Changed comment at the top of this file;
19078         the header is not installed, but it's safe to #include it from
19079         within the JIT.
19080
19081         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
19082         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
19083
19084 2006-02-02  Martin Baulig  <martin@ximian.com>
19085
19086         * mono-debug.h
19087         (MonoSymbolTable): Removed the `metadata_info' field.
19088
19089         * mono-debug.c
19090         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
19091
19092         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19093         (mono_debugger_add_builtin_types): Removed.
19094         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
19095         (mono_debugger_create_notification_function): We now operate on a
19096         pre-allocated area; take a `gpointer' and return `void'.
19097
19098         * mono-debug-debugger.c
19099         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
19100         (mono_debugger_add_builtin_types): Removed.
19101
19102 2006-02-02  Martin Baulig  <martin@ximian.com>
19103
19104         * threads.c (mono_debugger_create_all_threads): New public method.
19105
19106 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
19107
19108         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
19109         breaks on several platforms.
19110
19111 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
19112
19113         * assembly.c: the VS.NET build doesn't supply default values for
19114         MONO_ASSEMBLIES and MONO_CFG_DIR.
19115
19116 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
19117
19118         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
19119         helper function.
19120
19121         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
19122
19123         * loader.c (method_from_memberref): Fix a warning.
19124
19125         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
19126
19127         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
19128         with explicit layout. Fixes #77433.
19129
19130 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
19131
19132         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
19133         max_interface_id is initialized before using it. Fixes #77398.
19134         (ves_icall_Type_GetInterfaces): Ditto.
19135
19136 2006-01-30  Raja R Harinath  <rharinath@novell.com>
19137
19138         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19139         allocate memory for parameter attributes when parsing memberref
19140         signatures.
19141         * loader.c (mono_loader_set_error_method_load): Don't warn.
19142         (method_from_memberref): Ensure MissingMethodException gets thrown
19143         if method is not found.  Make warning more informative.
19144
19145 2006-01-29  Raja R Harinath  <harinath@gmail.com>
19146
19147         Fix #77397
19148         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
19149         return true if is byref.
19150         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
19151         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
19152         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
19153
19154 2006-01-27  Raja R Harinath  <rharinath@novell.com>
19155
19156         Fix tests/find-method.2.il
19157         * loader.c (find_method, find_method_in_class): Remove is_inflated
19158         argument.  Revert 2006-01-18 change.
19159         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
19160         is generic, search for method in its generic definition.
19161         * class.c (mono_class_setup_vtable_general): Print generic
19162         arguments of generic types in debugging printf.
19163
19164 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
19165
19166         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
19167
19168         * threads.c (mono_threads_request_thread_dump): New helper function.
19169
19170 2006-01-25  Raja R Harinath  <rharinath@novell.com>
19171
19172         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
19173
19174 2006-01-25  Ankit Jain  <jankit@novell.com>
19175
19176         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
19177         move definition to ..
19178         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
19179         
19180 2006-01-25  Ankit Jain  <jankit@novell.com>
19181             Raja R Harinath  <rharinath@novell.com>
19182
19183         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
19184         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
19185         as necessary.
19186
19187 2006-01-25  Martin Baulig  <martin@ximian.com>
19188
19189         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
19190         `MonoDebuggerThread' into debug-debugger.c.
19191
19192 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
19193
19194         * profiler.c: fix printing of data.
19195
19196 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
19197
19198         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
19199           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
19200
19201 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
19202
19203         * object.c: fix deadlock related to string interning.
19204
19205 2006-01-23  Martin Baulig  <martin@ximian.com>
19206
19207         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19208
19209         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
19210
19211 2006-01-23  Martin Baulig  <martin@ximian.com>
19212
19213         * mono-debug.h: Moved the prototypes of some functions which are
19214         used by the JIT here from mono-debug-debugger.h.
19215
19216 2006-01-21  Martin Baulig  <martin@ximian.com>
19217
19218         * Makefile.am: Don't install mono-debug-debugger.h.
19219
19220 2006-01-21  Martin Baulig  <martin@ximian.com>
19221
19222         * mono-debug-debugger.h: Enforce the private status of this header
19223         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
19224         Moved some stuff from mono-debugger-jit-wrapper.h here.
19225
19226 2006-01-20  Raja R Harinath  <rharinath@novell.com>
19227
19228         * class.c (mono_class_from_typeref): Add a sanity test to help
19229         catch lack of assembly load/search hooks.
19230
19231 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
19232
19233         * marshal.c (emit_struct_conv): Relax the fields with same offset
19234         check even more. Fixes #77230.
19235
19236 2006-01-18  Martin Baulig  <martin@ximian.com>
19237
19238         * loader.c (find_method_in_class): Added `gboolean is_inflated'
19239         argument; if false, we compare the uninstantiated signatures.
19240         (method_from_memberref): Compare the uninstantiated signatures;
19241         fixes #76417.
19242
19243 2006-01-18  Robert Jordan  <robertj@gmx.net>
19244
19245         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
19246         Clear the weak link. Fixes bug #77170.
19247
19248         * gc.c (mono_gchandle_free):
19249         Reflect *-gc.c changes (tiny optimization).
19250
19251 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
19252
19253         * metadata.c (mono_metadata_signature_dup): Applied patch from
19254         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
19255         Fixes #77288.
19256
19257 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
19258
19259         * marshal.c (emit_struct_conv): Allow fields with the same offset when
19260         marshalling from native to managed code. Fixes #77230.
19261
19262 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19263
19264         * threadpool.c: fix problem (Mac only) when more than one asynchronous
19265         connect. Fixes bug #77020.
19266
19267 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
19268
19269         * class.c: fixed id assignement for nested interfaces (bug #77275).
19270         Added also better info for --print-vtable debugging.
19271
19272 2006-01-12  Martin Baulig  <martin@ximian.com>
19273
19274         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
19275         interfaces on-the-fly; fixes #76625.
19276
19277         * class-internals.h
19278         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
19279         don't need that anymore.
19280
19281 2006-01-12  Miguel de Icaza  <miguel@novell.com>
19282
19283         * socket-io.c
19284         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
19285         To avoid initing the nested_classes when not needed I turned the
19286         PeerCredData as a toplevel internal class, as it has to be shared
19287         anyways. 
19288
19289         Fixes the CASA issue.
19290
19291 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
19292
19293         * domain.c: Accessors for MonoJitInfo
19294
19295         * profiler-private.h: Add jitinfo to the end jit hook
19296
19297         * profiler.[ch]: Define new hooks, called after jitting which give
19298         the MonoJitInfo that was compiled
19299
19300 2006-01-10  Martin Baulig  <martin@ximian.com>
19301
19302         * class.c (mono_class_setup_events): Add support for generic
19303         classes; fixes #76440.
19304
19305 2006-01-06  Raja R Harinath  <rharinath@novell.com>
19306
19307         Fix #77160.
19308         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
19309         on passed-in method.
19310
19311 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19312
19313         * object.c (mono_runtime_invoke_array): Add Nullable support.
19314
19315         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
19316
19317 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
19318
19319         * file-io.c: Don't consider sockets as directory and avoid an endless
19320         loop. Fix bug #76966.
19321
19322 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19323
19324         * object.c (mono_nullable_init): New helper function.
19325         (mono_nullable_box): Ditto.
19326
19327         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
19328
19329         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
19330
19331         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
19332         
19333 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
19334
19335         * class.c (mono_class_is_assignable_from): Make T assignable to 
19336         Nullable<T>.
19337
19338 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
19339
19340         * appdomain.c: Bump corlib version to 46.
19341         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
19342         serialization purpose) and changed ves_icall_System_Reflection_
19343         Assembly_get_code_base signature to accept a boolean (to escape, or 
19344         not, the assembly code base).
19345
19346 2005-12-23  Dick Porter  <dick@ximian.com>
19347
19348         * icall.c: 
19349         * threads-types.h: 
19350         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
19351         CreateEvent icall now returns "created" boolean parameter.
19352
19353 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
19354
19355         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
19356         #76967.
19357
19358         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
19359         when attr_klass is an interface. Fixes #77045.
19360
19361 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
19362
19363         * marshal.c (emit_struct_conv): Fix previous patch.
19364         
19365         * marshal.c (emit_struct_conv): Add a check for fields with the same
19366         offset.
19367
19368 2005-12-20  Raja R Harinath  <rharinath@novell.com>
19369
19370         Fix regression in Mono.C5.
19371         * class.c (mono_class_create_generic): If 'klass' is an interface
19372         set up the interface offsets.
19373         (mono_class_is_assignable_from): Don't throw away generic arguments.
19374
19375 2005-12-19  Raja R Harinath  <rharinath@novell.com>
19376
19377         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
19378         type parameters.
19379
19380 2005-12-15  Raja R Harinath  <rharinath@novell.com>
19381
19382         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
19383         dead store.
19384         (do_mono_metadata_parse_generic_class): Don't pass the current
19385         generic context when parsing the type being instantiated: it
19386         cannot use it, anyway.
19387
19388         * loader.c (method_from_memberref): Don't inflate a signature if
19389         it doesn't contain any type parameters.
19390
19391 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
19392
19393         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
19394
19395 2005-12-14  Martin Baulig  <martin@ximian.com>
19396
19397         * class.c
19398         (mono_type_get_name_recurse): Don't return null for type
19399         parameters and open generic classes.
19400         (mono_class_setup_methods): Don't exclude generic instances.
19401         (mono_get_unique_iid): Use different IDs for different
19402         instantiations of the same generic type.
19403         (mono_class_setup_vtable): Only use setup_generic_vtable() for
19404         open generic instances; create a normal vtable for closed generic
19405         instances.
19406         (mono_class_setup_vtable_general): We're now also called for
19407         closed generic instances.
19408
19409         * reflection.c
19410         (mono_reflection_bind_generic_parameters): Correctly use
19411         mono_metadata_lookup_generic_inst() everywhere.
19412
19413 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
19414
19415         * object.c (mono_class_create_runtime_vtable): Call 
19416         mono_class_setup_vtable ().
19417
19418         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
19419         function.
19420         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
19421         #76959.
19422
19423         * loader.c (mono_loader_set_error_type_load): Print the type load
19424         warnings to the console so they are more visible to the user.
19425         (mono_loader_set_error_method_load): Ditto.
19426
19427         * reflection.c (ensure_runtime_vtable): Revert the last change as it
19428         is still broken.
19429         
19430         * reflection.c (ensure_runtime_vtable): Fix build.
19431
19432         * reflection.c (ensure_runtime_vtable): Disable an optimization which
19433         doesn't work in all cases.
19434
19435 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
19436
19437         * object.c (mono_array_new_full): Treat a single dimensional array
19438         with 0 lower bounds as an szarray. Fixes #76973.
19439
19440         * reflection.c (custom_attr_visible): Really fix this.
19441
19442 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
19443
19444         * reflection.c (custom_attr_visible): Allow nested public attributes
19445         as well.
19446
19447         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
19448         interface check.
19449
19450 2005-12-12  Raja R Harinath  <harinath@gmail.com>
19451
19452         * class.c (set_generic_param_owner): Delete.
19453         (mono_class_create_from_typedef): Don't set ->owner field of
19454         generic parameters to "param containers" of enclosing classes.
19455         * reflection.c (mono_reflection_initialize_generic_parameter):
19456         Likewise.
19457
19458 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
19459
19460         * reflection.c (custom_attr_visible): Fix build.
19461
19462 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
19463
19464         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
19465         private attributes.
19466         
19467         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
19468         handling of null parameter defaults.
19469
19470 2005-12-09  Raja R Harinath  <rharinath@novell.com>
19471
19472         * class.c (mono_class_from_generic_parameter): Don't set
19473         klass->generic_container.
19474         (my_mono_class_from_generic_parameter): Likewise.
19475
19476 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
19477
19478         * reflection.c (load_public_key): Fix a warning.
19479         (method_encode_code): Fix unaligned accesses.
19480
19481 2005-12-07  Martin Baulig  <martin@ximian.com>
19482
19483         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
19484
19485         * reflection.c
19486         (write_generic_param_entry): Encode our custom attrs.
19487
19488         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
19489
19490 2005-12-07  Martin Baulig  <martin@ximian.com>
19491
19492         * reflection.c (encode_new_constraint): Removed; we don't use the
19493         `NewConstraintAttribute' anymore.
19494
19495 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
19496
19497         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
19498         not fire a TypeResolve event when Assembly.GetType () is called.
19499
19500 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
19501
19502         Beginning of support for nullable types in the runtime. Parts of
19503         this patch are from Martin.
19504
19505         * appdomain.c (MONO_CORLIB_VERSION): Bump
19506
19507         * domain.c (mono_init_internal): get the nullable type
19508
19509         * class.c (mono_class_is_nullable): New method
19510         (mono_class_get_nullable_param): New mehod
19511         (mono_class_create_generic): In types T? set cast_class to T
19512
19513         * class-internals.h (MonoDefaults): new nullable default class
19514         (mono_class_get_nullable_param, mono_class_get_nullable_param):
19515         new methods.
19516
19517 2005-12-05  Raja R Harinath  <rharinath@novell.com>
19518
19519         * metadata.c (select_container): New.  Refactor code to select the
19520         appropriate GenericContainer given the type of generic parameter
19521         we are looking for.
19522         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
19523         not a MonoGenericContext.  Use select_container.  Update parameters.
19524         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
19525         and MONO_TYPE_MVAR.
19526         (unwrap_arrays): Remove duplicate tests.
19527         (find_generic_param): Rename from 'has_same_context'.  Now walks a
19528         generic instantiated class to find any arguments that are generic
19529         parameters.
19530         (mono_type_create_from_typespec_full): Use find_generic_param to
19531         avoid evicting some generic instantiations from the typespec
19532         cache.
19533
19534 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
19535
19536         * reflection.c: fixed writing of doubles on ARM FPA.
19537
19538 2005-12-02  Robert Jordan  <robertj@gmx.net>
19539
19540         * icall.c: Fixed EventInfo.ReflectedType (#76829).
19541
19542 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19543
19544         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
19545         least on SUSE 10 they are not the same (on debian, they are just the
19546         same thing).
19547
19548 2005-12-01  Raja R Harinath  <rharinath@novell.com>
19549
19550         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
19551         DeclaringType for VARs and MVARs.
19552         * class.c (set_generic_param_owner): Fix initialization of owner
19553         fields.
19554
19555 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
19556
19557         * icall.c: fixed Enum.ToObject() to correctly convert the values.
19558
19559 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19560
19561         * threadpool.c: workaround for a bug that shows up on the Mac:
19562         select()+connect() on a blocking socket is not like it should
19563         be, so we proceed to connect() in that case, wasting the I/O
19564         threadpool thread until connect succeedes. Fixes bug #75436.
19565
19566 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19567
19568         * threadpool.c: fix typo when setting file descriptor states.
19569
19570 2005-11-28  Raja R Harinath  <rharinath@novell.com>
19571
19572         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
19573         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19574         create a temporary signature container.
19575         (mono_metadata_parse_generic_param): Update to changes.
19576         (mono_type_create_from_typespec_full): Update to changes.
19577         * loader.c (method_from_memberref): Don't use a
19578         MonoGenericContainer while parsing a memberref signature.
19579         (method_from_methodspec): Remove dead-store of the 'container'
19580         variable.  It's overwritten before use.
19581
19582         * metadata.c (mono_type_create_from_typespec_full): Make debugging
19583         checks tighter.
19584         (mono_metadata_parse_generic_param): Likewise.
19585         * loader.c (find_method_in_class): Does not need a
19586         MonoGenericContainer.  Use 'mono_method_signature' rather than
19587         'mono_method_signature_full'.
19588         (find_method, mono_get_method_constrained, method_from_memberref):
19589         Update to changes.
19590
19591         * metadata.c (mono_type_create_from_typespec_full): Ensure that
19592         owner-less generic-parameters are never evicted from the typespec
19593         cache.
19594
19595         * loader.c (method_from_memberref): Don't use the current context
19596         when parsing signatures.
19597         (method_from_methodspec, mono_get_method_from_token): Update to changes.
19598
19599         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
19600         side-effects in g_assert.
19601         * loader.c (mono_get_method_from_token): Resolve klass earlier so
19602         that we don't potentially lose information.
19603
19604 2005-11-26  Dick Porter  <dick@ximian.com>
19605
19606         * icall.c:
19607         * threads.c: icalls to implement basic (ie, not named)
19608         System.Threading.Semaphore.
19609
19610 2005-11-24  Dick Porter  <dick@ximian.com>
19611
19612         * process.c
19613         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
19614         Use GetProcessId() if it's available.
19615
19616 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
19617
19618         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
19619
19620 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19621             Ankit Jain  <jankit@novell.com>
19622
19623         * loader.c (mono_get_method_from_token): Initialize 'method' field
19624         of all generic parameters before parsing the signature.  Remove
19625         code that "fixed"-up MVAR references.
19626
19627 2005-11-23  Ankit Jain  <jankit@novell.com>
19628
19629         * metadata.c (mono_metadata_has_generic_params):
19630         (mono_metadata_load_generic_param_constraints):
19631         (mono_metadata_load_generic_params): Move duplicate code ...
19632         (mono_metadata_get_generic_param_row): ... here. Returns the
19633         first row-id in GenericParam table for a given owner (token).
19634         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
19635         prototype.
19636
19637 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19638             Ankit Jain  <jankit@novell.com>
19639
19640         * metadata.c (mono_metadata_class_equal): Pass signature_only when
19641         comparing VARs too.
19642         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
19643         type->data.generic_param only if the type is an MVAR.
19644         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
19645         leak owner-less VARs and MVARs into managed space.
19646
19647 2005-11-21  Martin Baulig  <martin@ximian.com>
19648
19649         * class-internals.h
19650         (MonoMethod): Moved the `generic_container' here from
19651         `MonoMethodNormal' since we now also need it for
19652         `MonoMethodPInvoke';
19653         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
19654         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
19655         an union containing both `MonoMethodNormal' and
19656         `MonoMethodPInvoke'.
19657
19658         * loader.c
19659         (mono_get_method_from_token): Allow implementing generic methods
19660         as interncalls.
19661
19662         * threads.c
19663         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
19664         icall.
19665
19666 2005-11-17  Dick Porter  <dick@ximian.com>
19667
19668         * icall.c: 
19669         * process.h: 
19670         * process.c: Split the Process Start_internal icall into
19671         ShellExecuteEx_internal and CreateProcess_internal, which are
19672         called depending on whether UseShellExecute is true.  Fixes bug
19673         76670.
19674
19675         * appdomain.c (MONO_CORLIB_VERSION): Incremented
19676
19677 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
19678
19679         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
19680         'msize' parameters, use the information in 'mspec' instead.
19681         (emit_object_to_ptr_conv): Ditto.
19682
19683         * marshal.c (emit_struct_conv): Handle explicit layout structs with
19684         fields out of order. Fixes #76733.
19685
19686 2005-11-17  Ankit Jain  <jankit@novell.com>
19687
19688         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
19689
19690 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
19691
19692         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
19693           bug #76575.
19694
19695 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19696
19697         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
19698         for types with non-auto layout. Fixes #76717.
19699
19700 2005-11-16  Ankit Jain  <jankit@novell.com>
19701
19702         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
19703         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
19704         if generic_context is null.
19705           (mono_metadata_generic_param_equal): param->owner can be null.
19706           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
19707         null.
19708
19709 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19710
19711         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
19712         the correct value.
19713
19714 2005-11-15  Martin Baulig  <martin@ximian.com>
19715
19716         * object.c (set_value): Use mono_class_from_mono_type() instead of
19717         the hack for generic instances; fixes #76136.
19718
19719 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
19720
19721         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
19722         fields.
19723
19724         * image.c (load_metadata_ptrs): Initialize the new fields.
19725
19726         * reflection.c (create_dynamic_mono_image): Ditto.
19727
19728         * reflection.c (build_compressed_metadata): Use the new fields.
19729
19730         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
19731         icall.
19732
19733         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
19734         icall.
19735         
19736 2005-11-15  Ankit Jain  <jankit@novell.com>
19737             Raja R Harinath  <harinath@gmail.com>
19738
19739         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
19740         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
19741         new per-generic_container cache if the cached MonoType's context matches
19742         the current context.
19743           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
19744         to the expected context.
19745           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
19746
19747 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19748
19749         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
19750         we changed the signature of an icall.
19751         * icall.c: Modify to mono_double_ParseImpl return true/false 
19752         depending on the success, instead of throwing the exception. This will
19753         help us in Double.TryParse methods.
19754         
19755 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
19756
19757         * marshal.c (emit_marshal_object): Throw an exception when
19758         marshalling 'object' instead of crashing. Fixes #76696.
19759
19760 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
19761
19762         * class-internals.h: Add prototype for mono_type_get_full_name ().
19763
19764 2005-11-11  Dick Porter  <dick@ximian.com>
19765
19766         * threads.c (mono_thread_manage): Make sure the main thread has
19767         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
19768
19769 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
19770
19771         * loader.c (mono_loader_set_error_type_load): Log a warning to the
19772         console about the missing type.
19773         (mono_loader_set_error_method_load): Ditto.
19774
19775 2005-11-09  Miguel de Icaza  <miguel@novell.com>
19776
19777         * mono-config.c (mono_get_config_dir): Set the system defaults if
19778         none is specified.
19779
19780         * assembly.c (mono_set_dirs): New API entry point to set the
19781         assembly and the config directory in one call
19782
19783 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
19784
19785         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
19786         the ftnptr was created from a delegate in a domain other than the
19787         current domain. Fixes #75377.
19788
19789         * exception.h exception.c: Add mono_get_exception_not_supported ().
19790
19791 2005-11-08  Martin Baulig  <martin@ximian.com>
19792
19793         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
19794
19795 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
19796
19797         * security-manager.h: Added definitions to deal with strongname key 
19798         pairs bigger (and smaller) than 1024 bits.
19799         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
19800         adjust wrt the public key length being used.
19801
19802 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
19803
19804         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
19805           Windows build (r51396-51397).
19806
19807 2005-11-03  Martin Baulig  <martin@ximian.com>
19808
19809         * class.c (mono_class_setup_vtable_general): Also add generic
19810         methods to the vtable; fixes #76581.
19811
19812 2005-11-01  Miguel de Icaza  <miguel@novell.com>
19813
19814         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
19815         sure that we lookup GetString method from the System.Text.Encoding
19816         class, not the derived class or we get an empty method.
19817
19818         Fixed class #76612.
19819
19820 2005-10-25  Miguel de Icaza  <miguel@novell.com>
19821
19822         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
19823         if it has been previously set (embedders). 
19824
19825         Make mono_set_rootdir available also on Unix.
19826
19827 005-10-24  Robert Jordan  <robertj@gmx.net>
19828
19829         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
19830
19831 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
19832
19833         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
19834         only calls which are made to native code use this flag.
19835
19836         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
19837
19838 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
19839
19840         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
19841         Add support for FieldBuilders.
19842
19843 2005-10-29  Martin Baulig  <martin@ximian.com>
19844
19845         * mono-debug.c
19846         (mono_debug_using_mono_debugger): New public method; returns
19847         whether we're running inside the debugger.
19848
19849 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
19850
19851         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
19852         for Method/Constructor/FieldBuilders.
19853
19854 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
19855
19856         * reflection.c (module_add_cattrs): Save custom attributes for global methods
19857         and fields as well.
19858
19859 2005-10-26  Martin Baulig  <martin@ximian.com>
19860
19861         * mono-debug-debugger.c
19862         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
19863
19864 2005-10-24  Raja R Harinath  <harinath@gmail.com>
19865
19866         * icall.c (base64_to_byte_array): Don't pass an out-of-range
19867         integer to isspace.
19868
19869 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
19870
19871         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
19872         when passing valuetypes byref. Fixes #76502.
19873
19874 2005-10-19  Jackson Harper  <jackson@ximian.com>
19875
19876         * profiler.c: Don't put a . in front of types that are not in a
19877         namespace.
19878
19879 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
19880
19881         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
19882
19883 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
19884
19885         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
19886         #76436.
19887         (mono_marshal_get_ldflda_wrapper): Fix a warning.
19888
19889 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19890
19891         * assembly.c metadata-internals.h icall.c: Define an additional
19892         parameter for mono_assembly_name_parse_full, so we can avoid creating
19893         S.R.AssemblyName.Version when no version info wasn't passed.
19894         
19895 2005-10-09  Miguel de Icaza  <miguel@novell.com>
19896
19897         * class.c (mono_type_get_full_name): Reimplement method that was
19898         removed. 
19899
19900         * image.c: Some docs
19901
19902 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
19903
19904         * profiler.c (output_newobj_profile): Fix printing of Total memory
19905         on x86.
19906
19907 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
19908
19909         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
19910
19911 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
19912
19913         * threads.c: remove debug output.
19914
19915 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
19916
19917         * threads.c (mono_thread_manage): Fix crashes if more than 64
19918         threads need to be aborted. Hopefully fixes #75899.
19919
19920         * assembly.c (mono_stringify_assembly_name): New helper function.
19921
19922         * class.c: Use mono_stringify_assembly_name instead of the similar
19923         static function.
19924
19925         * assembly.h assembly.c: Add support for calling a postload search 
19926         hook if an assembly cannot be loaded.
19927
19928         * appdomain.c: Register new search hooks which call the AssemblyResolve
19929         events in AppDomain. Fixes #75231
19930
19931 2005-10-07  Martin Baulig  <martin@ximian.com>
19932
19933         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
19934         methods without debug info.
19935
19936 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
19937
19938         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
19939         wrappers.
19940
19941 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19942
19943         * file-io.c: now that we return symlinks, use lstat and, when the file
19944         is a symbolic link, stat, to get the file attributes. Also avoid the
19945         conversion to/from utf16/external.
19946
19947 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
19948
19949         * class.c (mono_class_layout_fields): Compute klass->has_references
19950         correctly if an embedded valuetype is not yet initialized. Fixes
19951         #76331.
19952
19953 2005-10-04  Martin Baulig  <martin@ximian.com>
19954
19955         * metadata.c
19956         (mono_metadata_load_generic_param_constraints): New public
19957         function; splitted the constraints loading out from
19958         mono_metadata_load_generic_params().
19959
19960         * class.c (mono_class_create_from_typedef): Call
19961         mono_metadata_load_generic_param_constraints() after setting up
19962         the type and creating our parent; fixes #75329.
19963
19964 2005-10-04  Martin Baulig  <martin@ximian.com>
19965
19966         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
19967         non-dynamic parent classes.
19968
19969 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
19970
19971         * file-io.c : win32 build fix (ETXTBSY seems not found).
19972
19973 2005-10-04  Martin Baulig  <martin@ximian.com>
19974
19975         * reflection.c
19976         (mono_image_get_methodspec_token): Make the cache actually work;
19977         fixes #75974.
19978
19979 2005-10-04  Martin Baulig  <martin@ximian.com>
19980
19981         * class.c (mono_class_name_from_token): Removed the unneccessary
19982         `MonoGenericContext *' argument.
19983
19984 2005-10-04  Martin Baulig  <martin@ximian.com>
19985
19986         * loader.c
19987         (method_from_methodspec): Make the caching work again; fixes the
19988         performance regression from #76262.
19989
19990 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19991
19992         * file-io.c:
19993         * file-io.h:
19994         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
19995         GetFileSystemEntries that performs the same work but without going
19996         into io-layer, locking, etc.
19997
19998 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
19999
20000         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
20001         ThreadState_Stopped as well. Fixes #76047.
20002
20003 2005-09-29  Martin Baulig  <martin@ximian.com>
20004
20005         * class.c
20006         (inflate_generic_context): If the new context has a `gmethod', set
20007         its `container' that that gmethod's `container'.
20008
20009         * metadata.c
20010         (mono_metadata_parse_generic_param): Simplify things;
20011         `generic_container = generic_context->container;' is just fine.
20012
20013         * loader.c (method_from_methodspec): Code cleanups.
20014
20015 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
20016
20017         * decimal.c: fix warning (and let gcc generate correct
20018         code on ARM with optimizations).
20019
20020 2005-09-28  Martin Baulig  <martin@ximian.com>
20021
20022         * loader.c
20023         (method_from_memberref): Added `MonoGenericContext *class_context'
20024         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
20025         (method_from_methodspec): If we're a memberref, use the enclosing
20026         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
20027
20028 2005-09-28  Martin Baulig  <martin@ximian.com>
20029
20030         * object.c (mono_runtime_invoke_array): Added support for
20031         MONO_TYPE_GENERICINST; fixes #75917.
20032
20033 2005-09-27  Martin Baulig  <martin@ximian.com>
20034
20035         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
20036         `k->byval_arg.type' to determine the actual type.
20037
20038         * loader.c (method_from_methodspec): Removed some hacks.
20039
20040 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
20041
20042         * class-internals.h (mono_field_is_deleted): Do the test for
20043         rtspecialname before we check the actual name of the field. This
20044         prevents us from dereferencing a pointer into the string table,
20045         saving us from accessing a few pages
20046
20047         * *.c: Replace the use of {Enter,Leave}CriticalSection with
20048         macros. This will allow a deadlock debugger to easily be plugged
20049         in.
20050
20051 2005-09-27  Martin Baulig  <martin@ximian.com>
20052
20053         * loader.c (method_from_methodspec): Create a "signature"
20054         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
20055
20056 2005-09-27  Martin Baulig  <martin@ximian.com>
20057
20058         * class.c
20059         (inflate_generic_class): Correctly set the new context's
20060         container.
20061
20062         * loader.c
20063         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
20064         instead of a `MonoGenericContext *'.
20065         (mono_method_signature_full): Take a `MonoGenericContainer *'
20066         instead of a `MonoGenericContext *'.
20067
20068         * metadata.c
20069         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
20070         instead of a `MonoGenericContext *'.
20071         (mono_metadata_parse_method_signature_full): Likewise.
20072
20073 2005-09-26  Martin Baulig  <martin@ximian.com>
20074
20075         * class.c
20076         (mono_class_from_generic_parameter): Set `klass->generic_container'
20077         (mono_class_from_generic_parameter): Likewise.
20078         (mono_bounded_array_class_get): We inherit the generic container
20079         from the element class.
20080
20081         * loader.c
20082         (find_method, find_method_in_class): Take a `MonoGenericContext *'
20083         argument rather than computing it here.
20084         (method_from_memberref): Correctly set the generic context before
20085         parsing the signature.  Fixes #75681.
20086
20087 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
20088
20089         * object.c (mono_class_has_special_static_fields): Fix warnings.
20090
20091 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20092
20093         * assembly.c: Add parse_public_key function, to
20094         par the public keys. Also added mono_assembly_name_parse_full,
20095         to define it the parsed key should be freed or not.
20096         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
20097         to parse a long format assembly name.
20098         * metadata-internals.h: Keep mono_assembly_name_parse_full as
20099         private, since calling it to preserve the key requires
20100         freeing it manually.
20101         
20102 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
20103
20104         * locales.c : removed HAVE_ICU part.
20105
20106 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
20107
20108         * object.c (mono_class_create_runtime_vtable): Avoid calling 
20109         field_is_special_static if the klass has no special static fields.
20110
20111         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
20112         (MonoCachedClassInfo): Likewise.
20113
20114         * object.c (mono_class_has_special_static_fields): New helper function.
20115
20116 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20117
20118         * class.c (mono_class_create_from_typedef): Don't call 
20119         interfaces_from_typedef_full for enums.
20120         (mono_class_create_from_typedef): Compute the base types of enums directly
20121         without calling mono_class_setup_fields ().
20122         (mono_class_find_enum_basetype): New helper function.
20123
20124         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
20125         one place inside the string heap.
20126         
20127 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
20128
20129         * class.c: locking fixes, code cleanups, some docs added.
20130         Allocate some data structures in the image mempool.
20131
20132 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20133
20134         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20135         the example code.
20136         
20137 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
20138
20139         * class-internals.h, class.c, reflection.c: reduce memory taken by
20140         MonoClass.
20141
20142 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
20143
20144         * metadata.c, metadata.h, loader.h: documentation updates, code and
20145         API cleanups.
20146
20147 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20148
20149         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20150         the example code.
20151
20152         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
20153         page faults caused by the runtime while reading metadata.
20154
20155 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20156
20157         * socket-io.c: the field names were changed 3 months ago and no one
20158         realized until bug #76077 got filed!
20159
20160 2005-09-20  Martin Baulig  <martin@ximian.com>
20161
20162         * icall.c (assembly_icalls): Removed some unused debugger icalls.
20163
20164 2005-09-20  Martin Baulig  <martin@ximian.com>
20165
20166         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
20167         write the rank into the class entry.
20168
20169 2005-09-20  Martin Baulig  <martin@ximian.com>
20170
20171         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
20172
20173 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
20174
20175         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20176
20177         * icall.c (custom_attrs_defined_internal): New icall.
20178
20179         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
20180         function.
20181         (mono_custom_attrs_construct_by_type): New helper function.
20182
20183 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
20184
20185         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
20186         terminate the resulting string. Fixes #76123.
20187
20188 2005-09-16  Martin Baulig  <martin@ximian.com>
20189
20190         * mono-debug.c
20191         (mono_debug_add_method): Ignore inflated methods for the moment.
20192
20193 2005-09-14  Martin Baulig  <martin@ximian.com>
20194
20195         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
20196
20197 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
20198
20199         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
20200         return a success/failure indication.
20201         (mono_metadata_interfaces_from_typedef_full): Ditto.
20202         (get_constraints): Ditto.
20203
20204 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
20205
20206         * marshal.c (emit_marshal_array): Fix handling of null arrays.
20207         
20208         * marshal.c (emit_marshal_array): Add support for returning string
20209         arrays from delegates. Fixes #76063.
20210
20211         * marshal.c: Use the emit_ldloc/stloc macros where possible.
20212
20213 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
20214
20215         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
20216         icall.
20217
20218 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
20219
20220         * reflection.c icall.c: Fix after mono_get_exception_type_load
20221         signature change.
20222
20223         * assembly.c (mono_assembly_get_assemblyref): New helper function.
20224         (mono_assembly_load_reference): Use the new helper.
20225
20226         * class-internals.h (MonoLoaderError): New structure containing 
20227         information about type loading errors.
20228
20229         * class-internals.h loader.c: Add APIs to store per-thread loader
20230         error information.
20231
20232         * loader.c class.c: Set the loader error if needed.
20233
20234         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
20235
20236 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
20237
20238         * decimal.c: fixed to handle the broken ARM fp format.
20239
20240 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
20241
20242         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
20243         broken.
20244
20245 2005-09-06  Martin Baulig  <martin@ximian.com>
20246
20247         * domain.c (supported_runtimes): Added v2.0.50727.
20248
20249 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
20250
20251         * culture-info.h: reduce the size of some structures.
20252
20253 2005-09-05  Martin Baulig  <martin@ximian.com>
20254
20255         Reflect latest API changes in the August CTP.
20256
20257         * icall.c
20258         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
20259         ("MonoType.HasGenericArguments"): Removed.
20260         ("MonoMethod.BindGenericParameters"): Renamed to
20261         "MakeGenericMethod".
20262         ("MethodBuilder.BindGenericParameters"): Renamed to
20263         "MakeGenericMethod".    
20264
20265 2005-09-05  Martin Baulig  <martin@ximian.com>
20266
20267         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
20268
20269 2005-09-05  Martin Baulig  <martin@ximian.com>
20270
20271         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20272
20273         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
20274         generic_container is non-NULL.
20275
20276 2005-09-05  Martin Baulig  <martin@ximian.com>
20277
20278         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20279
20280         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
20281
20282 2005-08-29  Michal Moskal  <malekith@nemerle.org>
20283
20284         * reflection.c (encode_locals,
20285         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
20286         for large generic types.
20287
20288 2005-09-05  Martin Baulig  <martin@ximian.com>
20289
20290         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20291
20292         * class.c (mono_dup_array_type): New public method.
20293         (mono_metadata_signature_deep_dup): New public method.
20294         (dup_type): Correctly duplicate array and function types.
20295
20296 2005-09-05  Martin Baulig  <martin@ximian.com>
20297
20298         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20299
20300         * reflection.c (get_default_param_value_blobs): Handle generic types
20301         and generic methods.
20302
20303 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
20304
20305         * class.c: Fixed error reporting (method/class were inversed) for 
20306         inheritance demands.
20307         * security-manager.c|h: Added the AppDomain when calling the managed
20308         System.Security.SecurityManager.InheritanceDemand method.
20309
20310 2005-09-01  Raja R Harinath  <rharinath@novell.com>
20311
20312         * reflection.c (encode_marshal_blob): 'marshaltype' and
20313         'marshaltyperef' are alternate sources for the custom marshaler
20314         name.
20315
20316 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
20317
20318         * class.c: fix creation of array classes with rank == 1
20319         (patch by Ankit Jain <jankit@novell.com>).
20320
20321 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
20322
20323         * object.c: fix check for creating the bound data for arrays vs
20324         szarrays.
20325
20326 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20327
20328         * object.c: configuration file name is now based on the executable name,
20329         not the image name. Fixes bug #75931.
20330
20331 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
20332
20333         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
20334         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
20335
20336 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
20337
20338         * rand.c: Use wincrypt.h instead of WinCrypt.h.
20339
20340 2005-08-24  Ankit Jain  <jankit@novell.com>
20341             Raja R Harinath  <rharinath@novell.com>
20342
20343         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
20344           called by it recursively.
20345           (mono_class_init): Remove special case in pending_init handling, since it's
20346           superseded by the fix to mono_class_from_typeref.
20347
20348 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
20349
20350         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
20351         BROKEN_THREAD_START stuff.
20352
20353 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
20354
20355         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
20356         trampoline.
20357
20358         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
20359         
20360         * object.c (mono_delegate_ctor): Replace the original function address with
20361         a delegate trampoline.
20362
20363 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
20364
20365         * icall.c: add boolean argument to base64_to_byte_array and 
20366         InternalFromBase64String to control whether a whitespace-only string
20367         is allowed (or should casue a FormatException to be thrown). We need
20368         this as the behavior has changed between MS.NET 1.x and 2.0, and we
20369         to match the MS behaviour in both profiles.
20370         * appdomain.c: Bump corlib version.
20371
20372 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20373
20374         This patch implements a big portion of publisher policy
20375         support, used to bind assembly versions and redirect
20376         one assembly from version A to version B.
20377
20378         * assembly.c:
20379         New GSList loaded_assembly_bindings, for storing the cached
20380         assembly bindings.
20381         (assembly_binding_maps_name): New static function for checking if a 
20382         assembly binding information maps an assembly name.
20383         (mono_assembly_binding_info_free): New function for freeing
20384         assembly binding information resources.
20385         (get_publisher_policy_info): New static function for retrieving 
20386         assembly binding information from a MonoImage.
20387         (compare_versions): New static function for comparing an assembly
20388         binding information data and the version of an assembly name.
20389         (check_policy_versions): New static function for checking if an
20390         assembly binding info mapping an assembly name is valid for it.
20391         (mono_assembly_load_publisher_policy): New static function for
20392         loading the 'policy.major.minor.MyAssembly' image for an assembly
20393         with an assembly name 'aname'.
20394         (mono_assembly_bind_version): New static function for updating
20395         assembly redirection.
20396         (mono_assembly_apply_binding): New static function for applying
20397         assembly binding.
20398         (search_binding_loaded): New static function for searching 
20399         loaded assembly binding infos in the cache domain.
20400         (mono_assembly_load_full): Don't apply assembly binding for
20401         reflection only assemblies.
20402
20403         * metadata-internals.h: Add MonoAssemblyBindingInfo,
20404         which contains information about assembly binding. Also
20405         declare signature for mono_config_parse_publisher_policy ()
20406         function, used to retrieve pub policy info.
20407         
20408         * mono-config.c:
20409         (publisher_policy_start): New static function used to parse publisher 
20410         policy config files.
20411         (publisher_policy_parser): New static MonoParseHandler containing 
20412         the functions used when parsing config files.
20413         (mono_config_parse_publisher_policy): New function for parsing
20414         publisher policy files.
20415         
20416 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
20417
20418         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
20419
20420         * marshal.c (mono_delegate_free_ftnptr): Ditto.
20421
20422         * object.c (mono_get_addr_from_ftnptr): New helper function.
20423
20424         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
20425
20426         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20427
20428 2005-08-19  Dick Porter  <dick@ximian.com>
20429
20430         * threads.c, threads.h, appdomain.c, appdomain.h,
20431         profiler-private.h, monitor.c, object.c, object-internals.h,
20432         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
20433         store the thread ID, so it can hold a 64 bit value if needed.
20434
20435 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
20436
20437         * reflection.c (mono_reflection_create_dynamic_method): Store the
20438         handle class into the method references as well so ldtoken works in
20439         dynamic methods.
20440
20441         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
20442         types.
20443
20444 2005-08-19  Ankit Jain <jankit@novell.com>
20445
20446         Fix #75847.
20447         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
20448           here rather than using the method signature of a arbitrary function
20449           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
20450           two arguments.
20451           Hack done with Harinath.
20452
20453 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20454
20455         * threadpool.c: disable printing stack traces when we get a exception
20456         in a threadpool thread. I need to do more testing to figure out which
20457         cases actually print this. Fixes bug #75828.
20458
20459 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20460
20461         * icall.c: there might be ignored whitespace after the last '='. This
20462         fixes length computation and bug #75840.
20463
20464 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
20465
20466         * assembly.c (mono_assembly_load_full): Consider .exe extension as
20467         well. Fixes #75809.
20468
20469         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
20470         #75784.
20471         
20472         * reflection.c (create_custom_attr_data): Ditto.
20473
20474 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
20475
20476         * locales.c, culture-info.h : removed RegionLCIDMap.
20477         * culture-info-tables.h : regenerated.
20478
20479 2005-08-16  Martin Baulig  <martin@ximian.com>
20480
20481         * class.c (mono_type_get_name_recurse): Small fix.
20482
20483 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
20484
20485         * locales.c : indentation fixie.
20486
20487 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
20488
20489         * object-internals.h,
20490           locales.h,
20491           locales.c,
20492           culture-info.h,
20493           icall.c : added RegionInfo table support.
20494         * culture-info-table.h : regenerated for region support.
20495
20496 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
20497
20498         * reflection.c (resolve_object): handle all kinds of MonoMethod
20499         including generic ones
20500
20501 2005-08-12  Ankit Jain <jankit@novell.com>
20502
20503         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
20504           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
20505
20506 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
20507
20508         * process.c: Don't close a thread handle when it's NULL. This is a
20509         workaround for bug #75733.
20510
20511 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
20512
20513         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
20514
20515 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
20516
20517         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
20518
20519 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20520
20521         * threadpool.c: if a work item in the thread pool has a callback that
20522         catches a exception, don't propagate it after invoking the callback.
20523         Fixes bug #75336.
20524
20525 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
20526
20527         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
20528
20529         * class-internals.h (MonoCachedClassInfo): Add some new fields.
20530
20531         * class.c (mono_class_init): Load field info lazily in the AOT case.    
20532
20533         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
20534
20535 2005-08-03  Ankit Jain  <jankit@novell.com>
20536
20537         Fix #75683.
20538         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
20539           PInvoke calling convention is 0.
20540
20541 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
20542
20543         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
20544         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
20545
20546 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
20547
20548         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
20549         to handle threads not started by the GC (patch by Michael Meeks
20550         <michael.meeks@novell.com>).
20551
20552 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
20553
20554         * reflection.c: Make buffer used in emitting types larger for some
20555         big generic types (patch by Michal Moskal).
20556
20557 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
20558
20559         * mono-debug.c: Fix some (not all) alignment problems.
20560
20561 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20562
20563         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
20564         Invoke mono_image_load_from_data_full passing the refonly
20565         parameter.
20566
20567         * assembly.c
20568         (mono_assembly_open_from_bundle): Add the refonly argument, 
20569         in order to pass it to other methods it calls to.
20570         (do_mono_assembly_open): Add the refonly argument, in order 
20571         to pass it to other methods it calls to.
20572         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
20573         the refonly parameter to it.
20574
20575         * image.c: Add loaded_images_refonly_hash and
20576         loaded_images_refonly_guid_hash to cache the reflection
20577         only loaded images.
20578         (mono_images_init): Initialize the hash tables used for
20579         caching the reflection only images.
20580         (load_modules): Invoke mono_image_open_full passing the refonly
20581         parameter to load the modules the correct way.
20582         (build_guid_table): Add the refonly argument, to re-build the 
20583         correct hash table.
20584         (do_mono_image_open): Added the refonly argument, in order to
20585         define it for the loaded image.
20586         (mono_image_loaded_full): New function, which receives an
20587         additional parameter to look for the image in the refonly or
20588         non-refonly section.
20589         (mono_image_loaded): Updated, using mono_image_loaded_full.
20590         (mono_image_loaded_by_guid_full): The same case that happens
20591         with mono_image_loaded_full.
20592         (mono_image_loaded_by_guid): Likewise.
20593         (register_image): Use the ref_only variable inside MonoImage
20594         to decide in which hash table store the current image.
20595         (mono_image_open_from_data_full): Rename
20596         mono_image_open_from_data to mono_image_open_from_data_full,
20597         adding the refonly argument, to define the ref_only variable 
20598         inside MonoImage.
20599         (mono_image_open_from_data): Return 
20600         mono_image_open_from_data_full.
20601         (mono_image_open_full): Rename mono_image_open to
20602         mono_image_open_full, receiving the new refonly argument,
20603         to pass it to inner methods.
20604         (mono_pe_file_open): Update this function, to open
20605         a MonoImage as a non-refonly image.
20606         (mono_image_close): Use the refonly variable inside
20607         MonoImage to remove the image from the correct caches.
20608
20609         * image.h: Add the signatures of mono_image_open_full,
20610         mono_image_open_from_data_full, mono_image_loaded_full,
20611         mono_image_loaded_by_guid_full.
20612
20613         * metadata-internals.h: Add the ref_only field to 
20614         MonoImage.
20615         
20616 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20617
20618         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
20619         Fix the last behavior, which used to load the assemblies and
20620         extract MonoReflectionAssemblyName information, instead of
20621         extract it from the metadata tables. Needed for Reflection
20622         Only assemblies.
20623         
20624 2005-07-29  Martin Baulig  <martin@ximian.com>
20625
20626         * mono-debug-debugger.c
20627         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
20628         not initialized.
20629
20630         * mono-debug.c
20631         (mono_debug_address_from_il_offset): Check whether we have
20632         debugging support before attempting to take the lock.
20633         (mono_debug_source_location_from_address): Likewise.
20634         (mono_debug_source_location_from_il_offset): Likewise.
20635         (mono_debug_il_offset_from_address): Likewise.
20636         (mono_debug_address_from_il_offset): Likewise.
20637
20638 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
20639
20640         * class.c (mono_class_from_name_case): Add support for dynamic images.
20641         Fixes #75650.
20642
20643         * object.c (mono_class_compute_gc_descriptor): Add a workaround
20644         for #75479.
20645
20646 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20647         
20648         * reflection.c (mono_method_get_object): Fix warning.
20649
20650 2005-07-28  Martin Baulig  <martin@ximian.com>
20651
20652         * mono-debug.c
20653         (mono_debug_add_wrapper): Also write the wrapper type.
20654
20655 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20656
20657         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
20658         
20659         * class.c (mono_class_init): Avoid reading nested classes if the AOT
20660         data indicates the class has none.
20661
20662 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
20663
20664         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
20665         loader lock with the debugger lock. Prevents deadlocks for beagle.
20666
20667         Beagle can now run on an smp box for a weekend without any
20668         issues. Woohoo!
20669
20670 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
20671
20672         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
20673         in a module. Fixes #75629.
20674
20675 2005-07-26  Martin Baulig  <martin@ximian.com>
20676
20677         * mono-debug.c (mono_debug_add_wrapper): New static method.
20678         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
20679         interncall or a wrapper.
20680
20681         * mono-debug.h (MonoDebugWrapperData): New public typedef.
20682         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
20683         (MONO_DEBUGGER_VERSION): Bump to 51.
20684
20685         * mono-debug-debugger.c
20686         (mono_debugger_add_type): Removed this empty function.
20687         (mono_debugger_add_method): Likewise.
20688
20689 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
20690
20691         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
20692         before accessing method->slot.
20693
20694 2005-07-21  Jb Evain  <jbevain@gmail.com>
20695
20696         * reflection.c (method_encode_clauses/class): Handle filters clauses.
20697         Fixes #75010.
20698
20699 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
20700
20701         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
20702         #75587.
20703
20704 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
20705
20706         * image.h image.c: Add mono_image_get_guid () API function.
20707
20708 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
20709
20710         There were issues when multiple threads tried to load
20711         assemblies. A deadlock was created between assemblies_mutex and
20712         mono_domain_assemblies_lock. This fixes the issue by making the
20713         assembly ref counting be lock free. See bug 75586.
20714         
20715         * image.c (mono_image_close): The add ref function here was using
20716         Interlocked operations while the unref was using a mutex and a
20717         --. I don't think this was ever a bug that would be exposed in a
20718         non-pendantic way (ie, by an embedder doing a ref on one thread
20719         and an unref on another), but for the sake of correctness, this is
20720         now Interlocked.
20721
20722         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
20723         (mono_assembly_load_reference): Call mono_assembly_addref rather
20724         than touching the refcount ourselves.
20725         (mono_assembly_close): Use InterlockedDecrement to unref the
20726         assembly. Don't acquire the lock unless it is actually needed.
20727
20728 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
20729
20730         * class.c (mono_class_layout_fields): Fix calculation of has_references
20731         for generic types.
20732
20733 2005-07-12  Martin Baulig  <martin@ximian.com>
20734
20735         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20736
20737         * metadata.c
20738         (mono_type_hash): Provide better hashing for generic instances.
20739         (mono_generic_inst_hash): Improve hashing.
20740         (mono_generic_class_hash): Likewise.
20741
20742         * reflection.c (mymono_metadata_type_hash): Improve hashing for
20743         generic instances.
20744
20745 2005-07-12  Martin Baulig  <martin@ximian.com>
20746
20747         * reflection.c (mono_reflection_create_runtime_class): Remove the
20748         hack for generic type definitions and non-`Run' assemblies.
20749         (mono_reflection_bind_generic_parameters): Also use
20750         `klass->wastypebuilder' to check for TypeBuilders.
20751
20752 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
20753
20754         * class.c (mono_class_layout_fields): Fix calculation of has_references
20755         for generic types.
20756
20757         * class.c (inflate_generic_class): Fix a leak.
20758         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
20759         for generic types.
20760
20761 2005-07-11  Martin Baulig  <martin@ximian.com>
20762
20763         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
20764         on error.
20765
20766 2005-07-11  Martin Baulig  <martin@ximian.com>
20767
20768         * loader.c (find_method): Also lookup in
20769         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
20770
20771 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
20772
20773         * appdomain.c (mono_domain_unload): Don't free the error message
20774         before passing it to mono_get_exception_...
20775
20776         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
20777         
20778 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
20779
20780         * threads.c: try to better guess an available RT signal (bug #75387).
20781
20782 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
20783
20784         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
20785         and CACHE_OBJECT.
20786
20787 2005-07-07  Martin Baulig  <martin@ximian.com>
20788
20789         * class.c (mono_type_get_name_full): Return NULL for
20790         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
20791         fixes #75408.
20792
20793 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
20794
20795         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
20796         exit the appdomain as well being aborted.
20797
20798         * threadpool.c: Create all threadpool threads inside the root appdomain, and
20799         change back to the root domain after calling managed code. This enables
20800         appdomains using threadpools to be unloaded.
20801
20802 2005-07-07  Martin Baulig  <martin@ximian.com>
20803
20804         * class-internals.h
20805         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
20806         into `MonoDynamicGenericClass' since we only need it for dynamic
20807         types.
20808
20809         * reflection.c (mono_class_bind_generic_parameters): We don't need
20810         to compute the `parent' here.
20811
20812 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
20813
20814         * culture-info-table.h : regenerated.
20815
20816 2005-07-06  Martin Baulig  <martin@ximian.com>
20817
20818         * icall.c
20819         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
20820
20821         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
20822
20823 2005-07-06  Martin Baulig  <martin@ximian.com>
20824
20825         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
20826         we're doing a signature-only comparision; fixes #74945.
20827
20828 2005-07-06  Martin Baulig  <martin@ximian.com>
20829
20830         * class-internals.h (MonoGenericClass): Moved some things out into
20831         a new `MonoInflatedGenericClass' type.  
20832         (MonoInflatedGenericClass): New type; the `klass' of a
20833         `MonoGenericClass' is now computed lazyly in
20834         mono_get_inflated_generic_class().      
20835
20836         * class.c (mono_get_inflated_generic_class): New public function.
20837         (mono_class_inflate_generic_method): Removed the unused
20838         `MonoClass *' argument.
20839         (setup_generic_vtable): Don't call mono_get_inflated_method() on
20840         all the methods.
20841         (mono_class_create_generic): Make this static and merge it with
20842         mono_class_create_generic_2(); we're now called automatically from
20843         mono_get_inflated_generic_class().
20844
20845         * loader.c (mono_method_signature): Call
20846         mono_get_inflated_method() here.
20847
20848 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
20849
20850         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
20851         type of fields with RVA.
20852
20853         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
20854         for this pseudo class.
20855         (my_mono_class_from_generic_parameter): Likewise.
20856         (mono_class_init): Allow interfaces to have cctors.
20857
20858 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
20859
20860         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
20861         lazily for AOT methods.
20862
20863 2005-07-05  Martin Baulig  <martin@ximian.com>
20864
20865         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
20866         returns FALSE for a successful match, not TRUE.
20867
20868 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
20869
20870         * loader.c (mono_method_get_index): Optimize this a bit.
20871
20872 2005-07-04  Martin Baulig  <martin@ximian.com>
20873
20874         * class.c
20875         (class_compute_field_layout): Move the check for generic type
20876         definitions into mono_class_layout_fields().  Fixes #74684.
20877         (mono_class_from_generic_parameter): Correctly compute
20878         `klass->parent'; fixes #75457.
20879
20880         * reflection.c (register_assembly, register_module): Make sure
20881         `domain->rejobject_hash' is already created.
20882
20883 2005-07-02  Martin Baulig  <martin@ximian.com>
20884
20885         * class-internals.h
20886         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
20887         `MonoDynamicGenericClass'.      
20888
20889 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
20890
20891         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
20892         returned by a field getter is null, since null is a valid value.
20893
20894 2005-07-01  Martin Baulig  <martin@ximian.com>
20895
20896         * reflection.c (mono_reflection_generic_class_initialize): Update
20897         the `dgclass->fields [i].parent' to the correct class.
20898         (mono_image_get_fieldref_token): Use the declaring type, not the
20899         reflected type.
20900
20901 2005-07-01  Martin Baulig  <martin@ximian.com>
20902
20903         * loader.c (find_method): Also look in the interfaces; fixes #75429.
20904
20905 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
20906
20907         * threads.c (thread_cleanup): assert that thread != NULL
20908         (wait_for_tids_or_state_change): We were using the wrong variable
20909         when accessing wait->threads. `i' was always out of the bounds of
20910         the array.
20911
20912 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20913
20914         * loader.c: map user32 and kernel32 to libMonoSupportW
20915
20916 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
20917
20918         * appdomain.c (unload_thread_main): Mark this as WINAPI.
20919
20920 2005-06-28  Martin Baulig  <martin@ximian.com>
20921
20922         * loader.c (method_from_methodspec): Fix #75334.
20923
20924 2005-06-28  Martin Baulig  <martin@ximian.com>
20925
20926         Fix #74953 - Arrays now implement the generic IList<T> interface
20927         on the 2.0 platform.
20928
20929         * class-internals.h (MonoDefaults): Added `generic_array_class'.
20930
20931         * reflection.c (mono_class_bind_generic_parameters): New public
20932         function; similar to mono_reflection_bind_generic_parameters(),
20933         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
20934
20935         * domain.c (mono_init_internal): Try to initialize.
20936         `mono_defaults.generic_array_class' here; this'll only succeed if
20937         we're using the 2.0 corlib.
20938
20939         * icall.c
20940         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
20941         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
20942         (mono_lookup_internal_call): Added support for nested classes.
20943
20944         * loader.c
20945         (mono_get_method_from_token): Set `result->signature->pinvoke' if
20946         we're an interncall and have generic arguments.
20947
20948         * class.c
20949         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
20950         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
20951         instance of System.Array.InternalArray<T> for arrays, so they
20952         implement the generic IList<T> interface.
20953
20954 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
20955
20956         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
20957         (chastamar@yahoo.com). Fixes #75374.    
20958
20959 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
20960
20961         * culture-info-table.h: regenerated.
20962
20963 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20964
20965         * icall.c: handle spaces correctly for base64 strings.
20966
20967 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
20968
20969         * *.c: Kill some warnings.
20970
20971 2005-06-23  Duncan Mak  <duncan@novell.com>
20972
20973         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
20974         that this builds on Solaris 10 (x86).
20975
20976 2005-06-23  Martin Baulig  <martin@ximian.com>
20977
20978         * class.c
20979         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
20980         generic type definitions.
20981
20982 2005-06-23  Martin Baulig  <martin@ximian.com>
20983
20984         Fix #75331.
20985
20986         * metadata.c (mono_class_get_overrides): Renamed to
20987         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
20988         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
20989         pass it to mono_get_method_full().
20990
20991 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
20992
20993         * reflection.c (mono_reflection_create_runtime_class): take the
20994         mono_domain_lock in this method. Prevents deadlocks
20995
20996 2005-06-22  Martin Baulig  <martin@ximian.com>
20997
20998         * loader.c (method_from_methodspec): Fix #75330.
20999
21000 2005-06-22  Martin Baulig  <martin@ximian.com>
21001
21002         * reflection.c (type_get_qualified_name): Use
21003         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
21004         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
21005         argument; use it if we don't have an assembly name.
21006
21007 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
21008
21009         * object.c: In mono_message_init, set "copy out" flag for in
21010         parameters with the [Out] flag.
21011
21012 2005-06-21  Martin Baulig  <martin@ximian.com>
21013
21014         * class.c
21015         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
21016         and MONO_TYPE_PTR.
21017
21018 2005-06-21  Martin Baulig  <martin@ximian.com>
21019
21020         * class.c (mono_class_init): Don't initialize `class->fields' for
21021         generic instances since they're initialized again in
21022         compute_field_layout(). 
21023         (compute_field_layout): Set the field's `generic_info' here; fix
21024         #75320. 
21025
21026 2005-06-21  Martin Baulig  <martin@ximian.com>
21027
21028         * class-internals.h
21029         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
21030
21031         * metadata.c (mono_metadata_generic_method_equal): Also
21032         distinguish the `generic_class'; fixes #75334.
21033
21034 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21035
21036         * domain.c:
21037         * appdomain.c:
21038         * domain-internals.h:
21039         * reflection.c: 'domain_assemblies' field is now protected by its own
21040         lock. Don't call into managed code to run the AssemblyLoad event if we
21041         now there are no registered delegates for it.
21042
21043 2005-06-20  Martin Baulig  <martin@ximian.com>
21044
21045         * class.c (mono_class_is_assignable_from): Use a custom version of
21046         mono_class_has_parent() to make things work for generic instances;
21047         fix #75300.
21048
21049 2005-06-20  Martin Baulig  <martin@ximian.com>
21050
21051         * loader.c (method_from_methodspec): Apply a patch from
21052         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
21053
21054 2005-06-20  Martin Baulig  <martin@ximian.com>
21055
21056         * class.c (mono_class_init): Reverted Zoltan's last change; it
21057         breaks generics.
21058
21059 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
21060
21061         * threads.c (wait_for_tids_or_state_change): Add missing locking.
21062
21063 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21064
21065         * socket-io.c: fix the index in the socket array for writable/error
21066         sockets. Fixes bug #75306.
21067
21068 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
21069
21070         * class.c (mono_class_init): Allow interfaces to have static ctors.
21071
21072 2005-06-17  Martin Baulig  <martin@ximian.com>
21073
21074         * loader.c (method_from_methodspec): Use `context->container' when
21075         parsing the `gmethod->inst'.
21076
21077 2005-06-17  Martin Baulig  <martin@ximian.com>
21078
21079         * class.c (mono_type_get_name_recurse): Don't add the assembly
21080         name for type arguments.
21081
21082 2005-06-15  Martin Baulig  <martin@ximian.com>
21083
21084         * reflection.c (mono_image_get_inflated_method_token): Encode
21085         correct klass; fixes #75260.
21086
21087 2005-06-13 Michal Moskal <malekith@nemerle.org>
21088
21089         * icall.c: Make GetCorrespondingMethod/Constructor take
21090         MonoReflectionMethod method not MonoMethod. Removed
21091         MonoType.GetCorrespondingField, and make
21092         MonoGenericType.GetCorrespondingField take name not
21093         MonoClassField.
21094
21095 2005-06-13  Michal Moskal <malekith@nemerle.org>
21096
21097         * reflection.c (field_encode_signature, encode_locals):
21098          Make sizes of buffers for types larger (for big generic types).
21099          (create_generic_typespec,
21100          mono_reflection_sighelper_get_signature_local,
21101          mono_reflection_sighelper_get_signature_field):
21102          Add asserts for too small buffers.
21103
21104 2005-06-15  Martin Baulig  <martin@ximian.com>
21105
21106         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
21107         if our parent is not a dynamic type.
21108
21109 2005-06-15  Martin Baulig  <martin@ximian.com>
21110
21111         * class-internals.h (MonoTypeNameFormat): New enum.
21112
21113         * class.c
21114         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
21115         (mono_type_get_full_name): Removed.
21116         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
21117         argument instead of the boolean's.
21118
21119         * icall.c (ves_icall_System_MonoType_getFullName):
21120         Added `gboolean assembly_qualified'.    
21121
21122         * reflection.h
21123         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
21124
21125         * reflection.c (mono_reflection_parse_type): Parse the new type
21126         name format.
21127
21128 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21129
21130         * icall.c: no need to convert from utf16 to utf8 and then back again
21131         after the call to GetLogicalDrives.
21132
21133 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21134
21135         * icall.c: frombase64. Fix problems exposed by new tests.
21136
21137 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21138
21139         * icall.c: added internal calls for converting char [] and strings in
21140         base64 into byte [].
21141
21142 2005-06-10  Martin Baulig  <martin@ximian.com>
21143
21144         * class.c (mono_class_create_generic_2): Read the nested classes
21145         from the metadata rather than from `gklass->nested_classes' since
21146         `gklass' might not be initialized yet.
21147
21148 2005-06-09  Duncan Mak  <duncan@novell.com>
21149
21150         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
21151         all public headers. Fixes #74919.
21152
21153 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
21154
21155         * domain.c: The key for proxy_vtable_hash is now a pointer
21156         array. Added new GHashFunc and GCompareFunc functions for this.
21157
21158         * class.h: The list of interfaces in MonoRemoteClass is known in
21159         advance and can't grow (we create a new MonoRemoteClass if needed),
21160         so now the interface array can be allocated together with
21161         MonoRemoteClass.
21162         
21163         * object.c: Added a new method create_remote_class_key.
21164         Fixed mono_remote_class so it does not depend on
21165         mono_upgrade_remote_class.
21166         Removed extend_interface_array.
21167         Added new method clone_remote_class(), which makes a copy of a remote
21168         class and adds a new interface or class to it.
21169         mono_upgrade_remote_class() now creates a new remote class (or gets
21170         it from the cache) if an vtable upgrade is needed. In this way
21171         we make sure that other objects sharing the same remote class
21172         don't get the new vtable with unwanted interfaces.
21173         
21174         * object-internals.h:
21175         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
21176         
21177         * marshal.c: Track changes in mono_upgrade_remote_class().
21178
21179 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
21180         * icall.c: Add runtime methods for obtaining members of inflated
21181         class, which were created from supplied non-inflated members. It
21182         is used in internal Get{Method,Constructor,Field} methods in
21183         System.Type
21184
21185 2005-06-09  Martin Baulig  <martin@ximian.com>
21186
21187         * reflection.c
21188         (mono_reflection_bind_generic_method_parameters): Fix #75169.
21189
21190 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21191         * reflection.c (mono_image_basic_init): Define
21192         Version in MonoDynamicAssembly. 
21193         
21194 2005-06-08  Martin Baulig  <martin@ximian.com>
21195
21196         Fix #75136.
21197
21198         * loader.c
21199         (mono_method_signature_full): New public method; takes a
21200         `MonoGenericContext *'.
21201         (find_method): Use mono_method_signature_full() and pass the
21202         klass'es context to it.
21203
21204         * class.c (mono_class_is_inflated_method): Use
21205         mono_method_signature_full() and pass the context to it.
21206
21207 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
21208
21209         * object.c: add proper locking in mono_remote_class_vtable(),
21210         fixes possible memory corruption.
21211
21212 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
21213
21214         * marshal.c (mono_remoting_marshal_init): set
21215         initialized after initialization.
21216
21217 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21218
21219         * locales.c : hush.
21220
21221 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
21222
21223         * object.c (extend_interface_array): fix really silly
21224         memory corrupting / comparison bug.
21225
21226 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21227
21228         * reflection.c: Functions added to support the creation
21229         of CustomAttributeData, which includes Attribute data
21230         used by ReflectionOnly methods.
21231
21232         * reflection.h:  mono_reflection_get_custom_attrs_data and
21233          mono_custom_attrs_data_construct added (functions exposed).
21234
21235          * icall.c: Added mono_reflection_get_custom_attrs_data
21236          as icall.
21237         
21238 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
21239
21240         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
21241         lupus's request.
21242
21243 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
21244
21245         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
21246
21247         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
21248         dynamic DllImportAttribute.
21249
21250         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
21251         dynamic DllImportAttribute.
21252
21253         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
21254         Fixes #75162.
21255
21256 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21257
21258         * threads.c: avoid segfault when an unstarted thread is aborted.
21259
21260 2005-06-05  Kornél Pál <kornelpal@hotmail.com>
21261
21262         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
21263         Returns the name and version of the runtime for reporting.
21264
21265 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21266
21267         * appdomain.c: bump corlib version.
21268         * object-internals.h: new field in MonoReflectionAssembly.
21269
21270 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21271
21272         * object-internals.h: Carlos forgot to add this field.
21273
21274 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21275
21276         * icall.c: Added create_version to create instances
21277         of Version of MonoReflectionAssemblyName. This change helps
21278         the AssemblyName tests to keep running fine.
21279         
21280 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
21281   
21282         * object.c (mono_method_return_message_restore): A somehow less
21283         intrusive fix for #75138.
21284
21285 2005-06-03  Raja R Harinath  <rharinath@novell.com>
21286
21287         * object.c (mono_method_return_message_restore): Fix computation
21288         of expected number of out args.
21289
21290 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21291
21292         * reflection.c (mono_image_get_method_info): Fix the case when the
21293         charset is empty.
21294
21295 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
21296
21297         * object.c: Added missing null check in
21298           mono_method_return_message_restore.
21299
21300 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21301
21302         * reflection.c (mono_image_get_method_info): Handle the case when
21303         dllentry is empty.
21304
21305 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
21306
21307         * object.c: When creating the vtable for a proxy, take into account
21308         all inherited interfaces, not only the ones registered in
21309         iclass->interfaces. This fixs bug #74996.
21310         Also, in mono_method_return_message_restore, verify that the array
21311         of out args has the expected lengh.
21312
21313 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21314
21315         * socket-io.c: update the timeout in Poll when the call is interrupte.
21316
21317 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21318
21319         * socket-io.c: support abort/suspend in Select_internal after last
21320         change.
21321
21322 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21323
21324         * threadpool.c: remove warning.
21325
21326 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21327
21328         * icall.c:
21329         * socket-io.[ch]: Select_internal uses poll() now when available, thus
21330         removing the 1024 limit from select(). Runtime part of the fix for
21331         bug #71203.
21332
21333 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21334
21335         * socket-io.c: when resolving the addresses for the same
21336         host returned by gethostname(), get the local IPs from the interface
21337         list. Loopback addresses are discarded if the are interfaces up with
21338         non-loopback ones. Fixes bug #63265.
21339
21340 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
21341
21342         * appdomain.c, verify.c, object-internals.h, reflection.c:
21343         bumped corlib number to 36, and added new extra_flags field
21344         to ReflectionMethodBuilder and friends.  Fixes #75060.
21345
21346 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
21347
21348         * gc.c: register a new weak link only if the object is non-null
21349         (fixes bug#75047).
21350
21351 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21352
21353         * culture-info.h : short time pattern too.
21354
21355 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21356
21357         * culture-info.h : expand long time pattern string length.
21358
21359 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21360
21361         * culture-info-table.h : update (more French date format; #72788).
21362
21363 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
21364
21365         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
21366         the method is static. Fixes #75029.
21367
21368 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
21369
21370         * reflection.c: Update the table_idx field of method builders after
21371         saving the module, since it can change. This is a workaround for
21372         bug #74914. 
21373
21374 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21375
21376         * culture-info-table.h : update (additional French date format).
21377
21378 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
21379
21380         * icall.c (ves_icall_type_Equals): Revert last change.
21381         
21382         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
21383
21384         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
21385
21386 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
21387
21388         * class-internals.h: Added executioncontext_class field to 
21389         MonoDefaults structure.
21390         * domain.c: Cache System.Threading.ExecutionContext class in 
21391         mono_defaults.
21392         * object.c: Capture the ExecutionContext for asynchroneous calls in
21393          mono_async_result_new.
21394         * object-internals.h: Added execution_context and original_context 
21395         fields to MonoAsyncResult. Added execution_context to MonoThread.
21396         * security-manager.c|.h: Added mono_get_context_capture_method to 
21397         return the capture method (if required by the security manager or by
21398         the framework version used).
21399         * threadpool.c: Apply capture (if present) ExecutionContext in 
21400         mono_async_invoke and revert to original context after it completes.
21401
21402 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
21403
21404         * culture-info-table.h : updated (real hacky solution for zh-CHT).
21405
21406 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
21407
21408         * culture-info-table.h : zh-CHT related workaround.
21409
21410 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21411
21412         * marshal.c (emit_marshal_custom): Add some error checking and call the
21413         methods in the ICustomMarshaler interface. Fixes #74875.
21414         
21415         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
21416         native->managed wrappers.
21417
21418 2005-05-12  Martin Baulig  <martin@ximian.com>
21419
21420         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
21421         here and use the loader lock.
21422
21423         * mono-debug.c: Properly lock when the debugger is not attached.
21424         (mono_debug_init): Release the initial lock if we're not running
21425         in the debugger.
21426
21427 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21428
21429         * marshal.c (emit_marshal_custom): Pass through NULL values without
21430         calling the custom marshalling routines.
21431
21432         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
21433         conversion in structures. Fixes #74882.
21434
21435 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
21436
21437         * culture-info-table.h : zh-* cultures were missing.
21438
21439 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
21440
21441         * threads.c: Added a new event background_change_event which is signaled
21442         when a thread changes its background mode.
21443         Moved here several checks previously done in managed code. The checks
21444         require the thread lock, and using the thread lock in managed code
21445         can result in deadlocks.
21446         Merged Start_internal and Thread_internal into a single method. Now 
21447         Thread_internal does all work of creating and starting a thread.
21448         Added icalls for setting and getting the state of the object. Moved from
21449         managed code to avoid locking there.
21450         Added wait_for_tids_or_state_change() which is called instad of
21451         wait_for_tids when waiting for non-backround threads to end. This method
21452         will return if one of the threads ends or the background_change_event
21453         is signaled.
21454         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
21455         the background mode. This method signals the background_change_event
21456         event.
21457         * icall.c:
21458         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
21459         removed Start_internal.
21460         
21461 2005-05-11  Martin Baulig  <martin@ximian.com>
21462
21463         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
21464         to order of some fields to get proper alignment on 64-bit machines.
21465
21466 2005-05-11  Martin Baulig  <martin@ximian.com>
21467
21468         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
21469         changes as they're broken and completely fuck up the debugger.
21470
21471         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
21472
21473 2005-05-10  Martin Baulig  <martin@ximian.com>
21474
21475         * reflection.c (mono_reflection_generic_class_initialize): Don't
21476         call mono_class_setup_parent() here.
21477
21478 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21479
21480         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
21481         send/receive timeout use an integer in milliseconds. We were using a
21482         struct timeval.
21483
21484 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21485
21486         * locales.c:
21487         (internal_get_cultures): reserve the first slot of the array for the
21488         InvariantCulture, which will be filled in managed code.
21489
21490 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
21491
21492         * reflection.c (mono_image_fill_module_table): Initialize the
21493         GENERATION field as well.
21494
21495 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21496
21497         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
21498         Monitor.Enter on the object.
21499
21500 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
21501
21502         * threads.c: Enable the wait for running threads when exiting.
21503         * icall.c: Suspend all threads before exiting.
21504
21505 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
21506
21507         * assembly.c (mono_assembly_load_reference): Fix warning.
21508
21509 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21510
21511         * threadpool.c: changed the default number of threads per cpu. From now
21512         on, the default will be 20 + (5 * number of cpus) instead of 50.
21513
21514 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
21515
21516         * loader.c (mono_method_get_signature_full): Add locking here.
21517
21518 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
21519
21520         * appdomain.c: Moved methods for parsing and freeing assembly
21521         names to assembly.c.
21522         * assembly.c, domain-internals.h: Created public methods for parsing
21523         assembly names. Fixed mono_assembly_load_with_partial_name:
21524         it now finds the best match, taking into account the version,
21525         token and culture specified in the partial name. Also return
21526         the latest version if no version information is specified.
21527
21528 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
21529
21530         * threadpool.c: replace check for SocketAsyncCall class.
21531
21532 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21533
21534         * threadpool-internals.h:
21535         * Makefile.am: added threadpool-internals.h
21536
21537         * threadpool.c: call mono_unhandled_exception on exceptions not handled
21538         that happen in threadpool threads (tested on MS).
21539         (mono_thread_pool_remove_socket): new function that dispatch any pending
21540         AIO call on a socket that is closing. By now only epoll really needs it,
21541         as select/poll wake up when the socket closes.
21542
21543
21544         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
21545
21546 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
21547
21548         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
21549
21550 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
21551
21552         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
21553
21554 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
21555
21556         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
21557         has an abort request, convert it into a suspend request.
21558
21559 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
21560
21561         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
21562         warning for the usage of `UnmanagedFunctionPointerAttribute' which
21563         is not supported yet.
21564
21565 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21566
21567         * image.c: register assemblies loaded from data (bundles) in the loaded
21568         assemblies hash. Fixes bug #74772.
21569
21570 2005-04-29  Martin Baulig  <martin@ximian.com>
21571
21572         * class.c (mono_type_get_name_recurse): Update to the new naming
21573         schema from the latest .NET 2.x beta2.
21574         (mono_class_setup_vtable_general): If we're a generic instance,
21575         copy the vtable from our generic type definition and inflate all
21576         the methods in it.
21577
21578         * loader.c (find_method): Update to the new naming schema from the
21579         latest .NET 2.x beta2.
21580
21581 2005-04-29  Raja R Harinath  <harinath@gmail.com>
21582
21583         * class.c (mono_class_init): Add a mono_loader_unlock to the
21584         #74734 fix.
21585
21586 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
21587
21588         * icall.c (ves_icall_System_Environment_Exit): Remove the 
21589         suspend_all_other_threads () call for the time being, since it can hang.
21590
21591         * threads.c (mono_thread_manage): Similarly, disable the waiting for
21592         the background threads to exit, since it can also hang.
21593
21594         * class.c (mono_class_init): Applied patch from Ankit Jain 
21595         (radical@gmail.com). Avoid pending init errors when a field refers
21596         to a nested class using a typeref. Fixes #74734.
21597
21598         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
21599         this for dynamic modules.
21600
21601 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21602
21603         * threads.c: don't wait for threads that are in the process of aborting
21604         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
21605         and waiting for background threads to finish. This makes xsp and
21606         mod-mono-server exit without random length delays and/or hangs.
21607
21608 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21609
21610         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
21611
21612 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
21613
21614         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
21615         dynamic types to prevent infinite loops. Fixes #74727.
21616
21617         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
21618         ..._is_assignable_to.
21619
21620 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
21621
21622         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
21623
21624 2005-04-25  Martin Baulig  <martin@ximian.com>
21625
21626         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
21627
21628         * domain.c
21629         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
21630
21631         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
21632
21633         * reflection.c (build_compressed_metadata): Set metadata header
21634         version to 2.0.
21635
21636 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
21637
21638         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
21639         number into an integral and a decimal part. Fixes #70473.
21640
21641         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
21642
21643 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
21644
21645         * culture-info-table.h : reflected the latest locale-builder output.
21646
21647 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21648
21649         * threadpool.c: check for SuspendRequested too when deciding if
21650         mono_thread_interruption_checkpoint should be called.
21651
21652 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21653
21654         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
21655         * threads.c: remove interruption_mutex and use Interlocked instead. When
21656         suspending all the threads, wait for all the suspended events at once.
21657         If we're shutting down and get an APC that is going to be queued,
21658         call mono_thread_execute_interruption immediately, as the thread might
21659         be sleeping on a pthread condition or mutex.
21660
21661         * icall.c: call mono_runtime_set_shutting_down before suspending the
21662         threads.
21663
21664         Fixes bug #74693. And now xsp is happier when exiting.
21665
21666 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
21667
21668         * loader.c (mono_stack_walk): Fix #74690.
21669
21670 2005-04-22  Martin Baulig  <martin@ximian.com>
21671
21672         * mono-debug.h (MonoDebugMethodJitInfo): Added
21673         `MonoDebugMethodJitInfo *jit'.
21674
21675         * mono-debug.c (mono_debug_read_method): Cache the
21676         MonoDebugMethodJitInfo in `address->jit'.
21677         (mono_debug_free_method_jit_info): New public method.
21678
21679 2005-04-22  Martin Baulig  <martin@ximian.com>
21680
21681         * class.c (mono_class_is_assignable_from): Disallow
21682         type parameter -> interface.
21683
21684 2005-04-21  Dick Porter  <dick@ximian.com>
21685
21686         * threads.c (mono_thread_create): Turn an assertion into an error.
21687
21688 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
21689
21690         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
21691         
21692         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
21693         Fix some gcc 4.0 warnings.
21694
21695 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
21696
21697         * file-io.c: fix alt dir separator char on unix systems
21698         and cleanup (fixes bug #71214).
21699
21700 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
21701
21702         * marshal.c: Use CALLVIRT instead of CALL when dispatching
21703         a call to a remote domain, since the method may be an
21704         interface method in the client domain. This fixes bug #74192.
21705
21706 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21707
21708         * threadpool.c: recv/send are now performed before going back to managed
21709         code to save one transition.
21710
21711 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21712
21713         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
21714
21715         * metadata/threadpool.c: removed hack to workaround the bug above.
21716
21717         Fixes bug #74618.
21718
21719 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
21720
21721         * reflection.c reflection.h: Fix handling of parameter defaults in
21722         dynamic methods. Also fixes handling of parameter attributes.
21723         Fixes #74609.
21724
21725         * mono-debug.c (mono_debug_close_image): Fix warning.
21726
21727 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21728
21729         * socket-io.h: replaced old unused field with new 'blocking'.
21730         * threadpool.c: restore socket blocking state on windows(tm).
21731
21732 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
21733
21734         * icall.c: don't return the codebase in the AssemblyName[] returned by
21735         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
21736         * object-internals.h: Removed FIXME (fields were presents) and fixed
21737         versioncompat declaration.
21738
21739 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21740
21741         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
21742         not closed, so don't cleanup when it happens.
21743
21744 2005-04-13  Chris Toshok  <toshok@ximian.com>
21745
21746         * mono-debug-debugger.h: change prototype for
21747         mono_debugger_lookup_type.
21748
21749         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
21750         this function, although it should probably be named
21751         mono_debugger_init_type.
21752
21753 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21754
21755         * threadpool.c: fix non-AIO case.
21756
21757 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
21758
21759         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
21760         the built-in profiler to measure just JIT compilation times.
21761
21762 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21763
21764         * threadpool.c: the epollfd might be closed by another thread at
21765         any time, so ignore EBADF at treat it as a "we're closing" sign.
21766
21767 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21768
21769         * threadpool.c: release the semaphores with a count equals to the number
21770         of working threads in both IO and regular pools. Fixed typo that messed
21771         up the count of IO pool threads. Don't initialize the pipe handles if
21772         we're using epoll.
21773
21774 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21775
21776         * threadpool.c: some systems don't like a NULL when deleting the socket
21777         from epoll.
21778
21779 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21780
21781         * threadpool.c: fix semaphore allocation.
21782
21783 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21784
21785         * threadpool.c: added epoll() based implementation for asynchronous IO
21786         that is used instead of the default poll() when available.
21787         It can be disabled by setting MONO_DISABLE_AIO.
21788
21789 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21790
21791         * threadpool.c: windows needs 'closesocket' and instead of returning
21792         0 when the stream is closed while in select, it returns -1. Fixes bug
21793         #74573.
21794
21795 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
21796
21797         * class.c (class_compute_field_layout): Fix the regression caused by
21798         the previous try.
21799
21800 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21801
21802         * threadpool.c: separate pool for socket async. IO.
21803         * threadpool.h: mono_max_worker_threads is not a global any more.
21804
21805 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
21806
21807         * class.c (class_compute_field_layout): Fix #74549.
21808
21809 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21810
21811         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
21812         use 2 connected sockets instead.
21813
21814 2005-04-08  Miguel de Icaza  <miguel@novell.com>
21815
21816         * mono-config.c: Add new entry point for mkbundle
21817         mono_config_parse_memory. 
21818
21819 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21820
21821         * threadpool.c: removed another unused function.
21822
21823 2005-04-08  Ankit Jain  <radical@corewars.org>
21824
21825         * reflection.c (get_default_param_value_blobs): Add 'types'
21826         parameter to get the types encoded in the constant table.
21827         (mono_param_get_objects): Use the type from the constant table,
21828         not the type of the parameter, when creating default values.
21829         Handle null default values correctly.
21830
21831 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21832
21833         * file-io.c:
21834         * file-io.h:
21835         * threadpool.c:
21836         * threadpool.h:
21837         * icall.c:
21838         * socket-io.c: removed dead code for async IO.
21839
21840 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21841
21842         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
21843
21844         * threadpool.c: intercept socket async. calls and pass them to a thread
21845         that is polling and dispatching the job items to the threadpool as
21846         socket become ready. Fixes bugs #71217, #71933.
21847
21848         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
21849         between char and short/ushort arrays.
21850
21851         * socket-io.c: remove dead code.
21852
21853 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
21854
21855         * locales.c,
21856           icall.c : removed InternalToUpper_Comp() and
21857           InternalToLower_Comp().
21858
21859 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
21860
21861         * char-conversions.h : The tables were incorrectly generated. Should
21862           be generated against invariant culture.
21863
21864 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
21865
21866         * object.c (mono_runtime_invoke_array): Fix return value when 
21867         passing pre-created valuetype objects to ctors.
21868
21869         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
21870         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
21871         Fixes #74338.
21872
21873 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
21874
21875         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
21876         only used with --security and hides the wrong corlib version error.
21877
21878 2005-03-30  Joshua Tauberer  <tauberer@for.net>
21879
21880         * class.c: Changed mono_class_name_from_token so that types
21881         outside of a namespace don't have an initial period.  Improved
21882         the g_warning message used in _mono_class_get when loading
21883         fails.
21884         * assembly.c: In mono_assembly_load_reference, when an assembly
21885         can't be found, "No such file or directory" is misleading and
21886         unhelpful because a few paths were checked for the presence of
21887         the assembly.  When that happens (ENOENT), display a nicer
21888         message indicating the directories that were searched.  In all
21889         cases, the warning is made easier to read for non-hackers.
21890
21891 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
21892
21893         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
21894         project/solution.
21895         * appdomain.h|domain.c: Removed inline from functions.
21896         * appdomain.c: Reduced warnings when compiling on windows.
21897         * icall.c: Fixed output_debug declaration to gunichar2*.
21898         * mono-config.c: Reduced warnings when compiling on windows.
21899         * rand.c: Added missing "windows.h". Added missing return value.
21900         * rawbuffer.c: Added missing winsock2.h for windows.
21901         * sysmath.h: Added mono-compiler.h header to allow/ease 
21902         compilation with non-GCC compilers.
21903         * threads.c: Fixed declarations to compile with VS.NET C compiler.
21904         Removed cast warnings.
21905
21906         Adapted from the work of J Lothian (for VC6).
21907
21908 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
21909
21910         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
21911         from default_path.
21912
21913 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
21914
21915         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
21916         the 2.0 profile.
21917
21918 2005-03-27  Raja R Harinath  <harinath@gmail.com>
21919
21920         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
21921         has to be in $(exec_prefix).  $(prefix) is for arch-independent
21922         stuff, and it would probably use $(prefix)/share rather than
21923         $(prefix)/lib.
21924
21925 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21926
21927         * console-io.c: added 2 includes that might be missing.
21928
21929 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
21930
21931         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
21932         profile.
21933
21934         * reflection.c (create_custom_attr): Allocate the params array using
21935         alloca so it gets GC tracking.
21936
21937 2005-03-23  Chris Toshok  <toshok@ximian.com>
21938
21939         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
21940         out some spew.
21941
21942 2005-03-24  Raja R Harinath  <rharinath@novell.com>
21943
21944         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
21945         changes to pick up any changes in prefix, etc.
21946
21947 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
21948
21949         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
21950         
21951         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
21952         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
21953
21954 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
21955
21956         * class-internals.h object-internals.h class.c reflection.c: Extend the
21957         mono_lookup_dynamic_token () function to return the class of the
21958         token as well. 
21959
21960         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
21961         well. Fixes #73848.
21962
21963 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
21964
21965         * security-manager.c: Skip inheritance checks for intra-corlib
21966         class inheritance and method overrides. This skips a lot of checks
21967         and (anyway) permissions cannot work until corlib is loaded.
21968
21969 2005-03-23  Martin Baulig  <martin@ximian.com>
21970
21971         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
21972         MONO_TYPE_GENERICINST.  
21973
21974 2005-03-23  Martin Baulig  <martin@ximian.com>
21975
21976         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
21977
21978 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
21979
21980         * class.c: added locking comments to some functions.
21981         Cache the interface offsets arrays (saves about 20 KB
21982         of runtime memory in a typical app).
21983         Reduce the time overhead in mono_class_setup_supertypes ().
21984
21985 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
21986
21987         * icall.c: speedup and fix leaks in GetMethodsByName and
21988         GetPropertiesByName.
21989
21990 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
21991
21992         * reflection.c: some locking fixes.
21993
21994 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
21995
21996         * metadata.c: added missing break in case statement.
21997
21998 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
21999
22000         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22001         typedbyref return values. Fixes #73941.
22002
22003 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
22004
22005         * security-manager.c|h: Added demandunmanaged method and 
22006         suppressunmanagedcodesecurity class to MonoSecurityManager.
22007         Renamed aptc class to allowpartiallytrustedcallers.
22008
22009 2005-03-17  Martin Baulig  <martin@ximian.com>
22010
22011         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
22012
22013 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22014
22015         * file-io.c: disabled file async. IO using aio_*. It uses the
22016         threadpool now. Workaround for bug #73718.
22017
22018 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22019
22020         * assembly.h, mono-config.c: added code to deal with bundled configs
22021         for bundled assemblies.
22022
22023 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
22024
22025         * *.c, private.h: cleanup, removing old private.h header file.
22026
22027 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
22028
22029         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
22030         and throw_on_unmappable_char attributes.
22031
22032 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
22033
22034         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
22035         _ProcessName_internal.
22036
22037 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
22038
22039         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
22040         #73631.
22041
22042         * icall.c threads.c threads-types.h: Remove slothash icalls as they
22043         are no longer used.
22044
22045 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
22046
22047         * object.c (compute_class_bitmap): Add support for generics. Fixes
22048         #73527.
22049
22050 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22051
22052         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
22053
22054 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22055
22056         * filewatcher.c: commented out the code for windows watcher, as we don't
22057         use it (we use the managed implementation instead).
22058
22059 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22060
22061         * object-internals.h (MonoThread): Remove 'unused1' field.
22062
22063         * appdomain.c: Bump corlib version.
22064
22065         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
22066
22067         * reflection.c (mono_reflection_create_runtime_class): Remove the
22068         AssemblyBuilder.Save optimization since it causes too many problems.
22069
22070 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
22071
22072         * exception.c|h: Added mono_get_exception_reflection_type_load to
22073         create a ReflectionTypeLoadException object.
22074         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
22075         to return NULL is a InheritanceDemand fails during reflection. Updated
22076         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
22077         ReflectionTypeLoadException if an InheritanceDemand fails during 
22078         reflection. Added icall mapping for GetLinkDemandSecurity.
22079         * security-manager.c|h: Added ves_icall_System_Security_
22080         SecurityManager_GetLinkDemandSecurity internal call to return the
22081         class and methods permissions set for a LinkDemand. Removed unused
22082         fields in MonoSecurityManager.
22083
22084 2005-03-10  Martin Baulig  <martin@ximian.com>
22085
22086         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
22087         it's a generic instance.
22088
22089 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
22090
22091         * reflection.c (mono_get_object_from_blob): Applied patch from
22092         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
22093
22094         * class.c (mono_class_is_assignable_from): Another try at fixing 
22095         #73469 without breaking anything.
22096
22097 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
22098
22099         * class.c: (mono_class_is_assignable_from): Revert the last changes
22100         since they don't work with generics.
22101         
22102         * class.c (mono_class_is_assignable_from): Fix build bustage.
22103
22104         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
22105         the managed IsAssignableFrom method. Fixes #73469.
22106
22107         * reflection.c (mono_reflection_call_is_assignable_from): New helper
22108         function.
22109
22110 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
22111
22112         * object.c (mono_load_remote_field_new): Fix returning uninitialized
22113         memory when the remoting callback does not sets the out arguments.
22114         Fixes #73007.
22115
22116         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
22117         by mistake.
22118
22119         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
22120
22121         * object-internals.h (MonoStackFrame): Sync with managed object layout.
22122
22123         * appdomain.c: Bump corlib version.
22124
22125 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
22126
22127         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
22128         function.
22129
22130         * threads.c (mono_thread_attach): Detect threads which are not started
22131         by the GC pthread wrappers.
22132
22133 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
22134
22135         * icall.c: Added new icall for RNG.
22136         * rand.c|h: Added new icall to open the RNG. This allows to share a 
22137         single handle on Linux to access /dev/urandom and fix #73183.
22138
22139 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
22140
22141         * object.c: setting the new vtable in a transparent proxy object must
22142         not change the GC descriptor.
22143
22144 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22145
22146         * object.c: fixed compilation without GCJ support.
22147         * reflection.c: for runtime-created types ensure klass->has_references
22148         is correct (bug #73215).
22149
22150 2005-03-02  Martin Baulig  <martin@ximian.com>
22151
22152         * class.c (mono_class_is_assignable_from): Make this work if
22153         `oklass' is a generic instance; fixes #72831.
22154
22155 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22156
22157         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
22158         with hasthis set.
22159         
22160         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
22161
22162         * marshal.c: Reorganize native->managed marshalling code to also use
22163         the emit_marshal_... functions.
22164
22165 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22166
22167         * object.c: typed allocs have issues with bitmap sizes > 30,
22168         so check for max_set >= 30.
22169
22170 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22171
22172         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
22173         managed code. Fixes #73012.
22174
22175         * metadata.h (MonoMarshalSpec): Add elem_mult field.
22176
22177         * metadata.c reflection.c: Load/Emit elem_mult as well.
22178         
22179         * metadata.h (MonoMarshalSpec): Add comment.
22180
22181         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
22182
22183         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
22184         num_elem to -1 if not given.
22185
22186         * object-internals.h (MonoReflectionMarshal): Add has_size field.
22187
22188         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
22189         given values.
22190
22191 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
22192
22193         * null-gc.c (mono_gc_free_fixed): Was not compilable.
22194
22195 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
22196
22197         * reflection.c (encode_marshal_blob): Encode param_num field as well.
22198
22199         * object-internals.h (MonoReflectionMarshal): Add param_num field.
22200
22201 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22202
22203         * object.c: generalized the reference bitmap creation
22204         and added hooks for the new GC.
22205         * class-internals.c: removed the gc_bitmap field from MonoClass.
22206
22207 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22208
22209         * domain.c: help the compiler to produce better code
22210         in mono_jit_info_table_find ().
22211
22212 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22213
22214         * object.c: make all allocations look typed.
22215
22216 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22217
22218         * socket-io.c: load Mono.Posix if it's not loaded already
22219         (fixes bug#73033).
22220
22221 2005-02-24  Martin Baulig  <martin@ximian.com>
22222
22223         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
22224         * reflection.c (dup_type): Likewise.
22225
22226 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
22227
22228         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
22229         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
22230
22231 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22232
22233         * domain.c, threads.c, object-internals.h: make the critical thread
22234         local vars use the fast access mode (even when we're compiled in
22235         a lib). Provide accessors to be used by the jit during codegen.
22236
22237 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
22238
22239         * appdomain.c: Changed hook functios behavior to include
22240         support for the reflection only assemblies. Some icalls were changed
22241         to support the mentioned assemblies too. Signatures of static methods
22242         try_assembly_resolve and real_load now have an additional parameter:
22243         refonly.
22244
22245         * assembly.c: General changes to mono_assembly_ methods to support
22246         reflection only api. Functions mono_assembly_open, mono_assembly_load,
22247         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
22248         suffix, to support an additional gbool parameter to specify whether
22249         the assembli is reflection only or not. Created some new hook functions 
22250         to add support for reflection only assemblies. Signatures of static 
22251         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
22252         have now an additional parameter: refonly.
22253
22254         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
22255         indicating whether the assembly is reflection only or not.
22256
22257         * exception.c: Add mono_get_exception_invalid_operation.
22258
22259         * icall.c: Throw an InvalidOperationException when trying to invoke
22260         a property/method/event, or trying to set/get the value of a field.
22261         Also add an icall to retrieve the ref_only flag to the
22262         MonoReflectionAssembly.
22263
22264 2005-02-23  Chris Toshok  <toshok@ximian.com>
22265
22266         Part of fix for #72827.
22267         * mono-debug.c (mono_debug_add_method): add lexical block data to
22268         the info we write.  Kind of a hack at the moment - we copy the
22269         lexical block info from the MonoDebugMethodInfo to the
22270         MonoDebugMethodJitInfo here, before writing it.
22271         (mono_debug_read_method): read the lexical block info.
22272
22273         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
22274
22275         * debug-mono-symfile.h: add lexical block support.
22276
22277         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
22278         support.
22279
22280 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22281
22282         * loader.c (mono_lookup_pinvoke_call): Fix warning.
22283
22284         * object.c (mono_runtime_free_method): Call mono_free_method () and
22285         put the TODOs there.
22286
22287         * loader.c (mono_free_method): Free up most memory allocated for 
22288         dynamic methods.
22289
22290 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22291
22292         * reflection.c: properly flag a Type argument to a
22293         named custom attr value (bug #72248).
22294
22295 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22296
22297         * reflection.c: reduce code duplication in named custom
22298         attribute encoding.
22299
22300 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
22301
22302         * reflection.c: properly encode custom attrs of type object
22303         (bug #72649).
22304
22305 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22306
22307         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
22308
22309 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
22310
22311         * socket-io.c: load System.dll if it's not loaded already
22312         (bug #72850 and #70477).
22313
22314 2005-02-21  Martin Baulig  <martin@ximian.com>
22315
22316         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22317         generic instances.
22318
22319 2005-02-21  Martin Baulig  <martin@ximian.com>
22320
22321         * reflection.c (mono_image_build_metadata): We also need to
22322         "fixup" the MethodImpl table after we computed the final method
22323         indices.  Call fixup_methodimpl() to do that.
22324         (fixup_methodimpl): New private method.
22325
22326 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22327
22328         * assembly.c: special case mscorlib.dll (bug#72536),
22329         patch from Carlos Alberto Cortez.
22330
22331 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
22332
22333         * threads-types.h threads.c: Fix build bustage.
22334
22335         * threads.c: Use a union for long<->double conversions.
22336
22337         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
22338         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
22339
22340         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
22341         containing the checkpoint call with NOT_TAKEN.
22342         
22343         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
22344         checkpoint before pushing the arguments, so they won't have to be
22345         spilled to stack.
22346
22347 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22348
22349         * domain.c, assembly.c, domain-internals.h: make some data
22350         const and relocation-free.
22351
22352 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
22353
22354         * object.c, appdomain.c, class-internals.h: introduce the
22355         MonoClassRuntimeInfo structure to hold the info needed to
22356         use a class at runtime. Made mono_class_vtable() lock-free
22357         for all the appdomains.
22358
22359 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
22360
22361         * metadata-internals.h, image.c: introduce a per-image mempool to
22362         be used for memory that has the same lifetime as the image.
22363
22364 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
22365
22366         * domain.c: In mono_init_internal(), instead of selecting the first
22367         runtime version supported by an executable, get a list of all
22368         supported versions and select the one for which an mscorlib exists
22369         (since even if the runtime supports a given version, it doesn't mean
22370         that the framework for that version is installed).
22371         Modified get_runtimes_from_exe to support this behavior.
22372         In supported_runtimes, added information about additional system
22373         assembly versions.
22374         
22375         * assembly.c: Added support for more than one system assembly version
22376         per runtime version. Updated the assembly list.
22377         In mono_assembly_remap_version, removed the initial version check,
22378         since we don't know to which version we need to compare until we
22379         get the version set on which the assembly is based.
22380         Moved the code for loading corlib into the new method
22381         mono_assembly_load_corlib(), so it can be used by the initialization
22382         code.
22383         
22384         * domain-internals.h: Updated data structures and added declaration
22385         for mono_assembly_load_corlib.
22386
22387 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22388
22389         * reflection.c (resolve_object): Fix the creation of the signature in 
22390         the SignatureHelper case.
22391
22392         * assembly.c (mono_assembly_remap_version): Fix binary search.
22393         
22394 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
22395  
22396         * class.c: Added inheritance check when a method is overloaded (from a
22397         virtual method or when implementing an interface) and when a class is
22398         inherited. Added functions to set a failure for a class and to 
22399         retreive the exception from a failure.
22400         * class-internals.h: Added fields to MonoClass to keep the exception
22401         information status for inheritance (or other exceptions) to be thrown
22402         later (i.e. not at load time).
22403         * object.c: Throw the inheritance SecurityException when a type is to 
22404         be created with either class or method inheritance violations.
22405         * reflection.c|h: Fix when getting declsec from a class. Removed 
22406         unrequired code for class. Improved sanity in parameter naming.
22407         * security-manager.c|h: Added functions to check for class and method
22408         inheritance.
22409
22410 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22411
22412         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
22413         and has_finalize in dynamic types as well.
22414
22415 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
22416
22417         * culture-info-table.h : fixed currency format for en-GB (and so on).
22418
22419 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
22420
22421         * gc.c: ensure the GC handles never have 0 as a value.
22422
22423 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22424
22425         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
22426         a pointer to a struct to unmanaged code. Fixes #72625.
22427
22428 2005-02-16  Martin Baulig  <martin@ximian.com>
22429
22430         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
22431
22432 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22433
22434         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
22435
22436 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22437
22438         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
22439
22440         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
22441         UnmanagedFunctionPointerAttribute, use it for determining calling convention
22442         etc. Fixes #71471.
22443
22444         * reflection.c (mono_custom_attrs_get_attr): New helper function.
22445
22446         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
22447
22448 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
22449
22450         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
22451         changes to make the current context a field in MonoThread.
22452
22453 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22454
22455         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
22456         the last change.
22457         
22458         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
22459         extracted from mono_marshal_get_native_wrapper.
22460
22461         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
22462         to create wrappers around native functions.
22463
22464         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
22465         delegates for arbitrary function pointers. Fixes #71472.
22466
22467 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
22468
22469         * threads.c: cleaned up the code a little.
22470
22471 2005-02-15  Martin Baulig  <martin@ximian.com>
22472
22473         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
22474         the data table.
22475
22476         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
22477         allocate larger chunks if needed.
22478
22479 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22480
22481         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
22482         in by mistake.
22483
22484 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
22485
22486         * domain.c: keep the domains in an array and ensure the domain ids
22487         are kept small, so they can be used as indexes to domain-specific data
22488         with a small memory overhead.
22489
22490 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22491
22492         * icall.c: Handle byref types in Type icalls. Fixes #72544.
22493
22494 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
22495
22496         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
22497
22498 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
22499
22500         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
22501
22502         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
22503         values.
22504
22505         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
22506         
22507 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
22508
22509         * domain-internals.h: add the hashtable here.
22510
22511         * class-internals.h: Remove `info' from MonoMethod
22512
22513         * domain.c: Add a new hashtable, jit_trampoline_hash
22514
22515 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
22516
22517         * object.c: don't set the value of static fields
22518         (fixes bug#72494).
22519
22520 2005-02-11  Martin Baulig  <martin@ximian.com>
22521
22522         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
22523         (mono_debug_add_method): Silently ignore the method if it's too big.
22524         (mono_debug_add_type): Likewise.
22525
22526 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
22527
22528         * threads.c, appdomain.c: remove #ifdefs from the code.
22529
22530 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
22531
22532         * metadata-internals.h: Added flags to MonoAssembly to cache the most
22533         common security informations. This allows us to stay in unmanaged code
22534         when doing LinkDemand and it's special cases (except for the first 
22535         time for initialization). The flags a very much used with --security.
22536         * reflection.c|h: Added code to get declarative security attributes 
22537         for LinkDemand and InheritanceDemand. This required to refactor the
22538         existing code for Demand.
22539         * security-manager.c|h: Added new method fields for the special cases
22540         of LinkDemand.
22541
22542 2005-02-10  Martin Baulig  <martin@ximian.com>
22543
22544         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
22545         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
22546
22547 2005-02-10  Martin Baulig  <martin@ximian.com>
22548
22549         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
22550         debugging code; this is almost a complete rewrite.
22551
22552         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
22553
22554 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22555
22556         * domain.c, object.h: expose mono_string_equal () and 
22557         mono_string_hash ().
22558         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
22559         it's implemented in managed code.
22560
22561 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22562
22563         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
22564         lo leak objects between appdomains.
22565
22566 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22567
22568         * assembly.c: old compilers compilation fix from 
22569         robertj@gmx.net (Robert Jordan).
22570
22571 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
22572
22573         * class-internals.h: Little reminder for the future.
22574
22575         * debug-helpers.c: Fix up wrapper_type_names
22576
22577 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22578
22579         * image.c, metadata-internals.h: when loading an image from a file,
22580         mmap all of it and use the same codepaths as when using a
22581         in-memory image: the code is simpler and we use less memory
22582         (both writable and readonly).
22583
22584 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22585
22586         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
22587         API to alloc runtime data structures that need to be tracked by the
22588         GC and contain pointers.
22589         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
22590         make the code more readable and eventually use a different GC.
22591
22592 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
22593
22594         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
22595         for out arguments.
22596         
22597 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
22598
22599         * object.c: In release_type_locks(), don't release the cctor lock
22600         if it has already been released. This fixes a crash in the
22601         thread5 test.
22602
22603 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22604
22605         * gc.c, marshal.c, icall.c: register a delegate for finalization
22606         only when the native function pointer has been allocated for it.
22607
22608 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22609
22610         * object.c: cleaned up some code, allocate objects that are
22611         pointer free with the atomic malloc variant. Allocate memory
22612         for static data from the mempool if it's pointer-free.
22613         Allocate the bounds array at the end of the array data, when needed.
22614         * object-internals.h, object.h: move a private function in a private
22615         header.
22616         * class.c: handle missing case in tracking references in fields.
22617
22618 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22619
22620         * class.c, class-internals.h: keep track if a type has
22621         reference fields in either the instance or static fields.
22622
22623 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
22624
22625         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
22626         and renamed to MonoRuntimeInfo. Added fields to store the expected
22627         framework assembly version. Changed mono_get_framework_version and
22628         mono_get_runtime_version for a single mono_get_runtime_info method.
22629         
22630         * assembly.c: Added method to remap system assembly versions to the
22631         current executing runtime version. Removed old mapping code.
22632         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
22633         
22634         * icall.c, reflection.c: Track api changes.
22635
22636 2005-02-06  Miguel de Icaza  <miguel@novell.com>
22637
22638         * loader.c (method_from_memberref): Improve error reporting,
22639         produce the class name instead of the typeref/typedef index. 
22640
22641 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
22642
22643         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
22644
22645 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22646
22647         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
22648         stdcall and charset name mangling.  Reorganize the code and add
22649         some tracing stuff.
22650
22651 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22652
22653         * monodiet.c: More iters!
22654
22655         * marshal.c: Iter usage.
22656
22657         * icall.c: Iter usage.
22658
22659         * object.c: Use iters.
22660
22661         * debug-helpers.c: More iters
22662
22663 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22664
22665         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
22666         under win32.
22667
22668 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22669
22670         * mono-debug-debugger.c: use iters
22671
22672         * class.c, class-internals.h: mono_class_setup_events is static
22673         now
22674
22675         * All callers: use iters
22676
22677 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22678
22679         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
22680         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
22681
22682 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22683
22684         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
22685
22686         * marshal.h: Add prototypes for ldfld/stfld_remote.
22687
22688         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
22689         this is called during startup.
22690         
22691 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
22692
22693         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
22694         MonoThreadsSync struct private in monitor.c. Changed the way
22695         MonoThreadsSync is allocated so it's faster and there is no
22696         need to keep track of it with a finalizer and it uses less memory.
22697         This also finally allows us to allocate mono objects as ptrfree when
22698         there are no reference fields.
22699
22700 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
22701
22702         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
22703         disappearing link to the GC interface and use them to simplify
22704         the gchandles code.
22705
22706 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22707
22708         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
22709         stfld_remote which call mono_load/store_field_new. This allows methods
22710         calling ldfld/stfld wrappers to be AOTed.
22711
22712         * console-io.c: Include sys/filio.h under solaris.
22713         
22714         * console-io.c: Include curses.h if needed correctly.
22715
22716 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
22717         
22718         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
22719         method->klass as well.
22720
22721         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
22722
22723         * class.c (mono_class_init): Switch on lazy initialization of 
22724         methods.
22725
22726         * class.c (mono_class_get_finalizer): Handle the case when the 
22727         finalizer is inherited.
22728
22729 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22730
22731         * console-io.c: <curses.h> is needed by term.h on solaris.
22732
22733 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
22734
22735         * icall.c, class-internals.h, monodiet.c, class.c: Remove
22736         mono_class_setup_properties where possible. Remove this ftn from
22737         the header file, and make it static.
22738
22739 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
22740
22741         * loader.c: Add missing setup_... call.
22742
22743         * class.c: Add missing setup_... calls.
22744
22745         * class.c (mono_class_init): Switch on lazy initialization of 
22746         the generic vtable.
22747         
22748         * class.c (mono_class_init): Fix generics broken by the recent changes.
22749
22750         * monodiet.c (handle_type): Add missing setup_... calls.
22751
22752         * class.c: Back out garbage in previous patch.
22753         
22754         * class.c: Add missing setup_... calls.
22755
22756         * class.c (mono_class_get_method_from_name_flags): Avoid calling
22757         mono_class_setup_methods () if possible.
22758
22759         * class-internals.h (MonoClass): Add 'has_cctor' flag.
22760
22761         * class-internals.h (MonoCachedClassInfo): New structure.
22762
22763         * class.c: Initialize properties and events fields of MonoClass lazily.
22764
22765         * class.c: Add infrastructure for lazily initializing the methods and
22766         vtable fields of MonoClass. Not yet used.
22767
22768         * class.c (mono_class_get_finalizer): New helper function.
22769
22770         * class.c: Add infrastructure for loading some class related data from
22771         an AOT file.
22772
22773         * object.c: Add infrastructure for initializing the vtable from data
22774         in the AOT file.
22775
22776         * gc.c (run_finalize): Use mono_class_get_finalizer ().
22777
22778         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
22779         appropriate initialization function before accessing parts of the
22780         MonoClass structure.
22781
22782         * marshal.c: Fix warnings.
22783         
22784         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
22785
22786         * mono-debug-debugger.c (get_exception_message): Use 
22787         mono_class_get_method_from_name_flags ().
22788
22789 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
22790
22791         * reflection.c, appdomain.c: Replace a few manual searches that
22792         Zoltan missed. (Paolo approved this part of my initial patch).
22793
22794 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
22795
22796         * profiler.c: disable recording statistical events at report time.
22797
22798 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22799
22800         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
22801         to byteswap arrays of enum values, too (bug #72080).
22802
22803 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
22804
22805         * appdomain.c (set_domain_search_path): Allow this to be called if
22806         domain->setup is not yet set.
22807
22808         * loader.c (mono_method_get_index): New helper function.
22809
22810         * loader.c reflection.c: Use mono_method_get_index ().
22811
22812         * class.c (mono_class_get_method_from_name_flags): New helper method.
22813
22814         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
22815         this.
22816
22817         * class.c (mono_class_get_cctor): New helper method.
22818
22819         * string-icalls.c object.c class.c marshal.c reflection.c: Use
22820         mono_class_get_method () to look up methods.
22821
22822 2005-02-01  Miguel de Icaza  <miguel@novell.com>
22823
22824         * console-io.c: Fix the build, this should work on Windows.
22825
22826 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
22827
22828         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
22829         be set to null to keep things valid
22830
22831 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22832
22833         * icall.c: added Console 2.0 icalls.
22834         * Makefile.am: added console-io.[ch]
22835         * console-io.[ch]: internal calls for Console 2.0 API.
22836
22837 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22838
22839         * class.c: make sure we consider all the interfaces
22840         when calculating max_interface_id (bug found by
22841         Jeroen Frijters running ikvm).
22842
22843 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
22844
22845         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
22846         valuetype fields to null.
22847
22848         * object.c (set_value): Ditto. Fixes #71669.    
22849
22850 2005-01-31  Martin Baulig  <martin@ximian.com>
22851
22852         * metadata.c (mono_metadata_has_generic_params): New public
22853         function; checks whether something is a generic method.
22854
22855 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
22856
22857         * appdomain.c: fix infinite recursion when adding assemblies.
22858
22859 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
22860
22861         * object.c: Fix small typo to return all items for Environment.
22862         GetCommandLineArgs.
22863
22864 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22865
22866         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
22867         reflection.c: more domain and assembly-unload related fixes
22868         and memory leaks plugs.
22869
22870 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
22871
22872         * 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.
22873
22874 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
22875
22876         * loader.c (mono_method_signature): Make this method lazy
22877         (mono_get_method_from_token): Don't computate the signature here.
22878
22879         Doing this saves quite a bit of memory. I got 90 kb on starting up
22880         monodoc. It should also save some disk reads on startup.
22881
22882         * *: MonoMethod->signature might be NULL now. You *MUST* use
22883         mono_method_signature.
22884
22885 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
22886
22887         * object.c (mono_runtime_get_main_args): Return an array from the
22888         current domain here. Fixes #71938.
22889
22890 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
22891
22892         * monitor.c: formatting changes to comply with the
22893         mono coding style and remove #ifdefs from the code.
22894
22895 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22896
22897         * metadata.c, private.h: remove some unneeded data
22898         and use a more compact representation for table schemas.
22899
22900 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
22901
22902         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
22903         to get a better distribution in hash tables.
22904         * *.c: use mono_aligned_addr_hash() where appropriate.
22905         * assembly.c: make var static.
22906
22907 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
22908
22909         * domain-internals.h: Put MonoJitInfo on a diet.
22910
22911         * domain.c: Fix a warning.
22912
22913 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22914
22915         * gc.c: rework the gc handles code to reuse handles
22916         when freed.
22917
22918 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
22919
22920         * domain.c: fixed long standing bug in mono_string_equal() which
22921         was brought to light with the ldstr changes.
22922
22923 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
22924
22925         * reflection.c: Remove warning by adding missing include for marshal.h
22926
22927 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22928
22929         * domain.c, object.c: change the ldstr_table to hold
22930         MonoString* as keys: makes the runtime isinterned lookup
22931         faster and simplifies memory management.
22932
22933 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
22934  
22935         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
22936         possible to add imperative security checks before calling the icall.
22937         * reflection.c: Return security attributes on the original MonoMethod
22938         (and not the wrapped one). This fix permissions on icalls.
22939
22940 2005-01-25  Dick Porter  <dick@ximian.com>
22941
22942         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
22943         the check for mktime() support actually test the mktime() return
22944         value.  "Fixes" bug 71682, though the output is still different to
22945         MS.
22946
22947 2005-01-25  Martin Baulig  <martin@ximian.com>
22948
22949         * class.c (mono_class_is_assignable_from): Make this work for
22950         generic instances.
22951
22952 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
22953
22954         * marshal.c (mono_string_utf8_to_builder)
22955         (mono_string_builder_to_utf16): We might not have ownership of the
22956         string. In thise case, we need to create a new buffer.
22957
22958         * object-internals.h (mono_stringbuilder_capacity): sb->str might
22959         be null, in which case, use the default capacity.
22960
22961 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22962
22963         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
22964         GC events to the profiler.
22965
22966 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22967
22968         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
22969         if you don't want the GC to run.
22970
22971 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
22972
22973         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
22974         start providing a GC API and keeping different implementations in
22975         their own file.
22976         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
22977
22978 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
22979
22980         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
22981         mmap rather than allocating a huge buffer.
22982         (mono_debug_close_mono_symbol_file): Free the buffer allocated
22983         above.
22984
22985 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
22986
22987         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
22988         and CheckExecutionRights.
22989         * reflection.c|h: Keep the index of the declarative security to be 
22990         used, instead of the pointer, when AOT compiler is used. Also add 
22991         class initialization when requesting demands.
22992         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
22993         CheckExecutionRights. Both properties are now FALSE by default, and
22994         unmodifiable, unless the --security option is used.
22995
22996 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22997
22998         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
22999         reflection.c: properly refcount images and assemblies, many leaks fixed.
23000
23001 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23002
23003         * threadpool.c: increase the timeout for threads in the thread pool to
23004         10s.  Fixes bug #67159.
23005
23006 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
23007
23008         * class-internals.h: Sun's compiler insists on explicit
23009         signed on bit fields to handle then correctly.
23010
23011 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
23012
23013         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
23014         Make the size of the array fit only the number of invalid path
23015         chars that we have.
23016
23017         * class.c (_mono_class_get): Improve the error reporting when a
23018         class referenced is not found, to assist debugging. 
23019
23020 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
23021
23022         * threads.c: fix off-by-one error.
23023         * domain.c: free data allocated in the domain.
23024
23025 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23026
23027         * reflection.c (mono_method_body_get_object): Fill out exception info
23028         as well.
23029
23030         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
23031         structure.
23032         
23033 2005-01-19  Martin Baulig  <martin@ximian.com>
23034
23035         * loader.c (mono_get_method_constrained): Make this work again.
23036
23037 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23038
23039         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
23040         guint16 to match the managed side.
23041
23042         * reflection.c (mono_reflection_body_get_object): Fill out local
23043         variables array.
23044
23045         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
23046         as well.
23047
23048         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
23049         'local_var_sig_token'.
23050
23051 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
23052
23053         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
23054         System.Drawing.
23055
23056         * reflection.c (mono_method_body_get_object): Handle abstract and
23057         runtime methods.
23058
23059 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
23060
23061         * marshal.c, loader.c, class-internals.h, reflection.c:
23062         store the emthod data for a wrapper in an array instead of a list.
23063
23064 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
23065
23066         * marshal.c: change the code to allocate memory more
23067         conservatively for method wrappers.
23068
23069 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
23070
23071         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
23072         fields from MonoClass to the marshal info structure where they belong.
23073
23074 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
23075
23076         * class.c, object.c, class-internals.h, marshal.c: rearrange
23077         some fields and tweak some types to lower memory usage.
23078
23079 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
23080
23081         * threads.c (signal_thread_state_change): Handle the case when the
23082         target thread is the current thread.
23083
23084         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
23085
23086         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
23087         emit_ptr_to_object_conv. 
23088
23089         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
23090         marshalling. Fixes #71352.
23091
23092 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
23093
23094         * metadata.h, blob.h: move table enum to blob.h so it can be included
23095         in any header.
23096         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
23097         cut the size of MonoImage/MonoDynamicImage.
23098
23099 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
23100
23101         * profiler.c (mono_profiler_install_simple): Fix default arguments.
23102
23103 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
23104
23105         * reflection.c, reflection.h, icall.c: add a function to check
23106         if an attribute type is defined for a metadata object.
23107
23108 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
23109
23110         * object-internals.h: Added some needed fields from StringBuilder class.
23111         * marshal.c: Set the maxCapacity when creating a StringBuilder.
23112
23113 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
23114
23115         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
23116         threads before shutting down the runtime.
23117
23118         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
23119
23120 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
23121
23122         * object-internal.h, threads.c: implement stacksize and 
23123         parameterized thread start functionality (requires
23124         matching corlib). Marked broken code for later removal.
23125
23126 2005-01-12  Martin Baulig  <martin@ximian.com>
23127
23128         * class-internals.h (MonoGenericClass): Moved the `initialized'
23129         flag to MonoDynamicGenericClass, removed `init_pending'.
23130         (MonoGenericInst): Added `is_reference' flag.
23131
23132 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
23133
23134         * reflection.c (mono_image_create_pefile): Only set the pe_offset
23135         inside the MSDOS header. Fixes #71201.
23136
23137         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
23138         gc thread.
23139         (mono_domain_finalize): Ditto.
23140
23141 2005-01-12  Martin Baulig  <martin@ximian.com>
23142
23143         * class.c (mono_get_shared_generic_class): Use the cache for
23144         non-dynamic generic classes.
23145
23146         * class-internals.h (mono_class_create_generic_2): Removed
23147         function prototype, this function is now static inside class.c.
23148
23149         * class.c (mono_class_create_generic_2): Made this static, only
23150         call it from mono_class_init() and mono_class_setup_parent().
23151         (collect_implemented_interfaces_aux): Call mono_class_init() on
23152         the interfaces we collect.
23153         (mono_class_setup_vtable): Call mono_class_init (class->parent).
23154
23155 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23156
23157         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
23158         it a real thread handle.
23159
23160         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
23161         MonoJitExceptionInfo, since each catch clause needs its own variable.
23162         
23163 2005-01-11  Dick Porter  <dick@ximian.com>
23164
23165         * image.c (mono_pe_file_open): New variant on mono_image_open()
23166         that does not set up the CLI metadata; used for FileVersionInfo so
23167         it can get the data for windows binaries too.
23168         
23169         * process.c (process_read_string_block): Don't read off the end of
23170         the StringTable block.
23171
23172         These both fix bug 70766.
23173
23174 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
23175
23176         * gc.c: set some fields to NULL at GC cleanup time.
23177         * threads.c: if we quit the main thread, call exit ().
23178
23179 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23180
23181         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
23182
23183 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
23184
23185         * threads.h, threads.c, object.c: added accessor and settor for
23186         main_thread. Handle it specially when exiting from it: wait
23187         for other foreground threads to exit.
23188
23189 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
23190
23191         * process.c, verify.c: remove some bloat.
23192
23193 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
23194
23195         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
23196         the calling convention to cdecl under win32.
23197
23198 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
23199
23200         * object.c (mono_object_get_size): New function to get the size of
23201         an object instance.
23202
23203         * profiler.c (simple_allocation): Use above.
23204
23205 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
23206
23207         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
23208         ves_icall_System_AppDomain_getRootDomain (as it's not required to
23209         get an appdomain by it's id and we can't assume the root's id is 0).
23210         * domain-internals.h: Change the function prototype to match.
23211         * icall.c: Change the icall table for AppDomain.
23212
23213 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
23214
23215         * locales.c (string_invariant_compare_char): Only compute
23216         GUnicodeTypes in the case where we need them.  Test for ordinality
23217         first and return if so.
23218
23219         From the commit:
23220
23221                 /*
23222                  * FIXME: here we must use the information from c1type and c2type
23223                  * to find out the proper collation, even on the InvariantCulture, the
23224                  * sorting is not done by computing the unicode values, but their
23225                  * actual sort order.
23226                  */
23227
23228 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
23229
23230         * loader.c: for P/Invoke methods, allow the "Internal" shared
23231         library name to refer to the calling process symbol namespace.
23232
23233 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
23234
23235         * Makefile.am: Add the security manager to the build.
23236         * security-manager.c|h: New. Initialization of the security manager.
23237
23238 2005-01-07  Dick Porter  <dick@ximian.com>
23239
23240         * threads.c: 
23241         * monitor.c: Update thread state during Monitor and WaitHandle
23242         waits.  Fixes bug 71031.
23243
23244 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
23245
23246         * reflection.c (property_encode_signature): Correctly handle when the
23247         property has no methods.
23248
23249 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
23250
23251         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
23252         
23253         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
23254         fields from mb, not rmb. Fixes #71017.
23255
23256         * marshal.c (emit_ptr_to_str_conv): Add support for 
23257         ByValTStr -> string conversion. Fixes #71015.
23258
23259         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
23260
23261         * mempool.c (mono_mempool_contains_addr): New helper function.
23262
23263 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23264
23265         * metadata.c (mono_metadata_compute_size): Fix size calculation of
23266         HasSematics encoded fields.
23267         
23268         * metadata.c (mono_type_to_unmanaged): Improve error message for 
23269         invalid string marshalling.
23270
23271         * metadata.c: Fix warnings.
23272         
23273 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
23274
23275         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
23276         profiler support.
23277
23278 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23279
23280         * domain.c object.c domain-internals.h: Revert part of r38077 since the
23281         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
23282         tests.
23283
23284 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
23285
23286         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
23287         so methods containing these can be AOTed.
23288
23289 2005-01-03  Martin Baulig  <martin@ximian.com>
23290
23291         * loader.c (find_method): Removed the hack for generic instances.
23292         (method_from_memberref): If our parent is a generic instance, pass
23293         its generic type definition to find_method() and then inflate the
23294         method.
23295         (mono_get_method_constrained): Pass the generic type definition to
23296         find_method() and inflate the method later.
23297
23298         * class-internals.h (MonoStats): Added `generic_class_count'.
23299
23300         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
23301         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
23302
23303         * reflection.c (mono_custom_attrs_from_params): Don't ignore
23304         generic type definitions.
23305
23306 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
23307
23308         * loader.c icall.c: Fix warnings.
23309
23310 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
23311
23312         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
23313         blittable types. Fixes #70864.
23314
23315 2004-12-29  Martin Baulig  <martin@ximian.com>
23316
23317         * icall.c
23318         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
23319
23320         * reflection.c (mono_method_get_object): Create a
23321         "System.Reflection.MonoGenericMethod" for inflated methods; don't
23322         call mono_get_inflated_method().
23323
23324         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
23325
23326 2004-12-27  Martin Baulig  <martin@ximian.com>
23327
23328         * class-internals.h (MonoMethod): Added `is_inflated' flag.
23329         (MonoMethodInflated): Added `inflated' field.
23330
23331         * class.c (mono_class_inflate_generic_method): Don't really
23332         inflate the method here; just set the `is_inflated' flag in the
23333         MonoMethod.
23334         (mono_class_get_inflated_method): Actually inflate the method here
23335         if it's not already inflated; we use the MonoMethodInflated's new
23336         `inflated' field as a cache.
23337
23338 2004-12-26  Martin Baulig  <martin@ximian.com>
23339
23340         * class.c
23341         (inflate_generic_class): Moved some code out of inflate_generic_type().
23342         (mono_class_inflate_generic_method): If we're already inflated,
23343         inflate the context and use the declaring method; ie. make sure
23344         the declaring method of an inflated method is always the generic
23345         method definition.
23346         (mono_class_create_from_typedef): Create
23347         `class->generic_container->context->gclass'.
23348
23349 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
23350
23351         * metadata-internals.h, marshal.c, reflection.c: More
23352         MonoGHashTable->GHashTable.
23353
23354         * domain-internals.h, class.c: Change MonoGHashTable's into
23355         GHashTables for some cases where no gc stuff is used
23356
23357         All users: update apis
23358
23359 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
23360
23361         * metadata.c (builtin_types): Make this `const'. Makes this get
23362         put into the shareable section.
23363         (mono_metadata_init): Casts to make gcc happy.
23364
23365 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
23366
23367         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
23368
23369 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
23370
23371         * icall.c: Added an internal call to retrieve the position and length
23372         of assembly-level declarative security attributes (RequestMinimum, 
23373         RequestOptional and RequestRefuse). This is used by the Assembly class
23374         to re-create the corresponding permission sets.
23375
23376 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
23377
23378         * marshal.c: fix the stelemref wrapper to be type correct
23379         (and faster).
23380
23381 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
23382
23383         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
23384         to do key & 0x7fffffff. Hashtable already does this. It just
23385         results in longer code.
23386
23387 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
23388
23389         * appdomain.c: Bump corlib version.
23390         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
23391         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
23392         * reflection.c|h: Add functions to get declarative security infos
23393         (blob position and length) for assemblies, classes and methods.
23394
23395 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
23396
23397         * reflection.c: sort the constant table (bug #70693).
23398
23399 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
23400
23401         * object-internals.h, threads.c, domain.c: add accessors for
23402         the MonoThread and MonoDomain tls keys.
23403
23404 2004-12-18  Martin Baulig  <martin@ximian.com>
23405
23406         * class.c (inflate_generic_type): If we're inflating a generic
23407         instance, set `ngclass->context->container = context->container';
23408         ie. the container we inflated into.
23409
23410         * metadata.c (mono_metadata_parse_generic_param): Reflect above
23411         inflate_generic_type() changes.
23412
23413 2004-12-17  Martin Baulig  <martin@ximian.com>
23414
23415         * class-internals.h
23416         (MonoGenericClass): Replaced `MonoType *generic_type' with
23417         `MonoClass *generic_class'.  Removed `dynamic_info'; if
23418         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
23419         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
23420
23421 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
23422
23423         * exception.c (mono_exception_from_token): New helper function.
23424
23425 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
23426
23427         * assembly.c (mono_assembly_load_with_partial_name): Call 
23428         mono_assembly_loaded before invoking the preload hooks. Fixes
23429         #70564.
23430
23431         * object-internals.h (MonoThread): Change culture_info and 
23432         ui_culture_info into an array.
23433
23434         * threads.c: Cache culture info objects from more than one appdomain.
23435
23436         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
23437         current UI culture.
23438
23439 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
23440
23441         * threads.h threads.c appdomain.c: Clear the culture_info field of
23442         all threads during unloading if they point to an object in the dying
23443         appdomain.
23444
23445 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
23446
23447         * culture-info.h (TextInfoEntry): New struct
23448         * object-internals.h: sync with managed
23449         * locales.c: fill the `text_info_data' field
23450         * culture-info-tables.h: update
23451
23452 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
23453
23454         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
23455         collector.
23456
23457 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
23458
23459         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
23460         (ves_icall_ModuleBuilder_getMethodToken): Ditto
23461
23462 2004-12-12  Martin Baulig  <martin@ximian.com>
23463
23464         * mono-debug-debugger.c (write_type): If we're an enum and the
23465         builtin types have already been initialized, call mono_class_init().
23466
23467 2004-12-11  Martin Baulig  <martin@ximian.com>
23468
23469         * metadata.c (mono_metadata_load_generic_params): Added
23470         `MonoGenericContainer *parent_container' argument; automatically
23471         compute `container->is_method'; pass the correct owner to
23472         get_constraints().      
23473
23474         * reflection.c (compare_genericparam): Sort the GenericParam table
23475         according to increasing owners. 
23476
23477 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
23478
23479         * profiler.c: allow disabling the default profiler.
23480
23481 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
23482
23483         * decimal.c, icall.c: allow disabling System.Decimal support.
23484
23485 2004-12-09  Marek Safar <marek.safar@seznam.cz>
23486
23487         * reflection.c: Add support for null attribute arguments.
23488
23489 2004-12-09  Martin Baulig  <martin@ximian.com>
23490
23491         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
23492         names to get rid of compiler warnings.
23493
23494 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23495
23496         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
23497         mono_marshal_load_type_info (). Fixes #69625.
23498         (mono_marshal_get_ptr_to_struct): Likewise.
23499
23500 2004-12-08  Martin Baulig  <martin@ximian.com>
23501
23502         * mono-debug.h: Bumped version number to 47.
23503
23504         * mono-debug-debugger.c
23505         (mono_debugger_event_handler, mono_debugger_event): Take two
23506         guint64 arguments insteed of a gpointer and a guint32.  
23507
23508 2004-12-08  Martin Baulig  <martin@ximian.com>
23509
23510         * debug-mono-symfile.h
23511         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
23512         `address' to `native_offset'.
23513
23514 2004-12-08  Martin Baulig  <martin@ximian.com>
23515
23516         * class.c (mono_class_create_from_typespec): Only inflate if we
23517         either have `context->gclass' or `context->gmethod'.
23518
23519 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23520
23521         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
23522
23523         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
23524
23525         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
23526
23527         * reflection.c (mono_assembly_get_object): Remove the workaround put
23528         in for the release.
23529         
23530         * appdomain.c: Use the corlib_internal field from MonoAssembly.
23531
23532         * appdomain.c: Bump corlib version.
23533
23534         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
23535         be visible in other appdomains.
23536
23537 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
23538
23539         * threads.c: Interlocked inc and dec for longs were messed up,
23540         use a KISS based impl for this. Fixes 70234
23541
23542 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
23543
23544         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
23545
23546 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
23547
23548         * icall.c: fix to follow policy not to allow struct
23549         arguments in icalls.
23550
23551 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23552
23553         * process.c: make the patch that handles spaces in file paths work
23554         on mono/windows too.
23555
23556 2004-12-06  Martin Baulig  <martin@ximian.com>
23557
23558         * class.c (mono_class_create_generic): Call
23559         mono_class_setup_supertypes() if we're dynamic.
23560         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
23561
23562 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
23563
23564         * object-internals.h: Add new fields to MonoThread.
23565
23566         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
23567
23568         * icall.c threads-types.h threads.c: Add new icalls.
23569
23570         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
23571
23572         * object-internals.h (MonoReflectionAssembly): Sync object layout with
23573         managed side.
23574
23575         * appdomain.c: Bump corlib version.
23576
23577         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
23578         internal assemblies. Fixes #69181.
23579
23580 2004-12-05  Martin Baulig  <martin@ximian.com>
23581
23582         * class.c (mono_class_inflate_generic_signature): Make this a
23583         no-op if `context' is NULL or we don't have any type parameters;
23584         also copy `sentinelpos'.        
23585
23586 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
23587
23588         * image.c: Add unbox_wrapper_cache.
23589
23590         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
23591
23592         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
23593         function generator.
23594         
23595         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
23596         Fixes #70173.
23597
23598         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
23599         
23600 2004-12-04  Martin Baulig  <martin@ximian.com>
23601
23602         * loader.c (mono_method_get_signature_full): New public function;
23603         like mono_method_get_signature(), but with an additional
23604         `MonoGenericContext *' argument.
23605
23606         * class.c (mono_class_inflate_generic_signature): Formerly known
23607         as inflate_generic_signature(); make this public.
23608
23609 2004-12-04  Martin Baulig  <martin@ximian.com>
23610
23611         * metadata.c
23612         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
23613         instead of a `MonoGenericContainer *'.  
23614         (mono_metadata_parse_array_full): Likewise.
23615         (mono_metadata_parse_signature_full): Likewise.
23616         (mono_metadata_parse_method_signature_full): Likewise.
23617         (mono_metadata_parse_generic_inst): Likewise.
23618         (mono_metadata_parse_generic_param): Likewise.
23619         (mono_metadata_parse_mh_full): Likewise.
23620         (mono_type_create_from_typespec_full): Likewise.
23621
23622 2004-12-03  Martin Baulig  <martin@ximian.com>
23623
23624         * class-internals.h (MonoGenericContainer): Replaced the
23625         `MonoGenericContext * pointer with a `MonoGenericContext'
23626         structure and made it the first element.
23627
23628 2004-12-03  Martin Baulig  <martin@ximian.com>
23629
23630         * class.c
23631         (inflate_generic_type): Set the `context->container' when creating
23632         a new MonoGenericContext.
23633         (mono_class_inflate_generic_method): Likewise.
23634         (mono_class_create_from_typespec): Just use `context->container'
23635         to get the container.
23636
23637         * loader.c (method_from_methodspec): Set `context->parent' from
23638         `context->container' - and if that's a method container, use its
23639         parent.  Also set the `context->container' when creating a new
23640         MonoGenericContext.
23641         (mono_get_method_from_token): Use just `context->container' to get
23642         the container.
23643
23644         * metadata.c (do_mono_metadata_parse_generic_class): Also set
23645         `gclass->context->container'.
23646
23647         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
23648         the `context->container' when creating a new MonoGenericContext.
23649
23650 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
23651
23652         * reflection.c (compare_genericparam): Sort params with identical
23653         owner by their number. Fixes gen-111 on sparc.
23654
23655 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23656
23657         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
23658         around the domain changes.
23659
23660         * appdomain.c (mono_domain_unload): Handle the case when the thread
23661         calling Unload is itself being aborted during unloading. Fixes #70022.
23662
23663         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
23664
23665         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
23666         checkpoint_func as an icall so it gets a wrapper.
23667         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
23668         in the cross-appdomain wrappers too.
23669
23670         * threads.c (mono_thread_has_appdomain_ref): Make this public.
23671
23672         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
23673
23674         * reflection.c: Fix some memory leaks.
23675         
23676 2004-12-02  Martin Baulig  <martin@ximian.com>
23677
23678         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
23679
23680         * metadata.c (generic_class_cache): New static hashtable.
23681         (mono_metadata_lookup_generic_class): New public method.
23682
23683 2004-12-02  Martin Baulig  <martin@ximian.com>
23684
23685         * class.c (mono_class_create_from_typedef): Call
23686         mono_class_setup_parent() and mono_class_create_mono_type() before
23687         parsing the interfaces.
23688
23689 2004-12-02  Martin Baulig  <martin@ximian.com>
23690
23691         * metadata.c (generic_inst_cache): New static hashtable.
23692         (mono_metadata_lookup_generic_inst): New public function.
23693         (mono_metadata_inflate_generic_inst): New public function.
23694         (mono_metadata_parse_generic_inst): New public function.
23695         (do_mono_metadata_parse_generic_class): Use the new
23696         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
23697         since this'll also use the cache.
23698
23699         * reflection.c (mono_reflection_bind_generic_method_parameters):
23700         Use mono_metadata_lookup_generic_inst() to use the new cache.
23701
23702         * class.c (inflate_mono_type): Use
23703         mono_metadata_inflate_generic_inst() to inflate a generic
23704         instance; this'll also use the new cache.
23705
23706         * loader.c (method_from_methodspec): Use
23707         mono_metadata_parse_generic_inst() and
23708         mono_metadata_inflate_generic_inst() rather than parsing it
23709         manually, so we can use the new cache.
23710
23711 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23712
23713         * threads.c (wait_for_tids): Do not incorrectly free threads when 
23714         the wait times out.
23715
23716 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
23717
23718         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
23719         iter->args based on whether parameters are passed in registers (i.e.
23720         MONO_ARCH_REGPARMS is defined)
23721
23722 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
23723
23724         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
23725         the exception message. Fixes #70070.
23726         (method_from_methodspec): Fix warnings.
23727
23728 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23729
23730         * process.c: (complete_path) return the path quoted
23731
23732 2004-12-01  Martin Baulig  <martin@ximian.com>
23733
23734         * class-internals.h (MonoGenericInst): New structure.
23735         (MonoGenericClass): Replaced `type_argc', `type_argv' and
23736         `is_open' with `MonoGenericInst *inst'.
23737         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
23738         `is_open' with `MonoGenericInst *inst'.
23739
23740 2004-11-30  Martin Baulig  <martin@ximian.com>
23741
23742         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
23743
23744         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
23745         to `generic_class_cache'.
23746
23747         * metadata.c
23748         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
23749         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
23750         (mono_generic_inst_is_valuetype): Renamed to
23751         mono_generic_class_is_valuetype().
23752
23753         * class-internals.h
23754         (MonoGenericInst): Renamed to MonoGenericClass.
23755         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
23756         (MonoClass): Renamed `generic_inst' to `generic_class'.
23757         (MonoGenericContext): Renamed `ginst' to `gclass'.
23758
23759         * object-internals.h
23760         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
23761
23762         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
23763         mono_reflection_generic_class_initialize().
23764
23765         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
23766         now known as "System.Reflection.MonoGenericClass".
23767         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
23768
23769 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
23770
23771         * class-internals.h: Added a flag field to MonoClass to cache the
23772         declarative security attributes actions associated with the class.
23773         * domain-internals.h: Added booleans to MonoJitInfo to cache the
23774         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
23775         applicable to the JITted method.
23776         * reflection.c|h: Added functions to extract (as flags) which security
23777         actions are available (declaratively) for a method, class or assembly.
23778         * metadata.c|h: Added functions to search the declarative security
23779         table in the metadata.
23780         
23781 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
23782
23783         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
23784         EXPORTEDTYPES are already in the class name cache, so there is no
23785         need to add extra code here to look at them. Just removes a bit of
23786         cruft.
23787
23788         (ves_icall_System_Environment_get_TickCount): No need for #if
23789         WINDOWS. We already have the code in io-layer.
23790
23791 2004-11-28  Martin Baulig  <martin@ximian.com>
23792
23793         * loader.c
23794         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
23795         Fixes gen-112.cs.
23796
23797 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
23798
23799         * assembly.c (do_mono_assembly_open): Instead of having a
23800         conditional WITH_BUNDLE, incorporate support for bundles here, by
23801         having a global `bundles' variable holding a pointer to the actual
23802         bundles. 
23803
23804         (mono_register_bundled_assemblies): New API call used by the
23805         bundle code. 
23806
23807         See mkbundle.1 for details.
23808         
23809 2004-11-27  Martin Baulig  <martin@ximian.com>
23810
23811         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
23812         the vtable for generic methods.
23813
23814 2004-11-26  Martin Baulig  <martin@ximian.com>
23815
23816         * metadata.c
23817         (mono_metadata_generic_method_hash): New public function.
23818         (mono_metadata_generic_method_equal): Likewise.
23819
23820         * class-internals.h
23821         (MonoGenericContainer): Added `GHashTable *method_hash'.
23822
23823         * reflection.c (ReflectionMethodBuilder): Added
23824         `MonoGenericContainer *generic_container'.
23825         (reflection_methodbuilder_to_mono_method): Don't create a new
23826         MonoGenericContainer each time we're called.
23827         (mono_reflection_bind_generic_method_parameters): Use
23828         `container->method_hash' to cache the results so we don't create a
23829         different method if we're called several times with the same
23830         arguments.
23831
23832         * loader.c (method_from_methodspec): Use the new
23833         `container->method_hash' here, too.
23834
23835 2004-11-26  Martin Baulig  <martin@ximian.com>
23836
23837         * class.c (inflate_generic_signature): Correctly compute
23838         `res->has_type_parameters'.
23839         (mono_class_vtable): Use the `has_type_parameters' flag to
23840         determine whether we're a generic method.
23841
23842         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
23843
23844 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
23845
23846         * object.c (mono_runtime_run_main): Fix a small memory leak.
23847
23848 2004-11-25  Martin Baulig  <martin@ximian.com>
23849
23850         * class.c (set_generic_param_owner): Fixed the loop.
23851
23852 2004-11-25  Martin Baulig  <martin@ximian.com>
23853
23854         * object.c (mono_class_vtable): Don't create any JIT wrappers for
23855         generic methods.
23856
23857 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
23858
23859         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
23860         names. Fixes #69787.
23861
23862 2004-11-24  Martin Baulig  <martin@ximian.com>
23863
23864         * class.c (mono_class_create_generic_2): If we don't have a
23865         `ginst->parent', inflate `gklass->parent' to get our parent.
23866
23867 2004-11-24  Martin Baulig  <martin@ximian.com>
23868
23869         * reflection.c (compare_genericparam): Correctly sort the
23870         GenericParam table; fixes #69779.
23871
23872 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
23873
23874         * reflection.c: When writing a PE file, don't create a huge
23875         buffer in memory. Just write the arrays we have to the file.
23876         This reduces memory usage.
23877
23878         * metadata-internals.h: MonoDynamicStream pefile is no longer used
23879         globally.
23880
23881 2004-11-17  Martin Baulig  <martin@ximian.com>
23882
23883         * class.c (mono_class_init): Don't setup `class->parent' for
23884         dynamic instances; moved this to mono_class_generic_2().
23885         (mono_class_create_generic): Also set `klass->inited' for dynamic
23886         generic instances.
23887         (mono_class_create_generic_2): Don't do anything for dynamic
23888         generic instances.  Set `klass->parent' here and also call
23889         mono_class_setup_parent() here. 
23890
23891         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
23892         `MonoType *parent' argument; set `ginst->parent' before calling
23893         mono_class_create_generic_2(), so we set the correct parent.
23894
23895 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
23896
23897         * reflection.c: allow getting attributes from ModuleBuilder
23898         (used by ikvm).
23899
23900 2004-11-17  Martin Baulig  <martin@ximian.com>
23901
23902         * class.c (mono_class_create_from_typedef): If a type parameter is
23903         inherited from an outer class, set its owner to that class.
23904
23905 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
23906
23907         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
23908           for (int*) written size. This fixes bug #69592.
23909
23910 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
23911
23912         * icall.c: Added IsAuthenticodePresnet internal call.
23913         * image.c|h: New function that check a MonoImage for an Authenticode
23914         signature in the certificate PE data directory.
23915         * security.c|h: New internal call to ask the runtime if an 
23916         Authenticode signature seems referenced in the PE header.
23917
23918 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
23919
23920         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
23921
23922         * reflection.c (mono_image_create_pefile): Free the assembly streams
23923         after writing out the assembly file.
23924
23925         * object.c (mono_runtime_run_main): Fix small memory leak.
23926
23927         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
23928         property access modifiers. Fixes #69389.
23929
23930 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
23931
23932         * domain.c, object.c, object-internals.h, domain-internals.h,
23933         object.h, marshal.c: keep dynamic code info per domain.
23934
23935 2004-11-15  Martin Baulig  <martin@ximian.com>
23936
23937         * class.c (mono_type_get_name_recurse): Put type arguments in
23938         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
23939         see bug #68387.
23940
23941 2004-11-15  Martin Baulig  <martin@ximian.com>
23942
23943         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
23944         (mono_class_setup_vtable): When computing `the_cname' for a
23945         generic instance, don't include the namespace since we'd otherwise
23946         add it twice.
23947
23948 2004-11-15  Martin Baulig  <martin@ximian.com>
23949
23950         * class.c (mono_class_create_generic): Changed return type to void.
23951         (mono_class_create_generic_2): New public function; setup
23952         `class->method', `class->field' and `class->interfaces' here
23953         instead of in mono_class_init().
23954
23955         * class.h (mono_class_create_generic): Moved to class-internals.h.
23956
23957 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
23958
23959         * reflection.c (mono_image_create_pefile): take a file HANDLE.
23960         rather than writing to memory, write to this file. Right now,
23961         we are just writting into a buffer, and copying that. However
23962         we can avoid the buffer later.
23963
23964         (mono_dynamic_stream_reset): new function
23965
23966         * icall.c, object-internals.h: update for the above.
23967
23968 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
23969
23970         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
23971         have been using gc'd memory. First it is slower, unlikely
23972         the comment in the source code said, secondly, it increases
23973         our footprint to do it in the gc.
23974
23975         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
23976         the method so that it does not have to copy to managed code.
23977
23978 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
23979
23980         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
23981
23982 2004-11-12  Martin Baulig  <martin@localhost>
23983
23984         * reflection.c (mono_image_create_token): Allow generic method
23985         definitions here, since they may appear in an `.override'; see
23986         gen-98/gen-99 for an example.
23987
23988 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
23989
23990         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
23991         #69365.
23992
23993         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
23994         descriptive.
23995
23996 2004-11-11  Martin Baulig  <martin@ximian.com>
23997
23998         * class.c (mono_class_setup_vtable): In an explicit interface
23999         implementation, the method name now includes the arity.
24000
24001 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
24002
24003         * object.c (mono_array_full_copy): Fix warning.
24004
24005 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
24006
24007         * appdomain.c: Removed look_for_method_by_name(). Use the new method
24008         mono_class_get_method_from_name() instead.
24009         
24010         * class-internals.h: Added two new types of wrappers. 
24011         Added MonoRemotingTarget enum. Added new trampoline function type, which
24012         takes an additional MonoRemotingTarget value as parameter, so it is
24013         possible to request a trampoline for a specific target.
24014         
24015         * class.c: Added new mono_class_get_method_from_name() method.
24016         
24017         * class.h: In MonoRemoteClass, we can have now to vtables, one for
24018         general remoting sinks and one specific for cross domain calls.
24019         
24020         * debug-helpers.c: Added new wrapper names.
24021         
24022         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
24023         of a remote class.
24024         
24025         * image.c: Porperly delete value objects form the remoting invoke hashtable.
24026         
24027         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
24028         with several other methods (mono_marshal_get_xappdomain_dispatch,
24029         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
24030         and others) can generate a fast remoting wrapper for cross domain calls.
24031         More information can be found in docs/remoting.
24032         Other changes: Removed mono_find_method_by_name, and used
24033         mono_class_get_method_from_name instead.
24034         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
24035         is stored in the remoting invoke hashtable.
24036         
24037         * marshal.h: published the new method for getting the xdomain wrapper,
24038         and also added a method for getting the adequate wrapper for a given
24039         method and target.
24040         
24041         * object-internals.h, object.c: Added a couple of methods for capying and
24042         cloning arrays.
24043         Modified mono_install_remoting_trampoline, which takes the new remoting
24044         trampoline that has a remoting target as parameter.
24045         mono_class_proxy_vtable now also takes a remoting target as parameter, and
24046         will return the most suitable vtable for the target.
24047         Added mono_remote_class_vtable, which returns the vtable of a remote class
24048         (which can be the normal remoting vtable or the xdomain vtable).
24049         
24050         * threads.c: the xdomain invoke and dispatch wrappers must also be
24051         protected against interruptions.
24052
24053 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24054
24055         * icall.c: use memmove in BlockCopyInternal when the source and
24056         destination arrays are the same.
24057
24058 2004-11-09  Martin Baulig  <martin@ximian.com>
24059
24060         * class-internals.h (MonoGenericContainer): Removed `method' and
24061         `signature', replaced them with `is_method' and `is_signature'
24062         flags.  Added `context'.
24063
24064         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
24065         instead of a `MonoGenericContainer *'.
24066
24067         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
24068         for dynamic type parameters.
24069         (mono_metadata_load_generic_params): Setup `container->context'.
24070
24071         * reflection.c (mono_reflection_setup_generic_class): Setup
24072         `tb->generic_container->context'.
24073         (do_mono_reflection_bind_generic_parameters): Use
24074         mono_class_inflate_generic_type() to correctly inflate types,
24075         rather than using our own hack just for MONO_TYPE_VAR.
24076
24077 2004-11-09  Martin Baulig  <martin@ximian.com>
24078
24079         * class.c (mono_class_inflate_generic_method): Small fix; don't
24080         crash here.
24081
24082         * icall.c
24083         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
24084         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
24085         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
24086         (ves_icall_Type_BindGenericParameters): Likewise.
24087         (ves_icall_Type_get_IsGenericInstance): Likewise.
24088         (ves_icall_Type_GetGenericParameterPosition): Likewise.
24089         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
24090         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
24091         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
24092
24093 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
24094
24095         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
24096         assembly versions and public key tokens. Fixes #69113.
24097
24098 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
24099
24100         * metadata.c: fix bug introduced with the type cache changes
24101         on 2004-11-06.
24102
24103 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
24104
24105         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
24106         the MonoClass pointer instead of the token in exception clauses.
24107         * reflection.c: updates for the above and make the code not depend
24108         on the structure of MonoExceptionClause.
24109
24110 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
24111
24112         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24113         Add support for dynamic assemblies. Fixes #69114.
24114
24115         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
24116
24117 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
24118
24119         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
24120         since most only those methods use it. the code member of
24121         MonoMethodPInvoke was dead, so that can be removed too. Also,
24122         remove inline_count (again, not used), and move slot so that it
24123         can share bits with some other flags. This saves 8 bytes in the
24124         structure and gives us about 50 kb back for mcs helloworld.cs
24125
24126         * *.[ch]: Do naming changes for the above.
24127
24128         * loader.c (mono_method_get_header): Lazily init the header
24129         on first access.
24130         (mono_get_method_from_token): don't init the header here
24131         (mono_free_method): the header may never be allocated
24132
24133         Overall, this saves 150 kb of unmanaged allocations
24134         for mcs helloworld.cs. That accounts for 10% of the unmanaged
24135         memory at runtime.
24136         
24137         * loader.c, loader.h (mono_method_get_header): new accessor.
24138
24139         * *.[ch]: use the above method. Prepares us to lazily load
24140         the header.
24141
24142         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
24143         three warnings, which are actual bugs (see 69206).
24144
24145         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
24146         unused. Saves a cool 4 bytes / method.
24147
24148 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
24149
24150         * metadata.c (builtin_types): Add types for System.Object here.
24151         (mono_metadata_parse_type_full): Cache MonoType*'s that are
24152         for a class or valuetype from klass->this_arg or klass->byval_arg.
24153
24154         On mcs for a hello world, this gets us down from 21836 MonoType's
24155         to 14560.
24156
24157         (mono_metadata_free_type): Account for the above change.
24158
24159 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
24160
24161         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
24162         exception instead of asserting if name is null.
24163         (ves_icall_System_AppDomain_GetData): Ditto.
24164
24165 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
24166
24167         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
24168         EnumBuilder.
24169
24170         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
24171         Return NULL when the domain does not have entry_assembly set.
24172
24173         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
24174         Add a 'resource_modules' argument.
24175         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
24176
24177         * reflection.c (mono_reflection_create_runtime_class): Move setting
24178         of wastypebuilder here, so mono_get_type_object () returns a MonoType
24179         for enums too.
24180
24181         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
24182         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
24183         Throw an ArgumentNullException if 'ptr' is null.
24184
24185         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
24186         assemblies here. Fixes #69020.
24187
24188 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
24189
24190         * reflection.c (build_compressed_metadata): Fix the previous patch for
24191         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
24192         the stack.
24193
24194 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
24195
24196         * assembly.c (mono_assembly_names_equal): Allow a match if one of
24197         the cultures is false. Fixes #69090.
24198
24199         * reflection.c (build_compressed_metadata): Fix invalid memory read 
24200         detected by valgrind.
24201         
24202         * reflection.c (mono_reflection_get_type): Avoid triggering a 
24203         TypeResolve multiple times for the same type. Fixes #65577.
24204
24205 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
24206
24207         * marshal.c: Avoid using ldftn to call managed functions. It is
24208         much slower than just a call.
24209
24210         * reflection.c (mono_module_get_object): free the basename we
24211         allocate here from glib.
24212         
24213         * reflection.c (ensure_runtime_vtable): make sure to free
24214         overrides.  Also, we were allocating an array of MonoMethod not an
24215         array of MonoMethod*.
24216
24217         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
24218
24219         * image.c (mono_image_close): free image->guid here.
24220
24221 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
24222
24223         * reflection.c: Fix some spec conformance issues with the PE file
24224         structures so mcs compiled apps run on the Net 2.0 beta.
24225
24226 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
24227
24228         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
24229         Implement this. Fixes #67264.
24230
24231         * debug-helpers.h debug-helpers.c marshal.c: Move 
24232         mono_find_method_by_name to debug-helpers.c.
24233
24234 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
24235
24236         * object.c (mono_release_type_locks): type_initialization_hash is
24237         a GHashTable.
24238
24239         * reflection.c object.c object-internals.h: Fix warnings.
24240
24241         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
24242         without accessors. Fixes #61561.
24243
24244         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
24245         application base from the root domain if not set. Fixes #65641.
24246         (mono_runtime_init): Fix warning.
24247
24248 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24249
24250         * appdomain.c: call mono_thread_pool_init.
24251         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
24252         of worker threads based on the number of CPUs and the environment
24253         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
24254         for non-windows (windows) systems.
24255
24256 2004-10-27  Chris Toshok  <toshok@ximian.com>
24257
24258         * mono-debug-debugger.c (write_class): don't call mono_class_init
24259         here, as even with the check for (!klass->init_pending), we get
24260         into a situation where we're hitting cycles in class
24261         initialization.  Fixes #68816.
24262
24263 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
24264
24265         * image.c: Avoid overwriting values in the loaded_images_hash when an
24266         assembly is loaded multiple times. Fixes #61152.
24267
24268         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
24269         so multiple satellite assemblies for the same name can be loaded.
24270         Fixes #68259.
24271
24272         * mono_domain_assembly_preload: Actually return the loaded assembly, 
24273         not NULL.
24274
24275         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
24276         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
24277
24278         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
24279         pending finalizers are not invoked after the appdomain has been 
24280         unloaded. Fixes #67862.
24281
24282 2004-10-22  Martin Baulig  <martin@ximian.com>
24283
24284         * mono-debug-debugger.c
24285         (mono_debugger_runtime_invoke): Don't box valuetypes.
24286
24287 2004-10-22  Chris Toshok  <toshok@ximian.com>
24288
24289         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
24290         don't hide private methods.
24291
24292 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
24293
24294         * icall.c: Allows the runtime to "share" (when known) the public key
24295         token of an assembly. This avoid the need to recalculate the token 
24296         (from the public key) in managed code.
24297
24298 2004-10-21  Chris Toshok  <toshok@ximian.com>
24299
24300         * debug-helpers.c (append_class_name): argh, revert last patch.
24301         
24302 2004-10-21  Chris Toshok  <toshok@ximian.com>
24303
24304         * debug-helpers.c (append_class_name): use '+' as the delimiter,
24305         not '/', so that it matches what the debugger uses to look up
24306         methods.
24307
24308 2004-10-21  Martin Baulig  <martin@ximian.com>
24309
24310         * mono-debug-debugger.c (mono_debugger_throw_exception): New
24311         public method; this is called each time an exception is thrown and
24312         allows the debugger to use exception catch points.
24313
24314 2004-10-21  Martin Baulig  <martin@ximian.com>
24315
24316         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
24317         the stack pointer and the exception object in some struct and pass
24318         that to the debugger.
24319
24320 2004-10-21  Chris Toshok  <toshok@ximian.com>
24321
24322         * mono-debug-debugger.c (do_write_class): add instance/static
24323         event support.  We don't expose "raise" or "other" yet.
24324         (event_is_static): new method.
24325
24326 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
24327
24328         * mono-debug-debugger.c
24329         (mono_debugger_handle_exception): Remove
24330         bogus return value for fussy compilers.
24331
24332 2004-10-20  Martin Baulig  <martin@ximian.com>
24333
24334         * mono-debug-debugger.c
24335         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
24336         (mono_debugger_handled_exception): Likewise.
24337
24338 2004-10-20  Martin Baulig  <martin@ximian.com>
24339
24340         * mono-debug-debugger.h (MonoDebuggerEvent): Added
24341         MONO_DEBUGGER_EVENT_EXCEPTION.
24342
24343         * mono-debug-debugger.c (mono_debugger_handle_exception): New
24344         public function to send the debugger a notification for an
24345         exception and inform it about a catch/finally clause.
24346
24347 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
24348
24349         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
24350         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
24351         fix 2.95 build. 
24352
24353         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
24354
24355 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
24356
24357         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
24358         marshalled as [In,Out]. Fixes #58325.
24359
24360 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
24361
24362         * reflection.c (mono_method_body_get_object): Implement some fields.
24363
24364 2004-10-12  Martin Baulig  <martin@ximian.com>
24365
24366         * reflection.c (mono_reflection_bind_generic_parameters): Small
24367         fix, correctly retrieve our parent from a generic instance.
24368
24369 2004-10-12  Martin Baulig  <martin@ximian.com>
24370
24371         * metadata.c (mono_metadata_generic_param_equal): We always have
24372         an owner.
24373
24374         * class.c
24375         (mono_class_from_generic_parameter): We need to have an owner.
24376         (my_mono_class_from_generic_parameter): Likewise.
24377
24378         * reflection.c (mono_reflection_setup_generic_class): Renamed to
24379         mono_reflection_create_generic_class() and added a new
24380         mono_reflection_setup_generic_class().  
24381         (mono_reflection_initialize_generic_param): If we're a nested
24382         generic type and inherited from the containing class, set our
24383         owner to the outer class.
24384
24385 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
24386
24387         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
24388
24389         * reflection.c (mono_method_body_get_object): New function to create
24390         a MethodBody object.
24391
24392         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
24393
24394 2004-10-11  Martin Baulig  <martin@ximian.com>
24395
24396         * metadata.c (_mono_metadata_type_equal): Renamed to
24397         do_mono_metadata_type_equal() and made static.
24398
24399 2004-10-11  Martin Baulig  <martin@ximian.com>
24400
24401         * appdomain.c: Bump corlib version number to 28.
24402
24403 2004-10-10  Martin Baulig  <martin@ximian.com>
24404
24405         * class-internals.h
24406         (MonoGenericInst): Added `MonoGenericContainer *container'.
24407         (MonoGenericMethod): Likewise.
24408         (MonoGenericContext): Likewise.
24409         (MonoGenericParam): Added `MonoGenericContainer *owner'.
24410
24411         * metadata.c
24412         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
24413         (do_mono_metadata_parse_generic_inst): Likewise.
24414         (mono_metadata_parse_type_full): New public method.  This is the actual
24415         mono_metadata_parse_type() implementation - with an additional
24416         `MonoGenericContainer *' argument.
24417         (mono_metadata_parse_array_full): Likewise.
24418         (mono_metadata_parse_signature_full): Likewise.
24419         (mono_metadata_parse_method_signature_full): Likewise.
24420         (mono_metadata_parse_mh_full): Likewise.
24421         (mono_type_create_from_typespec): Likewise.
24422         (mono_metadata_interfaces_from_typedef_full): New public method;
24423         this is similar to the other _full() methods, but we take a
24424         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
24425         (mono_metadata_parse_generic_param): Take an additional
24426         `MonoGenericContainer *' argument and lookup the MonoGenericParam
24427         from that container.
24428         (mono_metadata_generic_param_equal): New static method to compare
24429         two type parameters.
24430         (_mono_metadata_type_equal): New static method; takes an
24431         additional `gboolean signature_only' argument - if true, we don't
24432         compare the owners of generic parameters.
24433         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
24434         with a TRUE argument - do a signature-only comparision.
24435
24436         * loader.c: Use the new _full() methods and pass the
24437         MonoGenericContainer to them.
24438
24439         * object-internals.h (MonoReflectionTypeBuilder): Added
24440         `MonoGenericContainer *generic_container' field.
24441         (MonoReflectionMethodBuilder): Likewise.
24442
24443 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
24444
24445         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
24446         case initial images of dynamic assemblies.
24447
24448         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
24449
24450         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
24451
24452         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
24453         length of event->other array.
24454         (typebuilder_setup_events): Ditto.
24455
24456         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
24457         'assembly_by_name' and add an 'assemblies' list.
24458
24459         * assembly.h assembly.c: Add a new search hook for determining whenever
24460         an assembly is already loaded. Use this instead of searching in the
24461         loaded_assemblies list.
24462
24463         * domain.c appdomain.c: Implement the new search hook so loaded 
24464         assemblies are now scoped by appdomain. Fixes #67727.
24465
24466 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
24467
24468         * threads.c (mono_thread_attach): Initialize synch_lock field so
24469         mono_thread_detach works again.
24470
24471         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
24472         'lib' too. Fixes #63130.
24473
24474 2004-10-06  Jackson Harper  <jackson@ximian.com>
24475
24476         * culture-info-tables.h: regenerated.
24477
24478 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
24479
24480         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
24481         implemented by other interfaces in the result. Fixes #65764.
24482         
24483         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24484         Handle unloadable modules without crashing.
24485
24486         * image.c (load_modules): Revert the previous patch since modules must
24487         have a fixed index inside the array.
24488         
24489         * image.c (load_modules): Don't include native modules in the modules
24490         array.
24491
24492 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
24493
24494         * reflection.h: Add param_defaults field.
24495
24496         * reflection.c: Add support for parameter defaults in dynamic methods.
24497         Fixes #64595.
24498
24499         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
24500         an empty string when a type has no namespace. Fixes #64230.
24501
24502 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
24503
24504         * tabledefs.h: Added "internal" security actions to support non-CAS
24505         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
24506         Note: they do not seems to be used anymore in 2.0 (new metadata format)
24507
24508 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
24509
24510         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
24511         constructor of abstract class. Fixes #61689.
24512
24513 2004-10-04  Martin Baulig  <martin@ximian.com>
24514
24515         * class-internals.h (MonoGenericContainer): New type.
24516         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
24517         `MonoGenericContainer *generic_container'.
24518         (MonoClass): Replaced `gen_params' and `num_gen_params' with
24519         `MonoGenericContainer *generic_container'.
24520
24521         * metadata.c (mono_metadata_load_generic_params): Return a
24522         `MonoGenericContainer *' instead of a `MonoGenericParam *';
24523         removed the `num' argument.
24524
24525 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
24526
24527         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
24528         for dynamic images.
24529
24530         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
24531         machine fields.
24532
24533         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
24534
24535         * reflection.c: Save pe_kind and machine values into the generated
24536         image file.
24537
24538         * appdomain.c: Bump corlib version number.
24539
24540         * object-internals.h: Reorganize layout of LocalBuilder.
24541
24542         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
24543         New helper function.
24544
24545         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
24546         created MonoType for dynamic types. Fixes #66180.
24547
24548 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
24549
24550         * threadpool.c: the ares hashtable needs a critical section around it.
24551         this prevents some nasty segfaults
24552
24553 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
24554
24555         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
24556         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
24557         bug 67324).
24558         
24559 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24560
24561         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
24562         
24563 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
24564
24565         * image.c: Always canonicalize image file names, to avoid loading
24566         the same assembly twice when referenced using a relative path.
24567
24568 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24569
24570         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
24571
24572         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
24573
24574         * marshal.c: Fix warnings.
24575
24576 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
24577
24578         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
24579         attempting to marshal the delegate_trampoline as the method_addr.
24580         This patch has a static hashtable of marshalled delegates so that 
24581         we can map delegate_trampoline addresses back to delegates.  This
24582         allows a delegate passed to managed code to be passed back into native
24583         code.  Fixes #67039
24584
24585 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24586
24587         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
24588
24589         * reflection.c (method_encode_code): Align method headers properly.
24590         Fixes #66025.
24591
24592 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24593
24594         * marshal.c: In the runtime invoke wrapper, reset the abort
24595         exception if it is cached. This avoids the automatic rethrowal of 
24596         the exception after the catch of the wrapper. Also check for pending
24597         interruptions before calling the managed method. This is done using
24598         the new method emit_thread_force_interrupt_checkpoint, since the
24599         normal checkpoint method is ignored when running the invoke wrapper.
24600         * object.c: If the abort exception is rethrown, set the abort_exc
24601         field of the thread, so it will be rethrown aftere every catch.
24602         * threadpool.c: Only run an interruption checkpoint if what has been
24603         requested is a stop of the thread (aborts will be ignored).
24604         * threads.c: By default, a thread will now never be interrumped while
24605         running the runtime invoke wrapper (this ensures that runtime_invoke
24606         will always return to the caller if an exception pointer is provided).
24607         There is a new special method mono_thread_force_interruption_checkpoint()
24608         to force an interruption checkpoint even if running a protected
24609         wrapper, which is used by the same runtime invoke wrapper to do a check
24610         at a safe point.
24611
24612 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24613
24614         * object.c, object-internals.h: Implemented mono_release_type_locks,
24615         which releases the cctor locks held by a thread.
24616         * threads.c, threads.h: In thread_cleanup, release cctor locks held
24617         by a thread. Added mono_thread_exit() method to be used to safely stop
24618         a thread.
24619
24620 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24621
24622         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24623         Move null check before dereference.  Avoid indexing beyond the end
24624         of the 'modules' array.
24625
24626 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24627
24628         * metadata-internals.h (MonoImage): Add module_count field.
24629         * image.c (load_modules): Set image->module_count.
24630         (mono_image_load_file_for_image): Use image->module_count.
24631         * reflection.c (mono_image_load_module): Append to image->modules array 
24632         of dynamic assembly.
24633         (mono_module_get_object): Fix loop to actually increment index.
24634         Use image->module_count.
24635         * assembly.c (mono_assembly_load_references): Use image->module_count.
24636         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
24637         Likewise.
24638
24639 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24640
24641         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
24642         Avoid assert on generic types.
24643
24644 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
24645
24646         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
24647
24648         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
24649
24650         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
24651         function to convert a MarshalSpec structure to its managed counterpart.
24652
24653         * reflection.c: Fix warnings.
24654         
24655         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
24656         field.
24657
24658         * icall.c (mono_create_icall_signature): Fix build.
24659
24660 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
24661
24662         * icall.c: Add MakePointType icall.
24663
24664         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
24665         warnings.
24666
24667 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24668
24669         * threadpool.c: reuse allocated slots in the queue.
24670
24671 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
24672
24673         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
24674
24675         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
24676
24677         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
24678         previous change.
24679
24680         * tabledefs.h: Add constants for pinvoke attributes BestFit and
24681         ThrowOnUnmappableChar.
24682
24683         * icall.c (ves_icall_Type_GetPacking): New icall.
24684
24685 2004-09-24  Martin Baulig  <martin@ximian.com>
24686
24687         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
24688
24689 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24690
24691         * appdomain.c:
24692         (mono_domain_set): allow setting a domain that is being unloaded.
24693         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
24694         being unloaded.
24695
24696 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24697
24698         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
24699         the GetCustomAttributes icall.
24700
24701 2004-09-23  Martin Baulig  <martin@ximian.com>
24702
24703         * object-internals.h (MonoReflectionGenericParam): Replaced
24704         'has_ctor_constraint', `has_reference_type' and `has_value_type'
24705         with `guint32 attrs'.
24706
24707 2004-09-23  Martin Baulig  <martin@ximian.com>
24708
24709         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
24710
24711 2004-09-23  Martin Baulig  <martin@ximian.com>
24712
24713         * object-internals.h (GenericParameterAttributes): New enum.
24714
24715 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24716
24717         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
24718         
24719         * class.c (init_events): Fill out event->other field.
24720
24721         * class.c: Fix warnings.
24722
24723         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
24724
24725 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
24726
24727         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
24728         walk which doesn't supply the IL offset.
24729
24730 2004-09-22  Martin Baulig  <martin@ximian.com>
24731
24732         * reflection.c (mono_reflection_setup_internal_class): If we're
24733         System.ValueType, System.Object or System.Enum, set
24734         `klass->instance_size' and create the vtable.
24735         (mono_reflection_create_internal_class): If we're an enum type,
24736         get the base class from our current corlib.
24737
24738 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
24739
24740         * reflection.h (MonoResolveTokenError): New type.
24741
24742         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
24743         icall.
24744
24745         * icall.c: Add an 'error' argument to the ResolveToken icalls.
24746
24747 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
24748
24749         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
24750         Support also calling constructors, but only for already allocated objects.
24751
24752 2004-09-17  Geoff Norton <gnorton@customerdna.com>
24753
24754         * reflection.c (type_get_qualified_name): If the klass is null
24755         return the typename to avoid a NullRefEx.
24756         (encode_cattr_value): Get the qualified name of the boxed type,
24757         not the underlying enumtype.  Fixes #62984.
24758
24759 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
24760
24761         * marshal.c: Fix problems with previous checkin.
24762
24763 2004-09-21    <vargaz@freemail.hu>
24764
24765         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
24766         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
24767
24768         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
24769
24770 2004-09-21  Geoff Norton <gnorton@customerdna.com>
24771
24772         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
24773         should only return a type for pointers, arrays, and passbyref types.
24774         Fixes bug #63841.
24775
24776 2004-09-21  Martin Baulig  <martin@ximian.com>
24777
24778         * domain.c (mono_debugger_check_runtime_version): New public
24779         function.
24780
24781         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
24782
24783 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
24784
24785         * reflection.c: Added missing sort to the declarative security 
24786         attributes table. MS implementation stops seeing the attributes if the
24787         token number regress in the table (as shown by ildasm and permview).
24788
24789 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
24790
24791         * object-internals.h (MonoReflectionModule): Add 'token' field.
24792         
24793         * reflection.c (mono_reflection_get_token): Add support for Module
24794         and Assembly.
24795         (mono_module_get_object): Set 'token' field.
24796         (mono_module_file_get_object): Set 'token' field.
24797
24798         * icall.c: Add new Assembly and Module icalls.
24799
24800         * appdomain.c: Bump corlib version.
24801
24802 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
24803
24804         * loader.h loader.c class.h class.c: Add helper functions for obtaining
24805         tokens of metadata objects.
24806
24807         * reflection.h reflection.c (mono_reflection_get_token): New function
24808         to obtain the token of a metadata object.
24809
24810         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
24811
24812 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
24813
24814         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
24815         
24816         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
24817
24818 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
24819
24820         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
24821         * object-internals.h: Added 3 MonoArray* members to MonoReflection
24822         AssemblyBuilder to access the permissions set in the class lib.
24823         * reflection.c: Added security attributes encoding step in 
24824         mono_image_build_metadata.
24825         * tabledefs.h: Added new security actions defined in 2.0:
24826         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
24827
24828 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
24829
24830         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
24831         macro parameter.
24832
24833 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
24834  
24835         * locales.c: nullify the ICU_collator member of CompareInfo when it is
24836           finalized. There where random SIGSEVs at program termination, when
24837           an object being finalized was trying to do a string comparison and
24838           the current culture was already finalized.
24839  
24840 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24841
24842         * threads.c: call thread_cleanup before finishing the thread if we get
24843         there.
24844
24845 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
24846
24847         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
24848         assemblies from the parent. Fixes #65665.
24849
24850 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
24851
24852         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
24853         modifiers.
24854
24855 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
24856
24857         * reflection.h: add prototype for mono_get_dbnull_object
24858         * reflection.c: add prototypes for get_default_param_value_blobs 
24859         and mono_get_object_from_blob for fussier compilers
24860
24861 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
24862  
24863         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
24864         false deadlock checks in class initialization.
24865  
24866 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
24867
24868         * image.c (mono_image_addref): Fix comment.
24869
24870         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
24871         possible.
24872
24873 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
24874
24875         * reflection.c (mono_param_get_objects): Modified to return
24876         ParameterInfo.DefaultValue object.
24877
24878         (get_default_param_value_blobs):
24879         (mono_get_object_from_blob):
24880         (mono_get_dbnull_object): New helper routines. 
24881
24882         * object.c (mono_get_constant_value_from_blob): New helper routine
24883         carved out from get_default_field_value ()
24884
24885         * object-internals.h (mono_get_constant_value_from_blob): Added
24886         function declaration.
24887
24888 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
24889
24890         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
24891         referenced assemblies. Fixes #62135.
24892
24893         * exception.h exception.c (mono_get_exception_file_not_found2): New
24894         helper function.
24895
24896 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
24897
24898         * class.h class.c: Add mono_type_get_underlying_type ().
24899
24900 2004-09-09  Geoff Norton <gnorton@customerndna.com>
24901
24902         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
24903         Fix GetTypes() to support dynamically created assemblies.
24904
24905 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
24906
24907         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
24908         
24909         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
24910         previous patch.
24911
24912         * reflection.h reflection.c loader.c: Allow dynamic construction of
24913         pinvoke methods. Fixes #65571.
24914         
24915         * reflection.c (mono_reflection_get_type): Revert previous change since
24916         it causes regressions.
24917
24918 2004-09-08  Martin Baulig  <martin@ximian.com>
24919
24920         * class.c (class_compute_field_layout): Don't call
24921         mono_class_layout_fields() for open generic instances.
24922
24923 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
24924         * threads.c appdomain.c: fix typo in GC macro
24925
24926 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24927
24928         * threads.c: don't call mono_thread_detach() in start_wrapper(),
24929         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
24930
24931 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
24932
24933         * image.c (mono_image_close): Applied patch from 
24934         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
24935         assembly is loaded multiple times from data.
24936         
24937         * image.c (mono_image_open): Fix warning.
24938
24939 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24940
24941         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
24942         once. Fixes #58334.
24943         
24944         * reflection.c (mono_reflection_create_runtime_class): Initialize
24945         klass->nested_classes. Fixes #61224.
24946
24947 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
24948
24949         * threads.c: sched_yield() on exit, to allow threads to quit.
24950
24951 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24952
24953         * object.c (mono_unhandled_exception): Remove leftover debug code.
24954
24955 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
24956
24957         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
24958
24959 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
24960
24961         * marshal.c (emit_marshal_array): Really null terminate string arrays.
24962         
24963         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
24964
24965 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
24966
24967         * marshal.c (emit_marshal_array): Null terminate string arrays.
24968         
24969         * marshal.c (raise_auto_layout_exception): Fix warning.
24970
24971         * reflection.c (mono_param_get_objects): Initialize the default value
24972         with DBNull.Value, not null. Fixes #62123.
24973
24974 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
24975
24976         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
24977         throw an exception with a cute explanation.
24978
24979 2004-09-06  Dick Porter  <dick@ximian.com>
24980
24981         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
24982         Close the new process's thread handle, as we don't use it.  The
24983         handle stays around forever otherwise.
24984
24985 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
24986
24987         * object.c (arith_overflow): Fix warning.
24988
24989         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
24990         calling conventions in method refs. Fixes #65352.
24991
24992         * reflection.c: Fix warnings.
24993
24994 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
24995
24996         * icall.c: Add a new icall for Array.Clear
24997
24998 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
24999
25000         * object.c: When allocating an array, we have to throw
25001         an overflow exception if any of the lengths are < 0.
25002
25003 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25004
25005         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
25006         properly. Also move implementation of string array marshalling to 
25007         managed code. Fixes #42316.
25008
25009 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25010
25011         * assembly.c: provide more information when loading an assembly fails.
25012
25013 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25014
25015         * filewatcher.c: don't expect the development fam package to be
25016         installed.
25017
25018 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
25019
25020         * marshal.c: Make a copy of the signature cookie since it will be
25021         freed by the caller.
25022         
25023         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
25024
25025         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
25026
25027         * metadata.c (mono_metadata_free_marshal_spec): New function to free
25028         marshal specs.
25029
25030         * marshal.c: More refactoring.
25031         
25032         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
25033         smaller functions.
25034
25035 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
25036
25037         * object.c: In mono_message_invoke, fill the output parameter array after
25038           calling the managed method (it was done before the call). This fixes
25039           bug #59299.
25040
25041 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25042
25043         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
25044         as well.
25045
25046 2004-09-02  Martin Baulig  <martin@ximian.com>
25047
25048         * class.c (mono_class_instance_size): Don't allow generic type
25049         definitions or open generic instances.
25050         (mono_class_array_element_size): If we're a value type, call
25051         mono_class_instance_size() on the original class.
25052
25053         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
25054         handle generic instances.
25055
25056         * mono-debug-debugger.c (write_type): Handle generic instances
25057         like classes.
25058
25059 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25060
25061         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
25062         the allocation request fails. Fixes #65089.
25063
25064         * object.c (mono_runtime_free_method): Do not call mono_free_method.
25065         
25066         * object.c (mono_runtime_free_method): New function to free a dynamic
25067         method.
25068
25069         * marshal.c (mono_delegate_free_ftnptr): New function to free the
25070         delegate trampoline.
25071
25072         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
25073         with hasthis as dynamic,
25074
25075         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
25076
25077         * domain.c (mono_jit_info_table_remove): New function to remove an
25078         entry from the jit info table.
25079
25080         * class-internals.h (MonoMethod): Add 'dynamic' field.
25081
25082         * loader.c: Fix warnings.
25083
25084 2004-09-01  Martin Baulig  <martin@ximian.com>
25085
25086         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
25087         instead of mono_debugger_lock() because the latter one is a no-op
25088         unless running in the debugger.
25089
25090 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25091
25092         * class.c (class_compute_field_layout): Classes with auto-layout or
25093         reference fields are not blittable.
25094         
25095 2004-09-01  Dick Porter  <dick@ximian.com>
25096
25097         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
25098         mono_image_get_filename() to get the assembly location.
25099
25100         * icall.c:
25101         * metadata.h: Fix compile warnings
25102
25103 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25104
25105         * class.c (class_compute_field_layout): System.Object is blittable.
25106
25107         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
25108         as in/out. Fixes #59909.
25109
25110 2004-09-01  Martin Baulig  <martin@ximian.com>
25111
25112         * metadata.h (MONO_TYPE_ISREFERENCE): Call
25113         mono_metadata_generic_inst_is_valuetype() if we're a generic
25114         instance to check whether our underlying type is a reference type.
25115
25116 2004-09-01  Martin Baulig  <martin@ximian.com>
25117
25118         * metadata.c (mono_type_size): If we're a generic instance, call
25119         mono_class_value_size() for value types.
25120
25121 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
25122
25123         * marshal.c: Implement more custom marshalling functionality. Fixes
25124         #64915.
25125
25126 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
25127
25128         * mono-debug.c, debug-mono-symfile.c: add some locking love.
25129
25130 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
25131
25132         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
25133
25134         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
25135
25136         * icall.c: Fix some warnings.
25137
25138         * threads.c (abort_appdomain_thread): Fix unref errors.
25139         (mono_thread_current): Fix THREAD_DEBUG define.
25140
25141 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
25142
25143         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
25144
25145         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
25146
25147 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
25148
25149         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
25150         string arrays.
25151
25152 2004-08-28  Martin Baulig  <martin@ximian.com>
25153
25154         * metadata.c
25155         (mono_metadata_generic_inst_is_valuetype): New public function.
25156
25157         * metadata.h (MONO_TYPE_ISSTRUCT): Call
25158         mono_metadata_generic_inst_is_valuetype() if we're a generic
25159         instance to check whether our underlying type is a valuetype.
25160
25161 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
25162
25163         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
25164         #63768.
25165
25166 2004-08-25  Martin Baulig  <martin@ximian.com>
25167
25168         * loader.c (mono_get_method_from_token): Abstract methods can also
25169         be generic and thus have type parameters.
25170
25171         * metadata-internals.h
25172         (MonoDynamicImage): Added `GPtrArray *gen_params'.
25173
25174         * reflection.c (mono_image_get_generic_param_info): Don't create a
25175         metadata row, just add an entry to the `gen_params' array.
25176         (build_compressed_metadata): Sort the `gen_params' array and then
25177         actually create the metadata.
25178
25179 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25180
25181         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
25182
25183 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
25184
25185         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
25186
25187 2004-08-24  Martin Baulig  <martin@ximian.com>
25188
25189         * class.cs (mono_class_is_subclass_of): Like an interface, a
25190         generic instance also derives from System.Object.
25191
25192 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
25193
25194         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
25195         custom modifiers to be in any order. Fixes #61990.
25196
25197 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
25198
25199         * object.c: Register mono_object_new_fast icall.
25200         
25201         * object.c (mono_class_get_allocation_ftn): Return to calling
25202         mono_object_new_fast, since it seems faster to compute the object 
25203         size in unmanaged code than passing it as a parameter.
25204
25205         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
25206
25207         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
25208         this function with Boehm as the oom handler, so we don't have to check
25209         the result of GC_malloc.
25210
25211         * object.c: Remove checks for oom.
25212
25213         * object.h object.c (mono_class_get_allocation_ftn): New function to
25214         return the icall which can be used to allocate an instance of a given
25215         class. 
25216
25217         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
25218
25219         * class-internals.h: Add 'enabled' field.
25220
25221 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
25222
25223         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
25224
25225 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
25226         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
25227         value 0x0010.
25228
25229 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
25230
25231         * appdomain.c: use the Tls function for appdomain too,
25232         at Zoltan's request. Actually return in mono_context_get
25233
25234         * appdomain.c, profiler.c, threads.c: use __thread
25235
25236 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
25237
25238         * appdomain.c threads.c: Call GC_CreateThread on windows.
25239
25240         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
25241         multiple libraries since this don't work on windows.
25242
25243 2004-08-18  Martin Baulig  <martin@ximian.com>
25244
25245         * class-internals.h
25246         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
25247         MonoMethodHeader.
25248
25249         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
25250         MonoMethodNormal since we also need it for abstract and interface
25251         methods.
25252
25253         * reflection.c
25254         (build_compressed_metadata): Sort the GenericParam table.
25255         (mono_image_create_token): Added `gboolean create_methodspec'
25256         argument; this is false when generating a MethodImpl token.
25257         (reflection_methodbuilder_to_mono_method): Abstract and interface
25258         methods may also have generic parameters.
25259
25260 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
25261
25262         * appdomain.c: thread local alloc
25263
25264 2004-08-17  Martin Baulig  <martin@ximian.com>
25265
25266         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
25267
25268         * icall.c
25269         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
25270         argument.
25271
25272         * class.c (mono_type_get_full_name): New public function.
25273         (mono_type_get_name): Don't include the type arguments.
25274
25275 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
25276
25277         * Makefile.am: Build static versions of libmetadata and libmonoruntime
25278         for inclusion into the mono executable.
25279
25280 2004-08-16  Martin Baulig  <martin@ximian.com>
25281
25282         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
25283         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
25284
25285 2004-08-14  Martin Baulig  <martin@ximian.com>
25286
25287         * class.c (dup_type): Also copy the `byref' field.
25288
25289 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
25290
25291         * reflection.c (create_dynamic_mono_image): Revert the last change 
25292         since it breaks bootstrap.
25293
25294 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
25295
25296         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
25297
25298         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
25299         not free them with g_free.
25300
25301 2004-08-11  Martin Baulig  <martin@ximian.com>
25302
25303         * reflection.c (mono_reflection_setup_internal_class): Also call
25304         mono_class_setup_mono_type() if we already have a `tb->type.type'.
25305
25306 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
25307
25308         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
25309         called during default (first) AppDomain creation. Keep track of
25310         Evidence when loading assemblies.
25311
25312 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
25313
25314         * opcodes.c, opcodes.h: reduce runtime relocations.
25315
25316 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
25317
25318         * culture-info.h, locales.c: fixes and chages to sue the new
25319         optimized format of the locale data.
25320         * culture-info-tables.h: regenerated.
25321
25322 2004-08-06  Geoff Norton <gnorton@customerdna.com>
25323         
25324         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
25325
25326 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
25327
25328         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
25329         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
25330         * domain-internals.h: icall declaration.
25331         * icall.c: icall registration.
25332         * object-internals.h: New fields in MonoAssembly for CAS.
25333
25334 2004-08-05  Duncan Mak  <duncan@ximian.com>
25335
25336         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
25337         CEE_LDELEM_ANY.
25338
25339 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
25340
25341         * reflection.c: fix to deal with object[] arrays in custom ctors
25342         (bug #62550).
25343
25344 2004-08-05  Martin Baulig  <martin@ximian.com>
25345
25346         * class.c (mono_class_array_element_size): Added support for
25347         generic instances and correctly handle "recursive" types.
25348
25349 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
25350
25351         * assembly.c: Fix warnings.
25352
25353 2004-08-04  Martin Baulig  <martin@ximian.com>
25354
25355         * class.c
25356         (mono_type_get_name_recurse): Added `gboolean include_arity'
25357         argument specifying whether or not we should include the generic
25358         arity in the type name.
25359         (_mono_type_get_name): New static function.
25360         (mono_class_setup_vtable): If we're a generic instance, don't
25361         include the generic arity in the names of explicit method
25362         implementations.        
25363
25364 2004-08-03  Martin Baulig  <martin@ximian.com>
25365
25366         * class.c (mono_type_get_name_recurse): Enclose the generic type
25367         arguments in `<', '>'.
25368
25369 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25370
25371         * gc.c: make GC warning messages use the trace API, they are just
25372         noise to most of the users.
25373
25374 2004-08-03  Martin Baulig  <martin@ximian.com>
25375
25376         * debug-mono-symfile.c (read_string): Correctly read the string.
25377
25378 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
25379
25380         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
25381         
25382         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
25383         icalls.
25384         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
25385
25386 2004-07-30  Martin Baulig  <martin@ximian.com>
25387
25388         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
25389         Reflect latest symbol writer changes.   
25390
25391 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25392
25393         * object.c: always create an object if null is passed
25394         to Invoke() where a valuetype is expected.
25395
25396 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
25397
25398         * marshal.c (mono_marshal_init): make managed
25399         signatures match native ones better for 64bits.
25400
25401 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25402
25403         * appdomain.c: hack to build correctly the private bin path on windows.
25404         Fixes bug #61991.
25405
25406 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
25407
25408         * assembly.c: Load mscorlib from the correct framework directory
25409           (mono/<version>/mscorlib.dll).
25410         * appdomain.h: Added prototypes for new functions.
25411         * internals.h: Added some prototypes.
25412         * domain.c: When initializing the runtime, get from the executable and
25413           the configuration files the runtime version that the app supports.
25414           Added support methods for reading app.exe.config. Added list of versions
25415           supported by the JIT. Added two new methods: mono_init_from_assembly,
25416           which initializes the runtime and determines the required version from
25417           the provided exe file, and mono_init_version, which initializes
25418           the runtime using the provided version.
25419         * icall.c: Get machine.config from version-specific directory.
25420         * reflection.c: When generating an image, embed the version number
25421           of the current runtime.
25422
25423 2004-07-28  Dick Porter  <dick@ximian.com>
25424
25425         * socket-io.c
25426         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
25427         returned sockaddr size before creating the remote address object.
25428         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
25429         61608.
25430
25431 2004-07-28  Dick Porter  <dick@ximian.com>
25432
25433         * locales.c (string_invariant_compare_char): Fix invariant char
25434         compares between upper and lower cases.  Fixes bug 61458.
25435
25436 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
25437         
25438         * marshal.c: actually cache stelem.ref wrappers.
25439         
25440 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
25441
25442         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
25443         sections and remove the mono_cli_rva_map () function.
25444
25445 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
25446
25447         * debug-mono-symfile.c: fix one more endianess issue, from a patch
25448         by Geoff Norton (<gnorton@customerdna.com>).
25449
25450 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25451
25452         * class.c: fix class loads for pointer types (typeof(int) !=
25453         typeof(int*)).
25454
25455 2004-07-27  Martin Baulig  <martin@ximian.com>
25456
25457         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
25458         reading the debugging information from an external ".mdb" file.
25459
25460 2004-07-24  Martin Baulig  <martin@ximian.com>
25461
25462         * reflection.c (mono_image_get_type_info): Only write a class
25463         layout entry if we actually have a size or a packing size.
25464
25465 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25466
25467         * reflection.c (type_get_fully_qualified_name): 
25468         insert cast to get type checking of ?: with non-gcc compilers
25469
25470 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25471
25472         * rand.c: use g_getenv for both lookups of
25473         MONO_EGD_SOCKET
25474
25475 2004-07-17  Martin Baulig  <martin@ximian.com>
25476
25477         * reflection.c (mono_reflection_bind_generic_method_parameters):
25478         Set `gmethod->reflection_info'.
25479
25480 2004-07-17  Martin Baulig  <martin@ximian.com>
25481
25482         * class.c (mono_class_create_from_typedef): Insert the newly
25483         created class into the hash table before computing the interfaces
25484         since we could be called recursively.
25485
25486 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
25487
25488         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
25489         function to implement stelem.ref in managed code
25490         * class-internals.h, debug-helpers.c: a new wrapper type
25491         for the above.
25492
25493 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25494
25495         * gc.c: allow GC handles to work even when no GC is compiled in.
25496         Fix part of bug #61134 (GetAddrOfPinnedObject).
25497
25498 2004-07-13  Peter Williams  <peter@newton.cx>
25499  
25500         * process.c (complete_path): Make sure we don't attempt to execute
25501         directories.
25502  
25503 2004-07-12  Geoff Norton <gnorton@customerdna.com>
25504
25505         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
25506           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
25507           and will add/subtract the hour if needed
25508
25509 2004-07-12  Martin Baulig  <martin@ximian.com>
25510
25511         * reflection.c (mono_field_get_object): If we have
25512         `field->generic_info', take the attributes from
25513         `field->generic_info->generic_type'.    
25514
25515 2004-07-12  Martin Baulig  <martin@ximian.com>
25516
25517         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
25518         This function must be called before initializing the runtime.
25519         (mono_debug_init_1): New function; call this after initializing
25520         the runtime, but before loading the assembly.  It tells the
25521         debugger to load corlib and the builtin types.
25522
25523         * mono-debug-debugger.c: Did some larger changes in the debugging
25524         code; support recursive class declarations, make sure we actually
25525         add all classes.
25526
25527 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25528
25529         * debug-helpers.c: undo my previous patch and fixed the real issue in
25530         ../mini/exceptions-x86.c
25531
25532 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25533
25534         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
25535         when no HOME env. variable was set and a NullRef was thrown in a .cctor
25536         called from other .cctors.
25537
25538 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
25539
25540         * loader.c: Removed the mono_loader_wine_init hack now that we are
25541         doing a managed version of Windows.Forms.
25542
25543 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
25544
25545         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
25546         threadpool.c, threads.c: remove static data from rootset.
25547
25548 2004-07-09  Dick Porter  <dick@ximian.com>
25549
25550         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
25551         Don't do any more processing if the matched length was 0.  It was
25552         increasing the size of the string before.  Fixes bug 61167.
25553
25554 2004-07-09  Dick Porter  <dick@ximian.com>
25555
25556         * socket-io.h:
25557         * socket-io.c
25558         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
25559         Add support for SO_PEERCRED if its available.
25560
25561 2004-07-09  Peter Bartok <pbartok@novell.com>
25562         * loader.c: winelib.exe.so error message is now only displayed if
25563         MONO_DEBUG is set. To help us avoid questions when people are trying
25564         out the new Managed.Windows.Forms.
25565
25566 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
25567
25568         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
25569         for isinst and castclass wrappers.
25570
25571         * class-internals.h icall.c: Move registration and lookup of JIT icalls
25572         to libmetadata from the JIT, so they could be used by the marshalling
25573         code and the interpreter.
25574
25575         * marshal.c: Register marshalling related JIT icalls here instead of
25576         in mini.c. Use CEE_MONO_ICALL instead of the family of 
25577         CEE_MONO_PROC<x> opcodes to call marshalling functions.
25578
25579         * metadata.h: Remove unneeded marshalling conversions.
25580
25581         * opcodes.c: Update for new opcodes.
25582         
25583 2004-07-08  Martin Baulig  <martin@ximian.com>
25584
25585         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
25586         (mono_debug_get_domain_data): Make this function static.
25587
25588 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25589
25590         * gc.c, object.h: add nice GC handle API for embedders.
25591
25592 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
25593
25594         * reflection.c: more changes for the new api
25595
25596         * object.c: When we reflect on a field w/ a constant value, it
25597         will not have a memory location, so we must access metadata. Also,
25598         allow easier reading of strings so that we can read them from
25599         the constant data.
25600
25601         * class.c (mono_class_layout_fields): no need for literal fields here.
25602
25603         * class-internals.h: api changes for const fields
25604
25605         * icall.c (ves_icall_get_enum_info): use new apis for const fields
25606
25607 2004-07-06  Martin Baulig  <martin@ximian.com>
25608
25609         * mono-debug.h: Increment version number to 44.
25610
25611         * mono-debug.c (mono_debug_add_wrapper): The second argument is
25612         now a gpointer, rewrote this whole method.
25613
25614         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
25615         function.  Add information about the wrapper in a new "misc table".
25616
25617         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
25618         for the new misc table.
25619
25620 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
25621
25622         * metadata-internals.h image.c: Add a cache for helper signatures.
25623
25624         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
25625
25626 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
25627
25628         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
25629         delegates from a delegate. Fixes #61033.
25630         
25631         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
25632         marshalling of stringbuilder arrays. Fixes #59900.
25633
25634 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
25635
25636         * icall.c: Add EnumBuilder:setup_enum_type icall.
25637
25638 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
25639
25640         * icall.c: Added a new icall for the property version of
25641         OffsetOfStringData.
25642
25643 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
25644
25645         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
25646         it has a constant size across platforms.
25647
25648         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
25649         stack trace.
25650
25651 2004-06-29  Martin Baulig  <martin@ximian.com>
25652
25653         * mono-debug.c (mono_debug_add_method): Protect the whole function
25654         in mono_debugger_lock(), not just parts of it.
25655
25656 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
25657
25658         * reflection.c: make sure padding bytes in heaps are zeroed.
25659
25660 2004-06-24  David Waite  <mass@akuma.org>
25661
25662         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
25663         image.c, loader.c, locales.c, marshal.c, metadata.c,
25664         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
25665         string-icalls.c, threads.c: change to C90-style comments from C99 /
25666         C++ -style
25667
25668 2004-06-24  Dick Porter  <dick@ximian.com>
25669
25670         * threads.c
25671         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
25672         return createdNew.  Fixes bug 60412.
25673
25674         * threads-types.h: 
25675         * icall.c: Add createdNew parameter to CreateMutex icall
25676
25677 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
25678
25679         * reflection.c, object-internals.h: save default value in params.
25680
25681 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25682
25683         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
25684         no need to build a new path combining that with the application base.
25685         Fixes bug #60442.
25686
25687 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
25688
25689         * reflection.c: fixed minor standard compliance issues.
25690
25691 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25692
25693         * reflection.c: fixed issue with encoding some custom attributes
25694         (arrays in properties and fields, bug #60411).
25695
25696 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25697
25698         * reflection.c: fix start address when copying the public key token.
25699
25700 2004-06-23  Martin Baulig  <martin@ximian.com>
25701
25702         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
25703         the `exc' object in a static object to put it into the GC's root set.
25704
25705 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
25706
25707         * reflection.c: make mono_reflection_setup_internal_class ()
25708         callable a second time to setup a new parent class.
25709
25710 2004-06-23  Dick Porter  <dick@ximian.com>
25711
25712         * threads.c: Check for WAIT_IO_COMPLETION return values.
25713
25714 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
25715
25716         * appdomain.c: Removed the g_free on the public key token. Now copy 
25717         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
25718         * assembly.c: Added public key token string value when loading 
25719         assemblies. Fix bug #60439.
25720         * icall.c: Added missing informations (like public key) in 
25721         GetReferencedAssemblies. Fix #60519.
25722         * image.h: Changed definition for public key token from const char*
25723         public_tok_value to guchar public_key_token [17];
25724         * reflection.c: Updated for changes to public key token.
25725
25726 2004-06-22  Lluis Sanchez Gual
25727
25728         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
25729         for the field in base classes.
25730
25731 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
25732
25733         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
25734         mark headers as not supported, they are installed only for use by the
25735         debugger.
25736
25737 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
25738
25739         * *.c, *.h: avoid namespace pollution in public headers.
25740
25741 2004-06-21  Martin Baulig  <martin@ximian.com>
25742
25743         * exception.c (mono_get_exception_security): It's in
25744         "System.Security", not in "System".
25745
25746         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
25747         the exception classes.
25748
25749 2004-06-21  Martin Baulig  <martin@ximian.com>
25750
25751         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
25752         Protect the exception object from being finalized.
25753
25754 2004-06-21  Martin Baulig  <martin@ximian.com>
25755
25756         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
25757         public function.
25758
25759 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
25760
25761         * reflection.c: Load the assembly in mono_reflection_type_from_name,
25762         if it was not loaded before. Fix parts of #60439.
25763
25764 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
25765
25766         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
25767         code that was broken since Ben's change: wrappers are now
25768         dependent on the method signature only again.
25769
25770 2004-06-21  Martin Baulig  <martin@ximian.com>
25771
25772         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
25773         added interface support.
25774
25775 2004-06-21  Martin Baulig  <martin@ximian.com>
25776
25777         * class.c (mono_vtable_get_static_field_data): New public method.
25778
25779 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
25780
25781         * filewatcher.c : Windows build fix to be compliant with API changes.
25782
25783 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
25784
25785         * class.h, class.c: more accessors.
25786         * metadata.h, metadata.c: prepare for hiding MonoType and
25787         MonoMethodSignature: people should use the accessors from now on
25788         outside of the tree.
25789
25790 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
25791
25792         * *.c, *.h: more API cleanups.
25793
25794 2004-06-18  Jackson Harper  <jackson@ximian.com>
25795
25796         * assembly.c: Trace loading assemblies.
25797         * loader.c: Trace loading native libraries.
25798         * mono-config.c: Trace loading config files.
25799         
25800 2004-06-18  Dick Porter  <dick@ximian.com>
25801
25802         * locales.c: Tell ICU the lengths of strings, it can cope with
25803         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
25804
25805 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
25806
25807         * image.c: swapped name/filename;
25808
25809 2004-06-18  Martin Baulig  <martin@ximian.com>
25810
25811         * mono-debug-debugger.c (write_class): Write the parent class at
25812         the end of the header.
25813
25814 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
25815
25816         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
25817
25818 2004-06-17  Raja R Harinath  <rharinath@novell.com>
25819
25820         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
25821         (bundle_obj): New conditional define.
25822         (BUILT_SOURCES): Remove.
25823         ($(bundle_srcs)): Make parallel-make safe.
25824         (libmonoruntime_la_LIBADD): Make unconditional.
25825         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
25826         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
25827
25828 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
25829
25830         * culture-info-tables.h: It was inconsistent with the latest
25831           supp info files.
25832
25833 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
25834
25835         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
25836         be loaded.
25837
25838         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
25839         with gcc 2.95.
25840
25841 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
25842
25843         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
25844         cleaned up public header threads.h.
25845
25846 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
25847
25848         * Makefile.am, *.c, *.h: more API cleanups.
25849
25850 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
25851
25852         * Makefile.am: removed monosn from compilation.
25853         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
25854         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
25855         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
25856         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
25857         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
25858         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
25859
25860 2004-06-15  Jackson Harper  <jackson@ximian.com>
25861
25862         * assembly.c: Make locales lower case when searching the GAC for
25863         assemblies. gacutil will always make locales lowercase when
25864         installing so this effectively makes them case insensitive.
25865         
25866 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
25867
25868         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
25869         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
25870           parameter which allows to choose whether the wait can be interrupted or 
25871           not. Also added the method mono_monitor_enter(), which locks the monitor
25872           using an infinite wait and without allowing interruption.
25873           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
25874           interrupted.
25875         * object.h: Added new fields in MonoThread. suspend_event holds the event
25876           used to susped/resume the thread. synch_lock is the lock object to use for
25877           modifying the thread state.
25878         * threads.c: Use the new synch_lock object for locking, instead of "this",
25879           which can generate deadlocks.
25880           Moved thread state change in Thread.Sleep and Thread.Join from managed
25881           to unmanaged code. This avoids a deadlock when the thread was suspended
25882           just after acquiring the thread lock.
25883           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
25884           Implemented Thread.Suspend using an event instead of ThreadSuspend,
25885           which is not fully implemented in the io-layer.
25886         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
25887
25888 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
25889
25890         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
25891         threads-types.h: more API cleanups.
25892
25893 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
25894
25895         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
25896         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
25897         threadpool.c, threads.c: first pass at the exported API cleanup.
25898
25899 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
25900
25901         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
25902
25903 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25904
25905         * icall.c: added internalGetHome.
25906
25907 2004-06-14  Dick Porter  <dick@ximian.com>
25908
25909         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
25910         possible to return successfully when '.' or '..' were the only
25911         entries in a directory, but were skipped.  The MonoIOStat was not
25912         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
25913         Fixes bug 59574.
25914
25915 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
25916
25917         * reflection.c: make binaries run on .Net 1.1 by default.
25918
25919 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
25920
25921         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
25922
25923 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
25924
25925         * marshal.c: keep track of struct size with explicit layout
25926         (bug #59979).
25927
25928 2004-06-12  Martin Baulig  <martin@ximian.com>
25929
25930         * mono-debug-debugger.c: Comment out a debugging g_message().
25931
25932 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
25933
25934         * reflection.c, reflection.h: do not free custom attrs that are cached.
25935         * icall.c: use braces to make code clearer.
25936
25937 2004-06-11  Martin Baulig  <martin@ximian.com>
25938
25939         * class.h (MonoInflatedField): New type.
25940         (MonoClassField): Replaced `MonoType *generic_type' with
25941         `MonoInflatedField *generic_info'.
25942
25943         * icall.c
25944         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
25945
25946 2004-06-11  Martin Baulig  <martin@ximian.com>
25947
25948         * reflection.c (mono_image_create_method_token): Correctly encode
25949         varargs methods.
25950
25951 2004-06-11  Martin Baulig  <martin@ximian.com>
25952
25953         * metadata.c (mono_metadata_parse_method_signature): When parsing
25954         a MethodDef which has VarArgs, also set sentinelpos if we don't
25955         have any parameters.
25956
25957 2004-06-11  Martin Baulig  <martin@ximian.com>
25958
25959         * verify.c (mono_method_verify): In CEE_CALL, use
25960         mono_method_get_signature() to get the method's signature, unless
25961         we're a PInvoke method.
25962
25963 2004-06-10  Jackson Harper  <jackson@ximian.com>
25964
25965         * assembly.c: Use <path>/lib/mono/gac for the extra paths
25966         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
25967         logical name as the supplied path is just a prefix to the gac not
25968         the direct path to it.
25969         
25970 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
25971
25972         * reflection.c: make the token for a created method match
25973         the token of the MethodBuilder it was created from
25974         (IKVM requires this behaviour now).
25975
25976 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
25977
25978         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
25979         reflection.c, socket-io.c: leak fixes.
25980
25981 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
25982
25983         * icall.c: handle sentinel pos in vararg methods in position different
25984         from 0.
25985
25986 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25987
25988         * culture-info-tables.h: freshly generated.
25989
25990 2004-06-09  Martin Baulig  <martin@ximian.com>
25991
25992         * loader.c (mono_get_method_constrained): Call `mono_class_init
25993         (constrained_class)'.   
25994
25995 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
25996
25997         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
25998         any methods. Fixes #59629.
25999
26000 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26001
26002         * culture-info-tables.h: reflecting locale-builder updates.
26003
26004 2004-06-08  Dick Porter  <dick@ximian.com>
26005
26006         * object.h:
26007         * locales.c: Fixed compile warnings, including a real bug in
26008         CompareInfo_internal_compare.
26009         
26010 2004-06-08  Dick Porter  <dick@ximian.com>
26011
26012         * locales.c
26013         (ves_icall_System_Globalization_CompareInfo_internal_index):
26014         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26015         Double-check the resuls of usearches, because ICU currently
26016         ignores most of the collator settings here.  Fixes bug 59720.
26017         
26018 2004-06-08  Dick Porter  <dick@ximian.com>
26019
26020         * locales.c
26021         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26022         Fix memory leak and segfault-causing typo.  No idea how this one
26023         lasted so long without being noticed.
26024
26025 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
26026
26027         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
26028         any methods. Fixes #59629.
26029
26030 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26031
26032         * assembly.c:
26033         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
26034         own the critical section before). Removed dead code (that's done
26035         in the preload hook).
26036
26037         (mono_assembly_load_with_partial_name): call the preload hook.
26038
26039 2004-06-08  Martin Baulig  <martin@ximian.com>
26040
26041         * metadata.c (mono_metadata_signature_alloc): Default
26042         `sentinelpos' to -1.
26043
26044         * reflection.c (mono_image_get_array_token): Likewise.
26045
26046 2004-06-08  Martin Baulig  <martin@ximian.com>
26047
26048         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
26049
26050         * metadata.c (mono_metadata_parse_method_signature): When parsing
26051         a MethodDef which has VarArgs, set sentinelpos.
26052
26053         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
26054         `gint16' since we're using -1 for non-varargs methods.
26055
26056         * reflection.c
26057         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
26058         (method_encode_signature): Added varargs support.
26059         (method_builder_encode_signature): Likewise.
26060         (mono_image_get_varargs_method_token): New static method.
26061         (mono_image_create_method_token): New public method; this is
26062         called via an icall instead of mono_image_create_token() when
26063         calling a varargs method.       
26064
26065 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
26066
26067         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
26068
26069 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26070
26071         * culture-info-tables.h : Reflecting the latest locale-builder that
26072           fixed empty array representation ({} to {0}).
26073
26074 2004-06-07  Jackson Harper  <jackson@ximian.com>
26075
26076         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
26077         looking up extra gac paths. This allows MONO_GAC_PATH to act
26078         exactly like a prefix.
26079         
26080 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26081
26082         * reflection.c (mono_reflection_type_from_name): Make a copy of the
26083         type name before modifying it. Fixes #59405.
26084
26085 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26086
26087         * culture-info.h: added fields for "all datetime patterns".
26088         * locales.c: (  ves_icall_System_Globalization_CultureInfo
26089           _construct_datetime_format ()): fill xxx_patterns fields.
26090         * object.h: added fields for "all datetime patterns" to
26091           MonoDateTimeFormatInfo.
26092         * culture-info-tables.h: reflecting locale-builder updates.
26093
26094 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26095
26096         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
26097         the event has no add and remove methods. Fixes #59629.
26098
26099 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
26100
26101         * object.c: Fixed possible integer overflow when allocating large
26102         strings.
26103
26104 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26105
26106         * culture-info-tables.h: reflecting locale-builder updates.
26107
26108 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26109
26110         * culture-info-tables.h: reflecting locale-builder updates.
26111
26112 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
26113
26114         * culture-info-tables.h: reflecting locale-builder updates.
26115
26116 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
26117
26118         * threads.c: Made Thread.Sleep abortable.
26119
26120 2004-06-02  Martin Baulig  <martin@ximian.com>
26121
26122         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
26123
26124         * debug-mono-symfile.h: Bumped symbol file version number to 37.
26125
26126 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
26127
26128         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
26129
26130 2004-05-30  Jackson Harper  <jackson@ximian.com>
26131
26132         * reflection.c: Do not hardcode assembly versions or public key
26133         tokens anymore. All of this except the corlib section was dead
26134         code anyways.
26135         
26136 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
26137
26138         * object.c (mono_runtime_invoke_array): Automatically create boxed
26139         objects for byref valuetypes if needed. Fixes #59300.
26140         
26141         * object.c (mono_method_return_message_restore): Handle 
26142         MONO_TYPE_OBJECT as well.
26143
26144 2004-05-28  Jackson Harper  <jackson@ximian.com>
26145
26146         * reflection.c: The modified type encoding was causing build
26147         problems. Reverted for now.
26148         
26149 2004-05-28  Jackson Harper  <jackson@ximian.com>
26150
26151         * reflection.c/h: Take an assembly ref so that we dont create
26152         fully qualified names when encoding types in the same assembly as
26153         the custom attribute being emitted.
26154         * appdomain.c: Increment version number.
26155         
26156 2004-05-26  Duncan Mak  <duncan@ximian.com>
26157
26158         * icall.c
26159         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
26160         Set the full version number (major, minor, build, revision).
26161
26162 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
26163
26164         * marshal.c (emit_struct_conv): increment src/dst after blit
26165         (mono_marshal_get_managed_wrapper,
26166         mono_marshal_get_native_wrapper): make sure we have marshalling
26167         info before marshalling params (info computation affects
26168         blittable)
26169
26170         * class.c (class_compute_field_layout): correctly deal with
26171         blittable
26172         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
26173         value types (as per what windows dows by default)
26174         (mono_class_setup_mono_type): System.ValueType is blittable
26175         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
26176         blittable
26177
26178         * marshal.c (mono_marshal_load_type_info): flag types  as
26179         non-blittable if the native layout doesn't match the managed
26180         layout
26181
26182 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26183
26184         * appdomain.c: don't add stuff in the private search path that is
26185         above the application base. If application base is not set, there's
26186         no private search path.
26187
26188 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
26189
26190         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
26191         byref struct arguments in native->managed marshalling.
26192
26193 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
26194
26195         * marshal.c (mono_marshal_get_runtime_invoke): correctly
26196         cache methods using signature (special case for methods
26197         that are value type or string class)
26198         
26199         * image.c (mono_image_close): clean up allocated GSList's
26200         in runtime_invoke_cache.
26201
26202 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26203
26204         * mono-config.c: set the correct path for mono_cfg_dir on windows when
26205         there's no MONO_CFG_DIR environment variable defined.
26206
26207 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26208
26209         * threads.c: windows version must be >= 0x0500 to include OpenThread.
26210
26211 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
26212
26213         * threadpool.c: Really wait for 500ms after the async call, even if the wait
26214           is interrumped.
26215         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
26216           before waiting for it, and call CloseHandle after the wait to unref it.
26217           This will make sure that handles are not disposed too early.
26218
26219 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26220
26221         * appdomain.c:
26222         * appdomain.h:
26223         * icall.c: removed
26224         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
26225         needed now.
26226
26227         * object.c: se the application_base only for the domain that runs
26228         Main. Fixes bug #59216,
26229
26230 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26231
26232         * appdomain.c:
26233         * object.c: only the domain in which Main is run have
26234         SetupInformation.ConfigurationFile set, so moved a few lines from
26235         appdomain.c to object.c.
26236
26237 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26238
26239         * appdomain.c: we tried to load [name].(dll|exe), but according
26240         to bug #57710, we must also try [culture]/[name].(dll|exe) and
26241         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
26242         There's a test case attached to bug #58922.
26243
26244 2004-05-27  Dick Porter  <dick@ximian.com>
26245
26246         * icall.c:
26247         * file-io.c: Implemented icalls for locking and unlocking regions
26248         in a file.
26249         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
26250         FALSE on error (fixes both compiler warning and real bug.)
26251
26252 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
26253
26254         * culture-info-tables.h: reflecting locale-builder updates.
26255
26256           (Added missing ChangeLog entry for 05/26)
26257
26258 2004-05-27  Jackson Harper  <jackson@ximian.com>
26259
26260         * locales.c: Fix some cut and paste errors.
26261         
26262 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26263
26264         * mono-config.c: set the correct path for config. directory on windows.
26265
26266 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26267
26268         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
26269           on win32.
26270
26271 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26272
26273         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
26274         from pinvoke functions.
26275         
26276         * marshal.c (mono_ftnptr_to_delegate): Implement this.
26277
26278 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26279
26280         * culture-info-tables.h: reflecting locale-builder updates.
26281
26282 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26283
26284         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
26285         #59086.
26286
26287 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
26288
26289         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
26290         * icall.c: Modified icalls for RNG.
26291         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
26292         Windows (CryptoAPI).
26293
26294 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26295
26296         * locales.c: Fix build.
26297
26298 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
26299
26300         * culture-info-tables.h: reflecting locale-builder updates.
26301
26302 2004-05-25  Jackson Harper  <jackson@ximian.com>
26303
26304         * locales.c: When creating the current culture use the $LANGs
26305         specific culture. So DateTimeFormat and NumberFormat entries are created.
26306         
26307 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26308
26309         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
26310         a char array as parameter.
26311
26312 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
26313
26314         * image.c: In mono_image_open(), always use an absolute path name to
26315           look for already loaded images.
26316
26317 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
26318
26319         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
26320         missing in the windows build (like older cygwin include files).
26321
26322 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
26323
26324         * icall.c: Fixed check for possible integer overflow in Buffer_
26325         BlockCopy icall. Replaced comments style // by /* */.
26326
26327 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
26328
26329         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
26330         
26331         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
26332         check after MONO_VTADDR. Fixes pinvoke2.exe.
26333
26334         * marshal.h marshal.c metadata.h: Add beginnings of support for
26335         ftnptr -> delegate marshalling.
26336
26337 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
26338
26339         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
26340         * threads.c: Fix warnings.
26341
26342 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
26343
26344         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
26345         * icall.c: Registered icalls for Suspend and Resume.
26346         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
26347           Thread.Abort.
26348         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
26349         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
26350         * process.c: Use WaitForSingleObjectEx.
26351         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
26352           checkpoints.
26353         * threads.c, threads.h: Make use of new Ex wait methods. Improved
26354           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
26355           for Suspend and Resume. Added new mono_thread_stop, used for stoping
26356           background threads. Added basic support for Abort in Windows.
26357           Start new threads using a managed delegate invoke wrapper. This wrapper
26358           has an interruption checkpoint that is needed since an interruption
26359           can be requested before the thread leaves the unmanaged code that starts 
26360           the thread.
26361         * marshal.c: Added interruption checkpoint after every native call, and
26362           also before managed calls for wrappers called from unmanaged code to
26363           go into managed code.
26364         * object.h: Added new field in MonoThread to keep track of interruption
26365           requests.
26366
26367 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
26368
26369         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
26370         calls.
26371
26372 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26373
26374         * appdomain.c:
26375         * assembly.c:
26376         * gc.c:
26377         * locales.c:
26378         * mono-config.c:
26379         * rand.c: getenv -> g_getenv (windows!)
26380
26381         * process.c: complete_path is also used on non-windows platforms.
26382
26383 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26384
26385         * icall.c: new signature for Process_Start.
26386
26387         * process.[ch]: new signature for Process_Start. If we're on windows
26388         and UseShellExecute is false, we have to search for the program by
26389         ourselves if we don't get a full path.
26390
26391 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
26392
26393         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
26394         marshalling and call CleanUpNativeData if needed. Fixes #58646.
26395
26396 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26397
26398         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
26399         Fixes bug #58373.
26400
26401 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26402
26403         * process.c: use double quotes to quote program name and arguments on
26404         windows. Fixes bug #58575.
26405
26406 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26407
26408         * file-io.c: don't return "." and ".." when using windows Find*File.
26409
26410 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
26411
26412         * marshal.c: Don't pass wrappers to message init because method 
26413         addressed used to lookup metadata. part of remoting[2|3] fix.
26414
26415 2004-05-15  Jackson Harper  <jackson@ximian.com>
26416
26417         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
26418         path is essentially the same as MONO_PATH except that it points to
26419         GACs instead of lib directories.
26420         * loader.h: The user gac is gone so we dont need function to
26421         enable/disable it.
26422         * mono-config.c: user gac option is now gone.
26423         
26424 2004-05-15  Jackson Harper  <jackson@ximian.com>
26425
26426         * culture-info.h: Make defines more consistent, add calendar data
26427         to the culture info table.
26428         * culture-info-tables.h: Add basic calendar data. Basically
26429         everyone gets default gregorian until all the data is
26430         updated.
26431         * locales.c: Use the new consistent defines. Set calendar data for
26432         culture info objects.
26433         * object.h: add a field for calendar data to CultureInfo
26434         
26435 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
26436
26437         * image.c: image->runtime_invoke_cache is keyed on signatures now.
26438         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
26439         a signature.
26440         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
26441         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
26442         an extra param that is the pointer of the method to invoke. The IL for
26443         the invoke method is no longer specific to the method, but to the
26444         signature of the method. Thus, we can share the same code for multiple
26445         methods. This reduces the number of methods that have to be compiled.
26446
26447 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
26448
26449         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
26450
26451         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26452
26453         * icall.c: Optimize Buffer.BlockCopy.
26454
26455 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26456
26457         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
26458         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
26459         quote). Changed them to "MMMM yyyy".
26460
26461 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
26462
26463         * rand.c
26464         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
26465
26466 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
26467
26468         * reflection.h: Updated after changes to managed structures.
26469
26470         * appdomain.c: Bump corlib version.
26471
26472 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26473
26474         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
26475         windows.
26476
26477 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26478
26479         * Makefile.am: link to ../os/libmonoos.la on windows.
26480
26481         * assembly.c:
26482                 -If MONO_DEBUG, warn about non-existing directories in
26483                 MONO_PATH.
26484                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
26485                 compile time variable.
26486                 -Removed init_default_path and call mono_set_rootdir from
26487                 libmonoos.a instead (windows only).
26488
26489         * assembly.h: declare mono_assembly_getrootdir().
26490
26491         * domain.c:
26492         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
26493
26494         * loader.c: s/getenv/g_getenv/
26495
26496 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
26497
26498         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
26499
26500         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
26501
26502         * metadata.h: Add new marshalling conversions.
26503
26504         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
26505         function.
26506
26507         * reflection.c (mono_reflection_get_type): Lookup the type in all
26508         modules of a multi-module assembly. Fixes #58291.
26509
26510 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
26511
26512         * threads.c: Before aborting a background, set the StopRequested
26513         state.  This avoids throwing the Abort exception.
26514         In mono_thread_manage, don't continue with the shutdown until all
26515         aborted threads have actually stopped.
26516
26517 2004-05-10  Jackson Harper  <jackson@ximian.com>
26518
26519         * locales.c: Remove the modifier from culture names.
26520         
26521 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26522
26523         * Makefile.am: monosn is not installed any more. It has been deprecated
26524         in favor of sn.
26525
26526 2004-05-07  Jackson Harper  <jackson@ximian.com>
26527
26528         * locales.c
26529         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
26530         Fix array construction, add bailout if the length is 0.
26531
26532 2004-05-07  Dick Porter  <dick@ximian.com>
26533
26534         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
26535         machine doesn't have a DNS entry.  Patch by Urs Muff
26536         (umuff@quark.com), fixes bug 57928.
26537
26538 2004-05-06  Jackson Harper  <jackson@ximian.com>
26539
26540         * reflection.c: Handle null PublicTokens properly. alloc mem for
26541         assembly names culture so we dont crash when freeing it.
26542         
26543 2004-05-06  Jackson Harper  <jackson@ximian.com>
26544
26545         * assembly.c: Check the usergac when loading with partial names.
26546         
26547 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26548
26549         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
26550         does nothing for now (not required for Linux/Windows) but the class
26551         library can call it (and a newer or modified runtime could need it).
26552         * icall.c: Registred icall.
26553
26554 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26555
26556         * loader.c: prints a message on module loading error we set MONO_DEBUG
26557         environment variable.
26558
26559 2004-05-05  Jackson Harper  <jackson@ximian.com>
26560
26561         * appdomain.c: Handle PublicKeyToken=null properly.
26562         
26563 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26564
26565         * environment.c|h: Added icall ves_icall_System_Environment_
26566         GetOSVersionString to get the current OS version as a string.
26567         * icall.c: Registred icall.
26568
26569 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
26570
26571         * object.c: in mono_object_get_virtual_method(), take into account that
26572         non-virtual methods don't have a slot in the vtable. Check needed when
26573         the object is a proxy.
26574
26575 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
26576
26577         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
26578         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
26579
26580         * object.c (mono_class_compute_gc_descriptor): Fix warning.
26581
26582         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
26583         passed when a valuetype is expected.
26584
26585         * object.c (mono_unhandled_exception): Only set the exit code if the
26586         exception happens in the main thread. Fixes thread5.exe.
26587
26588         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
26589         invalid names. Fixes #58047.
26590
26591 2004-05-03  Jackson Harper  <jackson@ximian.com>
26592
26593         * assembly.c: This line was committed accidently and is unneeded.
26594         
26595 2004-05-03  Jackson Harper  <jackson@ximian.com>
26596
26597         * icall.c: Add new icall for Assembly::LoadWithPartialName
26598         * assembly.c/.h: new function that probes the GAC to load partial
26599         assembly names by Paolo Molaro.
26600         
26601 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26602
26603         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
26604         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
26605         (type_get_fully_qualified_name): Added PublicKeyToken when building a
26606         full type name.
26607
26608 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26609
26610         * appdomain.c: fixed check for 'neutral' culture and removed warning.
26611         * reflection.c: fix bug when parsing a full type name and Version is not
26612         the last thing in the string.
26613
26614 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
26615
26616         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
26617         crashes when it is freed.
26618
26619 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26620
26621         * assembly.c: print the compat warning to stderr.
26622
26623 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
26624
26625         * assembly.c (mono_assembly_load_references): Add a compatibility
26626         hack to run old applications that might be still referencing the
26627         3300-based assemblies, only do this for System.xxx.
26628
26629 2004-05-01  Jackson Harper  <jackson@ximian.com>
26630
26631         * appdomain.c: If the culture is neutral we set it to "".
26632         
26633 2004-04-29  Jackson Harper  <jackson@ximian.com>
26634
26635         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
26636
26637 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
26638  
26639         * string-icalls.c: added low overhead function for copying chars
26640         * icall.c: added needed icall for the above function
26641  
26642 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26643
26644         * icall.c: fix return value of get_global_assembly_cache.  Implemented
26645         Environment.GetLogicalDrives.
26646
26647 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
26648
26649         * rand.c: try and talk to egd or prngd
26650         for random bytes if opening devices fail.
26651
26652 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
26653
26654         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
26655         alignment for the type using the native alignment of its members 
26656         instead of using klass->min_align.
26657
26658         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
26659
26660 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26661
26662         * file-io.c:
26663         * socket-io.c: added check for sys/aio.h.
26664
26665 2004-04-28  Dick Porter  <dick@ximian.com>
26666
26667         * threads.c: Don't abort a thread thats already aborting, when
26668         terminating everything.
26669
26670 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26671
26672         * icall.c: added 2 new async calls for Socket.
26673
26674         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
26675         IO on *nix systems.
26676
26677         * threadpool.c: removed unused variable.
26678
26679 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
26680
26681         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
26682
26683 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
26684
26685         * locales.c: put back string_invariant_tolower () and
26686         string_invariant_toupper ().
26687
26688 2004-04-26 David Waite <mass@akuma.org>
26689
26690         * file-io.h:
26691         * socket-io.h:
26692         * threads.h:
26693         * unicode.h: remove comma from end of enumeration declarations
26694
26695 2004-04-26 David Waite <mass@akuma.org>
26696
26697         * debug-mono-symfile.h:
26698         * decimal.c:
26699         * mono_debug.h:
26700         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
26701
26702
26703 2004-04-26  Jackson Harper  <jackson@ximian.com>
26704
26705         * appdomain.c: Increment version number.
26706         
26707 2004-04-26  Jackson Harper  <jackson@ximian.com>
26708
26709         * appdomain.c: Set assembly references public token value when
26710         PublicKeyToken is specified, not the hash_value. Free public token
26711         values when free assembly name data. Previously the public key
26712         token was hex decoded, however we are using hex encoded public key
26713         tokens, so this is not neccasary.
26714         * assembly.c: Lookup assemblies in the gac if their public token
26715         value is set. Add function to allow enabling user gac
26716         lookups. Specify whether or not the assembly was loaded from the
26717         GAC. Compare full assembly names when checking the cache for
26718         assemblies (Temporarily disabled see comment in code). Remove
26719         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
26720         specifies trace-loader they get extra info to stdout on the
26721         loading of assemblies.
26722         * image.h: Add a field for an assembly references public token
26723         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
26724         whether an assembly has been loaded from the GAC.
26725         * image.c: Remove a corlib -> mscorlib name mapping.
26726         * loader.h: Add function to enable/disable the user gac.
26727         * mono-config.c: Check if the usergac is enabled in the config
26728         file.
26729         * icall.c: New icall to determine whether or not an assembly has
26730         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
26731         * tabldefs.h: Add constant for assemblyref flag that specifies a
26732         full public key is used instead of a public token.
26733         * reflection.c: Remove mscorlib -> corlib mappings. Set
26734         PublicTokenValue instead of hash value. This value is a hex
26735         string so it does not need to be expanded.
26736
26737 2004-04-26  Martin Baulig  <martin@ximian.com>
26738
26739         * mono-debug-debugger.c (mono_debugger_initialize): Set
26740         `mono_debugger_initialized' before calling mono_debug_lock().
26741
26742 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
26743
26744         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
26745           InternalToUpper/InternalToLower.
26746         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
26747           removed invariant culture shortcut.  This is now done in managed code.
26748         * locales.c: (string_invariant_toupper/tolower) removed.
26749
26750 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26751
26752         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
26753         Added Poll internal call.
26754
26755         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
26756         call for Poll. Select was too heavy for polling a single socket.
26757
26758         * threadpool.[ch]: added mono_threadpool_cleanup.
26759         * threads.c: use it. Don't use Thread_Abort on windows.
26760
26761 2004-04-23  Martin Baulig  <martin@ximian.com>
26762
26763         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
26764
26765 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
26766
26767         * icall.c: Registred new icalls for key pair protection and added an
26768         icall for Environment.GetFolderPath on Windows.
26769         * security.c|h: Added new icalls for key pair protection.
26770
26771 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26772
26773         * socket-io.c: don't display the non-supported family warning for known
26774         families. Now this is not displayed on windows when checking support
26775         for IPv4/IPv6.
26776
26777 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26778
26779         * class.c: don't display the layout warning for static fields.
26780
26781 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
26782
26783         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
26784         * locales.c, locales.h: Added new icalls for culture-specific
26785         Char.ToLower and Char.ToUpper.
26786
26787 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26788
26789         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
26790         by David Waite.
26791
26792 2004-04-20  Martin Baulig  <martin@ximian.com>
26793
26794         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
26795         of the type name before passing it to mono_reflection_type_from_name().
26796
26797 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
26798
26799         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
26800         encodings here. Fixes #56965.
26801
26802 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
26803
26804         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
26805         fix test on strstr result not that I can see anything that
26806         relies on the result.
26807
26808 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
26809
26810         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
26811         Fixes #57081.
26812
26813         * marshal.c (mono_marshal_get_string_encoding): New helper function.
26814
26815         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
26816         function to determine which marshalling to use for strings. Fixes
26817         #56965.
26818
26819         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
26820
26821         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
26822
26823 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
26824
26825         * icall.c: #include mono-config.h
26826
26827 2004-04-15  Jackson Harper  <jackson@ximian.com>
26828
26829         * culture-info-tables.h: Fix date formats for en-US culture.
26830         
26831 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
26832
26833         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
26834         ThreadPool.SetMinThreads.
26835         * threadpool.c: Implemented ThreadPool.GetMinThreads and
26836         ThreadPool.SetMinThreads.
26837
26838 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
26839
26840         * mono-config.c: also load the .config file in the directory
26841         where the assembly was found.
26842
26843 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
26844
26845         * assembly.c: load per-assembly config files.
26846         * icall.c: decrapified code to get the config dir and moved to
26847         mono-config.c.
26848         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
26849         per-assembly config files. When doing a dll map lookup give precedence
26850         to the per-assembly data.
26851
26852 2004-04-14  Martin Baulig  <martin@ximian.com>
26853
26854         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
26855         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
26856         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
26857
26858         * mono-debugger-debugger.c: While the debugger is locked, remember
26859         whether the symbol tables have changes and send one single
26860         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
26861
26862 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
26863
26864         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
26865
26866         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
26867         function.
26868
26869         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
26870         account when marshalling string arrays. Fixes #56965.
26871
26872 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
26873
26874         * icall.c: Add new icalls mapping for security.
26875         * security.c|h: Add internal calls for WindowsIdentity,
26876         WindowsImpersonationContext and WindowsPrincipal.
26877
26878 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
26879
26880         * class.c: Added comment to ensure the System.MonoDummy class
26881         is removed when no longer necessary
26882
26883 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
26884
26885         * appdomain.c: Pass arguments to the bootstraping exceptions to
26886         minimize JITed methods at boot
26887
26888         * metadata.c (mono_exception_from_name_two_strings): Allow for the
26889         second string to be null.
26890
26891         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
26892         Change the protocol to minimize the JIT methods at startup.  Now
26893         it Returns the internal codepage, if the value of "int_code_page"
26894         is 1 at entry, and we can not compute a suitable code page
26895         number, returns the code page as a string.
26896
26897 2004-04-13  Jackson Harper  <jackson@ximian.com>
26898
26899         * culture-info-tables.h: Fix number of decimal digits for all
26900         english locales.
26901
26902 2004-04-13  Jackson Harper  <jackson@ximian.com>
26903
26904         * icall.c: Clairfy out of sync error message. It is not always
26905         your corlib that is out of sync.
26906
26907 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
26908
26909         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
26910         properties when only the set accessor is overriden. Fixes #55874.
26911
26912 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
26913
26914         * assembly.c (mono_assembly_load_references): Make this thread safe.
26915         Fixes #56327.
26916
26917 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
26918
26919         * monosn.c: Add missing initialization calls.
26920
26921 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
26922
26923         * locales.c:
26924         ves_icall_System_Globalization_CultureInfo_construct_number_format
26925         Fix g_assert so it compiles on fussier compilers re int/ptr
26926         mismatch
26927
26928 2004-04-08  Dick Porter  <dick@ximian.com>
26929
26930         * socket-io.h:
26931         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
26932         53992.  Also rearrange the code so that the internal calls return
26933         an error value and exceptions are thrown from managed code.
26934
26935         * icall.c: Add type info to the socket icalls.
26936
26937 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26938
26939         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
26940         owes me a beer.
26941
26942 2004-04-07  Martin Baulig  <martin@ximian.com>
26943
26944         * class.c (mono_class_from_generic_parameter): Don't default
26945         `klass->parent' to `mono_defaults.object_type'.
26946
26947 2004-04-07  Martin Baulig  <martin@ximian.com>
26948
26949         * reflection.c (mono_reflection_initialize_generic_parameter): Set
26950         `param->pklass->reflection_info'.       
26951
26952 2004-04-07  Jackson Harper  <jackson@ximian.com>
26953
26954         * culture-info-tables.h: Fix date separator symbol.
26955         
26956 2004-04-07  Martin Baulig  <martin@ximian.com>
26957
26958         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
26959         from System.Type to System.MonoType.
26960
26961 2004-04-07  Martin Baulig  <martin@ximian.com>
26962
26963         * reflection.h
26964         (MonoReflectionGenericParam): Added `has_reference_type' and
26965         `has_value_type' fields.
26966
26967         * reflection.c (mono_image_get_generic_param_info): Encode the
26968         correct flags if we have the `class' or `struct' constraint.
26969
26970 2004-04-07  Martin Baulig  <martin@ximian.com>
26971
26972         * reflection.h
26973         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
26974
26975 2004-04-07  Jackson Harper  <jackson@ximian.com>
26976
26977         * appdomain.c: Revert extra patches, just wanted to bump the
26978         version number.
26979         
26980 2004-04-07  Jackson Harper  <jackson@ximian.com>
26981
26982         * Makefile.am: Add culture-info private headers.
26983         * icall.c: Add new icalls for contructing locales.
26984         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
26985         * locales.h: Declare new culture info construction methods.
26986         * object.h: Add new fields used to avoid the CultureMap to
26987         MonoCultureInfo.
26988         * culture-info.h: Definition of structs used in the culture info
26989         tables.
26990         * culture-info-tables.h: Autogenerated tables that contain culture
26991         info data. This file was generated with the locale-builder tool.
26992         * appdomain.c: Incement corlib version number.
26993         
26994 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
26995
26996         * appdomain.c: (mono_runtime_init) move mono_thread_init
26997         to before mono_object_new calls so critical sections
26998         are initialized before use.
26999
27000 2004-04-07  Martin Baulig  <martin@ximian.com>
27001
27002         * icall.c
27003         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
27004         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
27005         (ves_icall_MonoGenericParam_initialize): Removed.
27006         (monogenericparam_icalls): Removed.
27007         (generictypeparambuilder_icalls): Added new table for
27008         System.Reflection.Emit.GenericTypeParameterBuilder.
27009
27010         * reflection.c
27011         (mono_reflection_define_generic_parameter): Removed.
27012         (mono_reflection_initialize_generic_parameter): This is now called
27013         from GenericTypeParameterBuilder's .ctor.
27014
27015 2004-04-06  Martin Baulig  <martin@ximian.com>
27016
27017         * class.c (mono_class_init): Don't inflate nested classes in a
27018         generic instance.
27019         (mono_type_get_name_recurse): Include the generic arguments for
27020         generic instances and generic type declarations.
27021         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
27022         (_mono_class_get_instantiation_name): Removed.
27023         (mono_class_create_generic): Always use `gklass->name' as our name.
27024
27025         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
27026
27027         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
27028         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
27029         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
27030         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
27031         closed generic methods here.
27032
27033         * reflection.c
27034         (mono_reflection_generic_inst_get_nested_types): Removed.
27035         (inflate_mono_method): Copy the generic parameters from the
27036         MonoMethodHeader into out MonoGenericMethod.
27037
27038 2004-04-06  Martin Baulig  <martin@ximian.com>
27039
27040         * row-indexes.h
27041         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
27042
27043         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
27044
27045         * reflection.c (build_compressed_metadata): If we have any entries
27046         in the GenericParam, MethodSpec or GenericParamConstraint tables,
27047         set the header version to 1.1.
27048
27049 2004-04-06  Martin Baulig  <martin@ximian.com>
27050
27051         * class.c (mono_class_init): If we're a generic instance,
27052         initialize our nested classes, too.
27053         (_mono_class_get_instantiation_name): Deal with the new `!%d'
27054         suffix. 
27055
27056 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27057
27058         * process.c: quote the argument passed to the shell on windows.
27059
27060 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
27061
27062         * threads.c (mono_alloc_special_static_data): Allow this to be
27063         called during startup.
27064
27065 2004-04-02  Martin Baulig  <martin@ximian.com>
27066
27067         * icall.c
27068         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
27069
27070 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
27071
27072         * icall.c: Fix build.
27073
27074 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
27075
27076         * Makefile.am: Added security.c|h.
27077         * icall.c: Added icall for get_UserName;
27078         * security.c: New file for security related icalls. Added function
27079         get_UserName for System.Environment (fix #56144).
27080         * security.h: New. Header file for security.c
27081
27082 2004-04-02  Dick Porter  <dick@ximian.com>
27083
27084         * icall.c: Deleted the icalls that were obsoleted some time ago
27085         by the ICU string code, and which were mixed into the icall
27086         rearranging.  Fixes bug 55969.
27087
27088         * string-icalls.h: 
27089         * string-icalls.c: Deleted the code that those icalls reference.
27090
27091 2004-04-01  Martin Baulig  <martin@ximian.com>
27092
27093         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
27094
27095         * class.c (mono_class_from_generic_parameter): Don't set 
27096         TYPE_ATTRIBUTE_INTERFACE.
27097         (my_mono_class_from_generic_parameter): Likewise.
27098
27099 2004-04-01  Martin Baulig  <martin@ximian.com>
27100
27101         * loader.c (find_method): Added an optional `MonoClass *ic'
27102         argument to search in a specific interface.
27103         (mono_get_method_constrained): New public function.
27104
27105 2004-04-01  Martin Baulig  <martin@ximian.com>
27106
27107         * reflection.c (mono_image_get_generic_field_token): Use the
27108         `handleref' cache here.
27109
27110 2004-04-01  Martin Baulig  <martin@ximian.com>
27111
27112         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
27113
27114         * reflection.c (create_generic_typespec): Use the `typespec' hash
27115         here, not the `typeref' one.    
27116
27117 2004-04-01  Martin Baulig  <martin@ximian.com>
27118
27119         * class.c (mono_class_inflate_generic_type): Moved the
27120         functionality into a new static inflate_generic_type() which
27121         returns NULL if it didn't do anything.  Only increment the
27122         `mono_stats.inflated_type_count' if we actually inflated
27123         something.
27124         (mono_class_get_full): Check the classes type to see whether we
27125         need to inflate it; also inflate MONO_TYPE_(M)VAR.
27126
27127 2004-04-01  Jackson Harper  <jackson@ximian.com>
27128
27129         * reflection.c: Set culture for assembly references.
27130         
27131 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
27132
27133         * reflection.[ch], icall.[ch], Fix support for pinning variables.
27134
27135 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27136
27137         * assembly.c:
27138         (do_mono_assembly_open): the critical section also covers
27139         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
27140
27141 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27142
27143         * threads.c:
27144         (mono_manage_threads): abort the background threads when finishing.
27145         Fixes bug #47232.
27146
27147 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27148
27149         * gc.c: only close the done_event handle if there was no timeout.
27150         C-ified comments.
27151
27152 2004-03-30  Martin Baulig  <martin@ximian.com>
27153
27154         * icall.c (icall_entries): It's called "System.Activator", not
27155         "System.Activation".    
27156
27157 2004-03-30  Martin Baulig  <martin@ximian.com>
27158
27159         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
27160         (mono_class_create_from_typespec): Likewise.
27161
27162 2004-03-30  Martin Baulig  <martin@ximian.com>
27163
27164         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
27165         `has_ctor_constraint' and `initialized'.
27166
27167 2004-03-30  Martin Baulig  <martin@ximian.com>
27168
27169         * reflection.c (encode_new_constraint): New static function to add
27170         the constructor constraint attribute to a type parameter.
27171         (encode_constraints): Call encode_new_constraint() if necessary.
27172
27173         * reflection.h
27174         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
27175
27176         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
27177         
27178 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
27179
27180         * reflection.c, icall.c: add support for pinning variables. 
27181
27182 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
27183
27184         * marshal.c (mono_marshal_get_managed_wrapper):
27185         init bool local with zero rather than null.
27186
27187 2004-03-29  Martin Baulig  <martin@ximian.com>
27188
27189         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
27190         the "official" behavior here.
27191         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
27192
27193 2004-03-29  Martin Baulig  <martin@ximian.com>
27194
27195         * icall.c: Reflect latest API changes.
27196
27197 2004-03-29  Martin Baulig  <martin@ximian.com>
27198
27199         * loader.c (mono_get_method_from_token): Also call
27200         mono_metadata_load_generic_params () for abstract and interface
27201         methods; replace the type arguments in the method signature with
27202         the ones which are loaded from the metadata.
27203
27204 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
27205
27206         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
27207         of the lock is not the current thread. MS.NET don't do it, in spite of
27208         what the documentation says. See bug #56157.
27209
27210 2004-03-28  Martin Baulig  <martin@ximian.com>
27211
27212         * class.c (mono_class_init): Don't call init_properties() and
27213         init_events() for generic instances; set `prop->parent' when
27214         inflating properties.
27215
27216         * reflection.c (mono_generic_inst_get_object): Call
27217         `mono_class_init (ginst->klass)'.
27218         (mono_type_get_object): Only create a MonoGenericInst if your
27219         generic type is a TypeBuilder.
27220         (do_mono_reflection_bind_generic_parameters): Only set
27221         `ginst->is_dynamic' if our generic type is a TypeBuilder.
27222
27223 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
27224
27225         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
27226         Fixes #56091.
27227
27228 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27229
27230         * icall.c: added Kill_internal icall.
27231         * process.[ch]: added Kill_internal icall.
27232
27233 2004-03-25  Martin Baulig  <martin@ximian.com>
27234
27235         * class.h (MonoStats): Added `generic_instance_count',
27236         `inflated_method_count', `inflated_type_count' and
27237         `generics_metadata_size'.       
27238
27239 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27240
27241         * reflection.c: no warnings now.
27242
27243 2004-03-25  Martin Baulig  <martin@ximian.com>
27244
27245         * class.c (mono_class_get_full): New public function; does a
27246         mono_class_get(), but also takes a `MonoGenericContext *'.
27247
27248         * loader.c (mono_field_from_memberref): Renamed to
27249         `field_from_memberref', made static and added `MonoGenericContext *'
27250         argument.
27251         (mono_field_from_token): Added `MonoGenericInst *' argument.
27252         (method_from_memberef): Likewise.
27253         (mono_get_method_from_token): Likewise.
27254         (mono_get_method_full): New public function; does a
27255         mono_get_method(), but also takes a `MonoGenericContext *'.
27256
27257         * verify.c (mono_method_verify): Get the method's generic context
27258         and pass it to mono_field_from_token(), mono_get_method_full() and
27259         mono_class_get_full().
27260
27261 2004-03-25  Martin Baulig  <martin@ximian.com>
27262
27263         * class.c (mono_class_inflate_generic_type): Take a
27264         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
27265         `MonoGenericMethod *'.
27266
27267 2004-03-25  Martin Baulig  <martin@ximian.com>
27268
27269         * loader.h (MonoMethodInflated): Store the MonoGenericContext
27270         instead of the MonoGenericMethod here.
27271
27272 2004-03-25  Martin Baulig  <martin@ximian.com>
27273
27274         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
27275         each time we create a new MonoGenericInst, we also create a new
27276         context which points back to us.
27277
27278         * class.c (inflate_method): Use `ginst->context' instead of
27279         creating a new context.
27280
27281         * loader.c (method_from_memberref): Use
27282         `klass->generic_inst->context' instead of creating a new context.
27283
27284 2004-03-25  Martin Baulig  <martin@ximian.com>
27285
27286         * class.h (MonoGenericContext): New struct.
27287         (MonoGenericMethod): Removed `generic_inst'.
27288
27289         * class.c (mono_class_inflate_generic_method): Take a
27290         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
27291
27292 2004-03-25  Martin Baulig  <martin@ximian.com>
27293
27294         * loader.h (MonoMethodInflated): New typedef.
27295
27296         * metadata.h (MonoMethodSignature): Removed `gen_method', make
27297         `generic_param_count' consume just 30 bits, added `is_inflated'
27298         and `has_type_parameters' flags (one bit each).
27299
27300         * class.c (mono_class_inflate_generic_method): Create a
27301         MonoMethodInflated instead of a MonoMethodNormal and set
27302         `is_inflated' in the method signature.
27303
27304         * class.h (MonoGenericMethod): Removed `generic_method'.
27305
27306 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
27307
27308         * image.c: Make sure the name of a MonoImage is always an absolute path.
27309           This fixes bug #54415.
27310
27311 2004-03-24  Martin Baulig  <martin@ximian.com>
27312
27313         * class.c (mono_class_setup_vtable): If we're a generic instance,
27314         use our generic type's vtable size.
27315
27316 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
27317
27318         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
27319         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
27320         problems.
27321
27322 2004-03-23  Martin Baulig  <martin@ximian.com>
27323
27324         * class.h (MonoDynamicGenericInst): Added `int count_events' and
27325         `MonoEvent *events'.
27326
27327         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
27328         (typebuilder_icalls): Added "get_event_info"; calls
27329         mono_reflection_event_builder_get_event_info(). 
27330
27331         * reflection.c (mono_reflection_generic_inst_initialize): Added
27332         `MonoArray *events'.
27333         (mono_reflection_event_builder_get_event_info): New function.
27334
27335 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
27336
27337         * object.h: add mono_type_initialization_init
27338
27339         * object.c (mono_runtime_class_init): 
27340         implement class constructor synchronization rules
27341         to cope with threading issues.  
27342         add mono_type_initialization_init
27343
27344         * appdomain.c (mono_runtime_init): call 
27345         mono_type_initialization_init
27346
27347         * class.h: removing initializing field from MonoVTable
27348
27349 2004-03-23  Martin Baulig  <martin@ximian.com>
27350
27351         * class.c (my_mono_class_from_generic_parameter): Use
27352         `param->name' if it's not NULL. 
27353
27354 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
27355
27356         * class.c: do not insert non-virtual methods in the vtable.
27357         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
27358         that means the method is non-virtual. This never would have
27359         happened before.
27360
27361 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
27362
27363         * profiler.c: Added lock for accessing coverage_hash.
27364
27365 2004-03-22  Martin Baulig  <martin@ximian.com>
27366
27367         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
27368         `method->method->signature->generic_param_count != 0' to make it
27369         work for interface methods.
27370
27371 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27372
27373         * process.c: quote the string passed to the shell using g_shell_quote.
27374
27375 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27376
27377         * threads.c:
27378         (mono_threads_manage): don't remove the finalizer thread and self
27379         from the threads hash table so that mono_thread_manage can be called
27380         more than once.
27381
27382 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27383
27384         * process.c: quote the arguments when UseShellExecute is true. Fixes
27385         bug #55790.
27386
27387 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27388
27389         * threads.c: set mono_thread_detach as a cleanup routine for every
27390         thread. This way it's always executed upon thread termination, either
27391         aborted or finished normally. No more xsp hangs!
27392
27393 2004-03-17  Martin Baulig  <martin@ximian.com>
27394
27395         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
27396         `int count_nested' and a `MonoType **nested'.
27397
27398         * reflection.c (mono_reflection_bind_generic_parameters): Moved
27399         most of the functionality into a new static
27400         do_mono_reflection_bind_generic_parameters() and don't take a
27401         `MonoType *nested_in' argument any more.  Don't compute nested
27402         types here.
27403         (mono_reflection_generic_inst_get_nested_types): New public method
27404         to get nested types.
27405
27406         * class.c (mono_class_create_generic): Set `klass->nested_in' if
27407         we're a nested class.
27408
27409         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
27410         mono_reflection_generic_inst_get_nested_types() to compute the
27411         nested types.
27412
27413 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27414
27415         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
27416         descriptive error message under windows.
27417         
27418 2004-03-17  Martin Baulig  <martin@ximian.com>
27419
27420         * class.c (dup_type): Added `const MonoType *original' argument;
27421         copy the attrs from the original type.
27422
27423 2004-03-17  Martin Baulig  <martin@ximian.com>
27424
27425         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
27426         `m->generic_inst_cache' here.
27427
27428 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27429
27430         * exception.h exception.c: Add stack_overflow_exception.
27431
27432 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27433
27434         * threadpool.c:
27435         (overlapped_callback): call SetEvent *after* invoking the callback.
27436         No need to call CloseHandle.
27437
27438 2004-03-16  Martin Baulig  <martin@ximian.com>
27439
27440         * reflection.c (mono_image_get_fieldref_token): Take a
27441         `MonoReflectionField *' instead of a `MonoClassField *' and a
27442         `MonoClass *'; store the `MonoReflectionField *' in the hash.
27443
27444 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27445
27446         * appdomain.c: don't add the culture to the filename we're looking for
27447         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
27448
27449 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27450
27451         * locales.c: don't ignore symbols when doing case insensitive compares.
27452         Thanks Dick! Fixes bug #54046.
27453
27454         * threads.c: surround 'threads' usage with enter/leave in
27455         mono_thread_manage.
27456
27457 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
27458
27459         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
27460         implicitly marshalled as [Out]. Fixes #55450.
27461
27462         (mono_marshal_get_runtime_invoke): Zero out the result if there is
27463         an exception.
27464
27465 2004-03-16  Martin Baulig  <martin@ximian.com>
27466
27467         * class.c (mono_class_from_generic_parameter): Use the actual
27468         parameter name. 
27469
27470 2004-03-16  Martin Baulig  <martin@ximian.com>
27471
27472         * reflection.c (type_get_signature_size): New static function.
27473         Compues the size of the type in a method signature.
27474         (method_get_signature_size): New static function; calls
27475         type_get_signature_size() to compute the actual size of the
27476         method's signature.
27477         (method_encode_signature): Use method_get_signature_size() to get
27478         the signature's size rather than using `nparams * 10'.
27479
27480 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27481
27482         * file-io.h: define here WapiOverlapped on windows. I don't want the
27483         regular OVERLAPPED one.
27484
27485         * file-io.c:
27486         * threadpool.c: somehow, BindIoCompletionCallback is not found.
27487         Disabling AIO on windows.
27488
27489 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27490
27491         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
27492         bug #55385.
27493
27494 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27495
27496         * appdomain.c: upgraded corlib version.
27497
27498         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
27499         and BeginWrite. Allow opening files for asynchrnous operations.
27500
27501         * file-io.h: new struct that maps FileStreamAsyncResult.
27502         * icall.c: added new icalls.
27503         * process.[ch]: support setting child process environment variables
27504         and use the SHELL or COMSPEC when UseShellExecute is true.
27505
27506         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
27507         callback for async. IO is here and also BindHandle.
27508
27509         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
27510         from here.
27511
27512 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
27513
27514         * reflection.c (create_custom_attr): Allow len == 0.
27515
27516         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
27517         computation on big-endian machines.
27518
27519 2004-03-13  Martin Baulig  <martin@ximian.com>
27520
27521         * class.h (MonoGenericInst): Added `int count_ifaces'.
27522
27523         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
27524         `ginst->count_ifaces' instead `klass->interface_count' since we
27525         may get called before the vtable is created.
27526
27527         * loader.c (mono_method_get_param_names): If we're a generic
27528         instance, return and don't initialize the class.
27529
27530         * reflection.c (mono_reflection_setup_generic_class): Don't call
27531         ensure_runtime_vtable().
27532         (mono_reflection_bind_generic_parameters): Set
27533         `ginst->count_ifaces'.
27534
27535 2004-03-11  Jackson Harper <jackson@ximian.com>
27536
27537         * icall.c:
27538         * unicode.c:
27539         * unicode.h: Remove unused System.Char icalls.
27540         
27541 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
27542
27543         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
27544         code when we P/Invoke the first library in Windows.Forms, instead
27545         of when we first open the assembly.
27546
27547         * assembly.c: Drop the lookup from here.
27548
27549 2004-03-10  Martin Baulig  <martin@ximian.com>
27550
27551         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
27552         class for properties, fields and events.  Finally fixes #54945.
27553
27554 2004-03-10  Martin Baulig  <martin@ximian.com>
27555
27556         * metadata.c (mono_metadata_class_equal): New static function;
27557         checks whether two generic instances or two generic parameters are
27558         equal.
27559         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
27560         compare classes.        
27561
27562 2004-03-10  Martin Baulig  <martin@ximian.com>
27563
27564         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
27565
27566         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
27567         argument and write it into the `reflection_info' field.
27568
27569         * icall.c
27570         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
27571         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
27572
27573 2004-03-09  Jackson Harper  <jackson@ximian.com>
27574
27575         * char-conversions.h: use 8 bits for numeric data its all we need
27576         * icall.c: numeric data is only 8 bits now.
27577
27578 2004-03-09  Martin Baulig  <martin@ximian.com>
27579
27580         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
27581
27582         * class.c (init_properties, init_events): Initialize the new
27583         `parent' field.
27584
27585         * reflection.c (typebuilder_setup_properties): Likewise.
27586         (typebuilder_setup_events): Likewise.
27587
27588         * reflection.h (MonoEventInfo): Replaced `parent with
27589         `declaring_type' and `reflected_type'.
27590
27591         * icall.c (ves_icall_get_property_info): Distinguish between
27592         declaring and reflected type.
27593         (ves_icall_get_event_info): Likewise.
27594
27595 2004-03-09  Martin Baulig  <martin@ximian.com>
27596
27597         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
27598         (ves_icall_Type_GetField): Correctly set field->klass.
27599
27600 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
27601
27602         * loader.h: Fix warning.
27603
27604 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
27605
27606         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
27607         library routine if present.  Notice that it will still continue
27608         executing even if its missing, for those working on the Gtk#
27609         edition of Windows.Forms.
27610
27611         * assembly.c (do_mono_assembly_open): If loading the
27612         System.Windows.Forms call mono_loader_wini_init.
27613
27614 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
27615
27616         * class.h: Added MonoRemoteClass struct.
27617         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
27618         function for MonoStrings.
27619         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
27620         Added internal call for getting the proxy type.
27621         * marshal.c: Get the type of transparent proxies from its remote_class.
27622         Added methods that generate the IL for type checks and casts:
27623         mono_marshal_get_isinst, mono_marshal_get_castclass, 
27624         mono_marshal_get_proxy_cancast.
27625         * marshal.h: Declaration of the previous new methods.
27626         * object.c: Added new moethods for creating and updating MonoRemoteClass
27627         instances: mono_remote_class, mono_upgrade_remote_class, 
27628         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
27629         * verify.c: FIx transparent_proxy_fields layout.
27630         * appdomain.c: Bump corlib version.
27631
27632 2004-03-04  Jackson Harper  <jackson@ximian.com>
27633
27634         * icall.c: Add icall to access char conversion tables.
27635         * char-conversions.h: Character conversion tables.
27636         * Makefile.am: Add char-conversions.h private header file.
27637         
27638 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
27639
27640         * appdomain.c (unload_thread_main): Increase unloading timeout to
27641         10 sec as a temporary workaround for Nant problems.
27642
27643 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
27644
27645         * gc.c: Add checks for GC_enable and GC_disable.
27646
27647         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
27648         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
27649         (bug #54988).
27650         
27651 2004-02-27  Martin Baulig  <martin@ximian.com>
27652
27653         * reflection.c (mono_reflection_bind_generic_parameters): Take a
27654         `MonoReflectionType *' instead of a `MonoType *'.
27655
27656 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
27657
27658         * gc.c (run_finalize): Avoid finalizing the object representing the
27659         finalizer thread.
27660         (finalizer_thread): Fix warning.
27661
27662 2004-02-25  Martin Baulig  <martin@ximian.com>
27663
27664         * class.c (_mono_class_get_instantiation_name): Added `int offset'
27665         argument for nested types.
27666         (mono_class_create_generic): Added support for nested generictypes.
27667
27668         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
27669         `GList *nested'.
27670
27671         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
27672
27673         * reflection.c (method_encode_signature): Increase the minimum
27674         value of `size' from 10 to 11.
27675         (mono_reflection_bind_generic_parameters): Take `int type_argc'
27676         and `MonoType **types' arguments instead of the `MonoArray
27677         *types'; added `MonoType *nested_in'.  Recursively instantiate
27678         nested classes. 
27679
27680 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
27681
27682         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
27683         stack_overflow_ex members which are used by exception handling.
27684
27685         * appdomain.c (mono_runtime_init): Initialize the new members.
27686
27687         * gc.c (mono_gc_enable): New helper function.
27688         * gc.c (mono_gc_disable): New helper function.
27689
27690 2004-02-23  Martin Baulig  <martin@ximian.com>
27691
27692         * icall.c: I must have been really stupid - make it actually work
27693         this time ;-)
27694
27695 2004-02-23  Martin Baulig  <martin@ximian.com>
27696
27697         * loader.c (method_from_memberref): Only inflate the method if
27698         it's in another klass.
27699
27700 2004-02-23  Martin Baulig  <martin@ximian.com>
27701
27702         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
27703         (mono_class_init): If we're a generic instance and an interface,
27704         compute `class->interface_id'; also create `class->interfaces'
27705         here and inflate them.
27706
27707         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
27708         `ginst->is_open'.
27709         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
27710
27711         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
27712
27713 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
27714
27715         * reflection.c (method_encode_code): Improved the error message
27716         generated by the exception.
27717
27718 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27719
27720         * icall.c: Martin did not do what he said in the ChangeLog for
27721         2004-02-18, but put back the changes for properties and events.
27722         Commenting those changes out again and adding comment to bug #54518.
27723         
27724         * process.c: removed warning.
27725
27726 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
27727
27728         * marshal.c (emit_struct_conv): Print an error message instead of
27729         asserting when a type does not have the StructLayout attribute.
27730
27731 2004-02-20  Martin Baulig  <martin@ximian.com>
27732
27733         * reflection.c (mono_type_get_object): Also use the cache for
27734         generic instances.
27735         (mono_reflection_bind_generic_parameters): Always compute
27736         `ginst->ifaces'.        
27737
27738 2004-02-20  Martin Baulig  <martin@ximian.com>
27739
27740         * class.h (MonoGenericMethod): Removed `klass'.
27741
27742         * class.c (mono_class_inflate_generic_method): Added `MonoClass
27743         *klass' argument.
27744
27745 2004-02-20  Martin Baulig  <martin@ximian.com>
27746
27747         * reflection.c (method_encode_methodspec): Actually use the
27748         uninflated signature for the memberref.
27749
27750 2004-02-20  Martin Baulig  <martin@ximian.com>
27751
27752         * class.h (MonoGenericMethod): Removed `declaring'.
27753
27754         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
27755         is NULL, compute it here.
27756
27757 2004-02-20  Martin Baulig  <martin@ximian.com>
27758
27759         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
27760
27761         * metadata.c (mono_metadata_generic_inst_hash): New method.
27762         (mono_metadata_generic_inst_equal): New method.
27763
27764         * reflection.c (mono_reflection_bind_generic_parameters): Use the
27765         `klass->image->generic_inst_cache' cache to avoid creating
27766         duplicate MonoGenericInst's.
27767
27768         * class.c (mono_class_inflate_generic_type): Use the cache.
27769
27770 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
27771
27772         * object.c: fixed gc descriptor calculation for embedded valuetypes.
27773
27774 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27775
27776         * icall.c: added Socket.WSAIoctl icall.
27777
27778         * socket-io.[ch]: implemented
27779         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
27780
27781 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
27782
27783         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
27784
27785 2004-02-18  Urs C Muff  <umuff@quark.com>
27786
27787         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
27788         this work on PPC and other big-endian architectures.
27789
27790         * debug-mono-symfile.h: Prepended the names of all the `guint32'
27791         fields with an underscore to make sure they're only accessed by
27792         the read32() macro.
27793
27794 2004-02-18  Martin Baulig  <martin@ximian.com>
27795
27796         * icall.c: Put the klass->refclass changes back for methods and
27797         fields, but not for properties and events.  We're currently not
27798         distinguishing between DeclaringType and ReflectedType for
27799         properties and events, that's what caused the regressions.
27800
27801 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27802
27803         * object.c:
27804         (mono_async_result_new): the handle can be NULL.
27805
27806         * threadpool.c: Use an event instead of a semaphore, don't initialize
27807         it until needed. This saves quite a few semaphores from being created
27808         when using the threadpool.
27809
27810 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
27811
27812         * object.c (mono_string_is_interned_lookup): Fix interning of long
27813         strings. Fixes #54473.
27814
27815         * domain.c (ldstr_equal): Optimize if the two strings are equal.
27816
27817         * icall.c: Revert the klass->refclass changes since they introduce
27818         regressions (bug #54518).
27819
27820 2004-02-18  Martin Baulig  <martin@ximian.com>
27821
27822         * class.c (mono_class_init): If we're a generic instance and don't
27823         come from a TypeBuilder, inflate our members here.
27824         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
27825         (mono_class_create_generic): New public method.
27826         (mono_class_initialize_generic): Removed.
27827         (get_instantiation_name): Renamed to
27828         _mono_class_get_instantiation_name() and made it public.
27829
27830 2004-02-18  Martin Baulig  <martin@ximian.com>
27831
27832         * class.c (mono_class_inflate_generic_type): Clear the new
27833         instance's `nginst->klass' when inflating a generic instance.
27834         (mono_class_is_subclass_of): Added (basic) support for generic
27835         instances.
27836
27837 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
27838
27839         * appdomain.h, domain.c: use a MonoCodeManager instead of a
27840         MonoMempool to hold compiled native code.
27841
27842 2004-02-17  Martin Baulig  <martin@ximian.com>
27843
27844         * class.h (MonoDynamicGenericInst): Added `count_properties' and
27845         `properties'.
27846
27847         * reflection.c (mono_reflection_generic_inst_initialize): Added
27848         `MonoArray *properties' argument.
27849
27850         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
27851
27852 2004-02-17  Martin Baulig  <martin@ximian.com>
27853
27854         * icall.c (ves_icall_Type_GetFields): Renamed to
27855         ves_icall_Type_GetFields_internal() and added a
27856         `MonoReflectionType *rtype' argument; pass it to
27857         mono_field_get_object() to set the field's "reflected" type.
27858         (ves_icall_Type_GetConstructors): Likewise.
27859         (ves_icall_Type_GetEvents): Likewise.
27860         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
27861         argument; pass it to mono_method_get_object() to set the method's
27862         "reflected" type.       
27863
27864 2004-02-17  Martin Baulig  <martin@ximian.com>
27865
27866         * class.h (MonoDynamicGenericInst): New type.
27867         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
27868
27869         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
27870         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
27871         (ves_icall_MonoGenericInst_GetFields): New interncall.
27872
27873         * class.c (mono_class_from_generic): Don't call
27874         mono_class_initialize_generic() if this is a dynamic instance;
27875         ie. it's being created from a TypeBuilder.
27876         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
27877         `class->byval_arg.type'.
27878
27879         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
27880         to `inflate_method' and made static.
27881         (mono_reflection_inflate_field): Removed.
27882         (mono_reflection_generic_inst_initialize): New public method.
27883
27884         * reflection.h (MonoReflectionGenericInst): Removed `methods',
27885         `ctors' and `fields'; added `initialized'.
27886
27887 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
27888
27889         * debug-helpers.c (mono_method_full_name): Fix output for empty
27890         namespaces.
27891
27892 2004-02-12  Martin Baulig  <martin@ximian.com>
27893
27894         * class.h (MonoClassField): Added `MonoType *generic_type'.
27895
27896         * reflection.c (mono_image_get_fieldref_token): Added support for
27897         instantiated generic types.
27898         (field_encode_inflated_field): Removed.
27899         (mono_image_get_inflated_field_token): Removed.
27900         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
27901
27902         * reflection.h (MonoReflectionInflatedField): Removed.
27903
27904 2004-02-12  Martin Baulig  <martin@ximian.com>
27905
27906         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
27907         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
27908
27909         * reflection.c (mono_image_get_methodspec_token): Take a
27910         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
27911         (mono_image_create_token): Check whether we have a
27912         `method->signature->gen_method' and call
27913         mono_image_get_methodspec_token() if appropriate.
27914         (inflated_method_get_object): Removed.
27915         (mono_reflection_bind_generic_method_parameters): Return a
27916         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
27917         (mono_reflection_inflate_method_or_ctor): Likewise.
27918
27919         * reflection.h (MonoReflectionInflatedMethod): Removed.
27920
27921 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
27922
27923         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
27924         for custom valuetype marshalling.
27925
27926         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
27927
27928 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27929
27930         * icall.c: fixed WSAGetLastError_internal name.
27931
27932 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
27933
27934         * threads.c (mono_thread_attach): Allow this to be called multiple
27935         times for a thread.
27936         
27937         * threads.c (build_wait_tids): Do not wait for ourselves.
27938
27939         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
27940         appdomain list is empty.
27941
27942         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
27943         memory returned by mono_string_builder_to_utf16, since it points into
27944         managed memory. Thanks to Bernie Solomon for noticing this.
27945
27946         * icall.c: Add AppDomainSetup icalls.
27947
27948         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
27949
27950         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
27951         types.
27952
27953         * reflection.c (reflection_methodbuilder_to_mono_method): Save
27954         custom attributes to the method_aux struct. Also fix array indexes etc.
27955
27956         * loader.c (mono_method_get_param_names): Make dynamic case work again.
27957         
27958 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
27959
27960         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
27961         (both static and runtime) and reduce startup time.
27962
27963 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
27964
27965         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
27966         AsAny marshalling conversion instead of crashing.
27967
27968         * marshal.c: Fix warnings.
27969
27970 2004-02-09  Martin Baulig  <martin@ximian.com>
27971
27972         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
27973
27974         * reflection.h (MonoReflectionInflatedMethod): Removed the
27975         `declaring' field, it's now in the unmanaged MonoGenericMethod.
27976
27977         * reflection.c (method_encode_methodspec): Removed the `method'
27978         argument; we get it from `gmethod->declaring'.
27979         (inflated_method_get_object): Removed the `declaring' argument.
27980
27981 2004-02-09  Martin Baulig  <martin@ximian.com>
27982
27983         * class.h (MonoGenericMethod): New type.
27984         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
27985         `generic_method'.
27986
27987         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
27988         a `MonoGenericMethod *gen_method' one.
27989
27990         * class.c (mono_class_inflate_generic_type): Take an additional
27991         `MonoGenericMethod * argument.  This is only non-NULL if we're
27992         inflating types for a generic method.   
27993         (mono_class_inflate_generic_signature): Renamed to
27994         inflate_generic_signature() and made static; take a
27995         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
27996         (inflate_generic_header): Take a `MonoGenericMethod *' argument
27997         instead of a `MonoGenericInst *' one.
27998         (mono_class_inflate_generic_method): Likewise.
27999
28000         * reflection.c (encode_generic_method_sig): Take a
28001         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
28002         (method_encode_methodspec): Likewise.
28003         (inflated_method_get_object): Likewise. 
28004
28005         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
28006         field with a `MonoGenericMethod *gmethod' one.  
28007
28008 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
28009
28010         * class.h (mono_class_has_parent): add parens to expansion
28011         so you can ! this.
28012
28013 2004-02-08  Martin Baulig  <martin@ximian.com>
28014
28015         * image.h (MonoImage): Removed `generics_cache'.
28016
28017         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
28018         instead of a `MonoType *' argument; removed the `inflate_methods'
28019         argument.  Don't inflate methods here.
28020
28021         * loader.c (find_method): If it's a generic instance, call
28022         mono_class_init() on the `sclass->generic_inst->generic_type'.
28023
28024         * metadata.c (mono_type_size): Make this work on uninitialized
28025         generic instances; call it on the `ginst->generic_type's class.
28026
28027         * reflection.c (mono_reflection_bind_generic_parameters): Call
28028         mono_class_from_generic() to create the `ginst->klass'.
28029
28030 2004-02-08  Martin Baulig  <martin@ximian.com>
28031
28032         * class.h (MonoClass): Changed type of `generic_inst' from
28033         `MonoType *' to `MonoGenericInst *'.
28034
28035 2004-02-08  Martin Baulig  <martin@ximian.com>
28036
28037         * icall.c (ves_icall_Type_BindGenericParameters): Just call
28038         mono_type_get_object(), this is now creating a `MonoGenericInst'
28039         for MONO_TYPE_GENERICINST.
28040         (ves_icall_MonoGenericInst_GetParentType): Likewise.
28041         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
28042
28043         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
28044         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
28045         (inflated_method_get_object): Added `MonoClass *refclass' argument.
28046         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
28047         and reflected type.
28048
28049         * reflection.h (MonoReflectionInflatedMethod): Removed
28050         `declaring_type' and `reflected_type'.
28051
28052 2004-02-08  Martin Baulig  <martin@ximian.com>
28053
28054         * class.h (MonoGenericInst): Added `MonoType *parent' and
28055         `MonoType **ifaces'.
28056
28057         * reflection.h (MonoReflectionGenericInst): Removed `klass',
28058         `parent' and `interfaces'.
28059
28060         * reflection.c (mono_reflection_bind_generic_parameters): Take a
28061         `MonoType *' argument and return a `MonoType *'.
28062
28063         * icall.c
28064         (ves_icall_MonoGenericInst_GetParentType): New interncall.
28065         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
28066
28067 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28068
28069         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
28070         valuetype marshalling.
28071
28072 2004-02-06  Martin Baulig  <martin@ximian.com>
28073
28074         * class.c
28075         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
28076         (my_mono_class_from_generic_parameter): Likewise.
28077
28078 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28079
28080         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
28081         contents of the symbol files lazily.
28082
28083         * object.h (MonoThread): Add 'name' and 'name_len' fields.
28084
28085         * threads.h threads.c icall.c: New icalls for getting and setting the
28086         threads name.
28087
28088 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
28089
28090         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
28091         Raise an exception when the domain is not found.
28092
28093 2004-02-03  Martin Baulig  <martin@ximian.com>
28094
28095         * reflection.c (mono_image_get_methodspec_token): Use the
28096         uninflated signature; fixes gen-33.
28097
28098 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
28099
28100         * gc.c threads.c: Make the finalizer thread a normal managed thread so
28101         the finalizer code can use thread functionality.
28102
28103         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
28104         the finalizer thread.
28105
28106         * threads.c: Make some functions more robust.
28107
28108         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
28109
28110         * metadata.h: Add new marshalling conventions.
28111
28112         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
28113         stringbuilder marshalling. Fixes #53700.
28114
28115         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
28116
28117         * reflection.c (mono_image_get_type_info): Save declarative security
28118         info.
28119
28120         * reflection.c (mono_image_get_field_info): Handle uninitialized 
28121         unmanaged fields as well.
28122
28123         * appdomain.c: Bump corlib version.
28124
28125 2004-02-01  Martin Baulig  <martin@ximian.com>
28126
28127         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
28128         method type arguments.  
28129
28130 2004-01-30  Duncan Mak  <duncan@ximian.com>
28131
28132         * marshal.h: Add prototype for
28133         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
28134         and
28135         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
28136         fix the build.
28137
28138 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
28139
28140         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
28141         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
28142
28143 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28144
28145         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28146         custom marshalling of valuetypes.
28147
28148         * marshal.c: Fix some warnings.
28149
28150 2004-01-29  Martin Baulig  <martin@ximian.com>
28151
28152         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
28153         for generic method parameters.
28154
28155         * reflection.c (method_encode_methodspec): Write the uninflated
28156         signature into the methodspec table.
28157         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
28158         is always the uninflated method.
28159         (reflection_methodbuilder_to_mono_method): Copy the generic
28160         parameters from the MethodBuilder into `header->gen_params'.
28161
28162 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28163
28164         * class.c (mono_class_from_generic_parameter): Fix warning.
28165
28166 2004-01-27  Martin Baulig  <martin@ximian.com>
28167
28168         * class.c (mono_class_from_generic_parameter): Don't create
28169         `klass->methods' here.  
28170
28171 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
28172
28173         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
28174         extension since it does not work with libraries named lib<FOO>.dll.so.
28175
28176 2004-01-25  Martin Baulig  <martin@ximian.com>
28177
28178         * class.c (mono_class_inflate_generic_type): Added support for
28179         MONO_TYPE_GENERICINST.
28180
28181         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
28182         inflate methods on open constructed types.      
28183
28184 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28185
28186         * object.c: fire ProcessExit event in the root AppDomain after running
28187         Main. Fixes bug #53299.
28188
28189 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
28190
28191         * socket-io.c: include the new socket-wrappers.h header.
28192         Use the wrappers instead of the unix socket functions to make the code
28193         more clear.
28194
28195 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
28196
28197         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
28198
28199         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28200         Fixes #22532.
28201
28202 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
28203
28204         * reflection.c (mono_image_create_pefile): Handle the case when the
28205         entry point is not a MethodBuilder.
28206
28207         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28208         field to ReflectionMethod since it is not allways a builder.
28209
28210         * reflection.c (type_get_fully_qualified_name): New helper function to
28211         return the fully qualified name of a type.
28212
28213         * reflection.c (encode_marshal_blob): Always emit the fully qualified
28214         type name for custom marshallers.
28215
28216         * reflection.c (mono_marshal_spec_from_builder): Ditto.
28217
28218         * class.c (mono_class_setup_vtable): If a parent class already 
28219         implements an interface, use the implementing methods from that class.
28220         Fixes #53148.
28221
28222 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28223
28224         * threadpool.c: just return instead of ExitThread to allow for thread
28225         clean up earlier.
28226
28227 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
28228
28229         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
28230         when closing resource modules.
28231
28232         * reflection.c (mono_image_create_pefile): Handle the case when the
28233         entry point is not a MethodBuilder.
28234
28235         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28236         field to ReflectionMethod since it is not allways a builder.
28237
28238 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
28239
28240         * marshal.c (mono_marshal_get_managed_wrapper): 
28241         mono_marshal_alloc takes native int so CONV_I
28242         the arg for 64bits.
28243
28244 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
28245
28246         * reflection.c (fixup_cattrs): New function to fixup the methoddef
28247         tokens in the cattr table. Fixes #53108.
28248
28249 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28250
28251         * loader.c: don't trim ".dll" before looking up in the config file.
28252         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
28253
28254 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
28255
28256         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
28257         Return the module which contains the resource as well.
28258         (ves_icall_System_Reflection_Module_Close): New icall.
28259
28260         * appdomain.c: Bump corlib version number.
28261
28262         * image.c (mono_image_addref): New public function.
28263
28264         * assembly.c: Call mono_image_addref.
28265
28266         * reflection.c (mono_module_get_object): Increase reference count of 
28267         the image.
28268
28269         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28270         Fixes #22532.
28271
28272         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
28273         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
28274         proper exceptions on DllImport problems.
28275
28276 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
28277
28278         * class.c, metadata.c: eliminate CSIZE macro.
28279
28280 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
28281
28282         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
28283         * object.h: Added async_callback field in MonoAsyncResult.
28284         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
28285         * verify.c: Added async_callback in MonoAsyncResult layout.
28286
28287 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
28288
28289         * reflection.c (mono_reflection_get_custom_attrs): Add support
28290         for Modules.
28291
28292 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28293
28294         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
28295         marshalling.
28296         (mono_marshal_method_from_wrapper): Add null pointer check.
28297
28298 2004-01-16  Martin Baulig  <martin@ximian.com>
28299
28300         * debug-mono-symfile.h: Set version number to 36 and reflect
28301         latest symbol writer changes.
28302
28303 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28304
28305         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
28306         multi-dimensional arrays.
28307         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
28308         (mono_class_from_mono_type): Use bounded_array_class_get.
28309         
28310         * class.c (mono_bounded_array_class_get): New function which takes
28311         a 'bounded' bool argument to distinguish vectors from one dimensional
28312         arrays.
28313
28314         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
28315         bounded_array_class_get if the array has bounds.
28316
28317         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
28318         Search modules loaded using AssemblyBuilder:AddModule as well.
28319
28320 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28321
28322         * appdomain.c: increased corlib version.
28323         * filewatcher.c: removed g_print.
28324         * icall.c:
28325         (get_property_info): only allocate what is actually requested.
28326         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
28327
28328 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28329
28330         * Makefile.am: added filewatcher.[ch]
28331         * filewatcher.[ch]: FileSystemWatcher runtime support.
28332         * icall.c: added new FSW icalls.
28333
28334 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
28335
28336         * string-icalls.c: fix stringbuilder regression as suggested by
28337         Iain McCoy <iain@mccoy.id.au>.
28338
28339 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
28340
28341         * process.c (process_read_stringtable_block): Recognize '007f' as
28342         a language neutral stringtable block.
28343
28344 2004-01-12  Patrik Torstensson
28345
28346         * object.h (MonoStringBuilder) : Changed layout to support our
28347         new stringbuilder class.
28348         * marshal.c: Change marshalling to support the new layout of 
28349         string builder.
28350         * appdomain.c: increased version number because new layout of
28351         string builder.
28352
28353 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
28354
28355         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
28356         assembly name as an string instead of an AssemblyName, since it is
28357         easier to extract info from it.
28358
28359         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
28360         the culture subdirectories too. Fixes #52231.
28361
28362 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28363
28364         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
28365         It takes 2 new parameters with an optional name for the method to look
28366         for and case ignoring info.
28367
28368         * threadpool.c: removed unused variable.
28369
28370 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28371
28372         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
28373         It takes 2 new parameters with an optional name for the property to look
28374         for and case ignoring info.
28375         Fixes bug #52753.
28376
28377 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
28378
28379         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
28380         Fix #52451.
28381
28382 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28383
28384         * appdomain.c:
28385         * assembly.c: escape the uri before passing it to g_filename_from_uri.
28386         Fixes bug #52630.
28387
28388 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
28389
28390         * reflection.c: Add support for more than one unmanaged resource.
28391
28392         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
28393         in field->def_value, as done in all other cases.
28394
28395         * reflection.c (mono_reflection_get_custom_attrs): Add support for
28396         TypeBuilders.
28397
28398         * reflection.c (mono_reflection_create_runtime_class): Remove 
28399         errorneous assignment to klass->element_class, since it is already
28400         done in mono_reflection_setup_internal_class.
28401
28402 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28403
28404         * gc.c: added missing LeaveCriticalSection.
28405         * icall.c: indented a couple of lines.
28406         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
28407         if we call EndInvoke inside a callback. Fixes bug #52601.
28408
28409 2004-01-07  Martin Baulig  <martin@ximian.com>
28410
28411         * mono-debug-debugger.h
28412         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
28413
28414 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
28415
28416         * appdomain.c: Use messages in NotImplementedException.
28417
28418         * exception.c (mono_get_exception_not_implemented): Now this takes
28419         a message argument.
28420
28421         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
28422         exception instead of g_asserting an aborting when something is not
28423         implemented.
28424
28425         Add some inline docs.
28426
28427 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
28428
28429         * reflection.h: Update after changes to object layout.
28430
28431         * reflection.c: Implement saving of unmanaged aka win32 resources.
28432
28433         * appdomain.c: Bump version number.
28434
28435         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
28436         Handle missing domains gracefully.
28437
28438 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
28439
28440         * file-io.c : On Windows, there are much more invalid_path_chars.
28441
28442 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
28443
28444         * class.h, object.c: prepare for GetType () speedup.
28445
28446 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
28447
28448         * profiler.c: workaround for --profile null reference exception on
28449           cygwin. Patch by Patrik Torstensson.
28450
28451 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
28452
28453         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
28454         make work for unaligned access.
28455
28456 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
28457
28458         * class.c: small cleanup (class->fields [i] -> field).
28459         * image.c: check address of metadata is valid.
28460
28461 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
28462
28463         * assembly.h assembly.c (mono_assembly_loaded): New public function to
28464         search the list of loaded assemblies.
28465
28466         * reflection.c (mono_reflection_type_from_name): Use 
28467         mono_assembly_loaded instead of mono_image_loaded.
28468
28469         * reflection.c: Fix warnings.
28470
28471 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
28472
28473         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
28474         is dynamic. This is needed since an assembly can contain both dynamic and
28475         non-dynamic images.
28476
28477         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
28478         assembly->dynamic.
28479
28480         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
28481
28482         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
28483         to store modules loaded using AddModule.
28484
28485         * reflection.c (mono_image_fill_file_table): Generalize this so it works
28486         on Modules.
28487
28488         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
28489
28490         * reflection.c (mono_image_fill_export_table_from_module): New function to
28491         fill out the EXPORTEDTYPES table from a module.
28492
28493         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
28494         into a separate function. Also handle loaded non-dynamic modules.
28495
28496         * reflection.c (mono_image_basic_init): Fix memory allocation.
28497
28498         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28499
28500         * assembly.c (mono_assembly_load_references): Make this public.
28501
28502 2003-12-19  Martin Baulig  <martin@ximian.com>
28503
28504         * class.c (mono_class_initialize_generic): Made this static, take
28505         a `MonoGenericInst *' instead of a `MonoClass *'.
28506         (mono_class_from_generic): Call mono_class_initialize_generic()
28507         unless we're already initialized or being called from
28508         do_mono_metadata_parse_generic_inst().
28509
28510         * class.h (MonoGenericInst): Added `initialized' and
28511         `init_pending' flags.
28512
28513         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
28514         `mono_class_init (gklass)' or mono_class_initialize_generic()
28515         here; set `generic_inst->init_pending' while parsing the
28516         `type_argv'.
28517
28518 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
28519
28520         * locales.c: include string.h for memxxx prototypes
28521
28522 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
28523
28524         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
28525         constructor when accessing literal fields.
28526
28527 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
28528
28529         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28530
28531         * reflection.c (assembly_add_resource_manifest): New function to fill
28532         the MANIFESTRESOURCE table.
28533
28534         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
28535
28536         * reflection.h: Update to changes in class layout.
28537
28538         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
28539         Reenable call to mono_runtime_is_shutting_down ().
28540
28541         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
28542         determine if the runtime is shutting down.
28543
28544 2003-12-16  Jackson Harper <jackson@ximian.com>
28545
28546         * icall.c: comment out call to mono_runtime_is_shutting_down to
28547         fix build.
28548         
28549 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
28550
28551         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
28552         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
28553
28554 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
28555
28556         * reflection.c: move definition of swap_with_size
28557         to before its first call
28558
28559 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
28560
28561         * appdomain.c (mono_runtime_is_shutting_down): New public function.
28562
28563         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
28564         icall.
28565
28566         * object.c: Fix warnings.
28567
28568         * icall.c (ves_icall_Type_Get...): Only consider inherited static
28569         members if FlattenHierarchy is set.
28570
28571         * reflection.c (mono_image_add_decl_security): New function to emit
28572         declarative security.
28573
28574         * reflection.h reflection.c: Add support for declarative security.
28575
28576         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28577         
28578 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
28579
28580         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28581         
28582         * appdomain.c verify.c: Moved corlib version checking into its own
28583         function in appdomain.c since it needs to create vtables etc.
28584
28585 2003-12-13  Patrik Torstensson <p@rxc.se>
28586
28587         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
28588         instead of unwrapped server.
28589
28590 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
28591
28592         * verify.c (check_corlib): Fix field index.
28593
28594 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
28595
28596         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
28597         GetGacPath icall.
28598
28599 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
28600
28601         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
28602         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
28603         cope with sizeof(size_t) != sizeof(guint32).
28604
28605 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28606
28607         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
28608         in case of failure.
28609
28610 2003-12-10  Mark Crichton <crichton@gimp.org>
28611
28612         * icall.c: removed the GetNonZeroBytes.  We now handle this case
28613         in managed code.
28614
28615         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
28616
28617 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
28618
28619         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
28620         marked as deleted.
28621
28622 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
28623
28624         * verify.c (check_corlib): Handle the case when the version field is 
28625         initialized by a static constructor.
28626
28627 2003-12-08  Patrik Torstensson  <p@rxc.se>
28628
28629     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
28630
28631 2003-12-08  Martin Baulig  <martin@ximian.com>
28632
28633         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
28634         a MonoReflectionGenericParameter, also take the parameter index
28635         and name as arguments.
28636         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
28637         (ves_icall_MonoGenericParam_initialize): New interncall.
28638         (ves_icall_Type_make_byref_type): New interncall.
28639
28640         * reflection.h (MonoReflectionGenericParam): Derive from
28641         MonoReflectionType, not just from MonoObject.  Added `refobj' and
28642         `index' fields.
28643
28644         * reflection.c (mono_reflection_define_generic_parameter): Create
28645         and return a new MonoReflectionGenericParam; don't initialize the
28646         constraints here.
28647         (mono_reflection_initialize_generic_parameter): New public method;
28648         initializes the constraints and creates the `param->pklass'.
28649
28650 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
28651
28652         * reflection.h reflection.c: Use the new fields 'num_types', 
28653         'num_fields' and 'num_methods' to track the number of types etc.
28654
28655         * verify.c (check_corlib): Check corlib version number.
28656
28657 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
28658
28659         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
28660         function works on all methods.
28661
28662 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
28663
28664         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
28665         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
28666         the custom_type_info flag of the transparent proxy.
28667         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
28668         objects that supports IRemotingTypeInfo.
28669         * object.h: Added custom_type_info field in transparent proxy.
28670
28671 2003-12-06  Martin Baulig  <martin@ximian.com>
28672
28673         * class.c (mono_class_create_from_generic): Removed.
28674         (mono_class_from_generic): Check `ginst->klass' before doing
28675         anything else.  This is important to fully support "recursive"
28676         generic types.
28677
28678         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
28679         empty `generic_inst->klass' before doing anything else.
28680
28681 2003-12-06  Dick Porter  <dick@ximian.com>
28682
28683         * verify.c: 
28684         * object.h:
28685         * icall.c:
28686         * locales.c: Use C structs to access class fields.  Don't do a
28687         conversion between MonoString and UChar because both are
28688         platform-endian UTF-16.  Compare now takes startindex and count
28689         parameters.  Add a char overload for IndexOf.  Speed up the
28690         invariant string IndexOf.
28691
28692 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
28693
28694         * Makefile.am (monosn_LDADD): Fix parallel build.
28695
28696 2003-12-04  Martin Baulig  <martin@ximian.com>
28697
28698         * icall.c
28699         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28700         (ves_icall_Type_make_array_type): New interncall.       
28701
28702 2003-12-04  Martin Baulig  <martin@ximian.com>
28703
28704         * locales.c: also change it in the !HAVE_ICU case.
28705
28706 2003-12-04  Dick Porter  <dick@ximian.com>
28707
28708         * icall.c:
28709         * locales.c: construct_compareinfo is now in CompareInfo, not
28710         CultureInfo.
28711
28712 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
28713
28714         * image.c (mono_image_load_file_for_image): Cache loaded images in the
28715         image->files array.
28716
28717         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
28718         table as well.
28719
28720         * assembly.c (mono_assembly_load_references): Only load references
28721         once.
28722
28723         * class.c (mono_class_from_name): Avoid linear search of the 
28724         EXPORTEDTYPE table.
28725
28726         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
28727
28728 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
28729
28730         * image.h (MonoImage): Add 'field_cache' field.
28731
28732         * loader.c (mono_field_from_token): Cache field lookups.
28733         
28734         * reflection.c (mono_module_get_object): Fix name property.
28735
28736         * icall.c (ves_icall_get_enum_info): Update after changes to 
28737         mono_metadata_get_constant_index ().
28738
28739         * icall.c: Get rid of get_type_info icall, use a separate icall for
28740         each type property to avoid needless memory allocations. Fixes #51514.
28741
28742         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
28743         to avoid needless binary searches.
28744
28745         * class.c (class_compute_field_layout): Move the initialization of
28746         field->def_value to mono_class_vtable ().
28747
28748         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
28749         non-corlib types.
28750
28751         * object.c (mono_object_allocate): Make it inline.
28752
28753         * object.c (mono_object_allocate_spec): Make it inline.
28754         
28755 2003-12-02  Dick Porter  <dick@ximian.com>
28756
28757         * locales.c (create_NumberFormat): NumberFormatInfo construction.
28758         Patch by Mohammad DAMT (mdamt@cdl2000.com).
28759
28760 2003-12-01  Dick Porter  <dick@ximian.com>
28761
28762         * threads.c: Fix signature and call in CreateMutex and
28763         CreateEvent.
28764
28765 2003-12-01  Dick Porter  <dick@ximian.com>
28766
28767         * icall.c: 
28768         * locales.c: Implement string compares and searching
28769
28770         * object.h: Add extra Thread field
28771
28772 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
28773
28774         * reflection.c (fixup_method): Add support for MonoCMethod.
28775
28776 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
28777
28778         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
28779
28780         * reflection.c (assembly_name_to_aname): Allow extra characters in
28781         assembly names. Fixes #51468.
28782
28783 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
28784
28785         * exception.c (mono_exception_from_name_domain): New helper function.
28786
28787         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
28788         exception object in the correct domain.
28789
28790         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
28791         formatting + make a copy a the input data.
28792
28793         * loader.c (mono_get_method_from_token): Methods which contain
28794         native code do not have entries in the ImplMap.
28795
28796         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
28797         Thanks to Gonzalo for spotting this.
28798         
28799         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
28800         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
28801
28802         * assembly.h (mono_assembly_load_from): Split the second part of 
28803         assembly loading into a new public function.
28804
28805         * exception.h (mono_get_exception_bad_image_format): New function.
28806
28807 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
28808
28809         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
28810         Enumerate all modules inside a dynamic assembly. Fixes #51293.
28811         
28812         * icall.c: Add new icall for creating dynamic methods.
28813
28814         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
28815
28816         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
28817
28818         * reflection.c (mono_reflection_create_dynamic_method): New icall to
28819         create a dynamic method.
28820
28821         * reflection.c (resolve_object): New helper function.
28822
28823         * reflection.c: Generalize ReflectionMethodBuilder and the functions
28824         which manipulate it so they can also work on dynamic methods.
28825
28826         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
28827         creating the MonoReflectionMethodAux structure if it is not needed.
28828         
28829         * reflection.h verify.c: Update after changes to object layout.
28830
28831         * reflection.c (method_builder_encode_signature): Fix compilation on
28832         gcc 2.95.x.
28833
28834 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
28835
28836         * appdomain.h: Added support for context static fields. Added static_data
28837           field to MonoAppContext and renamed thread_static_fields to a more
28838           generic special_static_fields in MonoAppDomain, since it can now contain
28839           context static fields.
28840         * domain.c: Updated hashtable name.
28841         * object.c: Replaced field_is_thread_static() for a more generic
28842           field_is_special_static() which also checks for context static attribute.
28843           In mono_class_vtable(), added support for static context fields.
28844         * threads.c: Changed methods that manage thread static fields to more
28845           generic methods so they can be reused both for thread and context static
28846           data.
28847         * threads.h: Declared some new methods.
28848
28849 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
28850
28851         * reflection.h: Update after changes to the managed types.
28852
28853         * reflection.c (encode_custom_modifiers): New helper function.
28854
28855         * reflection.c (method_encode_signature): Emit custom modifiers.
28856
28857         * reflection.c (field_encode_signature): Emit custom modifiers.
28858
28859 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
28860
28861         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
28862
28863         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
28864         implementation.
28865
28866         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
28867         icall.
28868
28869         * object.c (mono_field_get_value_object): New function.
28870
28871         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
28872         specific.
28873
28874 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
28875
28876         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
28877         return a preallocated out-of-memory exception instance.
28878
28879         * object.c (out_of_memory): Use the new function.
28880
28881         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
28882         flag is before the custom modifiers. Fixes #49802.
28883
28884 2003-11-16  Martin Baulig  <martin@ximian.com>
28885
28886         * class.c (mono_class_is_open_constructed_type): Implemented the
28887         MONO_TYPE_GENERICINST case.
28888
28889 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
28890
28891         * assembly.c (mono_assembly_fill_assembly_name): New function to
28892         fill out the MonoAssemblyName structure.
28893         (mono_assembly_open): Use the new function.
28894
28895         * icall.c (fill_reflection_assembly_name): New helper function.
28896
28897         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
28898         new function.
28899
28900         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
28901
28902 2003-11-15  Martin Baulig  <martin@ximian.com>
28903
28904         * class.c (mono_class_is_open_constructed_type): New public
28905         function; checks whether a type is an open constructed type,
28906         ie. whether it still contains type parameters.
28907         (mono_class_inflate_generic_type): If we're a type parameter and
28908         the inflated type is also a MONO_TYPE_(M)VAR, return the original
28909         type.
28910
28911         * class.h (MonoGenericInst): Added `guint32 is_open'.
28912
28913         * loader.c (method_from_methodspec): Check whether we're an open
28914         or closed constructed type and set `ginst->is_open'.
28915
28916         * reflection.c (mono_reflection_bind_generic_parameters): Check
28917         whether we're an open or closed constructed type and set
28918         `ginst->is_open'.
28919         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
28920         from open constructed types.
28921
28922 2003-11-15  Martin Baulig  <martin@ximian.com>
28923
28924         * reflection.c (mono_reflection_bind_generic_parameters): If we're
28925         a generic instance (instead of a generic type declaration) with
28926         unbound generic parameters, bind them to our actual types.
28927
28928 2003-11-14  Martin Baulig  <martin@ximian.com>
28929
28930         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
28931
28932         * reflection.c (mono_reflection_bind_generic_parameters): If we're
28933         an interface type, populate `res->interfaces' with instantiated
28934         versions of all the interfaces we inherit.
28935
28936 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
28937
28938         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
28939         when MONO_PATH is set but doesn't contain the install dir.
28940
28941 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28942
28943         * icall.c:
28944         (ves_icall_Type_GetInterfaces): don't return an interface twice when
28945         it's also implemented in base classes. Fixes bug #50927.
28946
28947 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
28948
28949         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
28950         if this method is called from a finalizer. Fixes #50913.
28951
28952 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
28953
28954         * threads.c: Implement VolatileRead/VolatileWrite
28955
28956         * icall.c: Add new icalls for VolatileRead/VolatileWrite
28957
28958 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28959
28960         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
28961         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
28962         2.95.3.
28963
28964         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
28965         from Peter Ross (pro@missioncriticalit.com).
28966         
28967 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
28968
28969         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
28970
28971 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28972
28973         * assembly.c (mono_assembly_load_references): Disable check because it
28974         triggers on older corlibs which lots of people have.
28975
28976 2003-11-12  Jackson Harper  <jackson@ximian.com>
28977
28978         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
28979         load corlib.dll if mscorlib.dll is not found.
28980         * assembly.h: Remove corlib name define.
28981         * class.c:
28982         * domain.c:
28983         * image.c: Change corlib name to mscorlib.
28984         
28985 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
28986
28987         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
28988
28989 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
28990
28991         * appdomain.h: Added loader_optimization here to sync with the C#
28992         code, and add disallow_binding_redirects field.
28993
28994 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
28995
28996         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
28997
28998         * reflection.c (mono_image_build_metadata): Fix crash on modules
28999         with no types.
29000
29001         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
29002
29003         * icall.c (ves_icall_get_method_info): Return callingConvention as
29004         well.
29005
29006         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
29007         namespaces from the EXPORTEDTYPE table as well.
29008
29009         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
29010         from all modules inside the assembly.
29011         
29012 2003-11-11  Martin Baulig  <martin@ximian.com>
29013
29014         * reflection.c (mono_reflection_bind_generic_parameters): Make
29015         this work for interfaces.
29016
29017 2003-11-11  Martin Baulig  <martin@ximian.com>
29018
29019         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
29020
29021 2003-11-11  Martin Baulig  <martin@ximian.com>
29022
29023         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
29024         "MonoInflatedMethod" and "MonoInflatedCtor".
29025
29026 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
29027
29028         * reflection.c (resolution_scope_from_image): Use the assembly table
29029         from the manifest module, since other modules don't have it.
29030
29031         * debug-helpers.c (mono_type_full_name): New helper function.
29032
29033         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
29034
29035         * image.c (mono_image_load_file_for_image): New public function which
29036         is a replacement for the load_file_for_image in class.c.
29037
29038         * assembly.c (mono_assembly_load_module): A wrapper for the function
29039         above which does assembly association and reference loading too.
29040
29041         * class.c (mono_class_from_name): Call mono_assembly_load_module.
29042
29043 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29044
29045         * appdomain.c: not all of the attributes for the full assembly name
29046         are required and the order doesn't matter. Fixes bug #50787.
29047
29048 2003-11-10  Dick Porter  <dick@ximian.com>
29049
29050         * locales.c: Use platform-endian UTF16
29051
29052 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29053
29054         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29055         
29056 2003-11-10  Martin Baulig  <martin@ximian.com>
29057
29058         * metadata.c
29059         (mono_metadata_load_generic_params): Make this actually work.
29060
29061         * reflection.c (mono_reflection_bind_generic_parameters): If our
29062         parent is a generic instance, pass all the `types' to it, no
29063         matter whether it has the same number of type parameters or not.
29064
29065 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29066
29067         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29068
29069         * assembly.c (mono_assembly_load_references): Move the image<->assembly
29070         assignment code to this function so it gets called recursively for all
29071         modules.
29072
29073         * image.c (load_modules): Remove the assembly assignment since it is
29074         now done by mono_assembly_load_references.
29075         
29076         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
29077         Add 'module' argument.
29078         (mono_module_get_types): New helper function.
29079         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
29080
29081 2003-11-08  Martin Baulig  <martin@ximian.com>
29082
29083         * class.c (mono_class_inflate_generic_method): Interface method
29084         don't have a header.
29085
29086         * reflection.c (mono_image_get_methodspec_token): Take an
29087         additional `MonoGenericInst *' argument instead of reading it from
29088         the header; this is necessary to support interfaces.
29089         (mono_image_create_token): Pass the `MonoGenericInst *' from the
29090         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
29091         (inflated_method_get_object): Take an additional `MonoGenericInst *'
29092         argument.
29093
29094         * reflection.h (MonoReflectionInflatedMethod): Added
29095         `MonoGenericInst *ginst'.
29096
29097 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
29098
29099         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
29100
29101 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
29102
29103         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
29104
29105 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
29106
29107         * reflection.c 
29108         (reflection_methodbuilder_from_method_builder):
29109         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
29110         initialize a ReflectionMethodBuilder structure.
29111         (mono_image_get_methodbuilder_token):
29112         (mono_image_get_ctorbuilder_token): New functions to emit memberref
29113         tokens which point to types in another module inside the same assembly.
29114
29115         * reflection.c: Use the new helper functions.
29116         
29117         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
29118
29119         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
29120         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
29121
29122         * reflection.c (resolution_scope_from_image): Emit a moduleref if
29123         neccesary.
29124
29125         * reflection.c (mono_image_build_metadata): Emit metadata only for the
29126         current module. Emit the manifest only for the main module.
29127
29128         * reflection.c (mono_image_create_token): Add assertion when a 
29129         memberref needs to be created.
29130
29131         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
29132
29133         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
29134         larger buffer for the custom attribute blob. Fixes #50637.
29135         
29136 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29137
29138         * threadpool.c: notify listener on async processing handles after
29139         invoking the async callback. Thanks to Zoltan.
29140
29141 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29142
29143         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
29144         avoid code duplication.
29145
29146         * reflection.h (MonoDynamicImage): New type which is currently unused,
29147         but will be used through the ref.emit code in place of 
29148         MonoDynamicAssembly.
29149
29150         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29151         object layout.
29152
29153         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
29154         a MonoDynamicImage instead of just a MonoImage.
29155         
29156         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
29157         icalls to ModuleBuilder but keep their semantics, so they will work
29158         with moduleb->assemblyb. This will change later.
29159         
29160 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29161
29162         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29163         object layout.
29164
29165         * reflection.c (mono_image_build_metadata): Avoid creation of a default
29166         main module, since it is now done by the managed code.
29167
29168 2003-11-03  Martin Baulig  <martin@ximian.com>
29169
29170         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
29171         `ginst->klass' here.
29172         (method_encode_methodspec): Don't use the `ginst->generic_method's
29173         klass if it's a generic instance, use `ginst->klass' in this case.
29174
29175 2003-11-03  Martin Baulig  <martin@ximian.com>
29176
29177         * reflection.c (mono_image_get_generic_method_param_info):
29178         Removed, use mono_image_get_generic_param_info() instead.
29179         (mono_image_get_type_info): Write the GenericParam table before
29180         the Method table.  This is neccessary because in the GenericParam
29181         table, type parameters of the class (ie. '!0' etc.) must come
29182         before the ones from its generic methods (ie. '!!0' etc).
29183
29184 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29185
29186         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
29187
29188 2003-11-02  Martin Baulig  <martin@ximian.com>
29189
29190         * reflection.c (create_generic_typespec): Take a
29191         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
29192         the generic parameters from it.
29193
29194 2003-11-02  Martin Baulig  <martin@ximian.com>
29195
29196         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
29197         instead of a `MonoClassField *' since we just need the type.
29198         (create_generic_typespec): New static function.  Creates a
29199         TypeSpec token for a generic type declaration.
29200         (mono_image_get_generic_field_token): New static function.
29201         (mono_image_create_token): If we're a FieldBuilder in a generic
29202         type declaration, call mono_image_get_generic_field_token() to get
29203         the token.
29204
29205 2003-11-02  Martin Baulig  <martin@ximian.com>
29206
29207         * reflection.h
29208         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
29209         `MonoReflectionGenericInst *declaring_type' and
29210         `MonoReflectionGenericInst *reflected_type' fields.
29211
29212         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
29213         `MonoReflectionGenericInst *declaring_type' and a
29214         `MonoReflectionGenericInst *reflected_type' argument instead of a
29215         single `MonoReflectionGenericInst *type' one.  Set
29216         `res->declaring_type' and `res->reflected_type' from them.
29217         (mono_reflection_inflate_field): Likewise.      
29218
29219 2003-11-02  Martin Baulig  <martin@ximian.com>
29220
29221         * class.c (mono_class_setup_vtable): Don't store generic methods
29222         in the vtable.  
29223
29224 2003-11-02  Martin Baulig  <martin@ximian.com>
29225
29226         * reflection.h (MonoReflectionGenericInst): Added
29227         `MonoReflectionType *declaring_type'.
29228
29229         * reflection.c (mono_reflection_bind_generic_parameters): Use
29230         `if (tb->parent)' instead of `klass->parent'.
29231
29232 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
29233
29234         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
29235         with an empty ASSEMBLY table.
29236
29237         * reflection.c (mono_image_build_metadata): Avoid using the same loop
29238         variable in the inner and outer loops.
29239
29240 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
29241
29242         * metadata.h (mono_metadata_make_token): Put parentheses around macro
29243         argument.
29244
29245         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
29246         
29247         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
29248         icalls. Instead, do everything in managed code. This is needed since
29249         it is hard to restore the original domain etc. in unmanaged code in the
29250         presence of undeniable exceptions.
29251
29252         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
29253         New icalls to push and pop appdomain refs.
29254
29255 2003-10-31  Martin Baulig  <martin@ximian.com>
29256
29257         * class.c (inflate_generic_type): Renamed to
29258         mono_class_inflate_generic_type() and made it public.
29259
29260         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
29261         New interncall.
29262
29263         * loader.c (mono_field_from_memberref): Also set the retklass for
29264         typespecs.
29265
29266         * fielder.c (mono_image_get_inflated_field_token): New static
29267         method; creates a metadata token for an inflated field.
29268         (mono_image_create_token, fixup_method): Added support for
29269         "MonoInflatedField".
29270         (fieldbuilder_to_mono_class_field): New static function.
29271         (mono_reflection_inflate_field): New public function.
29272
29273         * reflection.h
29274         (MonoReflectionGenericInst): Added `MonoArray *fields'.
29275         (MonoReflectionInflatedField): New typedef.     
29276
29277 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
29278
29279         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
29280         for Solaris and other platforms without s6_addr16
29281
29282 2003-10-30  Martin Baulig  <martin@ximian.com>
29283
29284         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
29285         argument instead of two.
29286         (mono_class_inflate_generic_signature): Likewise.
29287         (inflate_generic_header): Likewise.
29288         (mono_class_inflate_generic_method): Likewise.  In addition, if
29289         `ginst->klass' is set, it becomes the new `method->klass'.
29290
29291         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
29292         field.
29293
29294         * reflection.c (encode_generic_method_sig): Write a 0xa as the
29295         first byte. [FIXME]
29296         (method_encode_methodspec): If we have generic parameters, create
29297         a MethodSpec instead of a MethodRef.
29298         (fixup_method): Added support for "MonoInflatedMethod" and
29299         "MonoInflatedCtor".
29300         (mono_image_create_token): Added support for "MonoInflatedMethod"
29301         and "MonoInflatedCtor".
29302         (inflated_method_get_object): New static function; returns a
29303         managed "System.Reflection.MonoInflatedMethod" object.
29304         (mono_reflection_bind_generic_method_parameters): Return a
29305         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
29306         (mono_reflection_inflate_method_or_ctor): Likewise.
29307         (mono_image_get_generic_method_param_info): Initialize unused
29308         fields to zero.
29309         (mono_image_get_generic_param_info): Likewise.
29310
29311         * reflection.h (MonoReflectionInflatedMethod): New public
29312         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
29313         "S.R.MonoInflatedCtor" classes.
29314
29315         * loader.c (method_from_memberref): If we're a TypeSpec and it
29316         resolves to a generic instance, inflate the method.
29317
29318 2003-10-28  Dick Porter  <dick@ximian.com>
29319
29320         * object.c (mono_runtime_run_main): Convert command-line arguments
29321         into utf8, falling back to the user's locale encoding to do so.
29322
29323 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
29324
29325         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
29326         at this time.
29327
29328         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
29329
29330         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
29331         up icalls at method definition time. Partially fixes #33569.
29332
29333 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
29334
29335         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
29336         marshalling of arrays. Fixes #50116.
29337
29338         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
29339
29340         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
29341         points to a vtable in the dying appdomain.
29342
29343         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
29344         listeners into unmanaged code inside the lock.
29345
29346         * object.c (mono_class_vtable): Turn off typed allocation in non-root
29347         domains and add some comments.
29348
29349 2003-10-25  Martin Baulig  <martin@ximian.com>
29350
29351         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
29352
29353         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
29354
29355         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
29356         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
29357         currently parsing.  Create the generic class and store it in
29358         `generic_inst->klass' before parsing the type arguments.  This is
29359         required to support "recursive" definitions; see mcs/tests/gen-23.cs
29360         for an example.
29361         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
29362         to support recursive typespec entries.
29363
29364         * class.c (mono_class_setup_parent): If our parent is a generic
29365         instance, we may get called before it has its name set.
29366         (mono_class_from_generic): Splitted into
29367         mono_class_create_from_generic() and mono_class_initialize_generic().
29368
29369 2003-10-25  Martin Baulig  <martin@ximian.com>
29370
29371         * icall.c (ves_icall_Type_BindGenericParameters): Return a
29372         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
29373         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
29374         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
29375
29376         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
29377         (create_typespec): Likewise.
29378         (mono_reflection_bind_generic_parameters): Return a
29379         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
29380         (mono_reflection_inflate_method_or_ctor): New public function.
29381
29382         * reflection.h (MonoReflectionGenericInst): New typedef.        
29383
29384 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
29385
29386         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
29387         inside the domain lock. Fixes #49993.
29388         
29389         * object.c (mono_class_vtable): When typed allocation is used, 
29390         allocate vtables in the GC heap instead of in the mempool, since the
29391         vtables contain GC descriptors which are used by the collector even
29392         after the domain owning the mempool is unloaded.
29393
29394         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
29395
29396         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
29397         reflect what it does. Also invalidate mempools instead of freeing
29398         them if a define is set.
29399
29400         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
29401         of the appdomain.
29402         
29403         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
29404         hold the finalizable objects in this domain.
29405
29406         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
29407         appdomain.
29408
29409         * appdomain.c (mono_domain_set): New function to set the current
29410         appdomain, but only if it is not being unloaded.
29411
29412         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
29413         appdomain which is being unloaded.
29414         
29415         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
29416         unloading of the root appdomain.
29417
29418         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
29419         icall to execute a method in another appdomain. Intended as a 
29420         replacement for InternalSetDomain, which can confuse the code 
29421         generation in the JIT.
29422
29423         * appdomain.c (mono_domain_is_unloading): New function to determine
29424         whenever an appdomain is unloading.
29425
29426         * appdomain.c (mono_domain_unload): New function to correctly unload
29427         an appdomain.
29428
29429         * assembly.c (mono_assembly_load_references): Check that an assembly
29430         does not references itself.
29431
29432         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
29433         domain manually, it asks the finalizer thread to do it, then waits for
29434         the result. Also added a timeout.
29435
29436         * icall.c: Register the new icalls.
29437
29438         * threads.h threads.c: Export the mono_gc_stop_world and 
29439         mono_gc_start_world functions.
29440         
29441         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
29442         function to fill out the mempool with 0x2a.
29443
29444 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
29445
29446         * reflection.h (MonoReflectionMethodAux): New structure to store
29447         information which is rarely used, thus is not in the MonoMethod
29448         structure.
29449
29450         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
29451         store the aux info.
29452
29453         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
29454         and marshalling info into the aux structure.
29455
29456         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
29457         from the aux structure.
29458
29459         * loader.c (mono_method_get_param_names): Retrieve the param names from
29460         the aux structure.
29461         
29462 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
29463
29464         * exception.h exception.c: Add AppDomainUnloadedException && fix 
29465         warning.
29466
29467 2003-10-21  Dick Porter  <dick@ximian.com>
29468
29469         * socket-io.c
29470         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
29471         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
29472
29473 2003-10-21  Martin Baulig  <martin@ximian.com>
29474
29475         * reflection.c (mono_reflection_bind_generic_parameters):
29476         `klass->parent' is NULL for interfaces.
29477
29478 2003-10-21  Martin Baulig  <martin@ximian.com>
29479
29480         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
29481
29482 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
29483
29484         * exception.c (mono_exception_from_name_msg): New helper function for
29485         creating exceptions and initializing their message field.
29486
29487         * exception.c: Simplify functions using the new helper.
29488
29489         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
29490         New function.
29491
29492         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
29493         mono_raise_exception, since otherwise gcc doesn't generate the function
29494         epilog for raise_exception, confusing the stack unwinding in the JIT.
29495         Fixes #45043.
29496
29497         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
29498         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
29499         Fixes #49499.
29500
29501 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29502
29503         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
29504         utf8.
29505
29506 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
29507
29508         * icall.c: Removed GetUninitializedObject method because
29509           AllocateUninitializedClassInstance does the same.
29510
29511 2003-10-18  Martin Baulig  <martin@ximian.com>
29512
29513         * class.c (inflate_generic_signature): Renamed to
29514         mono_class_inflate_generic_signature() and made it public.
29515         (my_mono_class_from_generic_parameter): New static function; if we
29516         don't already have the generic parameter's MonoClass, create a
29517         very simple one which is just used internally in the runtime and
29518         not passed back to managed code.
29519
29520         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
29521
29522         * metadata.h (MonoMethodSignature): Moved the
29523         `MonoGenericParam *gen_params' to the MonoMethodHeader.
29524         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
29525
29526         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
29527         ves_icall_MonoMethod_GetGenericArguments(); this is now an
29528         interncall on the MonoMethod class, not on MethodInfo.
29529         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
29530         calling mono_reflection_bind_generic_method_parameters() directly.
29531
29532         * loader.c (mono_method_get_signature): If this is a MethodSpec;
29533         return the already computed `method->signature'.
29534         (method_from_methodspec): New static function to load a method
29535         from a MethodSpec entry.
29536         (mono_get_method_from_token): Call the new method_from_methodspec()
29537         for MethodSpec tokens.  
29538         (mono_get_method_from_token): If we're a generic method, load the
29539         type parameters.
29540
29541         * reflection.c (mono_image_get_memberref_token): Allow
29542         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
29543         table.
29544         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
29545         (mono_image_create_token): First check whether it's a generic
29546         method (so we'd need to create a MethodSpec), then do the other
29547         two alternatives.
29548         (mono_reflection_bind_generic_method_parameters): Return a
29549         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
29550         called directly from the interncall.
29551
29552 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
29553
29554         * reflection.c (load_public_key): Move loading of the public key
29555         into managed code.
29556
29557         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
29558
29559         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
29560         fields.
29561
29562         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
29563         culture, hash_alg and public_key. Fixes #49555.
29564
29565 2003-10-17  Martin Baulig  <martin@ximian.com>
29566
29567         * class.h (MonoGenericInst): Moved this declaration here and added
29568         `MonoMethod *generic_method'.
29569
29570         * icall.c
29571         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
29572         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
29573
29574         * metadata.c (mono_metadata_type_equal): Two types of
29575         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
29576         index; ie. don't compare the address of the `MonoGenericParam'
29577         structure.
29578         (mono_metadata_load_generic_params): Removed the `MonoMethod
29579         *method' argument.
29580
29581         * metadata.h (MonoGenericInst): Moved declaration to class.h.
29582         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
29583
29584         * reflection.c (method_encode_signature): Encode the number of
29585         generic parameters.
29586         (encode_generic_method_sig): New static function.
29587         (method_encode_methodspec): New static function; creates an entry
29588         in the MethodSpec table for a generic method.
29589         (mono_image_get_methodspec_token): New static function.
29590         (mono_image_create_token): Call mono_image_get_methodspec_token()
29591         for generic methods.
29592         (mono_reflection_bind_generic_method_parameters): New public
29593         function.  Instantiates a generic method.
29594
29595 2003-10-16  Martin Baulig  <martin@ximian.com>
29596
29597         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
29598         *gen_params' here from MonoMethodHeader.
29599
29600         * metadata.c (mono_metadata_parse_method_signature): If we have
29601         generic parameters, initialize `method->gen_params' and then set
29602         the correct `type->data.generic_param' in all the parameters.
29603
29604 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
29605
29606         * threads.c (mono_threads_get_default_stacksize): New function to 
29607         return the default stacksize.
29608
29609         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
29610         termination of the finalizer thread, since the previous method had
29611         race conditions. Fixes #49628.
29612
29613         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
29614         as for the other managed threads.
29615
29616 2003-10-16  Martin Baulig  <martin@ximian.com>
29617
29618         * class.c (inflate_generic_signature): Copy `generic_param_count'
29619         and `gen_params'.
29620
29621         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
29622         New interncall.
29623
29624         * metadata.c (mono_metadata_parse_method_signature): Actually set
29625         the `method->generic_param_count' here.
29626         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
29627
29628 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
29629
29630         * object.h: Add a new field to TypedRef to simplify the implementation
29631         of the REFANY opcodes in the JIT.
29632
29633         * icall.c: Make use of the new field.
29634
29635         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
29636         dynamically.
29637
29638 2003-10-15  Martin Baulig  <martin@ximian.com>
29639
29640         * class.c (mono_class_from_gen_param): Renamed to
29641         mono_class_from_generic_parameter() and moved most of the
29642         functionality from mono_reflection_define_generic_parameter()
29643         here; ie. we create a "real" class here.
29644         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
29645         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
29646         previously been called.
29647
29648         * class.h (MonoGenericParam): Moved the declaration of this struct
29649         here from metadata.h and added `MonoMethod *method'.
29650
29651         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
29652         interncall.
29653
29654         * loader.c (mono_get_method_from_token): If we have any generic
29655         parameters, call mono_metadata_load_generic_params() to read them
29656         from the MONO_TABLE_GENERICPAR.
29657
29658         * metadata.c (mono_metadata_load_generic_params): Added
29659         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
29660
29661         * metadata.h (MonoMethodSignature): Replaced
29662         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
29663         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
29664
29665         * reflection.c (mono_reflection_define_generic_parameter): Moved
29666         most of the functionality into the new
29667         mono_class_from_generic_parameter(); set the `method' field if
29668         we're a method parameter.       
29669
29670 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
29671
29672         * marshal.c (emit_struct_conv): if native size is 0
29673         emit no code.
29674
29675 2003-10-14  Martin Baulig  <martin@ximian.com>
29676
29677         * icall.c: The generics API has changed in the spec since it was
29678         added to System.Type; these modifications make it match the spec
29679         again.
29680         (ves_icall_Type_GetGenericParameters): Renamed to
29681         `ves_icall_Type_GetGenericArguments'.
29682         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
29683         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
29684         `ves_icall_MonoType_get_HasGenericArguments'.
29685         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
29686         `ves_icall_MonoType_get_IsGenericParameter'.
29687         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
29688         this is no interncall anymore.
29689         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
29690         `ves_icall_TypeBuilder_get_IsGenericParameter'.
29691
29692 2003-10-14  Martin Baulig  <martin@ximian.com>
29693
29694         * reflection.c (mono_reflection_bind_generic_parameters): Also
29695         inflate generic methods if we're reading the class from IL.
29696
29697 2003-10-13  Martin Baulig  <martin@ximian.com>
29698
29699         * reflection.c (mono_reflection_define_generic_parameter): This
29700         method isn't called directly from the icall anymore; take a
29701         `MonoReflectionAssemblyBuilder *' so we can use this for type and
29702         method generic parameters.
29703         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
29704         (method_builder_encode_signature): Encode generic parameters.
29705         (mono_image_get_method_info): Write generic params to the
29706         MONO_TABLE_GENERICPARAM table.
29707
29708         * reflection.h (MonoReflectionMethodBuilder): Added
29709         `MonoArray *generic_params'.
29710
29711         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
29712
29713         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
29714         wrapper for mono_reflection_define_generic_parameter().
29715         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
29716
29717 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
29718
29719         * marshal.h: Add missing function to fix build.
29720
29721         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
29722         the SetLastError pinvoke attribute.
29723
29724         * marshal.c (mono_marshal_set_last_error): New helper function called
29725         by the generated code.
29726         
29727         * marshal.c (mono_mb_emit_branch): New helper function.
29728
29729         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
29730
29731         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
29732         classes as parameters and return values of delegates. Fixes #29256. 
29733
29734 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
29735
29736         * locales.c: use gint32 in non HAVE_ICU case
29737
29738 2003-10-11  Martin Baulig  <martin@ximian.com>
29739
29740         * mono-debug.c (mono_debug_add_method): Added a workaround for
29741         bug #48591.
29742
29743 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
29744
29745         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
29746         delegates passed to native code must use the STDCALL calling 
29747         convention. Fixes #35987.
29748
29749 2003-10-10  Martin Baulig  <martin@ximian.com>
29750
29751         * class.c (inflate_generic_type): If we're inflating for a generic
29752         type instance (and not for a generic method), return
29753         MONO_TYPE_MVAR unchanged.
29754
29755 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29756
29757         * string-icalls.c: Join ignores null strings in the source array.
29758         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
29759         * threads.c: GetAvailableTheads is slightly more accurate.
29760
29761 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
29762
29763         * threads.h threads.c : add mono_threads_set_default_stacksize
29764         and pass default to CreateThread calls.
29765
29766 2003-10-09  Dick Porter  <dick@ximian.com>
29767
29768         * icall.c:
29769         * locales.h:
29770         * locales.c: Internal calls for constructing CultureInfo and
29771         related objects from libicu (if its available.)
29772
29773 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
29774
29775         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
29776
29777 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29778
29779         * threadpool.c: added an argument to async_invoke_thread that is the
29780         item to process, pass the MonoAsyncResult to the thread start function
29781         when creating a new thread. This way we don't need to acquire any lock
29782         when we're creating a new thread. Readded a semaphore for faster
29783         response times (instead of that Sleep i added).
29784
29785 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
29786
29787         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
29788         get daylight change dates better on Windows, fix handling
29789         of platforms without tm_gmtoff.
29790
29791 2003-10-06  Martin Baulig  <martin@ximian.com>
29792
29793         * class.c (inflate_generic_method): Renamed to
29794         mono_class_inflate_generic_method() and made public.
29795         (mono_class_init): Don't inflate the generic methods here.
29796         (mono_class_from_generic): Added `gboolean inflate_methods'
29797         argument.  Inflate the methods here.
29798
29799         * loader.c (mono_method_get_param_names): Ignore instances of
29800         generic types for the moment.
29801
29802         * reflection.c (fixup_method): Added support for inflated methods.
29803         (mono_image_create_token): Use mono_image_get_methodref_token()
29804         for inflated methods.
29805         (mono_custom_attrs_from_param): Ignore instances of generic types
29806         for the moment.
29807         (mono_reflection_bind_generic_parameters): New public function.
29808         Moved all the functionality from
29809         ves_icall_Type_BindGenericParameters() here and added support for
29810         dynamic types.
29811         (mono_reflection_define_generic_parameter): Initialize
29812         `klass->methods' here.
29813
29814         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
29815         functionality into mono_reflection_define_generic_parameter().
29816         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
29817         TypeBuilder, return that TypeBuilder.
29818
29819 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29820
29821         * appdomain.c: removed mono_delegate_semaphore.
29822
29823         * threadpool.c:
29824         (mono_thread_pool_add): moved hash table creation inside and the thread 
29825         creation outside of the critical region.
29826         (mono_thread_pool_finish): removed obsolete code.
29827         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
29828         continue or exit the thread depending on the queue.
29829
29830 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
29831
29832         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
29833         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
29834         handle more bool marshalling options
29835
29836 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
29837
29838         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
29839         arrays of structs. Also add a more descriptive error message when
29840         a structure member is marshalled as LPArray.
29841
29842 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
29843
29844         * marshal.c (mono_marshal_get_native_wrapper): Add support for
29845         marshalling arrays of complex types. Fixes #29098. Also remove an
29846         usused and incomplete function.
29847
29848 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
29849
29850         * gc.c: report heap_size - free_bytes as total memory allocated
29851         (bug#49362).
29852
29853 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
29854
29855         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
29856         fix timezone handling problems on Windows.
29857         
29858         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
29859         asserts when the year is outside the range handled by ms the functions.
29860
29861         * class.c (setup_interface_offsets): If the class is an interface,
29862         fill out its interface_offsets slot.
29863
29864 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29865
29866         * threadpool.c: mark threadpool threads as background.
29867
29868 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
29869
29870         * decimal.c - define DECINLINE to nothing if not using GCC
29871
29872 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
29873
29874         * assembly.c: More refcount fixes.
29875
29876 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29877
29878         * string-icalls.c: if we're not trimming, return the same string.
29879         When not splitting, don't create a new string.
29880
29881 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29882
29883         * image.c:
29884         (mono_image_open): increment the ref_count inside the critical section.
29885
29886 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
29887
29888         * image.c (mono_image_open): Fix reference counting bug.
29889
29890 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
29891
29892         * marshal.c (mono_marshal_type_size) struct alignment changed for 
29893         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
29894         64bits. Avoid leak in mono_marshal_get_native_wrapper when
29895         mono_lookup_pinvoke_call throws.        
29896
29897 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
29898
29899         * reflection.c (mono_reflection_parse_type): Fix #49114.
29900
29901         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
29902         temporary workaround for cygwin header problem.
29903
29904         * object.c (mono_object_isinst): Synchronize this with the code
29905         generated by the JIT for casts.
29906
29907 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
29908
29909         * reflection.c (encode_type): Fix #38332.
29910
29911 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
29912
29913         * marshal.c (mono_marshal_method_from_wrapper): New function to return
29914         the original method from the wrapper method.
29915
29916 2003-09-25  Martin Baulig  <martin@ximian.com>
29917
29918         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
29919         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
29920         (ves_icall_Type_get_IsGenericInstance): New interncall.
29921
29922 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
29923
29924         * object.c: fix cast warning in big endian code.
29925
29926 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
29927
29928         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
29929         
29930 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29931
29932         * assembly.c: don't call check_env from mono_assembly_load. It's
29933         already done once in mono_assemblies_init and may cause headaches when
29934         multiple threads are loading assemblies.
29935
29936 2003-09-19  Martin Baulig  <martin@ximian.com>
29937
29938         * reflection.c (mono_reflection_define_generic_parameter): Don't
29939         allocate `klass->methods', set `klass->flags' to
29940         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
29941
29942 2003-09-18  Martin Baulig  <martin@ximian.com>
29943
29944         * class.c (mono_class_init): Don't create `class->methods' if it's
29945         already initialized.
29946
29947         * metadata.c (mono_metadata_load_generic_params): Make this
29948         actually work.
29949
29950         * reflection.c (mono_reflection_define_generic_parameter): Set
29951         parent class and interfaces from the constraints.
29952
29953         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
29954         to keep this struct in sync with the declaration in TypeBuilder.cs.
29955
29956 2003-09-17  Martin Baulig  <martin@ximian.com>
29957
29958         * metadata.h (MonoType): Replaced the data's `int type_param'
29959         field with `MonoGenericParam *generic_param'.
29960         (MonoGenericParam): Added `MonoClass *klass'.
29961
29962         * class.c (mono_class_from_gen_param): Removed the
29963         `MonoImage *image' and `int type_num' arguments.
29964
29965         * metadata.c (mono_metadata_parse_generic_param): New static
29966         method; creates a MonoGenericParam which just contains the index.
29967         (do_mono_metadata_parse_type): Call
29968         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
29969         MONO_TYPE_MVAR.
29970
29971         * reflection.c (mono_image_typedef_or_ref): Generic type
29972         parameters may be in the same assembly, but never use a typedef
29973         for them.
29974         (mono_reflection_define_generic_parameter): We're now creating a
29975         "real" class for the type parameter; it's now safe to call
29976         mono_class_from_mono_type() on the class'es type, it'll do the
29977         right thing.
29978
29979 2003-09-16  Martin Baulig  <martin@ximian.com>
29980
29981         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
29982         `symfile->range_entry_size' and `symfile->class_entry_size' here;
29983         the `symfile' data structure must be fully initialized before it
29984         gets added to the table.
29985
29986 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
29987
29988         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
29989
29990         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
29991         class init trampolines.
29992
29993 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
29994
29995         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
29996         to the built-in profiler to turn off time and allocation profiling
29997         respectively.
29998
29999 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
30000
30001         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
30002         g_direct_equal.
30003
30004         * debug-helpers.c (mono_method_full_name): Print the wrapper type
30005         in human readable form.
30006
30007 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
30008
30009         * reflection.c icall.c: Fixed warnings.
30010
30011         * image.c (load_class_names): Use a temporary hash table to hold the
30012         namespaces in order to avoid doing many string comparisons.
30013
30014         * image.h: Fix typo.
30015
30016         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
30017         Pass NULL instead of g_direct_equal to the GHashTable constructor 
30018         since the NULL case is short-circuited inside g_hash_table_lookup, 
30019         leading to better performance.  
30020
30021         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
30022         obtain the first custom attribute for a given index. Depends on the
30023         CustomAttribute table being sorted by the parent field.
30024
30025         * reflection.c (mono_custom_attrs_from_index): Use the new function 
30026         for better performance.
30027
30028 2003-09-07  Martin Baulig  <martin@ximian.com>
30029
30030         * class.c (mono_class_init): If we're a generic instance, inflate
30031         all our methods instead of loading them from the image.
30032         (mono_class_from_generic): Set `class->methods = gklass->methods'.
30033
30034 2003-09-07  Martin Baulig  <martin@ximian.com>
30035
30036         * mono-debug-debugger.c: Added support for constructors.
30037
30038 2003-09-06  Martin Baulig  <martin@ximian.com>
30039
30040         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
30041         New interncall.
30042
30043         * reflection.c (mono_reflection_setup_generic_class): Call
30044         ensure_runtime_vtable() to create the vtable.
30045
30046 2003-09-05  Martin Baulig  <martin@ximian.com>
30047
30048         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
30049         MONO_TYPE_MVAR.
30050
30051 2003-09-04  Martin Baulig  <martin@ximian.com>
30052
30053         * reflection.c (mono_reflection_define_generic_parameter): Generic
30054         parameters start with zero.
30055
30056 2003-09-04  Martin Baulig  <martin@ximian.com>
30057
30058         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
30059
30060         * reflection.h (MonoReflectionGenericParam): New typedef.
30061         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
30062         the generic parameters from the managed TypeBuilder.
30063
30064         * reflection.c (mono_reflection_define_generic_parameter): New function.
30065         (mono_reflection_create_runtime_class): Encode generic parameters.
30066         (mono_reflection_setup_generic_class): New function; this is
30067         called after adding adding all generic params to the TypeBuilder.
30068         (encode_type): Added MONO_TYPE_VAR.
30069
30070 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
30071
30072         * class.h class.c (mono_class_needs_cctor_run): Moved this method
30073         here from the JIT.
30074
30075         * assembly.h assembly.c: Moved the AOT loading code into an assembly
30076         load hook.
30077
30078 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
30079
30080         * reflection.h reflection.c class.h class.c: Delete duplicate 
30081         definition of mono_type_get_name () from reflection.c and export the
30082         one in class.c.
30083
30084         * class.c: Class loading fixes from Bernie Solomon 
30085         (bernard@ugsolutions.com).
30086
30087         * reflection.c: Endianness fixes from Bernie Solomon 
30088         (bernard@ugsolutions.com).
30089         
30090 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
30091
30092         * assembly.h assembly.c: Define a file format version for AOT
30093         libraries.
30094         
30095         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
30096
30097         * appdomain.h (MonoJitInfo): New field to determine whenever the
30098         code is domain neutral.
30099         
30100 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
30101
30102         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
30103
30104 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
30105
30106         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
30107         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
30108         Avoid caching the result since strings must be domain specific. Fixes
30109         #48050.
30110
30111 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
30112
30113         * marshal.c (mono_marshal_init): Make this callable multiple times
30114         since it is hard to find a correct place to call it.
30115
30116         * object.c (mono_runtime_class_init): Execute static constructors in
30117         the correct appdomain.
30118
30119         * image.c (build_guid_table): Handle the case when multiple images have
30120         the same GUID.
30121
30122 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30123
30124         * icall.c: added a couple of icalls for System.Web.
30125
30126 2003-08-28  Martin Baulig  <martin@ximian.com>
30127
30128         * icall.c (ves_icall_Type_BindGenericParameters): Use
30129         `klass->generic_inst' instead of `&klass->byval_arg' in the
30130         mono_type_get_object() call.  The returned type must be
30131         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
30132
30133 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
30134
30135         * NOTES: New file.
30136
30137         * object.c (mono_class_proxy_vtable): Make it thread safe.
30138
30139         * pedump.c: Fix warning.
30140
30141         * object.c appdomain.h: Get rid of metadata_section. 
30142         It is no longer needed and it was causing deadlocks with domain->lock.
30143
30144         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
30145
30146 2003-08-26  Martin Baulig  <martin@ximian.com>
30147
30148         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
30149
30150 2003-08-26  Martin Baulig  <martin@ximian.com>
30151
30152         * pedump.c (main): Call mono_metadata_init(),
30153         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
30154         and mono_loader_init().
30155
30156 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
30157
30158         * loader.h: Add missing include to fix build.
30159
30160         * image.h: mono_image_load_references is no more.
30161
30162         * assembly.c: Reworked assembly loading to make it really thread safe.
30163         After these changes, the assembly returned by mono_assembly_open is
30164         fully initialized, i.e. all its references assemblies are loaded.
30165
30166         * assembly.c (mono_image_load_references): Renamed to 
30167         mono_assembly_load_references, and made private, since clients no
30168         longer need to call it.
30169
30170         * class.c: Removed calls to mono_assembly_load_references, since it was
30171         a source of deadlocks.
30172
30173         * loader.h loader.c class.h class.c: Protect data structures using a 
30174         new lock, the loader lock.
30175
30176         * class.c (mono_class_setup_vtable): Create temporary hash tables and
30177         GPtrArrays only when needed.
30178
30179         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
30180         into empty structures by mcs. Fixes pinvoke7.cs.
30181         
30182         * domain.c (mono_init): Call a new initialization function.
30183
30184         * appdomain.c (mono_runtime_init): Call the new initializer function
30185         of the marshal module.
30186
30187         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
30188         inserted into empty structures by mcs. Fixes pinvoke7.cs.
30189
30190         * marshal.h marshal.c: Added locks around the wrapper caches to make
30191         this module thread safe.
30192
30193         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
30194         this argument. Fixes pinvoke1.exe.
30195
30196 2003-08-25  Lluis Sanchez <lluis@ximian.com>
30197
30198         * object.h: Added call_type field to MonoMethodMessage and the corresponding
30199         enumeration of values. Removed fields to store remote call output values in
30200         MonoAsyncResult. Not needed any more.
30201         * object.c: Initialize call_type and async_result fields in mono_message_init.
30202         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
30203         dispatching the message.
30204         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
30205         async call to finish. To do it use a message with EndInvoke call type.
30206
30207 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
30208
30209         * loader.h loader.c (mono_method_hash_marhal_info): New function which
30210         determines whenever a method has marshalling info.
30211
30212 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30213
30214         * assembly.c: fix the build on windows.
30215
30216 2003-08-22 Lluis Sanchez <lluis@ximian.com>
30217
30218         * object.cs: Fixed bug #47785.
30219
30220 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
30221
30222         * string-icalls.c (StringReplace): If their are no occurances of
30223         the old string found return a reference to the supplied
30224         string. This saves some memory and matches MS behavoir.
30225         
30226 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30227
30228         * socket-io.c: fixed compilation for systems that define AF_INET6
30229         and don't define SOL_IP/SOL_IPV6.
30230
30231 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
30232
30233         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
30234         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
30235
30236         * rawbuffer.c rawbuffer.h: Make this module thread safe.
30237
30238         * domain.c: Make this module thread safe.
30239
30240         * domain.c (mono_init): Call new initialization function.
30241
30242         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
30243         reference types too. Fixes #38812.
30244
30245         * image.c (mono_image_init): Fixed warnings.
30246
30247         * class.c (mono_class_from_typeref): Handle assembly load failure
30248         correctly.
30249
30250         * appdomain.c (add_assemblies_to_domain): Handle the case when
30251         the references of an assembly are not yet loaded.
30252
30253         * metadata.c image.c assembly.c: Moved initialization of global
30254         variables to a separate function called at startup since lazy 
30255         initialization of these variables is not thread safe.
30256         
30257         * image.c assembly.c: Made this module thread safe by adding locks in 
30258         the appropriate places.
30259
30260         * domain.c (mono_init): Call the new initialization functions of the
30261         three modules.
30262
30263 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
30264
30265         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
30266           make a direct call. It is proxy's work to make the call asynchronous.
30267           mono_delegate_end_invoke(): If the targe is a proxy, just collect
30268           the return values.
30269         * object.cs: mono_method_call_message_new(): read AsyncResult and
30270           state object from parameters list, if this info is requested.
30271         * object.h: Added fields to store remote call output values in
30272           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
30273
30274 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30275
30276         * object.h: add needed fields to MonoThread.
30277         * threads.c, threads.h: allow registering a function to cleanup data
30278         allocated per thread by the JIT.
30279
30280 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30281
30282         * loader.h: portability fix by Bernie Solomon
30283         * <bernard@ugsolutions.com>.
30284
30285 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
30286
30287         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
30288         return a MonoArray. This simplifies the code and also ensures that
30289         the cache allways contains an object reference as a value.
30290
30291         * icall.c (ves_icall_get_parameter_info): Simplified using the new
30292         function.
30293
30294 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30295
30296         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
30297         fixes a problem with byte ordering when getting the address family for
30298         a socket.
30299
30300 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
30301
30302         * .cvsignore: Added monosn.
30303
30304         * reflection.h reflection.c loader.c: Added support for parameter
30305         marshalling to dynamically created types. Fixes #47295.
30306
30307 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
30308
30309         * rand.c: remove useless warnings.
30310
30311 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30312
30313         * class.c: implemented ldtoken for methods and fieldrefs.
30314
30315 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30316
30317         * threadpool.c: when mono_async_invoke was called, no one took care of
30318         monitoring the queue. So if the method invoked took some time and we
30319         got new async invoke requests after 500 ms (the thread created waited
30320         that long in WaitForSingleObject), the new async invoke was not called
30321         until the previous one finished.
30322
30323         This is fixed now. Thanks to Totte for helping with it.
30324
30325 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30326
30327         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
30328
30329 2003-08-11  Martin Baulig  <martin@ximian.com>
30330
30331         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
30332
30333 2003-08-06  Martin Baulig  <martin@ximian.com>
30334
30335         * mono-debug-debugger.c: Added support for static fields,
30336         properties and methods.
30337
30338 2003-08-06  Martin Baulig  <martin@ximian.com>
30339
30340         * mono-debug-debugger.c: Don't store the MonoString's vtable to
30341         make this work for applications with multiple application domains.
30342
30343 2003-08-04  Martin Baulig  <martin@ximian.com>
30344
30345         * mono-debug-debugger.c: Completely reworked the type support; the
30346         most important thing is that we're now just using one single
30347         `MonoType' instance per type.
30348
30349 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
30350
30351         * mono-endian.h, mono-endian.c, icall.c: Added icall
30352         ves_icall_System_Double_AssertEndianity to assert double word endianity
30353         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
30354
30355 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30356
30357         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
30358         support, icalls and fixes.
30359
30360 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
30361
30362         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
30363         classes that are a punctuation character in .NET is not the same a
30364         g_unichar_ispunct.
30365
30366 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30367
30368         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
30369
30370 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
30371
30372         * icall.c: Add new MemCopy internalcall.
30373         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
30374         Simplified code; It is not necessary to handle all the cases here,
30375         as the C# code takes care of it.  Only handle the case of the name
30376         resource embedded into the assembly.
30377
30378         Changed signature to return the data pointer and the size of the
30379         data. 
30380
30381 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
30382
30383         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
30384         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
30385
30386 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30387
30388         * socket-io.c: ignore EINTR error in select.
30389
30390 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
30391
30392         * class.h, class.c: removed unused subclasses field in MonoClass.
30393
30394 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30395
30396         * icall.c: improve fix of get_base_definition(). If the parent class
30397           doesn't have the mehod, look at the parent of the parent.
30398         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
30399           to check if a parameter is an in or out parameter
30400           (PARAM_ATTRIBUTE_IN is not set by default).
30401           mono_method_return_message_restore(): Use mono_class_value_size to
30402           get the size of a value type. mono_type_stack_size (parameterType)
30403           does not return the correct value if parameterType is byRef.
30404           mono_load_remote_field(), mono_load_remote_field_new(),
30405           mono_store_remote_field(), mono_store_remote_field_new():
30406           raise exception if the remote call returns an exception.
30407
30408 2003-07-28  Martin Baulig  <martin@ximian.com>
30409
30410         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
30411         method.  This is a wrapper around mono_runtime_invoke() which
30412         boxes the instance object if neccessary.
30413
30414 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30415
30416         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
30417         metadata.h, row-indexes.h, verify.c: first cut of generics support.
30418
30419 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30420
30421         * icall.c: disable mcs bug workaround.
30422
30423 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
30424
30425         * object.c (mono_runtime_class_init): Take the metadata_section
30426         mutex before obtaining the domain mutex.
30427
30428         * appdomain.h: Added definition of metadata_section mutex here. 
30429
30430         * object.c: define metadata_mutex here.
30431
30432 2003-07-24  Ravi Pratap  <ravi@ximian.com>
30433
30434         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
30435         fixed.
30436
30437 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
30438
30439         * reflection.c: Fix bug #46669
30440
30441 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30442
30443         * exception.c:
30444         * exception.h:
30445         * icall.c:
30446         * object.h: fill in the type name for TypeLoadException.
30447
30448 2003-07-23  Ravi Pratap  <ravi@ximian.com>
30449
30450         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
30451         relationship between TypeBuilders while compiling corlib) and bug
30452         45993 (Array types returned from the runtime while compiling
30453         corlib were from the loaded corlib).
30454
30455 2003-07-22  Martin Baulig  <martin@ximian.com>
30456
30457         * mono-debug-debugger.c: Reworked the type support a bit more;
30458         distinguish between types and classes.
30459
30460 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
30461
30462         * icall.c: add IsArrayImpl icall.
30463
30464 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
30465
30466         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
30467         initializing real_size only once. Also fix bug #46602.
30468
30469 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
30470
30471         * object.c: Renamed mono_metadata_section to metadata_section.
30472
30473 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
30474
30475         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
30476           empty array if the type is an array. Fixed.
30477           ves_icall_MonoMethod_get_base_definition: if the base method
30478           is abstract, get the MethodInfo from the list of methods of
30479           the class.
30480         * reflection.c: ParameterInfo.PositionImpl should be zero-based
30481           and it was 1-based. Fixed in mono_param_get_objects.
30482
30483 2003-07-20  Martin Baulig  <martin@ximian.com>
30484
30485         * mono-debug.h: Set version number to 31.
30486         (mono_debug_init): Added `MonoDomain *' argument.
30487
30488         * mono-debug-debugger.c: Reworked the type support; explicitly
30489         tell the debugger about builtin types; pass the `klass' address to
30490         the debugger.
30491
30492 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
30493
30494         * image.c: Allow new metadata tables to be loaded without a
30495         warning. Also update the warning message to give the new constant value.
30496                 
30497 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
30498
30499         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
30500         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
30501         array type representation changes.
30502
30503 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30504
30505         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
30506         on Environment.Exit () call.
30507
30508 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30509
30510         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
30511         requires a matching corlib.
30512
30513 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30514
30515         * Changelog: My editor decided to add a CR to each line. Sorry about that.
30516           Committed again without the CRs.
30517         
30518 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30519
30520         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
30521           getting it from the "this" socket instance. Did not work
30522           if the socket is a subclass of Socket.
30523           Also fixed bug #35371.
30524
30525 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
30526
30527         * metadata.c: fixed size for TypedByRef.
30528         * loader.c: when searching for a method, consider the vararg amrker.
30529         * unicode.c, decimal.c: constify some arrays.
30530
30531 2003-07-15  Dick Porter  <dick@ximian.com>
30532
30533         * socket-io.c: Fixed compilation for gcc < 3.2.
30534
30535         Fixed compilation for machines that don't have AF_INET6 (thanks to
30536         Bernie Solomon <bernard@ugsolutions.com> for that part.)
30537
30538         Fixed compile warnings.
30539         
30540         Fixed formatting and line endings.
30541
30542 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
30543
30544         * socket-io.h:
30545         * socket-io.c: Added IPv6 support.
30546
30547 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
30548
30549         * class.c (mono_class_is_assignable_from): New function to implement
30550         the is_assignable_from logic. Used by mono_object_isinst, 
30551         Type::IsAssignableFrom () and the interpreter.
30552
30553         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
30554         Object, even interfaces.
30555         
30556         * object.c (mono_object_isinst): Implement in terms of 
30557         is_assignable_from.
30558
30559         * icall.c (ves_icall_type_is_assignable_from): New icall.
30560
30561 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
30562
30563         * domain.c (foreach_domain): fix compiler warning.
30564
30565 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
30566
30567         * image.c (load_metadata_ptrs): use g_strndup because strndup is
30568         not available on all plattforms
30569
30570 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
30571
30572         * image.h image.c: Store the metadata version string in MonoImage.
30573         * icall.c: New icall to retrieve the image version.
30574         * reflection.c (create_dynamic_image): Fill in the image version field
30575         * reflection.c (build_compressed_metadata): Use the image version
30576         from the image structure.
30577
30578 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30579
30580         * appdomain.c: modified comment.
30581         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
30582         That will be its last iteration when mono_gc_cleanup is called from
30583         mono_runtime_cleanup and before the domain is unloaded.
30584
30585         Fixes bug #45962.
30586
30587 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
30588
30589         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
30590         attributes.
30591
30592 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30593
30594         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
30595         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
30596         Bernie Solomon <bernard@ugsolutions.com>.
30597
30598 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
30599
30600         * object.c, object.h: provide mono_object_new_fast() for faster
30601         allocation in some special cases.
30602
30603 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
30604
30605         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
30606         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
30607
30608 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
30609
30610         * threadpool.c: fix leaks.
30611
30612 2003-07-01  Dick Porter  <dick@ximian.com>
30613
30614         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
30615         using MonoGHashTables.  Fixes threadpool bug posted to list.
30616
30617 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
30618
30619         * image.h, image.c: added support to load an assembly from a byte array.
30620         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
30621         assembly bundle support.
30622
30623 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
30624
30625         * threadpool.c (mono_thread_pool_add): keep a reference to the
30626         AsyncResult to prevent GC
30627
30628 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30629
30630         * class.c: leak fix.
30631
30632 2003-06-25  Dick Porter  <dick@ximian.com>
30633
30634         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
30635         for the async object, the WaitHandle object will close the handle.
30636         Fixes bug 45321.
30637
30638 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
30639
30640         * class.c: in mono_array_class_get (), lookup from the hash with the
30641         same type we insert: this works around a bug in
30642         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
30643         lluis. The real fix will have to wait for after the release.
30644
30645 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30646
30647         * icall.c: fix memory leak when getting type members.
30648
30649 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30650
30651         * reflection.c: added more pubtoken special cases.
30652
30653 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
30654
30655         * class.c: handle field offset correctly when class size
30656         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
30657
30658 2003-06-20  Martin Baulig  <martin@ximian.com>
30659
30660         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
30661         *image' field.
30662
30663 2003-06-20  Martin Baulig  <martin@ximian.com>
30664
30665         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
30666
30667 2003-06-20  Martin Baulig  <martin@ximian.com>
30668
30669         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
30670         just distinguish between variables in registers and variables at
30671         an offset relative to a register.
30672
30673 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30674
30675         * icall.c: #ifdef out latest changes until mcs is fixed.
30676
30677 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30678
30679         * icall.c: return members in metadata order.
30680
30681 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30682
30683         * icall.c: avoid infinite loop in GetTimeZoneData.
30684
30685 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
30686
30687         * icall.c: added Marshal.Prelink/All icalls.
30688
30689 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30690
30691         * object.c, object.h: fix warnings and do some overflow checking
30692         when creating arrays.
30693
30694 2003-06-17  Dick Porter  <dick@ximian.com>
30695
30696         * file-io.h:
30697         * file-io.c: File attributes need to be tweaked slightly when
30698         passed from the managed to the w32 world.
30699
30700 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30701         * profiler.h profiler-private.h profiler.c: Rework last patch
30702         based on suggestion by Paolo.
30703         
30704 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30705
30706         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
30707         instruction level coverage data collection.
30708         * profiler.h profiler.c (: Added new callback function which can be
30709         used by the profiler to limit which functions should have coverage
30710         instrumentation.
30711         * profiler.c (mono_profiler_load): Call g_module_build_path to
30712         generate the file name of the profiler library.
30713
30714 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30715
30716         * profiler.c, profiler.h, profiler-private.h: added basic block 
30717         coverage profiling API.
30718
30719 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
30720
30721         * reflection.c (mono_reflection_create_runtime_class): Add support
30722         for events in dynamically generated code.
30723
30724         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
30725         not allocated.
30726
30727 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
30728
30729         * icall.c: when getting timezone info, return reasonable values if we
30730         can't get the actual data.
30731
30732 2003-06-14  Dick Porter  <dick@ximian.com>
30733
30734         * threads.c (start_wrapper): Remove the reference to the thread
30735         object in the TLS data, so the thread object can be finalized.
30736         This won't be reached if the thread threw an uncaught exception,
30737         so those thread handles will stay referenced :-( (This is due to
30738         missing support for scanning thread-specific data in the Boehm GC
30739         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
30740
30741 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
30742
30743         * reflection.c: ensure streams and tables are first allocated with
30744         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
30745
30746 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30747
30748         * icall.c: fixed GetElementType for byrefs (bug# 44792).
30749
30750 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
30751
30752         * reflection.c (mono_reflection_create_runtime_class): Add support for
30753         properties to dynamically created classes.
30754         * reflection.c: Fix a few places where non-MonoObjects were inserted
30755         into the tokens hashtable.
30756
30757 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30758
30759         * object.c: some support to handle out of memory exceptions.
30760
30761 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
30762
30763         * marshal.c (mono_marshal_get_native_wrapper): support reference
30764         return types
30765
30766 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
30767
30768         * object.h, object.c: more portability stuff from Bernie Solomon.
30769         Unexport mono_object_allocate(). Added mono_object_unbox ().
30770         Set exitcode when an unhandled exception is thrown.
30771
30772 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
30773
30774         * marshal.c (mono_marshal_get_native_wrapper): use custom
30775         marshaler for return types.
30776
30777 2003-06-10  Dick Porter  <dick@ximian.com>
30778
30779         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
30780         ip_mreq is available
30781
30782 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
30783
30784         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
30785         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
30786         by Bernie Solomon <bernard@ugsolutions.com>.
30787
30788 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
30789
30790         * gc.c (mono_gc_init): Avoid error message on shutdown when
30791         GC_DONT_GC=1 is used.
30792
30793         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
30794         New icall to return the GUID of a module.
30795
30796 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
30797
30798         * class.c: ensure instance size always includes the parent's size
30799         even whem class size is set explicitly (fixes bug#44294).
30800
30801 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
30802
30803         * profiler.h, profiler.c: made the simple profiler thread-safe,
30804         get more accurate timing info. Allow the loading of an
30805         externally-developed profiler module.
30806
30807 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
30808
30809         * marshal.c (mono_marshal_get_native_wrapper): improved
30810         class/byref arguments.
30811         (mono_marshal_get_native_wrapper): better string marshaling support.
30812
30813 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
30814
30815         * class.c: ensure .pack and .size are handled correctly and
30816         simplified layout of static fields.
30817
30818 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
30819
30820         * appdomain.c
30821         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
30822
30823         * loader.c (mono_lookup_pinvoke_call): look for modules in the
30824         current directory (fix bug 44008)
30825
30826 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
30827
30828         * marshal.c (mono_marshal_get_native_wrapper): started support for
30829         custom marshalers.
30830         (mono_delegate_to_ftnptr): consider marshalling specifications
30831
30832 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
30833
30834         * reflection.c, reflection.h: emit custom marshal info.
30835
30836 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30837
30838         * object.c: free the GError.
30839         * icall.c: added CloseEvent_internal.
30840         * threads.[ch]:
30841         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
30842         call.
30843
30844 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
30845
30846         * loader.c (mono_method_get_signature): Add support for dynamic
30847         assemblies.
30848
30849 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
30850
30851         * reflection.c: fixed bug #43905.
30852
30853 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
30854
30855         * class.c, domain.c, icall.c, metadata.h, object.h: support for
30856         handling TypedReference and ArgIterator.
30857         * loader.c, loader.h: added function to get signature at call site.
30858
30859 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
30860
30861         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
30862         data readonly. Buglets and warning fixes. Some MethodSpec support.
30863
30864 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
30865
30866         * class.h, class.c, object.c: remove relative numbering support.
30867
30868 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
30869
30870         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
30871         free the string, until we get a chance to fix Gtk#
30872
30873 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30874
30875         * marshal.c: revert last patch.
30876
30877 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
30878
30879         * icall.c: updates for new mono_class_vtable() not calling
30880         the type constructor anymore.
30881
30882 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
30883
30884         * object.h, object.c: separate vtable creation from type
30885         initialization. Make running the .cctor thread safe.
30886
30887 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
30888
30889         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
30890
30891 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
30892
30893         * loader.c (mono_get_method): consider calling convention
30894
30895 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
30896
30897         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
30898         to return the invisible global type for a module.
30899
30900         * reflection.c (mono_image_build_metadata): Emit global fields too.
30901
30902 2003-05-20  Peter Williams  <peterw@ximian.com>
30903
30904         * loader.c (mono_lookup_internal_call): Add a few newlines.
30905
30906 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
30907
30908         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
30909         literal strings.
30910
30911         * appdomain.c (set_domain_search_path): Recalculate search path when
30912         AppDomainSetup.PrivateBinPath changes.
30913
30914         * object.c (mono_class_compute_gc_descriptor): It turns out some
30915         parts of the class libs (like System.Thread) holds pointers to
30916         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
30917         to treat native int a pointer type here.
30918         
30919 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
30920
30921         * appdomain.h, domain.c: add hashtable for jump target resolution.
30922
30923 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
30924
30925         * reflection.h reflection.c icall.c: Added new icalls 
30926         GetManifestResourceInfoInternal, GetModulesInternal and support
30927         infrastructure.
30928
30929 2003-05-16  Dick Porter  <dick@ximian.com>
30930
30931         * icall.c:
30932         * file-io.h:
30933         * file-io.c: Implement System.IO.MonoIO::GetTempPath
30934
30935 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
30936
30937         * object.c: mono_store_remote_field: little fix to previous patch.
30938
30939 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30940
30941         * class.c: add constructors to array classes.
30942         * icall.c: special case array construction for InternalInvoke (),
30943
30944 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
30945
30946         * class.h class.c reflection.c object.c: Added support for field
30947         defaults in dynamically generated classes.
30948
30949 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
30950
30951         * reflection.c: properly encode charset for ddlimport.
30952
30953 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
30954
30955         * threads.c: allow compiling without GC.
30956
30957 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
30958
30959         * appdomain.h, object.c, object.h, threads.c, threads.h: added
30960         handling of thread static data.
30961
30962 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30963
30964         * reflection.h, reflection.c: added mono_custom_attrs_free ().
30965
30966 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
30967
30968         * class.c (mono_array_class_get): always set the serializable flags
30969         (mono_array_class_get): always set the SEALED attribute for array types
30970
30971 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
30972
30973         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
30974         attributes (fix for bug 42021).
30975
30976 2003-05-12  Dick Porter  <dick@ximian.com>
30977
30978         * gc.c: Don't run finalizers when the finalizer thread is
30979         finishing up, because the default domain has already been
30980         destroyed.
30981
30982 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
30983
30984         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
30985         value is null, we should throw an exception.   This is slightly
30986         different than the other conventions used for the constructor.
30987
30988 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30989
30990         * socket-io.c: fixed windows build.
30991
30992 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30993
30994         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
30995
30996 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
30997
30998         * object.c (mono_string_new_wrapper): Compatibility fix for MS
30999         compilers.
31000
31001 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
31002
31003         * class.c (mono_class_layout_fields): Add experimental GC aware
31004         auto layout facility. Requires class library changes to work correctly.
31005
31006         (mono_class_setup_vtable): Avoid overriding explicit interface
31007         method implementations. Fixes iface3.exe test.
31008
31009         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
31010         object reference.
31011         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
31012         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
31013
31014         * metadata.h: Add new type classification macro which determines
31015         whenever the type holds an object reference.
31016
31017 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
31018
31019         * marshal.c (mono_marshal_get_native_wrapper): cleanups
31020
31021 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
31022
31023         * gc.c (finalizer_thread): Work around a GC bug.
31024
31025 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
31026
31027         * marshal.c (emit_struct_conv): allow unions
31028
31029         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
31030
31031 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
31032
31033         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
31034
31035 2003-05-06  Martin Baulig  <martin@ximian.com>
31036
31037         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
31038
31039 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31040
31041         * socket-io.c:
31042         (Select_internal): allow NULLs, don't create arrays if not needed.
31043         Coupled with Socket.cs changes.
31044
31045         * threadpool.c:
31046         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
31047         register a finalizer for it that will close the semaphore handle. This
31048         fixes the leak and make Lupus' test run with > 4080 loops.
31049
31050 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
31051
31052         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
31053         Jerome Laban (bug #42287)
31054
31055 2003-05-02  Martin Baulig  <martin@ximian.com>
31056
31057         * debug-mono-symfile.h
31058         (MonoSymbolFile): Moved declaration into mono-debug.h.
31059         (MonoDebugMethodJitInfo): Likewise.
31060         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
31061         argument.
31062         (_mono_debug_address_from_il_offset): Take a
31063         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
31064
31065         * mono-debug.h
31066         (MonoDebugDomainData): New struct.
31067         (mono_debug_get_domain_data): New function.
31068         (mono_debug_add_method): Take an additional `MonoDomain *'
31069         argument.
31070         (mono_debug_source_location_from_address): Likewise.
31071         (mono_debug_il_offset_from_address): Likewise.
31072         (mono_debug_address_from_il_offset): Likewise.
31073
31074 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
31075
31076         * reflection.c: one more check for null type in custom attrs.
31077
31078 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31079
31080         * reflection.c: avoid warning (comparison is always false due to limited
31081         range of data type).
31082
31083 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31084
31085         * icall.c: throw an exception in Type.GetField if the argument 'name'
31086         is NULL.
31087
31088 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
31089
31090         * reflection.c: fixed handling of enums in named arguments to custom
31091         attributes (bug #42123).
31092
31093 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
31094
31095         * reflection.c: use the right array element type and handle
31096         a null for a Type argument, too.
31097
31098 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
31099
31100         * reflection.c: handle arrays as arguments to custom attributes.
31101
31102 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
31103
31104         * reflection.c: handle a string value in a custom attr
31105         ctor that takes an object.
31106
31107 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
31108
31109         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
31110         (fix bug #42063)
31111
31112 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
31113
31114         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
31115
31116 2003-04-27  Martin Baulig  <martin@ximian.com>
31117
31118         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
31119         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
31120         MONO_DEBUGGER_EVENT_BREAKPOINT.
31121         (mono_breakpoint_trampoline_code): Removed.
31122         (mono_debugger_event_handler): The last argument is now a
31123         `guint32'.
31124         (mono_debugger_insert_breakpoint_full): Removed the
31125         `use_trampoline' argument.
31126         (mono_debugger_method_has_breakpoint): Likewise.
31127         (mono_debugger_trampoline_breakpoint_callback): Renamed to
31128         mono_debugger_breakpoint_callback(); take the method and
31129         breakpoint number as arguments.
31130
31131 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
31132
31133         * metadata.c: fix off by one when loading parameters attributes.
31134
31135 2003-04-24  Martin Baulig  <martin@ximian.com>
31136
31137         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
31138
31139 2003-04-24  Martin Baulig  <martin@ximian.com>
31140
31141         * mono-debug-debugger.c: Moved all code which interacts with the
31142         Mono Debugger here.
31143
31144         * debug-mono-symfile.c: This code now just deals with the symbol
31145         file itself, the debugger code is now in mono-debug-debugger.c.
31146
31147 2003-04-23  Martin Baulig  <martin@ximian.com>
31148
31149         * mono-debug.c (mono_debug_source_location_from_il_offset):
31150         New method; like mono_debug_source_location_from_address(), but
31151         takes an IL offset instead of a machine address.
31152
31153 2003-04-23  Martin Baulig  <martin@ximian.com>
31154
31155         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
31156         `line' field; this is now computed by the debugger.
31157
31158 2003-04-23  Martin Baulig  <martin@ximian.com>
31159
31160         * mono-debug.[ch]: New files.  This is the new debugging interface.
31161
31162         * mono-debug-debugger.[ch]: New files.  Moved all code which
31163         interacts with the Mono Debugger here.
31164
31165 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
31166
31167         * domain.c (mono_init): initialize mono_defaults.monitor_class
31168
31169 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
31170
31171         * reflection.c (method_encode_code): Add a spicy exception to help
31172         future compiler authors.
31173
31174 2003-04-21  Martin Baulig  <martin@ximian.com>
31175
31176         * icall.c
31177         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
31178         Make this work with relative pathnames; g_filename_to_uri() needs
31179         an absolute filename.
31180
31181 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
31182
31183         * icall.c: Track name changes in Object and ValueType.
31184
31185 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
31186
31187         * metadata.c (mono_type_stack_size): size should be a multiple of
31188         sizeof (gpointer)
31189
31190 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31191
31192         * gc.c:
31193         (internal_domain_finalize): moved into mono_domain_finalize. No need
31194         to create another thread because the finalizers will be run in the
31195         finalizer thread.
31196         
31197         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
31198         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
31199         to be run (MS does this too).
31200
31201 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
31202
31203         * object.c (mono_class_compute_gc_descriptor): Update comment.
31204
31205         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
31206
31207         * image.h: Add synchronized wrapper cache.
31208
31209         * image.c (do_mono_image_open): Initialize cache.
31210
31211         * reflection.c (create_dynamic_mono_image): Initialize cache.
31212
31213 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31214
31215         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
31216         ves_icall_System_Buffer_ByteLengthInternal.
31217
31218 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31219
31220         * reflection.c: setup klass->nested_in earlier. Allow
31221         a dash in the assembly name.
31222
31223 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
31224
31225         * metadata.c (mono_type_to_unmanaged): dont access
31226         type->data.klass for MONO_TYPE_OBJECT
31227         (mono_type_to_unmanaged): consider System.Delegate class
31228
31229 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
31230
31231         * class.c: just setup supertypes in the proper place instead of
31232         initializing the full element class for arrays.
31233
31234 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
31235
31236         * class.c: ensure the element class of arrays is initialized.
31237         Setup the supertype info for array classes, too.
31238
31239 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
31240
31241         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
31242
31243 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31244
31245         * Makefile.am: re-added -m option when running cygpath. This way,
31246         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
31247         separator.
31248         * mono-config.c: same codepath for locating mono config file for WIN32
31249         and the rest.
31250         * assembly.c: if mono_assembly_setrootdir is called, don't override
31251         the value set.
31252
31253 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31254
31255         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
31256         MONO_ASSEMBLIES variable.
31257
31258 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
31259
31260         * icall.c: added Assembly::GetNamespaces() icall.
31261
31262 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31263
31264         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
31265
31266 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
31267
31268         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
31269         * object.c: fixed bug in the construction of vtable for proxies
31270
31271 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
31272
31273         * object.c (mono_array_new): Mark mono_array_new as an icall.
31274
31275 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31276
31277         * class.c: fixed test for public method when overriding interfaces.
31278         Closes bug #40970.
31279
31280 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
31281
31282         * appdomain.h, domain.c: added mono_domain_foreach() to
31283         be able to access the currently loaded appdomains.
31284         * object.c: make string interning work across sppdomains.
31285         Mark some functions for use as icalls.
31286
31287 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
31288
31289         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
31290
31291         * reflection.h reflection.c: Allocate long living data using 
31292         GC_MALLOC_ATOMIC so the collector does not need to scan it.
31293
31294         * reflection.c: Double the allocation size in streams instead of
31295         increasing it, to prevent unneccesary copying on large assemblies.
31296         
31297         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
31298         creation if the assembly does not have the Run flag set.
31299
31300 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
31301
31302         * class.h: avoid the C++ keywords in header files (Jerome Laban
31303         spotted and fixed this).
31304
31305 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31306
31307         * object.c:
31308         (mono_unhandled_exception): fill in the arguments for the
31309         UnhandledException event. Only trigger that event for the default
31310         domain (as MS does).
31311
31312 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
31313
31314         * object.c: Improve typed allocation stuff based on suggestions from
31315         Paolo. Also turn it on if the GC library supports it.
31316
31317 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31318
31319         * object.c object.h class.h: Added experimental typed allocation
31320         facility using the interfaces in gc_gcj.h.
31321
31322         * os/gc_wrapper.h: Added new include files.
31323         
31324 2003-04-03  Martin Baulig  <martin@ximian.com>
31325
31326         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
31327         which is not yet enabled by default.
31328
31329         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
31330         functions.
31331         (mono_gc_lock, mono_gc_unlock): New static functions.
31332
31333         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
31334         functions; stop/start the world for the garbage collector.  This
31335         is using the windows API; we need to complete the SuspendThread()/
31336         ResumeThread() implementation in the io-layer to make this work on Unix.
31337         (mono_gc_push_all_stacks): New public function; tells the garbage
31338         collector about the stack pointers from all managed threads.
31339
31340 2003-04-03  Martin Baulig  <martin@ximian.com>
31341
31342         * object.h (MonoThread): Added `gpointer stack_ptr'.
31343
31344         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
31345
31346 2003-04-03  Martin Baulig  <martin@ximian.com>
31347
31348         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
31349
31350 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31351
31352         * reflection.c (typebuilder_setup_fields): Initialize field.first and
31353         field.last.
31354
31355 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
31356
31357         * loader.c (mono_lookup_internal_call): Report the corlib that is
31358         out of sync.
31359
31360 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
31361
31362         * icall.c (ves_icall_type_GetTypeCode): fixed check for
31363         System.DBNull (it's class not valuetype).
31364
31365 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
31366
31367         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
31368         if the array method was already assigned a token (fixes bug#40646).
31369
31370 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
31371
31372         * reflection.c (mono_reflection_get_type): Attempt type resolve even
31373         if no assembly is given.
31374
31375 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
31376
31377         * metadata.h: Added the new tables.
31378
31379         * row-indexes.h: Added definitions for new tables.
31380
31381         * metadata.c: Add schemas for new tables, and add support for
31382         computing the sizes of them.
31383
31384         * class.c: Update for handling the new type cases.
31385
31386 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
31387
31388         * metadata.h (MONO_TYPE_IS_VOID): new macro
31389
31390 2003-03-31  Martin Baulig  <martin@ximian.com>
31391
31392         * threads.h (MonoThreadCallbacks): Added `thread_created'.
31393
31394         * threads.c (mono_thread_new_init): Call `thread_created' in the
31395         mono_thread_callbacks.
31396
31397 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
31398
31399         * loader.h: added marshalbyrefobject_class to mono_defaults
31400         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
31401         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
31402           generation of output parameters.
31403           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
31404         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
31405           contextbound and the target object belongs to the context of the caller.
31406         * object.h: added context and unwrapped_server variables in MonoRealProxy.
31407         * object.c: Implemented support for interfaces and abstract classes
31408           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
31409           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
31410
31411 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
31412
31413         * class.h class.c (mono_class_is_subclass_of): New function.
31414         
31415         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
31416         routines for most common case (calls from ArrayList::ToArray).
31417
31418         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
31419         routine so programs which call Environment::Exit() can be profiled.
31420
31421         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
31422         Added MONO_ARCH_SAVE_REGS.
31423
31424         * icall.c (ves_icall_type_is_subtype_of): Use new function.
31425
31426 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
31427
31428         * blob.h: Add a couple of new MonoType types definitions.
31429
31430         * tabledefs.h: Add a couple of new call convs.
31431
31432 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
31433
31434         * reflection.h (MonoReflectionDynamicAssembly): track changes in
31435         the layout of the class.
31436
31437         * reflection.c (alloc_table): double the size on overflow to avoid
31438         unnecessary copying.
31439
31440         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
31441         avoid filling out metadata tables and blobs. Also set mb->ilgen to
31442         null so it can be garbage collected.
31443         
31444 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
31445
31446         * reflection.c (mono_reflection_get_type): Return the resolved type
31447         only if it is in the assembly we searched.
31448
31449         * reflection.c (ensure_runtime_vtable): Initialize method slots.
31450
31451         * class.c (mono_class_setup_vtable): Set the slot of the overriding
31452         method.
31453
31454 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31455
31456         * appdomain.c:
31457         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
31458         the right one is 'file:///blah', but MS allows it.
31459         * assembly.c:
31460         (mono_assembly_open): allow 'file://blah'
31461
31462         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
31463
31464 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
31465
31466         * socket-io.c: fixes bug #40310.
31467
31468 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
31469
31470         * reflection.c (mono_reflection_parse_type): handle deeply nested
31471         types correctly.
31472
31473         * reflection.c (mono_image_create_token): Use unique token values
31474         since they will be put into a hash table.
31475
31476         * class.c (mono_class_setup_vtable): If a method occurs in more than
31477         one place in the vtable, and it gets overriden, then change the
31478         other occurances too.
31479
31480         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
31481         object as return type.
31482
31483 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31484
31485         * icall.c: Deleted "ToString" implementation for double and float
31486         because they are full implemented in managed code.
31487
31488 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31489
31490         * reflection.c, reflection.h: implemented and exported functions
31491         to retrieve info about custom attributes.
31492
31493 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31494
31495         * appdomain.c: moved Uri handling to assembly.c
31496         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
31497         work when using a file Uri in *nix and windows.
31498
31499         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
31500         GetReferencedAssemblies.
31501
31502 2003-03-18  Dick Porter  <dick@ximian.com>
31503
31504         * icall.c: Rename a couple of internal calls
31505
31506         * threads.c: Set the thread state to Stopped when a thread exits.
31507         Fixes bug 39377.
31508
31509 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
31510
31511         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
31512         New icall.
31513
31514         * object.c (mono_class_vtable): fix warning.
31515
31516 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
31517
31518         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
31519
31520         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
31521         memory.
31522         (method_encode_clauses): Create exception info structures in the right
31523         order.
31524         (mono_reflection_setup_internal_class): Initialize supertypes field.
31525
31526         * class.c object.c: Handle interfaces which implement other interfaces 
31527         correctly.
31528
31529         * class.h class.c: Move the supertypes array initialization code into 
31530         a separate function so it can be used for dynamic types too. Also call
31531         it earlier, in mono_class_init(), since it can be used before the
31532         type is initialized.
31533
31534 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31535
31536         * Makefile.am:
31537         * assembly.c:
31538         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
31539
31540         * appdomain.c:
31541         * appdomain.h:
31542         * marshal.c:
31543         * object.c: remove warnings.
31544
31545 2003-03-13  Martin Baulig  <martin@ximian.com>
31546
31547         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
31548         (MonoDebugLexicalBlockEntry): New types.
31549
31550         * debug-mono-symfile.c
31551         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
31552
31553 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31554
31555         * process.c: ret can be any non-zero value accroding to MS doc.
31556
31557 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
31558
31559         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
31560         fixing a warning for a miss-used prototype, would have cause
31561         random memory corruption.
31562
31563 2003-03-07  Martin Baulig  <martin@ximian.com>
31564
31565         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
31566         getting really annoying ....
31567
31568 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
31569
31570         * reflection.c (fixup_method): added support for array methods.
31571
31572 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
31573
31574         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
31575         (pointed out by Michael Adams).
31576
31577 2003-03-04  Dick Porter  <dick@ximian.com>
31578
31579         * icall.c: Temporarily reverted the Double and Single ToString()
31580         change, because it broke nunit.
31581
31582 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
31583
31584         * object.h, threads.h: make include files compatible with C++
31585         (patch by Jerome Laban <jlaban@wanadoo.fr>).
31586
31587 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31588
31589         * icall.c: Erased ToString helper functions for Double and Single.
31590         Now, that implementations ar all in managed code (Double and Single
31591         Formatters).
31592
31593 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
31594
31595         * appdomain.c: Added method for initializing the default context of
31596         a domain. Added internal call for getting the default context.
31597         * appdomain.h: Added context variable in MonoDomain struct.
31598         * domain.c: mono_domain_set also sets the default context of the domain
31599         * icall.c: Mapped internal method InternalGetDefaultContext.
31600         * object.c: mono_object_get_virtual_method returns always a remoting
31601         wrapper if the object is a transparent proxy.
31602         mono_runtime_invoke_array: when creating an object by calling the
31603         constructor, if the created object is a proxy, then the constructor should
31604         be called using the a remoting wrapper.
31605
31606 2003-03-03  Dick Porter  <dick@ximian.com>
31607
31608         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
31609         variable so it compiles on solaris.  Problem spotted by
31610         Christopher Taylor <ct@cs.clemson.edu>
31611
31612 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31613
31614         * appdomain.c:
31615         (get_info_from_assembly_name): don't leak value.
31616
31617         * icall.c:
31618         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
31619         result.
31620
31621 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
31622
31623         * assembly.c: export mono_image_load_references ().
31624         * class.c: handle function pointers. mono_class_from_name() now
31625         supports nested type names directly.
31626
31627 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
31628
31629         * reflection.h reflection.c: Encode already created dynamic methods 
31630         and fields correctly as a DEF instead of a REF.
31631
31632         * reflection.c: Get rid of the force_ref argument to 
31633         mono_image_typedef_or_ref since it was wrong in the first place.
31634
31635         * string-icalls.c: add error checking to string constructors according
31636         to the MSDN docs.
31637
31638         * reflection.c: Emit types in the order their TypeBuilders were 
31639         created. Previously, a new table index was assigned to each type before
31640         the tables were emitted. This was wrong because the signature blob
31641         might already refer to a type by its original table index.
31642
31643 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
31644
31645         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
31646         change.
31647         
31648 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31649
31650         * Makefile.am: make assemblies dir have \ instead of / on windows.
31651
31652 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
31653
31654         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
31655         iterate over the NESTEDCLASS table using a linear search since the
31656         table is not guaranteed to be sorted by the secondary key.
31657
31658         * class.c (mono_class_create_from_typedef): fixed up call to
31659         mono_metadata_nesting_typedef.
31660         
31661 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
31662
31663         * marshal.c (mono_string_to_byvalstr): clear the memory as
31664         suggested by Jerome Laban <jlaban@wanadoo.fr>
31665
31666 2003-02-26  Dick Porter  <dick@ximian.com>
31667
31668         * process.c: Cope with padding in .rsrc blocks
31669
31670 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31671
31672         * metadata.h: reverted the filter_len change, it breaks reflection
31673         
31674 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31675
31676         * metadata.h: added a new field to store the filter_len
31677         
31678
31679 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
31680
31681         * reflection.c: handle custom attributes for types and members
31682         created with Reflection.Emit (bug#38422).
31683
31684 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
31685
31686         * reflection.c: define RTSpecialName automatically for constructors for
31687         compatibility with MS.NET.
31688
31689         * reflection.c (mono_reflection_create_runtime_class): initialize
31690         nested_in field of dynamically created classes.
31691
31692 2003-02-22  Martin Baulig  <martin@ximian.com>
31693
31694         * debug-mono-symfile.h: Incremented version number.
31695
31696 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31697
31698         * object.h icall.c process.c: fix warnings.
31699
31700 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31701
31702         * appdomain.h appdomain.c:
31703         (mono_domain_try_type_resolve): split the 
31704         name_or_tb argument into a name and a tb argument.
31705         (mono_domain_has_type_resolve): new function to check whenever the
31706         application has registered a TypeResolve event handler.
31707         
31708         * icall.c reflection.h reflection.c: move the type resolve logic into
31709         mono_reflection_get_type () so it will be invoked when 
31710         Assembly::GetType () is called.
31711
31712         * reflection.c:
31713         (mono_reflection_get_type): renamed to get_type_internal.
31714         (mono_reflection_get_type): fixed type name generation so it works 
31715         for nested types too.
31716         (mono_reflection_get_type): call has_type_resolve () to avoid the 
31717         costly type name generation if there is no resolve event handler.
31718
31719 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31720
31721         * class.c, image.c: load exported types from file references.
31722
31723 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
31724
31725         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
31726           used to cache the managed methods used to create proxies and make 
31727           remote invocation of methods.
31728         * class.h: Added in MonoVTable a flag to indicate that a class needs 
31729           to be remotely created.
31730         * object.c: Modified the method mono_class_vtable(). It now initializes 
31731           the remote flag of the vtable. Modified mono_object_new_specific(), 
31732           so now it checks the remote flag.
31733         * icall.c: Added a couple of internal methods, one for enabling instance 
31734           creation interception for a type, and one for creating objects bypassing
31735           the remote check.
31736
31737 2003-02-18  Martin Baulig  <martin@ximian.com>
31738
31739         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
31740         New interncall to get a method's metadata token.
31741
31742         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
31743         New interncall for the debugger.
31744
31745 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
31746
31747         * class.c (mono_class_setup_vtable): allocate supertype array
31748
31749 2003-02-18  Martin Baulig  <martin@ximian.com>
31750
31751         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
31752
31753 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31754
31755         * reflection.c:
31756         (assembly_name_to_aname): jump over unknown properties (i've found
31757         something like: 'type, assembly, version=xxx, custom=null, public...',
31758         so now will ignore custom=null and still get the rest of the values).
31759
31760 2003-02-17  Dick Porter  <dick@ximian.com>
31761
31762         * threads.c: Have Thread.Start() wait for a semaphore to signal
31763         that the thread has set up all its local data.  This fixes bug
31764         34323, where Abort() raced the new thread's TLS data.
31765
31766         Also removes the handle_store() call from start_wrapper, because
31767         threads are now always created suspended and there is no longer a
31768         race between the parent and child threads to store the info.
31769
31770 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
31771
31772         * image.c: explain the #- heap issue in a message, hopefully
31773         avoiding FAQs on mono-list.
31774
31775 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31776
31777         * icall.c:
31778         (GetEntryAssembly): if the domain has not invoked
31779         AppDomain.ExecuteAssembly yet, return the assembly of the default
31780         AppDomain.
31781
31782 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
31783
31784         * class.c (mono_ldtoken): make it work in dynamic assemblies.
31785
31786 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
31787
31788         * metadata.c, reflection.c: simple speedup to type hash
31789         and equals code.
31790
31791 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
31792
31793         * image.c, image.h, class.c, assembly.c: move module loading
31794         to MonoImage. When loading metadata, consider alignemnet from
31795         the start of metadata, not from the metadata address in memory.
31796
31797 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
31798
31799         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
31800         AssemblyBuilder objects. Factored out custom attribute creation into
31801         a separate function.
31802         (create_custom_attr): new function to create custom attributes.
31803
31804 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
31805
31806         * Makefile.am: Got tired of typing the full pathname to pedump.
31807         Until there is another option, am installing this.
31808
31809 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
31810
31811         * class.c (class_compute_field_layout): always set field->parent 
31812         (mono_ldtoken): use mono_defaults.fieldhandle_class;
31813
31814 2003-02-11  Dick Porter  <dick@ximian.com>
31815
31816         * threads-types.h:
31817         * monitor.c: Rewrote Monitor, making lock much faster and
31818         Pulse/Wait work as specified.  Also uses much fewer handles, and only
31819         creates them as needed.
31820
31821         * exception.c: Added SynchronizationLockException
31822
31823         * threads.c: Deleted old Monitor implementation.  The new one is
31824         in a new file.
31825
31826 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
31827
31828         * class.c: handled TypedReference type code. Set the correct size for
31829         class data. Setup interface_offsets for interface classes, too.
31830
31831 2003-02-09  Martin Baulig  <martin@ximian.com>
31832
31833         * debug-mono-symfile.h: Reflect latest symbol writer changes.
31834
31835 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
31836
31837         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
31838         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
31839         * object.c: fixed mono_object_get_virtual_method () for interfaces.
31840         * verify.c: check for code that runs after the end of the method.
31841
31842 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31843
31844         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
31845         "System.Math::Round2".
31846         * sysmath.h: Added Floor, Round and Round2 definitions.
31847         * sysmath.c: Modified certain functions that were not 100% compliant
31848         with MS.NET (math precision) and added the implementation of Floor,
31849         Round and Round2.
31850
31851 2003-02-07  Martin Baulig  <martin@ximian.com>
31852
31853         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
31854
31855 2003-02-07  Martin Baulig  <martin@ximian.com>
31856
31857         * debug-mono-symfile.c: Reflected latest symwriter changes.
31858         (mono_debug_create_mono_symbol_file): Removed.
31859         (mono_debug_open_mono_symbol_file): Take an argument which
31860         specifies whether to create a dynamic symbol file.
31861
31862 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
31863
31864         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
31865
31866 2003-02-05  Martin Baulig  <martin@ximian.com>
31867
31868         * reflection.c (mono_image_build_metadata): Make this public,
31869         protect it against being called multiple times, don't create
31870         resources and don't build the compressed metadata here.
31871         (mono_image_create_pefile): Do this here.
31872
31873         * icall.c
31874         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
31875
31876 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31877
31878         * socket-io.c: fixed bug #36322.
31879
31880 2003-02-06  Piers Haken <piersh@friskit.com>
31881
31882         * appdomain.[ch]:
31883         * class.h:
31884         * debug-mono-symfile.c:
31885         * icall.c:
31886         * loader.c:
31887         * mono-config.c:
31888         * monosn.c:
31889         * reflection.c:
31890         * socket-io.c: warning cleanups
31891
31892 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
31893
31894         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
31895         function. works like remoting invoke, but does a check for the Proxy first.
31896
31897 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
31898
31899         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
31900
31901 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
31902
31903         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
31904         array of pointers.
31905         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
31906         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
31907
31908         * object.c (mono_store_remote_field_new): used by the new jit
31909         instead of mono_store_remote_field
31910         (mono_load_remote_field_new): used by the new jit
31911         instead of mono_load_remote_field
31912
31913 2003-02-05  Patrik Torstensson
31914
31915         * appdomain.c: changed unload to take the domain id instead
31916         of domain
31917         
31918         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
31919
31920
31921 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31922
31923         * appdomain.c: don't look for assemblies in ApplicationBase if
31924         PrivateBinPathProbe is set.
31925
31926 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31927
31928         * object.c: make the first argument in main_args contain the absolute
31929         path to the assembly. Fixes bug #37511.
31930
31931 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31932
31933         * icall.c: get correct UTC offset for countries not using daylight
31934         time saving. Fixes bug #30030.
31935
31936 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31937
31938         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
31939         and 1 are the family).
31940
31941 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
31942
31943         * icall.c (ves_icall_InternalExecute): removed wrong assertion
31944
31945         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
31946
31947 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
31948
31949         * reflection.c: added support for SignatureHelper tokens, which is
31950         needed by the Calli opcode.
31951
31952         * reflection.h: track changes to SignatureHelper class.
31953
31954         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
31955
31956 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31957
31958         * appdomain.c: fixed loading assemblies from PrivateBinPath.
31959
31960 2003-02-03  Patrik Torstensson
31961         * appdomain.[c|h], domain.c : 
31962          - Added support for getting a domain via domain id
31963          - Support for setting and getting domain from System.AppDomain 
31964            (used in cross appdomain channel)
31965          - Added support for get/set for a MonoAppContext on a thread 
31966            (Context class in System.Runtime.Remoting.Contexts),
31967          - Removed hack in Get/SetData and ExecuteAssembly.
31968         
31969         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
31970         the managed world to get control when a proxy is created.
31971
31972         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
31973         
31974 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
31975
31976         * icall.c
31977         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
31978         Populate the codebase field as well.
31979
31980 2003-02-02  Martin Baulig  <martin@ximian.com>
31981
31982         * debug-mono-symfile.c
31983         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
31984         (mono_debug_symfile_add_method): Allow interncalls.
31985
31986 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31987
31988         * icall.c: throw parse exception if strtod fails or the string is empty.
31989
31990 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
31991
31992         * marshal.c: handle object type separately from defined
31993         class types.
31994
31995 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
31996
31997         * marshal.c: handle NATIVE_LPSTR for strings when it's
31998         explicitly specified.
31999
32000 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
32001
32002         * reflection.c, reflection.h, icall.c: setup the reflection
32003         handle cache for ModuleBuilders and AssemblyBuilders.
32004
32005 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
32006
32007         * reflection.c (reflection_methodbuilder_to_mono_method): set
32008         pinvoke flag
32009
32010 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32011
32012         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
32013
32014 2003-01-29  Dick Porter  <dick@ximian.com>
32015
32016         * threads.c: No need for the fake_thread kludge now that Thread
32017         doesn't run a class constructor
32018         
32019 2003-01-29  Dick Porter  <dick@ximian.com>
32020
32021         * threads.c: Use g_direct_hash instead of the rather bogus
32022         g_int_hash
32023
32024 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
32025
32026         * marshal.c (mono_marshal_get_native_wrapper): add check for null
32027         (fix pinvoke12.exe)
32028         (mono_marshal_get_struct_to_ptr): generate valid IL code
32029         (mono_marshal_get_ptr_to_struct): generate valid IL code
32030         (*): correctly set sig->pinvoke, we need to memdup the signature
32031         to do that
32032
32033 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
32034
32035         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
32036         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
32037
32038 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32039
32040         * profiler.c: provide more callers information.
32041
32042 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
32043
32044         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
32045
32046         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
32047
32048         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
32049
32050 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32051
32052         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
32053         exception instead of going into an infinite loop on dates which it 
32054         can't yet handle.
32055
32056         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
32057         out-of-range exception if needed.
32058
32059         * class.c (mono_class_setup_vtable): allow a virtual method to provide
32060         an implementation for an interface method and to override an inherited
32061         method at the same time. 
32062         Imagine a scenario when a virtual method is used to override a
32063         virtual abstract method in a parent class, and this same method 
32064         provides an implementation for an method inherited from an interface. 
32065         In this case, the interface resolution code will set im->slot, which 
32066         means that the virtual method override pass will skip this method 
32067         which means a pointer to the abstract method inherited from the parent
32068         will remain in the vtable of this non-abstract class.
32069
32070         * class.c: (mono_class_setup_vtable): continue search for a real 
32071         method if only an abstract method is found.     
32072
32073 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32074
32075         * reflection.c: add size to encoding for ByValStr and ByValArray
32076         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
32077
32078 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32079
32080         * class.c (mono_class_setup_vtable): pass the override info as an
32081         argument.
32082
32083         * class.c (mono_class_setup_vtable): set the slot of overriding methods
32084         correctly.
32085         
32086         * reflection.c (ensure_runtime_vtable); add support for method 
32087         overrides.
32088         
32089 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32090
32091         * reflection.c (resolution_scope_from_image): Hack to work to work with
32092         dynamic assemblies.
32093
32094         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
32095         added a 'force_ref' argument to force this function to allways return 
32096         a TypeRef. This is needed by mono_image_get_memberref_token ().
32097         
32098 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32099
32100         * reflection.c (mono_image_get_type_info): interfaces really don't have
32101         a parent.
32102
32103         * reflection.c (mono_image_basic_init): fill out missing fields of
32104         image structure.
32105
32106         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
32107         dynamic assemblies. This is required so dynamic assemblies show up in
32108         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
32109         Type::GetType() etc. This is consistent with MS behaviour.
32110
32111         * image.c image.h reflection.c: add newly created classes to the name 
32112         cache so mono_class_get () will find them.      
32113
32114 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32115
32116         First part of changes to get IKVM.NET running under mono.
32117         
32118         * appdomain.h, appdomain.c: added new function 
32119         mono_domain_try_type_resolve() which will emit TypeResolve events. 
32120         This function will call AppDomain::DoTypeResolve to do the actual work.
32121
32122         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
32123         moved existing code dealing with dynamic tokens to a new function 
32124         called mono_reflection_lookup_dynamic_token (). This function will 
32125         raise TypeResolve events when appropriate. Since reflection.c is not 
32126         part of libmetadata, a new hook function called 
32127         mono_lookup_dynamic_token() is added to class.c which will call this.
32128
32129         * assembly.h assembly.c: make the invoke_load_hook function public,
32130         so it can be called for dynamic assemblies.
32131
32132         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
32133
32134         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
32135         type isn't found.
32136
32137         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
32138         MonoGHashTable, since it contains pointers to objects which the GC 
32139         needs to track.
32140
32141         * assembly.c (search_loaded): remove unused variable.
32142         
32143 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
32144
32145         * object.c: fixed issue exposed by gcc-generated IL programs
32146         that use RVA data for pointers.
32147
32148 2003-01-25  Martin Baulig  <martin@ximian.com>
32149
32150         * threads.c (start_wrapper): Moved the initialization of
32151         `start_func' above the mono_new_thread_init() call to which we
32152         pass it as argument.
32153
32154 2003-01-24  Martin Baulig  <martin@ximian.com>
32155
32156         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
32157         the MonoThread pointer.
32158
32159 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
32160
32161         * icall.c: Rename `PowImpl' to Pow.
32162
32163 2003-01-23  Dick Porter  <dick@ximian.com>
32164
32165         * threads.c (start_wrapper): Create a Thread object if needed, so
32166         the Main() thread can do the class initialisation in a subthread
32167         that has been set up to allow managed code execution.
32168
32169         Pass the thread ID instead of the MonoThread pointer to the thread
32170         start and attach callbacks.  This change is required, because the
32171         jit thread start callback must be called _before_ the Thread
32172         object can be created.
32173         
32174         (mono_thread_init): Removed much object creation code that is no
32175         longer needed.  No managed code is called from here now.
32176
32177         * object.c (mono_runtime_exec_managed_code): Create a subthread
32178         for Main, and call back to the runtime to use it.
32179         Set the exit code when Main exits.
32180
32181         * gc.c: Make sure domain finalisation happens in a subthread.
32182         Re-enable threaded GC, fixing bug 31333 (again).
32183
32184         * environment.c: System.Environment internall calls (so far just
32185         ExitCode is here, the others are still in icall.c)
32186
32187         * appdomain.c (mono_runtime_cleanup): All threads running managed
32188         code should have finished before mono_runtime_cleanup() is
32189         reached, so no need to clean up threads.
32190
32191 2003-01-22  Martin Baulig  <martin@ximian.com>
32192
32193         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
32194         `gpointer func' arguments.      
32195         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
32196         but added `MonoThread *thread' argument.
32197         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
32198
32199         * threads.c (mono_new_thread_init): Added `gpointer func' argument
32200         and pass it to the mono_thread_start_cb callback.
32201         (mono_install_thread_callbacks): New public function to install a
32202         set of callbacks which are set by the debugger.
32203         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
32204
32205 2003-01-22  Martin Baulig  <martin@ximian.com>
32206
32207         * Makefile.am: Install debug-mono-symfile.h.
32208
32209 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
32210
32211         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
32212
32213 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
32214
32215         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
32216         * class.c (mono_ptr_class_get): correctly set access levels of pointers
32217         (mono_array_class_get): correctly set access levels of arrays
32218
32219 2003-01-20      Patrik Torstensson
32220         * image.h (MonoAssemblyName): changed major, minor, build, revision
32221         from signed to unsigned.
32222
32223 2003-01-20  sean kasun <skasun@azstarnet.com>
32224
32225         * reflection.c (load_cattr_value): Now this handles
32226         MONO_TYPE_SZARRAY.  Fixes bug #35629
32227
32228 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
32229
32230         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
32231         integer value
32232
32233 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32234
32235         * decimal.c: fixed bug #26056.
32236
32237 2003-01-17  Martin Baulig  <martin@ximian.com>
32238
32239         * gc.c: Raise an ExecutionEngineException instead of using g_error().
32240
32241 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32242
32243         * exception.[ch]:
32244         (mono_get_exception_type_initialization): new function.
32245
32246         * object.c: throw a TypeInitializationException when an exception is
32247         thrown invoking the class constructor.
32248
32249 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32250
32251         * reflection.c: fixed attribute reading.
32252
32253 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32254
32255         * icall.c:
32256         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
32257         provided, look for the type in the calling assembly and then in
32258         mscorlib; if the assembly name is provided, only try that one.
32259
32260 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
32261
32262         * object.c: register the vtable before there is a chance it's
32263         queried again recursively.
32264
32265 2003-01-13  Duncan Mak  <duncan@ximian.com>
32266
32267         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
32268         gc-internal.h. 
32269         
32270 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
32271
32272         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
32273
32274 2003-01-11  Martin Baulig  <martin@ximian.com>
32275
32276         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
32277         this to 20 for the release.
32278
32279 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
32280
32281         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
32282
32283         * loader.c (mono_method_get_marshal_info): bug fix
32284
32285         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
32286         structures with explicit layout
32287
32288 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32289
32290         * profiler.c: made the output more readable (and sorted). 
32291         Added caller information for the allocation profiler.
32292
32293 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
32294
32295         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
32296
32297 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32298
32299         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
32300         to get value types.
32301         
32302 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
32303
32304         * object.c, profiler.h, profiler.c, profiler-private.h:
32305         Added object allocation profiler.
32306
32307 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
32308
32309         * reflection.h, reflection.c: handle global methods.
32310         Compress blob entries.
32311
32312 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
32313
32314         * marshal.c: fix compilation.
32315
32316 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
32317
32318         * loader.c (mono_method_get_marshal_info): impl.
32319
32320         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
32321
32322 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32323
32324         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
32325         for reference types.
32326
32327 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
32328
32329         * loader.c: fixed off by one error in loaded parameter names.
32330
32331 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
32332
32333         * marshal.c (mono_marshal_get_icall_wrapper): like
32334         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
32335         instead of a MonoMethod.
32336
32337 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32338
32339         * decimal.c: fixed bug #36537.
32340
32341 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
32342
32343         * marshal.c: throw a missing method exception if a
32344         P/Invoke method is not found.
32345
32346 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32347
32348         * icall.c: allow a null this for constructors.
32349
32350 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
32351
32352         * icall.c: raise the proper exceptions if the arguments to the
32353         internal Invoke are incorrect.
32354
32355 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
32356
32357         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
32358
32359 2003-01-03  Martin Baulig  <martin@ximian.com>
32360
32361         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32362
32363 2002-12-31  Martin Baulig  <martin@ximian.com>
32364
32365         * debug-mono-symfile.c: Completely rewrote the type section.
32366         Instead of using individual malloc()ed fields, we use one big
32367         continuous memory area and offsets into this area.
32368         See the comments in the source code for details.
32369
32370 2002-12-30  Martin Baulig  <martin@ximian.com>
32371
32372         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
32373
32374 2002-12-30  Martin Baulig  <martin@ximian.com>
32375
32376         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
32377         line number table in this data blob instead of using an external
32378         pointer.
32379
32380 2002-12-28  Martin Baulig  <martin@ximian.com>
32381
32382         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32383
32384 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
32385
32386         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
32387         as a boxed return type.
32388
32389 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
32390
32391         * appdomain.c
32392         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
32393         g_build_filename to properly get separators on the filename created.
32394
32395         * object.h: Small change, introduce MonoMarshalByRefObject to
32396         track the layout of that structure in the C# universe as we make
32397         changes there.
32398
32399 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
32400
32401         * object.c: removed assert to allow static fields on interfaces.
32402         * loader.c: a TypeSpec may be used for any type, not just arrays.
32403
32404 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
32405
32406         * class.c, class.h: added mono_class_array_element_size ().
32407         Ignore static methods in interfaces.
32408
32409 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32410
32411         * threads.c: fixed the build under cygwin.
32412
32413 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
32414
32415         * reflection.c: handle nullref constants. Allocate keys for
32416         reflection handles with the GC.
32417
32418 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32419
32420         * threads.c, threads.h: added mono_thread_get_abort_signal()
32421         to get a suitable signal for thread abort.
32422
32423 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32424
32425         * metadata.c: fix handling of ExportedType table.
32426
32427 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32428
32429         * icall.c: added WriteWindowsDebugString internal call.
32430
32431 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32432
32433         * reflection.h: added fields to match C# implementation.
32434
32435 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32436
32437         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
32438
32439 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
32440
32441         * gc.h, gc-internal.h: Rename header for GC internal calls to
32442         gc-internal.h from gc.h as to not clash with Boehm GC having its
32443         header installed as <gc.h> in outside include paths.
32444         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
32445         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
32446
32447 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32448
32449         * icall.c: assign minor, build and revision in FillName.
32450
32451 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
32452
32453         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
32454         Added support for running code generated by Reflection.Emit.
32455
32456 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32457
32458         * appdomain.c: check for NULL argument in LoadFrom.
32459
32460 2002-12-10  Dick Porter  <dick@ximian.com>
32461
32462         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
32463
32464 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32465
32466         * appdomain.c: fix buglet when building exe file name.  Handle full
32467         assembly name (needed after latest changes to AssemblyName).
32468         * image.c:
32469         (mono_image_close): free some hashtables.
32470
32471 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
32472
32473         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
32474         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
32475         on some systems (redhat 7.3) 
32476
32477 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
32478
32479         * threads.c: delete the critical section of a sync block,
32480         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
32481
32482 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
32483
32484         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
32485
32486 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32487
32488         * appdomain.[ch]: handle the assembly preload event to try loading the
32489         assemblies using the paths we have in the current domain.
32490
32491         * assembly.[ch]: created an assembly preload hook that is called to try
32492         loading the assembly by other means that the ones provided here.
32493
32494         * domain.c: initialize the domain search path.
32495
32496         From now on, assemblies (TODO: except corlib and System) are loaded
32497         according to these rules when using mono_assembly_load ():
32498
32499                 1. It tries to load the assembly from the ApplicationBase
32500                 of the current domain appending .dll and .exe (TODO: have to
32501                 try loading from name/name.dll and name/name.exe).
32502
32503                 2. It tries the search path specified in PrivateBinPath for the
32504                 current domain (if any).
32505
32506                 3. Previous behavior.
32507
32508 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
32509
32510         * icall.c: implemented GetInterfaceMap() related icall.
32511         * domain.c, loader.h: load MethodInfo in mono_defaults.
32512
32513 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
32514
32515         * gc.c: disable the finalizer thread for now, untill all the issues
32516         with it are resolved.
32517
32518 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32519
32520         * string-icalls.c: handle embedded nulls in string ctor when the
32521         length is specified.
32522
32523 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
32524
32525         * class.c: look for explicit interface implementation in parent
32526         classes, too.
32527
32528 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
32529
32530         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
32531
32532 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
32533
32534         * gc.c: protect handles with a critical section.
32535
32536 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32537
32538         * icall.c:
32539         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
32540         parameters. If no assembly specified, try getting the type from all
32541         the assemblies in the current domain, else, load the assembly and get
32542         the type from it.
32543
32544 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32545
32546         * marshal.c: applied patch from Aleksey Demakov that fixes
32547         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
32548
32549 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32550
32551         * icall.c: fixed get_location.
32552
32553 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
32554
32555         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
32556         declarations to make it work with older gcc. 
32557
32558         * loader.c (mono_get_method): set signature->pinvoke for native calls
32559
32560 2002-11-20  Dick Porter  <dick@ximian.com>
32561
32562         * threads.c (mono_thread_init): Set the main thread's handle
32563
32564 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
32565
32566         * gc.c: allow compilation without GC support. Changed to match the
32567         mono coding style.
32568
32569 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
32570
32571         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
32572
32573 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
32574
32575         * reflection.c: set a public key token on the core assemblies.
32576
32577 2002-11-18  Dick Porter  <dick@ximian.com>
32578
32579         * threads.c: Split out some thread initialisation so that other
32580         files can set the start callback function.
32581
32582         * gc.c: Run finalisers in a separate thread, to avoid stack
32583         overflow.  Fixes bug 31333.
32584
32585         * appdomain.c: Set up GC finalisation thread.
32586
32587         * reflection.c: 
32588         * object.c: 
32589         * domain.c: Use gc.h macros for GC_malloc
32590         
32591 2002-11-15  Dick Porter  <dick@ximian.com>
32592
32593         * threadpool.c: 
32594         * threads.c:
32595         * appdomain.c: Removed mono_runtime_init_with_attach(),
32596         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
32597         merging the extra parameter with the existing function.  Removed
32598         unneeded code in mono_thread_attach().
32599
32600 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
32601
32602         * image.c (mono_image_loaded_by_guid): a method to get loaded
32603         images by guid. 
32604         (load_metadata_ptrs): we store the guid as string.
32605
32606 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
32607
32608         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
32609
32610         * metadata.c (mono_guid_to_string): imported method form Zoltan
32611         Varga (slightly modified)
32612
32613         * assembly.c (mono_assembly_open): load precompiled code
32614
32615         * loader.h (MonoMethod): we store the method token for use in the
32616         aot compiler. 
32617
32618 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32619
32620         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
32621         the hook function called when an assembly is loaded.
32622         
32623         * domain.c: Modified file.
32624         (mono_domain_assembly_load): removed hash table insertion of assemblies.
32625
32626         Fixes bug #33196.
32627
32628 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
32629
32630         * reflection.c: Map PEFileKind to the value expected by the WinNT
32631         image loader. 
32632
32633 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32634
32635         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
32636         Read until the buffer is filled completely.
32637
32638 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32639
32640         * icall.c: implemented MonoType.InternalGetEvent ().
32641
32642 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32643
32644         * appdomain.c: implemented InitAppDomainSetup. Delayed
32645         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
32646         the entry_assembly.
32647
32648         * assembly.c: base_dir is now an absolute path ending with
32649         G_DIR_SEPARATOR.
32650
32651         * icall.c: modified get_location according to the above changes.
32652
32653         * object.c: init AppDomain.SetupInformation for the default domain after
32654         we have the entry assembly.
32655
32656         * domain.c: when unloading a domain, setup = NULL.
32657
32658 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
32659
32660         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
32661
32662 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
32663
32664         * object.h, object.c: introduced mono_object_get_virtual_method ()
32665         to lookup the method invoked on an object when a callvirt is done on
32666         a method.
32667         * icall.c: make MethodInfo::Invoke() always do a virtual call.
32668
32669 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32670
32671         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
32672         current domain when loaded an assembly and failed to load it.
32673
32674         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
32675
32676 2002-10-31  Dick Porter  <dick@ximian.com>
32677
32678         * icall.c: 
32679         * file-io.h: 
32680         * file-io.c: Return the error status in a parameter, as the
32681         GetLastError() value has long since been blown away if we try and
32682         look it up in a subsequent internal call invocation.  Delete the
32683         GetLastError() internal call, because it's useless.
32684
32685 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
32686
32687         * class.[ch]: added cast_class to fix bug 29517
32688
32689 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
32690
32691         * marshal.c: create valid IL code in the filter clause:
32692         the new JIT is less forgiving:-)
32693
32694 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32695
32696         * icall.c: removed get_property internal call.
32697
32698 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
32699
32700         * appdomain.h domain.c: Added an ID to appdomains.
32701         
32702         * threads.c threads.h icall.c: Implement icall
32703         Thread:GetDomainID(), and remove unused icall 
32704         CurrentThreadDomain_internal.
32705
32706 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32707
32708         * icall.c: Don't recurse through the base types in GetConstructor.
32709         Fixes bug #32063. 
32710
32711 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
32712
32713         * mempool.h, mempool.c: added mono_mempool_empty() and
32714         mono_mempool_stats().
32715
32716 2002-10-23  Dick Porter  <dick@ximian.com>
32717
32718         * file-io.c: 
32719         * file-io.h: 
32720         * icall.c: Added MonoIO.GetFileType internal call
32721
32722 2002-10-17  Dick Porter  <dick@ximian.com>
32723
32724         * appdomain.c (mono_runtime_cleanup): Don't signal the async
32725         delegate semaphore before waiting for all threads to finish,
32726         because new threads can also call async delegates.  Fixes bug
32727         32004.
32728
32729         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
32730         of 3 seconds, in case another async job is queued.  (This part is
32731         needed because the bug fix reintroduced the 3s exit lag.)  This
32732         makes the mono_runtime_shutdown flag superfluous.
32733
32734 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
32735
32736         * reflection.c: include ehader size in method section headers.
32737         Really check for suplicated modules entries.
32738
32739 2002-10-17  Martin Baulig  <martin@gnome.org>
32740
32741         * debug-mono-symfile.c: Added back support for locals.
32742
32743 2002-10-14  Martin Baulig  <martin@gnome.org>
32744
32745         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
32746         MONO_TYPE_VOID.
32747
32748 2002-10-14  Martin Baulig  <martin@gnome.org>
32749
32750         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
32751         mono_class_get() instead of looking in the class cache. 
32752
32753 2002-10-13  Martin Baulig  <martin@gnome.org>
32754
32755         * debug-mono-symfile.c: Set version number to 28, include the
32756         signature in method names.
32757
32758 2002-10-13  Martin Baulig  <martin@gnome.org>
32759
32760         * debug-mono-symfile.h: Set version number to 27.
32761
32762 2002-10-11  Martin Baulig  <martin@gnome.org>
32763
32764         * gc.c: Don't register/unregister NULL pointers as disappearing links.
32765
32766 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
32767
32768         * metadata.c, metadata.h: added helper function to allocate signatures.
32769
32770 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32771
32772         * icall.c: added internal call to get the location of machine.config.
32773
32774 2002-10-08  Martin Baulig  <martin@gnome.org>
32775
32776         * debug-mono-symfile.c: Ignore classes with a pending init for the
32777         moment.
32778
32779 2002-10-03  Dick Porter  <dick@ximian.com>
32780
32781         * threads.c: Freebsd pthread_t is a pointer
32782
32783 2002-10-03  Dick Porter  <dick@ximian.com>
32784
32785         * socket-io.c: Implemented GetHostName_internal
32786
32787 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32788
32789         * mono-config.c:
32790         (mono_config_parse_file): don't leak the text.
32791
32792 2002-10-02  Martin Baulig  <martin@gnome.org>
32793
32794         * debug-mono-symfile.c: Added support for methods.
32795
32796 2002-10-01  Martin Baulig  <martin@gnome.org>
32797
32798         * debug-mono-symfile.c: Don't emit methods and line numbers for
32799         the dynamic symbol file, just write the type table.  We can easily
32800         have an external helper program which creates a symbol file for an
32801         IL file.        
32802
32803 2002-10-01  Dick Porter  <dick@ximian.com>
32804
32805         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
32806         Only add the handle to the cleanup array when we're about to
32807         launch the thread.  Bug 31425 deadlocked when the test was run on
32808         mono under w32.
32809
32810 2002-10-01  Martin Baulig  <martin@gnome.org>
32811
32812         * debug-mono-symfile.c: Added support for properties.
32813
32814 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
32815
32816         * reflection.c: unaligned store fix from Mark Crichton
32817         <crichton@gimp.org>.
32818
32819 2002-09-27  Martin Baulig  <martin@gnome.org>
32820
32821         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
32822         New interncall.
32823
32824 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
32825
32826         * assembly.h, assembly.c: use a sane API to hook into the assembly
32827         loading process instead of a useless special-purpouse hack
32828         (ngen needs a hook, too, for example).
32829
32830 2002-09-27  Dick Porter  <dick@ximian.com>
32831
32832         * threads.c (mono_thread_init): Call GetCurrentProcess() so
32833         io-layer can set up some process handle info.  Not needed on w32,
32834         but doesn't hurt either.
32835
32836         * process.c: Pass the program name in the second parameter to
32837         CreateProcess, so the path is searched.  Include the working
32838         directory. Implemented process name, process enumeration, and some
32839         process detail internal calls.
32840         
32841         * icall.c: Added internal calls for process lookup, and some
32842         process details
32843
32844 2002-09-26  Martin Baulig  <martin@gnome.org>
32845
32846         * assembly.c (mono_install_open_assembly_hook): New global
32847         function to install a function to be invoked each time a new
32848         assembly is loaded.
32849         (mono_assembly_open): Run this callback function if set.
32850
32851         * debug-mono-symfile.c: Put back line numbers for the dynamic
32852         symbol file and also record the .il file as source file.  This
32853         allows us to install the temporary symbol file as `file.dbg' just
32854         like a compiler-generated one.
32855
32856 2002-09-26  Nick Zigarovich <nick@chemlab.org>
32857
32858         * Corrected typo in gc.c (BOHEM vs BOEHM).
32859
32860 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32861
32862         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
32863         GetProperties. Also avoid calling g_slist_length in GetProperties and
32864         GetMethods.
32865
32866 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
32867
32868         * reflection.c: avoid unaligned stores (bug spotted by
32869         Mark Crichton  <crichton@gimp.org>).
32870
32871 2002-09-25  Martin Baulig  <martin@gnome.org>
32872
32873         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
32874         instead of guint64 for addresses and added prologue/epilogue info.
32875
32876 2002-09-25  Martin Baulig  <martin@gnome.org>
32877
32878         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
32879         store line number info.  For the dynamic symbol file, we only need
32880         to provide the JIT generated dynamic line number info for the dynamic
32881         symbol file.
32882
32883 2002-09-25  Martin Baulig  <martin@gnome.org>
32884
32885         * debug-mono-symfile.h: Incremented version number.
32886
32887 2002-09-24  Martin Baulig  <martin@gnome.org>
32888
32889         * class.c (mono_debugger_class_init_func): New global function
32890         pointer variable.
32891         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
32892         call it.
32893
32894         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
32895         function.  This is called via the mono_debugger_class_init_func
32896         hook to add all types to the dynamic type table.
32897         (ves_icall_MonoDebugger_GetType): New interncall to get a class
32898         from its metadata token.
32899
32900         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
32901         New interncall for the debugger.
32902
32903 2002-09-24  Nick Drochak <ndrochak@gol.com>
32904
32905         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
32906         before using it in case it is null.
32907         
32908 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
32909
32910         * metadata.c: allow custom modifiers in local var signatures
32911         (bug spotted by Zoltan Varga).
32912
32913 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
32914
32915         * class.c: deal with the <Module> class that may have a NULL vtable.
32916         Eliminate warnings.
32917
32918 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
32919
32920         * image.c, image.h: more strong name helpers.
32921         * monosn.c: more work: convert pem keys to cryptoapi format.
32922
32923 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
32924
32925         * string-icalls.c: speedup IndexOf.
32926
32927 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
32928
32929         * icall.c: updates from Zoltan.2.Varga@nokia.com.
32930
32931 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
32932
32933         * icall.c: cleanup: use mono_object_domain ().
32934
32935 2002-09-23  Martin Baulig  <martin@gnome.org>
32936
32937         * debug-mono-symfile.c: Improved type support.
32938
32939 2002-09-22  Martin Baulig  <martin@gnome.org>
32940
32941         * debug-mono-symfile.c: Added support for reference types and strings.
32942
32943 2002-09-22  Martin Baulig  <martin@gnome.org>
32944
32945         * debug-mono-symfile.c: Started to work on the type table.
32946
32947 2002-09-21  Martin Baulig  <martin@gnome.org>
32948
32949         * debug-mono-symfile.c: Largely reworked the symbol table format.
32950         The symbol table is now incrementally updated each time a new
32951         method is added.  We're now also using our own magic and version
32952         so that you don't need to recompile all your classes if the
32953         dynamic table changes.
32954         (mono_debug_update_mono_symbol_file): Removed.
32955         (mono_debug_symfile_add_method): New function to add a method.
32956
32957 2002-09-21  Martin Baulig  <martin@gnome.org>
32958
32959         * icall.c
32960         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
32961         New interncall.
32962
32963         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
32964         New interncall to get a method from its metadata token.
32965
32966 2002-09-21  Martin Baulig  <martin@gnome.org>
32967
32968         * debug-mono-symfile.c: Create type table.
32969
32970 2002-09-20  Martin Baulig  <martin@gnome.org>
32971
32972         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
32973
32974 2002-09-20  Martin Baulig  <martin@gnome.org>
32975
32976         * debug-mono-symfile.c: Provide information about params and locals.
32977
32978 2002-09-20  Martin Baulig  <martin@gnome.org>
32979
32980         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
32981         New interncall.
32982
32983         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
32984         interncall to get a method from its metadata token.
32985
32986 2002-09-20  Martin Baulig  <martin@gnome.org>
32987
32988         * debug-mono-symfile.c: Added a few checks for method->header
32989         being non-NULL.  This should never happen, but for the moment
32990         let's use a g_warning() rather than a g_assert().
32991
32992 2002-09-19  Mark Crichton  <crichton@gimp.org>
32993
32994         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
32995         even if support for it isn't present.  Added an #ifdef to fix this.
32996
32997         * socket-io.c: Added checks back for Solaris support.
32998
32999 2002-09-19  Martin Baulig  <martin@gnome.org>
33000
33001         * debug-mono-symfile.c (read_string, write_string): Reflect latest
33002         changes in the symbol file format.
33003
33004 2002-09-18  Martin Baulig  <martin@gnome.org>
33005
33006         * debug-mono-symfile.c: Set version number to 21.
33007
33008 2002-09-18  Dick Porter  <dick@ximian.com>
33009
33010         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
33011         on netbsd.  Fixes bug 30051.
33012
33013 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33014
33015         * reflection.c:
33016         (set_version_from_string): little fix.
33017
33018 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33019
33020         * monosn.c, Makefile.am: added strong name utility.
33021         * reflection.h, reflection.c: implemented delayed signing,
33022         locale, version and hash id assembly attributes.
33023
33024 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33025
33026         * loader.c, metadata.c: load param attributes in signatures.
33027
33028 2002-09-16  Martin Baulig  <martin@gnome.org>
33029
33030         * debug-mono-symfile.c: Added string table with all method names.
33031
33032 2002-09-14  Martin Baulig  <martin@gnome.org>
33033
33034         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
33035         fast method lookup.
33036
33037 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33038
33039         * reflection.c: record the public key token of referenced assemblies.
33040
33041 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33042
33043         * image.c, image.h: added functions to get the strong name and the
33044         public key of an assembly.
33045         * pedump.c: use them.
33046
33047 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
33048
33049         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
33050
33051 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
33052
33053         * marshal.c (mono_marshal_get_managed_wrapper): Added
33054         MONO_TYPE_BOOLEAN 
33055
33056 2002-09-11  Martin Baulig  <martin@gnome.org>
33057
33058         * gc.c: Call GC_unregister_disappearing_link() on all links when
33059         finalizing them, this is necessary to aviod a crash in boehm's
33060         finalize handler.
33061
33062 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33063
33064         * gc.c: handle GetTarget for finalized objects spotted and fixed by
33065         nick@chemlab.org.
33066
33067 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
33068
33069         * icall.c: implemented MonoType::Module.
33070         * reflection.c, reflection.h: mono_module_get_object () from
33071         Tomi Pakarinen <tomi.pakarinen@welho.com>.
33072
33073 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33074
33075         * icall.c: ignore overridden methods in GetMethods ().
33076         Fix for FieldInfo::SetValue().
33077         * object.c: handle float/double in runtime invoke.
33078
33079 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33080
33081         * object.c: allow a constructor to be called again on an object.
33082
33083 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33084
33085         * class.h, class.c: move field layout code to it's own function and
33086         export it. Get an interface id earlier. Move fields in MonoClass
33087         so they are more cache friendly and align the bitfields.
33088         * loader.c: temporary handle get_param_names() for a runtime method.
33089         * reflection.c, reflection.h: more code to handle runtime creation of
33090         types.
33091
33092 2002-09-09  Martin Baulig  <martin@gnome.org>
33093
33094         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
33095         signature with the pinvoke field being set for the actual call.
33096
33097 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33098
33099         * icall.c: removed some unused icalls. Start of map of glib charsets
33100         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
33101
33102 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33103
33104         * debug-helpers.c: break infinite loop (found and fixed by
33105         Holger Arnold <harnold@gmx.de>).
33106
33107 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33108
33109         * icall.c: target may be null in create_delegate.
33110
33111 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33112
33113         * marshal.c: handle a boolean return type.
33114
33115 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33116
33117         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
33118
33119 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33120
33121         * gc.c: fix weakreferences.
33122
33123 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
33124
33125         * icall.c: added icall to get default codepage.
33126
33127 2002-09-03  Dick Porter  <dick@ximian.com>
33128
33129         * threads.h: 
33130         * threads.c: Use MonoThread instead of MonoObject where
33131         apropriate.
33132
33133         Store running thread objects in a hash table, so that we have all
33134         the info to hand when waiting for them to finish
33135         (means we don't need OpenThread() any more, so mingw builds should
33136         be fully functional again.)
33137
33138         * verify.c:
33139         * object.h: Added thread ID to MonoThread
33140
33141 2002-09-03  Martin Baulig  <martin@gnome.org>
33142
33143         * icall.c (System.Reflection.Assembly::get_location): New interncall.
33144
33145 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33146
33147         * icall.c: fixed leak in get_temp_path. Thanks lupus.
33148
33149 2002-09-03  Martin Baulig  <martin@gnome.org>
33150
33151         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
33152         argument to store the end address of the disassembled instruction.
33153
33154         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
33155         here from debug-symfile.h.
33156         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
33157         JIT into this struct.
33158         (MonoSymbolFile): Added `char *image_file' field.
33159         (MonoDebugGetMethodFunc): Removed.
33160         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
33161         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
33162         (mono_debug_find_method): New method.
33163
33164         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
33165         create a full symbol file.
33166         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
33167         and static symbol files.
33168         (mono_debug_find_method): The symbol file keeps an internal method hash,
33169         call this to get a MonoDebugMethodInfo from a MonoMethod.
33170
33171         * debug-symfile.[ch]: Removed.
33172
33173 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
33174
33175         * image.c (do_mono_image_open): Remove linker version check.
33176
33177 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
33178
33179         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
33180         wrappers for instance methods.
33181         
33182 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33183
33184         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
33185
33186 2002-08-28  Dick Porter  <dick@ximian.com>
33187
33188         * Makefile.am: Export HOST_CC for w32 builds
33189
33190 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33191
33192         * file-io.c process.c: MonoString are null terminated, no
33193         need for mono_string_to_utf16() anymore.
33194
33195 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33196
33197         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
33198
33199 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
33200
33201         * icall.c, reflection.h: speedup System.MonoType.
33202
33203 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33204
33205         * reflection.c: allow null as the value of a string argument in
33206         custom attributes constructors.
33207
33208 2002-08-27  Martin Baulig  <martin@gnome.org>
33209
33210         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
33211         `trampoline_address' field.
33212
33213 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
33214
33215         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
33216         check (fixes bug #29486) 
33217
33218 2002-08-27  Martin Baulig  <martin@gnome.org>
33219
33220         * debug-mono-symfile.c: Changed the file format in a way that allows us
33221         open it read-only and to use a specially malloced area for all the
33222         dynamic data.  We can now also generate a symbol file on-the-fly if we're
33223         debugging IL code and there is no MCS generated symbol file for it.
33224
33225 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33226
33227         * object.c: added a define for a good string and array
33228         creation speedup (not enabled by default because we need to deal with
33229         the synch stuff).
33230
33231 2002-08-26  Martin Baulig  <martin@gnome.org>
33232
33233         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
33234         function to create a dynamic symbol file.  This is used by the
33235         debugger to create a symbol file for IL code on-the-fly.
33236
33237 2002-08-26  Martin Baulig  <martin@gnome.org>
33238
33239         * loader.c (mono_lookup_pinvoke_call): Include the error message
33240         from g_module_error() in the error message.
33241
33242 2002-08-24  Martin Baulig  <martin@gnome.org>
33243
33244         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
33245         function to update the symbol file.  The symbol file is mmap()ed
33246         writable, but private.  This allows us to install the symbol file
33247         together with the assembly.
33248
33249 2002-08-24  Martin Baulig  <martin@gnome.org>
33250
33251         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
33252         but they can read the new symbol file format which mcs is now creating.
33253
33254         * debug-symfile.c (mono_debug_find_source_location): Moved to
33255         debug-mono-symfile.c; this is now operating on the new symbol file.
33256
33257 2002-08-23  Martin Baulig  <martin@gnome.org>
33258
33259         * debug-helpers.c (mono_method_desc_from_method): New function to get
33260         a MonoMethodDesc from a MonoMethod.
33261
33262 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33263
33264         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
33265         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
33266
33267 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
33268
33269         * string-icalls.[ch]: make helper methods static.
33270
33271 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33272
33273         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
33274         types to it and to SetValueInternal.
33275
33276         * object.c: Moved handle_enum label to its proper place. This was the
33277         f... bug! ;-)
33278
33279         This time i compiled mcs and gtk-sharp and they both work.
33280
33281 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33282
33283         * icall.c: reverted partially my previous patch until 
33284         object.c:set_value handles enums correcly.
33285
33286 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33287
33288         * icall.c:
33289         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
33290         (ves_icall_System_Environment_get_MachineName): removed warning when
33291         compiling under cygwin.
33292
33293 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33294
33295         * object.c: fixed field_get_value() for reference types.
33296
33297 2002-08-22  Dick Porter  <dick@ximian.com>
33298
33299         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
33300         Don't free a buffer while it's still needed.  Patch from Jonathan
33301         Liger <Jonathan.liger@wanadoo.fr>
33302
33303 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
33304
33305         * icall.c (ves_icall_System_Environment_get_Platform): Add new
33306         internal call.
33307
33308 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
33309
33310         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
33311         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
33312
33313         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
33314         we call unmanaged code which throws exceptions.
33315
33316 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33317
33318         * appdomain.h: added per-domain entry_assembly.
33319         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
33320         arguments.
33321         * icall.c: Assembly::GetEntryAssembly icall.
33322         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
33323         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
33324
33325 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33326
33327         * appdomain.h, gc.c: added mono_domain_finalize ().
33328
33329 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33330
33331         * object.c:
33332         (mono_print_unhandled_exception): changed g_warning by g_printerr
33333         because g_log has a 1024 characters limit (yeah, i got a big stack
33334         trace). Don't print exception name, that should be in ToString 
33335         returned string.
33336
33337 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33338
33339         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
33340         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
33341
33342 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33343
33344         * object.c:
33345         (mono_print_unhandled_exception): after previous commit, i realized
33346         that MS calls ToString on the exception. I changed this function to
33347         do that. This way we get stack_trace for free.
33348
33349 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33350
33351         * object.c:
33352         (mono_print_unhandled_exception): invoke Message property instead of
33353         getting 'message' field from Exception. Don't allocate memory for
33354         'trace' and 'message' if not needed.
33355
33356 2002-08-18  Dick Porter  <dick@ximian.com>
33357
33358         * unicode.c: Fix asserts to match Encoder.cs checks
33359
33360 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33361
33362         * marshal.c: fix unaligned store issue and a few wrong
33363         opcode argument types.
33364
33365 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33366
33367         * icall.c: added GetUninitializedObjectInternal internal call.
33368
33369 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
33370
33371         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
33372         to the right domain.
33373
33374 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
33375
33376         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
33377
33378         * class.c (class_compute_field_layout): set blittable to false for Strings
33379
33380         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
33381
33382 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33383
33384         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
33385         first chunk of code to create types at runtime. Code to
33386         handle ReflectedType/DeclaringType. Make reflection handles
33387         domain specific.
33388
33389 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33390
33391         * class.c: set correct name in arrays.
33392
33393 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
33394
33395         * appdomain.c (mono_domain_transfer_object): make it work with
33396         valuetypes. bug fixes.
33397
33398 2002-08-12  Dick Porter  <dick@ximian.com>
33399
33400         * object.h: Rename some parameters to avoid c++ keywords (Patch
33401         from Joseph Wenninger <kde@jowenn.at>)
33402
33403 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
33404
33405         * icall.c: added icall to implement Assembly.GetFile*.
33406
33407 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33408
33409         * reflection.h, reflection.c: code to embed managed resources.
33410
33411 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33412
33413         * class.c: move all the type size stuff into
33414         class_compute_field_layout().
33415
33416 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33417
33418         * class.c: ensure enums have always the correct instance size.
33419         * unicode.c: remove wrong assert.
33420
33421 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33422
33423         * assembly.c: fix mem corruption issue.
33424         * image.h, image.c: added mono_image_get_resource () to access
33425         managed resources.
33426         * icall.c: implemented Assembly.EntryPoint property and some
33427         Managed Resources related internalcalls.
33428
33429
33430 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33431
33432         * image.c, image.h: impemented mono_image_get_entry_point ().
33433         * appdomain.c: use mono_image_get_entry_point.
33434
33435 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33436
33437         * reflection.c: support the object type argument when loading
33438         custom attributes.
33439
33440 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
33441
33442         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
33443         String as return type.
33444
33445 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
33446
33447         * reflection.c: fix encoding of named args for custom attrs to match
33448         the ms implementation. Read them back when instantiating custom
33449         attributes.
33450
33451 2002-08-02  Radek Doulik  <rodo@ximian.com>
33452
33453         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
33454         by Dietmar as quick fix
33455         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
33456         16 as stack size, used on more places as quick fix before Dietmar
33457         will fix it properly
33458
33459 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33460
33461         * object.h, object.c: added accessors for fields and properties.
33462
33463 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33464
33465         * class.c, class.h: made mono_class_get_field_from_name ()
33466         loop on parent types.
33467         Added mono_class_get_property_from_name ().
33468
33469 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33470
33471         * class.c, class.h: move the code to setup the type vtable in its own
33472         function so that it can be reused also for types created at runtime.
33473         Eliminate the "class" identifier from the header file.
33474         * reflection.c: setup the vtable for enums so that we can create
33475         objects for use in SetConstant ().
33476
33477 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
33478
33479         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
33480         instead of the delegate itself as this pointer (bug #28383)
33481
33482 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
33483
33484         * marshal.c (mono_marshal_get_managed_wrapper): added return type
33485         conversions.
33486
33487 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33488
33489         * loader.c: don't set the pinvoke bit on icalls.
33490
33491 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
33492
33493         * debug-helpers.c (mono_method_full_name): only print a number to
33494         indicate wrapper type (so that the output is more readable in traces).
33495
33496 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
33497
33498         * class.c (mono_class_init): include method override patch from Paolo
33499
33500 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
33501
33502         * icall.c: fixed GetTypeCode().
33503
33504 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
33505
33506         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
33507         use real delegate invoke function to make it work with multicast
33508         delegates (fix bug# 28291).
33509
33510 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33511
33512         * object.c: load constant strings.
33513
33514 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33515
33516         * reflection.c: no magic numbers.
33517         * tabledefs.h: security action enum.
33518
33519 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33520
33521         * assembly.c: fix possible memory corruption.
33522
33523 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33524
33525         * reflection.h, reflection.c: added support for linking resources.
33526         * verify.c: check we have an updated corlib.
33527
33528 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
33529
33530         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
33531         string arrays.
33532         (mono_marshal_string_array): null terminate unmanaged string arrays.
33533         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
33534
33535 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33536
33537         * icall.c: Type.GetType () can now return also types from the
33538         calling assembly.
33539
33540 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33541
33542         * loader.h, loader.c: stack walking support.
33543         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
33544         GetCallingAssembly.
33545
33546 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
33547
33548         * marshal.c: added optimisations for blittable types 
33549
33550         * class.c (mono_array_class_get): do not set blittable attribute on arrays
33551         (mono_class_setup_mono_type): set blittable attribute for single
33552         and double.
33553
33554         * marshal.c (mono_string_utf8_to_builder): impl.
33555         (mono_string_builder_to_utf8): impl.
33556         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
33557
33558 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
33559
33560         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
33561         (mono_marshal_get_managed_wrapper): impl. byref types
33562
33563 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33564
33565         * icall.c:
33566         (search_method): don't display debug message. 
33567
33568 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33569
33570         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
33571
33572 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33573
33574         * appdomain.c: set the missing filename when throwing exception.
33575
33576 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33577
33578         * metadata.c (mono_type_size): code cleanup
33579         (mono_type_stack_size): removed some test code
33580
33581 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
33582
33583         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
33584         mono_get_exception_file_not_found now.
33585
33586         * exception.c (mono_exception_from_name_two_strings): New version
33587         that will call a constructor with two string arguments. 
33588         (mono_get_exception_file_not_found): New helper routine, used to
33589         report file-not-found errors.
33590
33591 2002-07-20  Dick Porter  <dick@ximian.com>
33592
33593         * process.h:
33594         * process.c: Pass file handles to CreateProcess
33595         
33596         * icall.c:
33597         * file-io.h:
33598         * file-io.c: Implemented CreatePipe
33599
33600 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33601
33602         * metadata.c (mono_get_param_info): set alignment for value types
33603
33604 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33605
33606         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
33607         Constify mono_domain_assembly_open().
33608         * loader.c: handle null namespace in icalls.
33609
33610 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33611
33612         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
33613         (emit_str_to_ptr_conv): marshal object as structs
33614
33615         * metadata.c (mono_type_to_unmanaged): marshal object as structs
33616
33617         * marshal.c (mono_marshal_get_runtime_invoke): support value types
33618
33619 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
33620
33621         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
33622         (mono_marshal_get_native_wrapper): we an now return value types
33623
33624 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33625
33626         * verify.c: more checks implemented.
33627
33628 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
33629
33630         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
33631         (fix bug #27695)
33632         (mono_marshal_get_native_wrapper): allow byref arguments
33633         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
33634         impl. PtrToStringXXX methods
33635         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
33636         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
33637         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
33638         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
33639         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
33640
33641 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33642
33643         * reflection.c: fix buglet in parsing an assembly name.
33644
33645 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33646
33647         * marshal.c (emit_ptr_to_str_conv): first impl.
33648
33649 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33650
33651         * object.c, class.h: cache the vtable in the class as suggested by
33652         vargaz@freemail.hu (Zoltan Varga).
33653
33654 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33655
33656         * class.h, loader.c: added mono_field_from_token().
33657         * verify.c: first cut of type checking code.
33658
33659 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33660
33661         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
33662
33663 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
33664
33665         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
33666         (fix bug #27782)
33667         (mono_marshal_get_remoting_invoke): impl.
33668         (mono_delegate_begin_invoke): impl.
33669         (mono_mb_emit_save_args): impl.
33670         (mono_delegate_end_invoke): impl.
33671         (mono_marshal_get_delegate_begin_invoke):
33672         (mono_marshal_get_delegate_end_invoke):
33673         (mono_marshal_get_delegate_invoke): generate a special name for
33674         those methods (including the signature) and associate them whith
33675         the delegate class. 
33676
33677 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
33678
33679         * reflection.[ch]: 
33680         (mono_reflection_type_from_name): now it has a MonoImage parameter
33681         which is used as the default image to search the type in. If the image
33682         is NULL or getting the type from it fails, it defaults to corlib.
33683
33684         * icall.c: changed 1 call to mono_reflection_type_from_name to match
33685         new parameter.
33686
33687 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33688
33689         * reflection.c: update the parameter table index.
33690
33691 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33692
33693         * domain.c: don't include the mark byte in the string hash.
33694
33695 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33696
33697         * icall.cs: icall for Type.GetTypeCode ().
33698         * verify: a couple of fixes and disabled local initialization checks.
33699
33700 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
33701
33702         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
33703
33704         * debug-helpers.c (mono_method_full_name): print the type of the
33705         runtime wrapper
33706
33707         * metadata.c (mono_signature_hash): a hash function for signatures
33708         (mono_signature_hash): better hash algorithm
33709
33710         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
33711
33712         * debug-helpers.c (mono_method_full_name): this can now generate
33713         method names with signatures
33714
33715         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
33716         method dont have this pointers.
33717
33718 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33719
33720         * reflection.c: fixup typebuilder tokens.
33721         * image.c: fix buglet.
33722         * marshal.h: remove whitespace.
33723         * metadata.h, metadata.c: reinstate code that was removed.
33724         * verify.c: handle catch directives and fix another couple of bugs.
33725
33726 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
33727
33728         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
33729         (mono_marshal_get_native_wrapper): make it comp. with the old code
33730         (mono_marshal_get_native_wrapper): support boolean
33731         (mono_marshal_get_managed_wrapper): support more types
33732
33733 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
33734
33735         * class.c (class_compute_field_layout): compute class->blittable attribute.
33736
33737 2002-07-09  Dick Porter  <dick@ximian.com>
33738
33739         * threads.c: Make the thread cleaning up cope with threads that
33740         call ExitThread()
33741
33742 2002-07-08  Radek Doulik  <rodo@ximian.com>
33743
33744         * reflection.c (method_encode_code): use non-translated values to
33745         compute finally_start, this fixes exception handling on ppc, yay!
33746
33747         * decimal.h (struct signscale): fix endianess
33748
33749 2002-07-07  Radek Doulik  <rodo@ximian.com>
33750
33751         * reflection.c: swap box_val and not val
33752
33753 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
33754
33755         * reflection.c, reflection.h: handle full assembly info in type name.
33756         Handle Type arguments when loading custom attributes.
33757         * icall.c: updated to use new mono_reflection_type_from_name () method.
33758
33759 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33760
33761         * loader.c:
33762         (method_from_memberref): also print assembly name when method not found.
33763
33764 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33765
33766         * icall.c:
33767         (ves_icall_TypeGetProperties): fixed bug #27473. 
33768
33769 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33770
33771         * reflection.c: display image name and token when cannot find the
33772         .ctor for an attribute.
33773
33774 2002-07-05  Martin Baulig  <martin@gnome.org>
33775
33776         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
33777
33778 2002-07-04  Dick Porter  <dick@ximian.com>
33779
33780         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
33781         compile on mingw.  This will cause mingw builds to not wait for
33782         subthreads to terminate after the main thread does.  I've lodged a
33783         bug with the mingw developers for them to wrap OpenThread().
33784
33785 2002-07-03  Dick Porter  <dick@ximian.com>
33786
33787         * threads.c: Store thread IDs instead of handles, because
33788         GetCurrentThread() returns a pseudohandle and therefore stores
33789         useless values.  mono_thread_cleanup() continues checking the
33790         array of threads until it is empty, to cope with subthreads
33791         spawning new threads after the main thread has finished.
33792
33793         * profiler.h:
33794         * profiler.c:
33795         * profiler-private.h: Pass the thread ID to thread profiler
33796         functions, instead of a handle
33797
33798 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33799
33800         * verify.c: fixes to make it more usable.
33801         * pedump.c: added --verify code to verify IL code in an assembly.
33802
33803 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33804
33805         * reflection.c: turn errors into warnings to allow compiling corlib.
33806
33807 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
33808
33809         * reflection.c: add special cases to compile corlib.
33810
33811 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33812
33813         * reflection.c: handle properties with only a set method.
33814
33815 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33816
33817         * opcodes.h: add enum with opcodes in opval order.
33818
33819 2002-07-01  Dick Porter  <dick@ximian.com>
33820         
33821         * object.h:
33822         * object.c (mono_runtime_run_main): Removed unneeded argument
33823
33824 2002-06-28  Martin Baulig  <martin@gnome.org>
33825
33826         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
33827
33828 2002-06-27  Dick Porter  <dick@ximian.com>
33829
33830         * threads.c: Store the handle in both the parent thread and in the
33831         subthread, to minimise the time between starting a new thread and
33832         storing its ID.
33833
33834 2002-06-26  Dick Porter  <dick@ximian.com>
33835
33836         * appdomain.c (mono_runtime_cleanup): Close the socket library
33837         after all the threads have finished, not before
33838
33839 2002-06-26  Martin Baulig  <martin@gnome.org>
33840
33841         * debug-symfile.c (mono_debug_find_source_location): Added
33842         `guint32 *line_number' argument.  If it's not NULL, store the line number
33843         there and return the file name without the line number.
33844
33845 2002-06-25  Dick Porter  <dick@ximian.com>
33846
33847         * icall.c:
33848         * process.h:
33849         * process.c: Process forking and other support functions
33850
33851 2002-06-25  Dick Porter  <dick@ximian.com>
33852
33853         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
33854         things dont happen when the image is closed.
33855         (mono_image_lookup_resource): Walk the resource section looking
33856         for a particular entry
33857
33858         * cil-coff.h: PE resource section decoding
33859
33860 2002-06-25  Dick Porter  <dick@ximian.com>
33861         
33862         * assembly.h:
33863         * assembly.c: 
33864         (mono_assembly_foreach): Accessor functions to walk the list of
33865         loaded assemblies
33866         (mono_assembly_set_main):
33867         (mono_assembly_get_main): Process methods need to know which
33868         assembly is the "main" one
33869
33870         * object.c (mono_runtime_run_main): Record the main assembly
33871
33872         * debug-helpers.c: Fix typo
33873
33874 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
33875
33876         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
33877         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
33878
33879 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
33880
33881         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
33882
33883 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
33884
33885         * image.c (do_mono_image_open): Initialize reference count,
33886         otherwise we leak the MonoImage.
33887
33888 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33889
33890         * reflection.c: small tweak to handle self-hosting.
33891
33892 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33893
33894         * reflection.c: fix type name parse code.
33895
33896 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33897
33898         * reflection.c: break out of the loop.
33899         * image.c: special case corlib.
33900
33901 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33902
33903         * reflection.c: add all the custom attrs at the end to ensure the
33904         ctors have been properly initialized when the attributes are defined
33905         in the current assembly.
33906
33907 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33908
33909         * reflection.c: handle correctly multiple-nested types.
33910
33911 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
33912
33913         * row-indexes.h: fix typos.
33914         * reflection.c: adjust for typos and fix method_def_or_ref
33915         encoding in MethodImpl table.
33916
33917 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33918
33919         * reflection.c: fix entry point patching (thanks Serge!).
33920
33921 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
33922
33923         * verify.c: add check for System.Exception
33924
33925 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33926
33927         * image.c, class.c: minifix for code just c&p'ed.
33928         * reflection.c: warning fix.
33929         * object.h, loader.h, domain.c: load also StringBuilder.
33930
33931 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33932
33933         * marshal.h, marshal.c: some support code to handle complex marshaling.
33934
33935 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33936
33937         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
33938         Better signatures with vtable error dump.
33939
33940 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
33941
33942         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
33943
33944 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
33945
33946         * icall.c (ves_icall_Type_GetField): impl.
33947
33948 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33949
33950         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
33951         to retrieve a marshal description blob for a field or param.
33952
33953 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33954
33955         * reflection.h, reflection.c: change order of nested type emission
33956         to avoid table corruption. The NestedTypes table is sorted.
33957         * icall.c: change order of GetConstructor results to workaround mcs bug.
33958
33959 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
33960
33961         * reflection.h, reflection.c: handle field and param marshal
33962         information.
33963
33964 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33965
33966         * icall.c, marshal.c marshal.h: more Marshal class implementation.
33967
33968 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33969
33970         * reflection.c: fix call convention.
33971
33972 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33973
33974         * reflection.h, reflection.c: mono_image_get_memberref_token()
33975         takes a type instead of a class, now. Added
33976         mono_image_get_array_token() to create tokens for the special
33977         multi-dim array methods.
33978
33979 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33980
33981         * assembly.c: handle modules (no assembly table). Split
33982         loading references in its own function.
33983         * class.c: handle moduleref resolution scope.
33984         * image.c, image.h: cache module name in image.
33985
33986 2002-06-07  Martin Baulig  <martin@gnome.org>
33987
33988         * reflection.c (mono_image_get_type_info): Only add a class layout entry
33989         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
33990
33991 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
33992
33993         * icall.c: more signature fixes that used uint instead of int.
33994
33995 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33996
33997         * reflection.c: fixed signature of field refs.
33998
33999 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34000
34001         * class.c, reflection.c: handle typerefs of nested types
34002         (both on read and when writing files).
34003
34004 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
34005
34006         * icall.c: fix method signatures that tried to workaround the previous
34007         typo, d'oh!
34008
34009 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34010
34011         * debug-helpers.c: fix typo.
34012
34013 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34014
34015         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
34016         rewrote the PE/COFF writing code (our programs are understood by the
34017         ms runtime, now).
34018
34019 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
34020
34021         * gc.c, gc.h, icall.c: weakreference support.
34022
34023 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34024
34025         * Makefile.am, mono-config.c: use $(sysconfdir).
34026
34027 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34028
34029         * icall.c: changed default precision of Double.ToString() to 15.
34030         Fixed memory leak. Unified with Single.ToString.
34031
34032 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
34033
34034         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
34035
34036 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
34037
34038         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
34039         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
34040         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
34041         and myself.
34042
34043 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34044
34045         * debug-symfile.c, sysmath.c: yet more compilation fixes.
34046
34047 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34048
34049         * reflection.c, socket-io.c: more compilation fixes.
34050
34051 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34052
34053         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
34054         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
34055         unicode.c: warning and compiler compatibility fixes.
34056
34057 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34058
34059         * class.h, metadata.c: fixed warnings/compilation errors.
34060
34061 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34062
34063         * Makefile.am, mono-config.c, mono-config.h: configuration file
34064         support routines.
34065         * loader.c, loader.h: make Dll mapping configurable at runtime in the
34066         config file. Export methods to insert and lookup mappings.
34067
34068 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
34069
34070         * reflection.c: handle types and boxed objects in custom attr
34071         constructors.
34072
34073 2002-05-30  Martin Baulig  <martin@gnome.org>
34074
34075         * debug-symfile.c
34076         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
34077
34078 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
34079
34080         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
34081         to lookup the implmap row for a P/Invoke method.
34082         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
34083         P/Invoke method from the runtime on an as needed basis.
34084
34085 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
34086
34087         * metadata.c (mono_metadata_parse_signature): impl.
34088
34089 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34090
34091         * class.c: handle .pack directive.
34092
34093 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
34094
34095         * object.c: initialize static fields with RVA data.
34096
34097 2002-05-25  Martin Baulig  <martin@gnome.org>
34098
34099         * debug-symfile.c
34100         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
34101
34102 2002-05-24  Martin Baulig  <martin@gnome.org>
34103
34104         * debug-symfile.c
34105         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
34106         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
34107         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
34108
34109 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
34110
34111         * object.c: special case string ctros in invoke.
34112         * gc.c: silly whitespace changes.
34113
34114 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
34115
34116         * threadpool.[ch]: impl. a threadpool that can
34117         be used by mint and mono.
34118
34119 2002-05-22  Martin Baulig  <martin@gnome.org>
34120
34121         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
34122         The first argument is now a `MonoReflectionModuleBuilder *', the return
34123         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
34124         `methods' field to get the method builder.  The `token' argument is the
34125         unfixed token.
34126
34127         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
34128         invalid characters instead of g_assert_not_reached()ing.  This seems
34129         to be the behaviour of mscorlib.
34130
34131 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
34132
34133         * object.c (mono_runtime_invoke_array): applied patch from Rachel
34134         Hestilow to fix bug #25104
34135
34136 2002-05-21  Martin Baulig  <martin@gnome.org>
34137
34138         * debug-symfile.c (mono_debug_find_source_location): New function.
34139         Looks up an IL offset in the line number table and returns the source
34140         location as a string.
34141
34142 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34143
34144         * icall.c:
34145         (mono_double_ToStringImpl): changed %f by %g until we have something
34146         better.
34147
34148 2002-05-21  Nick Drochak  <ndrochak@gol.com>
34149
34150         * icall.c : Use different name for Math.Pow's icall.  Needed to check
34151         parameters first in C#.
34152
34153 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34154
34155         * icall.c, reflection.h: added icall to get info about an event.
34156
34157 2002-05-20  Radek Doulik  <rodo@ximian.com>
34158
34159         * object.c (mono_value_box): don't use memcpy for boxing on BIG
34160         endian
34161         (mono_value_box): don't use memcpy for small sizes on
34162         architectures with unaligned access
34163
34164 2002-05-20  Martin Baulig  <martin@gnome.org>
34165
34166         * reflection.c (mono_reflection_setup_internal_class): Don't crash
34167         if `tb->parent == NULL'.
34168         (mono_reflection_create_internal_class): New function.  This is
34169         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
34170         for enum types.
34171
34172         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
34173         New interncall.
34174
34175 2002-05-19  Martin Baulig  <martin@gnome.org>
34176
34177         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
34178         argument to get the length, don't default to the array length.
34179
34180 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
34181
34182         * assembly.c (mono_assembly_setrootdir): New function used to
34183         override the MONO_ASSEMBLIES directory.
34184
34185 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34186
34187         * icall.c: ValueType_GetHashCode() initialize local var.
34188
34189 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34190
34191         * reflection.c: sort custom attributes table.
34192
34193 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34194
34195         * reflection.c: support named args in custom attributes (write support).
34196
34197 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
34198
34199         * reflection.c: fix finally position calculation.
34200
34201 2002-05-15  Radek Doulik  <rodo@ximian.com>
34202
34203         * reflection.c: fixed endianess at many places
34204
34205         * icall.c (ves_icall_InitializeArray): comment out debug msg
34206
34207 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
34208
34209         * object.c (mono_unhandled_exception): new function to handle
34210         unhandled exceptions.
34211         (mono_unhandled_exception): call the UnhandledException event.
34212         (mono_runtime_delegate_invoke): impl.
34213
34214 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
34215
34216         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
34217         returns the RVA, not the direct pointer to the data. Handle the case
34218         when the class size is fixed.
34219
34220 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
34221
34222         * reflection.c: fix some endianess issues.
34223
34224 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
34225
34226         * object.c (mono_runtime_invoke): is now able to catch exceptions.
34227
34228         * threads.c (mono_thread_init): added a callback which is invoked
34229         at thread start.
34230
34231 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34232         
34233         * icall.c: make GetHashCode return non-negative values.
34234
34235 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34236
34237         * object.c, icall.c, gc.c: revert to address-based hashcode.
34238
34239 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
34240
34241         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
34242
34243 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34244
34245         * icall.c, class.c: special case <Module>.
34246
34247 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
34248
34249         * icall.c: fix bug in GetNow().
34250
34251 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
34252
34253         * object.c (mono_runtime_class_init): make sure that we call all
34254         static class constructors.
34255
34256 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
34257
34258         * reflection.c: sort methodsemantics table.
34259
34260 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
34261
34262         * reflection.h, reflection.c: honour init locals setting.
34263
34264 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
34265
34266         * icall.c: copied Double ToStringImpl for Single ToStringImpl
34267
34268 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34269
34270         * reflection.c: support ContructorBuilders in attribute blob creation.
34271
34272 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34273
34274         * reflection.c: some changes to build a binary that can be run
34275         directly in windows.
34276
34277 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34278
34279         * loader.c: print a big message when an icall can't be found.
34280
34281 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34282
34283         * string-icalls.c: fix bug 24248.
34284
34285 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
34286
34287         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
34288         icall.c, reflection.h: separate assembly loading by pathname and by
34289         assembly name. Use the MONO_PATH env var to search for assemblies.
34290
34291 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34292
34293         * assembly.c, image.h: add some support for assemblies
34294         with multiple modules.
34295         * class.c, class.h: export mono_class_from_typeref().
34296         * loader.c: remove duplicated code and use mono_class_from_typeref(),
34297         instead.
34298
34299 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34300
34301         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
34302         documentation says (the ECMA one is correct).
34303
34304 2002-05-02  Dick Porter  <dick@ximian.com>
34305
34306         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
34307         Don't name the synchronisation mutex.
34308
34309 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
34310
34311         * rand.c
34312         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
34313         Make the prototypes match.
34314         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
34315         Same.
34316
34317         * icall.c
34318         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
34319         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
34320         all systems have tm.tm_zone, so use strftime() with %Z to print
34321         the timezone abreviation into a temp string.
34322
34323         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
34324         rather than mono_array_addr() on a MonoString on Big Endian
34325         machines.
34326
34327 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
34328
34329         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
34330         fix bug 24041
34331
34332 2002-04-30  Dick Porter  <dick@ximian.com>
34333
34334         * socket-io.c: Cope with SOCKET being an integer rather than a
34335         pointer now.
34336
34337         * threads.c: Added Thread_free_internal, to deal with thread
34338         handle cleanup.  Moved calls to handle_store() and handle_remove()
34339         to start_wrapper(), so each can only be called once.  Allocate
34340         synchronisation blocks with GC_malloc(), and use GC finalisation
34341         to close the handles.
34342
34343         * icall.c: added System.Threading.Thread::Thread_free_internal
34344
34345 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34346
34347         * icall.c: support Environment.Exit, CommandLineArgs().
34348
34349 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
34350
34351         * object.c, object.h: added mono_runtime_run_main () and
34352         mono_runtime_get_main_args () for use in System.Environment.
34353
34354 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34355
34356         * gc.c: fix thinko, enable actual finalization since the jit is now
34357         fixed.
34358
34359 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34360
34361         * gc.c, object.c: take into account that an object may be offset wrt the address
34362         returned by GC_malloc().
34363
34364 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
34365
34366         * image.c: handle files without entries in the assembly table (modules).
34367
34368 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
34369
34370         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
34371         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
34372         allowed to be null when it's System.Object class setup.
34373
34374 2002-04-27  Martin Baulig  <martin@gnome.org>
34375
34376         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
34377         if `tb->parent == NULL' rather than crashing.
34378
34379 2002-04-28  Nick Drochak  <ndrochak@gol.com>
34380
34381         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
34382         calling acos() where asin() should have been called.
34383
34384 2002-04-26  Martin Baulig  <martin@gnome.org>
34385
34386         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
34387         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
34388         there's a subdirectory called `System', but we don't want to read that
34389         subdirectory as an assembly.
34390
34391 2002-04-25  Martin Baulig  <martin@gnome.org>
34392
34393         * debug-symfile.c: Reflect latest MonoString changes.
34394
34395 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34396
34397         * rand.c, rand.h: instance method icalls need to have an explicit
34398         this pointer as first argument in the C implementation.
34399
34400 2002-04-25  Nick Drochak <ndrochak@gol.com>
34401
34402         * icall.c: Fix typo in map for GetNonZeroBytes
34403
34404 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34405
34406         * string-icalls.c : String does now passes unit tests without any 
34407         errors, the following changes has been made:
34408         
34409         Implemented replace methods.
34410         Renaming of methods to (try) follow the standard.
34411         Fixed compare ordinal
34412         Made all memory allocated directly to function instead of via icall function.
34413         Small performance fix in is_in_array function
34414                         
34415  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
34416
34417         c (mono_string_Internal_ctor_charp_int_int):
34418         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
34419         sindex < 0, throw ArgumentOutOfRangeException instead of
34420         ArgumentNullException.
34421
34422         Added new check for length == 0, however
34423         I need to make it return String.Empty from the C code.
34424         
34425         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
34426         that calculate the length for us here.
34427         
34428         (mono_string_Internal_ctor_sbytep_int_int): Replaced
34429         mono_string_new_utf16 with mono_string_new, since value is utf8.
34430
34431 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34432
34433         * object.c: register the object for finalization if needed.
34434         Allocate one more char in the string for the terminating 0 char.
34435
34436 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34437
34438         * class.c, class.h, image.c: check if a type implemenst a destructor.
34439         Use the proper key for array class lookups.
34440         * icall.c: register the icalls in the System.GC class.
34441         * gc.c, gc.h: GC-related functions and icalls.
34442
34443 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34444
34445         * icall.c:
34446         * socket-io.c:
34447         * unicode.c: free some strings gotten from mono_string_to_utf8 and
34448         changed a couple of free () by g_free ().
34449
34450         * decimal.c: one-liner in the comments for decimal2string ().
34451
34452 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34453
34454         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
34455
34456 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34457
34458         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
34459         * object.c (mono_runtime_invoke_array) : handle null in params
34460
34461 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34462
34463         * string-icalls.c: fixed bug in split (one off bug)
34464
34465 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34466
34467         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
34468         * icalls.c: added String::Equals as internal method
34469
34470 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34471
34472         * threads.c: fixed bug in the double interlocked functions
34473
34474 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
34475
34476         * threads.c: implemented all of the new interlocked icalls.
34477         * string-icalls.c: fix a bug in insert.
34478         * icalls.c: added the icalls for interlocked, removed old string functions.
34479         
34480 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34481
34482         * loader.c: fix off-by-one error when reading argument names.
34483
34484 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34485
34486         * profiler.c: win32 counter implementation (untested).
34487         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
34488         (the latter needs testing and more complete impl. from win32 folks).
34489
34490 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
34491
34492         * object.c: mono_array_new_full workaround mono_array_class_get
34493         problem.
34494
34495 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34496
34497         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
34498         * object.h (mono_string_chars): Changed casting type.
34499
34500 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34501
34502         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
34503                            method signatures to use gunichar2 instead of gint16.
34504
34505 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
34506
34507         * object.h, object.c: domain-specific versions of mono_object_new and
34508         mono_array_new.
34509
34510 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
34511
34512         * object.c: changed String layout
34513
34514         * string-icalls.c (mono_string_Internal_ctor_chara): added
34515         internal string constructors.
34516
34517 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
34518
34519         * threads.c: pass 'this' to the thread start routine.
34520
34521 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34522
34523         * string-icalls.c: fix IndexOf and LastIndexOf. Now
34524         InternalCompareStr don't call twice mono_string_cmp_char for the last
34525         character. Improved performance in mono_string_cmp_char.
34526
34527 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34528
34529         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
34530         code into its own library: libmonoruntime.
34531
34532 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
34533
34534         * object.h, object.c: changed array format so that szarrays do not
34535         require a bounds structure.
34536         * icall.c, appdomain.c: support for new szarray format.
34537
34538 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34539
34540         * metadata.c: compare also the retuns type when comparing signatures:
34541         we didn't do this as an optimization since really overloaded methods
34542         must differ also in the arguments, but this doesn't work with
34543         low-level IL code (or when using explicit conversion operators: see
34544         bug#23498 for an example).
34545
34546 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34547
34548         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
34549
34550 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
34551
34552         * icall.c: make MonoType::GetElementType its own icall.
34553
34554 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34555
34556         * icall.c: remove MonoMethod_get_Name().
34557         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
34558         object.
34559
34560 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34561
34562         * string-icalls.c: optimized a few methods.
34563
34564 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34565
34566         * icall.c: added all new string internal calls
34567         * string-icalls.c: added, new string internal call implementation.
34568         * object.c: added mono_string_new_size for allocating a string a size
34569
34570 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
34571
34572         * object.c (mono_object_isinst): use the same code as in the
34573         optimized x86 version.
34574
34575 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34576
34577         * profiler.c: TSC-based timer code (faster and more accurate).
34578         Not hooked up in configure, yet (set USE_X86TSC to 1).
34579
34580 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
34581
34582         * profiler.c, profiler.h: track time spent compiling methods.
34583         * threads.c: track thread creation/destruction.
34584
34585 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
34586
34587         * profiler.c, profiler.h, profiler-private.h: profiling interface
34588         and sample implementation. Moved here so that it can be used also by
34589         the jit.
34590
34591 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
34592
34593         * reflection.c, reflection.h: keep types and other handles separate in
34594         the hash tables for referred tokens. Add guid for modules.
34595
34596 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34597
34598         * assembly.c: fix bugs found with valgrind.
34599         * metadata.h, metadata.c: added mono_metadata_guid_heap().
34600
34601 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
34602
34603         * threads: added icall support for getting current domain for
34604                    the thread.
34605  
34606 2002-04-13  Martin Baulig  <martin@gnome.org>
34607
34608         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
34609         (MonoDebugVarInfo): Added `index' field for register based addresses.
34610         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
34611         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
34612         `MonoDebugVarInfo *params' and `guint32 this_offset' with
34613         `MonoDebugVarInfo *this_var'.
34614
34615         * debug-symfile.c (relocate_variable): New static function to write
34616         a location description for a local variable or method parameter.
34617
34618 2002-04-12  Martin Baulig  <martin@gnome.org>
34619
34620         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
34621         stack offset and begin/end scope address of a local variable.
34622         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
34623         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
34624         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
34625
34626         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
34627         Added new relocation types for start/end scope of a local variable.
34628
34629 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34630
34631         * object.h: add mono_object_domain() macro.
34632         * reflection.c: handle typespecs.
34633         * icall.c: MonoMethod::get_Name() implementation.
34634
34635 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34636
34637         * icall.c: String::GetHashCode() icall implementation.
34638
34639 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34640
34641         * icall.c: String::IndexOfAny icall.
34642         * object.c, object.h: make array->max_length more useful.
34643         Intrduced mono_object_class() and mono_string_length() macros.
34644
34645 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34646
34647         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
34648         instead of g_unichar_isdigit.
34649
34650 2002-04-11  Nick Drochak  <ndrochak@gol.com>
34651
34652         * icall.c: Implement a simple Double.ToString().
34653
34654 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34655
34656         * appdomain.h: only io-layer.h is supposed to be included.
34657         * icall.c: explicitly import environ. Fix warning.
34658
34659 2002-04-10  Nick Drochak  <ndrochak@gol.com>
34660
34661         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
34662                 return true even if it's not Daylight Savings time.
34663                 Only return false for the case where the function isn't
34664                 implemented for a plaform (read Windows).
34665
34666 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34667
34668         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
34669         data with a mutex.
34670
34671 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
34672
34673         * mempool.c (mono_mempool_alloc): only use g_malloc when
34674         absolutely necessary.
34675
34676 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34677
34678         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
34679
34680         * class.c (mono_class_vtable): use domain mempool to allocate vtable
34681         (mono_class_proxy_vtable): use domain mempool
34682
34683 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34684
34685         * appdomain.h, appdomain.c: split initialization that requires the
34686         execution engine support into mono_runtime_init().
34687
34688 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34689
34690         * class.c (mono_class_init): don't include vtable inside MonoClass
34691         to save some memory, gather some statistics.
34692         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
34693
34694 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34695
34696         * icall.c: internalcall implementation for ValueType.Equals().
34697
34698 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
34699
34700         * object.c (mono_message_init): moved 
34701         (mono_runtime_exec_main): new arch. independent impl.
34702         (mono_runtime_invoke_array): new method - like
34703         mono_runtime_invoke, but you can pass an array of objects.
34704         (mono_remoting_invoke): new arch. independent impl.
34705         (mono_message_invoke): new arch. independent impl.
34706         (mono_runtime_class_init): new arch. independent impl.
34707         (mono_runtime_object_init): new arch. independent impl.
34708
34709 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34710
34711         * metadata.c, object.c, reflection.c: documented the exported
34712         functions.
34713
34714 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
34715
34716         * icall.c: simpler code to pass the assembly builder data to corlib.
34717         Implement GetNestedTypes() internalcall.
34718
34719 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34720
34721         * class.c: warn if a type can't be loaded.
34722
34723 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
34724
34725         * image.h: typedef MonoImageOpenStatus
34726         * types.h: removed unused file
34727         
34728 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
34729
34730         * icall.c: Enum_ToObject accepts enum value arguments.
34731
34732 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
34733
34734         * class.c: move initialization of properties, events and nested
34735         classes, so that they happen for interfaces, too.
34736
34737 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34738
34739         * icall.c: cleanup some ugly casts in Array_SetValue*.
34740
34741 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34742
34743         * icall.c: the values array fro enums is of the correct type, now.
34744         Implement (correctly) getFullName instead of assQualifiedName for
34745         MonoType.
34746         * reflection.h, reflection.c: added mono_type_get_name ().
34747
34748 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34749
34750         * assembly.c, image.h: for each MonoImage, record from wich assembly
34751         it was loaded.
34752         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
34753         Make Type.Assembly work.
34754
34755 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
34756
34757         * debug-symfile.h: use char* instead of gpointer to avoid
34758         unnecessary casts.
34759
34760         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
34761
34762         * icall.c (ves_icall_InternalExecute): impl. FielSetter
34763         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
34764
34765 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
34766
34767         * icall.c (mono_message_init): impl. (code cleanup)
34768         (ves_icall_InternalExecute): impl. FieldGetter
34769
34770         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
34771         defined we call all (non-static)methods through the vtable. 
34772
34773 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
34774
34775         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
34776         finalizer even though the memory is still referenced (and the chunk of
34777         memory is not freed).
34778
34779 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
34780
34781         * assembly.c: fix brokeness.
34782
34783 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
34784
34785         * class.c: kill some warnings. Check explicit interface method
34786         implementation also without considering the namespace.
34787         Load also literal strings in static class data.
34788
34789 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
34790
34791         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
34792         (default_assembly_name_resolver): Make the resolver take the
34793         "base" directory where the assembly was originally defined, so we
34794         can load DLLs that are in the same directory as the assembly that
34795         is being referenced.
34796
34797 2002-03-28  Dick Porter  <dick@ximian.com>
34798
34799         * file-io.h: 
34800         * file-io.c:
34801         * socket-io.c: 
34802         * unicode.h: 
34803         * unicode.c: Warning cleanups
34804
34805 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
34806
34807         * object.h, reflection.h: use the correct type instead of MonoObject.
34808
34809 2002-03-28  Martin Baulig  <martin@gnome.org>
34810
34811         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
34812         (mono_debug_update_symbol_file): Initialize classes if necessary.
34813
34814 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
34815
34816         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
34817         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
34818
34819 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
34820
34821         * assembly.h: fix function prototype.
34822         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
34823         * mono-endian.h: use const cast.
34824
34825 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
34826
34827         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
34828
34829 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
34830
34831         * loader.c: don't assert when a typeref can't be loaded, give
34832         a chance to the runtime to trow an exception instead.
34833         * loader.h: fix warning.
34834
34835 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
34836
34837         * class.c (mono_class_proxy_vtable): added proxy support
34838
34839 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
34840
34841         * icall.c: removed last of PAL calls, added System.Environment
34842         * file-io.h, file-io.c: MonoIO implementation
34843         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
34844
34845 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
34846
34847         * appdomain.c: do not use the byte marker in ldstr table lookup.
34848         * debug-helpers.c: allow two ':' to separate class and method name.
34849         * object.c: allocate arrays bounds with the GC, too.
34850         * verify: add a few more checks.
34851
34852 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
34853
34854         * reflection.c: output also literal strings. Allocate parameter data
34855         with GC_malloc() (thanks, Martin, for catching this!).
34856
34857 2002-03-26  Martin Baulig  <martin@gnome.org>
34858
34859         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
34860         include the `this' offset in the `param_offsets'.
34861
34862 2002-03-25  Martin Baulig  <martin@gnome.org>
34863
34864         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
34865         mono_debug_get_class() function to get the classes. Added new
34866         relocation types for arrays and strings.
34867         (mono_debug_get_class): New static function to search in all
34868         referenced assemblies for a metadata token.
34869
34870         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
34871
34872 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
34873
34874         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
34875         hold gc-allocated objects. Make the string heap a stream like the
34876         others. Removed duplicated code when writing stream info.
34877         Added asserts to catch possible buffer overflows. Set the sorted map
34878         for tables that need sorting. Added some documentation.
34879
34880 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
34881
34882         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
34883         for interned strings and vtables.
34884
34885 2002-03-24  Martin Baulig  <martin@gnome.org>
34886
34887         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
34888         it in the array since it was created with g_slist_prepend().
34889
34890 2002-03-24  Martin Baulig  <martin@gnome.org>
34891
34892         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
34893         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
34894         (mono_debug_method_from_token): Renamed to
34895         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
34896         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
34897
34898         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
34899         relocation types.
34900
34901         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
34902
34903 2002-03-24  Martin Baulig  <martin@gnome.org>
34904
34905         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
34906         (mono_debug_method_from_token): New func.
34907
34908         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
34909         New interncall, calls mono_debug_local_type_from_signature().
34910         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
34911         calls mono_debug_method_from_token().
34912
34913 2002-03-23  Martin Baulig  <martin@gnome.org>
34914
34915         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
34916         specifies the number of bytes to be converted, not the array size.
34917         Return the number of chars, not the number of bytes.
34918         (ves_icall_iconv_get_chars): The `byteCount' argument
34919         specifies the number of bytes to be converted, not the array size.
34920
34921 2002-03-23  Martin Baulig  <martin@gnome.org>
34922
34923         * reflection.h (MonoReflectionSigHelper): New type.
34924
34925         * reflection.c (mono_reflection_sighelper_get_signature_local),
34926         (mono_reflection_sighelper_get_signature_local): New functions.
34927
34928         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
34929         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
34930         interncalls.
34931
34932 2002-03-23  Martin Baulig  <martin@gnome.org>
34933
34934         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
34935         is_writeable is set.
34936         (mono_raw_buffer_update): New function to write the modified map
34937         back to disk.
34938
34939         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
34940
34941         * debug-symfile.c (mono_debug_update_symbol_file): Call
34942         mono_raw_buffer_update() when done writing.
34943
34944 2002-03-23  Martin Baulig  <martin@gnome.org>
34945
34946         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
34947
34948         * debug-symfile.c: Added support for arguments and local variables.
34949
34950 2002-03-23  Dick Porter  <dick@ximian.com>
34951
34952         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
34953         protected by ifdefs, hence breaking the w32 build.
34954
34955 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
34956
34957         * object.c: implement is_interned() the right way.
34958
34959 2002-03-21  Martin Baulig  <martin@gnome.org>
34960
34961         * debug-symfile.[ch]: New files to handle debugging information
34962         files. There's also support to dynamically update these symbol
34963         files to include machine dependent information.
34964
34965 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
34966
34967         * threads.c (mono_thread_create): new function to create thread
34968         from C
34969
34970 2002-03-20  Martin Baulig  <martin@gnome.org>
34971
34972         * icall.c (ves_icall_InternalInvoke): Create a new object if the
34973         method is a constructor.
34974         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
34975         points to ves_icall_InternalInvoke().
34976
34977 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
34978
34979         * file-io.c: Flush shouldn't throw exceptions.
34980
34981 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
34982
34983         * file-io.c: FileStream flush support; FileSetLength now
34984         restores file pointer.
34985
34986 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
34987
34988         * class.c: set image for pointer classes.
34989
34990 2002/03/19  Nick Drochak <ndrochak@gol.com>
34991
34992         * sysmath.c: Forgot one.
34993
34994 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
34995
34996         * sysmath.c: Avoid redefining existing names.
34997
34998 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
34999
35000         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
35001         handled by runtime as icall rather than dllimport from libm.so
35002         * file-io.c, file-io.h: fixed handle argument type.
35003
35004 2002-03-18  Dick Porter  <dick@ximian.com>
35005
35006         * reflection.c (mono_image_get_type_info): rename interface to
35007         iface, because of "#define interface struct" on windows.
35008
35009 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
35010
35011         * class.c, class.h: rename and export mono_ptr_class_get().
35012         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
35013         * reflection.c, reflection.h, icall.c: better/saner type name
35014         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
35015         method signatures.
35016
35017 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
35018
35019         * class.c (mono_class_init): removed hardcoded GHC_SLOT
35020
35021         * icall.c (ves_icall_InternalInvoke): impl.
35022
35023 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35024
35025         * reflection.c: output the interface map table, too.
35026
35027 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35028
35029         * class.c (class_compute_field_layout): separate computation of 
35030         static field layout
35031
35032 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
35033
35034         * icall.c: added System.Buffer support.
35035         * file-io.c: moved file icalls from PAL to FileStream.
35036
35037 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35038
35039         * icall.c (ves_icall_System_Object_GetHashCode): impl.
35040
35041 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
35042
35043         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
35044
35045 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35046
35047         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
35048
35049 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35050
35051         * debug-helpers.{c,h}: moved here from monograph some useful functions
35052         to locate a method by name/signature in a class or image. Included
35053         also a small and flexible IL disassembler.
35054
35055 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35056
35057         * reflection.c: fixup tokens in methods with small header size, too.
35058
35059 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
35060
35061         * object.c (mono_string_to_utf8): remove assert(!error), instead
35062         print a warning. 
35063
35064 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
35065
35066         * icall.c: update to the new mono_Array_class_get interface.
35067
35068 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35069
35070         * appdomain.c, object.c: Boehm-GC enable.
35071         * icall.c: make get_data_chunk() support split data requests.
35072         Ensure a class is initialized in more cases. Return only the first
35073         property found in GetProperties() or the compiler gets confused. 
35074         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
35075         * reflection.h, reflection.c: add fixup mechanism for field and method
35076         tokens. Initialize assembly->typeref in a single place. Output
35077         properties after events. Support custom attributes for events, too.
35078         Typo fix for paramter custom attrs.
35079
35080 2002-03-07  Martin Baulig  <martin@gnome.org>
35081
35082         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
35083
35084 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
35085
35086         * class.c (mono_array_class_get): fix. for multi. dim. arrays
35087
35088 2002-03-06  Martin Baulig  <martin@gnome.org>
35089
35090         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
35091         non-zero lower bounds. See testcases #F10-#F13.
35092
35093 2002-03-05  Martin Baulig  <martin@gnome.org>
35094
35095         * exception.c (mono_get_exception_argument_out_of_range): New exception.
35096
35097         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
35098         ves_icall_System_Array_GetValue(), only calculate the absolute array position
35099         here.
35100         (ves_icall_System_Array_SetValue): Likewise.
35101         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
35102         as argument and does the actual work. This function is used when copying a
35103         multi-dimensional array.
35104         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
35105         now do all the widening conversions of value types.
35106         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
35107
35108 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35109
35110         * class.c: remove some magic numbers and use the smbolic names,
35111         instead. Added init_events() to load event info at class init time.
35112         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
35113         and mono_metadata_methods_from_event().
35114         * reflection.h, reflection.c: added support for writing out the evnets
35115         related information.
35116
35117 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
35118
35119         * reflection.h, icall.c: use a different method (GetInterfaces)
35120         to gather interface info and add isbyref, isprimitive and
35121         ispointer to the ves_icall_get_type_info() return value.
35122
35123 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35124
35125         * class.h: stared adding support for events.
35126         * icall.c: split find_members implementation. Added debug icall to get
35127         the address of an object.
35128         * reflection.c: handle TypeBuilders in mono_type_get_object().
35129
35130 2002-03-01  Martin Baulig  <martin@gnome.org>
35131
35132         * icall.c (ves_icall_System_Array_GetLength): This must throw an
35133         ArgumentOutOfRangeException(), not an ArgumentException().
35134         (ves_icall_System_Array_GetLowerBound): Likewise.
35135         (ves_icall_System_Array_GetValue): Improved argument checking.
35136         (ves_icall_System_Array_SetValue): Improved argument checking.
35137
35138 2002-03-01  Martin Baulig  <martin@gnome.org>
35139
35140         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
35141         called with invalid arguments rather than just dying with g_assert().
35142         (ves_icall_System_Array_SetValue): Likewise.
35143         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
35144         raise a NotImplementedException instead.
35145         (ves_icall_System_Array_GetLength): Added argument checking.
35146         (ves_icall_System_Array_GetLowerBound): Added argument checking.
35147
35148 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
35149
35150         * object.h (mono_assert): new macros mono_assert and
35151         mono_assert_not_reached
35152
35153 2002-02-28  Martin Baulig  <martin@gnome.org>
35154
35155         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
35156         and "System::String::IsInterned" to "System::String::_IsInterned".
35157
35158 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
35159
35160         * icall.c: remove hacks for typebuilder. Added icall to create a
35161         modified type from a tybebuilder.
35162         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
35163         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
35164         to create a backing MonoClass for a TypeBuilder.
35165
35166 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35167
35168         * class.c, class.h: more refactoring of class init.
35169         Export mono_class_setup_mono_type() and mono_class_setup_parent().
35170
35171 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
35172
35173         * marshal.c, marshal.h: start of marshaling interface.
35174
35175 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35176
35177         * icall.c: fix order in assembly qualified name icall.
35178
35179 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35180
35181         * class.c: do not free str, since we store it in the hash table.
35182         * reflection.h: add label field to MonoILExceptionInfo.
35183         * reflection.c: handle references to more than one assembly. Handle
35184         case when there isn't a module created in the assembly.
35185
35186 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
35187
35188         * class.c: Fix typo. Start refactoring of class init code.
35189
35190 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
35191
35192         * appdomain.c: exit with 1 on error.
35193         * class.c: we already have the name in MonoClassField.
35194         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
35195         MonoStreamHeader instead of an offset of image->raw_metadata.
35196
35197 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
35198
35199         * appdomain.c (mono_init): Be even more descriptive about the error.
35200
35201 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
35202
35203         * appdomain.c: give the user an informative message when corlib can't
35204         be loaded.
35205
35206 2002-02-26  Martin Baulig  <martin@gnome.org>
35207
35208         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
35209         New icall to get the time zone data.
35210
35211 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35212
35213         * reflection.c: set virtual and raw size of section correctly.
35214         * threads.c: transfer domain information to newly created threads.
35215
35216 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35217
35218         * class.c: when instancing a class in a domain, load the default
35219         vaules for static fields from the constant table. Fix System.Enum to
35220         not be an enum.
35221         * icall.c: implement Object::GetType() internalcall. Implemented
35222         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
35223         Fixed checking of binding flags in find_members().
35224         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
35225         * reflection.c: handle enumerations when writing to the constant
35226         table. Use a different object cache for types.
35227
35228
35229 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
35230
35231         * object.c (mono_object_isinst): fix for arrays
35232
35233         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
35234
35235 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35236
35237         * object.c: don't use mprotect ()  and fix intern pool hash table
35238         lookup for big endian systems.
35239
35240 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35241
35242         * icall.c: change type_is_subtype_of () signature.
35243
35244 2002-02-21  Mark Crichton  <crichton@gimp.org>
35245
35246         * rand.c, rand.h: Added random number generator for
35247         System.Security.Cryptography classes.
35248
35249         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
35250
35251         * icall.c: Added System.Security.Cryptography calls.
35252
35253 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
35254
35255         * class.c, icall.c, metadata.c: better support for pointer types.
35256         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
35257         * reflection.c: Add support for getting custom attrs for properties
35258         and simplify some code.
35259
35260 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35261
35262         * icall.c: change getToken () and add custom attribute GetBlob()helper
35263         method.
35264         * reflection.h: add custom attrs array to the reflection builder structures.
35265         * reflection.c: encode and emit custom attributes for all the relevant
35266         reflection objects. Cache fieldref and methodref tokens. Change
35267         mono_image_create_token() interface to take a MonoDynamicAssembly.
35268         More complete custom attributes decoder. Load custom attributes for
35269         Assembly, Field, Method and Constructor objects, too. Make the
35270         returned array an Attribute[] one, not object[]. Added
35271         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
35272         custom attribute constructor.
35273
35274 2002-02-20  Dick Porter  <dick@ximian.com>
35275
35276         * icall.c:
35277         * rawbuffer.c:
35278         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
35279         problem code out for now).
35280
35281 2002-02-19  Radek Doulik  <rodo@ximian.com>
35282
35283         * object.c (mono_ldstr): use hash table to avoid multiple swapping
35284
35285 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
35286
35287         * icall.c: register the GetCustomAttributes method.
35288         * object.c, object.h: add mono_string_new_len ().
35289         * reflection.h, reflection.c: added mono_runtime_invoke(),
35290         mono_install_runtime_invoke(). Added
35291         mono_reflection_get_custom_attrs () to load custom attributes and
35292         create the attribute objects.
35293
35294 2002-02-19  Dick Porter  <dick@ximian.com>
35295         * threads-dummy-types.c:
35296         * threads-dummy-types.h:
35297         * threads-dummy.c:
35298         * threads-dummy.h:
35299         * threads-pthread-types.c:
35300         * threads-pthread-types.h:
35301         * threads-pthread.c:
35302         * threads-pthread.h:  Deleted obsolete files
35303
35304 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
35305
35306         * class.c (mono_class_vtable): runtime init the class when we
35307         allocate static class data.
35308
35309         * icall.c (ves_icall_System_Array_SetValue): check for null values.
35310
35311         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
35312         and String - but we will need generic marshalling support in the
35313         future. 
35314         (mono_init): set the domain name in a ms compatible way
35315
35316         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
35317         String[].
35318
35319 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
35320
35321         * object.c (mono_array_clone): use alloca() instead of g_malloc  
35322         for sizes
35323
35324         * appdomain.c (mono_domain_unload): impl.
35325
35326 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35327
35328         * appdomain.c, object.c: fix intern pool implementation.
35329         * class.c: fix alignment code.
35330
35331 2002-02-16  Radek Doulik  <rodo@ximian.com>
35332
35333         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
35334         and s2 > s1, just copy lower bytes to be compatible with little
35335         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
35336         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
35337
35338         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
35339         force big_endian to be 1 for big endian machines 
35340         (ves_icall_iconv_new_decoder): ditto
35341
35342 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
35343
35344         * socket-io.c (convert_sockopt_level_and_name): If the system
35345         doesn't define SOL_IP or SOL_TCP, get them by hand using
35346         getprotobyname() and caching the values (because this could be a
35347         slow operation).
35348         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
35349         Use the appropriate struct when the system does support it. Ie,
35350         not all systems have struct ip_mreqn so use struct ip_mreq when
35351         appropriate.
35352
35353 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
35354
35355         * reflection.c: handle finally clauses.
35356
35357 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
35358
35359         * socket-io.c: use g_snprintf() instead of snprintf.
35360
35361 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35362
35363         * reflection.c (mono_param_get_objects): Cast second argument to
35364         mono_method_get_param_names to a const char** to silence the
35365         compiler warning.
35366
35367         * appdomain.c (mono_domain_assembly_open): Put parens around the
35368         truth statement in the for-loop.
35369
35370         * unicode.c (iconv_convert): Got rid of a compiler warning about
35371         int i being unused when the system has a new iconv.
35372         (iconv_get_length): Same.
35373
35374         * image.c (load_class_names): Cast the second argument to
35375         g_hash_table_insert() to char* to hush compiler warnings about the
35376         arg being a const.
35377         (mono_image_open): Same here.
35378
35379         * socket-io.c: Don't conditionally include sys/filio.h or
35380         sys/sockio.h here anymore since we now get them from
35381         io-layer/io-layer.h
35382         (inet_pton): If the system doesn't support inet_aton, implement
35383         using inet_addr and also #define INADDR_NONE if it isn't defined
35384         by the system.
35385
35386 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
35387
35388         * metadata.c, metadata.h: added function to get packing and size info
35389         of a typedef.
35390         * reflection.h, reflection.c: handle field RVA data. Save info about
35391         the table layout if needed. Assign typedef indexes to all the types
35392         before dumping the info about them to avoid forward reference problems.
35393
35394 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
35395
35396         * socket-io.c (convert_sockopt_level_and_name): ifdef
35397         SO_ACCEPTCONN because it is not defined on my system (old debian)
35398
35399 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35400
35401         * opcode.c: use stddef.h to get NULL.
35402
35403 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35404
35405         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
35406         for FIONBIO, FIONREAD and SIOCATMARK.
35407         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
35408         define INADDR_NONE and besides, inet_addr() is deprecated and
35409         should not be used. Use inet_pton() instead - it also has the
35410         added bonus that it can easily handle IPv6 addresses as well.
35411         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
35412
35413 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
35414
35415         * decimal.c: remove _MSC_VER conditional.
35416
35417 2002-02-13  Dick Porter  <dick@ximian.com>
35418
35419         * socket-io.c: 
35420         * icall.c: Internal calls for Blocking, Select, Shutdown,
35421         GetSocketOption and SetSocketOption
35422
35423 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35424
35425         * assembly.cs: better resolver: use it instead of some kludgy
35426         code.
35427
35428 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
35429
35430         * reflection.c: the best way to speed-up the compiler is to avoid
35431         infinite loops.
35432
35433 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
35434
35435         * class.c (mono_class_vtable): changed the object layout
35436         (obj->vtable->class). 
35437         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
35438
35439 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35440
35441         * assembly.c: look for assemblies in the assembly dir, too.
35442
35443 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35444
35445         * class.c: fix thinko in mono_class_from_type().
35446
35447 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35448
35449         * exception.h, exception.c: added TypeLoadException.
35450         * object.h, object.c: added mono_array_clone ().
35451         * icall.c: handle throwOnError in AssemblyGetType().
35452         Added Array.Clone().
35453         * opcode.h, opcode.c: use a single value for the opcode val.
35454         Compile fix for non-gcc compilers.
35455
35456 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
35457
35458         * opcodes.c, opcodes.h: export interesting info about opcodes.
35459
35460 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
35461
35462         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
35463         icalls. 
35464
35465         * class.c (class_compute_field_layout): set element_class for enums
35466         (mono_class_create_from_typedef): set element_class for normal classes
35467
35468         * icall.c (ves_icall_System_Enum_get_value): impl.
35469
35470         * class.c (mono_class_create_from_typedef): do not set valuetype
35471         flag for System.ValueType and System.Enum
35472
35473 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
35474
35475         * unicode.c (iconv_convert): fix big endian problem.
35476
35477 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35478
35479         * class.c: add asserts if we are ever going to scribble over memory.
35480         * socket-io.c: not all systems have AF_IRDA defined.
35481
35482 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
35483
35484         * class.c (class_compute_field_layout): do not consider static
35485         fields to compute alignment
35486
35487 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
35488
35489         * appdomain.c (mono_appdomain_get): impl.
35490         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
35491
35492 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35493
35494         * icall.c: ignore "file://" prefix when loading an assembly.
35495
35496 2002-01-23  Dick Porter  <dick@ximian.com>
35497
35498         * socket-io.c:
35499         * icall.c:
35500         * Makefile.am: Added socket support
35501
35502 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35503
35504         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
35505         code back.  This should return the assemblies that are loaded by
35506         the runtime on behalf of an application domain. 
35507
35508         The current implementation is still broken, it just returns every
35509         assembly loaded, but until we get real applications domain this
35510         will do.
35511
35512 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
35513
35514         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
35515         AppDomain object.
35516
35517 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35518
35519         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
35520         the mono_class_from_name lookup.
35521         (ves_icall_get_parameter_info): ditto.
35522         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
35523         method.
35524         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
35525
35526 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
35527
35528         * class.c: load also nested classes on class init.
35529         System.ValueType instance methods gets passed boxed
35530         values, unless methods in derived classed that get a pointer to the
35531         data.
35532         * icall.c: use better name parsing code in GetType().
35533         * image.c, image.h: add mono_image_loaded ().
35534         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
35535         * reflection.c, reflection.h: added mono_reflection_parse_type().
35536
35537 2002-01-22  Veronica De Santis <veron78@interfree.it>
35538
35539         * icall.c : Added mapping of internal calls for Manual and Auto reset events
35540         * threads.c : Added the implementation of internal calls for events
35541         * threads.h : Added prototypes of internal calls for events
35542         
35543 2002-01-21  Radek Doulik  <rodo@ximian.com>
35544
35545         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
35546
35547 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
35548
35549         * class.c (mono_class_init): set min_align to 1 (instead of 0)
35550         (mono_class_value_size): use min_align
35551
35552 2002-01-20  Dick Porter  <dick@ximian.com>
35553
35554         * threads.h:
35555         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
35556         so it compiles on w32.
35557
35558 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
35559
35560         * metadata.c (mono_type_stack_size): impl.
35561
35562         * class.c (mono_class_get_field): impl. memberref token
35563
35564 2002-01-16 Veronica De Santis <veron78@@interfree.it>
35565
35566         * icall.h : Added the internal calls mapping for CreateMutex_internal
35567                     and ReleaseMutex_internal.
35568         * threads.h : Added the prototype of mutexes internal calls.
35569         * threads.c : Added the implementations of mutexes internal calls.
35570
35571 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35572
35573         * metaparse.h: removed unused file.
35574         * reflection.c, reflection.h: added stream_data_align () function 
35575         to align data in streams and keep stream aligned. Add support for
35576         exception support in method headers.
35577
35578 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
35579
35580         * unicode.c: make iconv_convert () return the number of bytess written
35581         in the output buffer.
35582
35583 2002-01-15  Dick Porter  <dick@ximian.com>
35584         * threads.c: Make the runtime's idea of infinite timeouts coincide
35585         with the class library's
35586
35587         Fix a particularly egregious bug in mono_thread_cleanup(). That
35588         code was so utterly bogus it must have been written on a Monday.
35589
35590 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35591
35592         * reflection.h: add subtypes field to TypeBuilder.
35593         * reflection.c: encode constants for literal fields.
35594         Handle subtypes. Fix user string token (and add a zero byte)
35595         at the end.
35596         
35597 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
35598
35599         * class.c (mono_class_init): bug fix: assign slot numbers for
35600         abstract methods.
35601
35602 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35603
35604         * reflection.c: don't try to output a code RVA for abstract methods.
35605         Small fixes for method header format. Output parameter info to the
35606         ParamDef table. Save method overriding info to MethodImpl table.
35607         Fix property support. Allow typedef.extends to be a type in the
35608         building assembly.
35609         * verify.c: fix off-by-one error.
35610
35611 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
35612
35613         * class.c: fix mono_class_from_mono_type () for szarray types.
35614         Remove unused cache check in mono_class_from_type_spec().
35615         * icall.c: *type_from_name () functions handle simple arrays and byref.
35616         * reflection.c: handle byref and szarray types. Handle methods without
35617         body (gets P/Invoke compilation working). Handle types and fields in
35618         get_token ().
35619         * reflection.h: add rank to MonoTypeInfo.
35620
35621 2002-01-10  Dick Porter  <dick@ximian.com>
35622
35623         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
35624         internal calls
35625
35626 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35627
35628         * icall.c: initialize class in type_from_handle ().
35629         Loop also in parent classes for get_method ().
35630         * reflection.c: properly encode class and valuetype types.
35631         Start on encoding TypeBuilder types. Handle fieldrefs.
35632         Use correct length when registering a user string.
35633         Handle ConstructorBuilder and MonoMethod in get_token ().
35634         Make mono_type_get_object () aware of cached types.
35635         * object.c: back out change to mono_string_new ().
35636
35637 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
35638         * object.c: mono_string_new should return a NULL when the string 
35639         passed in is NULL -- not try to deference it.
35640         
35641 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
35642
35643         * icall.c: hack to make IsSubType work for TypeBuilders.
35644         * reflection.c: emit constructors before methods.
35645         Retrieve param names in mono_param_get_objects().
35646
35647 2002/01/05  Nick Drochak  <ndrochak@gol.com>
35648
35649         * Makefile.am: fix list of headers and sources so automake 1.5
35650         doesn't complain. Removed \# at end of list.
35651
35652 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35653
35654         * reflection.c: get token for a method ref. Set return type of
35655         constructor to void.
35656         * loader.c: debug message.
35657         * class.c: typo fix.
35658
35659 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
35660
35661         * icall.c: fix array init with rank > 1. FindMembers
35662         loops in parent class as well.
35663         * image.c: do not insert nested types in name cache.
35664         * reflection.c: warning fix.
35665         * reflection.h: add override method (for interface impl).
35666
35667 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
35668
35669         * metadata.c: fix customattr decoding.
35670
35671 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
35672
35673         * rawbuffer.cs: Added native Win32 implementation, avoids using
35674         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
35675
35676 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
35677
35678         * class.c: make the low-level routines handle the cache.
35679
35680 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
35681
35682         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
35683
35684 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
35685
35686         * class.c: fix mono_array_element_size() for objects.
35687         * class.h, class.c: add properties to MonoClass and load them
35688         at init time.
35689         * icall.c: check with isinst() when assigning a value to an array
35690         instead of requiring the classes to match exactly.
35691         Implemented icall for System.Type::GetType().
35692         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
35693         enums. Handle bindingflags when looking for methods and fields.
35694         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
35695         and mono_metadata_methods_from_property().
35696         * reflection.h, reflection.c: added structures for propreties,
35697         parameters and enums. Implemented mono_property_get_object() and
35698         mono_param_get_objects().
35699
35700 2001-12-18  Dick Porter  <dick@ximian.com>
35701
35702         * file-io.c: Use mono_string_to_utf16() instead of
35703         mono_string_chars()
35704
35705         * object.c: Added mono_string_to_utf16(), which copies the non
35706         NULL-terminated MonoString into a new double-null-terminated
35707         buffer.
35708
35709 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
35710
35711         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
35712
35713 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
35714
35715         * file-io.c: raise exceptions if handle is invalid.
35716
35717 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
35718
35719         * assembly.c: yet another check for mscorlib.
35720         * class.c, class.h: load nesting info for classes.
35721         * icall.c: many new functions to support the Reflection classes.
35722         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
35723         * reflection.h, reflection.c: mono_image_create_token(),
35724         mono_assembly_get_object(), mono_type_get_object(),
35725         mono_method_get_object(), mono_field_get_object(): methods to return
35726         objects that parallel the C representation of assemblies, types,
35727         methods, fields.
35728
35729 2001-12-11  Dick Porter  <dick@ximian.com>
35730
35731         * icall.c:
35732         * file-io.c: Internal calls for file IO.
35733
35734 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
35735
35736         * tabledefs.h: missing FileAttributes.
35737         * verify.h, verify.c: use is_valid_string () to simplify and check for
35738         valid strings more correctly. Fix warnings and speeling.
35739         Check more tables: Filed, File, ModuleRef, StandAloneSig.
35740         Check code: branches, maxstack, method calls.
35741
35742 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
35743
35744         * object.c (mono_object_allocate): removed static, so that the jit
35745         can allocate value types.
35746
35747         * icall.c (ves_icall_System_DateTime_GetNow): impl.
35748
35749 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
35750
35751         * class.c: init enum types right away and register the
35752         token->MonoClass map in mono_class_create_from_typedef ().
35753         * verify.h, verify.c: first cut of the verifier.
35754         * pedump.c: add --verify switch to verify metadata tables.
35755         * tabledefs.h: add some missing enums.
35756
35757 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
35758
35759         * class.c (mono_install_runtime_class_init): impl.
35760         (mono_class_init): renamed mono_class_metadata_init to
35761         mono_class_init, also removed the metadata_inited flag
35762
35763         * object.c (mono_object_isinst): use faster algorithm
35764
35765 2001-11-30  Radek Doulik  <rodo@ximian.com>
35766
35767         * mono-endian.h: reverted last change
35768         added function prototypes
35769
35770         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
35771         add mono-endian.c back
35772
35773         * mono-endian.c: returned back, as Paolo pointed out, it's needed
35774         for unaligned access, I've mistaked it with endianess. I am
35775         sorry.
35776         (mono_read16): fix reverted endianess
35777         (mono_read64): ditto
35778         (mono_read32): ditto
35779
35780 2001-11-30  Dick Porter  <dick@ximian.com>
35781
35782         * exception.c: Implement mono_exception_from_name()
35783
35784 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
35785
35786         * metadata.h, metadata.c: remove params_size and locals_size and their
35787         calculation from the metadata code: they are only usefult to the
35788         interp.
35789
35790 2001-11-29  Radek Doulik  <rodo@ximian.com>
35791
35792         * object.c (mono_ldstr): swap bytes here, it's probably not the
35793         best place, but works for me now, I'll redo it once I know mono
35794         better, also note that I add PROT_WRITE and don't reset back, also
35795         note that it's only affects big endians, so x86 should be OK
35796
35797         * mono-endian.h (read16): use just glib macros for both endians
35798
35799         * mono-endian.c: removed as glib macros are used in in
35800         mono-endian.h so we don't need to care about endianess for read
35801         macros as glib does that for us already
35802
35803 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
35804
35805         * class.h, class.h: take minimum alignment into consideration so
35806         that the fields of a class remain aligned also when in an array.
35807
35808 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
35809
35810         * loader.h, loader.c: add mono_method_get_param_names().
35811         * class.c: 0-init class fields.
35812
35813 2001-11-26  Dick Porter  <dick@ximian.com>
35814
35815         * icall.c:
35816         * threads-types.h:
35817         * threads.c: New file that handles System.Threading on all platforms
35818
35819         * object.c: 
35820         * object.h: Remove the synchronisation struct from MonoObject,
35821         replace it with a pointer that gets initialised on demand
35822
35823         * Makefile.am: Replace all the system-specific threading code with
35824         a single file that uses the new wrapper library
35825
35826 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
35827
35828         * class.c, class.h: add mono_install_trampoline() so that the runtime
35829         can register a function to create a trampoline: removes the ugly
35830         requirement that a runtime needed to export arch_create_jit_trampoline.
35831         * object.h, object.c: added mono_install_handler() so that the runtime
35832         can install an handler for exceptions generated in C code (with
35833         mono_raise_exception()). Added C struct for System.Delegate.
35834         * pedump.c: removed arch_create_jit_trampoline.
35835         * reflection.c: some cleanups to allow registering user strings and
35836         later getting a token for methodrefs and fieldrefs before the assembly
35837         is built.
35838         * row-indexes.h: updates and fixes from the new ECMA specs.
35839
35840 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
35841
35842         * class.h, class.c: add enum_basetype field to MonoClass.
35843         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
35844         to get index in the constant table reated to a field, param or
35845         property.
35846         * reflection.h, reflection.c: handle constructors. Set public-key and
35847         version number of the built assembly to 0.
35848         * row-indexes.h: update from new ECMA spec.
35849
35850 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
35851
35852         * class.h, class.c: add a max_interface_id to MonoClass.
35853         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
35854         since it's used to do that. Added mono_type_type_from_obj().
35855         Make GetType() return NULL instead of segfaulting if the type was not
35856         found. Handle simple arrays in assQualifiedName.
35857         * object.h: add a struct to represent an Exception.
35858         * reflection.c: output call convention in method signature.
35859         Add code to support P/Invoke methods and fixed offsets for fields.
35860
35861 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
35862
35863         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
35864         the value.
35865         * icall.c: use mono_array_addr instead of array->vector: fixes the
35866         reflection image writing.
35867         * reflection.c: init call convention byte to 0 in method signature.
35868         Encode the property signature. Don't output property-related methods
35869         twice. Really process the properties for a type (don't cast a field to
35870         a property, my mom always told me that).
35871         Fix 64 bit issues in pointer alignment in a different and more
35872         readable way.
35873
35874 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
35875
35876         * loader.h: Removed type class from MonoDefaults, added monotype
35877
35878         * loader.c: Loaded MonoType, removed loading of Type
35879
35880         * icall.c (my_mono_new_object): Now returns a System.MonoType,
35881         and fills in System.Type._impl with a RuntimeTypeHandle rather
35882         than the actual MonoClass *
35883
35884         (ves_icall_type_from_handle): change from type_class to
35885         monotype_class
35886
35887         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
35888         implemented
35889
35890         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
35891         implemented
35892
35893         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
35894
35895         (ves_icall_System_Reflection_Assembly_GetType): implemented
35896
35897         (ves_icall_System_MonoType_assQualifiedName): implemented
35898
35899         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
35900
35901 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
35902
35903         * assembly.c (mono_assembly_open): Implement a cache for the
35904         assemblies. 
35905
35906         (mono_assembly_close): only destroy the assembly when the last
35907         reference is gone.
35908         
35909 2001-11-09  Dick Porter  <dick@ximian.com>
35910
35911         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
35912
35913 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
35914
35915         * class.c (mono_class_metadata_init): bug fix: compute the right slot
35916
35917 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
35918
35919         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
35920         from Martin Weindel.
35921         * object.h: add mono_string_chars ().
35922
35923 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
35924
35925         * reflection.c (build_compressed_metadata): Eliminates warnings
35926         and uses 64-bit clean code.
35927
35928         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
35929         (mono_type_equal): Change signature to eliminate warnings.
35930
35931 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
35932
35933         * icall.c, loader.c: remove the internalcall array constructors.
35934         Changes to match the new MonoArray structure.
35935         * object.h, object.c: an array object doesn't allocate an extra
35936         vector. Add mono_array_new_full () to create jagged arrays easily.
35937
35938 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
35939
35940         * metadata.h, metadata.c: add mono_metadata_field_info () to
35941         retreive all the info about a field from vairous tables.
35942         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
35943         * class.h, class.c: augment MonoClassField with more info.
35944         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
35945         policy and load a field's RVA if needed.
35946
35947 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
35948
35949         * class.c (mono_class_metadata_init): create a trampoline for all
35950         virtual functions instead of actually compiling them.
35951
35952 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
35953
35954         * class.h, class.c: include name in MonoClassField.
35955         * class.c: fix fundamental type of System.Object and System.String.
35956         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
35957         tokens in ldtoken.
35958         * icall.c: remove internalcalls for the Reflection stuff that is now
35959         done in C# code.
35960         * loader.c: mono_field_from_memberref () implementation.
35961         * mono-endian.c: thinko (s/struct/union/g).
35962         * object.c, object.h: make the mono_string_* prototypes actually use
35963         MonoString instead of MonoObject.
35964         * reflection.c, reflection.h: updates for changes in the reflection
35965         code in corlib: we use C structures that map to the actual C# classes.
35966         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
35967         fat method header if needed and use the info from the ILGenerator for
35968         methods. Handle fields in types. Misc fixes.
35969
35970 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
35971
35972         * class.c (mono_class_metadata_init): bug fix: always allocate
35973         space for static class data
35974
35975 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
35976
35977         * class.c (mono_compute_relative_numbering): use relative
35978         numbering to support fast runtime type checks.
35979
35980 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
35981
35982         * class.c (mono_class_create_from_typeref): added debugging output
35983         to print class name when MonoDummy is returned instead of real class
35984
35985 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
35986
35987         * class.c (mono_class_metadata_init): interface offset table now
35988         contains pointers into the vtable - this is more efficient for the jit
35989
35990 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
35991
35992         * class.c (mono_class_metadata_init): use a temporary vtable (the
35993         old algorithm only worked for the interpreter, but not for the jit)
35994
35995 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
35996
35997         * loader.c (method_from_memberref): use mono_class_get to get the
35998         class of an array instead of using System.Array directly.
35999         (mono_get_method): also add MEMBERREF methods to the method cache
36000         which usefull for arrays.
36001
36002 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
36003
36004         * pedump.c (arch_compile_method): added to compute vtable entry
36005
36006         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
36007         number of interfaces.
36008         
36009         * class.h: merged MonoArrayClass into MonoClass
36010
36011         * class.c (mono_class_create_from_typedef): compute the vtable size and
36012         allocate space to include the vtable inside MonoClass
36013         (mono_class_metadata_init): initialize the vtable
36014
36015 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
36016
36017         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
36018         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
36019         * image.c: endian fixes by Laurent Rioux.
36020         * object.h, object.c: rename MonoStringObject to MonoString and
36021         MonoArrayObject to MonoArray. Change some function names to conform to
36022         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
36023         guint16* as first argument, so don't use char*.
36024         Provide macros to do the interesting things on arrays in a portable way.
36025         * threads-pthread.c: updates for the API changes and #include <sched.h>
36026         (required for sched_yield()).
36027         * icall.c: updates for the API changes above.
36028         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
36029         platforms that need them.
36030
36031 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36032
36033         * class.c: set the correct type for all the fundamental
36034         type when loading the class.
36035
36036 2001-10-05  Dick Porter  <dick@ximian.com>
36037
36038         * threads-pthread.c (pthread_mutex_timedlock): Simple
36039         compatibility version for C libraries that lack this call.
36040
36041 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36042
36043         * class.c: MonoTypes stored in MonoClass are stored as
36044         fundamental MonoTypes when the class represents a
36045         fundamental type (System.Int32, ...).
36046         The TypeHandle return by ldtoken is a MonoType*.
36047         * icall.c: ves_icall_get_data_chunk () write out all the
36048         PE/COFF stuff. Implement ves_icall_define_method (),
36049         ves_icall_set_method_body (), ves_icall_type_from_handle ().
36050         * image.c: properly skip unknown streams.
36051         * loader.h, loader.c: add type_class to mono_defaults.
36052         * metadata.c, metadata.h: export compute_size () as
36053         mono_metadata_compute_size () with a better interface.
36054         Typo and C&P fixes.
36055         * pedump.c: don't try to print the entry point RVA if there is no entry point.
36056         * reflection.c, reflection.h: many cleanups, fixes, output method
36057         signatures and headers, typedef and typeref info, compress the metadata
36058         tables, output all the heap streams, cli header etc.
36059         * row-indexes.h: typo fixes.
36060
36061 2001-10-04  Dick Porter  <dick@ximian.com>
36062
36063         * object.h: Add a synchronisation mutex struct to MonoObject
36064
36065         * object.c (mono_new_object): Initialise the object
36066         synchronisation mutexes
36067
36068         * icall.c: System.Threading.Monitor internal calls
36069         
36070         * threads-pthread.h:
36071         * threads-pthread.c: System.Threading.Monitor internal calls
36072
36073         * threads-types.h: New file, includes the system-specific thread
36074         structures
36075         
36076         * threads-pthread-types.h:
36077         * threads-pthread-types.c: New files, handle pthread-specific
36078         synchronisation types
36079
36080         * threads-dummy-types.h: 
36081         * threads-dummy-types.c: New files of dummy support for
36082         thread-specific types
36083
36084         * metadata.c:
36085         * image.c:
36086         * pedump.c: include mono-endian.h not endian.h
36087         
36088         * Makefile.am: More threads files.
36089         Name mono-endian.h not endian.h
36090
36091 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
36092
36093         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
36094         stuff and implement a few more bits.
36095         * icall.c: a field needs to be dereferenced twice. Do not use the same
36096         name for two variables in the same scope.
36097         * image.c, image.h: cleanups.
36098
36099 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
36100
36101         * class.c (mono_class_metadata_init): bug fix: compute the right size
36102
36103 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
36104
36105         * icall.c: implemented some of the Reflection internalcalls.
36106         * image.c, image.h: start writing out the PE/COFF image.
36107         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
36108         that does the reverse than decode_blob_size ().
36109         * object.c: use mono_metadata_encode_value (). Move here
36110         temporary implementation of mono_string_to_utf8 ().
36111         * rawbuffer.c: make malloc_map static.
36112
36113 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36114
36115         * metadata.c: fix type comparison for arrays.
36116         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
36117         Added a couple of new classes to monodefaults.
36118         * icall.c: added a couple of Reflection-related internalcalls.
36119         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
36120         Added a byval_arg MonoType to MonoClass.
36121
36122 2001-09-28  Dick Porter  <dick@ximian.com>
36123
36124         * icall.c:
36125         * threads-pthread.h: 
36126         * threads-pthread.c: Implemented internal calls for
36127         LocalDataStoreSlot operations.  Applied mutexes around all shared
36128         data.  Reworked the thread creation and Start() operations to
36129         avoid a race condition.
36130         
36131         * threads-dummy.h:
36132         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
36133
36134 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
36135
36136         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
36137
36138 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
36139
36140         * class.c, loader.c: warn and return NULL instead of erroring out.
36141         * icall.c: added System.AppDomain::getCurDomain().
36142         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
36143
36144 2001-09-25  Dick Porter  <dick@ximian.com>
36145
36146         * threads-pthread.h:
36147         * threads-pthread.c: Implemented timed thread joining and added
36148         System.Threading.Thread::Join_internal internal call
36149
36150         * icall.c: Added System.Threading.Thread::Join_internal internal call
36151
36152         * threads-dummy.h:
36153         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
36154
36155 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
36156
36157         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
36158         mono_string_intern () to implement the semantics of the ldstr opcode
36159         and the interning of System.Strings.
36160         * icall.c: provide hooks to make String::IsIntern and String::Intern
36161         internalcalls.
36162
36163 2001-09-23  Dick Porter  <dick@ximian.com>
36164
36165         * threads-dummy.c: 
36166         * threads-dummy.h: New files of dummy threading routines
36167
36168         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
36169         support code based on system specifics
36170
36171         Rename PTHREAD_LIBS to THREAD_LIBS
36172         
36173 2001-09-23  Dick Porter  <dick@ximian.com>
36174
36175         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
36176         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
36177         internal calls.
36178         (mono_thread_init): Set up a Thread object instance to return when
36179         the main thread calls Thread.CurrentThread
36180         (mono_thread_cleanup): Wait for all subthreads to exit
36181
36182         * icall.c: New internal calls for System.Threading.Thread::Sleep
36183         (including Schedule) and CurrentThread
36184
36185         * threads.h: New file, to insulate thread-specific stuff from the
36186         rest of the code
36187
36188 2001-09-21  Dick Porter  <dick@ximian.com>
36189
36190         * threads-pthread.h: 
36191         * threads-pthread.c: New file, for handling pthreads-style
36192         threading support.  Start() now starts a new thread and executes
36193         the ThreadStart delegate instance.
36194
36195         * icall.c: Added the internalcall for
36196         System.Threading.Thread::Start_internal
36197
36198         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
36199
36200 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
36201
36202         * loader.c: work around the different signatures for delegates
36203         constructors csc generates in compiled code vs the ones compiled in mscorlib.
36204
36205 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36206
36207         * class.h, class.c: add mono_class_get_field_from_name ().
36208         * *: Fix C comments and other ANSI C issues.
36209
36210 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
36211
36212         * endian.h, assembly.c: fix some endianness issues.
36213
36214 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
36215
36216         * loader.h, load.c: add delegate_class to mono_defaults.
36217         Handle runtime provided methods in mono_get_method ().
36218
36219 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
36220
36221         * loader.c (mono_get_method): use pinvoke for internal call
36222
36223         * icall.c: use pinvoke for internal call
36224
36225         * loader.c (method_from_memberref): set the method name
36226
36227 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
36228
36229         * metadata.c: help the compiler generate better code for
36230         mono_class_from_mono_type ().
36231
36232 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
36233
36234         * class.c (mono_class_metadata_init): delayed computing of the
36235         class size to mono_class_metadata_init ()
36236
36237 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
36238
36239         * class.c, class.h: add an interfaces member to MonoClass.
36240         * image.c, image.h: add assembly_name field to MonoImage
36241         from the assembly table.
36242         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
36243
36244 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36245
36246         * class.c: Handle Array in mono_class_from_mono_type ().
36247         * metadata.c, pedump.c: some endian fixes.
36248
36249 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36250
36251         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
36252         * metadata.c: fix small problem introduced with the latest commit.
36253
36254 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
36255
36256         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
36257         We don't need a MonoMetadata pointer anymore to compare signatures in
36258         mono_metadata_signature_equal (), update callers.
36259         Reduced memory usage an number of allocations for MonoMethodHeader and
36260         MonoMethodSignature.
36261
36262 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
36263
36264         * metadata.c: added compare for szarray.
36265
36266 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
36267
36268         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
36269         and add a couple more types to it and mono_defaults. Give an hint on
36270         classes that need implementing in our corlib and are referenced
36271         in mscorlib.
36272
36273 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
36274
36275         * class.h, class.c: keep track if a class is also an Enum.
36276         * loader.c: Implement a couple more types for use in libffi
36277         marshalling. Gives better diagnostics when failing to dlopen
36278         a library. Set method->klass for P/Invoke methods, too.
36279
36280 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
36281
36282         * class.c, class.h: add a MonoType this_arg to MonoClass that
36283         represents a pointer to an object of the class' type that
36284         can be used by the interpreter and later the type cache.
36285         Add best guess alignment info for valuetype objects.
36286
36287 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
36288
36289         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
36290         into MonoType: one less level of indirection and allocation and
36291         simplifies quite a bit of code. Added cache for MonoTypes that are
36292         used frequently, so that we don't need to allocate them all the time.
36293
36294 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
36295
36296         * class.c (mono_class_create_from_typedef): System.Enum is also a
36297         value type, although it does not derive from System.ValueType
36298         (maybe a bug in the ms compiler?)
36299
36300         * metadata.c (mono_type_size): return the right size for value types
36301
36302         * loader.c (mono_get_method): only initialize method header if not abstract
36303
36304         * class.c (mono_class_from_mono_type): use mono_default values. 
36305
36306 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
36307
36308         * *: use MonoClass pointers instead of <type_tokens>
36309         
36310         * class.h: new flag: metadata_inited.
36311
36312         * class.c (mono_class_metadata_init): impl.
36313         (mono_class_instance_size): impl.
36314         (mono_class_data_size): impl.
36315
36316 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36317
36318         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
36319         MonoClass now has the name and name_space fields. 
36320         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
36321         mono_get_method () takes and optional MonoClass as argument.
36322         Removed mono_typedef_from_name() and added mono_class_token_from_name()
36323         instead that takes advantage of a map from class names to typedef
36324         tokens in MonoImage.
36325
36326 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
36327
36328         * metadata.c: zero is not a valid alignment boundary.
36329         Merge MONO_TYPE_VOID in default decoding code.
36330
36331 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
36332
36333         * image.h: merged MonoMetadata into MonoImage
36334
36335         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
36336         identify the type of elements.
36337
36338 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
36339
36340         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
36341         * cil-coff.h: split MonoMSDOSHeader and add size info.
36342         * image.c: add some consistency checks.
36343         * metadata.c: fix row size computation: one programmer
36344         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
36345         add explanation for the locator routine.
36346         Fix decoding of size in method header.
36347         
36348 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
36349
36350         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
36351         (g_concat_dir_and_file): Bring g_concat_dir_and_file
36352         function from gnome-libs.  This uses the right path separator
36353         based on the OS, and also works around a bug in some systems where
36354         a double slash is not allowed. 
36355         (default_assembly_name_resolver): Use g_concat_dir_and_file
36356         (mono_assembly_open): ditto.
36357
36358 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
36359
36360         * metadata.c (mono_metadata_signature_equal): impl.
36361
36362         * *: void is now a realy MonoType (instead of using NULL)
36363         
36364         * metadata.c (do_mono_metadata_parse_type): use
36365         mono_metadata_parse_type to parse void value.
36366
36367 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
36368
36369         * metadata.c, metadata.h: in the signature and method header store
36370         only the space required for holding the loca vars and incoming arguments.
36371
36372 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
36373
36374         * metadata.c (do_mono_metadata_parse_type): treat void like any
36375         other type (instead of assigning NULL);
36376
36377 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
36378
36379         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
36380
36381 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
36382
36383         * image.c (do_mono_image_open): added a cache for arrays.
36384
36385 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36386
36387         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
36388         decode a single column from a row in a metadata table and changes
36389         to take advantage of it in the typedef locator (gives a nice speed up).
36390         Store offset info for function params.
36391
36392 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
36393
36394         * image.h (MONO_IMAGE_IS_CORLIB): removed 
36395
36396 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
36397
36398         * assembly.c: how could mono_assembly_close () had ever worked?
36399         * metadata.c, metadata.h: provide offset info for local vars.
36400         Implement mono_type_size () to take care of alignment as well
36401         as size (it was mono_field_type_size in cli/class.c before).
36402
36403 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
36404
36405         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
36406
36407         * assembly.h (CORLIB_NAME): set to corlib.dll
36408
36409         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
36410
36411 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36412
36413         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
36414         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
36415         tokentype.h: massive namespace cleanup.
36416
36417 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36418
36419         * metadata.h, metadata.c: decode exception clauses when parsing method header.
36420
36421 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
36422
36423         * metadata.c (mono_metadata_free_type): added check for type !=
36424         NULL (void) before calling mono_metadata_free_type()
36425
36426 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
36427
36428         * metadata.h, row_indexes.h: added header with enumerations to use
36429         to index in the columns from tables in metadata and to decode coded
36430         tokens: we should start using this instead of embedding magic numbers
36431         all over the code.
36432
36433 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
36434
36435         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
36436         Move metadata_t info from cli_image_info_t to MonoImage, where
36437         it's easily accessible. Changed all the uses accordingly.
36438         Added the method and class caches to MonoImage.
36439         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
36440         and mono_metadata_decode_value () signature to be more consistent
36441         with the other parse functions (and simplify code). Taken advantage
36442         of zero-length array allocation with GCC. Removed reduntant (and
36443         wrong) MonoFieldType struct and use MonoParam instead. Changed
36444         mono_metadata_parse_field_type () to use common code for parsing.
36445         Added mono_metadata_typedef_from_field () and
36446         mono_metadata_typedef_from_method () to lookup a typedef index from a
36447         field or method token.
36448         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
36449
36450 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
36451
36452         * metadata.c (mono_metadata_parse_field_type): Implement. 
36453         (do_mono_metadata_parse_type): Split engine from
36454         mono_metadata_parse_type, so that we can create smaller structures
36455         for things that just have one pointer to the MonoType (look at
36456         the MonoFieldType)
36457
36458 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
36459
36460         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
36461         as Jan Gray found out, it is incorrect. 
36462
36463 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
36464
36465         * assembly.c: Implement asssembly loading.  This loads an image
36466         and loads all the referenced assemblies.  Come to think of it, we
36467         could always do lazy loading of the assemblies. 
36468
36469         * image.c (mono_image_open): Keep loaded images in a hashtable.
36470
36471         * image.h (MonoImage): Add reference count.
36472
36473 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
36474
36475         * assembly.c (mono_assembly_open): Keep track of the file name in
36476         case the assembly has no ASSEMBLY table.
36477
36478         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
36479         from get.c here.
36480
36481 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
36482
36483         * metadata.c, metadata.h: decode local vars in method header
36484         parse function. Change callers accordingly.
36485
36486 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
36487
36488         * metadata.h, cil-coff.h: protect against multiple inclusion.
36489         Added some new structures to hold information decoded from metadata:
36490         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
36491         and relevant decoding/free functions.
36492         * metadata.c: implement decoding functions. Add warning for out of bounds
36493         index in mono_metadata_locate(). Implement mono_get_method () to retreive
36494         all the info about a method signature and invocation. Remove check on
36495         uninitialized local var in parse_mh() and fix memory leak.
36496
36497 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
36498
36499         * metadata.h: More macros.
36500
36501         * tokentype.h: New file.
36502
36503 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
36504
36505         * assembly.c: added a consistency check and initialize
36506         some structures with g_new0().
36507         * metadata.c: fixed a couple more bugs in table size computation
36508         and add other checks for out-of bound access to metadata.
36509
36510 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
36511
36512         * metatada.c: fix bugs computing table sizes. Spew a
36513         warning when index in string heap is out of bounds.
36514
36515 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
36516
36517         * metadata.h: Add a couple of macros to manipulate tokens. 
36518
36519 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36520
36521         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
36522         cli_section_tables).
36523
36524 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
36525
36526         * metadata.c (mono_metadata_user_string): New function, provides
36527         access to the UserString heap. 
36528
36529 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
36530
36531         * metadata.c: Add inline documentation.
36532
36533 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
36534
36535         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
36536         files. 
36537
36538 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
36539
36540         * typeattr.h: New file, TypeAttribute flags. 
36541
36542 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
36543
36544         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
36545         mono_assembly_ensure_section): Section loading code.
36546         (load_section_tables): Load the sections.
36547
36548         * mono/metadata/metadata.c (mono_metadata_locate_token,
36549         mono_metadata_locate): Functions to locate the information
36550         definition given a token or a table and an index.
36551         (mono_metadata_compute_table_bases): New.
36552         (compute_size): New function to compute the sizes of the various
36553         tables.
36554
36555         * mono/metadata/metadata.h: Finish listing the different index
36556         types. 
36557
36558         * mono/metadata/pedump.c: Improve to dump new information.
36559
36560 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
36561
36562         * mono/metadata/metadata.c: Entered all the tables matching
36563         Beta2. 
36564
36565         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
36566
36567
36568
36569