2010-04-08 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / metadata / ChangeLog
1 2010-04-08  Zoltan Varga  <vargaz@gmail.com>
2
3         * threads.c (mono_thread_suspend_all_other_threads): Call ensure_synch_cs_set ()
4         to avoid crashes on newly created threads.
5
6 2010-04-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
7
8         * file-io.c: reset the MonoIOStat structure in case of error.
9         Fixes bug #582667.
10
11 2010-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
12
13         * class.c (print_implemented_interfaces): Print proper type name.
14
15         * class.c (mono_class_setup_vtable): Don't try that hard to produce
16         the override map for generic instances since it later ignored.
17
18         * class.c (mono_class_implement_interface_slow): Don't break for
19         dynamic generic instances.
20
21         * object.c (mono_runtime_invoke_array): Add an assert for allocation.
22
23         * reflection.c (mono_reflection_method_get_handle): New method that
24         resolves a method handle.
25
26         * reflection.c (mono_reflection_get_dynamic_overrides): Handle the
27         case when we override methods from a dynamic generic instance interface.
28
29         Fixes #575941.
30
31 2010-04-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
32
33         * threadpool.c: don't attempt to close the pipe when it has not been
34         created.
35
36 2010-04-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
37
38         * threadpool.c: if there are no waiting threads, try to start a new
39         one. This fixes the not-so-random hangs in System.ServiceModel tests.
40         No need to use InterlockedCompareExchange to read volatile variables.
41
42 2010-04-05 Rodrigo Kumpera  <rkumpera@novell.com>
43
44         * verify.c (verify_type_compatibility_full): Fail mixed valuetype
45         and reference types that point to the same class.
46
47         Fixes #565598.
48
49 2010-04-05 Rodrigo Kumpera  <rkumpera@novell.com>
50
51         * verify.c (verify_stack_type_compatibility_full): Ignore constraints
52         when verifying compatibility between a generic instance and a generic
53         parameter.
54
55         * verify.c (check_is_valid_type_for_field_ops): Improve error message.
56
57         * verify.c (stack_slot_stack_type_full_name): Improve verification type
58         name.
59
60         Fixes #587849.
61
62 2010-04-04  Mark Probst  <mark.probst@gmail.com>
63
64         * sgen-gc.c: Remove superfluous scanning of alloc-pinned objects.
65
66 2010-04-04  Zoltan Varga  <vargaz@gmail.com>
67
68         * threads.c Applied some openbsd changes from Robert Nagy <robert@openbsd.org>.
69
70 2010-04-03  Marek Habersack  <mhabersack@novell.com>
71
72         * process.c: when cross-compiling with MinGW, force GetProcessId
73         lookup using GetProcAddress.
74
75 2010-04-02  Mark Probst  <mark.probst@gmail.com>
76
77         * sgen-gc.c: parse_environment_string_extract_number() must be
78         static.
79
80 2010-04-02  Mark Probst  <mark.probst@gmail.com>
81
82         * sgen-gc.c, sgen-gray.c: Macros for gray_object_enqueue() and
83         gray_object_dequeue(), to make sure they're inlined.
84
85 2010-04-02  Mark Probst  <mark.probst@gmail.com>
86
87         * sgen-gc.c, sgen-gray.c: Fix a few debug levels, put a few
88         asserts in inner loops into DEBUG and lower MAX_DEBUG_LEVEL.
89
90 2010-04-02  Jb Evain  <jbevain@novell.com>
91
92         * exception.c: remove dead code.
93
94 2010-04-02  Zoltan Varga  <vargaz@gmail.com>
95
96         * *-gc.c: Fix the signature of mono_gc_get_used/heap_size () to be consistent
97         with mono-gc.h.
98
99 2010-04-01  Sanjoy Das <sanjoy@playingwithpointers.com>
100
101         * sgen-gc.c: Make the nursery size adjustable by the
102         MONO_GC_PARAMS environment variable.
103
104         Code is contributed under MIT/X11 license.
105
106 2010-04-01 Gonzalo Paniagua Javier <gonzalo@novell.com>
107
108         * threadpool.c: threadpool threads wait is alertable.
109         Fixes bug #592964.
110         Reduced the stack size of the *poll_wait thread.
111
112 2010-04-01  Sebastien Pouliot  <sebastien@ximian.com>
113
114         * exception.c|metadata-internals.h: Add new mono_get_exception_
115         field_access_msg and mono_get_exception_method_access_msg 
116         functions that accept a const char* parameter to provide more 
117         details when the exception is thrown.
118         * security-core-clr.c|h: Rework code to allow logging exceptions
119         (export MONO_LOG_MASK="security") and to supply more details in
120         [TypeLoad|MethodAccess|FieldAccess]Exception thrown. Also added
121         mono_security_core_clr_is_field_access_allowed and 
122         mono_security_core_clr_is_call_allowed to return an exception,
123         with messages and logging, that can be emitted by method-to-ir.c
124
125 2010-04-01  Mark Probst  <mark.probst@gmail.com>
126
127         * sgen-gc.c, sgen-pinning-stats.c: In the heap-dump, dump each
128         pinned object.
129
130 2010-04-01  Zoltan Varga  <vargaz@gmail.com>
131
132         * appdomain.c (mono_domain_assembly_postload_search): Avoid a crash/assert if
133         the assembly name is not well formed utf8. Fixes #567882.
134
135 2010-04-01  Zoltan Varga  <vargaz@gmail.com>
136
137         * reflection.c (mono_reflection_create_generic_class): Set the flags field of
138         the generic parameters from the builder. Fixes #473298.
139
140 2010-03-31  Miguel de Icaza  <miguel@novell.com>
141
142         * object.c (mono_class_proxy_vtable): Eliminate warning. 
143
144         * marshal.c (emit_marshal_boolean): Eliminate possible
145         uninitialized local warning. 
146
147 2010-03-30  Sebastien Pouliot  <sebastien@ximian.com>
148
149         * class.c (mono_class_init): Postpone coreclr inheritance check
150         until the end of the initialization (so we can check up the 
151         default ctor manually for the core-clr inheritance rules).
152         * security-core-clr.c: Add the missing (undocumented) checks on
153         default constructors when verifying inheritance rules.
154
155 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
156
157         * domain-internals.h (MonoJitExceptionInfo): Add new field
158         handler_end to the data union. To be used to point the end
159         of a finally block.
160
161 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
162
163         * reflection.c: Add support for new v4 type
164         System.Reflection.MonoModule that is the concrete version
165         of Module which is abstract unver v4.
166
167 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
168
169         * class.c (mono_class_init): Don't set class failure after
170         inited = 1 is set. It must be done before.
171
172 2010-03-30  Andreas Färber  <andreas.faerber@web.de>
173
174         * mono-config.c: Add support for OS "haiku"
175         * ChangeLog: Fix UTF-8 encoding
176
177         Code is contributed under MIT/X11 license.
178
179 Tue Mar 30 15:53:06 CEST 2010 Paolo Molaro <lupus@ximian.com>
180
181         * console-unix.c: fixed include logic for sys/ioctl.h.
182
183 2010-03-30  Mark Probst  <mark.probst@gmail.com>
184
185         * threads.c: Fix bitmap generation for TLS marking on 64 bit
186         systems.
187
188 2010-03-30  Zoltan Varga  <vargaz@gmail.com>
189
190         * icall.c (ves_icall_System_Enum_get_underlying_type): Don't crash on
191         unfinished/broken typebuilders.
192
193 2010-03-29  Mark Probst  <mark.probst@gmail.com>
194
195         * sgen-gc.c: Use the same heuristic for the LOS target that we use
196         for the minor section allowance.
197
198 2010-03-29  Raja R Harinath  <harinath@hurrynot.org>
199
200         * metadata-verify.c (INVALID_METHOD_IMPLFLAG_BITS): Allow bit 6
201         "NoOptimization".
202
203 2010-03-29  Mark Probst  <mark.probst@gmail.com>
204
205         * sgen-gc.c: Count bytes allocated with heavy statistics.
206
207 2010-03-29  Mark Probst  <mark.probst@gmail.com>
208
209         * sgen-gc.c: More detailed time statistics.
210
211 Mon Mar 29 11:52:34 CEST 2010 Paolo Molaro <lupus@ximian.com>
212
213         * gc-internal.h, sgen-gc.c, threads.c, utils/mono-hash.c:
214         fix the user defined mark interface to pass a pointer
215         to the object location and not the object itself.
216
217 2010-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
218
219         * reflection.c (mono_method_body_get_object): Release
220         the method header before the call to CACHE_OBJECT since
221         this is a macro that returns.
222
223 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
224
225         * class.c (inflate_generic_type): mono_metadata_type_dup
226         already dupes array information, the g_memdup was just
227         leaking memory.
228
229 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
230
231         * verify.c: Add stack_peek function. Fix CEE_DUP
232         to not read from invalid memory if push did expand
233         the stack.
234
235 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
236
237         * verify.c: Remove old table verification code that has
238         been superseeded by the new metadata verifier.
239
240         * verify.h: Remove mono_image_verify_tables from the public
241         API.
242
243         * pedump.c: Fix for removed bits.
244
245 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
246
247         * verify.c: Allocate stack slows lazily to reduce stack usage
248         in case of methods with huge stacks. Reduces memory consumption
249         for mcs yyparse from 459Mb to 1.8Mb.
250
251 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
252
253         * threadpool.c: don't try executing items from domains being
254         unloaded. Fixes appdomain-async-invoke test.
255
256 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
257
258         * threadpool.c: spin while the threadpool initializes.
259         * mono-wsq.c: if the WSQ has not been initialized or has been shut
260         down, don't do anything.
261
262 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
263
264         * threads.c (mono_thread_create_internal): Set the GC type of the
265         threads_starting_up hash table.
266
267 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
268
269         * threadpool.c: reset 'state' to avoid returning non-null when the
270         event type is not found.
271
272 Fri Mar 26 19:03:09 CET 2010 Paolo Molaro <lupus@ximian.com>
273
274         * sgen-gc.c: make copy_object () take the address of the
275         slot holding the reference. This allows saving memory stores
276         when not needed and it allows keeping track of oldspace->nursery
277         references for the card table code.
278
279 2010-03-26  Andreas Färber  <andreas.faerber@web.de>
280
281         * null-gc.c (mono_gc_invoke_with_gc_lock): Fix function name.
282
283         Code is contributed under MIT/X11 license.
284
285 Fri Mar 26 11:33:17 CET 2010 Paolo Molaro <lupus@ximian.com>
286
287         * object.c, threads.c, threads-types.h, threads.h: make the
288         managed thread local storage references precisely tracked.
289
290 2010-03-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
291
292         * threadpool.[ch]: reworked the threadpool:
293                 -Threadpool threads use a work-stealing queue. Adding a work
294                 item from a threadpool thread will queue it in the thread
295                 local queue without locking (in most cases).
296                 -epoll events are coalesced before being added to the IO
297                 queue.
298                 -Dynamically change the number of active threads
299                 -Changed the global queue to be more GC friendly
300
301         * class-internals.h: add 2 new performance counters for the number of
302         threads in the threadpool and the IO threadpool.
303
304         * object-internals.h: new field in MonoAsyncResult.
305         * icall-def.h: new internal call for queueing work items.
306
307         * Makefile.am: add 2 new files.
308
309         * appdomain.c: bump up corlib version.
310
311         * mono-wsq.[ch]: an implementation of a work-stealing queue.
312
313         * mono-perfcounters-def.h:
314         * mono-perfcounters.c: added 2 new performance counters.
315
316 2010-03-26  Mark Probst  <mark.probst@gmail.com>
317
318         * sgen-gc.c: More FIXME/TODO updates.
319
320 2010-03-25  Mark Probst  <mark.probst@gmail.com>
321
322         * gc-internal.h, sgen-gc.c, sgen-gc.h, boehm-gc.c, null-gc.c: New
323         function mono_gc_invoke_with_gc_lock() which invokes a function
324         with the guarantee that no collection will occur during its execution.
325
326 2010-03-25  Mark Probst  <mark.probst@gmail.com>
327
328         * sgen-gc.c: Update a few comments.
329
330 2010-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
331
332         * reflection.c: Add support for new v4 type
333         System.Reflection.MonoAssembly that is the concrete version
334         of Assembly which is abstract unver v4.
335
336 2010-03-24  U-anarquia\miguel  <miguel@anarquia>
337
338         * reflection.c (mono_reflection_get_custom_attrs_info): Protect
339         code that uses System.Reflection.Emit in DISABLE_REFLECTION_EMIT.
340
341         Expose a few macros that are needed for SR but not SRE to the
342         world (previous inside the SRE ifdef)
343
344 2010-03-24  Mark Probst  <mark.probst@gmail.com>
345
346         * sgen-gc.c (gc_register_current_thread): We need
347         stack_start_limit as well in the non-attribute pthread case.
348
349 2010-03-23 Rodrigo Kumpera  <rkumpera@novell.com>
350
351         * threads.c: Fix windows build.
352
353 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
354
355         * thread-types.h: Add mono_thread_resume_interruption.
356
357         * threads.c: Add mono_thread_resume_interruption, this
358         function should be called after the last protected handler
359         found at interruption time has finished.
360
361 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
362
363         * threads.c (ves_icall_System_Threading_Thread_ResetAbort):
364         Check MonoInternalThread's ::state instead of ::abort_exc
365         since the later can be lazily created.
366
367         This is specially problematic when running a finally block
368         under AbortRequested state. ResetAbort must work, but the
369         abort_exc object has not been created because interruption
370         has not began.
371
372 2010-03-22  Geoff Norton  <gnorton@novell.com>
373
374         * locales.c: Its possible for CFStringGetCStringPtr
375         to return null and not convert encodings.  Use
376         CFStringGetCString instead.
377
378 Mon Mar 22 18:06:38 CET 2010 Paolo Molaro <lupus@ximian.com>
379
380         * class-internals.h, class.c, object.c: introduce compressed
381         interface bitmaps (for now only under small config): this saves
382         about 600 KB of runtime memory on gmcs bootstraps or monodevelop
383         startups.
384
385 Mon Mar 22 16:03:34 CET 2010 Paolo Molaro <lupus@ximian.com>
386
387         * mono-debug.c: don't try to get the method header, it causes a
388         deadlock and it is not used for anything anymore.
389
390 2010-03-22  Zoltan Varga  <vargaz@gmail.com>
391
392         * loader.c (mono_method_get_marshal_info): Fix the handling of dynamic methods
393         broken by the last change.
394
395 2010-03-21  Andreas Färber  <andreas.faerber@web.de>
396
397         * socket-io.c: Don't depend on AF_SNA, AF_DECnet,
398         SOCK_RDM.
399         
400         Code is contributed under MIT/X11 license.
401
402 2010-03-20  Sanjoy Das <sanjoy@playingwithpointers.com>
403
404         * sgen-gc.c (mono_gc_get_write_barrier): Handle non-aligned
405         nursery.
406
407         Code is contributed under MIT/X11 license.
408
409 2010-03-19  Martin Baulig  <martin@ximian.com>
410
411         * mono-debug.c (MonoDebugWrapperData): Replace `cil_code' with a
412         dummy field, containing an empty string.
413         (mono_debug_add_method): Don't call mono_disasm_code() for wrappers.
414
415
416 Fri Mar 19 17:26:43 CET 2010 Paolo Molaro <lupus@ximian.com>
417
418         * class.c: setup_interface_offsets() refactor to not call
419         mono_class_get_implemented_interfaces () more times than needed and
420         to reduce the runtime memory requirements to be O(num_interfaces)
421         instead of O(max_interface_id).
422
423 2010-03-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
424
425         * mono-mlist.[ch]: add mono_mlist_set_next ().
426
427 2010-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
428
429         * domain-internals.h: Add MonoTryBlockHoleJitInfo struct and
430         associated changes to support holes in the protected range of a
431         try block.
432
433         * domain.c: Add mono_jit_info_get_try_block_hole_table_info, which
434         retrieves the holes table from a given MonoJitInfo.
435
436 Tue Mar 16 13:11:15 CET 2010 Paolo Molaro <lupus@ximian.com>
437
438         * object.h, object-internals.h, object.c, icall.c, gc-internal.h,
439         debug-helpers.c, cominterop.c, process.c, sgen-gc.c, socket-io.c:
440         hide the contents of the MonoString and MonoArray structs from the
441         public API. Change the accessor macros to accessors functions where
442         needed. Adjusted the array API to allow for pointer-sized lengths and
443         starting positions, so 64 bit arrays can be optionally provided in an
444         API compatible way if needed on 64 bit systems.
445
446 Tue Mar 16 10:18:07 CET 2010 Paolo Molaro <lupus@ximian.com>
447
448         * class-internals.h, class.c, loader.c, marshal.c, metadata.c,
449         reflection.c: the MonoMethodNormal struct is now unused, so remove it.
450
451 Mon Mar 15 18:28:00 CET 2010 Paolo Molaro <lupus@ximian.com>
452
453         * class-internals.h: remove the method header from MonoMethod since
454         from now on it will be transient. We have a header pointer for method
455         wrappers, since in that case we need to keep track of it. For this
456         reason, all the Reflection.Emit generated methods use MonoMethodWrapper
457         structs now. The same happens with MonoMethodInflated.
458         * class.c: reset the sre_method flag for inflated method structures:
459         this makes the code that cares look at the header in the MonoMethodInflated
460         structure.
461         * loader.c: lookup the method header in the appropriate field now that
462         it is removed from MonoMethod.
463         * metadata-internals.h: add a flag to the method header to know if it
464         can be freed inside mono_metadata_free_mh ().
465         * method-builder.c: updates after moving the header field from
466         MonoMethod to MonoMethodWrapper.
467         * reflection.c: MonoMethods generated from Reflection.Emit use
468         MonoMethodWrapper structs if they need a method header now (later take
469         advantage of this and remove all the current unsafe uses of method_aux_hash).
470         * metadata.c: make method header parsing not leak when verification
471         fails. Alloc it with g_malloc() and free it in mono_metadata_free_mh().
472         These changes save a few hundred KB of runtime memory in a mcs
473         bootstrap or a monodevelop startup.
474
475 2010-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
476
477         * verify.c: Improve error message.
478
479 2010-03-12  Jb Evain  <jbevain@novell.com>
480
481         * reflection.c (add_exported_type): populate the exported
482         table with the type's nested type.
483
484 2010-03-10  Mark Probst  <mark.probst@gmail.com>
485
486         * sgen-gc.c (STRING_SIZE): Semi-revert r153342.  I'm an idiot who
487         can't read parentheses.
488
489 2010-03-10  Mark Probst  <mark.probst@gmail.com>
490
491         * threads.c (thread_cleanup): Add a guard to dereferencing
492         "thread" to avoid an unlikely race condition.
493
494 2010-03-09  Sebastien Pouliot  <sebastien@ximian.com>
495
496         * assembly.c: Fix crash in moon-unit when aname->culture is NULL
497         instead of an empty string.
498
499 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
500
501         * object-internals.h (_G_BOOLEAN_EXPR): Fix the definition of this to explicitly
502         convert to a boolean, recent gcc versions compile this differently.
503
504 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
505
506        * sgen-gc.c (safe_object_get_size): Avoid a function call so this can really be
507        inlined.
508
509 2010-03-09  Mark Probst  <mark.probst@gmail.com>
510
511         * sgen-gc.c (STRING_SIZE): Off by one.
512
513 2010-03-09  Mark Probst  <mark.probst@gmail.com>
514
515         * sgen-archdep.h: Fix the signal context register access for
516         AMD64.
517
518 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
519
520         * sgen-gray.c: Get rid of the unused 'start' field in GrayQueueSection.
521
522 2010-03-08  Rodrigo Kumpera  <rkumpera@novell.com>
523
524         * verify.c: Store the initial basic block returned by mono_basic_block_split
525         so we can release the whole list and not just the first one.
526
527 Mon Mar 8 17:30:44 CET 2010 Paolo Molaro <lupus@ximian.com>
528
529         * verify.c, debug-helpers.c, profiler.c, loader.c,
530         mono-basic-block.c, mono-debug.c, reflection.c: prepare to make
531         MonoMethodHeader a transient entity.
532
533 2010-03-08  Zoltan Varga  <vargaz@gmail.com>
534
535         * sgen-gc.c (scan_needed_big_objects): Call drain_gray_stack () to avoid
536         uncontrolled growth of the gray stack.
537
538         * sgen-gray.c: Rewrite this so it behaves like a stack, not a queue, so recently
539         added items are removed first, improving cache locality. Avoid freeing queue
540         segments in the fast path, use the list of segments as the free list, truncate
541         it to its max size at the start of collection.
542
543 Mon Mar 8 10:13:52 CET 2010 Paolo Molaro <lupus@ximian.com>
544
545         * metadata-internals.h: more memory savings, both with small config and without.
546
547
548 Sat Mar 6 19:12:12 CET 2010 Paolo Molaro <lupus@ximian.com>
549
550         * appdomain.c, domain-internals.h, domain.c, object.c:
551         make class_vtable_hash into an array to reduce memory usage.
552
553 Sat Mar 6 18:16:35 CET 2010 Paolo Molaro <lupus@ximian.com>
554
555         * mempool.c, class-internals.h, class.c, icall.c, metadata.c,
556         object-internals.h, object.c, reflection.c, threadpool.c:
557         reduce resource usage when the small config is selected.
558         In particular, up to 64K of methods/fields/properties/events
559         are allowed and "other" methods in events are ignored.
560
561 Fri Mar 5 19:05:47 CET 2010 Paolo Molaro <lupus@ximian.com>
562
563         * threads.c: reduce resource usage when compiled for a small config.
564
565 2010-03-05  Mark Probst  <mark.probst@gmail.com>
566
567         * sgen-gc.c: Also collect number of degraded-alloced objects with
568         heavy statistics.
569
570 2010-03-04  Geoff Norton  <gnorton@novell.com>
571
572         * assembly.c: Only support OSX bundling if the bundle is 
573         actually detectable.
574
575 2010-03-04  Geoff Norton  <gnorton@novell.com>
576
577         * loader.c: The marshal specs are freed at the end of the call
578         but it explicitly frees the strings as well as the container,
579         so we need to dup them too to avoid referencing free'd memory.
580
581 2010-03-04  Geoff Norton  <gnorton@novell.com>
582
583         * icall-def.h:
584         * icall.c: Add a new private internal icall to construct
585         an object from its type without running the ctor.
586
587 Thu Mar 4 15:37:09 CET 2010 Paolo Molaro <lupus@ximian.com>
588
589         * profiler.c: allow multiple profiler engines to be loaded
590         at the same time.
591
592 Wed Mar 3 20:19:45 CET 2010 Paolo Molaro <lupus@ximian.com>
593
594         * profiler-private.h, profiler.c, profiler.h, sgen-gc.c: introduce
595         profiler event to track object moves.
596
597 Wed Mar 3 19:20:39 CET 2010 Paolo Molaro <lupus@ximian.com>
598
599         * object.c, profiler.c, profiler.h, string-icalls.c:
600         remove the reduntant MONO_PROFILE_STRING_ALLOC profiler event.
601
602 2010-03-03  Miguel de Icaza  <miguel@novell.com>
603
604         * decimal.c (mono_double2decimal): Add support for reducing the
605         scale of a decimal.  It turns the 0.6000000000000 into 0.6 as
606         expected.
607
608 2010-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
609
610         * icall-def.h:
611         * icall.c: Implement System.MonoType::get_core_clr_security_level icall.
612
613 2010-03-03  Marek Habersack  <mhabersack@novell.com>
614
615         * mono-config.c (mono_config_parse_assembly_bindings): added -
616         parses assembly binding redirections from appdomain's config
617         file.
618
619         * metadata-internals.h: added definition of a new function -
620         mono_config_parse_assembly_bindings - to support parsing assembly
621         binding redirections defined in appdomain's config file.
622
623         * domain-internals.h: added two new fields to _MonoDomain - a list
624         of assembly bindings and a flag to parse the config file only
625         once.
626
627         * assembly.c (assembly_binding_maps_name): empty culture name and
628         NULL culture name are considered equal.
629         (mono_assembly_apply_binding): added support for domain specific
630         assembly binding redirections, read from the appdomain's
631         configuration file. Fixes bug #580185
632
633 Wed Mar 3 11:46:06 CET 2010 Paolo Molaro <lupus@ximian.com>
634
635         * appdomain.c, domain.c, icall.c, image.c, marshal.c, object.c,
636         reflection.c, socket-io.c, threadpool.c, threads.c: removed 1.1/1.0
637         support.
638
639 2010-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
640
641         * reflection.c (mono_image_get_memberref_token): Extract mono_image_add_memberef_row
642         from this function. The new function receive the parent token instead of a type.
643
644         * reflection.c (mono_image_get_methodref_token_for_methodbuilder):
645         * reflection.c (mono_image_get_ctorbuilder_token): Use new function to encode
646         typebuilders. This make it possible to properly encode generic type builders since
647         their unmanaged type don't have generics data while unfinished.
648
649         Fixes #583655.
650
651 2010-03-02  Mark Probst  <mark.probst@gmail.com>
652
653         * sgen-gc.c, sgen-protocol.c, sgen-protocol.h: New facility for
654         writing binary log files (can be enabled by #define'ing
655         BINARY_PROTOCOL) for better debugging of timing-dependent bugs or
656         bugs in longer running programs.
657
658 Mon Mar 1 19:35:32 CET 2010 Paolo Molaro <lupus@ximian.com>
659
660         * metadata.c: added some API documentation.
661
662 2010-03-01  Robert Jordan  <robertj@gmx.net>
663
664         * filewatcher.h: Include glib.h to fix the MSVC build.
665
666 2010-03-01  Zoltan Varga  <vargaz@gmail.com>
667
668         * class-internals.h (MonoClass): Get rid of the reflection_info field, add
669         a GC handle instead. This is a bit slower to access, but avoids burdening the
670         GC with 100s of individual roots.
671
672         * reflection.c (mono_class_get_ref_info):
673         (mono_class_set_ref_info):
674         (mono_class_free_ref_info): New internal helper fuctions.
675
676         * reflection.c appdomain.c icall.c class.c: Use the new helper functions instead
677         of accessing klass->reflection_info directly.
678
679         * sgen-gc.c (alloc_complex_descriptor): Fix the computation of the number of
680         words.
681
682         * gc.c (alloc_handle): Create a GC descriptor for the 'entries' array, free
683         the previous array.
684
685 2010-02-28  Zoltan Varga  <vargaz@gmail.com>
686
687         * marshal.c (get_runtime_invoke_type): Avoid sharing byref with I, as the latter
688         needs an indirection.
689
690 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
691
692         * generic-sharing.c: Removed, moved its contents to mini/mini-generic-sharing.c,
693         so all generic sharing code is in one place.
694
695         * class.c (get_implicit_generic_array_interfaces): Fix the last change so
696         we don't call setup_interface_offsets () for unfinished types.
697
698 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
699
700         * class.c (mono_class_generic_sharing_enabled): Move this to
701         generic-sharing.c.
702
703         * image.c: Add an unload hook which is called before an image is unloaded.
704
705         * generic-sharing.c: Use the unload hook to unregister per-image data, to avoid
706         metadata.c having to depend on generic sharing.
707
708 Fri Feb 26 19:23:18 CET 2010 Paolo Molaro <lupus@ximian.com>
709
710         * class.c: reduce size of ridiculously large cache.
711
712 2010-02-26  Martin Baulig  <martin@ximian.com>
713
714         * mono-debug.h
715         (MONO_DEBUGGER_MINOR_VERSION): Bump to 5.
716
717         * threads.c (mono_thread_internal_reset_abort): New method; resets
718         the abort, but doesn't throw any exception if no abort was requested.
719
720 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
721
722         * class.c (get_implicit_generic_array_interfaces): Call
723         mono_class_setup_interface_offsets () before accessing
724         eclass->interface_offsets_count. This only shows up on platforms without IMT for
725         some reason.
726
727 Thu Feb 25 12:12:44 CET 2010 Paolo Molaro <lupus@ximian.com>
728
729         * environment.c, environment.h, icall.c: make the GetOSVersionString()
730         icall internal.
731
732 Thu Feb 25 11:37:50 CET 2010 Paolo Molaro <lupus@ximian.com>
733
734         * metadata.c, metadata.h: make MONO_TYPE_IS* functional without
735         direct access to the MonoType fields.
736
737 2010-02-25  Zoltan Varga  <vargaz@gmail.com>
738
739         * threads.h: Move some internal functions which were added to this header by
740         mistake to threads-types.h.
741
742         * class.c (mono_class_init): Get rid of mono_setup_vtable_in_class_init.
743
744 Wed Feb 24 17:45:27 CET 2010 Paolo Molaro <lupus@ximian.com>
745
746         * class-internals.h, class.h, object.h: make MonoRemoteClass
747         and mono_remote_class() internal.
748
749 Wed Feb 24 17:05:18 CET 2010 Paolo Molaro <lupus@ximian.com>
750
751         * metadata-internals.h, class-internals.h, metadata.h: make the
752         MonoType guts internal as well.
753
754 Wed Feb 24 16:02:42 CET 2010 Paolo Molaro <lupus@ximian.com>
755
756         * reflection.h: the MonoTypeNameParse guts are internal now.
757         * assembly.c, assembly.h, image.h: the MonoAssemblyName guts
758         are internal now, provide accessors as needed.
759         * metadata.h, metadata-internals.h: the MonoMethodSignature
760         guts are internal now.
761         * Makefile.am: mempool.h is an internal header now.
762         * *.h, *.c: remove glib.h usage from the public headers.
763
764 2010-02-24  Atsushi Enomoto  <atsushi@ximian.com>
765
766         * culture-info-table.h : regenerated.
767
768 2010-02-22  Rodrigo Kumpera  <rkumpera@novell.com>
769
770         * metadata.c: Add mono_method_get_header_summary which returns minimal
771         information about the header of a method. This is the information used
772         by the inline oracle to reject methods.
773
774         This method doesn't decode local variables and doesn't cache it's result,
775         so it should cause a minimal reduction in memory usage.
776
777         * metadata-internals.h: Add MonoMethodHeaderSummary structure and
778         mono_method_get_header_summary.
779
780 2010-02-22  Jeffrey Stedfast  <fejj@novell.com>
781
782         * threads.c (mono_thread_exit): Make sure that the main thread is
783         non-null before dereferencing it.
784
785 2010-02-21  Geoff Norton  <gnorton@novell.com>
786
787         * Makefile.am: Add CoreFoundation linkage on darwin to properly get the current
788         locale.
789         * locaes.c: When running on darwin, try to get the local from CoreFoundation 
790         before falling back to the posix lookup.
791
792 2010-02-19  Zoltan Varga  <vargaz@gmail.com>
793
794         * threads.c (mono_thread_suspend_all_other_threads): Ignore threads which have
795         the DONT_MANAGE flag set.
796
797 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
798
799         * domain.c: Remove old v1 version strings. Let the runtime
800         default to 2.0 instead of failing because it can't find a
801         working 1.0 instalation.
802
803 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
804
805         * domain.c: Add v4 RC version string.
806
807 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
808
809         * mono-basic-block.c (mono_opcode_value_and_size): Use pointer variant
810         of overflow checking function.
811
812 2010-02-18  Rodrigo Kumpera  <rkumpera@novell.com>
813
814         * reflection.c (mono_reflection_method_on_tb_inst_get_handle): Handle non
815         generic methods.
816
817         * reflection.c (mono_reflection_get_custom_attrs_info): Handle compiler context
818         cases for ParameterInfo.
819
820         Fixes #579493.
821
822 2010-02-18  Zoltan Varga  <vargaz@gmail.com>
823
824         * class.c (mono_class_get_cctor): Fix support for dynamic classes, which doesn't
825         have has_cctor set. Fixes #575946.
826
827 2010-02-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
828
829         * appdomain.c: display a warning if the parsing the config file
830         produces any error.
831         Skip the BOM in UTF-8 files.
832         Copy the AppDomainSetup before setting the privateBinPath so that the
833         correct configuration file is read.
834
835 2010-02-15  Zoltan Varga  <vargaz@gmail.com>
836
837         * object.c: Instead of using one vtable trampoline, allow the JIT to use one
838         vtable trampoline per vtable slot index. Not used yet.
839
840 2010-02-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
841
842         * icall-def.h:
843         * icall.c: add internal call that returns the system page size.
844
845 2010-02-13  Zoltan Varga  <vargaz@gmail.com>
846
847         * debug-helpers.c (mono_method_desc_search_in_image): Handle short names like
848         'int' for system classes.
849
850 Fri Feb 12 18:36:02 CET 2010 Paolo Molaro <lupus@ximian.com>
851
852         * icall.c, icall-def.h: new icall to check for sufficient
853         stack space.
854
855 2010-02-12  Mark Probst  <mark.probst@gmail.com>
856
857         * reflection.c (ensure_complete_type): Check that reflection_info
858         is set, too.  Fixes crash of corlib testsuite with -O=-all.
859
860 2010-02-11  Rodrigo Kumpera  <rkumpera@novell.com>
861
862         * attrdefs.h:
863         * tabledefs.h: Add NoOptimization flag.
864
865 2010-02-10  Mark Probst  <mark.probst@gmail.com>
866
867         * sgen-gc.c: Don't consider it a missing remset if the target
868         object is pinned - we might have done the store but not added the
869         remset yet.
870
871 2010-02-10  Mark Probst  <mark.probst@gmail.com>
872
873         * sgen-gc.c: When checking for missing remsets, don't assert on
874         the first one, but print them all and then assert.
875
876 2010-02-10  Mark Probst  <mark.probst@gmail.com>
877
878         * sgen-gc.c (find_in_remset_loc): Handle the small bitmap case.
879
880 2010-02-09  Miguel de Icaza  <miguel@novell.com>
881
882         * console-unix.c: On OSX Control-Y is assigned to
883         VDSUSP (non-Posix), the
884         suspend-program-next-time-it-tries-to-read-input command (this is
885         different than C-z, which suspends immediately).
886
887         Do the same thing that bash does and ignore this setting,
888         making our repl/getline support pasting.
889
890 2010-02-10  Mark Probst  <mark.probst@gmail.com>
891
892         * sgen-gc.c: Simple plausibility check for scan_starts.
893
894 2010-02-10  Mark Probst  <mark.probst@gmail.com>
895
896         * sgen-gc.c: Round up when calculating the number of scan starts.
897
898 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
899
900         * reflection.c: Export mono_get_object_from_blob.
901
902         * object-internals.h: Ditto.
903
904         * icall.c: New icall property_info_get_default_value to get the default
905         value of a property. Since using this is not common, no caching is done.
906
907         * icall-def.h: Add new icall.
908
909 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
910
911         * class.c: Add mono_class_get_property_default_value.
912
913         * class-internal.h: Export mono_class_get_property_default_value.
914
915 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
916
917         * reflection.c (mono_image_get_property_info): Encode the default value of a property.
918
919 Wed Feb 10 14:48:45 CET 2010 Paolo Molaro <lupus@ximian.com>
920
921         * sgen-gc.c: introduced critical regions to allow some lockless
922         operations and increase scalability.
923
924 2010-02-10  Geoff Norton  <gnorton@novell.com>
925
926         * reflection.c: Support building with DISABLE_REFLECTION
927
928 2010-02-09 Gonzalo Paniagua Javier <gonzalo@novell.com>
929
930         * threadpool.c: Fixes for SetMinThreads and SetMaxThreads.
931         Closes bug #566057.
932
933         * exception.c: fix typo in comment.
934
935 2010-02-09  Rodrigo Kumpera  <rkumpera@novell.com>
936
937         * icall.c (param_info_get_type_modifiers): Handle the case when the member object is a
938         property. This happens which instances returned by PropertyInfo::GetIndexParameters ().
939
940         * reflection.c (mono_reflection_get_custom_attrs_info): Ditto.
941
942         * object-internals.h: Export mono_class_is_reflection_method_or_constructor as part of
943         the internal API.
944
945         Fixes #574434.
946
947 2010-02-09  Mark Probst  <mark.probst@gmail.com>
948
949         * threads.c: Removed two assertions that were too strict.  Added a
950         clarifying comment.  Fixes #577090.
951
952 2010-02-08  Zoltan Varga  <vargaz@gmail.com>
953
954         * domain.c (mono_jit_info_table_find): Avoid looking in the root domain, since
955         the caller has no way of knowing the domain which owns the returned MonoJitInfo.
956
957         * appdomain.c (create_exceptions): Call mono_thread_push/popappdomain_ref ().
958
959         * verify.c (mono_type_get_stack_name): Fix a warning.
960
961 2010-02-07  Zoltan Varga  <vargaz@gmail.com>
962
963         * marshal.c (mono_marshal_get_wrapper_info): Rename from
964         mono_marshal_wrapper_info_from_wrapper.
965
966         * marshal.c (mono_marshal_set_wrapper_info): Rename from
967         mono_marshal_method_set_wrapper_data, and export.
968
969         * boehm-gc.c sgen-gc.c null-gc.c: Get rid of mono_gc_get_allocator_type, store
970         the allocator type in a AllocatorWrapperInfo structure instead, which is accesible
971         by calling mono_marshal_get_wrapper_info ().
972
973         * sgen-gc.c (mono_gc_get_managed_allocator): Add a specialized allocator for
974         small objects which does no size checks.
975
976 2010-02-05  Rodrigo Kumpera  <rkumpera@novell.com>
977
978         * icall-def.h: Rename get_MetadataToken to GetMetadataToken.
979
980 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
981
982         * verify.c (mono_method_verify): Use the new basic block formation pass
983         to avoid verifying dead basic blocks. This is the same behavior as the
984         runtime MS verifier.
985
986 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
987
988         * mono-basic-block.c:
989         * mono-basic-block.h: New implementation of a basic block formation pass.
990         The formation pass does static liveness analysis as well to detect dead
991         basic blocks.
992
993 2010-02-04  Zoltan Varga  <vargaz@gmail.com>
994
995         * marshal.c (mono_marshal_get_native_wrapper): Emit a null check for the
996         'this' argument in icalls.
997
998 2010-02-02  Zoltan Varga  <vargaz@gmail.com>
999
1000         * reflection.c (resolve_object): Handle MonoArrayMethod. Fixes #575955.
1001
1002 2010-02-01  Mark Probst  <mark.probst@gmail.com>
1003
1004         * object.c, domain.c: When using SGen, we must register
1005         vtable->type as a root if it's not a MonoType, because then it
1006         wasn't pin-alloced.
1007
1008 2010-02-01  Mark Probst  <mark.probst@gmail.com>
1009
1010         * sgen-gc.c: Reset to_space_bumper to to_space_section->next_data
1011         at the start of nursery collections, because we might have had
1012         degraded allocations which changed next_data.
1013
1014 2010-01-30  Zoltan Varga  <vargaz@gmail.com>
1015
1016         * marshal.c (mono_marshal_get_managed_wrapper): Avoid constructing the
1017         custom attr so this function works in cross-compiling mode.
1018
1019 2010-01-29  Zoltan Varga  <vargaz@gmail.com>
1020
1021         * class.c (make_generic_param_class): Initialize interface offsets since we
1022         set klass->inited. Fixes #574819.
1023
1024 2010-01-28  Zoltan Varga  <vargaz@gmail.com>
1025
1026         * domain.c (mono_domain_free): Send the END_UNLOAD profiler event before
1027         calling the JIT domain cleanup hook.
1028
1029 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
1030
1031         * pedump.c (main): Properly set the verifier mode when running the metadata
1032         verifier.
1033
1034 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
1035
1036         * verify.c (verify_class_for_overlapping_reference_fields): Properly verify
1037         overlapping fields now that we're called before has_references is set.
1038
1039         * pedump.c (dump_verify_info): Clear any loader error before verifying another
1040         method. Otherwise all sort of weird stuff happens.
1041
1042 2010-01-27  Zoltan Varga  <vargaz@gmail.com>
1043
1044         * object.c (mono_field_get_value_object): Handle nullable types correctly.
1045         Fixes #572874.
1046
1047 2010-01-25  Zoltan Varga  <vargaz@gmail.com>
1048
1049         * icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
1050         Fixes #573322.
1051
1052 2010-01-23  Mark Probst  <mark.probst@gmail.com>
1053
1054         * sgen-pinning.c (evacuate_pin_staging_area): Don't assume
1055         pin_staging_area_index is greater than 0.
1056
1057 2010-01-22 Miguel de Icaza (miguel@novell.com)
1058
1059         * loader.c: Since we do nothing with the error returned, pass NULL
1060         to ignore the error.
1061
1062 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1063
1064         * reflection.c (typebuilder_setup_fields): Pretend field setup already
1065         happened before starting to encode the actual fields. This avoid ciclic
1066         dependencies and eventual crashes.
1067
1068         Fixes #572660.
1069
1070 2010-01-21  Mark Probst  <mark.probst@gmail.com>
1071
1072         * sgen-gc.c, gc-internal.h, object.c: Make string allocation
1073         atomic and remove the half-constructed hack in SGen.
1074
1075 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1076
1077         * metadata-verify.c (parse_generic_inst): Fail a type signature if it 
1078         has a recursive reference to itself.
1079
1080         Fixes #571863.
1081
1082 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1083
1084         * loader.c (mono_method_signature): Fix error message.
1085
1086 2010-01-21  Mark Probst  <mark.probst@gmail.com>
1087
1088         * sgen-gc.c: Reuse to-space sections between nursery collections.
1089
1090 2010-01-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1091
1092         * icall.c: don't raise AppDomain.TypeResolve when the type is loaded
1093         from the current assembly or mscorlib. Fixes bug #322957.
1094
1095 2010-01-20  Zoltan Varga  <vargaz@gmail.com>
1096
1097         * marshal.c: Calculate the target class of the delegete invoke wrappers using
1098         get_wrapper_target_class.
1099
1100 2010-01-19  Mark Probst  <mark.probst@gmail.com>
1101
1102         * sgen-gc.c: Fix warnings.
1103
1104 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1105
1106         * verify.c (store_local): Better error message.
1107
1108 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1109
1110         * object.c (mono_object_get_virtual_method): Handle generic interfaces with variant
1111         arguments.
1112
1113 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1114
1115         * icall.c (ves_icall_Remoting_RemotingServices_GetVirtualMethod): This
1116         function is generics variance aware.
1117
1118 2010-01-19  Sebastien Pouliot  <sebastien@ximian.com>
1119
1120         * security-core-clr.c (mono_security_core_clr_can_access_internals):
1121         Handle the case where 'basedir' can be NULL (e.g. SRE assemblies)
1122
1123 2010-01-19  Sylvain Dupont <duposyl@gmail.com>
1124
1125         * cominterop.c marshal.c: Added support for marshalling in, in/byref,
1126           in/out, in/out/byref parameters of type SAFEARRAY[VARIANT].
1127
1128         Code is contributed under MIT/X11 license.
1129
1130 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1131
1132         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Handle inflated generic methods
1133         on a GTD.
1134
1135 2010-01-19  Zoltan Varga  <vargaz@gmail.com>
1136
1137         * marshal.c (mono_marshal_wrapper_info_from_wrapper): New helper function to
1138         return a point to a wrapper specific info structure describing the wrapper.
1139         (mono_marshal_get_array_address): Store the rank+elem_size in the wrapper info.
1140  
1141 2010-01-18  Mark Probst  <mark.probst@gmail.com>
1142  
1143         * sgen-gc.c: Make minor collection section allowance adaptive,
1144         depending on the amount of memory reclaimed in the last major
1145         collection.  If more memory was reclaimed (i.e. more garbage
1146         produced), do the next collection earlier.
1147
1148 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
1149
1150         * metadata-verify.c (parse_type): Fail a type signature if it has a recursive reference
1151         to itself.
1152
1153         * metadata-verify.c (mono_verifier_verify_typespec_signature): Change signature to take
1154         the token as parameter.
1155
1156         * verify-internals.h: Ditto.
1157
1158         * metadata.c (mono_type_create_from_typespec): Pass token to verifier.
1159
1160         Fixes #571460.
1161
1162 2010-01-18  Mark Probst  <mark.probst@gmail.com>
1163
1164         * sgen-gc.c: Make store_remset_buffer_index long.
1165
1166 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
1167
1168         * class.c (mono_class_from_typeref): Fail loading of self-referencing typeref tokens.
1169
1170         Fixes #569579.
1171
1172 2010-01-18  Zoltan Varga  <vargaz@gmail.com>
1173
1174         * sgen-gc.c (mono_gc_base_init): Add 'conservative_stack_mark' option to turn
1175         off precise marking if it is available.
1176         (mono_gc_get_bitmap_for_descr): Fix the handling of run length descriptors.
1177
1178 2010-01-17  Zoltan Varga  <vargaz@gmail.com>
1179
1180         * sgen-gc.c (mono_gc_conservatively_scan_area): Resurrect this.
1181
1182         * sgen-pinning.c (evacuate_pin_staging_area): Don't assert if there are no
1183         pinned objects.
1184
1185         * sgen-gc.c (create_allocator): Add the missing n > MONO_ARRAY_MAX_INDEX check
1186         to the array allocator.
1187
1188 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
1189
1190         * generic-sharing.c (instantiate_other_info): Don't create ftnptr's from the
1191         result of mono_compile_method (), it already includes an ftnptr.
1192
1193 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
1194
1195         * metadata.c (get_image_set): Remove an assert which can happen in normal use.
1196
1197 2010-01-15  Zoltan Varga  <vargaz@gmail.com>
1198
1199         * metadata.c (mono_metadata_str_hash): New helper function to compute a stable
1200         hash value which doesn't depend on glib/eglib versions.
1201         (mono_metadata_type_hash): Use it.
1202
1203         * object.c (mono_method_get_imt_slot): Ditto.
1204
1205 2010-01-14  Rodrigo Kumpera  <rkumpera@novell.com>
1206
1207         * class.c (mono_type_has_exceptions): Check the generic instance. It can fail
1208         independently of the GTD.
1209
1210         * class.c (mono_class_setup_fields): Fail if field has negative offset.
1211
1212         * class.c (mono_class_setup_fields): Fail if valuetype has zero size. Add sizeof(MonoObject)
1213         to the upper limit since instance_size includes this amount.
1214
1215         * class.c (mono_class_layout_fields): Check if the types of the static fields have failed.
1216
1217         Fixes #569544.
1218
1219 2010-01-14  Zoltan Varga  <vargaz@gmail.com>
1220
1221         * object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
1222         with static methods.
1223
1224         * object.c (build_imt_slots): Avoid asserting when static methods are
1225         encountered in an interface.
1226
1227 2010-01-13  Mark Probst  <mark.probst@gmail.com>
1228
1229         * sgen-gc.c (to_space_expand): Fix assertion.
1230
1231 Wed Jan 13 15:42:28 CET 2010 Paolo Molaro <lupus@ximian.com>
1232
1233         * string-icalls.c: missing declaration fixes.
1234         * sgen-gc.c: portability fixes.
1235
1236 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
1237
1238         * class.c (mono_class_get_implemented_interfaces): Now take a MonoError argument.
1239
1240         * class.c:
1241         * cominterop.c:
1242         * icall.c:
1243         * object.c: 
1244         * class-internals.h: Adjust for new signature of mono_class_get_implemented_interfaces.
1245
1246 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
1247
1248         * class.c (mono_class_setup_interfaces): Now take a MonoError argument and
1249         it can fail loading the type.
1250
1251         * class.c: Add mono_class_inflate_generic_class_checked.
1252
1253         * class.c:
1254         * verify.c:
1255         * class-internals.h: Adjust for new signature of mono_class_setup_interfaces.
1256
1257 2010-01-11  Zoltan Varga  <vargaz@gmail.com>
1258
1259         * loader.c (mono_method_signature_checked): New internal function taking an
1260         MonoError argument.
1261
1262         * socket-io.c (AI_ADDRCONFIG): Applied patch from John Lightsey (jd@cpanel.net).
1263         Fixes build on rh 7.3.
1264
1265 2010-01-10  Aaron Bockover  <abockover@novell.com>
1266
1267         * assembly.c (mono_set_rootdir): Support finding the mono paths on OS X
1268         at runtime in the same way as on Windows, which yields a relocatable
1269         Mono. Uses dyld's _NSGetExecutablePath and realpath to resolve the path
1270         of the running mono process.
1271
1272         On TARGET_ARM, fallback () will always be executed.
1273
1274 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1275
1276         * icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.
1277
1278 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1279
1280         * class.c (mono_class_is_assignable_from_slow): Support variant
1281         generic delegates.
1282
1283         * class.c (mono_class_implement_interface_slow): Support types with
1284         variant generic arguments.
1285
1286 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1287
1288         * verify.c: Remove some code duplication.
1289
1290 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1291
1292         * object.c: Update docs.
1293
1294 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1295
1296         * object.c (add_imt_builder_entry): Improve DEBUG_IMT spew.
1297
1298         * object.c (build_imt_slots): Interfaces with variant generic arguments use the
1299         fallback trampoline as well.
1300
1301         * class.c (mono_class_interface_offset_with_variance): Add new non_exact_match
1302         out argument that is set to TRUE if the match was direct. 
1303
1304         * class.c (mono_class_is_assignable_from): Delegates require variance testing as well.
1305
1306         * class-internal.h: Update prototype of mono_class_interface_offset_with_variance.
1307
1308 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1309
1310         * class.c: Add mono_class_interface_offset_with_variance function that does same
1311         as mono_class_interface_offset but takes variance into account.
1312
1313         * class-internal.h: Export mono_class_interface_offset_with_variance.
1314
1315         * object.c: Fix and improve DEBUG_IMT. Added an assert for IMT thunk building.
1316
1317 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1318
1319         * object.c:
1320         * icall.c:
1321         * class.c: Add some FIXME for due to variant generic arguments.
1322
1323         object.c (mono_object_isinst_mbyref): Interfaces with variant generic arguments
1324         can't use the simple bitfield check, so call mono_class_is_assignable_from if
1325         the bitfield check fails.
1326
1327 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1328
1329         * class.c (mono_class_is_assignable_from): Rework the generics variance code
1330         to be easier to read and fix bugs in the case a non generic type implements a variant
1331         interface.
1332
1333         * class.c (mono_class_has_variant_generic_params): Make non static.
1334
1335         * class-internals.h: Export mono_class_has_variant_generic_params as part of
1336         the private API.
1337
1338 2010-01-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1339
1340         * assembly.c: fix MONO_PATH debug output.
1341
1342 2010-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1343
1344         * culture-info-table.h : regenerated.
1345
1346 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1347
1348         * verify.c (mono_verifier_verify_class): Properly check for broken parent. Ignore
1349         types that are meant to not have a parent.
1350
1351 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1352
1353         * marshal.c (mono_marshal_get_runtime_invoke): Make a copy of the signature
1354         from the image mempool, so it is not leaked.
1355
1356 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1357
1358         * metadata-internals.h (_MonoImage): Remove unused generic_class_cache field.
1359
1360 2010-01-04  Sebastien Pouliot  <sebastien@ximian.com>
1361
1362         * verify.c (verify_valuetype_layout_with_target): Fix case
1363         that can lead to infinite recursion. Fix bug #567861
1364
1365 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1366
1367         * pedump.c: Run code verifier even if image verification fails
1368         due to a failed type we. This allows more errors to be shown.
1369
1370 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1371
1372         * class.c (count_virtual_methods): Remove the assert and now
1373         fail properly.
1374         
1375         * class.c (setup_interface_offsets): This can fail now.
1376
1377         * class.c (mono_class_setup_vtable_general): Check for parent vtable
1378         errors. Check setup_interface_offsets errors.
1379
1380         * class.c (setup_interface_offsets): Simplify the return error logic
1381         and remove class_init_ok.
1382
1383         Fixes #560327.
1384
1385 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1386
1387         * class.c (mono_class_init): Do class verification at the beginning. Add
1388         some asserts to avoid tripping into invalid memory.
1389
1390         * object.c (compute_class_bitmap): Replace a g_assert_not_reached with a
1391         g_error and a decent message.
1392
1393         * verify.c (mono_verifier_verify_class): Verify for invalid super type.
1394
1395         Fixes #567548.
1396
1397 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1398
1399         * mempool-internals.h (g_list_prepend_mempool): Define this and related functions
1400         as inline functions instead of defining them in mempool.c.
1401
1402         * metadata-internals.h (MonoImageSet): New structure representing a set of
1403         MonoImages, which own a collection of generic instances.
1404
1405         * metadata.c: Get rid of the global generic caches, instead assign each generic
1406         instance to the image set which consists of all the images referenced by the
1407         instance. This greatly speeds up mono_metadata_clean_for_image (), and allows
1408         the memory used by generic instances to be allocated from a per image-set mempool
1409         later.
1410
1411 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1412
1413         * marshal.c (mono_marshal_get_runtime_invoke): Fix a memory leak.
1414
1415 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1416
1417         * appdomain.c (zero_static_data): Fix a warning.
1418
1419         * locales.c (construct_culture_from_specific_name): Applied patch from
1420         JosĂ© Antonio Sánchez Lázaro <jasl@darcysoft.es>. Fix a crash if a culture was
1421         not found. Fixes #567900.
1422
1423 2009-12-31  Sebastien Pouliot  <sebastien@ximian.com>
1424
1425         * loader.c (mono_method_get_signature_full): Remove two asserts.
1426         Return NULL instead so that the verifier can handle both cases 
1427         gracefully.
1428
1429 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1430
1431         * class.c (mono_class_setup_methods): Use checked version of mono_class_inflate_generic_method_full
1432         so we can properly fail types instead of crashing.
1433
1434         Fixes #567676.
1435
1436 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1437
1438         * reflection.c (reflection_methodbuilder_to_mono_method): Assert in case of a broken
1439         generic method.
1440
1441 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1442
1443         * marshal.c (mono_mb_emit_restore_result): Properly handle generic enums.
1444
1445 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1446
1447         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait): Don't close the
1448         wait handle if the wait is interrupted, since it is still in mon->wait_list, and
1449         we can't remove it from it since we don't hold the lock.
1450         (mon_new): Free the orphaned events here when a mon structure is added to the
1451         freelist. Fixes #561239. Thanks to Mike Rieker <wmrieker@nii.net> for tracking
1452         this down.
1453
1454 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1455
1456         * verify.c (init_stack_with_value_at_exception_boundary): Do stack overflow checking here
1457         as max stack might be zero.
1458
1459         Fixes #562320.
1460
1461 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1462
1463         Rework all uses of mono_class_setup_methods to accept that it can fail now.
1464
1465         * class.c (mono_class_setup_methods): This function now can fail the class. Do so for generic
1466         instances if the GTD did.
1467
1468         * class.c (mono_class_setup_properties): Ditto.
1469
1470         * class.c (mono_class_setup_events): Ditto.
1471
1472         * class.c (mono_class_setup_vtable): Fail early if the type is already broken.
1473
1474         * class.c (mono_class_setup_vtable_general): Add a few more missing broken type checks. Sanitize
1475         error setting.
1476
1477         * class.c (mono_class_init): Fail if GTD did.
1478
1479         * cominterop.c:
1480         * generic-sharing.c:
1481         * icall.c:
1482         * loader.c:
1483         * object.c:
1484         * verify.c: Properly handle failure of mono_class_setup_methods.
1485
1486 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1487
1488         * class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
1489         mono_class_inflate_generic_method_full internal.
1490
1491         * class.c (inflate_generic_context): Now takes a MonoError argument.
1492
1493         * class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
1494         errors.
1495
1496 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1497
1498         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
1499         they cannot be patched. Partly fixes #564408.
1500
1501 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1502
1503         * metadata-internals.h, reflection.c: Use the
1504         MonoDynamicImage.handleref hash table only with unmanaged keys,
1505         and add a managed hash table handleref_managed for managed keys.
1506
1507 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1508
1509         * sgen-gc.c: Unset to-space bumper between collections.  It might
1510         become invalid due to degraded allocations.
1511
1512 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
1513
1514         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
1515         with the one from the original method.
1516
1517         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
1518         compatibility.
1519
1520         * verify-internals.h: Add new function to the internal API.
1521
1522 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
1523
1524         * culture-info-tables.h: regenerated it to include the Georgian culture.
1525
1526 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1527
1528         * sgen-gc.c: Include mono/utils/memcheck.h.
1529
1530         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
1531         instead of the current domain, since the two might not match if this is called
1532         from the debugger.
1533
1534         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
1535         domain which created this assembly.
1536
1537 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1538
1539         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
1540
1541 2009-12-17  Mark Probst  <mark.probst@gmail.com>
1542
1543         * sgen-gc.c: Managed implementation of the specialized generic
1544         store write barrier.
1545
1546 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
1547
1548         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
1549         A private virtual newslot method is used to implement an interface method without exposing
1550         it to users. When querying for public instance methods, such method would hide a public one
1551         on a parent type.
1552
1553         Fixes #564379.
1554
1555 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
1556
1557         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
1558         conventions.
1559
1560 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1561
1562         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
1563
1564 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1565
1566         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
1567         as they are no longer used.
1568         
1569          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
1570
1571         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
1572
1573 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1574
1575         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
1576         if the owner class has not been finished before returning reflection_info.      
1577
1578         Fixes #565127.
1579
1580 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
1581
1582         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
1583         param doesn't have custom attributes. Fixes #565117.
1584
1585         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
1586         #565120.
1587
1588 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1589
1590         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
1591
1592 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1593
1594         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
1595         same amount done by a core-clr enabled runtime.
1596
1597 2009-12-15  Marek Habersack  <mhabersack@novell.com>
1598
1599         * appdomain.c (mono_make_shadow_copy): make sure access mode of
1600         the target files is reset to writable by owner and readable by
1601         everyone else to prevent problems when updating shadow copies of
1602         files whose source is read-only. Fixes bug #556884
1603
1604 2009-12-15  Mark Probst  <mark.probst@gmail.com>
1605
1606         * class.c (mono_generic_class_get_class): Allocate the generic
1607         class via malloc again, so that it can be freed when any one of
1608         the images of its constituent types is closed.
1609
1610         * metadata.c: When closing an image, don't free generic insts and
1611         generic classes right away, but put them into a list for later
1612         freeing.
1613
1614         * image.c, metadata-internals.h: Store the free list and in the
1615         second pass of closing an image, free it.
1616
1617 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1618
1619         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
1620
1621         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
1622         types in type_hash.
1623
1624         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
1625
1626 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1627
1628         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
1629         user type.
1630
1631         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
1632         is used.
1633
1634 2009-12-14  Miguel de Icaza  <miguel@novell.com>
1635
1636         * verify.c (mono_method_verify): The Unused opcodes produce an
1637         InvalidProgramException on .NET
1638
1639 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
1640
1641         * loader.c (mono_method_get_header): Move assert after the verifier
1642         has been called on the method header.
1643
1644 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1645
1646         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
1647
1648         * appdomain.c: Bump corlib version.
1649
1650 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1651
1652         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
1653         types as well since otherwise generic instances would not return UT as arguments but
1654         their undelying system type.
1655
1656         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
1657         to reflect the fact that they can have now multiple different types.
1658
1659         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
1660
1661         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
1662
1663         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
1664
1665         * reflection.c (mono_reflection_register_with_runtime): Init super types
1666         if the image is not dynamic.
1667
1668         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
1669         check if the generic type definition is a TypeBuilder.
1670
1671         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
1672         doesn't belong to a dynamic image, skip initialization.
1673
1674         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
1675         base definition is not a dynamic type.
1676
1677 2009-12-11  Marek Habersack  <mhabersack@novell.com>
1678
1679         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
1680         mono_profiler_string_allocation
1681
1682         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
1683         if string profiling is enabled, call
1684         mono_profiler_string_allocation
1685
1686         * profiler.h: added two MonoProfileFlags -
1687         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
1688         installation functions for the hooks below.
1689
1690         * profiler-private.h, profiler.c: added two hooks:
1691         mono_profiler_string_allocation called whenever a string is
1692         allocated by InternalAllocateStr and mono_profiler_iomap called
1693         whenever IOMAP code performs an adjustement on a file path.
1694
1695 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
1696
1697         * boehm-gc.c: fixed race condition while getting the target of a
1698         disappearing link (bug #522233).
1699
1700 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1701
1702         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
1703         the error.
1704
1705 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1706
1707         * reflection.c: Add mono_reflection_register_with_runtime icall to
1708         allow a MonoGenericClass to register itself as the managed mirror of
1709         a given generic instance.
1710         This is a temporary workaround until all MGC instantiation happens in
1711         managed code.
1712
1713         * object-internals.h: Ditto.
1714
1715         * icall-def.h: Ditto.
1716
1717 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1718
1719         * sgen-gc.c (find_in_remsets): Also search the generic store
1720         remsets.
1721
1722 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1723
1724         * sgen-gc.c: Don't access class names in debugging code when
1725         unloading a domain, because they might not be valid anymore.
1726
1727 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1728
1729         * domain.c, domain-internals.h: New function mono_domain_unset().
1730
1731         * appdomain.c (unload_thread_main): Detach the thread again at the
1732         end.
1733
1734         * threads.c: When a thread exists or is detached, unset its domain
1735         so that it's NULL when, for example, a pthread destructor runs.
1736
1737         * sgen-gc.c: Assert that there is no domain set after a thread is
1738         done.
1739
1740 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1741
1742         * class.c (mono_generic_class_get_class),
1743         metadata.c (free_generic_class): Allocate generic MonoClass's from
1744         the image mempool, not via malloc.  The problem with malloc is
1745         that when unloading a domain those classes are freed before
1746         clearing the heap and SGen needs the classes.  Rewriting the
1747         unloading code to do the free later would be more work and there's
1748         no point in using malloc anyway.
1749
1750 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
1751
1752         * loader.c (mono_method_signature): Always call mono_loader_unlock 
1753         before returning.
1754
1755 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1756
1757         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
1758         user string blobs.
1759
1760         * verify-internals.h: Add new function to the internal API.
1761
1762         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
1763         check if it's a valid string.
1764
1765         * object.c (mono_ldstr): Ditto.
1766
1767         Fixes #561943.
1768
1769 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1770
1771         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
1772         from a method before returning it. This is the expected behavior.
1773
1774 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
1775
1776         * reflection.c (inflate_method): Handle the case of a regular system type.
1777
1778 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1779
1780         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
1781         gathering code.
1782
1783         * mempool.c, mempool-internals.h: New function
1784         mono_mempool_get_bytes_allocated().
1785
1786         * Makefile.am: sgen-pinning-stats.c added.
1787
1788 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1789
1790         * sgen-gc.c (create_allocator): Only use the fast path if the
1791         object size is within the small object size limit.
1792
1793 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1794
1795         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
1796         possibly adding padding to sizeof (GCMemSection).
1797
1798 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1799
1800         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
1801         reference is not in the nursery.
1802
1803 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
1804
1805         * class.c (mono_class_from_typeref): Bounds check idx against the 
1806         assemblyref table.
1807
1808 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1809
1810         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
1811         through the potential roots, then sort the results and find the
1812         pinned objects from there.
1813
1814         * Makefile.am: sgen-pinning.c added.
1815
1816 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1817
1818         * sgen-gc.c: Record generic stores in specialized remset buffers.
1819
1820 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1821
1822         * sgen-gc.c: Make pinned chunks the same size as major heap
1823         sections, and align them as well, so that we can check whether an
1824         object is in a pinned chunk or a major section in constant time.
1825
1826 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1827
1828         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
1829
1830 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1831
1832         * sgen-gc.c: Make all major heap sections the same size (currently
1833         128k) and allocate them on aligned addresses.  Small heap sections
1834         give us better granularity with pinned objects - we can free up
1835         much more memory.
1836
1837 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1838
1839         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
1840         output removed.
1841
1842 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1843
1844         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
1845
1846         * mono/metadata/assembly.c: When opening an assembly image, pass the real
1847         names in addition to the runtime generated one.
1848
1849         * mono/metadata/image.h: Add a function to take the real name of the assembly
1850         image.
1851
1852         * mono/metadata/image.c: If a real name has been passed to load an assembly,
1853         use it instead of the runtime generated one.
1854
1855         Code is contributed under MIT/X11 license.
1856
1857 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1858
1859         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
1860         before the other checks to prevent problems if the DateTime class is blittable.
1861         Hopefully fixes #559600.
1862
1863 2009-12-05  Mark Probst  <mark.probst@gmail.com>
1864
1865         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
1866         returns the largest string length that will not be put into the
1867         LOS.
1868
1869         * sgen-gc.c, gc-internal.h: New function that returns the largest
1870         object size that will not be put into the LOS.
1871
1872         * appdomain.c: Bump corlib version.
1873
1874 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1875
1876         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1877
1878         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1879
1880 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1881
1882         * reflection.c (inflate_method): Fix signature.
1883
1884         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
1885         in managed code.
1886
1887 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1888
1889         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
1890
1891 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1892
1893         * sgen-gc.c: Abstract to-space handling.
1894
1895 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
1896
1897         * loader.c (find_method_in_class): Ignore methods with broken signatures.
1898
1899         Fixes #559906.
1900
1901 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1902
1903         * sgen-gc.c: Only add references from outside the nursery to
1904         within the nursery to the global remset list.
1905
1906 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1907
1908         * appdomain.c (create_exceptions): Set the domain temporarily if
1909         necessary to avoid cross-domain references.
1910
1911 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1912
1913         * verify.c (get_stack_type): Return that the type is invalid instead of
1914         asserting.
1915
1916         * verify.c (mono_method_verify): Verify that all locals and arguments
1917         have valid stack types.
1918
1919         Fixes #559913.
1920
1921 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1922
1923         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
1924         bounds checking overflow aware.
1925
1926         Fixes #559910.
1927
1928 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1929
1930         * verify.c (do_invoke_method): Check for invalid method signatures.
1931
1932         Fixes #553450.
1933
1934 2009-12-02  Jb Evain  <jbevain@novell.com>
1935
1936         * appdomain.c (MONO_CORLIB_VERSION): bump.
1937         * icall-def.h (get_base_definition): renamed to get_base_method
1938         and add a boolean argument indicating we want the original
1939         method definition, or the immediate base method.
1940         * icall.c: apply the get_base_definition to get_base_method change.
1941
1942 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1943
1944         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
1945
1946         Fixes #558042.
1947
1948 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
1949
1950         * class.c: remove asserts for invalid type token in
1951         mono_class_name_from_token(), mono_assembly_name_from_token() and
1952         mono_class_create_from_typedef () (fixes bug #553318).
1953
1954 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
1955
1956         * metadata.c, class.c, loader.c: remove assert after bsearch() for
1957         incorrect assemblies (bug #553322).
1958
1959 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1960
1961         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
1962
1963         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
1964
1965         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
1966
1967         * class.c (inflate_generic_context): Ditto.
1968
1969         * loader.c (method_from_methodspec): Ditto.
1970
1971         Fixes #558230.
1972
1973 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1974
1975         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
1976
1977         * class.c (mono_class_create_from_typespec): Ditto.
1978
1979         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
1980
1981         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
1982
1983         Fixes #558184.
1984
1985 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1986
1987         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
1988
1989         * verify.c (verify_delegate_compatibility): Ditto.
1990
1991         * verify.c (do_newobj): Ditto.
1992
1993         Fixes #558046.
1994
1995 2009-12-02  Mark Probst  <mark.probst@gmail.com>
1996
1997         * sgen-gc.c: Use a gray queue instead of requiring that gray
1998         objects are in a contiguous region.
1999
2000         * sgen-gray.c: The gray queue implementation.
2001
2002         * Makefile.am: sgen-gray.c added.
2003
2004 2009-12-02  Mark Probst  <mark.probst@gmail.com>
2005
2006         * appdomain.c: When unloading a domain, zero its static data and
2007         perform a minor collection when using SGen.  That will get rid of
2008         all the remsets pointing into that domain's static data.
2009
2010         * sgen-gc.c: Allow remsets into static data.  By doing this we
2011         need less checks so we're more efficient.
2012
2013 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2014
2015         * verify.c (mono_method_verify): Check for catch clauses with broken
2016         types.
2017
2018         Fixes #558465.
2019
2020 2009-12-01  Jb Evain  <jbevain@novell.com>
2021
2022         * class.c (make_generic_param_class): set the namespace of
2023         the generic parameter class from its owner, if available.
2024
2025 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2026
2027         * verify.c (code_bounds_check): Do proper overflow checking.
2028
2029         * verify.c (mono_method_verify): The number of switch entries is
2030         an unsigned int. Properly bounds check it.
2031
2032         Fixes #558594.
2033
2034 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2035
2036         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
2037         mono_metadata_method_has_param_attrs which only checks if a given param
2038         list has a non zero flags entry.
2039
2040         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
2041         to inform how many params should we expect to decode.
2042
2043         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
2044         as it's faster than mono_metadata_get_param_attrs.
2045
2046         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
2047         add mono_metadata_method_has_param_attrs.
2048
2049 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2050
2051         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
2052         failures.
2053
2054         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
2055         is -1 but its class is broken.
2056
2057         Fixes #558522.
2058
2059 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2060
2061         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
2062         for parameter overflow.
2063
2064         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
2065         of mono_metadata_get_param_attrs.
2066
2067         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
2068         API.
2069
2070         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
2071
2072 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2073
2074         * class.c (mono_class_setup_fields): Check for fields with broken types.
2075
2076         Fixes #558741.
2077
2078 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
2079
2080         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
2081         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
2082         its TypeBuilder::CreateType ().
2083
2084         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
2085         if not needed.
2086
2087         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
2088         to make setup_interface_offsets happy.
2089
2090         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
2091         compilation now works.
2092
2093 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
2094
2095         * appdomain.c (create_exceptions): New helper function extracted from
2096         mono_runtime_init () to precreate objects used during exception handling.
2097         (mono_runtime_init): Call it.
2098         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
2099
2100 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
2101
2102         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
2103         compilation until the proper one is found.
2104
2105 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
2106
2107         * class.c (mono_class_setup_vtable_general): Cache the result of
2108         get_virtual_methods () since it can be slow because of the metadata
2109         optimization.
2110
2111         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
2112         from a MonoValueHashTable for now, since the later is based on an earlier
2113         version of hpj's internal probing code and seems to have serious collision
2114         issues.
2115
2116         * loader.c (mono_get_method_full): Update after the change above.
2117
2118 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
2119
2120         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
2121
2122 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
2123
2124         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
2125         the GTD instead of the DGC instead of crashing.
2126
2127         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
2128         required. Inflate fields if needed.
2129
2130         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
2131         finished. Renamed.
2132
2133 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
2134
2135         * class.c (check_interface_method_override): Check for NULL signatures and fail
2136         the type.
2137
2138         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
2139
2140         Fixes #553428.
2141
2142 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
2143
2144         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
2145         the MONO_METHOD_FLAGS column instead of decoding the whole row.
2146
2147 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
2148
2149         * loader.c (field_from_memberref): Resolve the class first then the field
2150         signature. Remove a lot of duplicated code and make sure we don't pass valid
2151         values to mono_loader_set_error_field_load.
2152
2153         Fixes #553306.
2154
2155 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
2156
2157         * class.c (inflate_generic_type): Change code to use new signature of
2158         mono_error_set_bad_image.
2159
2160         Fixes #558124.
2161
2162 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
2163
2164         * verify.c (mono_method_verify): Don't free ctx.params items if 
2165         we aborted while inflating the ctx.locals. Complete previous fix
2166
2167 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
2168
2169         * verify.c (mono_method_verify): Use the uninflated type name, 
2170         when the inflated is null, to report errors. Also take care when
2171         freeing, not to free everything since, in case of an error, some
2172         stuff would be copies (i.e. not allocated by the function itself)
2173         Fix bug #558145
2174
2175 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
2176
2177         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
2178         or overflow. The caller must have done this check explicitly. This guard us
2179         from accessing invalid memory.
2180
2181         * verify.c (do_push_static_field): Check for stack overflow.
2182
2183         Fixes #553333.
2184
2185 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
2186
2187         * loader.c (find_method_in_class): Don't crash if the signature cannot
2188         be resolved.
2189
2190         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
2191         of asserting for the case of invalid params.
2192
2193         Fixes #553304.
2194
2195 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
2196
2197         * image.c (mono_image_load_module): Fix crash when a bad assembly
2198         has no module at all (fix bug #553412) and also replace the 
2199         g_assert with a return NULL (documented return value for failure)
2200
2201 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
2202
2203         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
2204
2205 2009-11-23  Miguel de Icaza  <miguel@novell.com>
2206
2207         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
2208         file attribute to managed code and avoid doing the mask/attribute
2209         checks here. 
2210
2211 2009-11-22  Miguel de Icaza  <miguel@novell.com>
2212
2213         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
2214         the managed world.
2215
2216         * icall-def.h: New entry points.
2217         
2218 2009-11-19  Mark Probst  <mark.probst@gmail.com>
2219
2220         * process.c: Don't put references to managed objects into a
2221         g_ptr_array.
2222
2223 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
2224
2225         * class.c (can_access_internals): Allow CoreCLR to participate in
2226         allowing (or not) [InternalsVisibleTo] between assemblies.
2227         * security-core-clr.c|h: Make sure that only trusted code (a 
2228         superset of platform code) can access the internals of platform
2229         code.
2230
2231 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
2232
2233         * reflection.c: use the correct base class to get the virtual method
2234         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
2235
2236 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
2237
2238         * security-core-clr.c (get_caller_no_reflection_related): 
2239         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
2240         it's still reflection and must be filtered correctly.
2241
2242 2009-11-16  Mark Probst  <mark.probst@gmail.com>
2243
2244         * object.c (compute_class_bitmap): Fix for large bitmaps.
2245
2246 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
2247
2248         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
2249
2250         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
2251         koush@koushikdutta.com). Disable GC_no_dls on android.
2252
2253 2009-11-12  Mark Probst  <mark.probst@gmail.com>
2254
2255         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
2256         tlab_next points outside the TLAB because the allocator was
2257         interrupted.
2258
2259 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2260
2261         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
2262
2263 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2264
2265         * object-internals.h: Change signature for mono_string_to_utf8_image.
2266
2267         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
2268         argument.
2269
2270         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
2271         exceptions due to mono_string_to_utf8.
2272
2273 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2274
2275         * object-internals.h: Change signature for mono_string_to_utf8_mp.
2276
2277         * object.c (mono_remote_class): Make sure all resources are released before
2278         raising an exception.
2279
2280         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
2281
2282 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2283
2284         * mono-perfcounters.c (network_get_impl): Change variable initialization
2285         ordering to fix potential memory leak in case of exceptions.
2286
2287         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
2288         encoded strings.
2289         
2290 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2291
2292         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
2293         variable initialization ordering to fix potential memory leak in case
2294         of exceptions.
2295
2296 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
2297
2298         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
2299         needed.
2300
2301 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2302
2303         * appdomain.c: Fix shadow path code to better deal with exceptions.
2304
2305 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2306
2307         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
2308         exception in the middle of the runtime code.
2309
2310 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2311
2312         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
2313         leak memory with broken envvar value.
2314
2315 2009-11-06  Mark Probst  <mark.probst@gmail.com>
2316
2317         * reflection.c (mono_reflection_setup_internal_class): Because
2318         nested classes are not added to the name cache, we must put them
2319         in the reflection_info_unregister_classes list.
2320
2321 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
2322
2323         * class.c: When CoreCLR is enabled don't call mono_init_com_types
2324         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
2325         platform (trusted) code. Instead we return a TypeLoadException to
2326         be thrown later. This is the exception thrown by Silverlight 2 if
2327         a type, inside application (user) code is marked with [ComImport]
2328
2329 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
2330
2331         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
2332         mono_is_debugger_attached () too.
2333
2334         * mono-debug.c (mono_is_debugger_attached): New helper function.
2335         (mono_set_is_debugger_attached): Ditto.
2336
2337 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2338
2339         * object-internals.h: Add mono_string_to_utf8_checked.
2340
2341         * object.c: Implement mono_string_to_utf8_checked.
2342
2343 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2344
2345         * class.c: Add missing check for load errors after every
2346         call to mono_class_setup_fields
2347
2348         Fixes #552282.
2349
2350 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2351
2352         metadata-verify.c (verify_tables_schema): Fix the error message.
2353
2354 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2355
2356         * metadata.c: Change event table schema to use TDOR for event type
2357         as this is what it's meant to be.
2358
2359         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
2360         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
2361         entry.
2362
2363         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
2364         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
2365         rows in MONO_TABLE_GENERICPARAM.
2366
2367         Fixes #552289.
2368
2369 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2370
2371         * class.c (mono_image_add_to_name_cache): Assert on duplicate
2372         insertion.
2373
2374         * reflection.c (mono_reflection_setup_internal_class): Avoid
2375         registering a gc root the same MonoClass multiple times.
2376         Don't register nested types on the global scope as they should
2377         not be available there.
2378
2379 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2380
2381         * culture-info-tables.h: regenerated.
2382
2383 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
2384
2385         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
2386
2387 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
2388
2389         * string-icalls.c|h: Remove string internal calls that are not 
2390         used anymore by the class libraries.
2391         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
2392         which is not used in the class librairies.
2393         * icall-def.h: Update tables.
2394
2395 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2396
2397         * class.h: Move mono_class_inflate_generic_type_checked...
2398
2399         * class-internals.h: to here and make it internal. We don't want to
2400         further expose MonoGenericContext. 
2401
2402 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2403
2404         * verify.c (mono_method_verify): Improve error message.
2405
2406 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2407
2408         * reflection.c (fieldref_encode_signature): If field_image is NULL then
2409         the token is already properly encoded. Fixs 4.0 build.
2410
2411 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2412
2413         * locales.c (construct_number_format): Check if the number index is
2414         valid before trying to use it, if not, just return.
2415         
2416 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
2417
2418         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
2419         since that loses the abort state. Fixes #539394.
2420
2421 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
2422
2423         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
2424         explicit this argument to the call signature.
2425         (mono_marshal_get_icall_wrapper): Ditto.
2426
2427 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2428
2429         * reflection.c (fieldref_encode_signature): Add new field_image parameter
2430         to indicate which assembly to use when resolving a custom-mod.
2431
2432         Fixes handling of volatile fields used across assemblies as reported in #551513.
2433
2434 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2435
2436         * loader.c: Improve error messages.
2437
2438 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2439
2440         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
2441         of interfaces. Fixes IKVM.
2442
2443         * class.c (mono_class_setup_vtable_general): Improve debug spew.
2444
2445 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2446
2447         * verify.c (verifier_inflate_type): Return the inflated type on success.
2448
2449 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
2450
2451         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
2452
2453         * threads.c (mono_thread_attach): Call the profiler thread start callback.
2454
2455         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
2456
2457         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
2458         flag set.
2459
2460         * profiler.c: Add new profiler callbacks for runtime invoke.
2461
2462         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
2463
2464 2009-11-01  Mark Probst  <mark.probst@gmail.com>
2465
2466         * sgen-gc.c: Keep track of the reason for a major collection and
2467         write it to the heap-dump file.
2468
2469 2009-10-31  Miguel de Icaza  <miguel@novell.com>
2470
2471         * threads.c: refactor the code that initializes the
2472         thread_start_args into a reusable function and use this in the two
2473         methods that start up threads.
2474
2475 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
2476
2477         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
2478         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
2479
2480 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
2481
2482         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
2483         Until now, we only had the per-cpu(core) counters.
2484
2485 2009-10-28  Mark Probst  <mark.probst@gmail.com>
2486
2487         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
2488         mono_gc_get_suspend_signal(), which returns the suspend signal
2489         number used by the GC.
2490
2491 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
2492
2493         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
2494
2495         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
2496         signalling start_notify.
2497
2498 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2499
2500         * appdomain.c: do not test the st_mode field for shadow-copies.
2501         Fixes bug #545276.
2502
2503 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2504
2505         * threadpool.[ch]: added hooks for thread start/finish and item
2506         processing begin/end. For monotouch use only.
2507
2508 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
2509
2510         * threads.c (mono_thread_get_name): New helper function.
2511
2512         * reflection.c (resolve_object): Set handle_class for strings too.
2513         (mono_reflection_create_custom_attr_data_args): New helper function to decode
2514         a cattr blob into a set of arrays and structures without creating the custom
2515         attributes themselves.
2516         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
2517
2518         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
2519
2520         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
2521         function.
2522
2523 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2524
2525         * verify.c: Replace calls to mono_class_inflate_generic_type with
2526         mono_class_inflate_generic_type_checked. Fixes #480005.
2527
2528 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2529
2530         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
2531         object since not all paths lead to callees initing it.
2532
2533 2009-10-23  Alp Toker  <alp@nuanti.com>
2534
2535         Fix embedding API breakage from r144688. mono-compiler.h is an internal
2536         header and should not be shipped:
2537
2538         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
2539         which is specific to the mono build. Not going to work.
2540
2541 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
2542
2543         * security-manager.c: Report if core-clr is active from
2544         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
2545         to allow Moonlight BCL to behave appropriately (both in browser
2546         and outside, e.g. smcs)
2547
2548 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
2549
2550         * mono-config.c: ignore UTF-8 BOM and report parser errors.
2551         Fixes bug #549108.
2552
2553 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2554
2555         * class.c: fix typo.
2556
2557 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
2558
2559         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
2560         a MonoError parameter.
2561
2562         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
2563         version that can does proper error handling.
2564
2565         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
2566
2567         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
2568
2569         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
2570
2571 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2572
2573         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
2574         NO_UNALIGNED_ACCESS is defined.
2575
2576 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
2577
2578         * marshal.c (mono_string_builder_to_utf16): Applied patch from
2579         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
2580         Fixes #549173.
2581
2582 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2583
2584         * sgen-gc.c: Shorten sections whenever possible.
2585
2586 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2587
2588         * sgen-gc.c: Use our portable semaphore #defines.
2589
2590 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2591
2592         * sgen-gc.c: A debug option for dumping the heap layout to a file
2593         after each collection.
2594
2595 2009-10-21  Mark Probst  <mark.probst@gmail.com>
2596
2597         * sgen-gc.c: Make managed write barriers atomic via
2598         thread-restarts.
2599
2600 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
2601
2602         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
2603         methods. Fixes #543021.
2604
2605 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2606
2607         * socket-io.[ch]: fix VS build.
2608
2609 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2610
2611         * icall-def.h:
2612         * socket-io.[ch]: implemented SendFile.
2613
2614 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2615
2616         * class.c (mono_class_create_from_typedef): Initialize class->element_class
2617         before the interfaces to avoid crashes later if class initialization fails.
2618         Fixes #548417.
2619
2620         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
2621         Fixes #548276.
2622
2623 2009-10-20  Marek Safar  <marek.safar@gmail.com>
2624
2625         * domain.c: Bump 4.0 version.
2626
2627 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
2628
2629         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
2630         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
2631         check since 'pubkey' can't be NULL at this stage
2632         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
2633         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
2634         initialization of 'iter'
2635
2636 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
2637
2638         * cominterop.c : Search the interface parts of vtable to find 
2639           method matches.  Fixes 547030.
2640
2641         Code is contributed under MIT/X11 license.
2642
2643 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
2644
2645         * marshal.c: BeginInvoke cannot be called on multicast delegates with
2646         multiple targets. Fixes bug #574426.
2647
2648 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2649
2650         * profiler.h: Put here the definition of
2651         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
2652         (and fix the build...).
2653
2654 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2655
2656         * profiler.c, profiler.h, profiler-private.h:
2657         Added support for different ways of getting call chains in stat mode.
2658
2659 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2660
2661         * object.c, object-internals.h: New function for computing the
2662         size of an array, factored out of mono_array_new_full().  Use
2663         SGen's functions for allocating arrays and vectors.
2664
2665         * sgen-gc.c, gc-internal.h: Special functions for allocating
2666         arrays and vectors without race conditions.  A managed array
2667         allocator method.
2668
2669         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
2670
2671 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2672
2673         * object.c, object.h, icall.c: Write barriers do the copying now,
2674         as well, so no need for an additional memcpy.
2675
2676         * sgen-gc.c: Lock when storing remsets.  Do the memory
2677         copying/moving in the write barriers.
2678
2679         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
2680
2681         * reflection.c: Added an assert.
2682
2683 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2684
2685         * threads.c, process.c: A few missing write barriers.
2686
2687 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
2688
2689         * mono-perfcounters.c, mono-perfcounters-def.h: Add
2690         network performance counters for bytes sent per second, bytes
2691         received per second, and bytes total per second.
2692
2693         Code is contributed under MIT/X11 license.
2694
2695 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2696
2697         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
2698         Fix warning.
2699
2700 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2701
2702         * threads.c, object-internals.h, object.c: Move code for
2703         transferring an object to a different domain (via
2704         serialization/remoting) to object.c.
2705
2706         * object.c (call_unhandled_exception_delegate): If the exception
2707         is in a different domain than the delegate, transfer the exception
2708         to that domain.
2709
2710 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
2711
2712         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
2713         Fixes #322934.
2714
2715 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
2716
2717         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
2718
2719 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2720
2721         * object.c (mono_method_return_message_restore): Handle the case
2722         where the argument is an instance of a generic type.  Fixes
2723         #544446.
2724
2725 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2726
2727         * object.c (set_value): Write barrier fix - we must pass the
2728         count, not the size.
2729
2730 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
2731
2732         * domain.c (mono_init_internal): Print a useful error message when encountering
2733         an old mscorlib, instead of crashing. Fixes #544307.
2734
2735 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
2736
2737         * appdomain.c (copy_app_domain_setup): Fix a warning.
2738
2739         * debug-helpers.c (dis_one): Ditto.
2740
2741 2009-10-04  Mark Probst  <mark.probst@gmail.com>
2742
2743         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
2744         into the new domain, instead of referencing the original one.
2745
2746         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
2747         non-static.
2748
2749         * appdomain.c: Corlib version bump.
2750
2751 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2752
2753         * threadpool.c: one more...
2754
2755 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2756
2757         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
2758         threads to die because we're shutting down. delgate5.exe works again.
2759
2760 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
2761
2762         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
2763           ccw_interface_hash table when a ccw is finalized.
2764
2765         Code is contributed under MIT/X11 license.
2766
2767 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2768
2769         * assembly.c, domain.c, image.c, metadata-internals.h: Split
2770         domain and image unloading into two steps.  We must do this
2771         because clearing the domain in SGen requires the class metadata to
2772         be intact, but we need to free the mono_g_hash_tables in case a
2773         collection occurs during domain unloading and the roots would trip
2774         up the GC.
2775
2776 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2777
2778         * object-internals.h: Remove serialized culture fields from
2779         MonoInternalThread.
2780
2781         * icall-def.h, thread-types.h, threads.c: Remove serialized
2782         culture icalls.
2783
2784         * appdomain.c: Corlib version bump.
2785
2786 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
2787
2788         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
2789         Fixes #543133.
2790
2791 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2792
2793         * sgen-gc.c: Try to shorten the new section after a major
2794         allocation to avoid ever-growing sections.
2795
2796 2009-10-13  Martin Baulig  <martin@ximian.com>
2797
2798         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
2799         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
2800         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
2801         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
2802
2803         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
2804
2805 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
2806
2807         * threadpool.c: fixed the order in which 'completed' and the wait
2808         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
2809         No need to use the wait_handle field of ASyncCall. Make sure the
2810         threadpool is active when adding a job or queueing an idle thread.
2811
2812 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
2813
2814         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
2815
2816         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
2817         when using --compile-all.
2818
2819 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2820
2821         * metadata.c (free_generic_class): Unregister the field_objects
2822         roots if we're using SGen.
2823
2824 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2825
2826         * reflection.c (mono_dynamic_image_free): Deregister the GC root
2827         for GenericParamTableEntry.gparam.
2828
2829 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2830
2831         * marshal.c: don't create the handle when calling. It is created later
2832         if needed.
2833
2834 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2835
2836         * sgen-gc.c: Warning fixes.
2837
2838 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2839
2840         * sgen-gc.c: New debug option "xdomain-checks", which scans the
2841         whole heap for cross-domain references before each collection.
2842
2843         * sgen-scan-object.h: The scan action can now use SCAN to scan the
2844         object.
2845
2846         * threadpool-internals.h, threadpool.c: New function
2847         mono_thread_pool_is_queue_array() for checking whether a given
2848         array is used as a (cross-domain) queue by the thread pool code.
2849
2850 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2851
2852         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
2853         searches the whole heap for objects containing a specific
2854         reference.  Only for debugging.
2855
2856 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2857
2858         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
2859
2860         * icall-def.h, threads.c, threads-types.h: New icalls for copying
2861         byte arrays between domains.
2862
2863 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2864
2865         * threadpool.c:
2866         * class-internals.h:
2867         * mono-perfcounters-def.h:
2868         * mono-perfcounters.c:
2869         -There is a list of idle threads
2870         -Each of those idle threads wait on their own WaitHandle instead
2871         of all of them using the same semaphore. When a new work item is
2872         added, the job is assigned directly to an idle thread or a newly
2873         created one if possible and then the handle for that thread is
2874         signaled. Compare that to the current approach where all the
2875         threads in the pool compete to dequeue a job from the same
2876         queue.
2877         -New struct ThreadPool that brings together the bunch of static
2878         variable for each threadpool (IO and regular).
2879         -New performance counters: # of items added and its rate per
2880         threadpool. The rate will be used later, perhaps together with
2881         other perf. counters, to decide when idle threads should exit.
2882
2883 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
2884
2885         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
2886         Fix typo on Windows build.      
2887         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
2888         
2889         Code is contributed under MIT/X11 license.
2890
2891 2009-09-25  Mark Probst  <mark.probst@gmail.com>
2892
2893         * object-internals.h: The Thread class is split up into Thread and
2894         InternalThread now.  We have exactly one InternalThread per
2895         thread, and at most one Thread per appdomain per thread.  Most
2896         data is stored in InternalThread.  All InternalThread objects live
2897         in the root domain.
2898
2899         * class-internals.h: Add internal_thread_class to MonoDefaults.
2900
2901         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
2902         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
2903         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
2904         resulting from the split of the Thread class.
2905
2906         * gc-internal.h: Prototype for new function for checking whether a
2907         thread is the finalizer thread.
2908
2909         * appdomain.c: Corlib version bump.
2910
2911 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2912
2913         * appdomain.c|h: Add a mono_domain_try_unload method which is
2914         equivalent to mono_domain_unload, except that it returns an exception
2915         instead of throwing it. Make mono_domain_unload use the
2916         mono_domain_try_unload method to avoid code-duplication.
2917
2918 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
2919
2920         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
2921         a problem.
2922
2923 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
2924
2925         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
2926         aborting when a conversion is not implemented.
2927
2928 2009-09-23  Miguel de Icaza  <miguel@novell.com>
2929
2930         * verify.c: when comparing culture strings, use g_ascii_strcmp
2931
2932         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
2933         when comparing public key tokens to use memcmp on 16 bytes.   I do
2934         not believe this ever worked as advertised in the past.
2935
2936         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
2937         which would have always failed earlier.
2938
2939 2009-06-25  Miguel de Icaza  <miguel@novell.com>
2940
2941         * gc.c: Raise a NullArgumentException if the object passed is
2942         null.
2943
2944 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
2945
2946         * image.c (mono_image_close): Atomically decrement the reference count and
2947         remove the image from the hash tables, to prevent another thread from seeing a
2948         dying MonoImage. Fixes #541194.
2949
2950 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2951
2952         * threadpool.c: actually use the minimum number of 'completion ports'
2953         (for us is just a potential worker thread).
2954
2955 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2956
2957         * threadpool.c: remove ares_htable. It does not make sense any more
2958         since the same objects are now stored in GC-tracked arrays while they are
2959         in the queue.
2960
2961 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2962
2963         * threadpool.c: increase the minimum length of the queues to 128.
2964         Remove warning.
2965
2966 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
2967
2968         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
2969         return the modified signature used by string ctors.
2970
2971 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
2972
2973         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
2974         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
2975         method, to be used by full-aot.
2976
2977 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
2978
2979         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
2980         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
2981         be known to be good.
2982
2983         * class.c (mono_class_init): Fail array types if their element type fails initialization
2984         as well.
2985
2986         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
2987         initialization, additionally we request the element_type vtable to be initialized as well.
2988
2989         This is fine and should not increase the working set in any meaningful way since it's reasonable
2990         to assume       that most code will create an array and eventually populate it, which will require the
2991         type's vtable to be initialized.
2992
2993         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
2994
2995 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
2996
2997         * normalization-tables.h : regenerated.
2998
2999 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
3000
3001         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
3002         a leb128 encoding can take up to 5 bytes.
3003
3004 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
3005
3006         * class.c (verify_class_overrides): Remove useless argument.
3007
3008         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
3009         before interface enumeration as this is no longer required.
3010
3011 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
3012
3013         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
3014         used under mono_class_init context. This functions avoid any code path that
3015         calls mono_class_init, which leads it to be slow as some things like the interface
3016         bitmap are not available.
3017
3018         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
3019         of it's own broken version. Fixes the verifier part of #538588.
3020
3021         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
3022         API.
3023
3024 2009-09-15  Mark Probst  <mark.probst@gmail.com>
3025
3026         * class.c (mono_class_init): Always set an exception in a class if
3027         vtable setup fails.  Fixes #538577.
3028
3029         * generic-sharing.c: Raise an exception if mono_class_vtable()
3030         returns NULL.
3031
3032 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
3033
3034         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
3035         methods of vtypes, as they could be incorrectly shared with static methods
3036         taking an IntPtr argument.
3037
3038 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
3039
3040         * domain.c:
3041         * object.c:
3042         * class-internals.h: renamed waithandle_class to
3043         manualresetevent_class.
3044         * marshal.c: propagate the exception if a remoting BeginInvoke call
3045         fails.
3046
3047 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3048
3049         * object.c: Properly handle vtable failures.
3050
3051 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3052
3053         * socket-io.c: Assert on vtable failure.
3054
3055         * mono-mlist.c: Assert on vtable failure.
3056
3057 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3058
3059         * marshal.c: Assert on vtable failure.
3060
3061 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3062
3063         * icall.c: Properly handle vtable failures.
3064
3065 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3066
3067         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
3068
3069 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3070
3071         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
3072
3073         * console-unix.c (do_console_cancel_event): Same.
3074
3075 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3076
3077         * class-internals.h: Add mono_class_vtable_full function that allows control
3078         if an exception should be raised or not.
3079
3080         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
3081         to do what its documentation say, that is to return NULL and set exception_type on
3082         failure.
3083
3084         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
3085         and change the code to honor it.
3086
3087 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3088
3089         * verify.c: Fix typo in error message.
3090
3091 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
3092
3093         * security-core-clr.c: Fix default_platform_check so it can run
3094         the runtime coreclr tests (without an infinite recursion when
3095         throwing an exception).
3096
3097 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3098
3099         object.c (mono_delegate_ctor_with_method): Guard against null method.
3100
3101 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3102
3103         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
3104         that should be replaced with error handling later.
3105
3106 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3107
3108         * marshal.c (mono_delegate_end_invoke): Fix warning.
3109
3110 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3111
3112         * loader.c (mono_field_from_token): Properly handle invalid
3113         dynamic tokens.
3114
3115 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3116
3117         * pedump.c (verify_image_file): Skip types that can't be
3118         decoded.
3119
3120 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3121
3122         * verify.c: Look for recursive valuetypes only against the
3123         type been initialized as this is a lot simpler and works.
3124
3125 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3126
3127         * verify.c: Ensure that fields are properly loaded before
3128         checking them.
3129
3130 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
3131
3132         * object.c (mono_object_get_virtual_method) : Call 
3133           mono_cominterop_get_invoke if the object is a COM object.
3134
3135         Code is contributed under MIT/X11 license.
3136
3137 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
3138
3139         * verify.c: Check for recursive valuetype definitions.
3140
3141 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
3142
3143         Use inheritance-aware interface offsets. Inherited types use the same offsets
3144         of their parents. This reduce offset duplication in case more than one type in
3145         the inheritance tree explicitly implements the same interface.
3146
3147         This also removes a source of vtable bubbles found in #532409. An abstract type
3148         isn't required to provide abstract methods to all interfaces it implements, which
3149         resulted in a bubble with the previous scheme as the child would get a non-full
3150         vtable from its parent. We fail all concrete types with vtable bubbles, so this
3151         should be fixed.
3152
3153         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
3154         it's expected to not cause any significant increase beyond that.
3155
3156         * class.c (setup_interface_offsets): Compute super class iface offsets
3157         first to force sharing.
3158
3159         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
3160         dumping only the relevant ones.
3161
3162         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
3163         methods a new slot regardless if they belong to an interface or not. This allows
3164         an inherited type to override the iface method separately from the class one.
3165
3166 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
3167
3168         * threadpool.c: make the Sleep() alertable to prevent delays exiting
3169         applications that take less than 2s to execute.
3170         Bug #524984 fixed.
3171
3172 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
3173
3174         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
3175
3176         * object.c (mono_get_runtime_callbacks): New helper function to return
3177         the runtime callbacks.
3178
3179         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
3180         mono_get_runtime_build_info () as the display name.
3181         
3182 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
3183
3184         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
3185         argument, since NEWARR expects a native int. Fixes #481559.
3186
3187 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3188
3189         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
3190         against broken SRE methods.
3191
3192 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3193
3194         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
3195         a NULL variable. Abort early on failure.
3196
3197 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3198
3199         * class.c (can_access_type): Fail visibility test for non nested
3200         types with nested visibility.
3201
3202 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
3203
3204         * assembly.c (parse_public_key): Avoid allocating (and not 
3205         freeing) the public key array when it's not requested by the 
3206         caller.
3207         * threads.c (mono_thread_manage, mono_thread_create_internal, 
3208         ves_icall_System_Threading_Thread_Thread_internal): Free 
3209         allocated memory on error.
3210
3211 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3212
3213         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
3214
3215 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3216
3217         * class.c (mono_class_setup_fields): Remove duplicated local variable
3218         named gklass.
3219         Rename gklass to gtd to reflect the fact that it points to the generic
3220         type definition.
3221         Remove the duplicated call to mono_class_setup_fields on gtd and move
3222         the error check to the beginning.
3223
3224 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3225
3226         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
3227         Remove cruft of the previous patch.
3228
3229 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3230
3231         * metadata-verify.c (verify_method_table): Check for abstract + final.
3232         Fixes #534175.
3233
3234 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3235
3236         * verify.c (verify_class_fields): Check for duplicate fields.
3237
3238 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3239
3240         * metadata-verify.c: Verify the typeref table for duplicates.
3241
3242 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3243
3244         This reverts r140936 and properly handles interfaces with static methods. The
3245         right fix is to ensure vtables without bubles which is an easier to verify
3246         constraint. We should avoid such special cases as of the reverted patch as those
3247         only make the runtime more brittle.
3248
3249         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
3250         static methods on interfaces.
3251
3252         * class.c (setup_interface_offsets): Use the number of virtual methods when
3253         calculating interface offsets instead of the number of methods. This way we
3254         avoid bubles on the layout.
3255
3256 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
3257
3258         * metadata-verify.c (verify_metadata_header): Some very smart
3259         obfuscators like to add extra stream headers. Ignore them.
3260
3261 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
3262
3263         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
3264         methods correctly.
3265
3266 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
3267
3268         * metadata-verify.c: Verify for duplicated types.
3269
3270 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
3271
3272         * metadata-verify.c (verify_typedef_table): Verify for nested types
3273         without an entry on the nested class table.
3274
3275 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
3276
3277         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
3278         <tom_hindle@sil.org>. Add locking around hash table accesses.
3279
3280 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3281
3282         * verify.c (mono_verifier_verify_class): Verify all interface if
3283         really are interfaces. Fixes #534184.
3284
3285 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
3286
3287         * pedump.c: Initialize all types during metadata validation so we report
3288         errors only detected as part of class initialization.
3289
3290 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
3291
3292         * metadata-verify.c (verify_method_table): PInvoke requires method to
3293         be static. Fixes #534189
3294
3295 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
3296
3297         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
3298         being NULL.
3299
3300 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3301
3302         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
3303         for holes or bad methods. Fixes #525314.
3304
3305 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3306
3307         * class.c (setup_interface_offsets): Don't allocate slot
3308         for the same interface multiple times. This creates bubbles
3309         that waster space and make vtable verification harder.
3310
3311         The same interface get a slot multiple times since we need
3312         to get the closure of all implemented interfaces, which means
3313         the same interface is reported multiple times.
3314
3315 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3316
3317         * verify.c (mono_verifier_verify_class): Don't check the fields
3318         of generic instances since the context on which they got expanded
3319         might lead to false positives.
3320
3321         Such thing happens when a generic type is inflated in the context
3322         of a generic method and the inflated type of a field turns into a
3323         generic method argument, which causes the checking code to think
3324         it's an invalid class when it's not.
3325
3326 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3327
3328         * verify.c (mono_type_is_valid_in_context): Verify if type
3329         is NULL and remove duplicate test.
3330
3331 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3332
3333         * verify.c (mono_verifier_verify_class): Check fields for
3334         invalid generic arguments.
3335
3336 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3337
3338         * class.c (verify_class_overrides): Verify if for static
3339         and non virtual methods.
3340
3341 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3342
3343         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
3344         Check for errors after retrieving the vtable.
3345
3346 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3347
3348         * class.c (mono_class_setup_vtable_general): Verify
3349         if method overrides are valid before processing them.
3350
3351 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3352
3353         * marshal.c (mono_array_to_lparray): Fix minimal build with
3354         cominterop disabled.
3355
3356         * marshal.c (mono_free_lparray): Same.
3357
3358 2009-08-21  Mark Probst  <mark.probst@gmail.com>
3359
3360         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
3361         the hash function for the ares_htable.
3362
3363 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
3364
3365         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
3366         bit for assembly flags. MS is ok with it but there is no spec anywhere
3367         on its mean
3368
3369 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3370
3371         * class.c (mono_class_create_from_typedef): Emit profiler events
3372         in all cases.
3373
3374 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3375
3376         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
3377         Release memory on failure.
3378
3379 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3380
3381         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
3382         to the internal API.
3383
3384         * metadata.c (get_constraints): Use a single-linked table as we don't
3385         traverse it backward. Fail and return FALSE if only of the contraint types
3386         is not found.
3387
3388         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
3389         to mono_metadata_load_generic_param_constraints except for having a return value.
3390         This has to be done since the later is part of the public API.
3391
3392         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
3393         and fail the type.
3394
3395         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
3396         and fail the method.
3397
3398 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3399
3400         * metadata-verify.c (is_valid_method_header): Add work-around to deal
3401         with MS broken behavior of emmitting EH section sizes without the
3402         header size added.
3403
3404 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3405
3406         * metadata.c (mono_type_create_from_typespec): Don't allocate image
3407         memory until we're sure that we'll need it. This avoids leaking for
3408         broken types or duplicated instantiation.
3409
3410 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3411
3412         * metadata-verify.c (is_valid_method_header): Fix stupid formating
3413         mistake.
3414
3415 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3416
3417         * metadata-verify.c (is_valid_method_header): Fix number of clauses
3418         and expected size calculation.
3419
3420 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3421
3422         * class.c (mono_class_get_field_idx): Add fixme for broken
3423         behavior for types with multiple fields with the same name.
3424         I would rather fix it, but have no idea on how to generate
3425         such artifact for testing.
3426
3427 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3428
3429         * verify.c (verifier_load_field): We should allow references to
3430         fields to be made using the generic type definition. It's up to
3431         the loader system to fail invalid ops.
3432
3433         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
3434         are invalid.
3435
3436 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3437
3438         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
3439
3440         * metadata-internals.h: Fix declaration of 
3441         mono_metadata_interfaces_from_typedef_full.
3442
3443         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
3444         heap_alloc_result parameter that controls if the result should be
3445         g_malloc'd.
3446
3447         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
3448         array be g_malloc'd and properly document this public API function.
3449
3450 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3451
3452         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
3453         remove METHOD_HEADER_TINY_FORMAT1.
3454
3455         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
3456
3457         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
3458
3459         Both spec and MS uses only 2 bits to enumerate the kind of header.
3460         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
3461         is superfluous, only used for tiny headers with odd code lengths.
3462
3463         This change also make sure that mono doesn't wronly interpret bit 2
3464         of fat header flags, which is currently reserved.
3465
3466 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3467
3468         * metadata.c (do_mono_metadata_parse_type): Do error
3469         checking for element types. Don't abort if presented
3470         with a broken type kind.
3471
3472 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3473
3474         * metadata.c (mono_metadata_parse_method_signature_full):
3475         Gracefully fail bad vararg signatures.
3476
3477 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3478
3479         * profiler.c:
3480         * class.c: Fix warnings for uninitialized variables.
3481
3482 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3483
3484         * icall.c: Fix _NSGetEnviron method declaration warning.
3485
3486 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3487
3488         * icall.c:
3489         * reflection.c: Make bitwise checks explicit.
3490
3491 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3492
3493         * debug-helpers.c:
3494         * marshal.c: Fix printf warnings.
3495
3496 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
3497
3498         * reflection.c (encode_cattr_value): Fix a warning.
3499
3500 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3501
3502         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
3503         of array bounds.
3504
3505 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3506
3507         * loader.c (mono_method_signature): Don't assert on broken
3508         signature. Print a more useful error message.
3509
3510 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3511
3512         * loader.c (mono_method_get_marshal_info): Assert if
3513         signature is invalid. Bounds check stores to the
3514         mspecs array;
3515
3516 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3517
3518         * loader.c (field_from_memberref): Fix warning.
3519
3520 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3521
3522         * loader.c (mono_method_get_param_names): Check if signature
3523         is null. Don't store beyond the size of the name array.
3524
3525 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3526
3527         * loader.c (mono_get_method_constrained): Check if signature
3528         is null.
3529
3530 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3531
3532         * loader.c (mono_loader_set_error_bad_image): Improve
3533         error messages.
3534
3535 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3536
3537         * loader.c (mono_get_method_full): Convert an assertion
3538         into a loader error.
3539
3540 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3541
3542         * class-internals.h, class.c: Better naming and documentation.
3543
3544 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
3545
3546         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
3547         obj is NULL.
3548
3549 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3550
3551         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
3552         parsing fails.
3553
3554 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3555
3556         * loader.c (mono_loader_error_prepare_exception): Handle missing field
3557         errors with no class set.
3558
3559         * loader.c (field_from_memberref): If the field signature is of the wrong
3560         type fail with a MissingFieldException instead of a BadImageException as
3561         this is the behavior observed on MS. 
3562
3563 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3564
3565         * loader.c (field_from_memberref): Don't crash if either the field
3566         signature or the typespec class are invalid.
3567
3568 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3569
3570         * verify.c (verifier_load_field): Don't allow field related
3571         ops to reference fields on generic type definition.
3572
3573 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3574
3575         * metadata-verify.c: Add new warning level for errors specified
3576         by ECMA 335 but that MS ignores.
3577
3578         * metadata-verify.c (verify_method_table): Make compiler controled
3579         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
3580         this check is safe because the end result will only be some visibility
3581         exceptions been thrown.
3582
3583 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3584
3585         * verify.c (get_boxable_mono_type): Don't allow the
3586         use of the generic type definition on boxed type positions.
3587
3588         Fixes #531237.
3589
3590 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3591
3592         * threadpool.c: Make sure no cross-domain references remain in
3593         ares_htable or the arrays that are thrown away when resizing.
3594
3595 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3596
3597         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
3598         list of classes for which we have to unregister reflection_info
3599         with the GC and which are not in the namespace cache.
3600
3601         * reflection.c (mono_reflection_initialize_generic_parameter): Add
3602         the class to the list.
3603
3604 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3605
3606         * domain.c (mono_domain_free): Unregister the GC roots in
3607         MonoDomain.
3608
3609 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3610
3611         * reflection.c (mono_reflection_type_get_handle): Fix typo.
3612
3613 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3614
3615         * class.c: Add mono_class_get_field_from_name_full which does
3616         the same as mono_class_get_field_from_name but does check field
3617         signature as well.
3618
3619         * class-internals.h: Export mono_class_get_field_from_name_full as
3620         part of the internal API.
3621
3622         * loader.c (field_from_memberref): Search fields by name and signature
3623         as it's valid to have two fields with same name but different types.
3624
3625         Fixes #528055.
3626
3627 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
3628
3629         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
3630
3631         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
3632
3633         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
3634         System.Type.
3635
3636 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
3637
3638         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
3639
3640         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
3641
3642 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3643
3644         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
3645         to sgen-scan-object.h, which can be included and parameterized via
3646         macros.
3647
3648         * Makefile.am: sgen-scan-object.h added.
3649
3650 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3651
3652         * gc.c: #define GC_dont_gc if we're compiling with SGen.
3653
3654 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3655
3656         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
3657         before clearing a domain in the GC.
3658
3659 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3660
3661         * exception.c (mono_exception_from_name_domain): Actually create
3662         the exception in the specified domain.
3663
3664         * appdomain.c (mono_domain_create_appdomain_internal): Create the
3665         OutOfMemoryException a bit later so that the domain is inialized
3666         "enough" that it works.
3667
3668 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3669
3670         * threads.c (thread_cleanup): Clean up the cached_culture_info
3671         array to prevent cross-domain references.
3672
3673 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
3674
3675         * metadata.c: more documentation for MonoType accessors.
3676
3677 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
3678
3679         Fix incorrect size definitions where the tail array isn't a list
3680         of pointers
3681         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
3682         define size.
3683         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
3684         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
3685         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
3686
3687 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3688
3689         * reflection.h:
3690         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
3691
3692 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3693
3694         * metadata.c:
3695         * loader.c:
3696         * metadata-internals.h:
3697         * method-builder.c:
3698         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
3699
3700 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3701
3702         * cominterop.c:
3703         * metadata.c:
3704         * metadata.h:
3705         * loader.c:
3706         * marshal.c:
3707         * reflection.c: #define for sizeof in MonoType and
3708         MonoMethodSignature.
3709
3710 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3711
3712         * domain.c:
3713         * domain-internals.h: add and use #define's instead of sizeof()
3714         for MonoJitInfo and MonoJitInfoTable.
3715
3716 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3717
3718         * object.c:
3719         * class.h: use #define instead of sizeof() for MonoRemoteClass.
3720
3721 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
3722
3723         * metadata.c:
3724         * metadata.h:
3725         * object.c:
3726         * class-internals.h:
3727         * generic-sharing.c:
3728         * marshal.c: use a #define instead of sizeof() for a few
3729         structures that use a zero-length array.
3730
3731 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
3732
3733         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
3734         to handle inflated generic methods.
3735
3736         * appdomain.c: Bump corlib version.
3737
3738         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
3739         instances.
3740
3741         * reflection.c (fixup_method): Same
3742
3743         * reflection.c (resolve_object): Same.
3744
3745         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
3746         g_error and a decent message.
3747
3748 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
3749
3750         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
3751         from the object because it could not yet be available globally
3752         (it happens if the profiler tries to create a gchandle on the
3753         MonoThread object of a thread that is still registering itself
3754         with the runtime).
3755
3756 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
3757
3758         * reflection.c (mono_generic_class_get_object): Initialized the
3759         managed type arguments array.
3760
3761         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
3762
3763         * appdomain.c: Bump corlib version.
3764
3765 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
3766
3767         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
3768         #527902.
3769
3770 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
3771
3772         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3773         Avoid a crash if synch_cs is not set.
3774         
3775         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3776         Handle the case when the handle is 0.
3777
3778         * appdomain.c: Bump corlib version.
3779
3780 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
3781
3782         * reflection.c (mono_type_get_object): Fix a warning.
3783
3784 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3785
3786         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
3787         descriptor here.  We assume it's already been computed.
3788
3789         * generic-sharing.c (instantiate_other_info): Compute the GC
3790         descriptor for info type MONO_RGCTX_INFO_KLASS.
3791
3792 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3793
3794         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
3795         type, so don't use MONO_OBJECT_SETREF to set a field.
3796
3797 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3798
3799         * gc.c: We were missing one case where invoking a finalizer would
3800         not reset the domain.  Also, in the finalizer thread loop, assert
3801         that we're in the root domain.
3802
3803 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3804
3805         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
3806         if the type is not an array.
3807
3808 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3809
3810         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
3811         method bound to the declaring type of the method. Raise an exception
3812         if the type is not a generic param.
3813
3814 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3815
3816         * class.c (print_unimplemented_interface_method_info): Print the
3817         full type name.
3818
3819         * class.c (mono_class_setup_vtable_general): When dealing with a
3820         generic instance first check if the generic type definition is
3821         not broken.
3822
3823 2009-02-11 Tom Hindke <tom_hindle@sil.org>
3824
3825         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
3826
3827         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
3828
3829         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
3830
3831         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
3832
3833         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
3834
3835         Code is contributed under MIT/X11 license
3836
3837 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
3838
3839         * verify.c: Fix naming of stelem and ldelem.
3840
3841 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3842
3843         * generic-sharing.c: Replace the templates lock with the loader
3844         lock because of very hard to resolve deadlock issues.
3845
3846 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
3847
3848         * icall.c (ves_icall_Type_GetMethodsByName): Use 
3849         mono_class_get_vtable_size () instead of accessing klass->vtable_size
3850         directly. Fixes #525338.
3851
3852         * class.c (mono_class_get_vtable_size): New helper function.
3853
3854         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
3855         the field belongs to the type. Fixes #525733.
3856
3857 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3858
3859         * sgen-gc.c: When we stop a thread and its stack top is not within
3860         its allocated stack (because it's in an altstack signal handler),
3861         restart it and stop it again, until it is.
3862
3863 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3864
3865         * sgen-gc.c: Take a thread's stack top and registers from the
3866         sigcontext in the suspend signal handler.
3867
3868         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
3869         stuff to sgen-archdep.h.
3870
3871         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
3872         caller, because have code in sgen-archdep.h to acquire that data.
3873
3874 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
3875
3876         * profiler.c, profiler.h, profiler-private.h:
3877         Added support for keeping track of code chunks and buffers.
3878
3879 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
3880
3881         * metadata-verify.c: Fix endianness problems on decoding functions.
3882         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
3883
3884 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3885
3886         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
3887         schema for vectors and one dimension SZARRAY.
3888
3889 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3890
3891         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
3892         schema for vectors and one dimension SZARRAY.
3893
3894 2009-07-27  Mark Probst  <mark.probst@gmail.com>
3895
3896         * icall-def.h, thread-types.h, threads.c: New separate icalls for
3897         Interlocked.(Compare)Exchange with object arguments, which invoke
3898         write barriers.
3899
3900 2009-07-26  Miguel de Icaza  <miguel@novell.com>
3901
3902         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
3903         passed invalid arguments.   Fixes another crasher in the
3904         Silverlight test suite.
3905
3906         * class.c (mono_class_array_element_size): Return 0 for the size
3907         of the class;  This fixes the crasher exposed by :
3908
3909         typeof (void).MakeArrayType ();
3910
3911         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
3912         if there is no method to dereference.    Put all the code that
3913         depends on this inside the if (method) block.
3914
3915         This fixes the crasher exposed by Microsoft's Silvelright CLR test
3916         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
3917
3918         With this change, we pass the test.
3919         
3920         * reflection.c (mono_reflection_sighelper_get_signature_local):
3921         Only dereference the assembly if it has been set.    Fixes a
3922         crasher exposed by #525328
3923
3924 2009-07-25  Mark Probst  <mark.probst@gmail.com>
3925
3926         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
3927         don't perform the store in mono_gc_wbarrier_generic_nostore().
3928         Remove the second argument (value), which is not needed.
3929
3930 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
3931
3932         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
3933         the build.
3934
3935         * boehm-gc.c: Ditto.
3936         
3937 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3938
3939         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
3940         not perform the store itself.  Introduce
3941         mono_gc_wbarrier_generic_nostore(), which is the same as
3942         mono_gc_wbarrier_generic_store(), except it doesn't perform the
3943         store.
3944
3945 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3946
3947         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
3948         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
3949         we still need the memcpy().
3950
3951 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3952
3953         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
3954         so that big arrays are handled correctly.  Always use
3955         safe_object_get_size() to calculate array object sizes, which
3956         takes bounds into account.
3957
3958 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3959
3960         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
3961         GC descriptor is computed before we use it.
3962
3963 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3964
3965         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
3966         write barrier if necessary.
3967
3968 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3969
3970         * icall-def.h, icall.c, thread-types.h: New separate icall for
3971         VolatileWrite(object&,object) that uses a write barrier.
3972
3973         * console-unix.c, file-io.c, icall.c, threads.c: Use write
3974         barriers in icalls which write to "ref" or "out" arguments.
3975
3976 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
3977
3978         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
3979         handler in a separate icall, to reduce the size of the wrappers.
3980
3981 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3982
3983         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
3984
3985 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3986
3987         * metadata-verify.c (parse_field): Allow byref field.
3988
3989         * metadata-verify.c (parse_locals_signature): Allow byref locals.
3990
3991         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
3992
3993 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3994
3995         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
3996         Fixes #522784.
3997
3998 2009-07-20  Robert Jordan  <robertj@gmx.net>
3999
4000         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
4001         Fix invalid IL in valuetype handling (STOBJ must push the
4002         corresponding class). Fixes bug #523149.
4003
4004         Code is contributed under MIT/X11 license.
4005
4006 2009-07-20  Geoff Norton  <gnorton@novell.com>
4007
4008         * gc.c: Use proper semaphores where available on posix and darwin.
4009
4010 2009-07-19  Geoff Norton  <gnorton@novell.com>
4011
4012         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
4013
4014 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
4015
4016         * refletion.c (is_sre_usertype): Change name to is_usertype and
4017         invert it's result so it returns true if the type is an user type
4018         and not the opposite.
4019
4020         * reflection.c (is_*_type): Change all of those to use new macro
4021         check_corlib_type_cached that cached the type lookup so we don't
4022         need to do string comparisons all the type. Changed the signature
4023         to take a MonoClass instead.
4024
4025         * reflection.c: Change mono_image_create_token and resolve_object
4026         to use is_sre_* functions.
4027
4028 2009-07-18  Mark Probst  <mark.probst@gmail.com>
4029
4030         * sgen-gc.c: Check for writes to the stack in the managed
4031         wbarrier as well.
4032
4033 2009-07-18  Mark Probst  <mark.probst@gmail.com>
4034
4035         * sgen-gc.c: When a thread is unregistered, don't free its remsets
4036         but put them on a list which is processed with the other thread's
4037         remsets.
4038
4039 2009-07-18  Mark Probst  <mark.probst@gmail.com>
4040
4041         * sgen-gc.c: Fix and enable the internal allocator instead of
4042         using malloc/free (which causes deadlocks).
4043
4044 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
4045
4046         * refletion.c: Fix builds with SRE disabled by adding a minimal
4047         implementation of mono_reflection_type_get_handle.
4048
4049 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
4050
4051         * refletion.c: Make mono_reflection_type_get_handle non static.
4052
4053         * object-internals.h: Export mono_reflection_type_get_handle.
4054
4055         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
4056         unmanaged handle using mono_reflection_type_get_handle.
4057
4058 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
4059
4060         * refletion.c: Replace all reads of MonoReflectionType::type with
4061         calls to mono_reflection_type_get_handle. Only the functions that
4062         deal with constructing TypeBuilder::type have not been changed
4063         because they have to deal with NULL values.
4064
4065         This is a first step into supporting reflection types that don't
4066         map directly into their unmanaged counterpart.
4067
4068 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
4069
4070         * metadata-verify.c (parse_locals_signature): Don't complain
4071         on signature with zero locals since MS generates it and doesn't
4072         bother with.
4073
4074 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
4075
4076         * reflection.c (mono_image_get_array_token): Resolve return
4077         type using mono_reflection_type_get_handle.
4078
4079         * reflection.c (mono_image_get_array_token): Resolve array method
4080         parent type using mono_reflection_type_get_handle.
4081
4082 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
4083
4084         * reflection.c (mono_image_basic_init): Applied patch from
4085         <Dax@daxxfiles.net>. Set the public key token from the assembly
4086         builder. Fixes #518909.
4087
4088         * appdomain.c: Bump corlib version.
4089
4090 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
4091
4092         * class.c (mono_class_needs_cctor_run): Make this return false if
4093         the class has no cctor.
4094
4095 2009-07-13  Mark Probst  <mark.probst@gmail.com>
4096
4097         * sgen-gc.c: When the minor GC needs to allocate a new section,
4098         invoke the major GC afterwards.
4099
4100 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
4101
4102         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
4103           Applying the window_style field to the SHELLEXECUTEINFO struct.
4104
4105         Code is contributed under MIT/X11 license.
4106
4107 2009-07-13  Mark Probst  <mark.probst@gmail.com>
4108
4109         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
4110         locking earlier.  Fix it in the managed allocator by making sure
4111         that no thread is stopped there before the GC runs.  If we do stop
4112         a thread there, we restart it and let it run a but, until it stops
4113         somewhere else.
4114
4115         * gc-internal.h, gc.c: Function for getting the IP from a signal
4116         context via a function registered by mini.
4117
4118 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
4119
4120         * object-internals.h (MonoIntPtr): New structure describing a boxed
4121         IntPtr.
4122
4123         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
4124         returns. Fixes #519953.
4125
4126         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
4127
4128 2009-07-09  Mark Probst  <mark.probst@gmail.com>
4129
4130         * class-internals.h, generic-sharing.c: New RGCTX info type for
4131         getting a remoting invoke with check wrapper.
4132
4133 2009-07-07  Geoff Norton  <gnorton@novell.com>
4134
4135         * icall-def.h: Fix the enable-minimal build.
4136
4137 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4138
4139         * object-internals.h: Add MonoReflectionDerivedType.
4140
4141         * reflection.c: Implement support for PointerType.
4142         Fixed tons of warnings.
4143
4144 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4145
4146         * object-internals.h: Add MonoReflectionByRefType.
4147
4148         * reflection.c: Implement support for ByRefType.
4149
4150 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4151
4152         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
4153
4154         * object-internals.h: Add MonoReflectionArrayType and
4155         mono_reflection_create_unmanaged_type.
4156
4157         * reflection.c: Implement support for ArrayType.
4158
4159 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4160
4161         * metadata-verify.c (is_valid_method_header): Parse EH block
4162         flags correctly.
4163
4164 2009-07-03  Mark Probst  <mark.probst@gmail.com>
4165
4166         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
4167         processing the disappearing links, and process disappearing links
4168         in a loop until no new objects are copied.
4169
4170 2009-07-03  Mark Probst  <mark.probst@gmail.com>
4171
4172         * object.c (handle_enum): Invoke the write barrier when copying
4173         value type instances.
4174
4175         * sgen-gc.c: Register remsets for unmanaged write barriers only
4176         when the address written to is actually on the heap.  This makes
4177         set_value() in object.c work without requiring that the result be
4178         on the heap.
4179
4180 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
4181
4182         The runtime wrappers are all bound to a given type that must
4183         exist in the same image. For regular images we use the <Module>
4184         type, which is required to exist for all images.
4185
4186         The <Module> type can't be used for dynamic images because it
4187         might not exist at the time the wrapper is required, so we create
4188         a synthetic type to use instead.
4189
4190         The current code works because of the 2 stage setup of MonoClass,
4191         but once this is gone it will no longer work.
4192
4193         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
4194
4195         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
4196
4197         * object-internals.h: Export mono_image_set_wrappers_type icall
4198         as part of the internal API.
4199
4200         * marshal.c (get_wrapper_target_class): If the image is dynamic,
4201         use MonoDynamicImage::wrappers_type instead of the <Module> type.
4202
4203         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
4204         image wrappers_type to the provided value.
4205
4206 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
4207
4208         * appdomain.c (deregister_reflection_info_roots): No need
4209         to use the image lock here.
4210
4211 2009-07-02  Mark Probst  <mark.probst@gmail.com>
4212
4213         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
4214
4215 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
4216
4217         * threads.c: Store the thread start argument in a hash table instead of
4218         registering it as a root, as libgc doesn't support unregistering roots
4219         under windows, leading to 'too many root sets' errors when many threads
4220         are created.
4221
4222         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
4223         shutdown, they can still be referenced by the other dying objects.
4224         Fixes #514506.
4225
4226 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4227
4228         * socket-io.c: DontLinger does not allow LingerOptions.
4229
4230 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4231
4232         * metadata-verify.c: The spec doesn't mention that it's possible to add
4233         custom attribute to a generic parameter. Fixed.
4234
4235 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4236
4237         * class.c (inflate_generic_type): Don't crash while trying to output a message
4238         on why we're aborting.
4239
4240 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
4241
4242         * socket-io.c: DontLinger can take an int or a boolean too.
4243
4244 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
4245
4246         * gc.c: check for a null argument to SuppressFinalize () and
4247         ReRegisterForFinalize ().
4248
4249 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4250
4251         * loader.c (method_from_methodspec): Call into the verifier to check
4252         the signature.
4253
4254         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
4255
4256         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
4257         part of the internal API.
4258
4259 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4260
4261         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
4262         the signature.
4263
4264         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
4265
4266         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
4267         part of the internal API.
4268
4269 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4270
4271         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
4272         the signature.
4273
4274         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
4275         blob verification.
4276
4277         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4278         part of the internal API.
4279
4280 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4281
4282         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
4283         when doing basic verification. 
4284
4285         This check must be done since the runtime peeks into signatures in much
4286         more places than it does decoding so it makes sense to ensure that all
4287         pointers to blob objects are well formed.
4288
4289 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4290
4291         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
4292         Use proper overflow dectection. Fix usage of it.
4293
4294 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4295
4296         * loader.c (field_from_memberref): Call into the verifier to check
4297         the signature.
4298
4299         * loader.c (mono_method_get_signature_full): Same.
4300
4301         * loader.c (method_from_memberref): Same.
4302
4303         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
4304
4305         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4306         part of the internal API.
4307
4308 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4309
4310         * threadpool.c (mono_thread_pool_add): If the domain is unloading
4311         or unloaded, still return an AsyncResult, but don't add it to the
4312         threadpool.
4313
4314 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
4315
4316         * threads.c: fix missing colon when DEBUG is defined.
4317
4318 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4319
4320         * threadpool.c: Don't add new calls to a threadpool if the domain
4321         of the call is unloading or unloaded.  When dequeuing a job, null
4322         the reference in the queue.
4323
4324 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4325
4326         * sgen-gc.c (null_link_in_range): Add the dislink for the old
4327         generation if an object was moved.
4328
4329 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
4330
4331         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
4332           parameters of type SAFEARRAY[VARIANT].
4333
4334         * reflection.c (encode_marshal_blob): Properly generate element type
4335           (SafeArraySubType marshal attribute option).
4336
4337         Code is contributed under MIT/X11 license.
4338
4339 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
4340
4341         * reflection.c: in mono_method_clear_object () really ensure all the
4342         objects are removed.
4343
4344 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4345
4346         * loader.c (mono_method_signature): Call into the verifier to check
4347         the method signature.
4348
4349         * metadata-verify.c (verify_method_table): Move signature verification
4350         to verify_method_table_full.
4351
4352         * metadata-verify.c: Add mono_verifier_verify_method_signature.
4353
4354         * verify-internals.h: Export mono_verifier_verify_method_signature as
4355         part of the internal API.
4356
4357 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4358
4359         * loader.c (mono_method_get_header): Call into the verifier to
4360         check the method header.
4361
4362         * metadata-verify.c: Add mono_verifier_verify_method_header.
4363
4364         * verify-internals.h: Export mono_verifier_verify_method_header as
4365         part of the internal API.
4366
4367 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4368
4369         * class.c (mono_class_find_enum_basetype): Call into the verifier to
4370         check the field signature. Replace an assert with an explicit check.
4371
4372         * class.c (mono_class_setup_fields): Call into the verifier to check
4373         the field signature.
4374
4375         * metadata-verify.c: Add mono_verifier_verify_field_signature.
4376
4377         * verify-internals.h: Export mono_verifier_verify_field_signature as
4378         part of the internal API.
4379
4380 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4381
4382         * class.c (mono_class_find_enum_basetype): Simplify this function
4383         by moving code outside of the loop and not decoding static fields.
4384
4385 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4386
4387         * metadata-verify.c (verify_typedef_table): Check the extends
4388         token here. Move to here a flags check from verify_typedef_table_full.
4389
4390 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
4391
4392         * metadata-verify.c (is_valid_method_header): Fix a warning.
4393
4394         * metadata-internals.h (MonoImage): Remove the unused 
4395         static_rgctx_invoke_wrapper_cache.
4396
4397         * image.c marshal.c: Ditto.
4398
4399 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4400
4401         * image.c (do_mono_image_load): Enable table data verification.
4402
4403 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4404
4405         * metadata-verify.c (is_valid_constant): Fix nullref check.
4406
4407 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4408
4409         * metadata-verify.c (is_valid_constant): Fix string bounds check.
4410
4411 2009-06-22  Mark Probst  <mark.probst@gmail.com>
4412
4413         * sgen-gc.c: Managed allocation with pthreads TLS.
4414
4415         * threads.c, threads-types.h: Functions for the JIT to tell the
4416         runtime whether it supports the MONO_TLS opcode.
4417
4418 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4419
4420         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
4421         without methods.
4422
4423 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4424
4425         * metadata-verify.c (is_valid_constant): Fix the string length check.
4426         Use safe overflow checking. Add decent error messages.
4427
4428 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4429
4430         * metadata-verify.c: Move remaininh blob checks to the offline
4431         verification path.
4432
4433 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4434
4435         * metadata-verify.c: Move more blob checks to the offline verification
4436         path.
4437
4438 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
4439
4440         * object-internals.h : Adding interrupt_on_stop field.
4441
4442         * threads.c (mono_thread_request_interruption) : On Windows exit the
4443           thread if interrupt_on_stop is set.
4444
4445         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
4446          Removing old interrupt logic and setting the interrupt_on_stop for the
4447          thread when calling accept.
4448
4449         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
4450          setting the interrupt_on_stop for the thread when calling accept.
4451
4452         Contributed under MIT/X11 license.
4453
4454 2009-06-20  Martin Baulig  <martin@ximian.com>
4455
4456         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
4457
4458 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
4459
4460         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
4461         running in no-exec mode.
4462
4463 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4464
4465         * metadata-verify.c (verify_method_table): Move header
4466         checking to verify_method_table_full.
4467
4468         * metata-verify.c (mono_verifier_verify_full_table_data):
4469         Call verify_method_table_full.
4470
4471 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4472
4473         * metadata-verify.c (verify_field_table): Move signature
4474         checking to verify_field_table_full.
4475
4476         * metata-verify.c (mono_verifier_verify_full_table_data):
4477         Call verify_field_table_full.
4478
4479 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4480
4481         * metadata-verify.c (verify_typedef_table): Move remaining
4482         stuff to verify_typedef_table_full.
4483
4484 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4485
4486         * metadata-verify.c: Kill is_corlib from VerifyContext.
4487         It is only used by the offline mode.
4488         So we better remove it from the runtime path.
4489
4490 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4491
4492         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
4493         function that perform the offline metadata verification steps.
4494
4495         * metadata-verify.c (verify_typedef_table): Move some checks to
4496         verify_typedef_table_full and make it been called by new function
4497         mono_verifier_verify_full_table_data.
4498
4499         * pedump.c: Call mono_verifier_verify_full_table_data.
4500
4501         * verify-internals.h: Export mono_verifier_verify_full_table_data as
4502         part of the internal API.
4503
4504 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4505
4506         * metadata-verify.c (typedef_is_system_object): Fix System.Object
4507         check.
4508
4509         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
4510         flags bits. SupportLastError was confused as bit 7 instead of 6.
4511
4512         * metadata-verify.c (verify_implmap_table): Fix import scope verification
4513         to check against the module ref table instead of module.
4514
4515         * metadata-verify.c (verify_implmap_table): Fix corlib check.
4516
4517         * pedump.c: Call mono_image_load_names.
4518
4519 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4520
4521         * image.c: Extract mono_image_load_names from do_mono_image_load.
4522
4523         * metadata-internals.h: Export mono_image_load_names as part of
4524         the internal API.
4525         
4526 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
4527
4528         * metadata.c (mono_metadata_cleanup): Free the generic method cache
4529         first, as it could reference data in the other caches.
4530
4531 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4532
4533         * metadata-verify.c: Finished with method header verification.
4534
4535 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4536
4537         * metadata-verify.c: Added more header verification code.
4538         Now only EH clauses are missing.
4539
4540 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
4541
4542         * marshal.c (get_runtime_invoke_type): Don't share primitive types
4543         for return values.
4544
4545 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4546
4547         * metadata-verify.c: Initial method header verification.
4548
4549 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4550
4551         * metadata-verify.c (verify_import_table): The IAT contents
4552         might end been patched by the windows DL when running with
4553         coree enabled.
4554
4555 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
4556
4557         * class.c (mono_class_from_typeref): If the enclosing type is not
4558         found return null instead of crashing. Fixes #508487.
4559
4560 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
4561
4562         * normalization-tables.h : updated to the latest unicode charcter
4563           data.
4564         * appdomain.c : bump corlib version.
4565
4566 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
4567
4568         * class.c (mono_class_from_name): Fix support for assembly references
4569         in the EXPORTEDTYPE table. Fixes #511704.
4570
4571 2009-06-13  Geoff Norton  <gnorton@novell.com>
4572
4573         * domain.c: Ensure that mono_domain_assembly_open actually opens the
4574         assembly in the target domain.
4575
4576 2009-06-12  Robert Jordan  <robertj@gmx.net>
4577
4578         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
4579         because "this" of the managed signature has become an
4580         ordinary parameter in the unmanaged signature.
4581
4582 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
4583
4584         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
4585         field for owner-less generic containers.
4586
4587         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
4588         image field of the owner-less generic containers created here.
4589
4590         * metadata.c (mono_metadata_load_generic_params): Ditto, the
4591         contain is ownerless until the caller sets its owner.
4592
4593         * metadata.c (type_in_image): Handle owner-less generic containers
4594         correctly.
4595         
4596 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4597
4598         * image.c (mono_image_close): Support debug_assembly_unload for
4599         dynamic images too.
4600
4601 2009-06-11 AndrĂ©s G. Aragoneses  <aaragoneses@novell.com>
4602
4603         * class.c: Fix some typos in comments.
4604
4605 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4606
4607         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
4608
4609         * threads.c (mono_thread_execute_interruption): Avoid creating the
4610         abort exception object while holding the synch_cs lock.
4611
4612 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4613
4614         * metadata-verify.c: Verify basic cattr content.
4615
4616 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
4617
4618         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
4619         nested types.
4620         
4621         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
4622         support for nested types. Fixes #511704.
4623
4624 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4625
4626         * metadata-verify.c: Verify methodspec signatures.
4627
4628 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4629
4630         * metadata-verify.c: Verify typespec signatures.
4631
4632 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
4633
4634         * metadata.c (free_inflated_method): Call 
4635         mono_marshal_free_inflated_wrappers (), which was missed earlier.
4636
4637 2009-06-08  Miguel de Icaza  <miguel@novell.com>
4638
4639         * mono-config.c: Small change to report the PPC64/ILP32 model.
4640
4641 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4642
4643         * metadata-verify.c (parse_type): Check szarray.
4644
4645 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4646
4647         * metadata-verify.c (parse_type): Check fnptr.
4648
4649 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4650
4651         * metadata-verify.c (parse_type): Check generic instances.
4652
4653 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4654
4655         * metadata-verify.c (parse_type): Check array shape.
4656
4657 2009-06-05  Robert Jordan  <robertj@gmx.net>
4658
4659         * class.c (mono_class_create_from_typedef): Check only for
4660         mscorlib's System.Array.
4661
4662 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4663
4664         * metadata-verify.c (parse_type): Check pointer, class/valuetype
4665         and generic params. 
4666
4667         * metadata-verify.c (parse_field): Check the signature.
4668
4669 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4670
4671         * metadata-verify.c: Implement locals signature check.
4672
4673 2009-06-04  Marek Safar  <marek.safar@gmail.com>
4674
4675         * domain.c: Add .NET 4.0 Beta 1 version.
4676
4677 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
4678
4679         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
4680           For QueryInterface on CCWs consider the base class
4681           interfaces as well.
4682
4683         Code is contributed under MIT/X11 license.
4684
4685 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4686
4687         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
4688
4689         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
4690         used.
4691
4692         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
4693         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
4694
4695         * generic-sharing.c (inflate_other_data): Ditto.
4696         
4697 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
4698
4699         * metadata-verify.c: Implement property signature check.
4700
4701 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4702
4703         * sgen-gc.h: Register saving support for PPC.
4704
4705 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4706
4707         * sgen-gc.c: Fixed a pthread TLS screwup.
4708
4709 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4710
4711         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
4712         supported.
4713
4714 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4715
4716         * sgen-gc.c: Disable TLA and managed allocation if the __thread
4717         keyword is not supported.
4718
4719 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4720
4721         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
4722         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
4723         the inflated method is freed. Fixes #508389.
4724
4725         The code is contributed under the MIT/X11 license.
4726         
4727 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
4728
4729         * marshal.c (get_wrapper_target_class): New helper function.
4730         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
4731         the <Module> class of the image. Fixes #509049.
4732
4733 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4734
4735         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
4736         Check if the thread was interrupted and proccess it straight away.
4737         Makes abortion much more responsive.
4738
4739 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4740
4741         * threads.c (mono_thread_execute_interruption): Use atomic cas with
4742         MonoThread::interruption_requested to match it's counterpart.
4743
4744         Fixes a hang in abort-stress-1 on a 2 core x86.
4745
4746         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
4747         Fix warning.
4748
4749 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4750
4751         Change MonoImage::name_cache to be protected by the image lock
4752         instead of the loader lock.
4753
4754         * appdomain.c (deregister_reflection_info_roots): Protect access
4755         to name_cache.
4756
4757         * class.c (mono_image_init_name_cache): Change from the loader lock
4758         to the image lock. Check if the cache wasn't already created.
4759
4760         * class.c: Change from the loader to the image lock.
4761
4762         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
4763         the code to hold the image lock while iterating over name_cache and
4764         not go into mono_array_new holding it.
4765
4766         * metadata-internals.h: Add a comment about this change.
4767
4768 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4769
4770         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
4771         Under the 2.0 profile raise the loader error.
4772
4773         Fixes #508532.
4774
4775 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4776
4777         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
4778         of ldind opcode for generic instances so we don't fail for direct wrappers.
4779         This only affect direct calls.
4780
4781 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
4782
4783         * reflection.c (create_dynamic_mono_image): Fix warnings.
4784
4785         * generic-sharing.c (other_info_equal): Ditto.
4786         
4787 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4788
4789         * metadata-verify.c: Implement field signature check.
4790
4791 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4792
4793         * metadata-verify.c: Implement standalone signature check.
4794
4795 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
4796
4797         * metadata-verify.c: Implement methodref signature check.
4798
4799 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
4800
4801         * object-internals.h (MonoRuntimeCallbacks): New structure containing
4802         callbacks supplied by the runtime.
4803
4804         * object.c (mono_install_callbacks): New internal function to install
4805         the callbacks.
4806
4807         * object.c (mono_create_ftnptr): Move the implementation of this to
4808         mini/.
4809
4810         * object.c (mono_get_addr_from_ftnptr): Ditto.  
4811
4812 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4813
4814         * metadata-verify.c (parse_return_type): Proper byref check.
4815         * metadata-verify.c (is_valid_method_signature): Check for zero arity
4816         generic signatures and method params.
4817
4818 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4819
4820         * metadata-verify.c (decode_signature_header): Fix bounds check.
4821
4822         * metadata-verify.c (parse_custom_mods): Check custom mods.
4823
4824         * metadata-verify.c (parse_type): Do initial basic verification
4825         of valid values.
4826         
4827         * metadata-verify.c (is_valid_method_signature): Parse the generic
4828         param count.
4829
4830 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
4831
4832         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
4833         discarded based on their most specific definition so we set the method_slots
4834         array before checking if the method is acceptable or not.
4835
4836         Fixes #506757.
4837
4838 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4839
4840         * icall.c: Free the old array when resizing a mono_ptr_array.
4841
4842 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4843
4844         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
4845         for the hashes whose keys are managed objects.
4846
4847 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4848
4849         * object-internals.h, threads.c: Set the execution context on
4850         thread start here, not in corlib.
4851
4852         * appdomain.c: Bump corlib version.
4853
4854 2009-05-27  Martin Baulig  <martin@ximian.com>
4855
4856         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
4857         if `_mono_debug_using_mono_debugger' is set to make things work
4858         properly when embedding Mono.
4859
4860 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4861
4862         * class.c (mono_class_setup_fields): Don't mark simd types as having
4863         16 bytes alignment as the whole runtime doesn't support.
4864
4865 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4866
4867         * metadata-verify.c (safe_read): Use endian safe read macros.
4868
4869 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
4870
4871         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
4872         it is read-only when using full aot.
4873
4874 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4875
4876         * metadata-verify.c (is_valid_method_signature): Verify parts
4877         of the return type. Provide an error message in case of failure.
4878
4879 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4880
4881         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
4882
4883 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4884
4885         * metadata-verify.c: Include the size prefix in the bounds check.
4886
4887 2009-05-22  Miguel de Icaza  <miguel@novell.com>
4888
4889         * icall.c: Remove warnings.
4890
4891         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
4892         prevent auto-detection based on GCC defines.
4893
4894         Add PS3
4895
4896         * metadata-verify.c: Do not include signal.h
4897
4898         * generic-sharing.c, marshal.c: Add returns to avoid some warning
4899         messages.  Not sure why the g_assert_not_reached is not enough to
4900         quiet the compiler.
4901         
4902
4903         * appdomain.c: Remove code that is not used when
4904         DISABLE_SHADOW_COPY is set.
4905
4906         * image.c: use g_getenv
4907
4908 2009-05-21  Miguel de Icaza  <miguel@novell.com>
4909
4910         * reflection.c: Remove code that it not used with
4911         DISABLE_REFLECTION_EMIT is defined.
4912
4913 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
4914
4915         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
4916         invoke wrappers.
4917
4918 2009-05-20  Miguel de Icaza  <miguel@novell.com>
4919
4920         * socket-io.c
4921         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
4922         the ifdef here and instead put that on io-layer
4923
4924 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4925
4926         * metadata-verify.c: Verify the generic param constraint table.
4927
4928 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4929
4930         * metadata-verify.c (verify_generic_param_table): Fix
4931         thinko on the valid flags bits for generic params.
4932
4933 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4934
4935         * metadata-verify.c: Verify the methodspec table.
4936
4937 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4938
4939         * metadata-verify.c: Verify the generic param table.
4940
4941 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4942
4943         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
4944
4945 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4946
4947         * sgen-gc.c: Use generation enum more consistently and use the
4948         correct generation in mono_gc_register_for_finalization().
4949
4950 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4951
4952         * metadata-verify.c: Verify the nested class table.
4953
4954 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4955
4956         * metadata-verify.c: Verify the manifest resource table.
4957
4958 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
4959
4960         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
4961
4962 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
4963
4964         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
4965         wrappers, this is now done in the JIT.
4966         
4967         * class.c (mono_set_generic_sharing_supported): New internal function.
4968         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
4969
4970 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4971
4972         * metadata-verify.c: Verify the exported type table.
4973
4974 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4975
4976         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
4977
4978 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4979
4980         * metadata-verify.c: Verify the file table.
4981
4982 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4983
4984         * metadata-verify.c (verify_assembly_table): Fix an error message.
4985
4986         * metadata-verify.c: Verify the assemblyref table.
4987
4988 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4989
4990         * metadata-verify.c (verify_assembly_table): Fix the valid
4991         bits mask for flags.
4992
4993 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
4994
4995         * debug-helpers.c (mono_method_full_name): Print generic parameters of
4996         generic methods as well.
4997
4998 2009-05-15  Geoff Norton  <gnorton@novell.com>
4999
5000         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
5001         use-case and is significantly more performant than the wapi layer.
5002
5003 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
5004
5005         * metadata-verify.c: Verify the assembly table.
5006
5007 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
5008
5009         * metadata-verify.c: Fix rows limit check.
5010
5011 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
5012
5013         * metadata-verify.c: Verify the fieldrva table.
5014
5015 2009-05-13  Mark Probst  <mark.probst@gmail.com>
5016
5017         * sgen.c: Speed up weak links and finalizers by grouping them by
5018         generation.
5019
5020 2009-05-13  Mark Probst  <mark.probst@gmail.com>
5021
5022         * marshal.c (delegate_hash_table_add): When overwriting an entry,
5023         free the old GCHandle (only applies to SGen).
5024
5025 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
5026
5027         * loader.c (mono_get_method_from_token): Avoid the expensive call to
5028         mono_metadata_load_generic_params () for non-generic methods.
5029
5030 2009-05-12  Mark Probst  <mark.probst@gmail.com>
5031
5032         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
5033         New function for returning a monitor's weak link if it has one.
5034
5035         * sgen-gc.c: Remove an object's monitor's weak link (if it has
5036         one) when clearing a domain.  These can still be around because
5037         the object might not have been collected.
5038
5039 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
5040
5041         * gc.c: Fix a warning.
5042
5043 2009-05-12  KornĂ©l Pál  <kornelpal@gmail.com>
5044
5045         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
5046         prevous wait that resulted in a deadlock on Windows when initializing
5047         the runtime form DllMain. Also results in improved startup time.
5048         (finalizer_thread): Get rid of thread_started_event.
5049         * threads.c, threads-types.h (mono_thread_create_internal): Return the
5050         resulting MonoThread.
5051
5052         Contributed under MIT/X11 license.
5053
5054 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
5055
5056         * metadata-verify.c: Verify the implmap table.
5057         Don't require that #US and #Strings be present.
5058
5059 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
5060
5061         * security-core-clr.c: Delegate checks are done at creation time,
5062         not a invocation time. Fix exception for Telerik Silverlight demo
5063
5064 2009-05-11  Mark Probst  <mark.probst@gmail.com>
5065
5066         * sgen-gc.c (need_remove_object_for_domain): Remove the special
5067         case for the Thread class.
5068
5069         * threads.c: Do clean-up of abort exception/state in
5070         thread_cleanup() instead of Thread.free_internal().  Also clean up
5071         current_appcontext.  The reason we have to do that is because
5072         those references might point into another domain and if that
5073         domain is unloaded before the thread is finalized, they point to
5074         invalid data.
5075
5076 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
5077
5078         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
5079         stub signatures.
5080         
5081         Contributed unter MIT/X11 license.
5082
5083 2009-05-09  Miguel de Icaza  <miguel@novell.com>
5084
5085         * verify.c, metadata-verifier.c: Add support for disabling the
5086         verifier in some builds.
5087
5088         [ Sorry, my previous commit accidentally commited some work in
5089         progress ]
5090
5091 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
5092
5093         * class.c (mono_class_setup_fields): Set class->field.first for
5094         generic instances.
5095
5096 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
5097
5098         * metadata-verify.c: Verify the typespec table.
5099
5100 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
5101
5102         * metadata-verify.c: Verify the module table.
5103
5104 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5105
5106         * metadata-verify.c: Verify the methodimpl table.
5107
5108 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5109
5110         * metadata-verify.c: Verify the property table.
5111
5112 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
5113
5114         * debug-helpers.c (mono_method_desc_match): Add support for generic
5115         glob patterns.
5116
5117 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
5118
5119         * metadata-verify.c: Verify the propertymap table.
5120
5121 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
5122
5123         * metadata-verify.c: Verify the event table.
5124
5125         * metadata-verify.c (search_sorted_table): Fix offset
5126         calculation.
5127
5128 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
5129
5130         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
5131
5132 2009-05-01  Mark Probst  <mark.probst@gmail.com>
5133
5134         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
5135         because mono_delegate_free_ftnptr() needs it.
5136
5137 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5138
5139         * metadata-verify.c: Verify the eventmap table.
5140
5141 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5142
5143         * metadata-verify.c: Verify the standalonesig table.
5144
5145 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5146
5147         * metadata-verify.c: Verify the field layout table.
5148
5149 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5150
5151         * class.c (mono_type_get_name_recurse): Don't crash
5152         for ownerless generic params.
5153
5154         * debug-helpers.c (mono_type_get_desc): Correct the format
5155         for ownerless generic params.
5156
5157 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5158
5159         * metadata-verify.c: Verify the class layout table.
5160
5161 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5162
5163         * metadata-verify.c: Verify the decl security table.
5164
5165 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5166
5167         * domain.c (mono_domain_set_internal_with_options): Don't do
5168         anything if the old domain is the same as the old one.  Fixes
5169         #499326.
5170
5171 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5172
5173         * appdomain.c: Deregister the reflection_info roots when unloading
5174         a domain.
5175
5176         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
5177         memory allocated by a domain and frees its disappearing links.
5178
5179         * boehm-gc.c, null-gc.c: Empty implementation of
5180         mono_gc_clear_domain().
5181
5182 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5183
5184         * appdomain.c (clear_cached_vtable): Free the static fields memory
5185         block.
5186
5187 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5188
5189         * gc.c: Set the correct domain when invoking finalizers.
5190
5191         * appdomain.c: Set the correct domain when creating threads.
5192
5193 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5194
5195         * sgen-gc.c: Fix skip size for vectors.
5196
5197 2009-05-03  Martin Baulig  <martin@ximian.com>
5198
5199         * mono-debug-debugger.c
5200         (mono_debugger_check_breakpoints): Check class init handlers even
5201         if we don't have any method load handers.
5202
5203 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
5204
5205         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
5206         returning refonly assemblies if refonly is FALSE. Fixes #499013.
5207
5208 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
5209
5210         * metadata-verify.c: Verify the field marshal table.
5211
5212 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
5213
5214         * metadata-verify.c: Verify the custom attribute table.
5215
5216 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5217
5218         * metadata-verify.c: Verify the constant table.
5219
5220 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5221
5222         * metadata-verify.c: Verify the memberef table.
5223
5224 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5225
5226         * metadata-verify.c (get_coded_index_token): Remove
5227         dead argument.
5228
5229 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5230
5231         * metadata-verify.c: Verify the interfaceimpl table.
5232
5233 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5234
5235         * verify.c: Improve error message.
5236
5237         * debug-helpers.c (mono_type_get_desc): Harden the code that
5238         deals with VAR and MVAR.
5239
5240 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
5241
5242         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
5243         part of #498692.
5244
5245 2009-04-23 Tom Hindle <tom_hindle@sil.org>
5246
5247         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
5248         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
5249
5250 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
5251
5252         * security-core-clr.c: Avoid redundant checks for platform code, 
5253         e.g. check for method and for class (very common) and check
5254         for class and outer class (less common)...
5255
5256 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
5257
5258         * reflection.c: Avoid returning random cattrs for synthetic methods.
5259         Fixes #498545.
5260
5261 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5262
5263         * assembly.c: assemblies in the GAC should never be shadow-copied.
5264
5265 2009-04-26  Mark Probst  <mark.probst@gmail.com>
5266
5267         * domain.c, domain-internals.h: Disable
5268         track_resurrection_{objects,handles}_hash in MonoDomain if using
5269         SGen.
5270
5271 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5272
5273         * metadata-verify.c: Verify the param table.
5274
5275 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5276
5277         * metadata-verify.c (verify_typedef_table): Range check FieldList and
5278         MethodList.
5279
5280         * metadata-verify.c (verify_method_table): Proper check the ParamList
5281         field.
5282
5283 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5284
5285         * metadata-verify.c (verify_method_table): Check for runtime
5286         implemented functions such as delegate .ctors. Remove spurious
5287         printf.
5288         
5289 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5290
5291         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
5292
5293 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5294
5295         Don't allocate MonoGenericInfo for ownerless generic params.
5296         * class-internals.h (MonoGenericParam::info): Move field to ...
5297         (MonoGenericParamFull): ... this.  New struct.
5298         (MonoGenericContainer::type_params): Change type to
5299         MonoGenericParamFull.
5300         (MonoGenericParam, MonoGenericContainer): Update accessors.
5301         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
5302         'info' field for ownerless generic param.
5303         (mono_metadata_load_generic_params): Update to changes.
5304         * reflection.c (mono_reflection_create_generic_class): Likewise.
5305         (reflection_methodbuilder_to_mono_method): Likewise.
5306         (mono_reflection_initialize_generic_parameter): Likewise.
5307
5308 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5309
5310         Don't use MonoGenericParamInfo for ownerless generic params.
5311         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
5312         use ParamInfo class at all.
5313         (mono_class_from_generic_parameter): Use them.
5314         (make_generic_param_class): Fix a couple of instances where 'pinfo
5315         == NULL' wasn't handle.
5316
5317 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5318
5319         * class.c (make_generic_param_class): Carve out of ...
5320         (mono_class_from_generic_parameter): ... here.
5321
5322 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5323
5324         Simplify mono_class_from_generic_parameter
5325         * class-internals.h (MonoGenericParamInfo::token): New field.
5326         * metadata.c (mono_metadata_load_generic_params): Initialize it
5327         from metadata.
5328         * class.c (mono_class_from_generic_parameter): Use it instead of
5329         searching through metadata.
5330
5331 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5332
5333         * metadata-verify.c: Add verification of the method table.
5334
5335 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5336
5337         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
5338         Delegate::Invoke optimization.
5339
5340 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5341
5342         * appdomain.c (mono_domain_create_appdomain_internal): Free the
5343         string returned by get_shadow_assembly_location_base.
5344
5345         * appdomain.c (get_shadow_assembly_location_base): Add a comment
5346         about caller's ownership.
5347
5348 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5349
5350         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
5351         reflection memory on domain unload.
5352
5353         * domain.c (mono_domain_free): Don't free refobject_hash, let the
5354         reflection cleanup code do it.
5355
5356         * domain-internals.h: Add mono_reflection_cleanup_domain.
5357
5358         This fixes a memory leak for managed mirrors of reflection objects
5359         on domain unload. 
5360
5361 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5362
5363         * metadata-verify.c: Implement more verification of the field table.
5364
5365 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5366
5367         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
5368         doesn't try to parse the input assembly, which can be broken.
5369
5370 2009-04-23  Mark Probst  <mark.probst@gmail.com>
5371
5372         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
5373         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
5374         by using the lowest bit in the link to store whether the link is
5375         tracked.  Move the track_resurrection hashes into boehm-gc.c.
5376
5377 2009-04-22  Miguel de Icaza  <miguel@novell.com>
5378
5379         * Makefile.am: Split the console support in platform specific code
5380         and put together a framework for making this easy in the future so
5381         that we can start splitting code instead of having a mess of PLATFORM_WIN32
5382
5383 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5384
5385         * pedump.c: Fix a warning.
5386
5387 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5388
5389         * verify.c (mono_delegate_type_equal): Compare valuetypes using
5390         mono_class_from_mono_type to avoid bad interactions with the dual representation
5391         of the generic type definition.
5392
5393 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5394
5395         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
5396         get the MonoClass for the call context type as it might be a generic
5397         instance.
5398
5399         Fixes #491483.
5400
5401 2009-04-21  Mark Probst  <mark.probst@gmail.com>
5402
5403         * object-internals.h: The Thread object has no execution_context
5404         member anymore.
5405
5406         * threads.c, threadpool.c, threads-types.h: Accessor functions for
5407         the execution context.
5408
5409         * appdomain.c: Bump corlib version.
5410
5411 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5412
5413         * verify.c (do_newobj): Improve error message.
5414
5415 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5416
5417         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
5418         is nested in the filter block.
5419
5420         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
5421         block is not fully nested.
5422
5423         Fixes #495656.
5424
5425 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5426
5427         * verify.c (verify_type_compatibility_full): Compare MonoClass and
5428         not MonoType to check for equality of valuetypes as the generic type
5429         definition allows for two different encodings: the generic type definition
5430         class or a generic instance over the GTD arguments.
5431
5432         Fixes #496175.
5433
5434 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5435
5436         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
5437
5438         * verify.c (do_initobj): Improve error message.
5439
5440 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5441
5442         * metadata-verify.c: Enable pe verification as the issue with #496453
5443         is that the authenticode data directory have a different unspecified
5444         format. Ignore it for now.
5445
5446         * pedump.c: Run the metadata verifier together with the IL verifier.
5447
5448         Fixes ##496453.
5449
5450 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
5451
5452         * metadata-verify.c: Temporarily disable pe verification due to #496453.
5453
5454 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5455
5456         * class.c (can_access_type): Check visibility against
5457         the element type for pointers and arrays.
5458
5459         Fixes #496150.
5460
5461 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5462
5463         * metadata-verify.c: Fix cli and table verification to use information
5464         from the MonoImage. A lot of duplicated code got killed.
5465
5466 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5467
5468
5469         This patch starts to integrate the metadata verifier with the runtime code.
5470
5471         This patch causes major regression in functionality for the metadata verifier
5472         as cli and table verification are disabled since they require to be ported to
5473         use MonoImage information.
5474
5475         * image.c (do_mono_image_load): Split the code in this function
5476         into mono_image_load_pe_data and mono_image_load_cli_data.
5477         Add     care_about_pecoff parameter to not load pecoff data.
5478         Call into the metadata verifier for pecoff and cli verification.
5479
5480         * image.c (mono_image_open_raw): New function that doesn't perform
5481         any parsing of the image contents.
5482         
5483         The reason for the 3 new functions is to give pedump better control
5484         into the interaction with the verifier.
5485
5486         * metadata-internals.h: Add new functions from image.c as part of the
5487         internal mono API.
5488
5489         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
5490         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
5491         to make those functions work together with the runtime.
5492
5493         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
5494         true if the image needs to be verified.
5495
5496         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
5497
5498         * pedump.c: Use new metadata verifier API.
5499
5500 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
5501
5502         * object.c (mono_install_vtable_trampoline): Make this receive a
5503         trampoline creation function instead of trampoline, allowing the JIT
5504         to use a different trampoline for each vtable.
5505
5506 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5507
5508         * object.c (mono_raise_exception): Don't reset the thread abort
5509         exception state here.
5510
5511 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5512
5513         * icall-def.h: New icall for getting the thread abort exception
5514         state for a thread.
5515
5516         * object.c, thread.c, object-internals.h: A thread's abort
5517         exception state is now a GC handle.  To get the object it stands
5518         for, we must move it into the current app domain, if it's
5519         different than the one where it originated from.
5520
5521         * appdomain.c: Bump corlib version.
5522
5523         * domain.c, domain-internals.h: New function for setting the
5524         domain and migrate the thread abort exception or not.
5525
5526 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5527
5528         * metadata-verify.c: Add initial verification of the
5529         field table.
5530
5531 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5532
5533         * metadata-verify.c: Add a macro to conditionally enable
5534         dumping of verification information. Add  make_coded_token
5535         and search_sorted_table to enable search sorted tables
5536         by a given coded token.
5537
5538 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5539
5540         * metadata-verify.c: Add array mapping from table index
5541         to description offset. Add get_col_offset and get_col_size
5542         functions.
5543
5544 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5545
5546         * metadata-verify.c: Add remaining table descriptions offsets.
5547         Add remaining coded index descriptions.
5548
5549 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5550
5551         * metadata-verify.c: Fixed constant table description.
5552         Fixed calculation of HasCustomAttribute coded index size.
5553         Fixed calculation of size for many table indexes. 
5554
5555 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5556
5557         * pedump.c (dump_metadata): Dump table offset instead
5558         of useless pointer in memory.
5559
5560 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5561
5562         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
5563
5564 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5565
5566         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
5567         a missing of for interface types.
5568
5569 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5570
5571         * metadata-verify.c (verify_pe_optional_header): Add comment of why
5572         the code is commented.
5573
5574         * metadata-verify.c (verify_resources_table): Remove spurious printf
5575         and don't fail if there are unmanaged resources. Gmcs generates a useless
5576         one     for all assemblies - I bet it's some MS compatibility junk.
5577
5578 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5579
5580         * metadata-verify.c (verify_typedef_table): Verify the extends field.
5581
5582         * metadata-verify.c (mono_image_verify): Add a is_corlib.
5583
5584         * verify-internals.h: Same.
5585
5586         * pedump.c: Fix for mono_image_verify new signature.
5587
5588 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5589
5590         * metadata-verify.c (verify_typedef_table): Verify for some invalid
5591         flags combinations.
5592
5593 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5594
5595         * metadata-verify.c (verify_module_table): Ignore the generation field.
5596
5597 2009-04-15  Martin Baulig  <martin@ximian.com>
5598
5599         * debug-mono-symfile.c
5600         (mono_debug_symfile_lookup_location): Don't print a warning for
5601         unknown extended opcodes if they're within 0x40 and 0x7f.
5602
5603 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
5604
5605         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
5606         invoke signatures returning an enum. Fixes #494847.
5607
5608 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5609
5610         * metadata-verify.c: Initial code to verify the typedef table.
5611
5612 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5613
5614         * verify.c (mono_method_verify): Don't fail if an unconditional branch
5615         with non empty stack happens before the beginning of a try block.
5616
5617         Fixes #494812.
5618
5619 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5620
5621         * metadata-verify.c: Verify typename and typenamespace fields of
5622         the typeref table.
5623
5624 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5625
5626         * metadata-verify.c: Initial code to verify the typeref table.
5627
5628 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5629
5630         * verify.c (verify_delegate_compatibility): Fix error message.
5631
5632 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
5633
5634         * security-core-clr.c: Fix typo
5635
5636 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5637
5638         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
5639         a MonoGHashTable to keep its values alive.
5640         (emit_marshal_boolean): Fix a warning.
5641
5642 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5643
5644         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
5645         not have any interface configured for IPv4/IPv6.
5646
5647 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5648
5649         * assembly.c: fix typo in error message.
5650
5651 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5652
5653         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
5654         allocating the location holding the this argument to prevent
5655         'too many root sets' errors.
5656
5657         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
5658         to mark fields as special static.
5659         (mono_field_static_get_value): Handle special static fields.
5660         (mono_field_static_set_value): Ditto.
5661
5662         * class-internals.h (struct _MonoClassField): Document this.
5663
5664 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5665
5666         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
5667           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
5668           case.  This will handle when managed code returns null to native code.
5669
5670         Code is contributed under MIT/X11 license.
5671
5672 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5673
5674         * object.c (build_imt_slots): Changing a free to a g_free to match
5675           the g_malloc0 in add_imt_builder_entry that allocated this memory.
5676
5677         Code is contributed under MIT/X11 license.
5678
5679 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5680
5681         * marshal.c (emit_marshal_boolean): Adding code to ensure that
5682           the correct TRUE value is passed through the marshaling layer.
5683
5684         Code is contributed under MIT/X11 license.
5685
5686 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
5687
5688         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
5689         correctly. Fixes #492330.
5690         
5691         * marshal.c: Fix the embedding of object pointers into JITted code in
5692         the native-to-managed wrappers by allocating some GC tracked memory, and
5693         embedding the address of that.
5694
5695 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
5696
5697         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
5698         pointers into the vtable.
5699
5700 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
5701
5702         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
5703
5704         * verify.c (verify_ldftn_delegate): Improve error message.
5705
5706 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5707
5708         * reflection.c (my_mono_class_from_mono_type): Remove.
5709
5710 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5711
5712         Prepare to reduce memory usage of owner-less generic parameters (1/n)
5713         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
5714         and constraints fields into ...
5715         (MonoGenericParamInfo): ... this.
5716         (mono_generic_param_info, mono_generic_container_get_param_info):
5717         New accessors.
5718         * class.c, debug-helpers.c, icall.c: Update to changes.
5719         * metadata.c, reflection.c, verify.c: Likewise.
5720
5721 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
5722
5723         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
5724
5725         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
5726         
5727         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
5728         booleans with sbytes.
5729
5730 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5731
5732         * class.c (can_access_instantiation): Verify accesibility of element types
5733         for arrays and pointers.
5734
5735         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
5736
5737         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
5738
5739         Fixes #493068.
5740
5741 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5742
5743         * verify.c (do_invoke_method): Improve error messages.
5744
5745 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
5746
5747         * verify.c:  Fixing the MSVC build.
5748
5749         Code is contributed under MIT/X11 license.
5750
5751 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5752
5753         * security-core-clr.c: Simplify get_reflection_caller not to call
5754         mono_method_get_last_managed (another stack walk) and adjust the
5755         callers to handle a (should not happen) NULL return value.
5756
5757 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5758
5759         Add accessors to some MonoGenericParam fields
5760         * class-internals.h (mono_generic_param_owner): New accessor.
5761         (mono_generic_param_num): Likewise.
5762         (mono_type_get_generic_param_owner): New helper.
5763         (mono_type_get_generic_param_num): New helper.
5764         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
5765
5766 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5767
5768         * class-internals.h (mono_generic_container_get_param): New wrapper.
5769         * class.c, icall.c, metadata.c, verify.c: Use it.
5770
5771 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5772
5773         Fix gtest-252.cs
5774         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
5775         the standard case/loop.  In particular, don't complain about
5776         references to generic type definitions.
5777
5778 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
5779
5780         * debug-helpers.c (dis_one): Decode string arguments.
5781
5782 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5783
5784         * pedump.c (dump_verify_info): Dump type name correctly.
5785
5786 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5787
5788         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
5789         are larger than code size.
5790
5791         This can happen in valid code if the try/catch block is not followed by any instruction
5792         and do a backward branch on the leave instruction.
5793
5794         Fixes #492494.
5795
5796 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
5797
5798         * security-core-clr.c: Fix typo while comparing second method names
5799         in can_avoid_corlib_reflection_delegate_optimization
5800
5801 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5802
5803         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
5804
5805         Fixes #487738.
5806
5807 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5808
5809         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
5810         a MVAR using a class context.
5811
5812         Fixes #490335.
5813
5814 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
5815
5816         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
5817
5818         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
5819
5820         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
5821         functions supplied by the JIT for the SGEN GC.
5822
5823         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
5824         
5825 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5826
5827         monitor.c (mono_monitor_try_enter_internal):
5828         Added calls to profile monitor contentions.
5829         Also duplicated a small piece of code (the "get the monitor" logic)
5830         from the fast path to the slow path, and changed the relevant goto
5831         statements, so that monitor acquisition events can be emitted from the
5832         slow path (this is by Paolo Molaro).
5833
5834 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5835
5836         * profiler.c, profiler.h, profiler-private.h:
5837         Added support for profiling monitor contentions.
5838
5839 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
5840
5841         * metadata-verify.c: Verify the modules table.
5842
5843 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
5844
5845         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
5846         using the context of the method been verifier and not of the method been called.
5847
5848         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
5849         safely inflate generic types. 
5850
5851 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
5852
5853         * security-core-clr.c: Change the strategy for checking the 
5854         "reflection using delegates optimization" to avoid unneeded 
5855         attributes in multiple class libraries.
5856
5857 2009-04-02  Mark Probst  <mark.probst@gmail.com>
5858
5859         * sgen-gc.c: Remove object element in the disappearing link struct
5860         by storing the object pointer in the link.
5861
5862 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5863
5864         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
5865
5866 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5867
5868         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
5869
5870         * verify.c (mono_method_verify): Do proper bounds checking of exception
5871         clause ranges.
5872
5873 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5874
5875         * loader.c (mono_field_from_token): Don't crash if the field parent could
5876         not be decoded.
5877
5878 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5879
5880         * sgen-gc.c: Execute critical finalizers after ordinary
5881         finalizers.
5882
5883         * class-internals.h, domain.c: Add CriticalFinalizerObject to
5884         mono_defaults.
5885
5886 2009-03-31 Jb Evain <jbevain@novell.com>
5887
5888         * verify.c (do_ldstr): don't check if a string is in the user strings
5889         heap if the current image is dynamic.
5890
5891 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5892
5893         * sgen-gc.c: Wait until the last finalizer has executed when
5894         returning from WaitForPendingFinalizers.
5895
5896 2009-03-31  Martin Baulig  <martin@ximian.com>
5897
5898         * mono-debug-debugger.h (MonoDebuggerEvent): Add
5899         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
5900         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
5901         (mono_debugger_event_create_appdomain): New function.
5902         (mono_debugger_event_unload_appdomain): New function.
5903
5904         * appdomain.c (mono_domain_create_appdomain_internal): Call
5905         mono_debugger_event_create_appdomain().
5906
5907 2009-03-31  Martin Baulig  <martin@ximian.com>
5908
5909         * mono-debug-debugger.c
5910         (mono_debugger_register_class_init_callback): Also register the
5911         class init callback if the class is already initialized to make
5912         things work with shadow copied assemblies.
5913
5914 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
5915
5916         * security-core-clr.c
5917         (mono_security_core_clr_ensure_reflection_access_field): Let 
5918         critical code access the field (just like we do for methods). Use
5919         check_field_access helper.
5920         (mono_security_core_clr_ensure_reflection_access_method): Use 
5921         check_field_access helper.
5922
5923 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5924
5925         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
5926         call the run-finalize function directly.
5927
5928         * gc.c, gc-internal.h: Make run_finalize() non-static.
5929
5930 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5931
5932         * sgen-gc.c: Use a separate struct for disappearing links.
5933
5934 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5935
5936         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
5937         * MaxIOVectorLength enabled, just ignore them.
5938         Fixes bug #349688.
5939
5940 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
5941
5942         * metadata-verify.c: Fix eglib build.
5943
5944 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
5945
5946         * threads-types.h: Fix the win32 build.
5947
5948 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
5949
5950         * class.c: move coreclr inheritance/override checks to 
5951         security-core.clr.c
5952         * security-core.clr.c|h: add code from class.c with additional
5953         documentation. Fix override check when the method is not critical.
5954
5955 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
5956
5957         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
5958         (match_class): Ditto.
5959
5960 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5961
5962         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
5963
5964         * metadata-verify.c: Implement table layout row size calculation. Verify
5965         the total size of the tables.
5966
5967 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5968
5969         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
5970
5971 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5972
5973         * appdomain.c:
5974         * console-io.[ch]: added new mono_console_init() to make sure that
5975         file descriptors 0, 1 and 2 are opened.
5976         Bug #489019 fixed.
5977
5978 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
5979
5980         * appdomain.h: Export a new callback type and a new function to
5981         set this callback. This allow a mono host to provide it's own
5982         definition for "platform code".
5983         * metadata-internals.h: Add a core_clr_platform_code flag on 
5984         _MonoImage to (cache and) know if it is representing platform 
5985         code.
5986         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
5987         on platform code images.
5988         * security-core-clr.c|h 
5989         (mono_security_set_core_clr_platform_callback): Allow the host
5990         to provide it's own platform check definition.
5991         (mono_security_core_clr_determine_platform_image): Detect if an 
5992         image is platform code (using the specified callback).
5993         (mono_security_core_clr_is_platform_image): Return cached value 
5994         for platform code.
5995
5996 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
5997
5998         * threads.c (mono_create_thread): New helper function to wrap CreateThread
5999         which has different parameter types for the 'tid' argument in windows and
6000         the io-layer.
6001
6002         * appdomain.c attach.c threads.c: Use the new helper.
6003
6004 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
6005
6006         * metadata-verify.c: Verify valid table bits.
6007
6008 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
6009
6010         * metadata-verify.c (verify_metadata_header): Store size in the size field.
6011
6012         * metadata-verify.c: Add initial table schema verification.
6013
6014 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
6015
6016         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
6017         obtain the refclass argument needed by mono_param_get_objects (). Fixes
6018         #488383.
6019
6020         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
6021
6022         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
6023
6024 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
6025
6026         * security-core-clr.c: Add/update documentation
6027
6028 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
6029
6030         * marshal.c (emit_marshal_object): Generate code to throw an exception
6031         instead of throwing it. Fixes #488670.
6032
6033 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6034
6035         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
6036         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
6037         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
6038         and add a call to mono_security_core_clr_ensure_delegate_creation
6039         to do the extra checks required by CoreCLR.
6040         * security-core-clr.c|h: Add function to check delegate creation,
6041         both in the binding and accessibility, under CoreCLR.
6042
6043 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
6044
6045         * reflection.c (mono_reflection_create_dynamic_method): when 
6046         coreclr is enabled make sure that every resolved object are
6047         checked (e.g. field and method access).
6048         * security-core-clr.c|h: Add function to check objects resolved
6049         when a dynamic method is created.
6050
6051 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
6052
6053         * metadata-verify.c: Cache directory rva translations.
6054
6055         * metadata-verify.c: Add cli-header and streams verification.
6056
6057 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
6058
6059         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
6060         the wrong offset (8 instead of 6).
6061
6062 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
6063
6064         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
6065         methods, return the native function address itself. Fixes
6066         #487758.
6067
6068 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6069
6070         * console-io.c: some of the values for control characters might not be
6071         present.
6072
6073 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
6074
6075         * exception.c|h: Add helpers to create [Field|Method]AccessException
6076         * icall.c: Add required coreclr check calls for field reflection.
6077         Move the existing (method) check logic into security-core-clr.c
6078         * security-core-clr.c: Add functions to check if the access of a
6079         field or method is allowed when reflecting under coreclr. This is
6080         mostly done using a stack walk to find the "real" caller: i.e. the
6081         code that is calling the reflection
6082
6083 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
6084
6085         * gc-internal.h: Change location of gc_wrapper.h
6086
6087 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
6088
6089         * class.c: Simplification to coreclr checks for overrides that
6090         makes it easier to set breakpoints.
6091
6092 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
6093
6094         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
6095         mono_security_core_clr_method_level): Avoid potential 
6096         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
6097         user/application code) and make it easier to set breakpoints
6098
6099 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6100
6101         * metadata-verify.c: Reject cli header tables that mono don't handle.
6102
6103 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6104
6105         * pedump.c: Fix CLI header dumping.
6106
6107 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6108
6109         * metadata-verify.c: More CLI header verification.
6110
6111 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
6112
6113         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
6114
6115 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
6116
6117         * metadata-verify.c: Initial verification of the CLI header.
6118
6119 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
6120
6121         * metadata-verify.c (verify_resources_table): Fix verification of zero
6122         sized resource section and id entries count.
6123
6124 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
6125
6126         * icall.c: Handle user types in many Type icalls. Fixes #486303.
6127
6128 2009-03-17  Jb Evain  <jbevain@novell.com>
6129
6130         * profiler.c: call mono_gc_base_init from mono_profiler_load.
6131
6132 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
6133
6134         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
6135         (mono_gc_make_descr_for_array): Ditto.
6136
6137 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
6138
6139         * verify.c (mono_verifier_is_class_full_trust): Add support for
6140         CoreCLR security mode where trusted assemblies are defined as
6141         "platform code".
6142
6143 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6144
6145         * metadata-verify.c: Add minimal PECOFF resource verification.
6146
6147 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6148
6149         * metadata-verify.c: Be less restrictive with some coff fields.
6150
6151 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6152
6153         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
6154         params as boxed values on stack. Fixes #485706.
6155
6156 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
6157
6158         * console-io.c: the termios values may vary in different flavors of unix.
6159
6160 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
6161
6162         * console-io.[ch]: return the entire set of control characters when
6163         initializing the terminal.
6164         * appdomain.c: bump corlib version.
6165
6166 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
6167
6168         * mono-perfcounters.c: added support for in-process custom
6169         performance counters.
6170
6171 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6172
6173         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
6174
6175 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6176
6177         * metadata-verify.c: Verify the data pointed by the import table. 
6178
6179 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6180
6181         * metadata-verify.c (load_data_directories): Store data
6182         directory contents.
6183
6184         * metadata-verify.c: Verify the import table. 
6185
6186 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6187
6188         * metadata-verify.c: Verify data directories.
6189
6190 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6191
6192         * metadata-verify.c: Check section header flags.
6193
6194 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
6195
6196         * appdomain.c: if the assembly name is a shadow-copied file, return
6197         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
6198         in mono_make_shadow_copy.
6199         * icall.c: if the assembly name is a shadow-copied file, replace it
6200         with the original assembly path.
6201
6202         Bug #484244 fixed. NUnit tests for corlib can be run without
6203         --noshadow now.
6204
6205 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
6206
6207         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
6208         entries when the table is reallocated.
6209
6210         * icall.c: Allocate the memory used by the mono_ptr_array macros using
6211         mono_gc_alloc_fixed () since it contains GC refs.
6212
6213 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
6214
6215         * reflection.c (ensure_complete_type): New helper function to call
6216         type resolve handlers for unfinished dynamic types.
6217         (resolve_object): Call it for MonoClassFields. Fixes #483852.
6218
6219 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
6220
6221         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
6222         #483247.
6223
6224 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
6225
6226         * appdomain.c (get_shadow_assembly_location): Fix memleak.
6227
6228 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
6229
6230         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
6231         between GCHandles of type WeakTrackResurrection and the objects they
6232         point to.
6233
6234         * gc.c: Partly implement the sematics of GCHandles of type 
6235         WeakTrackResurrection: these handles should only be cleared after the
6236         finalizer of the object they are pointing to has ran.
6237
6238 2009-03-06  Mark Probst  <mark.probst@gmail.com>
6239
6240         * icall.c: Partially revert r126631 because using the jump
6241         trampolines for generic shared methods makes it superfluous.
6242
6243 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
6244
6245         * threads.c (handle_store): Create the 'threads' hash table with the proper
6246         MONO_HASH_VALUE_GC type.
6247
6248 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
6249
6250         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
6251         FIRST_GC_TRACKED.
6252
6253         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
6254         and LAST_GC_TRACKED as a GC root.
6255
6256         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
6257
6258         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
6259         the static data even if it consists of 1 reference.
6260
6261         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
6262         if there is a GC descriptor.
6263
6264         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
6265         instead of through the GC since they contain no object references.
6266
6267 2009-03-05  Mark Probst  <mark.probst@gmail.com>
6268
6269         * generic-sharing.c (instantiate_other_info): Always return a jump
6270         trampoline for method code.
6271
6272 2009-03-05  Marek Habersack  <mhabersack@novell.com>
6273
6274         * culture-info-tables.h: generated to include the en-tt culture.
6275
6276 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
6277
6278         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
6279         capture the thread context.
6280
6281         * object.c (mono_async_result_new): Cache the invoke wrappers to
6282         ExecutionContext::Capture.
6283
6284 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
6285
6286         * marshal.h: Add a prototype for what mono_compile_method returns
6287         for invoke wrappers.
6288
6289         * gc.c: Use the new prototype declaration.
6290
6291 2009-03-04  Geoff Norton  <gnorton@novell.com>
6292
6293         * boehm-gc.c: Add some MONO_LOG tracing for the GC
6294         * gc-internal.h:
6295         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
6296
6297 2009-03-04  Martin Baulig  <martin@ximian.com>
6298
6299         * mono-debug.h
6300         (mono_debugger_runtime_invoke): Removed.
6301
6302         * mono-debug-debugger.c
6303         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
6304
6305 2009-03-02  Martin Baulig  <martin@ximian.com>
6306
6307         * mono-debug.h
6308         (mono_debugger_unhandled_exception): Removed.
6309         (mono_debugger_handle_exception): Removed.
6310         (mono_debugger_throw_exception): Removed.
6311
6312         * mono-debug.c
6313         (mono_debug_debugger_version): Bump to 5.
6314
6315         * mono-debug-debugger.c: Moved the exception handling code to
6316         ../mini/debug-mini.c
6317
6318 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6319
6320         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
6321         finalize_objects_hash.
6322
6323         * gc.c: Use the separate lock to access the finalize_objects_hash field.
6324         
6325         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
6326         field.
6327
6328         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
6329         cache.
6330
6331         * image.c (mono_image_close): Free it.
6332         
6333         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
6334         allowing a creation of a wrapper which invokes its method using a CALLVIRT
6335         on the this argument.
6336
6337         * gc.c (run_finalize): Optimize the calling of the finalizers.
6338
6339 2009-03-03  Martin Baulig  <martin@ximian.com>
6340
6341         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
6342         of the `MonoGenericInst' changes.
6343
6344 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6345
6346         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
6347         mono_array_class_get_cached to reduce locking contention. Extract
6348         a domain var.
6349
6350         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
6351         intermediary managed arrays. Use caching version of mono_array_new
6352         to allocate the result array.
6353
6354         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
6355
6356         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
6357
6358         * locales.c (create_names_array_idx):  Use mono_array_new_cached
6359         to reduce locking contention.
6360
6361 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6362                 
6363         * object.c (mono_method_add_generic_virtual_invocation): Put back the
6364         thunk builder code for the non-interface case.
6365
6366 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
6367
6368         * object.c (get_generic_virtual_entries): New helper function to collect
6369         the virtual generic method instances which need to be added to an IMT
6370         thunk.
6371         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
6372         Instead of creating a new IMT thunk, reset the vtable slot to the
6373         trampoline, the thunk will be created the next time the trampoline is called.
6374         (build_imt_slots): Add support for virtual generic methods in interfaces by
6375         adding to the IMT thunk all the methods registered using 
6376         mono_method_add_generic_virtual_invocation ().
6377
6378         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
6379         (struct _MonoIMTCheckItem): Ditto.
6380
6381         * object.c (mono_method_add_generic_virtual_invocation): Take a
6382         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
6383         the IMT thunk to include all items.
6384         
6385         * object.c (mono_class_create_runtime_vtable): Add a missing
6386         mono_loader_unlock ().
6387
6388 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6389
6390         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6391
6392         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
6393
6394 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6395
6396         * object-internals.h: Rename _MonoReflectionEvent to
6397         MonoReflectionMonoEvent so it reflects the right managed type.
6398         Add a MonoReflectionEvent that correctly represents System.EventInfo.
6399
6400         * icall.c:
6401         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
6402         type.
6403
6404 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6405
6406         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
6407         intermediary managed arrays. Use caching version of mono_array_new
6408         to allocate the result array.
6409
6410 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6411
6412         * reflection.c: Use cached version of mono_array_new alongside
6413         the mono_reflection_get_custom_attrs_by_type call path.
6414
6415 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6416
6417         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
6418         intermediary managed arrays. Use caching version of mono_array_new
6419         to allocate the result array.
6420
6421         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
6422
6423 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6424
6425         * icall.c: Add small implementation of a growable stack bound array.
6426
6427         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
6428
6429         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
6430         intermediary managed arrays. Use caching version of mono_array_new
6431         to allocate the result array.
6432
6433 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
6434
6435         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
6436         helps Enum::CompareTo to be implemented without reboxing all enums
6437         to their underlying type.
6438 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
6439
6440         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
6441         since it acquires a global lock leading to scalability problems.
6442
6443         * profiler.c: Make the stat profiler work with multiple appdomains, this
6444         currently only works when no appdomains are unloaded.
6445
6446 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
6447
6448         * appdomain.c: make the check to avoid copying when the assembly is
6449         already shadow copied actually work.
6450
6451 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
6452
6453         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6454
6455         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
6456         changes to the managed side.
6457
6458 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
6459
6460         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
6461         classes + a separate lock for it, as it is used frequently at runtime, not
6462         just during metadata loading/JIT compilation.
6463
6464         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
6465         for szarrays.
6466         
6467         * object-internals.h (mono_class_from_name_cached): New macro to cache
6468         the results of the lookup locally without having to declare a static
6469         variable to hold it.
6470         (mono_class_get_field_from_name_cached): Ditto.
6471         (mono_array_class_get_cached): Ditto.
6472
6473         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
6474         the new macros.
6475         
6476         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
6477         slower search in metadata.
6478
6479         * pedump.c: Fix a warning.
6480
6481 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
6482
6483         * reflection.c (encode_locals): Add checks for user types.
6484         (method_encode_clauses): Ditto.
6485         (method_encode_code): Ditto.
6486         (mono_image_create_token): Ditto.
6487
6488         * object-internals.h: Change the type of more fields from MonoReflectionType*
6489         to MonoObject*.
6490
6491 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
6492
6493         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
6494         the a thread does not suspend within 100ms.
6495
6496         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
6497         in addition to StopRequested as well.
6498
6499         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
6500
6501         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
6502         search the method_hash before inserting a new entry, to avoid crashes when
6503         the same method is inserted multiple times, causing the old 
6504         MonoDebugMethodInfo structure to be freed by the value dtor function.
6505
6506 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6507
6508         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
6509         SO_EXLUSIVEADDRUSE where available.
6510
6511 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
6512
6513         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
6514         runtime invoke wrappers, this time it is string ctor wrappers, which
6515         pass a dummy string as 'this' instead of their obj argument. Fixes
6516         #478473.
6517
6518 2009-02-21  Jb Evain  <jbevain@novell.com>
6519
6520         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
6521         only get create_culture once.
6522
6523 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
6524
6525         * reflection.c (mono_reflection_setup_internal_class): Move the user type
6526         check before the locking.
6527         
6528         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
6529         (mono_reflection_create_runtime_class): Ditto.
6530         (mono_reflection_sighelper_get_signature_local): Ditto.
6531         (mono_reflection_sighelper_get_signature_field): Ditto.
6532
6533         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
6534         is a System.MonoType object or similar.
6535         (monotype_cast): New helper function to cast a MonoObject to a 
6536         MonoReflectionType object.
6537
6538         * object-internals.h: Change MonoReflectionType* members in structures to
6539         MonoObject* members to force the usage of the monotype_cast () function.
6540
6541         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
6542         structures/arrays. This causes us to assert instead of crashing when 
6543         instances of user defined subclasses of System.Type are encountered.
6544
6545 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6546
6547         * cil-coff.h:
6548         * icall-def.h:
6549         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
6550         win32 resource loaded from a PE file.
6551
6552         * image.c: fix mono_image_lookup_resource.
6553
6554 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6555
6556         * icall-def.h:
6557         * threads-types.h:
6558         * threads.c: added internal call for WaitHandle.SignalAndWait.
6559
6560 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
6561
6562         * cominterop.c : Adding cominterop_type_from_handle and 
6563           registering it as an icall.  Replacing all references
6564           to type_from_handle.
6565
6566         Code is contributed under MIT/X11 license.
6567
6568 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6569
6570         * Makefile.am: Add lock-tracer.h and lock-trace.c.
6571
6572         * appdomain.c: Call the tracer init function.
6573
6574         * domain-internals.h: Enable the tracer for the domain locks.
6575
6576         * image.c: Enable the tracer for image locks.
6577
6578         * loader.c: Enable the trace for the loader lock.
6579
6580         * lock-tracer.h:
6581         * lock-tracer.c: Initial implementation of the lock trace utility.
6582         The tracer requires a compile time define to be enabled and a env var
6583         to be enabled at runtime.
6584
6585 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6586
6587         * domain.c (mono_domain_code_foreach): Improve documentation.
6588
6589 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6590
6591         * appdomain.c:
6592         * generic-sharing.c:
6593         * object.c:
6594         * reflection.c:  Adjust locking order to the new semantics where the loader lock
6595         comes first.
6596
6597 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
6598
6599         * domain.c: Add mono_domain_code_* functions that perform locking
6600         around the domain codeman.
6601
6602         * domain-internals.h: Export those functions.
6603
6604         * object.c: Use new functions instead of acquiring the domain lock.
6605
6606 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
6607
6608         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
6609         delegate. Fixes #477396.
6610
6611 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6612
6613         * reflection.c (create_custom_attr): Get rid of alloca.
6614
6615 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
6616
6617         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
6618           Adding exception handling for all CCW calls.
6619
6620         Code is contributed under MIT/X11 license.
6621
6622 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6623
6624         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
6625
6626         * marshal.c (emit_marshal_boolean): Add null checks to the new 
6627         native->managed marshalling code. Fixes #476247.
6628
6629 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6630
6631         * class.c (mono_class_get_vtable_entry): Move the addition of
6632         static rgctx invoke wrappers for vtable methods here, this simplifies
6633         a lot of code and causes fewer rgctx wrappers to be created.
6634
6635         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
6636         name of the statistics to begin with an uppercase.
6637
6638 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6639
6640         * reflection.c: Revert previous change as it breaks the build.
6641         
6642 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6643
6644         * verify.c: Properly handle SZARRAY element type.
6645
6646         Fixes #474271.
6647
6648 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6649
6650         * reflection.c (mono_image_create_method_token): Correctly encode
6651         MethodDef MemberRefParent token.
6652
6653         Fixes #472845.
6654
6655 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6656
6657         * image.c (mono_image_close): Delete the critical section before
6658         freeing the memory holding it.
6659
6660 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6661
6662         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
6663         Fixes #476257.
6664
6665 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6666
6667         * pedump.c (main): Call mono_marshal_init so pedump
6668         doesn't crash.
6669
6670 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6671
6672         * loader.c (method_from_memberref): Properly fix #474271 and
6673         don't break the runtime bad.
6674
6675 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6676
6677         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
6678         (mono_domain_alloc0): Ditto.
6679
6680 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6681
6682         * loader.c (method_from_memberref): Don't abort if the array
6683         method is not found. A regular loader failure is more informative
6684         and correct.
6685
6686         Fixes #474271.
6687
6688 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6689
6690         *loader.c: Guard MonoImage::method_cache/methodref_cache
6691         using the image lock instead of the loader lock.
6692
6693         * metadata.h: Add comments about which fields are protected by
6694         the image lock.
6695
6696 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6697
6698         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
6699
6700         * generic-sharing.c (mono_method_construct_object_context): Remove the
6701         wrapper_type == NONE assert, it is not needed.
6702
6703 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
6704
6705         * reflection.c (clear_cached_object): New helper function.
6706         (mono_method_clear_object): New function to clear the cached reflection
6707         objects for a dynamic method.
6708
6709         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
6710         Partly fixes # 463323.
6711         
6712 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6713
6714         * class.c:
6715         * loader.c:
6716         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
6717
6718 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6719
6720         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
6721         take the image lock instead of the loader lock.
6722
6723         * metadata-internals.h: Export new functions.
6724
6725 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6726
6727         * domain.c (app_config_parse): Remove another use of stat that is
6728         not necessary as g_file_get_contents already does the presence
6729         check. 
6730
6731 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6732
6733         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
6734
6735         * marshal.c: Move the bstr handling code to cominterop.c.
6736
6737         * marshal.c: Remove some COM interop code missed previously.
6738
6739 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6740
6741         More Paolo patches from the Wii port:
6742         
6743         * security.c: Remove ves_icall_System_Environment_get_UserName
6744         from here.
6745
6746         * icall.c: And put ves_icall_System_Environment_get_UserName
6747         here. 
6748
6749         * appdomain.c (mono_set_private_bin_path_from_config): Remove
6750         redundant call to stat that was only used to test for the file
6751         existence.   Patch from Paolo.
6752
6753         * gc.c (run_finalize): If COM is disabled, do not link in
6754         mono_marshal_free_ccw.
6755
6756         * generic-sharing.c: Use alloca.h here as well.
6757
6758 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
6759
6760         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
6761
6762 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6763
6764         * cominterop.c cominterop.h: New files.
6765
6766         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
6767         function/typedefs which are needed by cominterop.c global.
6768
6769 2009-02-12  Mark Probst  <mark.probst@gmail.com>
6770
6771         * generic-sharing.c: Don't take the loader lock to guard image
6772         mempool allocs.
6773
6774 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6775
6776         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
6777         called without the loader lock which is required to guard MonoImage:tokens.
6778
6779 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6780
6781         * class.c:
6782         * metadata.c:
6783         * method-builder.c:
6784         * marshal.c:
6785         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
6786
6787 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6788
6789         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6790         Rework the code to use regular mono_image_alloc/0.
6791
6792         * loader.c: Rework the code to use regular mono_image_alloc/0.
6793
6794         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6795
6796 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
6797
6798         * object-internals.h : Fixing a typo in the 
6799           MonoReflectionComVisibleAttribute struct.
6800
6801         * marshal.c (cominterop_com_visible): Check the implemented 
6802           interfaces for ComImport.
6803
6804         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
6805           assume that bools should be treated as VARIANTBOOLs.
6806
6807         * marshal.c (emit_marshal_boolean): Adding cases for 
6808           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
6809
6810         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
6811           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
6812
6813         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
6814           should be treated as VARIANTBOOLs.    
6815
6816         Code is contributed under MIT/X11 license.
6817
6818 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6819
6820         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
6821         allocation with the image lock.
6822
6823 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6824
6825         This patch is the last of a series to remove explicit reference of MonoImage::mempool
6826         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
6827
6828         * object.c: Add mono_string_to_utf8_image.
6829
6830         * object-internals.h: Export mono_string_to_utf8_image.
6831
6832         * reflection.c: Rework all explicit references to the the image mempool to go thought
6833         the mono_image_alloc set of functions.
6834
6835 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6836
6837         This patch is the third of a series to remove explicit reference of MonoImage::mempool
6838         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
6839         and generics-sharing.c.
6840
6841         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
6842         as first argument. Note that this function remains broken as it doesn't perform locking around the
6843         mempool allocation.
6844
6845         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
6846
6847         * image.c: Add g_slist_append_image.
6848
6849         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
6850         the supplied image for allocation. Move code into mono_metadata_field_info_full.
6851
6852         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
6853         Fix all related code to do the same.
6854
6855         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
6856
6857         * metadata-internals.h: Fix the signatures.
6858
6859 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6860
6861         This patch is the second of a series to remove explicit reference of MonoImage::mempool
6862         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
6863         and similar to work using MonoImage.
6864
6865         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
6866         MonoMemPool.
6867
6868         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
6869
6870         * class.c (mono_metadata_signature_deep_dup): Same.
6871
6872         * class.c (inflate_generic_type): Same.
6873
6874         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
6875
6876         * metadata.c (mono_metadata_signature_dup_full): Same.
6877
6878         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
6879         mono_metadata_signature_dup_full.
6880
6881         * metadata.c (mono_metadata_type_dup): Same.
6882
6883         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
6884
6885         * reflection.c: Same.
6886
6887         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
6888
6889         * metadata-internals.h: Fix the signatures.
6890
6891         * class-internals.h: Same.
6892
6893 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6894
6895         This patch is the first of a series to remove explicit reference of MonoImage::mempool
6896         and use mono_image_alloc set of functions instead. 
6897
6898         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
6899         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
6900         of a MonoMemPool.
6901
6902         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
6903
6904         * class.c (g_list_prepend_mempool): Removed.
6905
6906         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
6907
6908         * image.c: Add g_list_prepend_image.
6909
6910         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
6911
6912         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
6913
6914
6915 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6916
6917         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
6918         mono_image_unlock.
6919
6920         * image.c (mono_image_init): Init the lock field.
6921  
6922         * image.c (mono_image_init): Cleanup the lock field.
6923
6924         * image.c: Add mono_image_(un)lock functions.
6925
6926 2009-02-11  Mark Probst  <mark.probst@gmail.com>
6927
6928         * class.c, class-internals.h: mono_method_get_context_general()
6929         combines the functionality of mono_method_get_context() and
6930         mini_method_get_context().
6931
6932         * generic-sharing.c, domain-internals.h:
6933         mono_method_construct_object_context() and
6934         mono_domain_lookup_shared_generic() moved from mini.
6935
6936         * icall.c (ves_icall_InternalInvoke): Handle the case where the
6937         method doesn't have the correct instantiation because it's shared
6938         generic code.  Fixes #473999.
6939
6940 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
6941
6942         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
6943
6944         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
6945         
6946 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6947
6948         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
6949
6950         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
6951
6952         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
6953         and recheck the cache for dups after it.
6954
6955         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
6956
6957         Fixes one of the deadlocks found in #473150.
6958
6959 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
6960
6961         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
6962           For Win32, add additional break conditions for accept.
6963
6964         Code is contributed under MIT/X11 license.
6965
6966 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
6967
6968         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
6969         lazily initialize the native wrapper cache.
6970         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
6971         cache, since they are different from the normal wrappers.
6972
6973         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
6974
6975         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
6976         AOT compiled native wrappers.
6977
6978 2009-02-09  Geoff Norton  <gnorton@novell.com>
6979
6980         * appdomain.h:
6981         * security-core-clr.c: Allow enabling core-clr from the embedding
6982         API.
6983
6984 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6985
6986         * socket-io.c: when requesting all the local ips, if there are no
6987         interfaces up and running, MS returns 127.0.0.1.
6988
6989 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6990
6991         * mono-perfcounters-def.h: processor time is an inverse time.
6992         Fixes bug #468625.
6993
6994 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6995
6996         * socket-io.c: an empty host name returns the list of local IPs.
6997         Fixes bug #386637 part 1/2.
6998
6999 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
7000
7001         * verify.c (mono_class_interface_implements_interface): Call
7002         mono_class_setup_interfaces ().
7003         (merge_stacks): Ditto.
7004
7005 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
7006
7007         * class.c (mono_class_setup_interfaces): New function to lazily initalize
7008         klass->interfaces.
7009         (mono_generic_class_get_class): Don't initalize klass->interfaces.
7010         (mono_generic_class_get_class): Ditto.
7011
7012 2009-02-06  U-QUACK\miguel  <miguel@quack>
7013
7014         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
7015         they live in security.c
7016
7017         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
7018         another bit from Paolo's code.
7019
7020 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
7021
7022         * object.c (build_imt_slots): Add a small optimization to avoid inflating
7023         methods which will be discarded by add_imt_builder_entry ().
7024
7025         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
7026         need to be boxed.
7027
7028         * loader.c: Add a statistics for the size of the memberref signature cache.
7029         
7030         * loader.c (find_cached_memberref_sig): New helper function.
7031         (cache_memberref_sig): Ditto.
7032
7033         * loader.c: Cache the result of parsing memberref signatures, since otherwise
7034         they will be parsed again for every generic instantiation, leading to unbounded
7035         memory growth.
7036
7037 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7038
7039         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
7040         parameters of generic methods.
7041
7042         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
7043         after the original method is copied to the inflated method.
7044         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
7045
7046         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
7047         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
7048
7049         * class.c metadata.c: Update after the changes above.
7050
7051 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
7052
7053         * metadata-verify.c: Simplified error handling and added
7054         section table validation.
7055
7056 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7057
7058         * class-internals.h (MonoClassExt): New structure containing rarely used
7059         fields of MonoClass.
7060         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
7061         through a new 'ext' field.
7062
7063         * class.c (mono_class_alloc_ext): New helper function to allocate 
7064         class->ext.
7065
7066         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
7067
7068 2009-02-05  Mark Probst  <mark.probst@gmail.com>
7069
7070         * object.c (mono_object_get_virtual_method): Properly inflate
7071         generic methods.  Fixes #472692.
7072
7073 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
7074
7075         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
7076         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
7077         for the parent type, the created type must be ready to be used on a generic
7078         instantiation.
7079         We fill this_arg/byval_arg if the parent is a generic instance to make sure
7080         we won't have duplicated entries in generic_inst_cache.
7081
7082         Fixes #469553.
7083
7084 2009-02-05  Miguel De Icaza  <miguel@novell.com>
7085
7086         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
7087         replace with plain BSD per the comments on the bug MONO77637.
7088
7089 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7090
7091         * class.c (mono_class_get_generic_class): New accessor function.
7092         (mono_class_get_generic_container): Ditto.
7093
7094         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
7095         fields, similar to the ones in MonoMethod.
7096
7097         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
7098         (mono_class_create_from_typedef): Set klass->is_generic if needed.
7099
7100         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
7101         
7102         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
7103         the same information as element_class->byval_arg.
7104
7105         * class.c reflection.c: Remove references to class->byval_arg.
7106
7107         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
7108         klass->enum_basetype directly.
7109
7110         * verify.c metadata.c object.c icall.c reflection.c: Use 
7111         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
7112         directly.
7113
7114 2009-02-04  Miguel de Icaza  <miguel@novell.com>
7115
7116         * icall-def.h: Remove internal calls for sockets when
7117         DISABLE_SOCKET is defined, file system writing features when the
7118         OS only support reading and not writing data and Policy support if
7119         the Policy is disabled.
7120         
7121         * image.c (do_mono_image_open): Apply Paolo's patches for using
7122         mono_file_map_ APIs here.
7123
7124         * assembly.c: Add support for platforms to avoid prefix
7125         auto-detection. 
7126
7127 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
7128
7129         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
7130         warning.
7131
7132         * class.c (mono_class_inflate_generic_class): New helper function.
7133
7134         * class.c: Use mono_class_inflate_generic_class in a few places. Add
7135         statistics for inflated methods/classes.
7136
7137         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
7138
7139         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
7140         the call is made from Delegate.CreateDelegate () for the invoke method of
7141         a delegate.
7142
7143         * loader.c: Add a statistics for the memory occupied by inflated signatures.
7144
7145         * metadata.c (mono_metadata_signature_size): New helper function.
7146
7147         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
7148         generic instances.
7149
7150         * metadata.c (inflated_method_in_image): Avoid calling 
7151         mono_method_signature () if the method does not already have a signature.
7152
7153 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7154
7155         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
7156         valuetype is compatible with target type, check by inheritance as a
7157         VT is not really compatible with System.ValueType, for example.
7158
7159         * verify.c (do_invoke_method): Improve error message.
7160
7161         * verify.c (do_box_value): If boxing a nullable, use the type argument
7162         on stack instead.
7163
7164         * verify.c (do_newobj): Improve error message.  
7165
7166         Fixes #469549.
7167
7168 2009-02-03  Miguel de Icaza  <miguel@novell.com>
7169
7170         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
7171
7172 2009-02-03  Mark Probst  <mark.probst@gmail.com>
7173
7174         * generic-sharing.c: Don't hold domain lock when calling
7175         instantiate_other_info().  Fixes #471958.
7176
7177         * domain-internals.h, loader.c: Describe locking policy of domain
7178         lock vs loader lock.
7179
7180 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7181
7182         * verify.c (mono_delegate_signature_equal): Make it possible to check
7183         first-arg-bound delegates to static method.
7184
7185         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
7186         static methods with the first arg bound.
7187
7188         Fixes #469529.
7189
7190 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7191
7192         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
7193         errors.
7194
7195         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
7196         under strict mode. Any type, when boxed can be seen as a reference type.
7197
7198         Fixes #469528.
7199
7200 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7201
7202         * object.h: The lower bound of an array is a signed integer value.
7203         Introduce mono_array_lower_bound_t typedef. It should be used instead of
7204         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
7205
7206         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
7207         calculate the upper bound.
7208         
7209         Fixes #471252.
7210
7211 2009-02-02  Miguel de Icaza  <miguel@novell.com>
7212
7213         From Paolo's work, refactored, cleared up:
7214         
7215         * threadpool.c, icall.c: ifdef code that requires a working socket
7216         stack.
7217
7218         * metadata.c (mono_metadata_field_info): Do not attempt to return
7219         a value from a function declared as void.
7220
7221         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
7222         from the console stack.
7223
7224         * assembly.c: use strrchr instead of rindex.
7225
7226         * class.c, object.c, marshal.c, icall.c, reflection.c: include
7227         alloca.h on systems that have it.
7228
7229         * environment.c: Avoid code that uses stuff from
7230         HAVE_SYS_UTSNAME_H
7231         
7232         * appdomain.c: Include sys/time.h.
7233
7234         * console-io.c: include sys/ioctl.h if it is available.
7235
7236 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
7237
7238         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
7239
7240         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
7241         the method builder.
7242
7243         * marshal.c: Set mb->skip_visibility instead of setting it on the method
7244         after it was created and cached, as the later is not thread safe.
7245         
7246 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
7247
7248         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
7249         called while the debugging module is not initialized. Fixes #471669.
7250
7251 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
7252
7253         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
7254
7255         Fixes #471255.
7256
7257 2009-02-02  Mark Probst  <mark.probst@gmail.com>
7258
7259         * generic-sharing.c (lookup_or_register_other_info): Make sure the
7260         loader lock is not taken while the templates lock is held.  Fixes
7261         #471089.
7262
7263 2009-02-02  Mark Probst  <mark.probst@gmail.com>
7264
7265         * metadata.c (type_in_image): Added a check to fix a monodis
7266         crash.
7267
7268 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
7269
7270         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
7271         nullable arguments.
7272
7273         * object.c (mono_runtime_invoke_array): Ditto.
7274         
7275         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
7276         freeing wrappers of dynamic methods.
7277
7278         * loader.c (mono_free_method): Call it. Fixes #463323.
7279         
7280         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
7281         methods taking vtype/byref arguments, to fix yet another bug caused by
7282         the sharing of runtime invoke wrappers. Partly fixes #471259.
7283
7284 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
7285
7286         * debug-mono-symfile.c (check_line): Return NULL instead of returning
7287         <first file in file table>:1 when the IL offset does not have an associated
7288         line number.
7289
7290 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
7291
7292         * mono-debug.c (mono_debug_lookup_locals): New function to return local
7293         variable info for a method.
7294
7295         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
7296         
7297 2009-01-30  Jb Evain  <jbevain@novell.com>
7298
7299         * pedump.c: reuse code from monodis to make sure pedump honors
7300         MONO_PATH, which is needed to verify net_2_1 assemblies.
7301
7302 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
7303
7304         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
7305         there is no line number info.
7306
7307 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
7308
7309         Avoid some MonoType allocations
7310         * reflection.c (mono_reflection_initialize_generic_parameter):
7311         Reuse MonoType from param->pklass rather than allocating one.
7312         (mono_dynamic_image_free): Update to changes.
7313
7314 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7315
7316         Rearrange some code to improve consistency
7317         * reflection.c (mono_reflection_setup_generic_class): Move body ...
7318         (mono_reflection_initialize_generic_parameter): ... here.
7319
7320 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
7321
7322         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
7323         with type constraints as an experiment.
7324
7325         * boehm-gc.c (on_gc_notification): Update mono_stats.
7326
7327 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7328
7329         Avoid some allocations
7330         * class-internals.h (_MonoGenericInst::type_argv): Convert from
7331         pointer to tail array to avoid extra allocation.
7332         * metadata.c (free_generic_inst): Update to changes.
7333         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
7334         on-stack struct.
7335
7336 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
7337
7338         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
7339         return TRUE if the two type objects are the same.
7340
7341 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7342
7343         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
7344         (mono_class_native_size): Use klass->marshal_info->min_align instead of
7345         klass->min_align, since klass->min_align contains the managed alignment,
7346         while the native alignment can be different, like for longs on x86.
7347         Fixes #469135.
7348
7349         * class-internals.h (MonoMarshalType): Add a min_align field.
7350
7351 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
7352
7353         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
7354         the 1.0 format.
7355
7356 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7357
7358         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
7359         some comments about the usage of the used_regs field.
7360
7361         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
7362         Fixes #469217.
7363
7364 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
7365
7366         * appdomain.c: return NULL instead of throwing FileNotFoundException
7367         when LoadAssembly() fails.
7368
7369 2009-01-23  Mark Probst  <mark.probst@gmail.com>
7370
7371         * metadata.c (mono_metadata_generic_param_equal): Only compare the
7372         image if the owner is NULL.  Fixes the AOT failures.
7373
7374 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
7375
7376         * metadata.c (mono_metadata_load_generic_params): Initialize the 
7377         MonoGenericParam structure using memset so the image field is initialized
7378         as well.
7379
7380 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7381
7382         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
7383         a plain store.
7384
7385 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
7386
7387         * class.c (mono_class_setup_vtable_general): In the generic instance
7388         optimization, set method->slot for abstract virtual methods. Fixes part of
7389         #467834.
7390
7391 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7392
7393         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
7394         which signals that the unloading has started but all appdomain services must
7395         remain operational.
7396
7397         * appdomain.c (mono_domain_unload): The initial state for unloading now
7398         is unloading_start and we switch to unloading after the managed call to
7399         AppDomain::DomainUnload has finished.
7400
7401         The new unloading state has to be created because managed code in the
7402         DomainUnload event can depend on things like the threadpool still working.
7403         The domain must remain fully functional while the event executes.
7404
7405         This shown as an issue due to Process::WaitForExit, which waits for
7406         async reads of stdout and stderr to complete. Since those are processed
7407         in the threadpool the code deadlocks because the DomainUnload callback 
7408         waits for the async read finished event, which should have been set by a
7409         threadpool job but has been discarded due to the domain been in unload
7410         state.
7411
7412 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7413
7414         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
7415         image must match.
7416
7417 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7418
7419         * reflection.c (resolve_object): For fields, inflate the class and
7420         then get the field in the inflated class.
7421
7422 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7423
7424         * object-internals.h (struct _MonoException): Added a comment
7425         explaining the new use of trace_ips.
7426
7427 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7428
7429         * generic-sharing.c (inflate_other_data): Inflate array methods
7430         correctly.
7431
7432         * loader.c, class-internals.h: Rename search_in_array_class() to
7433         mono_method_search_in_array_class() and make it non-static.
7434
7435 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7436
7437         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
7438         Hopefully fixes #458168.
7439
7440 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7441
7442         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
7443         as it is performed elsewhere.
7444
7445         Code is contributed under MIT/X11 license
7446
7447 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7448
7449         * mono-perfcounters-def.h: Add counters for asp.net requests total and
7450         requests queued.
7451         * object.c (mono_raise_exception): Increment the exceptions total
7452         counter when an exception is thrown.
7453         * class-internals.h: Add a location for storing the total number of
7454         asp.net requests served.
7455         * mono-perfcounters.c: Implement update support for asp.net counters
7456         from the class libraries. Implement read support for asp.net counters
7457         and exceptions total counter.
7458
7459 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7460
7461         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
7462         accessing klass->methods. Fixes #467385.
7463
7464 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7465
7466         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
7467         for byval arguments without an [Out] attribute. Fixes #467212.
7468
7469         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
7470         Fix compilation under android.
7471         
7472         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
7473         processed, scan them directly after they are copied, to achieve better locality
7474         and cache usage.
7475
7476         * socket-io.c: Applied patch from Koushik Dutta
7477         (koush@koushikdutta.com). Disable IPV6 when running under android.
7478
7479 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7480
7481         * icall.c (ves_icall_InternalExecute): Add write barriers.
7482
7483         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
7484         the GC code.
7485
7486         * sgen-gc.c: Implement write barriers in IL code.
7487
7488 2009-01-17  Geoff Norton  <gnorton@novell.com>
7489
7490         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
7491
7492 2009-01-17  Geoff Norton  <gnorton@novell.com>
7493
7494         * image.c: When unloading the image->references table, there can be gaps
7495         in it.  Ensure that we iterate every entry to avoid leaking assembly references
7496         when unloading an appdomain.
7497
7498 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
7499
7500         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
7501         speed up ptr-in-nursery checks.
7502
7503         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
7504         threads_lock () to prevent deadlocks.
7505
7506         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
7507         does not need to be scanned during minor collections, since writes to it
7508         must use write barriers.
7509
7510 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
7511
7512         * metadata-verify.c: Add pe nt header verification.
7513         
7514 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7515
7516         * gc.c: Fix a few warnings when using SGEN.
7517
7518 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
7519
7520         * metadata-verify.c: Add pe optional header verification.
7521
7522 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7523
7524         * sgen-gc.c: Add support for user defined marker functions, used by
7525         MonoGHashTable to avoid registering a GC root for every hash node.
7526
7527 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7528
7529         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
7530         non-pinned roots into separate hashes to avoid having to traverse them
7531         in functions which are only interested in one kind.
7532
7533 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7534
7535         * metadata-verify.c: Add pe header machine field verification.
7536         
7537 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7538
7539         * metadata-verify.c: Add pe header size verification.
7540
7541 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7542
7543         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
7544         using the GC, they don't contain references.
7545
7546         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
7547
7548 2009-01-13  Geoff Norton  <gnorton@novell.com>
7549
7550         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
7551         AppDomains created on the native side can be cleaned up on the native side.
7552
7553 2009-01-13  Geoff Norton  <gnorton@novell.com>
7554
7555         * appdomain.c: Ensure that we call mono_context_init for the embedding api
7556         as well as the managed api.
7557
7558 2009-01-13  Geoff Norton  <gnorton@novell.com>
7559
7560         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
7561         with a MonoAppDomain initialized against it.
7562
7563 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7564
7565         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
7566         
7567         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
7568
7569         * marshal.c: Avoid setting the exception clauses after a method has been entered 
7570         into the wrapper caches. Fixes #465700.
7571
7572         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
7573         method builder.
7574         (mono_mb_create_method): Set the clauses from the method builder.
7575
7576 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
7577
7578         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
7579         Patch from Makoto Kishimoto.
7580
7581 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7582
7583         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
7584         encoding them as ROOT_DESC_COMPLEX.
7585         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
7586
7587 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
7588
7589         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
7590         no longer point to the nursery.
7591
7592         * sgen-gc.c: Add a few comments/FIXMEs.
7593         
7594         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
7595
7596         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
7597         initialization of the various _method variables thread safe. Fixes
7598         #465377.
7599
7600 2009-01-12  Mark Probst  <mark.probst@gmail.com>
7601
7602         * domain.c, domain-internals.h: Remove the shared_generics_hash
7603         and its lookup functions.
7604
7605 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
7606
7607         * socket-io.c:  Fixing the MSVC build. 
7608
7609         Code is contributed under MIT/X11 license.
7610
7611 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
7612
7613         * metadata-verify.c: Add pe header watermark verification.
7614
7615 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7616
7617         * metadata-verify.c: Add lfanew verification.
7618
7619 2009-01-12  Jb Evain  <jbevain@novell.com>
7620
7621         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
7622         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
7623
7624 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
7625
7626         * socket-io.c: Fix the build.
7627
7628         * environment.c: Fix an #ifdef.
7629
7630 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7631
7632         * threadpool.c (async_invoke_thread): Handle the wait function returning
7633         WAIT_IO_COMPLETION as well.
7634         (async_invoke_io_thread): Ditto.
7635
7636 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
7637
7638         * threads.c: Fixing the Windows build.
7639
7640         Code is contributed under MIT/X11 license.
7641
7642 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7643  
7644         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
7645         interrupt a wait.
7646         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
7647         the thread to wait again.
7648
7649 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7650
7651         * metadata-verify.c: Initial skeleton of the metadata verifier.
7652
7653         * pedump.c: Add support for the metadata verifier.
7654
7655         * verify-internal.h: Export the whole assembly metadata verifier function.
7656
7657 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7658
7659         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
7660
7661 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7662
7663         * Makefile.am: Upgrade dtrace-prelink.sh location.
7664
7665 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7666
7667         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
7668         well. Otherwise the shutdown deadlock that happens on unix will can happen
7669         as well.
7670         If the main thread code finishes too fast it's possible that the finalizer
7671         thread won't have executed yet, won't record itself as the finalizer thread
7672         and the shutdown sequence will wait on it forever.
7673
7674 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7675
7676         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
7677         with MSVC.
7678
7679 2009-01-08  Miguel de Icaza  <miguel@novell.com>
7680
7681         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
7682         Robert Jordan for pointing this out.
7683
7684 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
7685
7686         * icall.c
7687         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
7688         ves_icall_System_IO_DriveInfo_GetDriveType.
7689
7690 2009-01-07  Miguel de Icaza  <miguel@novell.com>
7691
7692         * icall.c: Wrap calls to mono_strtod in CriticalSection
7693         invocations when using eglib, to work around #464316.
7694
7695 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7696
7697         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
7698         return value of GetCurrentDirectory to never access unitialized memory.
7699
7700 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7701
7702         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
7703         return value of GetCurrentDirectory and expand the buffer if needed.
7704
7705         Fixes #459094.
7706
7707 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
7708
7709         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
7710           Adding a call to mono_init_com_types.
7711
7712         Code is contributed under MIT/X11 license.
7713
7714 2009-01-07  Geoff Norton  <gnorton@novell.com>
7715
7716         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
7717         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
7718         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
7719         be the value of the ip buffer.
7720
7721 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7722
7723         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
7724         interfaces_packed here.
7725
7726         Fixes part of #463294.
7727
7728 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7729
7730         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
7731
7732         Fixes part of #463294.
7733
7734 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7735
7736         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
7737         is a boxed complex as well.
7738
7739         Fixes part of #463294.
7740
7741 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7742
7743         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
7744         control if a methodspec should be created for the generic method definition from external assemblies.
7745         Caching of methodspec is done using the handleref hash table.
7746
7747         Fixes #462592.
7748
7749 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
7750
7751         * loader.c (find_method): When searching the interfaces of a class
7752         check the transitive closure of implemented interfaces.
7753
7754         Fixes #463303.
7755
7756 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7757
7758         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
7759         
7760 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7761
7762         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
7763         interfaces calculation to fill_valuetype_array_derived_types.
7764
7765         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
7766         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
7767         for example.
7768
7769         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
7770         interfaces for valuetypes if needed.    
7771
7772         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
7773         for their basetype as well. Types are array expanded if rank is > 0.
7774
7775         Fixes #400716.
7776
7777 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
7778
7779         * socket-io.h : Changing the signature of
7780           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
7781           the blocking state.
7782
7783         * icall-def.h :  Changing the signature of
7784           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
7785
7786         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
7787           For Windows only.  Avoid blocking when calling accept by
7788           querying for a connection via select.  The loop also queries
7789           the thread state every 1000 micro seconds for the thread
7790           stop state.  This will avoid the process hanging on shutdown
7791           when using a TcpChannel that is never connected to.
7792
7793         Code is contributed under MIT/X11 license.
7794
7795 2008-12-30  Marek Safar  <marek.safar@gmail.com>
7796
7797         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
7798
7799 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7800
7801         * class.c (get_implicit_generic_array_interfaces): Extract common
7802         code to a helper function making it a lot easier on the eyes.
7803
7804 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7805
7806         * class.c (get_implicit_generic_array_interfaces): If the internal
7807         enumerator is an interface inflate System.Object instead of itself.
7808
7809         Fixes #461261.
7810
7811 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
7812
7813         * object.c (mono_runtime_invoke_array): Don't assert with
7814         byref nullable types.
7815
7816         * marshal.c (mono_marshal_get_runtime_invoke): To handle
7817         byref nullables we unbox the object and store it on the
7818         stack. 
7819         We can't use the boxed object since it is the T of Nullable<T>
7820         and the boxed representation of a nullable it's underlying type
7821         or null.
7822         We could cheat and create a boxed nullable and use the same
7823         machinery of other byref VTs but this feels like a hack and
7824         using the stack has the bonus of reducing heap pressure.
7825
7826         Fixes #461941.
7827
7828 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
7829
7830         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
7831         return value.
7832
7833         Fixes #461867.
7834
7835 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
7836
7837         * icall-def.h : Adding an internal call definition for 
7838           System.Environment.internalBroadcastSettingChange.
7839
7840         * icall.c : Adding a Windows only implementation to broadcast a 
7841           WM_SETTINGCHANGE when an environment variable has changed.
7842
7843         Code is contributed under MIT/X11 license.
7844
7845 2008-12-19  Mark Probst  <mark.probst@gmail.com>
7846
7847         * class.c, class-internals.h: Made
7848         mono_class_has_parent_and_ignore_generics() non-static.
7849
7850 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
7851
7852         * image.c: deal with the mmap failing when loading an image.
7853
7854 2008-12-17  Geoff Norton  <gnorton@novell.com>
7855
7856         * threadpool.c: Ensure that the io_queue_lock is initialized
7857         in all circumstances, as we always attempt to cleanup against it.
7858
7859 2008-12-17  Miguel de Icaza  <miguel@novell.com>
7860
7861         * icall.c (ves_icall_System_Environment_get_Platform): For
7862         compatibility reasons for existing client code we will keep
7863         returning 4 for a while.   
7864
7865         For how long will depend on the documentation being updated, and
7866         for us to give client code a chance to be updated.
7867
7868         This reverts the original decison on #433108 since we did not
7869         catch roughly 33 instances of the broken code in our own source
7870         code base, we did not catch failures on the buildbots, and QA did
7871         not bring this as a problem.
7872
7873         Only today I found some customer's code breaking due to our own
7874         class libraries not being fully updated and tracked it down to
7875         this change.  I am reverting it because if we could not even get
7876         our story straight in our own code base, how can we hope that our
7877         end user code be fixed?
7878
7879         As of this morning, our Wiki page that documents how to detect
7880         Unix had not been fixed.    
7881
7882 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
7883
7884         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
7885
7886         * class.c (mono_class_get_fields): Handle loading errors.
7887
7888 2008-12-12 Mark Mason <mmason@upwardaccess.com>
7889
7890         * 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.
7891         
7892 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
7893
7894         * mono-perfcounters.c: avoid warning.
7895
7896 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7897
7898         * reflection.c (ensure_runtime_vtable): Work on generic instances and
7899         make sure all interfaces have MonoClass::interface_id set.
7900
7901         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
7902         method table is property set.
7903
7904 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7905
7906         * class.c: New function mono_class_setup_interface_id that setup
7907         MonoClass::interface_id if needed.
7908
7909         * class-internals.h: Export new function.
7910
7911 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7912
7913         * class.c: Add code to sanity check the vtable after setup_vtable_general
7914         has done it's work.
7915
7916 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
7917
7918         * icall.c: make Assembly.GetExecutingAssembly work properly when
7919         reflection is used to invoke the method.
7920         Bug #321781 fixed.
7921
7922 2008-12-11  Mark Probst  <mark.probst@gmail.com>
7923
7924         * metadata/generic-sharing.c: Look for constraints in all type
7925         arguments, not just the first one.
7926
7927 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7928
7929         * appdomain.c: return the correct CodeBase for an Assembly instance
7930         that was loaded from the shadow-copy directories.
7931         Bug #458190 fixed.
7932
7933 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
7934
7935         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
7936
7937         * sgen-gc.c (check_object): New debugging helper function.
7938
7939         * object.c: Fix calls to mono_value_copy_array ().
7940
7941 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7942
7943         * class.c (mono_class_setup_fields): If working on an inflated class
7944         first check if the generic definition did init with success.
7945
7946         Fixes #445361.
7947
7948 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7949
7950         pedump.c (main): Fix a warning.
7951
7952 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
7953
7954         * object-internals.h : Adding a definition for 
7955           MonoReflectionComVisibleAttribute.
7956
7957         * marshal.c (cominterop_com_visible) :  Method added to check the 
7958           ComVisible attribute of a class.
7959
7960         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
7961           cominterop_raise_hr_exception added to consolidate common code 
7962           to raise hr exceptions.
7963
7964         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
7965           if a managed class should support IDispatch.
7966
7967         * marshal.c 
7968           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
7969           Added additional checks for managed object when getting 
7970           an IDispatch interface.
7971
7972         Code is contributed under MIT/X11 license.
7973
7974 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7975
7976         pedump.c (main): Handle mono_get_method () returning NULL. 
7977
7978 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7979
7980         * marshal.h: Fix a warning.
7981
7982 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
7983
7984         * marshal.c : Adding cominterop_release_all_rcws to release all
7985           runtime callable wrappers held by the runtime.
7986
7987         * marshal.h : Adding declaration for cominterop_release_all_rcws.
7988           
7989         Code is contributed under MIT/X11 license.
7990
7991 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7992
7993         * metadata.c (mono_image_alloc_lock): New helper function.
7994         (mono_image_alloc0_lock): Ditto.
7995
7996         * metadata.c: Use the alloc_lock () helper functions for allocating
7997         memory from the image mempool.
7998
7999 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
8000
8001         * class.c (mono_class_from_generic_parameter): Document it's
8002         locking behavior. Fix double checked locking here, we stored in
8003         param->pklass a partially initialized MonoClass and no membar was used.
8004
8005 2008-12-05  Marek Habersack  <mhabersack@novell.com>
8006
8007         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
8008         (3) functions are present in the C library use them to do the
8009         job. If they are absent, make sure that the sum of int_part and
8010         dec_part is rounded before returning. This is necessary due to the
8011         division of dec_part by the power of 10 before the final addition
8012         is performed - if the result is not rounded in some cases it will
8013         yield invalid results.
8014
8015 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
8016
8017         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
8018         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
8019         instruction instead of a pointer constant.
8020
8021 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
8022
8023         * loader.c (mono_method_get_header): Do most of the work outside the
8024         loader lock, to avoid assembly load hook deadlocks.
8025
8026         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
8027         (mono_metadata_parse_type_full): Ditto.
8028
8029 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
8030
8031         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
8032         Make the stack depth fixed. Ensure proper argument passing to the backtrace
8033         funtions. Finally, use a lock to produce well ordered output.
8034
8035         The lock looks silly, as all calls to the corlib mempool should be guarded
8036         with the loader lock, but for some reason this fact doesn't help. 
8037
8038         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
8039
8040 2008-12-02  Mark Probst  <mark.probst@gmail.com>
8041
8042         * socket-io.c: 64 bit big-endian fixes.
8043
8044 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
8045
8046         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
8047         targets that require strict compatibility between the types.
8048
8049         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
8050         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
8051         Kill the strict argument and create a new one valuetype_must_be_boxed.
8052
8053         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
8054         state that all valuetypes must be boxed.
8055
8056         Fixes #448560.
8057
8058 2008-11-29  KornĂ©l Pál  <kornelpal@gmail.com>
8059
8060         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
8061         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
8062
8063         Contributed under MIT/X11 license.
8064
8065 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
8066
8067         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
8068         the inflate_generic_type machinery should handle it.
8069
8070         This avoids a crash when the field's flags is zero and it's type is
8071         a primitive.
8072         What happens is that mono_metadata_parse_type_full will see that opt_attrs
8073         is zero and will return one of the cached built-in primitive types. Since
8074         those types live in read-only memory, the code that copies it crashes.  
8075
8076 2008-11-28  Mark Probst  <mark.probst@gmail.com>
8077
8078         * object.c: Don't put function descriptors into generalized IMT
8079         thunks.
8080
8081 2008-11-28  Mark Probst  <mark.probst@gmail.com>
8082
8083         * class.c: Enable generic code sharing on PPC64.
8084
8085 2008-11-27  Mark Probst  <mark.probst@gmail.com>
8086
8087         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
8088         from mini/mini.c.
8089
8090         * generic-sharing.c: Allocate the method template slists from the
8091         image mempool so it doesn't leak.
8092
8093 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
8094
8095         * class.c (generic_array_methods): Release the linked list.
8096
8097 2008-11-27  Mark Probst  <mark.probst@gmail.com>
8098
8099         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
8100         invocation to g_utf16_to_utf8().
8101
8102 2008-11-26  Mark Probst  <mark.probst@gmail.com>
8103
8104         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
8105         arguments on big endian archs.
8106
8107 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
8108
8109         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
8110         the type name (test added in corlib).
8111
8112 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
8113
8114         * pedump.c: initialize perf. counters. Fixes a segv.
8115
8116 2008-11-25  Martin Baulig  <martin@ximian.com>
8117
8118         * mono-debug-debugger.c
8119         (mono_debugger_runtime_invoke): Return the exception object if an
8120         exception was thrown.  Visual Studio displays the exception object
8121         in the locals window.
8122
8123 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8124
8125         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
8126         ftnptr.
8127
8128 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8129
8130         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
8131         MONO_TYPE_U are sizeof (gpointer), too.
8132
8133 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8134
8135         * marshal.c (mono_type_native_stack_size): Fixed size and
8136         alignment for reference types.
8137
8138 2008-11-23  Mark Probst  <mark.probst@gmail.com>
8139
8140         * class.c (mono_class_generic_sharing_enabled): Disable generic
8141         code sharing for PPC64.
8142
8143 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
8144
8145         * icall.c (mono_method_get_equivalent_method): Make sure
8146         method->klass->methods is inited before looping over it.
8147
8148 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
8149
8150         * object.c: when calling ExecuteAssembly in a newly created domain,
8151         the configuration file and application base are already set up.
8152         Bug #446353 take 2 fixed.
8153
8154 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
8155
8156         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
8157         Fixes #444715. Fix a warning.
8158
8159 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
8160
8161         * appdomain.c: write the full path of the assembly to the .ini file
8162         created when "shadow-copying"
8163         Bug #446353 fixed.
8164
8165 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
8166
8167         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
8168         if signature==FALSE.
8169
8170 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
8171
8172         * marshal.h : Fix the cygwin build.
8173            marshal.c:12442: undefined reference to `_IID_IMarshal'
8174           
8175         Code is contributed under MIT/X11 license.
8176
8177 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
8178
8179         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
8180           free threaded marshaler when QueryInterface is called on a COM callable
8181           wrapper requesting the IMarshal interface.
8182           
8183         Code is contributed under MIT/X11 license.
8184
8185 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
8186
8187         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
8188
8189         * reflection.c (mono_type_get_object): Special case the very common
8190         void type.
8191
8192         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
8193         hold typeof(void).
8194
8195 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
8196
8197         * process.h : Adding method declaration for
8198           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8199           
8200         * process.c : Adding implementation for
8201           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8202           
8203         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
8204           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8205
8206         Code is contributed under MIT/X11 license.
8207
8208 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
8209
8210         * appdomain.c (unload_thread_main): Clean up threadpool by
8211         calling mono_thread_pool_remove_domain_jobs.
8212
8213         * domain-internals.h (struct _MonoDomain): Add new fields to
8214         help coordinate the cleanup of the threadpool.
8215
8216         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
8217         that cleans up the threadpool of all jobs associated with an appdomain.
8218         It does that by cleaning up the queues and making sure all active
8219         threads are accounted.
8220
8221         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
8222         unloaded or in the process of. Take this is such way that there is
8223         no race condition between another thread starting the unload and the
8224         current thread acknowledging it.
8225
8226         * threadpool.c (async_invoke_thread): Same.
8227
8228         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
8229         firing the new thread.
8230
8231         * threadpool.c (start_tpthread): Same.
8232
8233         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
8234
8235         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
8236
8237 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
8238
8239         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8240         Add support for DuplicateHandle.
8241         
8242         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8243         Add support for DuplicateHandle.
8244         
8245         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8246         Add support for DuplicateHandle.
8247
8248         Code is contributed under MIT/X11 license.
8249
8250 2008-11-06  Mark Probst  <mark.probst@gmail.com>
8251
8252         * class-internals.h: Make min_align into a whole byte.
8253
8254         * class.c: Set min_align for SIMD types to 16.
8255
8256 2008-11-05  Geoff Norton  <gnorton@novell.com>
8257
8258         * attach.c: Default the attacher to enabled for all cases including
8259         embedded.
8260
8261 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
8262
8263         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
8264         change r117650.
8265
8266 2008-11-04  Mark Probst  <mark.probst@gmail.com>
8267
8268         * monitor.c, monitor.h: New function for querying offsets of
8269         members of MonoThreadsSync.
8270
8271 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
8272
8273         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
8274         to speed up this function and to avoid the boundless memory growth caused by
8275         the signature_dup () calls.
8276
8277 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
8278
8279         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
8280         wrapper.
8281
8282         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
8283         by 1 bit.
8284
8285         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
8286
8287 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8288
8289         * appdomain.c:
8290         * domain-internals.h: made mono_set_private_bin_path_from_config()
8291         "internal".
8292         * object.c: call the above function after setting the configuration
8293         file path for the root domain.
8294         Fixes bug #314478.
8295
8296 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8297
8298         * assembly.c: when the assembly is loaded from an absolute path, end
8299         basedir with a directory separator.
8300         Bug #440781 fixed.
8301
8302 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8303
8304         * monitor.c (mono_monitor_get_fast_enter_method): If
8305         CompareExchange is not available, don't create the fastpath
8306         instead of asserting.  (The method is missing in the 1.1 profile.)
8307
8308 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8309
8310         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
8311
8312         * monitor.c, monitor.h: Code for generating Monitor.Enter and
8313         Monitor.Exit IL fastpaths.
8314
8315 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8316
8317         * class.c (mono_class_create_from_typedef): Added Vector2ul.
8318
8319 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8320
8321         * class.c (mono_class_create_from_typedef): Added Vector2l.
8322
8323 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
8324
8325         * class.c (mono_class_create_from_typedef): Added Vector2d.
8326
8327 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
8328
8329         * appdomain.c: translate \ into / for cache_path.
8330         * domain-internals.h: new mono_is_shadow_copy_enabled().
8331         * icall.c: (fill_reflection_assembly_name) do the same path
8332         manipulations that get_code_base does.
8333         (get_code_base) use mono_is_shadow_copy_enabled.
8334
8335 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
8336
8337         * appdomain.c: shadow-copied assemblies go to CachePath +
8338         ApplicationName when both are set. DynamicBase has nothing to do with
8339         shadow copies.
8340         Bug #406877 fixed.
8341
8342 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
8343
8344         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
8345         STANDALONESIG table.
8346
8347         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
8348         standalone signatures.
8349
8350         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
8351         comparison code: instead of comparing the signatures using a custom
8352         equals function, transform them to a common signature and compare that. This
8353         works better with AOT.
8354
8355 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
8356
8357         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
8358
8359         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
8360         call for generic instances.
8361         (mono_class_setup_properties): Call setup_properties () before accessing
8362         gklass->properties.
8363
8364         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8365         over the virtual methods of a class using metadata if possible, avoiding the
8366         creation of MonoMethod's for non-virtual methods.
8367         
8368         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8369         get_virtual_methods () to iterate over the virtual methods of classes.
8370
8371 2008-10-25  Martin Baulig  <martin@ximian.com>
8372
8373         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
8374
8375 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8376
8377         * class.c (mono_class_create_from_typedef): Added Vector4i.
8378
8379 2008-10-24  Mark Probst  <mark.probst@gmail.com>
8380
8381         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
8382         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
8383         special-casing applies to eliminate the call completely.
8384
8385 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8386
8387         * class.c (mono_class_create_from_typedef): Added Vector8s.
8388
8389 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
8390
8391         * class.c (mono_class_create_from_typedef): Added Vector16sb.
8392
8393 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8394
8395         * icall.c: get rid of annoying warning.
8396
8397 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8398
8399         * threadpool.c: in 1.x, if you change the background status of the
8400         threadpool thread, it's not reset.
8401         Remove unnecessary calls to SetState.
8402
8403 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8404
8405         * threadpool.c: asynchronously create a set of idle threads upon first
8406         use of the threadpool. SetMinThreads will now start the appropriate
8407         number of idle threads if they are not already running. The default is
8408         1 threadpool thread per CPU. Increased the maximum number of threads
8409         per CPU to 10.
8410
8411 2008-10-22  Martin Baulig  <martin@ximian.com>
8412
8413         Revert r116521 from Zoltan, it breaks the debugger:
8414
8415         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8416         over the virtual methods of a class using metadata if possible, avoiding the
8417         creation of MonoMethod's for non-virtual methods.
8418         
8419         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8420         get_virtual_methods () to iterate over the virtual methods of classes.
8421
8422 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8423
8424         * threads.c: when creating a threadpool thread, set its state to
8425         'background'.
8426         * threadpool.c: reset the background state of a threadpool thread
8427         after finishing each work item
8428         Bug #437888 fixed.
8429
8430 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8431
8432         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
8433         
8434         * class.c (mono_class_setup_vtable_general): Add an optimized version for
8435         generic instances which works by inflating the methods in the container
8436         class's vtable.
8437
8438         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
8439         variant which doesn't make a copy if no inflation was done.
8440         (mono_class_setup_fields): Use it.
8441
8442         * metadata.c (mono_metadata_get_shared_type): New helper function to
8443         return a shared instance of a given MonoType.
8444
8445         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
8446         a copy of most non-generic types.
8447
8448 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
8449
8450         * threadpool.c: remove one more GetSystemInfo () call.
8451
8452 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
8453
8454         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
8455         use the code in mono-proclib.h to get processor information.
8456
8457 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8458
8459         * appdomain.c: fixed the logic that determines whether assemblies in a
8460         directory are "shadow-copied" or not. Bug #433483 fixed.
8461
8462 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8463
8464         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
8465         warning.
8466
8467 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8468
8469         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
8470         returning a vtype.
8471
8472         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
8473         reflection.c: Use mono_field_get_name () for accessing a field's name.
8474
8475         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
8476         class.c
8477
8478         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
8479         field.
8480
8481         * loader.c (find_method_in_class): Reenable the metadata optimization by
8482         not using it for generic instances.
8483
8484         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
8485         data/def_type fields from MonoClassField into a separate structure.
8486         (struct MonoClassField): Remove data/def_type fields.
8487         (struct _MonoClass): Add a 'field_def_values' array to store the default
8488         values/RVA for fields.
8489
8490         * class.c reflection.c: Update after the changes.
8491         
8492         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
8493         for accessing field->data.
8494
8495         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
8496
8497         * loader.c (find_method_in_class): Revert the last change for now as
8498         it breaks Mono.C5 unit tests.
8499
8500         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
8501         'field_generic_types' and 'field_objects' which contain the information
8502         previously stored in MonoInflatedField.
8503         (MonoInflatedField): Delete.
8504         (struct _MonoClassField): Delete 'generic_info' field.
8505
8506         * reflection.c: Store the information which was previously in 
8507         field->generic_info in MonoDynamicGenericClass instead.
8508
8509         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
8510         MonoClassField changes.
8511
8512 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
8513
8514         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
8515         store the value inside the data array of the MonoMethodWrapper.
8516         This saves memory, is faster and fixes the lifetime issues (methods
8517         were never removed from the hash previously). May also fix bug#436996.
8518
8519 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8520
8521         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
8522         generic instances, compute the type from the generic definition instead of
8523         looking in field->generic_info.
8524
8525         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
8526         for inflated fields, the only user was get_fieldref_token () which no
8527         longer needs it.
8528
8529         * class.c (mono_class_init): Revert the last change as it seems to cause
8530         crashes.
8531
8532         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
8533         bytes on 64 bit platforms.
8534
8535         * object.c (mono_class_create_runtime_vtable): Fix a warning.
8536         
8537         * object.c (mono_class_create_runtime_vtable): Don't initalize
8538         field->data/field->def_type here, it is done lazily by 
8539         mono_class_get_field_default_value ().
8540
8541         * icall.c (ves_icall_get_enum_info): Call 
8542         mono_class_get_field_default_value () instead of directly accessing
8543         field->data and field->def_type.
8544
8545         * object.c (get_default_field_value): Ditto.
8546
8547         * class.c (mono_field_get_data): Ditto.
8548         
8549         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
8550         call for generic instances.
8551
8552         * loader.c (find_method_in_class): If klass != from_class, then inflate
8553         the method with the context of from_class, since the caller assumes this.
8554
8555 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
8556
8557         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
8558         for accessing method->slot.
8559
8560 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
8561
8562         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
8563
8564 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
8565
8566         * class.c (mono_method_get_vtable_index): Use
8567         mono_method_get_vtable_slot () for accessing method->slot.
8568
8569         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
8570         accessing klass->methods.
8571
8572         * class.c (mono_method_get_vtable_slot): New helper function.
8573         (mono_class_get_vtable_entry): Ditto.
8574         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
8575         accessing method->slot.
8576
8577         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
8578         method to get_inflated_method ().
8579
8580         * class.c (mono_class_get_inflated_method): New helper method to obtain
8581         a method of an inflated class without calling setup_methods ().
8582         (mono_class_get_cctor): Use get_inflated_method.
8583
8584         * generic-sharing.c (mono_class_get_method_generic): Ditto.
8585         
8586         * marshal.c image.c: Lazily create all the marshal caches.
8587
8588         * image.c (mono_image_init): Move initialization of runtime_invoke
8589         caches to marshal.c.
8590
8591         * marshal.c (get_cache): New helper function to lazily initialize a 
8592         wrapper cache.
8593         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
8594
8595         * debug-helpers.c (mono_method_full_name): Include generic arguments.
8596
8597 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
8598
8599         * loader.c: fixed check for interface type.
8600
8601 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
8602
8603         * appdomain.c: check for NULL setup before it's referenced.
8604
8605 p
8606 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
8607
8608         * class.c: remove the unused old vtable setup code.
8609
8610 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
8611
8612         * class.c: don't depend on interface order in
8613         setup_interface_offsets (bug #435777).
8614         * reflection.c: sort the InterfaceImpl table (patch from
8615         Jb Evain  <jbevain@novell.com>).
8616
8617 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
8618
8619         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
8620         the low level assemblies lock.
8621
8622 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
8623
8624         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
8625         object.c, reflection.c, socket-io.c, threads.c: introduced
8626         mono_framework_version () to return the major framewrok version,
8627         changed the code that was using more complex patterns to use it.
8628         Return the correct value for PlatformID for OSX.
8629
8630 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
8631
8632         * icall-def.h, process.h, process.c: added an icall to get info about
8633         processes using mono-proclib.
8634
8635 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
8636
8637         * mono-perfcounters.c: use the mono-proclib functions to
8638         access process information.
8639
8640 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
8641
8642         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
8643         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
8644         reflection.c: remove rawbuffer usage: mmap support is more sanely
8645         provided by utils/mono-mmap.
8646
8647 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
8648
8649         * gc.c: use posix semaphores when possible so that
8650         mono_gc_finalize_notify() is signal safe.
8651
8652 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
8653
8654         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
8655         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
8656         be #ifdef-ed out, the linker will remove the rest.
8657
8658         * marshal.c: Implement DISABLE_COM.
8659
8660         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
8661
8662 2008-10-11  Miguel de Icaza  <miguel@novell.com>
8663
8664         * locales.c (string_invariant_compare_char): Optimization: do not
8665         call g_unichar_type unless we actually need the information.
8666
8667 2008-10-10  Mark Probst  <mark.probst@gmail.com>
8668
8669         * object.c, class-internals.h: Also create remoting trampolines
8670         for generic methods.  Pass the domain to the remoting trampoline
8671         creation function, too.
8672
8673 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
8674
8675         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
8676
8677 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8678
8679         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
8680         Vector4ui.
8681
8682 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
8683
8684         * assembly.c:
8685         * locales.c: remove the use of g_strdown. Fixes bug #322313.
8686
8687 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
8688
8689         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
8690         for the least possible amount of time (extending the fix in r113458).
8691
8692 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8693
8694         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
8695
8696 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
8697
8698         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
8699         as possible simd intrinsic types.
8700         Optimized the test to check for the common prefix first.
8701
8702 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
8703
8704         * class.c: back out part of a broken optimization committed on
8705         May 23th (bug #433908).
8706
8707 2008-10-09  Mark Probst  <mark.probst@gmail.com>
8708
8709         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
8710         Win32.  Should fix #432388 for most cases until we have the new
8711         profiler on Win32.
8712
8713 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
8714
8715         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
8716         instead of using inst->id so the hash is stable for AOT.
8717
8718 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
8719
8720         * appdomain.c:
8721         * icall.c: create a .ini file for shadow-copied assemblies that
8722         contains the location of the original assembly. Use this to return the
8723         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
8724         Also fix the number of '/' for windows when returning the CodeBase.
8725         Fixes bug #430920.
8726
8727 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8728
8729         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
8730
8731         Code is contributed under MIT/X11 license.
8732
8733 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8734
8735         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
8736           if if the class vtable needs initialized.
8737
8738         Code is contributed under MIT/X11 license.
8739
8740 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8741
8742         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
8743           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
8744           STRING->BSTR, and CLASS->INTERFACE.
8745
8746         Code is contributed under MIT/X11 license.
8747
8748 2008-10-07  Marek Habersack  <mhabersack@novell.com>
8749
8750         * sysmath.h: changed the declaration of the
8751         ves_icall_System_Math_Round2 icall by adding an extra
8752         away_from_zero parameter.
8753
8754         * sysmath.c (ves_icall_System_Math_Round2): added support for
8755         away from zero rounding. The icall now takes an extra boolean
8756         parameter to signal that away from zero operation is requested.
8757
8758 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
8759
8760         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
8761         the delegate klass so it can work with full-aot.
8762         (mono_marshal_get_delegate_end_invoke): Ditto.
8763         (mono_marshal_get_delegate_invoke): Ditto.
8764
8765 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
8766
8767         * gc.c, attach.h, attach.c: remove a bad pattern:
8768         add_finalizer_callback () is not implemented correctly, it can't
8769         without adding more overhead to the finalizer loop and it's not
8770         even needed, since we know exactly what we need to call, so there is
8771         no need to do so through an expensive function pointer.
8772
8773 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
8774
8775         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
8776         for the no-gc case.
8777         * attach.c (mono_attach_init): Remove the #ifdef.
8778
8779 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
8780
8781         * attach.c (mono_attach_init): Don't use
8782         mono_gc_add_finalizer_thread_callback when compiling without GC.
8783         Fixes #432306.
8784         
8785         Code is contributed under MIT/X11 license.
8786
8787 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
8788
8789         * class.c (mono_class_create_from_typedef): Remove the 
8790         #ifndef DISABLE_SIMD stuff.
8791
8792 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
8793
8794         * class-internals.h (MonoClass): Added simd_type bit field.
8795
8796         * class.c (mono_class_create_from_typedef): Check if type is a simd
8797         intrinsic.
8798
8799 2008-10-03  Mark Probst  <mark.probst@gmail.com>
8800
8801         * object.c (mono_method_add_generic_virtual_invocation): Only add
8802         instantiations to the thunk whose count is at least as large as
8803         the threshold.
8804
8805 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
8806
8807         * icall.c: changed the Type of the exception thrown when trying to
8808         invoke a constructor on an abstract class. Part of the fix for bug
8809         #324185.
8810
8811 2008-10-02  Mark Probst  <mark.probst@gmail.com>
8812
8813         * class.c, class-internals.h (mono_method_get_vtable_index): New
8814         function which returns the index into the vtable and properly
8815         handles inflated virtual generic methods.
8816
8817 2008-10-01  Mark Probst  <mark.probst@gmail.com>
8818
8819         * object.c, domain.c, object-internals.h, domain-internals.h:
8820         Generalize IMT thunk machinery to also handle thunks for virtual
8821         generic method invokes.  When a virtual generic method is invoked
8822         more than a number of times we insert it into the thunk so that it
8823         can be called without lookup in unmanaged code.
8824
8825         * generic-sharing.c, class-internals.h: Fetching a
8826         MonoGenericInst* for a method from an (M)RGCTX.
8827
8828 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
8829
8830         * marshal.c (emit_marshal_string): Applied a variant of a patch by
8831         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
8832         marshalling. Fixes #431304.
8833
8834 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
8835
8836         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8837           handle when ref is specified without In or Out.
8838
8839         Code is contributed under MIT/X11 license.
8840
8841 2008-09-30  Mark Probst  <mark.probst@gmail.com>
8842
8843         * loader.c (mono_get_method_constrained): Don't expand method with
8844         the class's context, because it's already a method of that class.
8845
8846 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
8847
8848         * attach.c : should be correct build fix.
8849
8850 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
8851
8852         * attach.c: Fix the previous change.
8853
8854 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
8855
8856         * attach.c : quick w32 build fix.
8857
8858 2008-09-27  Miguel de Icaza  <miguel@novell.com>
8859
8860         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
8861         crashes MonoDevelop: #430455.
8862
8863 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
8864
8865         * domain-internals.h (struct _MonoDomain): Move most fields used only by
8866         the JIT do MonoJitDomainInfo in ../mini/mini.h.
8867
8868         * domain.c: Remove initialization/cleanup of the removed fields.
8869
8870 2008-09-27  Mark Probst  <mark.probst@gmail.com>
8871
8872         * class.c (mono_class_generic_sharing_enabled): Enable generic
8873         code sharing for PPC.
8874
8875 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
8876
8877         * attach.c : Fixing the Windows builds.
8878
8879         Code is contributed under MIT/X11 license.
8880
8881 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8882
8883         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
8884         the default generic sharing mode to 'all'.
8885
8886 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8887
8888         * generic-sharing.c, class-internals.h: New function for checking
8889         whether a method needs a static RGCTX invoke wrapper.  A few
8890         funtions moved from mini/generic-sharing.c.
8891
8892         * icall.c: New function used.
8893
8894 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8895
8896         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8897         Static RGCTX invoke wrapping applies to value type methods, too.
8898
8899         * class.c (mono_class_setup_vtable_general): In generic-shared
8900         value types, wrap methods with a static RGCTX invoke wrapper.
8901
8902 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8903
8904         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
8905         osx build.
8906
8907 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
8908
8909         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
8910         register a callback which is called when the finalizer thread is woken
8911         up.
8912         (finalizer_thread): Call the callback if it exists.
8913
8914         * attach.h attach.c: New files, implementing the attach mechanism.
8915
8916         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
8917         
8918         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
8919         by the previous change.
8920
8921 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
8922
8923         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
8924         loader.c, marshal.c, metadata-internals.h, metadata.c,
8925         method-builder.c, object.c, reflection.c: introduced specific functions
8926         to allocate from the domain and image mempools and cleaned up most of
8927         the code to use them (still missing a few in reflection.c).
8928         Keep the loader bytes counter updated.
8929
8930 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
8931
8932         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
8933         loader-related counters.
8934
8935 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
8936
8937         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
8938         added more MS-compatible counters.
8939
8940 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
8941
8942         * class.c (mono_class_setup_fields): Call setup_fields before accessing
8943         class->blittable. Fixes #428217.
8944
8945 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
8946
8947         * reflection.c (mono_image_get_field_on_inst_token): Call 
8948         field_encode_signature () since that handles custom modifiers too.
8949         Fixes #424663.
8950
8951 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
8952
8953         * reflection.c (add_custom_modifiers): New helper function to merge custom
8954         modifiers stored in objects to a MonoType.
8955         (fieldref_encode_signature): Encode custom modifiers.
8956         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
8957         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
8958
8959 2008-09-19  KornĂ©l Pál  <kornelpal@gmail.com>
8960
8961         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
8962         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
8963         64-bit IL only images because imports are not resolved for IL only images.
8964         Special thanks to Bill Holmes for finding this bug and testing the patch.
8965         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
8966
8967         Contributed under MIT/X11 license.
8968
8969 2008-09-19  Miguel de Icaza  <miguel@novell.com>
8970
8971         * mono-config.c (dllmap_start): Add support for the bits keyword
8972         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
8973
8974 2008-09-19  Mark Probst  <mark.probst@gmail.com>
8975
8976         * reflection.c (inflate_mono_method): When the class the method is
8977         to be inflated for is itself not inflated, just return the method.
8978
8979 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
8980
8981         * mono-perfcounters.c: use more user friendly process instance names.
8982
8983 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
8984
8985         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8986           handle "[in] ref" and "[in][out] ref" cases.
8987
8988         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
8989           to mono_mb_create_method.  This was causing problems calling native to
8990           managed passing Variants by value.
8991
8992         Code is contributed under MIT/X11 license.
8993
8994 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
8995
8996         * class.c (can_access_internals): Call mono_assembly_load_friends ()
8997         before accessing the friend_assembly_names field.
8998
8999         * assembly.c (mono_assembly_load_friends): Make this callable multiple
9000         times.
9001         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
9002         called lazily when it is needed.
9003
9004         * metadata-internals.h (struct _MonoAssembly): Add 
9005         'friend_assembly_names_inited' flag.
9006
9007 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
9008
9009         * mono-perfcounters-def.h: fix the types of a few counters.
9010         * mono-perfcounters.c: implemented the instance names getter
9011         and a few bugfixes.
9012
9013 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
9014
9015         * culture-info-table.h : regenerated.
9016
9017 2008-09-17  Robert Jordan  <robertj@gmx.net>
9018
9019         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
9020         context bound objects. Fixes #415577.
9021
9022         Code is contributed under MIT/X11 license.
9023
9024 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
9025
9026         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
9027         implementation (bug #423582).
9028
9029 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
9030
9031         * object.c (mono_object_get_virtual_method): Handle the case method->slot
9032         is not set. Fixes #426309.
9033
9034 2008-09-16  Jb Evain  <jbevain@novell.com>
9035
9036         * class.c (mono_class_from_name): fix the exported type look up
9037         when the type is defined in a referenced assembly.
9038
9039 2008-09-16  Jb Evain  <jbevain@novell.com>
9040
9041         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
9042         increment the next index counter on each iteration to make that work
9043         for more than one type forwarder. Unmanaged part to fix #422929.
9044
9045 2008-09-15  Mark Probst  <mark.probst@gmail.com>
9046
9047         * object-internals.h: enum ComInterfaceType in
9048         MonoInterfaceTypeAttribute is guint32, not guint16.
9049
9050 2008-09-12  Mark Probst  <mark.probst@gmail.com>
9051
9052         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
9053         writing code.
9054
9055 2008-09-11  Mark Probst  <mark.probst@gmail.com>
9056
9057         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
9058         not gboolean.
9059
9060 2008-09-11  Mark Probst  <mark.probst@gmail.com>
9061
9062         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
9063         Endianness fixes for MonoSymbolFileOffsetTable.
9064
9065 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
9066
9067         * process.c (complete_path) : Removing quotes from the 
9068           input path.  The glib file routines do not handle file paths
9069           that have quotes around them.
9070
9071         Code is contributed under MIT/X11 license.
9072
9073 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
9074
9075         * socket-io.h : Adding a comment to provide locations where 
9076           changes to MonoSocketAsyncResult need to be synced.
9077
9078         Code is contributed under MIT/X11 license.
9079
9080 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
9081
9082         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
9083         parameters as well. Fixes #425001.
9084
9085 2008-09-08  Miguel de Icaza  <miguel@novell.com>
9086
9087         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
9088         windows build.
9089
9090 2008-09-07  Miguel de Icaza  <miguel@novell.com>
9091
9092         * console-io.c: Add support for tracking the window size if it
9093         changes.
9094
9095         The setup is very simple: the TtySetup function will now return a
9096         pointer to a location in memory that tracks the current console
9097         size.  The managed code checks its current value every time its
9098         queried against the last value set, and updates accordingly.
9099
9100         With this setup we can work with multiple consoles, and we do not
9101         require to poke into managed code from a signal handler.
9102
9103         Additionally, the environment for COLUMNS and LINES is now handled
9104         in unmanaged code.
9105
9106         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
9107
9108 2008-09-07  Mark Probst  <mark.probst@gmail.com>
9109
9110         * marshal.c (mono_type_native_stack_size): Treat
9111         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
9112
9113 2008-09-04  Jb Evain  <jbevain@novell.com>
9114
9115         * class.c (mono_class_is_assignable_from): fix assignability of nullables
9116         to nullables.
9117
9118 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
9119
9120         * verify.c (verify_type_compatibility_full): Revert change
9121         to allow converting a native int to unmanaged pointer be verifiable
9122         under non-strict mode.
9123         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
9124
9125         * verify.c: Added some TODOs.
9126
9127 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
9128
9129         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
9130           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
9131           Changed to use GlobalAlloc for the memory returned on Windows platforms.
9132
9133         Code is contributed under MIT/X11 license.
9134
9135 2008-09-02  Jb Evain  <jbevain@novell.com>
9136
9137         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
9138
9139 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
9140
9141         reflection.c (typebuilder_setup_fields): Handle classes with
9142         explicit size.
9143
9144 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
9145
9146         class.c (mono_class_setup_events): Add memory barrier due to
9147         double checked locking.
9148         
9149         class.c (mono_class_setup_properties): Same.
9150
9151 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
9152
9153         * class.c (mono_class_is_assignable_from): Fix the build.
9154         
9155         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
9156         before accessing klass->interface_bitmap. Fixes #421744.
9157
9158 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
9159
9160         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
9161         the runtime into no-exec mode, useful when running the AOT compiler.
9162
9163         * appdomain.c gc.c object.c: Avoid executing managed code when running
9164         in no-exec mode.
9165         
9166         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
9167
9168         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
9169         special case when the mono_assembly_loaded () returns NULL because the 
9170         search hook is not installed.
9171
9172 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
9173
9174         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
9175         crashes in bstr marshalling on linux.
9176
9177 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
9178
9179         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
9180         with more than one parameter.
9181
9182 2008-08-24  Miguel de Icaza  <miguel@novell.com>
9183
9184         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
9185         start/stop flow control as well when turning off ICANON (allows
9186         C-s and C-q to be read by Console.ReadKey).
9187
9188 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
9189
9190         * class.c (mono_class_init): Move the initialization of nested classes
9191         into mono_class_get_nested_types (). Fixes #418433.
9192
9193         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
9194         flag.
9195
9196         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
9197         iterating tough the nested classes of a class.
9198
9199 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
9200
9201         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
9202         on arm.
9203
9204 2008-08-22  Miguel de Icaza  <miguel@novell.com>
9205
9206         * console-io.c (sigcont_handler): Support signal chaining for
9207         SIGCONT.
9208
9209         (console_set_signal_handlers): Use best practices with sigaction,
9210         clear the structure before using it. 
9211
9212 2008-08-22  Robert Jordan  <robertj@gmx.net>
9213
9214         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
9215         Fix the Windows build.
9216
9217 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
9218
9219         * class.c (mono_class_generic_sharing_enabled): Make the default
9220         sharing mode 'corlib'.
9221
9222 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
9223
9224         * console-io.c (console_set_signal_handlers): Fix a warning.
9225
9226         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
9227         method normally, the JIT will take care of avoiding recursion.
9228
9229 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
9230
9231         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
9232
9233         Code is contributed under MIT/X11 license.
9234
9235 2008-08-20  Miguel de Icaza  <miguel@novell.com>
9236
9237         * console-io.c (sigcont_handler): We need to restore the entire
9238         termios state, not only the original settings, as things like echo
9239         can be controlled after this (Booish exposes this issue with its
9240         own ReadLine implementation).
9241
9242         Additionally, we need to set the terminal back into keypad_xmit
9243         mode.
9244         
9245         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
9246         string as a paramter as well.   Otherwise we get different
9247         keyboard sequences.
9248
9249 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
9250
9251         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
9252         delegates with byref out parameter passing. Fixes #351520.
9253
9254         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
9255         a generic context.
9256         (mono_type_get_desc): Add the type arguments for GENERICINST.
9257         (mono_method_full_name): Stringify the class name using mono_type_full_name
9258         so it picks up generic arguments.
9259
9260 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
9261
9262         * console-io.c: Removed debug output.
9263
9264 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
9265
9266         reflection.c (mono_reflection_create_runtime_class): Alloc
9267         the nested classes linked list using the dynamic image mempool.
9268         Fixes leak in corlib compilation.
9269
9270 2008-08-19  Miguel de Icaza  <miguel@novell.com>
9271
9272         * console-io.c: Fix incredibly annoying behavior on the console
9273         after resuming execution after control-z.   This affected every
9274         console application.
9275
9276 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
9277
9278         * mempool-internals.h: Header for mono private mempool functions. The first
9279         two function are for allocating glib linked lists using pools.
9280
9281         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
9282
9283         * Makefile.am: Added mempool-internals.h.
9284
9285 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
9286
9287         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
9288         (mono_domain_free): Ditto.
9289
9290         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
9291         be used by the JIT to store its domain-specific information, instead of putting
9292         it directly into MonoDomain.
9293
9294         * domain.c (mono_install_create_domain_hook): New helper function to install
9295         a hook which initializes domain->runtime_info.
9296
9297         * domain.c (mono_install_free_domain_hook): Ditto.
9298         
9299 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
9300
9301         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
9302         asserting if the ares parameter is null.
9303
9304         * mono-perfcounters.c: Fix warnings.
9305
9306         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
9307         is not needed, don't check for interruptions either.
9308         (mono_marshal_get_delegate_end_invoke): Ditto.
9309
9310 2008-08-15  Marek Habersack  <mhabersack@novell.com>
9311
9312         * mono-perfcounters.c (predef_readonly_counter): added support for
9313         reading the ASP.NET Requests Queued counter from another process.
9314
9315 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
9316
9317         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
9318         MonoImage to simplify the AOT code.
9319
9320 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
9321
9322         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
9323         marshalling. Fixes #416078.
9324
9325 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9326         
9327         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
9328         it is set, looking up the icall address is deferred to the JIT, since 
9329         in embedded scenarios, the icall might not be registered in the runtime
9330         doing the AOT compilation. Backported from the 2.0 branch.
9331
9332 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9333
9334         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
9335         Fixes #415621.
9336
9337 2008-08-05  Marek Habersack  <mhabersack@novell.com>
9338
9339         * Makefile.am: added support for cross-compilation.
9340
9341 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
9342
9343         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
9344
9345 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
9346
9347         * mono-perfcounters.c: jitted methods and jitted bytes counters.
9348
9349 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
9350
9351         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
9352         mono-perfcounters.c: performance counters implementation.
9353
9354 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
9355
9356         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
9357         to gpointer, letting the AOT code decide what to store in it.
9358
9359 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
9360
9361         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
9362           mono_class_setup_methods if the methods are not initialized.
9363
9364         Code is contributed under MIT/X11 license.
9365
9366 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9367
9368         * verify.c: Remove some debug code I commited by accident.
9369
9370         * verify.c (mono_method_is_valid_in_context): Change the return value
9371         to make possible to distinguish between invalid and unverifiable.
9372
9373         * verify.c (verifier_load_method): Don't return NULL for unverifiable
9374         methods.
9375
9376 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9377
9378         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
9379         constraints. Fixes regression in gtest-253.
9380
9381 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9382
9383         * verify.c (mono_verifier_verify_class): Don't allow generic types
9384         with explicit layout.
9385
9386         * verify.c (mono_method_verify): Check locals and argument types.
9387
9388 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
9389
9390         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
9391         wait if the thread is in StopRequested state.
9392
9393         * class.c (mono_class_from_name): Refactor the module searching code into
9394         a separate function so it can be reused in the AOT case too.
9395
9396 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
9397
9398         * verify.c (mono_type_is_valid_in_context): Improve the error message.
9399         Check both the type and it's generic type definition for loader errors.
9400         
9401         * verify.c (mono_method_is_valid_in_context): Don't generate another
9402         error when a type errors occur, this leads to the wrong exception been
9403         thrown.
9404
9405 2008-07-28  Dick Porter  <dick@ximian.com>
9406
9407         * icall-def.h
9408         * process.c
9409         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
9410         New internal calls to duplicate and close a process handle.
9411
9412 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
9413
9414         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
9415
9416 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
9417
9418         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
9419
9420 2008-07-27  Robert Jordan  <robertj@gmx.net>
9421
9422         * class.c (mono_class_init): Don't compute class.has_finalize for
9423         valuetypes. Fixes #412477.
9424
9425 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
9426
9427         * verify.c: Implement constraint equivalence checking.
9428         This is required when a generic parameter is used as
9429         argument to a constrained one.
9430
9431         Fixes #410637.
9432
9433 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
9434
9435         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9436
9437         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
9438
9439         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
9440         synch with managed object layout.
9441
9442 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9443
9444         * verify.c (do_branch_op): Handle valuetypes and generic
9445         arguments properly.
9446
9447         * verify.c (do_cmp_op): Same.
9448
9449         Fixes #410383.
9450
9451 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9452
9453         * generic-sharing.c: Fix memory leaks.
9454
9455         * class.c, class-internals.h: Make
9456         mono_class_inflate_generic_type_with_mempool() non-static.
9457
9458 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9459
9460         * pedump.c (dump_verify_info): Dump full class name.
9461
9462 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9463
9464         * generic-sharing.c: Removed some old code that didn't do anything.
9465
9466 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
9467         * profiler.c: Added runtime_initialized_event,
9468         mono_profiler_install_runtime_initialized and
9469         mono_profiler_runtime_initialized. This new hook tells the profiler
9470         when the runtime is sufficiently initialized to be able to call
9471         mono_thread_attach on the root appdomain.
9472         * profiler.h, profiler-private.h: Likewise.
9473
9474 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9475
9476         * verify.c (do_cast): Do boxing for generic arguments as well.
9477
9478         * class.c (is_nesting_type): Drop generic instantiations before
9479         checking for nesting.
9480
9481         * class.c (can_access_instantiation): Allow access to generic
9482         arguments.
9483
9484 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9485
9486         * verify.c (verify_class_for_overlapping_reference_fields):
9487         On some cases, the field size might be zero, guard against that.
9488         Fix the explicit layout check to work as expected.
9489
9490 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
9491
9492         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
9493         mono_thread_resume () during shutdown, since the thread we want to abort
9494         might be suspended.
9495
9496 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
9497
9498         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
9499         warning.
9500
9501         * debug-mono-symfile.c: Fix a warning.
9502
9503         * mono-perfcounters.c (get_cpu_times): Fix a warning.
9504
9505         * object.c (mono_class_vtable): Check if exception_type is set, and return
9506         NULL as defined by the function comments.
9507
9508 2008-07-22  Mark Probst  <mark.probst@gmail.com>
9509
9510         * mempool.c: Use malloc for every single mempool allocation if the
9511         configure option is set.  This makes it easier to track mempool
9512         allocations with tools like Valgrind.
9513
9514 2008-07-22  Jb Evain  <jbevain@novell.com>
9515
9516         * reflection.c (create_dynamic_mono_image): emit the same
9517         metadata version that SL2 does when creating a SL2 image.
9518
9519 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
9520
9521         * icall-def.h:
9522         * icall.c: New icall System.Enum:get_hashcode. This function
9523         avoids the overhead of boxing the enum to the underlying type.
9524
9525 2008-07-21  Mark Probst  <mark.probst@gmail.com>
9526
9527         * reflection.c (mono_method_get_object): Don't let static RGCTX
9528         invoke wrappers get into MonoReflectionMethods.
9529
9530 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
9531
9532         * object-internals.h:
9533         * object.c: New mono_runtime_class_init_full function
9534         that makes throwing the exception optinal.
9535
9536         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
9537         for the case where the exception object is supplied.
9538
9539 2008-07-16  KornĂ©l Pál  <kornelpal@gmail.com>
9540
9541         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
9542         old ld versions.
9543
9544         Contributed under MIT/X11 license.
9545
9546 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9547
9548         * string-icalls.c (ves_icall_System_String_InternalSplit):
9549         Optimize array allocation by caching the MonoClass of the
9550         array type.
9551
9552         * icall.c (ves_icall_Type_GetMethodsByName): Same.
9553
9554         * reflection.c (mono_param_get_objects): Same.
9555
9556 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9557
9558         * icall-def.h:
9559         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
9560         It inflates the given type using the class context.
9561
9562 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
9563
9564         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
9565         the vtable if it already exists.
9566
9567         * object-internals.h: Add mono_class_try_get_vtable as part of the
9568         internal API.
9569
9570         * reflection.c (mono_type_get_object): Use the MonoObject from the
9571         vtable when possible. Reduces locking contention on reflection heavy
9572         code.
9573
9574 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
9575
9576         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
9577         g_bit_nth_msf () since that macro is not implemented in eglib.
9578
9579 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
9580
9581         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
9582         on platforms which do not support it.
9583
9584 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
9585
9586         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
9587
9588 2008-07-11  Martin Baulig  <martin@ximian.com>
9589
9590         * mono-debug-debugger.h
9591         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
9592
9593         * mono-debug-debugger.c
9594         (_mono_debugger_interruption_request): New global volatile variable.
9595         (mono_debugger_check_interruption): New public function.
9596
9597         * threads.c
9598         (mono_thread_current_check_pending_interrupt): Call
9599         mono_debugger_check_interruption().
9600         (mono_thread_interruption_checkpoint_request): Likewise.
9601
9602 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9603
9604         * verify.c: Add more type checks for loaded types. Verify the result
9605         handle from ldtoken.
9606
9607 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9608
9609         * loader.c (field_from_memberref): Don't crash if the field
9610         wasn't found.
9611
9612 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9613
9614         * verify.c: Verify if type and method instantiations
9615         don't have invalid VAR or MVAR arguments.
9616
9617 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9618
9619         * verify.c: Fix double free of function pointer list.
9620
9621 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9622
9623         * object.c (mono_string_to_utf8): Comment the new code as it
9624         breaks under eglib.
9625
9626 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
9627
9628         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
9629
9630 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
9631
9632         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
9633           is not throw too many times.
9634
9635         Code is contributed under MIT/X11 license.
9636
9637 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
9638
9639         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
9640         debugging is turned off.
9641
9642 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
9643
9644         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
9645
9646 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9647
9648         * class-internals.h, class.c: Added new generic sharing option:
9649         Share only stuff in System.Collections.Generic, which is now the
9650         default.
9651
9652 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9653
9654         * generic-sharing.c, class-internals.h: New function for getting a
9655         generic method in a generic class given the corresponding method
9656         for a different instantiation of the class.  Partly refactored
9657         from mini-trampolines.c.
9658
9659         * class.c: Make sure generic methods have a class_inst if they are
9660         part of a generic class.
9661
9662         * metadata.c (mono_type_stack_size_internal): Handle type
9663         variables.
9664
9665 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9666
9667         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
9668         Signifies whether information on the this/vtable/mrgctx variable
9669         is available.
9670
9671 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9672
9673         * object.c, object-internals.h, icall.c: New function
9674         mono_delegate_ctor_with_method(), which does the same as
9675         mono_delegate_ctor(), but takes an explicit method argument
9676         instead of taking the method from the jit info.
9677
9678         * marshal.c: When creating a delegate with an inflated method take
9679         the "this" argument as the target class for the castclass.
9680
9681 2008-07-03  Mark Probst  <mark.probst@gmail.com>
9682
9683         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
9684         mono_jit_info_table_find() to perform very badly in some cases.
9685
9686 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
9687
9688         * icall.c (type_from_typename): Handle 'string'.
9689
9690         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
9691         wrappers into the wrapper_hash, since the key is not a MonoMethod.
9692
9693 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
9694
9695         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
9696
9697         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
9698         number of available managed allocator types.
9699
9700         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
9701         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
9702
9703 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
9704
9705         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
9706         which is a low level lock protecting just the 'jit_code_hash' hash table.
9707
9708         * domain.c: Initialize+cleanup jit_code_hash_lock.
9709         
9710 2008-06-30  KornĂ©l Pál  <kornelpal@gmail.com>
9711
9712         * coree.c (mono_load_coree): Set coree_module_handle global variable only
9713         after initialization.
9714
9715         * coree.h: Make MonoFixupExe internal.
9716
9717         Contributed under MIT/X11 license.
9718
9719 2008-06-30  KornĂ©l Pál  <kornelpal@gmail.com>
9720
9721         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
9722         because that is platform independent. Check NumberOfRvaAndSizes in PE32
9723         as well.
9724         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
9725         image being loaded is a CLI image and _CorValidateImage gets called.
9726
9727         * coree.h: Add MonoLoadImage.
9728
9729         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
9730         instead of LoadLibrary.
9731
9732         Contributed under MIT/X11 license.
9733
9734 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
9735
9736         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
9737         for any primitive type.
9738
9739 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
9740
9741         * object.c (mono_array_new_specific): Optimize this and the other allocation
9742         functions a bit.
9743         
9744         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
9745         domains too if mono_dont_free_domains is set.
9746
9747         * domain-internals.h (mono_dont_free_domains): New internal option controlling
9748         whenever to free appdomain data after it has been unloaded.
9749
9750         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
9751         
9752 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
9753
9754         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
9755         (mono_method_get_equivalent_method): Fix a warning.
9756
9757         * object.c (mono_message_init): Avoid looking up array types for each call.
9758
9759 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
9760
9761         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
9762         call.
9763
9764         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
9765         even more.
9766
9767         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
9768         each iteration.
9769
9770         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
9771         fields of an enum.
9772
9773 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
9774
9775         * object.c (mono_value_box): Fix boxing of nullables.
9776
9777 2008-06-26  KornĂ©l Pál  <kornelpal@gmail.com>
9778
9779         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
9780         mono_module_handle that is defined by the linker; no initialization required.
9781         * coree.h: Remove mono_module_handle, add __ImageBase, update
9782         mono_image_open_from_module_handle.
9783         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
9784         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
9785         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
9786         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
9787         to 4 GB away from image base address. IA64 version is not tested but was very
9788         easy to implement and should work if we ever need it.
9789         * domain.c (mono_init_internal): Avoid system error message boxes.
9790         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
9791         with has_entry_point. Handle do_mono_image_load fauilre correctly.
9792         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
9793         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
9794         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
9795
9796         Contributed under MIT/X11 license.
9797
9798 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9799
9800         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
9801         as part of the private mono API.
9802         
9803         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
9804         Do proper argument checking for methods that belong to generic classes.
9805         Do proper type resolution for GMFH/2.
9806         Fixes #377324.
9807         
9808 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9809
9810         * verify.c (do_switch): Fix a memory corruption bug with
9811         the jump index is out of bound.
9812
9813 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9814
9815         * verify.c: Disable debug code.
9816
9817 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9818
9819         * reflection.c (mono_image_get_methodbuilder_token): Use
9820         mono_image_get_methodspec_token_for_generic_method_definition
9821         instead of mono_image_get_memberref_token. We cache more memberef
9822         entries now.
9823
9824 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9825
9826         * verify.c: Inflate exception clause types.
9827         Fixes #402606.
9828         
9829 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9830
9831         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
9832         name.
9833
9834         * reflection.c (mono_image_get_ctorbuilder_token): Same.
9835
9836         * reflection.c (mono_image_create_method_token): Same.
9837
9838 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9839
9840         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
9841         It does the same as mono_image_get_methodref_token but works on
9842         MethodBuilder.
9843
9844         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
9845         and always generate a methodspec. This follows the old behavior and fixes
9846         the regressions in System.Core. 
9847
9848 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
9849
9850         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
9851         don't event mono_class_get () succeeds. Fixes #402182.
9852
9853 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9854
9855         * metadata-internals.h: Added MonoDynamicImage::methodspec
9856         hashtable to store methodspec tokens created for MethodBuilders.
9857
9858         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
9859         MethodBuilders as open instantiations if a methodspec was requested.
9860
9861         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
9862
9863         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
9864
9865         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
9866
9867         Fixes bug #349190.
9868
9869 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9870
9871         * loader.c (method_from_methodspec): Avoid crashing if the
9872         method lookup fails.
9873
9874 2008-06-20  Dick Porter  <dick@ximian.com>
9875
9876         * socket-io.c (get_socket_assembly): Cope with Moonlight network
9877         classes being in a different assembly.  Fixes bug 399184.
9878
9879 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
9880
9881         * loader.c (mono_loader_init): Make this callable multiple times.
9882         (mono_dllmap_insert): Call mono_loader_init () so this works even before
9883         the runtime is initialized. Fixes #401755.
9884
9885 2008-06-19  Dick Porter  <dick@ximian.com>
9886
9887         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
9888         Fixes bug 349688.
9889
9890 2008-06-19  Dick Porter  <dick@ximian.com>
9891
9892         * socket-io.c:
9893         * icall-def.h: Implement Socket generic Send() and Receive()
9894         methods.  Fixes bug 395168.
9895
9896 2008-06-19  KornĂ©l Pál  <kornelpal@gmail.com>
9897
9898         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
9899
9900         Contributed under MIT/X11 license.
9901
9902 2008-06-18  Martin Baulig  <martin@ximian.com>
9903
9904         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
9905         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
9906         set to 80.0.  The debugger <-> runtime interface is now frozen as
9907         well.   
9908
9909         * mono-debug.c
9910         (mono_debug_debugger_version): Bump to 4.
9911
9912 2008-06-18  Martin Baulig  <martin@ximian.com>
9913
9914         * debug-mono-symfile.c
9915         (load_symfile): Don't check the minor version.
9916
9917         * debug-mono-symfile.h: Bump the version number to 50.0.
9918
9919 2008-06-18  Martin Baulig  <martin@ximian.com>
9920
9921         * debug-mono-symfile.c
9922         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
9923         minimum required version.
9924
9925 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9926
9927         * reflection.c (mono_custom_attrs_from_property): Fix support for
9928         retriveving cattrs of dynamic inflated generic types.
9929
9930         * reflection.c (mono_custom_attrs_from_event): Same.
9931
9932         * reflection.c (mono_custom_attrs_from_field): Same;
9933
9934         * reflection.c (typebuilder_setup_events): Same cattrs of events.
9935
9936         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
9937         Moved to metadata.c.
9938
9939         * metadata.c: New functions to retrive the equivalent field, event
9940         of property from the generic type definition.
9941
9942         * metadata-internals.h: Added new functions from metadata.c.
9943
9944 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9945
9946         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
9947         to cached in a mempool is used.
9948
9949         * metadata.c (free_generic_class): In some situations field generic_info type
9950         is not properly dup'ed and leads to double free'ing.
9951
9952         Fixes #400643.
9953
9954 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9955
9956         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
9957         this arguments (will be needed later for generic methods).
9958         Collect stats.
9959
9960 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9961
9962         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
9963         Create a static RGCTX invoke wrapper for methods which require it.
9964
9965 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9966
9967         * object.c, class-internals.h: New function for checking whether
9968         an individual field is special static.
9969
9970 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
9971
9972         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
9973         linear search since the table is sorted.
9974
9975         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
9976         Fixes #324180.
9977
9978 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
9979
9980         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
9981         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
9982
9983         * gc.c (mono_domain_finalize): Allow an infinite timeout.
9984
9985         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
9986         
9987         * threads.c (mono_thread_request_interruption): Get rid of locking, use
9988         InterlockedCompareExchange to query and modify 
9989         thread->interruption_requested.
9990
9991         * object-internals.h (struct _MonoThread): Change interruption_requested
9992         to a gint32 so it can be modified by atomic operations. Add 
9993         'critical_region_level' from the managed side, change small_id to a guint32,
9994         add new set of 'unused' fields.
9995
9996         * appdomain.c: Bump corlib version.
9997
9998 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
9999
10000         * class.c (mono_class_from_name): Search modules as well. Fixes
10001         #322332.
10002
10003 2008-06-13  Mark Probst  <mark.probst@gmail.com>
10004
10005         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
10006         templates.  Templates are generalized with an additional type_argc
10007         argument.  RGCTX templates have type_argc==0, MRGCTX templates
10008         have type_argc>0.
10009
10010         * domain-internals.h, domain.c: New hash table for looking up
10011         MRGCTXs.
10012
10013         * metadata.c, metadata-internals.h: Rename hash and equal
10014         functions for MonoGenericInst's and make them public.
10015
10016         * class-internals.h: New data structures for the MRGCTX.  Macros
10017         for distinguishing slots in the RGCTX and the MRGCTX.
10018
10019 2008-06-13  Mark Probst  <mark.probst@gmail.com>
10020
10021         * object.c (mono_method_get_imt_slot): Put the same methods of
10022         different instantiations of the same generic interface in the same
10023         IMT slots, to make generic sharing simpler.
10024
10025 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
10026
10027         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
10028
10029         * metadata.c (mono_metadata_field_info_with_mempool): Added.
10030         This function works just like mono_metadata_field_info, but
10031         accept a mempool as argument to be used allocating memory.
10032
10033         * marshal.c (mono_marshal_load_type_info): Use new function
10034         to load marshal data into image mempool.
10035
10036 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
10037
10038         * class.c (mono_class_inflate_generic_type_with_mempool):
10039         This function allows to inflate a generic type using
10040         a mempool.
10041
10042         * class.c (inflate_generic_type): Take a mempool as argument
10043         and use it to do type dup'ing.
10044
10045         * class.c (mono_class_setup_fields): Field type for generic
10046         generic classes are allocated from the image mempool.
10047
10048         * metadata.c (free_generic_class): Inflated field type is
10049         now allocated in the image mempool.
10050
10051 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
10052
10053         * threads.c (thread_cleanup): Free MonoThread::name.
10054
10055 2008-06-12  Marek Habersack  <mhabersack@novell.com>
10056
10057         * appdomain.c (ensure_directory_exists): avoid unnecessary
10058         mkdir(2) calls when the shadow directory already exists.
10059         (mono_make_shadow_copy): copy also satellite assemblies from the
10060         private bin directories.
10061
10062 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
10063
10064         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
10065         
10066         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
10067         a page boundary. Fixes #396219.
10068
10069 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10070
10071         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
10072         due to double-checked locking.
10073
10074 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10075
10076         * assembly.c (build_assembly_name): Release memory on failure.
10077
10078         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
10079
10080 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10081
10082         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
10083         memory on failure.
10084
10085 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10086
10087         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
10088         memory on failure.
10089
10090 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10091
10092         * loader.c (field_from_memberref): Check if field signature type is equal
10093         to the non-inflated type of the field. Fixes #398980.
10094
10095 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
10096
10097         * assembly.c (mono_assembly_load_from_full): Call 
10098         mono_assembly_load_friends () outside the assemblies lock, since it can
10099         acquire the loader lock. Fixes #323696.
10100
10101         * reflection.c (resolve_object): Inflate the inst with the context for
10102         FieldOnTypeBuilderInst. Fixes #399010.
10103
10104 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10105
10106         * reflection.c (mono_image_get_field_on_inst_token): Don't
10107         inflate the field to encode it's signature. If it's a
10108         VAR or MVAR it should stay that way in the signature.
10109         Fixes #399047.
10110
10111 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10112
10113         * reflection.c (resolve_object): Release memory of inflated types.
10114
10115 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10116
10117         * loader.c (mono_method_get_signature_full): Remove assert about
10118         loading a methodspec to a generic method. We have such methods, such as
10119         System.Threading.Interlocked::CompareExchange<T>.
10120         This assert was removed since it crashes the verifier when it checks
10121         methods calling CompareExchange<T>.
10122
10123 2008-06-10  Marek Safar  <marek.safar@gmail.com>
10124
10125         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
10126         of Type array and not MonoType.
10127
10128 2008-06-10  Marek Habersack  <mhabersack@novell.com>
10129
10130         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
10131         <lupus@ximian.com>
10132
10133 2008-06-10  Martin Baulig  <martin@ximian.com>
10134
10135         * debug-mono-symfile.h
10136         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
10137         changes to the file format, but we were generating incorrect
10138         source file indices in the line number table due to a bug, which
10139         made backtraces report an incorrect source file.
10140
10141 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10142
10143         * mono-debug.c: Moved mono_debug_free_method_jit_info from
10144         mini/debug-mini.c to here.
10145
10146         * mono-debug.c (il_offset_from_address): Free memory from find_method.
10147
10148         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
10149         use it to release structs returned by mono_debug_find_method.
10150
10151 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
10152
10153         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
10154         since it needs to set method->slot for all interface methods.
10155
10156 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10157
10158         * class-internals.h: Forgot to add.
10159
10160 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10161
10162         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
10163
10164         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
10165         Lookup the custom attributes from property_hash.
10166
10167         * reflection.c (mono_save_custom_attrs): Save the custom attributes
10168         in property_hash. Allocate all data using the image mempool.
10169
10170         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
10171         for dynamic_custom_attrs to checks if the image is dynamic.
10172
10173 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
10174
10175         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
10176         assemblies array.
10177         
10178         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
10179         runtime functions while holding the domain assemblies lock.
10180
10181 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10182
10183         * verify.c: Reapplied the last bit of the reverted changes.
10184
10185 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10186
10187         * verify.c: Reapplied more of the reverted changes.
10188
10189 2008-06-09  Martin Baulig  <martin@ximian.com>
10190
10191         * debug-mono-symfile.c (load_symfile): Check the major version
10192         first; if it's wrong, don't print the minor version in the error message.
10193
10194 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
10195
10196         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
10197         lock instead of the domain lock to avoid deadlocks, since the thread might
10198         already hold the loader lock.
10199
10200         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
10201         (mono_thread_attach): Ditto.
10202
10203         * monitor.c: Use a TLS variable for holding the current thread id instead
10204         of calling pthread_self ().
10205         (mono_monitor_init_tls): New internal function to initialize the TLS
10206         variable.
10207         (mono_monitor_try_enter_internal): Put the owner == id check after the
10208         owner == 0 check.
10209
10210         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
10211         missed optimizations when using gcc-4.3.
10212
10213 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
10214
10215         * reflection.c (mono_dynamic_image_free): Free the memory
10216         used by MonoGenericParam in MonoDynamicImage::gen_param.
10217
10218         * reflection.c (mono_reflection_setup_generic_class): Allocate
10219         container from mempool.
10220
10221         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
10222         container from mempool.
10223
10224 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
10225
10226         * threads.c (mono_set_pending_exception): New internal function to set the
10227         pending exception of the current thread.
10228         (mono_thread_get_and_clear_pending_exception): Check for 
10229         thread->pending_exception as well.
10230
10231         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
10232
10233         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
10234         it can trigger a collection.
10235
10236 2008-06-06  Martin Baulig  <martin@ximian.com>
10237
10238         Merged the `debugger-kahalo' branch.
10239
10240         * mono-debug.h
10241         (MONO_DEBUGGER_VERSION): Bumped to 72.
10242
10243         * debug-mono-symfile.h
10244         (MonoSymbolFileMethodIndexEntry): Removed.
10245         (MonoSymbolFileMethodEntry): New public typedef.
10246         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
10247         (MonoSymbolFileSourceEntry): Remove everything except `index' and
10248         `data_offset'.
10249         (MonoSymbolFileMethodEntry): Removed.
10250         (MonoSymbolFileLexicalBlockEntry): Removed.
10251         (MonoSymbolFileLineNumberEntry): Removed.
10252         (MonoDebugLexicalBlockEntry): Removed.
10253         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
10254         removed `num_il_offsets' and `il_offsets'.
10255         (MonoSymbolFile): Replace `version' with `major_version' and
10256         `minor_version'.
10257         (MONO_SYMBOL_FILE_VERSION): Replace with
10258         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
10259         `MONO_SYMBOL_FILE_MINOR_VERSION'.
10260
10261         * debug-mono-symfile.c
10262         (mono_debug_symfile_lookup_location): Add support for the new line
10263         number table format.
10264
10265 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10266
10267         * metadata.c (free_generic_class): Release the inflated
10268         MonoClass of dynamic generic classes if it's not a generic
10269         type definition.
10270
10271 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10272
10273         * verify.c: Reapplied more of the reverted changes.
10274
10275 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10276
10277         * reflection.c (lookup_custom_attr): Clean the cached flag or
10278         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
10279         for SRE types.
10280
10281 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10282
10283         * verify.c: Reapplied a small part of the reverted changes.
10284
10285 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
10286
10287         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10288
10289         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
10290         previously in managed code.
10291         (mono_monitor_exit): Ditto.
10292         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
10293
10294         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
10295         the managed definition.
10296
10297 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10298
10299         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
10300
10301 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10302
10303         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
10304         
10305         * monitor.c: Add some micro optimizations.
10306
10307         * icall.c (type_from_typename): Handle 'bool'.
10308
10309 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10310
10311         * verify.c: Implement constructor verification per P III 1.8.1.4.
10312         Fixes #396716.
10313
10314 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10315
10316         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
10317         holding the assemblies lock here too.
10318
10319 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10320
10321         * verify.c: Kill stack_top function.
10322
10323 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10324
10325         * verify.c: Kill stack_get function.
10326
10327 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10328
10329         * verify.c (mono_method_verify): Last change broke the build. Fixed.
10330
10331 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10332
10333         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
10334         more reliable.
10335
10336         * verify.c (mono_method_verify): Inflate params and locals to avoid
10337         mismatch when checking for compatibility.
10338
10339 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
10340
10341         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
10342         Length prefix should be size in bytes. Fix bug #339530.
10343         
10344         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
10345         Length prefix should be size in bytes. Fix bug #339530.
10346
10347         Code is contributed under MIT/X11 license.
10348
10349 2008-06-05  Bill Holmes <billholmes54@gmail.com>
10350
10351         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
10352
10353         Contributed under MIT/X11 license.
10354
10355 2008-06-05  Martin Baulig  <martin@ximian.com>
10356
10357         * mono-debug-debugger.c
10358         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
10359
10360 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
10361
10362         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
10363         while holding the assemblies lock to prevent deadlocks. Handle the case
10364         where the search hook returns NULL but the assembly was still loaded.
10365         Fixes #323696.
10366
10367         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
10368         modify domain state.
10369
10370 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
10371
10372         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
10373         * Makefile.am (pedump_LDADD): Post-process object files and
10374         add dtrace-generated object file, if necessary.
10375
10376         Code is contributed under MIT/X11 license.
10377
10378 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10379
10380         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
10381
10382 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10383
10384         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
10385
10386 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10387
10388         * threads.c: Try to free everything from the delayed free table
10389         when shutting down threads, and set the variable to NULL after the
10390         table is freed so that calling
10391         mono_thread_hazardous_try_free_all() when shutting down the root
10392         domain doesn't crash.
10393
10394 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10395
10396         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
10397         the caller if resulting type was inflated.
10398
10399         * class.c (mono_class_create_from_typespec): Free the MonoType if it
10400         was inflated.
10401
10402         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
10403
10404
10405 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
10406
10407         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
10408         class library tests.
10409
10410         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
10411         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
10412         #396989.
10413
10414 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10415
10416         * domain.c, domain-internals.h: The JIT infos are now freed by the
10417         JIT info table code.  They are freed immediately if there only a
10418         single JIT info table in circulation.  If there is more, the free
10419         is delayed via a queue.
10420
10421         * threads.c, threads-types.h: New hazard pointer function for
10422         freeing all freeable delayed items in one sitting.
10423
10424 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10425
10426         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
10427
10428         * reflection.c (typebuilder_setup_properties): Same.
10429
10430         * reflection.c (typebuilder_setup_events): Same.
10431
10432 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10433
10434         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
10435         and use it for allocating memory.
10436
10437         * reflection.c (mono_marshal_spec_from_builder): Same.
10438
10439         * reflection.c: Change code to use new signatures.
10440
10441         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
10442
10443 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10444
10445         * decimal.c (rescale128): Put back one line which was accidently commented
10446         out.
10447         
10448         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
10449         to cause crashes.
10450
10451 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10452
10453         * reflection.c (mono_reflection_generic_class_initialize): Name must
10454         be always malloc'ed so we can free it later on. Do this for field, property
10455         and event.
10456
10457         * metadata.c (free_generic_class): Free field, property and event names.
10458
10459 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10460
10461         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
10462         instead of g_memdup.
10463
10464         * reflection.c (typebuilder_setup_fields): Same.
10465
10466 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10467
10468         * decimal.c (rescale128): Optimize this function a bit more.
10469
10470 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10471
10472         * metadata.c (free_generic_class): Release some memory from
10473         SRE generic classes.
10474
10475 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10476
10477         * reflection.c (mono_image_get_generic_field_token): No reference
10478         to name is kept, free it.
10479
10480         * reflection.c (mono_reflection_generic_class_initialize): Free
10481         more memory of the inflated field.
10482
10483 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10484
10485         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
10486         code.
10487
10488 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10489
10490         * reflection.c (mono_dynamic_image_free): Release memory used by
10491         MonoDynamicImage::array_methods elements.
10492
10493         * reflection.c (assembly_add_win32_resources): Release memory after
10494         encoding.
10495
10496 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10497
10498         * decimal.c (log2_32): Use an optimized version for this function too.
10499         
10500         * decimal.c (log2_64): Fix this on 32 bit machines.
10501
10502 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10503
10504         * class.c (mono_dup_array_type): Implement allocation using a mempool.
10505
10506         * class.c (mono_metadata_signature_deep_dup): Same.
10507
10508         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
10509         a mempool.
10510
10511         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
10512
10513         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
10514
10515         * metadata-internals.h: Added mono_metadata_signature_dup_full.
10516
10517         * class-internals.h: Update signatures to take a MonoMemPool.
10518
10519 2008-06-02  Dick Porter  <dick@ximian.com>
10520
10521         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
10522         * icall-def.h: Add
10523         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
10524         FormatMessage API to get the error text.  Fixes bug 321827.
10525
10526 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10527
10528         * decimal.c: Add some micro optimizations to make decimal operations faster.
10529
10530 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
10531
10532         * reflection.c (method_encode_clauses): Take a mempool
10533         as parameter and use it to allocate the clause array.
10534
10535         * reflection.c (mono_image_get_field_on_inst_token): Free
10536         the inflated type after encoding it.
10537
10538         * reflection.c (mono_dynamic_image_free): Free each element
10539         of MonoDynamicImage::gen_params.
10540
10541         * reflection.c (reflection_methodbuilder_to_mono_method):
10542         Allocate the generic param array from the mempool.
10543         Allocate signature params from the mempool.
10544
10545         * reflection.c (mono_reflection_generic_class_initialize):
10546         Free inflated fields after been used.
10547
10548 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10549
10550         * icall.c: Reapply the memory leak fixes as they no
10551         longer make mono crash.
10552
10553 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10554
10555         * reflection.c (mono_type_get_object): Don't store the suplied
10556         MonoType with type_hash. A caller which pass a type that
10557         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
10558         might end with a pointer to freed memory.
10559         The solution is to use byval_arg or this_arg from the associated
10560         MonoClass of the supplied type.
10561
10562 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
10563
10564         * icall.c: Revert the rest of the last change as it breaks the build too.
10565
10566 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10567
10568         * icall.c: Revert a leak fix as it's breaking the build.
10569
10570 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10571
10572         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
10573
10574 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10575
10576         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
10577
10578 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10579
10580         * icall.c: Fix some memory leaks.
10581
10582 2008-05-29  Dick Porter  <dick@ximian.com>
10583
10584         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
10585         async socket operations from the pending list when a socket
10586         closes.  Leaving it until the threadpool services the event
10587         exposes a race condition when a socket descriptor is reused.
10588         Fixes bug 377589.
10589
10590 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10591
10592         * object.c: Fix negative index check for array alocation.
10593
10594 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10595
10596         * icall.c, marshal.c: Delegate wrappers should skip visibility.
10597         This check is performed by the verifier for IL created delegates
10598         and by Delegate::CreateDelegate for programatically created ones.
10599         Fixes #372406.
10600
10601 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10602
10603         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
10604         Fix code to use mono_array_size_t instead of int.
10605
10606         Based on patch by Luis F. Ortiz.
10607         Contributed under X11 license.
10608         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10609
10610 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10611
10612         * icall.c: Added ves_icall_System_Array_GetLongLength and
10613         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
10614         arrays.
10615
10616         * icall.h: Export both new functions.
10617
10618         Based on patch by Luis F. Ortiz.
10619         Contributed under X11 license.
10620         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10621
10622 2008-05-28  Martin Baulig  <martin@ximian.com>
10623
10624         The debugger now requires exactly r103463.
10625
10626         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
10627         This version is not supported by the debugger, wait for 72.
10628
10629 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10630
10631         * object.h: Changed array related functions to use
10632         mono_array_size_t instead of guint32. Forgot to commit this file.
10633
10634         Patch by Luis F. Ortiz.
10635         Contributed under X11 license.
10636         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10637
10638
10639 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10640
10641         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
10642         don't define it. Use the number literal instead.
10643
10644 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10645
10646         * icall.c: Changed array related functions to use
10647         mono_array_size_t instead of guint32.
10648
10649         * icall.c (ves_icall_System_Array_GetLength): Check for length
10650         overflow under MONO_BIG_ARRAYS.
10651
10652         Based on patch by Luis F. Ortiz.
10653         Contributed under X11 license.
10654         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10655
10656 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10657
10658         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
10659
10660         Based on patch by Luis F. Ortiz.
10661         Contributed under X11 license.
10662         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10663
10664 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10665
10666         * object.c, object.h: Changed array related functions to use
10667         mono_array_size_t instead of guint32.
10668
10669         Patch by Luis F. Ortiz.
10670         Contributed under X11 license.
10671         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10672
10673 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10674
10675         * object.h: Introduced mono_array_size_t typedef. This must be used
10676         in all places an array length is expected. This is 64bits wide if
10677         MONO_BIG_ARRAYS is enabled.
10678
10679         Patch by Luis F. Ortiz.
10680         Contributed under X11 license.
10681         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10682
10683 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
10684
10685         * security-manager.c class.c: Set the class exception info by calling
10686         mono_class_set_failure ().
10687
10688         * class.c (mono_class_get_exception_data): New accessor function.
10689         (mono_class_set_failure): Store exception_data in the property hash.
10690
10691         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
10692         the struct as a property.
10693
10694         * loader.c (mono_get_method_full): Store the lookup result for method
10695         tokens in method_cache, the others in methodref_cache to decrease the memory
10696         usage of hash tables.
10697
10698         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
10699         (mono_image_init): method_cache is lazy inited now.
10700
10701         * metadata-internals.h (struct _MonoImage): Change method_cache to
10702         a MonoValueHashTable, add a separate methodref_cache.
10703
10704 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
10705
10706         * number-formatter.h: Fix tables to avoid arithemtic overflow in
10707           Double.ToString as exposed by Bug #383531.
10708
10709 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
10710
10711         * number-formatter.h: Make some tables static.
10712
10713         * class.c (mono_method_set_generic_container): New accessor function.
10714         (mono_method_get_generic_container): Ditto.
10715
10716         * class-internals.h (struct _MonoMethod): Remove rarely used 
10717         'generic_container' field, store it in the property hash instead. Add 
10718         'is_generic' boolean field instead.
10719
10720         * image.c (mono_image_init): Initialize property_hash.
10721         (mono_image_close): Destroy property_hash.
10722
10723         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
10724         hold rarely used fields of runtime structures belonging to this image.
10725
10726         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
10727         to get/set method->generic_container.
10728
10729         * loader.c (mono_get_method_from_token): Avoid loading the method header for
10730         generic methods.
10731
10732 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
10733
10734         * class.c (mono_class_inflate_generic_method_full): Don't increase
10735         mono_stats.inflated_method_count for methods found in the cache.
10736
10737         * threads.c (mono_thread_request_interruption): Add a comment about 
10738         QueueUserAPC ().
10739
10740 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
10741
10742         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
10743         interface_offsets_packed table.
10744         
10745         * class.c (mono_class_init): Remove some dead code.
10746
10747         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
10748         mono_class_setup_vtable () when CAS is active to detect security problems.
10749
10750 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
10751
10752         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
10753
10754         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
10755         parameters as it's irrelevant for delegate checking.
10756
10757 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
10758
10759         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
10760
10761         * class.c (mono_class_init): Control the creation of a generic vtable using
10762         a global which is true by default, but set to false by the runtime startup code.
10763         
10764         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
10765         Disabled for now since it breaks the embedding API.
10766         Move the setup of class->methods for arrays to mono_class_setup_methods ().
10767         (mono_class_setup_methods): Add a memory barrier.
10768
10769         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
10770         when mono_class_init () doesn't compute the generic vtable.
10771         
10772 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
10773         * profiler.c: Added mono_profiler_install_statistical_call_chain,
10774         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
10775         to support call chains (backtrace) in the stat profiler.
10776         * profiler.c, profiler-private.h: Likewise.
10777
10778 2008-05-22  Mark Probst  <mark.probst@gmail.com>
10779
10780         * generic-sharing.c: Init generic class when a method of it is
10781         requested via a runtime generic context.
10782
10783 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
10784
10785         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
10786
10787         * reflection.c (mono_type_get_object): Add a FIXME.
10788
10789         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
10790
10791         * class.c (mono_class_get_method_by_index): New helper function, returning an
10792         entry in the class->methods array.
10793
10794 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10795
10796         * class.c (mono_class_init): Only do the array optimization for szarrays. 
10797         Avoid creating a generic vtable for generic instances as well.
10798         (mono_class_get_method_from_name_flags): Don't search in the metadata for
10799         generic instances.
10800
10801 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
10802
10803         * loader.c (mono_get_method_constrained): Inflate the signature
10804         with class context. Fix #325283.
10805
10806 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10807
10808         * object.c (mono_class_create_runtime_vtable): Add a comment.
10809
10810         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
10811         where needed.
10812         (setup_interface_offsets): Handle the case when this is called twice for arrays.
10813         (mono_class_setup_vtable_general): Add an assert.
10814         (mono_class_init): Avoid creating a generic vtable for arrays.
10815
10816         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
10817         here, let mono_class_init () do that.
10818
10819         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
10820         interfaces in mscorlib.
10821
10822         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
10823         interfaces. Add some comments.
10824         (mono_class_init): Call mono_class_setup_methods () here since it is no
10825         longer called by mono_class_setup_vtable ().
10826
10827         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
10828         not set in class->vtable.
10829         (mono_class_create_runtime_vtable): Reenable the disabled code.
10830
10831         * object.c (mono_class_create_runtime_vtable): Disable the last change for
10832         now as it causes some test failures.
10833
10834         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
10835         if using the vtable trampoline. Also remove some strange code which put the
10836         generic methods themselves into the vtable slots. Remove the AOT init_vtable
10837         stuff as it is no longer needed.
10838
10839 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
10840
10841         * pedump.c: Give make --verify all option check code as well.
10842         Using --verify code won't check for metadata now.
10843
10844 2008-05-19  Martin Baulig  <martin@ximian.com>
10845
10846         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
10847
10848         * mono-debug.c
10849         (_mono_debug_using_mono_debugger): New global variable; it's set
10850         directly by the debugger, so mono_debug_using_mono_debugger() also
10851         works after attaching.
10852
10853 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
10854
10855         * object.c (mono_class_create_runtime_vtable): Use memory barriers
10856         as we do double checked locking on MonoClass::runtime_info and
10857         MonoClassRuntimeInfo::domain_vtables.
10858
10859 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
10860
10861         * debug-helpers.c (print_field_value): Fix a warning.
10862
10863 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
10864
10865         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
10866         set in the AOT case.
10867
10868 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10869
10870         * class.c (mono_class_setup_vtable_general): Use memory barriers
10871         as we do double checked locking on MonoClass::vtable.
10872
10873 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10874
10875         * reflection.c (resolve_object): Inflate only if the generic context
10876         is not null. Fixes #389886.
10877
10878 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
10879
10880         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
10881         instead of g_free.
10882
10883         Code is contributed under MIT/X11 license.
10884
10885 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10886
10887         * class.c: Revert unrelated change.
10888
10889 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10890
10891         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
10892         a generic instantiation, use mono_class_from_mono_type instead of playing
10893         with MonoType directly.
10894
10895 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10896
10897         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
10898         checks must ignore generic instantiations, so mono_class_has_parent is not
10899         suitable. Fixes #390128.
10900
10901 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
10902
10903         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
10904         it to avoid registering tokens during metadata generation. Fixes #390023.
10905
10906 2008-05-14  KornĂ©l Pál  <kornelpal@gmail.com>
10907
10908         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
10909         consistent.
10910
10911         Contributed under MIT/X11 license.
10912
10913 2008-05-14  KornĂ©l Pál  <kornelpal@gmail.com>
10914
10915         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
10916         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
10917         to fixup the EXE image.
10918         (mono_cleanup): Use mono_close_exe_image.
10919         (mono_close_exe_image): New function.
10920         * image.c: Include "marshal.h".
10921         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
10922         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
10923         counting when the image is loaded outside of mono_image_open_full. Set status
10924         based on GetLastError.
10925         * coree.c: Include required headers. Add init_from_coree.
10926         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
10927         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
10928         (_CorExeMain): Set init_from_coree.
10929         (CorExitProcess): Only call ExitProcess for now.
10930         (CorBindToRuntimeEx): New stub implementation.
10931         (CorBindToRuntime): New function.
10932         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
10933         (MonoFixupExe): ILONLY executables require no fixups.
10934         (mono_set_act_ctx): New function to set activation context.
10935         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
10936         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
10937         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
10938         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
10939         as MONO_INTERNAL.
10940         * domain-internals.h: Add mono_close_exe_image.
10941
10942         Contributed under MIT/X11 license.
10943
10944 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
10945
10946         * metadata.c (mono_metadata_compute_size): Correctly calculate field
10947         size for generic param and event tables. Fixes #388977.
10948
10949 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
10950
10951         * loader.c (mono_method_signature): Use memory barriers because of the double
10952         checked locking pattern.
10953
10954         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
10955         aborting or aborted as well. Fixes #376391.
10956         
10957         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
10958         existing runtime state in the Suspend handler during shutdown.
10959
10960 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
10961
10962         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
10963
10964         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
10965         which are starting up or shutting down.
10966
10967         * threads.c (mono_threads_set_shutting_down): Don't return a value since
10968         this function never returns if the runtime is already shutting down.
10969
10970         * icall.c (ves_icall_System_Environment_Exit): Update after 
10971         mono_threads_set_shutting_down () signature change.
10972         
10973 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
10974
10975         * class.c: Added can_access_instantiation to verify if the instantiation
10976         is visible. Fix access check for nested types as they returned TRUE
10977         before doing type and generic instantiation visibility checks.
10978
10979 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10980
10981         * reflection.c (mono_reflection_create_generic_class): The created type
10982         must have a different container from its TypeBuilder. Otherwise they
10983         will end sharing generic arguments, which is wrong.
10984
10985         Due to the sharing, making a generic instance of the created type using
10986         the TypeBuider generic arguments resulted in the generic type definition
10987         been returned, which is wrong as well.
10988
10989         As a bonus the code was leaking the type_params array. This memory should
10990         be allocated from the image mempool.
10991
10992         This fixes bug #354047.
10993
10994 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10995
10996         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
10997         to here         as they are now used in assembly.c new code.
10998         Added a skipverification flag to MonoAssembly.
10999         New internal function mono_assembly_has_skip_verification.
11000
11001         * assembly.c: New function mono_assembly_has_skip_verification. It checks
11002         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
11003         part of #387274.
11004
11005 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
11006
11007         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
11008         needed. Fixes #387034.
11009
11010         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
11011
11012 2008-05-06  Miguel de Icaza  <miguel@novell.com>
11013
11014         * assembly.c (mono_assembly_load_reference): Prevent crash while
11015         disassembling Silverlight 2.0 executables while we still do not
11016         have GACed libraries.
11017
11018 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
11019
11020         * reflection.c: Special case generic type definitions as well. Fixes #383444.
11021
11022 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
11023
11024         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
11025         of the dynamic case. Fixes #387404.
11026
11027 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
11028
11029         *verify.c (mono_verifier_is_class_full_trust): If under
11030         verify_all and the verifier mode was not set, only
11031         gac and corlib types are fulltrust. This makes --verify-all
11032         usable to detect unverifiable code, which is the expected
11033         use case.
11034
11035 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
11036
11037         * verify.h: Ops, commited the header with debug
11038         enabled.
11039
11040 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
11041
11042         * verify.c (merge_stack): Use the new value on unverifiable
11043         stack merges.
11044
11045         * verify.c (verify_type_compatibility_full): Comparison
11046         of nullable types can't use mono_class_is_assignable_from.
11047
11048         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
11049         that makes all verification errors be reported.
11050
11051         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
11052         mono_method_verify.
11053
11054 2008-05-05  Robert Jordan  <robertj@gmx.net>
11055
11056         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
11057         support for value types. See #386415.
11058
11059         * object.c: comments.
11060
11061         Code is contributed under MIT/X11 license.
11062
11063 2008-05-05  Martin Baulig  <martin@ximian.com>
11064
11065         * debug-mono-symfile.h
11066         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
11067         for old pre-terrania symbol files.
11068
11069 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
11070
11071         * mono-config.c: Add ppc64 architecture.
11072
11073         Code is contributed under MIT/X11 license.
11074
11075 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
11076
11077         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
11078           PPC64 uses function descriptors as well.
11079
11080         Code is contributed under MIT/X11 license.
11081
11082 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
11083
11084         * object.c (compute_class_bitmap): Ignore literal static fields.
11085
11086         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
11087         var has an invalid format.
11088         (describe_ptr): Add some sanity checks for the vtable.
11089         (add_nursery_frag): Clear unused nursery fragments.
11090         (major_collection): Clear all remaining nursery fragments.
11091
11092 2008-05-03  Robert Jordan  <robertj@gmx.net>
11093
11094         * image.c, metadata-internals.h: add thunk_invoke_cache.
11095
11096         * marshal.c, marshal.h: implement
11097         mono_marshal_get_thunk_invoke_wrapper ().
11098
11099         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
11100
11101         Code is contributed under MIT/X11 license.
11102
11103 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
11104
11105         * verify.c (do_leave): Empty the stack.
11106
11107 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
11108
11109         * class.c (mono_class_is_assignable_from): Variance
11110         doesn't work between reference and value types. For example,
11111         given type C<T+>, C<int32> is not assignable to C<object>.
11112         Break the argument checking loop on first error. 
11113
11114 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
11115
11116         * icall.c : base64_to_byte_array() needs some more strict
11117           check for sequence of '=' characters. Patch by Santa
11118           Marta (http://deee.g.hatena.ne.jp/santamarta).
11119
11120           Contributed under MIT/X11 license.
11121           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
11122
11123 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
11124
11125         * domain.c: Disable LoadLibrary support to fix Win32 build.
11126
11127         Code is contributed under MIT/X11 license.
11128
11129 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
11130
11131         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
11132         to help with cache behaviour.
11133
11134 2008-05-01  Miguel de Icaza  <miguel@novell.com>
11135
11136         * appdomain.c (mono_domain_from_appdomain): Add new accessor
11137         method. 
11138
11139 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
11140
11141         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
11142
11143 2008-05-01  Dick Porter  <dick@ximian.com>
11144
11145         * process.c (process_get_fileversion): Only pass 16 bits of
11146         language ID to VerLanguageName.  Fixes bug 381204.
11147
11148 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
11149
11150         * verify.c (mono_method_verify): Fix the comparison
11151         operator for code bounds check.
11152
11153 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
11154
11155         * verify.c (mono_method_verify): Check the bounds of
11156         all access of the code array.
11157
11158 2008-04-29  KornĂ©l Pál  <kornelpal@gmail.com>
11159
11160         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
11161
11162 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
11163
11164         * image.c (mono_image_strong_name_position): Fix return value when the rva is
11165         not valid.
11166
11167 2008-04-28  KornĂ©l Pál  <kornelpal@gmail.com>
11168
11169         * loader.c (mono_get_method_from_token, mono_method_signature): Add
11170         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
11171         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
11172         fixup main EXE images when using mono.exe for mixed-mode assembly support.
11173         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
11174         mono_runtime_load.
11175         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
11176         runtime initialization from metadata.
11177         * assembly.c: Remove obsolete ceGetModuleFileNameA.
11178         (mono_set_rootdir): Use mono_get_module_file_name.
11179         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
11180         handles.
11181         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
11182         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
11183         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
11184         MonoCLIImageInfo. Add support for module handles.
11185         (load_cli_header): Update mono_cli_rva_image_map signature.
11186         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
11187         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
11188         (mono_image_rva_map): Add support for module handles.
11189         (mono_image_ensure_section_idx): Add support for module handles.
11190         (mono_image_close): Add support for module handles.
11191         (do_load_header): Add support for module handles.
11192         (mono_image_open_from_module_handle): New function for internal use.
11193         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
11194         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
11195         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
11196         handles.
11197         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
11198         * image.h: Add mono_image_fixup_vtable.
11199         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
11200         support.
11201         * coree.h: New file.
11202         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
11203         unsupported native code.
11204         (mono_marshal_set_callconv_from_modopt): New function splitted from
11205         mono_marshal_get_managed_wrapper.
11206         (mono_marshal_get_managed_wrapper): Use
11207         mono_marshal_set_callconv_from_modopt.
11208         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
11209         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
11210         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
11211         that results in a deadlock when the runtime is loaded in _CorDllMain.
11212         * Makefile.am: Add coree.c and coree.h.
11213
11214         Contributed under MIT/X11 license.
11215
11216 2008-04-28  Mark Probst  <mark.probst@gmail.com>
11217
11218         * generic-sharing.c: Search for type arguments in array element
11219         types as well.
11220
11221 2008-04-28  Mark Probst  <mark.probst@gmail.com>
11222
11223         * class-internals.h, generic-sharing.c: New, small runtime generic context.
11224
11225         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
11226
11227         * object.c: Don't setup the RGCTX when the vtable is created,
11228         because we're setting it up lazily now.
11229
11230 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
11231
11232         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
11233         64 bit support.
11234
11235 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
11236
11237         * verify.c (verify_class_for_overlapping_reference_fields): 
11238         If class is under fulltrust allow reference types to overllap
11239         if they have the same RVA.
11240
11241 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
11242
11243         * pedump.c: Added new flag valid-only, that makes the verifier
11244         behaves just like --security=validil. It won't fail type load
11245         due to unverifiable restrictions.
11246
11247 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
11248
11249         * class-internals.h (struct MonoMethod): Added a verification_success
11250         field to cache verifier executions. Reduced MonoMethod:slot size by
11251         one bit.
11252
11253 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
11254
11255         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
11256         instead of a 'vt' argument to save an indirection and to allow these to be used
11257         for valuetypes.
11258         (scan_vtype): New helper function to scan an area using a gc descriptor.
11259         (mono_gc_wbarrier_value_copy): Implement this.
11260         (handle_remset): Add support for REMSET_VTYPE.
11261         (find_in_remset_loc): Ditto.
11262         (mono_gc_base_init): Allow some debugging options to be controlled through the
11263         use of the MONO_GC_DEBUG env variable.
11264         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
11265         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
11266
11267 2008-04-23  Martin Baulig  <martin@ximian.com>
11268
11269         * domain.c (mono_domain_create): Move the call to
11270         mono_debug_domain_create() down, after allocating the domain id.
11271
11272 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
11273
11274         verify.c (verify_class_for_overlapping_reference_fields): Skip
11275         static fields while verifying for overlapping fields as they
11276         don't matter at all.
11277
11278 2008-04-23  Marek Habersack  <mhabersack@novell.com>
11279
11280         * domain-internals.h: added a declaration of
11281         mono_make_shadow_copy.
11282
11283         * assembly.c (mono_assembly_open_full): shadow copying of
11284         assemblies moved to here, so that all the assemblies within the
11285         application domain's private binary directories can be
11286         processed. Fixes bug #380546
11287
11288         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
11289         mono_make_shadow_copy and made non-static. The decision whether
11290         to shadow-copy an assembly is made based on its location - it's
11291         copied if it's in one of the private application domain binary
11292         directories and its different to the target file in the shadow
11293         directory. Fixes bug #380546
11294
11295 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
11296
11297         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
11298
11299         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
11300         types.
11301
11302         * reflection.c (mono_image_create_token): Handle 
11303         Method/ConstructorOnTypeBuilderInst.
11304         (resolve_object): Ditto.
11305         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
11306         so it can be called from resolve_object. Also handle the case when the inflated
11307         class already has its methods setup.
11308
11309 2008-04-21  Martin Baulig  <martin@ximian.com>
11310
11311         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
11312
11313 2008-04-20  Geoff Norton  <gnorton@novell.com>
11314
11315         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
11316         pointer dereference.
11317
11318 2008-04-15  Marek Habersack  <mhabersack@novell.com>
11319
11320         * appdomain.c (try_load_from): if IOMAP is in effect, call the
11321         portability API to look up the assembly file. Fixes behavior in
11322         situations when the application has a bin/ directory, but the
11323         assembly search patch refers to Bin/ (and thus the requested file
11324         name is Bin/SomeLibrary.dll). Fixes bug #379888
11325
11326 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
11327
11328         verify.c (mono_type_is_generic_argument): Extracted this check
11329         from a dozen places to here.
11330
11331         verify.c: Fixed all issues related to boxing generic arguments
11332         and their constraints.
11333
11334 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
11335
11336         verify.c (mono_class_interface_implements_interface): Fix win32 build.
11337
11338 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
11339
11340         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
11341         isn't finished yet. Fixes #363447.
11342
11343 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
11344
11345         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
11346         Fixes #346419.
11347
11348 2008-04-13  Jb Evain  <jbevain@novell.com>
11349
11350         * domain.c: update the 2.1 profile versions.
11351         Merged from the Moonlight 2 branch.
11352
11353 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
11354
11355         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
11356         mscorlibs for the non-refonly case as well.
11357
11358         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
11359         in mono_assembly_load_from_full (). Fixes #378924.
11360
11361 2008-04-11  Geoff Norton  <gnorton@novell.com>
11362
11363         * icall.c: The global extern environ doesn't exist on Mac.  We
11364         need to call NSGetEnviron instead.
11365
11366 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11367
11368         verify.c: Add generic method constraint verification.
11369
11370 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11371
11372         class.c (mono_class_inflate_generic_method_full): Add a long
11373         explanation to the is_mb_open hack. Remove the FIXME.
11374
11375 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11376
11377         * verify.c (mono_method_verify): Mark all unknown opcodes
11378         as invalid. Mark jmp as unverifiable.
11379
11380 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11381
11382         * verify.c: Add code to do type constraint verification on class instances.
11383
11384         * verify.c (mono_verifier_verify_class): Use the type constraint 
11385         verification code.
11386
11387 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11388
11389         * class.c (mono_class_get_field_default_value): Don't pass cindex
11390         as hint to mono_metadata_get_constant_index. The local is not initialized
11391         and should contain garbage most of the time. This could only work
11392         with a lot of luck.
11393
11394 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11395
11396         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
11397
11398 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11399
11400         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
11401
11402         * class.c (mono_class_from_generic_parameter): Save the token of the
11403         generic param in MonoClass::sizes.generic_param_token.
11404
11405         * reflection.c (mono_custom_attrs_from_class): If the class type is
11406         VAR or MVAR retrieve the attributes of the generic param.
11407
11408 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11409
11410         * class.c (mono_class_init): Do class verification if the verifier
11411         is enabled.
11412
11413 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11414
11415         * verify-internal.h: Added mono_verifier_verify_class.
11416
11417         * verify.c: Added mono_verifier_verify_class. It checks for
11418         classes with explicit layout that have overlapping reference fields.
11419
11420         * pedump.c: Init the verifier state prior to verification. Fixed
11421         command line arguments.
11422
11423 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11424
11425         * Makefile.am: Added verify-internals.h, hopefully fix the build.
11426
11427 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
11428
11429         * verify-internals.h: Fix a warning.
11430
11431 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11432
11433         * verify-internals.h: New header with the verifier configuration
11434         extracted from mini.c.
11435
11436         * verify.c: Implemented the new functions exported by verify-internals.h.
11437
11438 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11439
11440         * verify.c: Add proper verification of ckfinite.
11441
11442 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11443
11444         * verify.c (do_conversion): Improved error message to something
11445         more meanfull.
11446
11447         * verify.c (check_is_valid_type_for_field_ops): Fix to work
11448         with primitive types.
11449
11450 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11451
11452         * verify.c: Added tail prefix checking. Marked icall
11453         as unverifible.
11454
11455 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11456
11457         * verify.c: Fix the detection of branches to the middle
11458         of an instruction.
11459
11460 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
11461
11462         * verify.c: Implemented verification of volatile. and
11463         unaligned. prefix. Check if a type is valid after retrieving it.
11464
11465 2008-04-01  Dick Porter  <dick@ximian.com>
11466
11467         * process.c (process_get_fileversion): If there's no string block,
11468         set the file language to en_US.  Fixes the other new part of bug
11469         374600.
11470
11471 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
11472
11473         * class.c: New functions mono_method_can_access_field_full and
11474         mono_method_can_access_method_full. They perform type visibility
11475         and type site check.
11476
11477         * class-internal.h: Added exported functions.
11478
11479         * verify.c: Use new functions to implement proper visibility checks.
11480
11481 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
11482
11483         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
11484
11485 2008-03-28  Dick Porter  <dick@ximian.com>
11486
11487         * process.c (process_get_fileversion): Use the first language ID
11488         we see, rather than insisting on an invariant language.  Fixes bug
11489         374600.
11490
11491 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
11492
11493         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
11494         the streams to fix reading of invalid memory later.
11495
11496         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
11497         to ease debugging.
11498
11499 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
11500
11501         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
11502         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
11503
11504 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
11505         * threads.h: Added MonoThreadManageCallback type and
11506         mono_thread_set_manage_callback prototype
11507         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
11508         (used to store the mono_thread_manage callback).
11509         * threads.c: Added mono_thread_set_manage_callback, and handle
11510         "MonoThread->manage_callback" in build_wait_tids.
11511
11512 2008-03-26  Dick Porter  <dick@ximian.com>
11513
11514         * process.c (process_get_fileversion): Set FileVersionInfo strings
11515         to Empty when the resource doesn't have the particular info.
11516         Fixes bug 355717.
11517
11518 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
11519
11520         * verify.c (mono_method_verify): Proper prefix validation.
11521
11522 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
11523
11524         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
11525         itself in a separate argument instead of throwing them. Fixes #373448.
11526
11527         * appdomain.c: Bump corlib version.
11528
11529 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
11530
11531         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
11532
11533 2008-03-20  KornĂ©l Pál  <kornelpal@gmail.com>
11534
11535         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
11536         version macros.
11537
11538 2008-03-20  Mark Probst  <mark.probst@gmail.com>
11539
11540         * generic-sharing.c, class-internals.h: Code for putting
11541         reflection types into the runtime generic context.
11542
11543 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
11544
11545         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
11546         Fixes #340662. 
11547
11548
11549 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
11550
11551         * verify.c (VerifyContext): Added instruction prefix data to the struct.
11552
11553         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
11554
11555         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
11556
11557         * verify.c (do_cast): Let the result value keep the boxed status.
11558
11559         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
11560
11561 2008-03-17  Jb Evain  <jbevain@novell.com>
11562
11563         * reflection.c: when running on a 2.0 runtime, emit
11564         unconditionally the #~ header version as 2.0, and the
11565         CLI header version as 2.5, for symmetry's sake with csc.
11566
11567 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11568
11569         * class.c: Remove the unused cache_interface_offsets stuff.
11570
11571         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
11572         profiler.c: Fix warnings.
11573
11574 2008-03-16  Mark Probst  <mark.probst@gmail.com>
11575
11576         * generic-sharing.c, class-internals.h: Support for putting
11577         methods into the runtime generic context.
11578
11579 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11580
11581         * class.c (mono_class_setup_fields): Ignore calls made to this function for
11582         classes which are generic instances of not-yet finished typebuilders. Fixes
11583         #351172.
11584
11585         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
11586
11587 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
11588
11589         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
11590
11591         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
11592         field, replace it with a hash table in MonoDynamicImage.
11593
11594         * reflection.c (inflate_mono_method): Access the generic definition object from
11595         image->generic_def_objects instead of imethod->reflection_info.
11596
11597         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
11598
11599         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
11600         
11601         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
11602         function in reflection.c so it is easier to keep in sync with the dynamic image
11603         creation code.
11604
11605         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
11606         mono_image_close ().
11607
11608 2008-03-15  Mark Probst  <mark.probst@gmail.com>
11609
11610         * class.c (mono_class_generic_sharing_enabled): Disable generic
11611         sharing for all architectures except AMD64 and x86 to fix build.
11612
11613 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11614
11615         * verify.c: Use the generic definition MonoGenericContext when available.
11616         Remove code for checking generics instance compatibility in favor of
11617         mono_class_is_assignable_from.
11618
11619 2008-03-14  Mark Probst  <mark.probst@gmail.com>
11620
11621         * marshal.c, marshal.h, metadata-internals.h, image.c,
11622         wrapper-types.h: New wrapper for invoking a shared static method
11623         without having to pass the runtime generic context argument.
11624
11625 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11626
11627         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
11628
11629 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
11630
11631         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
11632         
11633         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
11634         create a token from a FieldOnTypeBuilderInst.
11635         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
11636         (resolve_object): Ditto.
11637
11638         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
11639         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
11640
11641 2008-03-14  Martin Baulig  <martin@ximian.com>
11642
11643         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
11644
11645         * debug-mono-symfile.h
11646         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
11647         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
11648
11649 2008-03-10  Martin Baulig  <martin@ximian.com>
11650
11651         * debug-mono-symfile.h
11652         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
11653         `lexical_block_table_offset'.
11654         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
11655         `lexical_blocks'.
11656         (MonoSymbolFile): Added `version'.
11657
11658         * mono-debug.h
11659         (MonoDebugLexicalBlockEntry): Removed.
11660         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
11661         `lexical_blocks'.
11662
11663         * mono-debug.c (mono_debug_add_method): Don't compute lexical
11664         blocks here; the debugger now does this internally.
11665
11666 2008-02-27  Martin Baulig  <martin@ximian.com>
11667
11668         * object.c (mono_runtime_exec_main): Call
11669         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
11670         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
11671
11672 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11673
11674         * verify.c (verify_type_compatibility_full): Allow native int to be converted
11675         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
11676
11677 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11678
11679         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
11680         ldftn with a virtual method.
11681
11682 2008-03-13  Geoff Norton  <gnorton@novell.com>
11683
11684         * decimal.c:  Only include memory.h if the platform has it.
11685
11686 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
11687
11688         * assembly.c, class.c, metadata-internals.h: make sure public key
11689         tokesns are compared in a case-insensitive way. Also, all
11690         the lookups in the GAC use a lowercase public key token
11691         (gaacutil already does the lowercasing on install). Fixes
11692         bug #369541.
11693
11694 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
11695
11696         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
11697         and return value.
11698
11699 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
11700
11701         * image.c: when someone loads a mscorlib from a file, return the
11702         currently loaded mscorlib (fixes bug #369253).
11703
11704 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11705
11706         * class.c: handle types with no parents by forcing them to have
11707         System.Object as a parent and marking them as broken (this currently
11708         allows the first part of bug #369173 to work as well, likely because
11709         we don't check for typeload exceptions everywhere yet).
11710
11711 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
11712
11713         * class.c: more complete check that types belong to corlib
11714         (fixes second part of bug #369173).
11715
11716 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
11717
11718         * generic-sharing.c:  Including glib.h for the MSVC builds to define
11719           "inline" to "__inline" before including mono-membar.h.
11720           
11721         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
11722           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
11723           MSVC builds.
11724
11725         Contributed under MIT/X11 license.
11726
11727 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11728
11729         * verify.c (do_invoke_method): Remove return type validation.
11730
11731         * verify.c (do_ret): Do return type validation at return site instead of
11732         call site.
11733
11734 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11735
11736         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
11737
11738         * verify.c: Some todos cleaned and improved a few error messages.
11739
11740 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
11741
11742         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
11743
11744 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
11745
11746         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
11747         system types correctly.
11748
11749         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
11750         function.
11751
11752 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11753
11754         * assembly.c (build_assembly_name): Fix a warning.
11755
11756 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
11757
11758         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
11759         the called function takes an object type argument. Fixes storing or
11760         valuetypes across remoting as well as reducing memory usage.
11761         * image.c, metadata-internals.h: remove now unused ldfld_remote and
11762         stfld_remote wrapper caches.
11763
11764 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11765
11766         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
11767         is not found.
11768
11769         * reflection.c (mono_image_register_token): New helper function to save
11770         a token->object mapping.        
11771
11772         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
11773         managed code.
11774
11775         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
11776         one dimension arrays. Fixes #367670.
11777         (mono_reflection_get_type_internal): Ditto.
11778
11779 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
11780
11781         * marshal.c: mono_load_remote_field_new() always returns object.
11782         so use the proper signature (fixes bug #366445).
11783
11784 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11785         
11786         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
11787         add an 'inline_failure' flag instead.
11788
11789 2008-03-04  Mark Probst  <mark.probst@gmail.com>
11790
11791         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
11792         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
11793         contains the location of "this", used for exception handling.
11794
11795 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11796
11797         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
11798         their size on all platforms for perf reasons.
11799
11800 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11801
11802         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
11803         object-internal.h
11804
11805         * object-internal.h: Same.
11806
11807 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11808
11809         * reflection.h: Fix the build I just broke.
11810
11811 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11812
11813         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
11814         Test if a token is valid, this remove explicit usage of 
11815         MonoDynamicImage::tokens from the verifier code.
11816
11817         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
11818
11819         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
11820         instead of direct access to MonoDynamicImage::tokens.
11821
11822 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11823
11824         * verify.c (token_bounds_check): Fix the build I just broke.
11825
11826 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11827
11828         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
11829
11830         * verify.c (verifier_load_method): Fixed the errors message.
11831
11832         * verify.c (mono_method_verify): Fixed a debug message.
11833
11834 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
11835
11836         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
11837         mono-perfcounters.h, class-internals.h: support for predefined
11838         writable counters, query of categories and counters, bugfixes.
11839
11840 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11841
11842         * verify.c (do_refanytype): Verify the refanytype opcode.
11843
11844         * verify.c (mono_method_verify): Use do_refanytype.
11845
11846 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11847
11848         * verify.c (do_mkrefany): Verify the mkrefany opcode.
11849
11850         * verify.c (mono_method_verify): Use do_mkrefany.
11851
11852 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
11853
11854         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
11855         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
11856         implementation.
11857
11858 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11859
11860         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
11861         the type load exception.
11862
11863 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
11864
11865         * verify.c: Added a few FIXME for method signatures
11866
11867         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
11868         of mono_method_get_signature and get vararg call working. Removed unused
11869         checks for return value.
11870
11871         * verify.c (do_refanyval): Verify the refanyval opcode.
11872
11873         * verify.c (mono_method_verify): Implemented verification of arglist and
11874         use do_refanyval.
11875
11876 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11877
11878         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
11879         vtypes to marshal.c.
11880
11881         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
11882         it works for AOT as well.
11883
11884 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11885
11886         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
11887         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
11888         the system time is adjusted.
11889
11890 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
11891
11892         * icall.c, icall-def.h: use the new time functions (fixes the
11893         non-monotonic behaviour of TickCount).
11894
11895 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
11896
11897         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
11898         it breaks the build.
11899         
11900         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
11901         cattr is not finished yet.
11902
11903 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11904
11905         * verify.c: Proper token validation for field, method and type.
11906
11907 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11908
11909         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
11910
11911         * loader.c (method_from_memberref): Generate type load error instead of method missing
11912         if the type is not found.
11913
11914 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
11915
11916         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
11917         some of the conversions caused the generation of a marshal directive exception.
11918
11919 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11920
11921         verify.c: Report which exception should be thrown by the JIT.
11922         Added a lot of FIXME notes.
11923
11924 2008-02-22  Mark Probst  <mark.probst@gmail.com>
11925
11926         * generic-sharing.c: Runtime generic context slots are not
11927         instantiated on init anymore.  Instead, provide function to do the
11928         instantiating on demand.
11929
11930         * class-internals.h: Added vtable to runtime generic context.
11931         Macros for encoding direct and indirect slot offsets in one
11932         guint32.
11933
11934 2008-02-21  Mark Probst  <mark.probst@gmail.com>
11935
11936         * object.c, generic-sharing.c: Moved some generic sharing code
11937         from object.c to generic-sharing.c.
11938
11939         * generic-sharing.c: Added support for extensible runtime generic
11940         context.
11941
11942         * metadata-internals.h: Two new hash tables in MonoImage for
11943         extensible runtime generic context support.
11944
11945         * domain.c: Unregister generic vtables upon domain unloading.
11946
11947         * image.c: Destroy new hash tables upon image unloading.
11948
11949         * metadata.c: Unregister generic subclasses upon image unloading.
11950
11951         * class-internals.h: New data structure for runtime generic
11952         context template.  New fields in the runtime generic context for
11953         extensible part.
11954
11955         * Makefile.am: Added generic-sharing.c.
11956
11957 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11958
11959         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
11960         there is a pending loader exception, raise it.
11961
11962         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
11963         same.
11964
11965         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
11966         same.
11967
11968         Fixes #363450.
11969
11970 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
11971
11972         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
11973
11974         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
11975         
11976         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
11977         ref-only requests for compatibility with MS.
11978
11979 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11980
11981         * reflection.c (mono_custom_attrs_from_method): Don't silently
11982         return an empty list for generic method instances.
11983         (mono_custom_attrs_from_param): Likewise.
11984
11985 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
11986             Raja R Harinath  <harinath@hurrynot.org>
11987
11988         Fix #354757
11989         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
11990         * class.c (mono_class_inflate_generic_method_full): Initialize it
11991         when a fully-open method is instantiated.
11992         * metadata.c (inflated_method_equal, inflated_method_hash): Update
11993         to new field.
11994         * reflection.c (inflate_mono_method): Don't create a temporary context.
11995
11996 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11997
11998         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
11999         Compute correct value, to prepare for imethod->reflection_info going away.
12000
12001 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
12002
12003         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
12004
12005 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
12006
12007         * verify.c: Implement skip visibility flag.
12008
12009 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
12010
12011         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
12012         which contains an extra field to tell the kind of exception that should be thrown.
12013
12014         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
12015
12016 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
12017
12018         * loader.c (mono_method_get_param_names): Initialize 'klass' after
12019         'method' is updated.
12020
12021 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
12022
12023         * class.c (mono_class_layout_fields): Set class->min_align for classes using
12024         explicit layout as well. Fixes #360375.
12025
12026 2008-02-11  Geoff Norton  <gnorton@novell.com>
12027
12028         * loader.c: Guard and dereference against inflated generic methods
12029
12030 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
12031
12032         * class.c: Include Retargetable spec in assembly name.
12033         * assembly.c: Always include PublicKeyToken spec in assembly name
12034         (with value "null" if assembly is not signed), and include
12035         Retargetable spec.
12036         * icall-def.h: Added icall for Assembly.get_fullname.
12037         * icall.c: Added icall returning the fullname of an assembly.
12038
12039 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
12040
12041         * class.c (mono_class_setup_vtable_general): Add a missing call to
12042         mono_class_setup_methods () which is needed in the AOT case.
12043
12044 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
12045
12046         * verify.c (mono_type_get_stack_name): Added. Return the name for the
12047         stack type of the given MonoType.
12048
12049         * verify.c (verify_type_compatibility_full): Handle the void type.
12050
12051         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
12052         way stack merging works.
12053
12054         * verify.c (store_local): Improved verification message.
12055
12056         * verify.c (do_branch_op): If the merging is invalid, the method
12057         is unverifiable and not invalid. Improved error message.
12058
12059         * verify.c (merge_stacks): Properly merge a boxed valuetype and
12060         a reference type diferent than System.Object. Improved error
12061         message.
12062
12063 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
12064
12065         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
12066
12067         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
12068         type of an enum even if the argument is byref.
12069
12070         * verify.c: Replace all explicit uses of enumtype and enum_basetype
12071         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
12072
12073         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
12074
12075         *verify.c (verify_type_compatibility_full): Make enum types
12076         compatible with their base types.
12077
12078         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
12079         types are compatible for the special case of a boxed valuetype and
12080         System.Object.
12081
12082         * verify.c (verify_stack_type_compatibility): The function
12083         is_compatible_boxed_valuetype was extracted from here.
12084
12085         * verify.c (push_arg): Only set ctx->has_this_store if the method
12086         is not static.
12087
12088         * verify.c (do_ldelem): Fixed a typo in an error message and added
12089         strict check for mixing int32 and native int as the array type
12090         and ldelem type.
12091
12092         * verify.c (merge_stacks): Consider boxed valuetypes in the
12093         compatibility checks.
12094
12095 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
12096         * profiler.h: (MonoGCEvent): Added start-stop the world events.
12097
12098 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
12099         *class.c: use_new_interface_vtable_code: renamed the env var to have
12100         a "MONO_" prefix, and fix the logic to enable it by default.
12101
12102 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
12103         *class.c:
12104         mono_class_setup_vtable_general: rewrote the way in which interface
12105         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
12106         makes the code more maintainable.
12107         For now the old code is still there, and can be activated setting
12108         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
12109
12110 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
12111
12112         * verify.c: guarded some debug functions around and #ifdef.
12113
12114         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
12115
12116 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
12117
12118         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
12119         changes for now since they seem to break too many things.
12120
12121 2008-02-05  Mark Probst  <mark.probst@gmail.com>
12122
12123         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
12124         mono_marshal_find_nonzero_bit_offset): Added macro and function
12125         for finding the byte- and bit-offset of a bitfield within a
12126         struct.
12127
12128 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
12129
12130         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
12131         (mono_marshal_get_struct_to_ptr): Ditto.
12132
12133         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
12134         cctor_signature.
12135
12136 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
12137
12138         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
12139         between methods for non-corlib types.
12140
12141 2008-02-02  Geoff Norton  <gnorton@novell.com>
12142
12143         * loader.c (mono_method_get_param_names): Populate the parameter name for 
12144         generic parameters as well. (Fixes #342536)
12145
12146 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
12147
12148         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
12149
12150         * verify.c (do_invoke_method): Fix for calling with byref structs.
12151
12152         * verify.c (do_cast): push a boxed value type based on the type token and not
12153         the type of stack.
12154
12155 2008-01-31  William Holmes  <billholmes54@gmail.com>
12156
12157         * process.c (process_module_string_read): Check the size returned form 
12158           VerQueryValue to avoid out of memory exception. 
12159
12160 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
12161
12162         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
12163         Handle properly modules which are not in the moduleref table. Fixes
12164         #356938.
12165
12166 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
12167
12168         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
12169         the dynamic case which is now in managed code.
12170         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
12171
12172         * marshal.c (mono_string_to_bstr): Fix a warning.
12173         (init_com_provider_ms): Ditto.
12174
12175         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
12176
12177         * exception.c (mono_get_exception_out_of_memory): New helper function.
12178
12179 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
12180
12181         * marshal.c: Add support for BSTR marshalling
12182         using other COM systems.
12183
12184         Code is contributed under MIT/X11 license.
12185
12186 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12187
12188         * object.c (mono_runtime_invoke_array): reverted previous
12189         commit as it breaks the build.
12190
12191 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12192
12193         * object.c (mono_runtime_invoke_array): Verify arguments for
12194         invalid types. Fixes #348522.
12195
12196 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12197
12198         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
12199         non-final virtual calls using call. 
12200
12201         * verify.c (do_invoke): fixed some TODOs.
12202
12203         * verify.c (push_arg): set has_this_store for "ldarga 0".
12204
12205 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
12206
12207         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
12208         which belong to an inflated class. Fixes #356531.
12209
12210 2008-01-26  Robert Jordan  <robertj@gmx.net>
12211
12212         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
12213         which resort to FindFirstFile when a certain error condition
12214         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
12215         Code is contributed under MIT/X11 license.
12216
12217 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
12218
12219         * marshal.c (emit_marshal_string): Fix out string marshalling
12220         to use specified encoding. Fixes #323900.
12221
12222         Code is contributed under MIT/X11 license.
12223
12224 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
12225
12226         * class.c (mono_class_inflate_generic_method_full): Don't modify
12227         iresult->context after cache check.
12228
12229 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
12230
12231         * class.c (mono_class_inflate_generic_method_full): Change the
12232         struct assignments to memcpy for better visibility and add some comments.
12233
12234 2008-01-23  Dick Porter  <dick@ximian.com>
12235
12236         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
12237         procedure, and make it work on windows.
12238
12239 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
12240
12241         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
12242         a MonoReflectionTypeBuilder since it is always of that type.
12243
12244         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
12245
12246         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
12247
12248         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
12249         
12250         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
12251
12252         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
12253
12254         * reflection.c (mono_reflection_create_runtime_class): Remove already created
12255         instantiations from the type cache.
12256
12257 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12258
12259         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
12260
12261         * verify.c (do_unbox_value): push a controled mutability managed pointer.
12262
12263 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12264
12265         * verify.c (do_ldstr): added, verifies if the #US token is valid.
12266
12267         * verify.c (mono_method_verify): removed old TODO
12268
12269 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12270
12271         * verify.c (do_newobj): add visibility check.
12272
12273 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12274
12275         * verify.c (do_load_function_ptr): add visibility check.
12276
12277 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
12278         *class.c:
12279         mono_generic_class_get_class: hook profiler events.
12280         mono_field_get_offset: added to support heap-shot in the new profiler.
12281         *class.h: exported mono_field_get_offset.
12282         * reflection.c:
12283         mono_reflection_setup_internal_class: hook profiler events.
12284
12285 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
12286
12287         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
12288         argument here too and use it to avoid checking for pending exceptions if 
12289         possible.
12290
12291 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
12292
12293         * assembly.c (build_assembly_name): add arg for passing the assembly
12294         flags. Do not consider a PublicKey with value "null" valid.
12295         (mono_assembly_name_parse_full): added boolean argument that will be
12296         set if the assembly name contains a PublicKeyToken spec. Added support
12297         for the Retargetable spec for which only Yes or No are allowed as valid
12298         value. Consider assembly name invalid if Retargetable spec is set, but
12299         either version, culture or public key (token) are not specified.
12300         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
12301         with implementation in assembly.c.
12302         * icall.c (fill_reflection_assembly_name): also copy assembly flags
12303         from MonoAssemblyName.
12304         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
12305         introduced argument for mono_assembly_name_parse_full to know if the
12306         assembly name has a PublicKeyToken spec, and if it has instruct
12307         fill_reflection_assembly_name to use default value for keyToken (if
12308         PublicKeyToken is null).
12309
12310 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12311
12312         * verify.c (mono_method_verify): fixed ovf ops with
12313         float values. They are unverifiable now.
12314
12315 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12316
12317         * class.c (set_failure_from_loader_error): add BadImageException to the
12318         list of exceptions that can cause a type to fail to load.
12319
12320         * class.c (mono_class_get_exception_for_failure): same.
12321
12322 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
12323
12324         * verify.c (in_any_exception_block): added, check if offset
12325         is part of any exception handling clause.
12326
12327         * verify.c (get_stack_type): added VAR and MVAR types.
12328
12329         * verify.c (do_stobj): better error messages.
12330
12331         * verify.c (do_cpobj): added, check cpobj.
12332
12333         * verify.c (do_initobj): added, check initobj.
12334
12335         * verify.c (do_sizeof): added, check sizeof.
12336
12337         * verify.c (do_localloc): added, check localloc.
12338
12339         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
12340
12341 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
12342
12343         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
12344         save_lmf/restore_lmf opcodes.
12345
12346         * threads.c (mono_threads_install_notify_pending_exc): New function to
12347         install a callback notifying the JIT there is a pending exception on a thread.
12348         (mono_thread_request_interruption): Call the new callback.
12349         (mono_thread_get_and_clear_pending_exception): New function to return the
12350         exception pending on a thread.
12351
12352         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
12353         to turn off checking for pending exceptions.
12354         (mono_marshal_get_native_wrapper): Ditto.
12355
12356 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12357
12358         * threads-types.h: Get rid of the unnecessary extern declarations.
12359
12360 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
12361
12362         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
12363         return field from parent class if not private.
12364         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
12365         returns fields from parent class if they are not private.
12366         (method_nonpublic): added function to determine if a given method
12367         should be considered non-public. Returns false for private methods
12368         on parent class, and internal methods from parent on the 1.0 profile.
12369         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
12370         use method_nonpublic function to determine whether method should be
12371         returned.
12372         (property_accessor_public): use newly introduced method_nonpublic
12373         function to determine whether accessor is non-public. 
12374         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
12375         event from parent class if not private. Only return static event if
12376         Static flag is set, and only return static event from parent class if
12377         FlattenHierarchy flag is set.
12378         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
12379         include non-private events from parent class.
12380
12381 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12382
12383         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
12384         warning.
12385
12386 2008-01-16  Wade Berrier <wberrier@novell.com>
12387
12388         * security.c: Add assembly.h header to appease some warnings
12389
12390 2008-01-16  Dick Porter  <dick@ximian.com>
12391
12392         * process.c (process_module_string_read): Remove trailing null
12393         when saving string.
12394
12395 2008-01-16  Mark Probst  <mark.probst@gmail.com>
12396
12397         * class-internals.h: A new data structure describing the layout of
12398         a runtime generic context (MonoRuntimeGenericContextTemplate).
12399
12400         * metadata-internals.h: Added a hash table to MonoDomain that maps
12401         from open generic classes to their runtime generic context
12402         templates.
12403
12404         * object.c: Building of the runtime generic context, including
12405         proper handling of generic type arguments of superclasses.
12406         Building of the runtime generic context according to the template.
12407
12408 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
12409
12410         * class.c (mono_class_setup_fields): Set field.count for generic instances.
12411         Fixes #350856.
12412
12413         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
12414         mono_portability_find_file (). Fixes #325466.
12415         (mono_image_get_public_key): Fix a warning.
12416
12417 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
12418
12419         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
12420         Fixes #353550.
12421         (mono_class_from_name_case): Ditto.
12422
12423 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
12424
12425         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
12426           common storage for the tables used in the System/NumberFormatter class.
12427
12428 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
12429
12430         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
12431
12432 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
12433
12434         * verify.c (get_boxable_mono_type): check if the token is valid.
12435
12436         * verify.c (set_stack_value): changed to add an error if an
12437         invalid type is set on stack. Changed all callers due to signature change.
12438
12439         * verify.c (do_stobj): implement stobj validation.
12440
12441 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
12442
12443         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
12444         set container->is_method, it was set earlier.
12445
12446         * metadata.c (type_in_image): Handle MVARs which belong to not finished
12447         generic methods.
12448
12449         * reflection.c (mono_reflection_initialize_generic_parameter): Set
12450         is_method of the generic container to TRUE for methods.
12451
12452 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12453
12454         * metadata.c (type_in_image): Handle type parameters properly.
12455
12456         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
12457         memory ownership of this structure.
12458
12459 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
12460
12461         * verify.c (get_boxable_mono_type): make typedref types been just
12462         unverifiable. check for void type.
12463
12464         * verify.c (do_unbox_any): added, verify opcode unbox.any.
12465
12466         * verify.c (do_load_function_ptr): accept method spec tokens.
12467
12468 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12469
12470         * marshal.c (mono_class_native_size): Always set *align even if this is called
12471         recursively.
12472
12473 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
12474
12475         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
12476         out-of-date.
12477
12478 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
12479
12480         * verify.c: removed some old unused tables. A huge bunch of small fixes
12481         to things found while testing the verifier with mono basic.
12482
12483         * verify.c (dump_stack_value): dump null literal flag to.
12484
12485         * verify.c (verify_type_compatibility_full): fix comparison
12486         for types that have a generic super type.
12487
12488         * verify.c (verify_stack_type_compatibility): fix compatibility
12489         between null literals and reference types. fix compatibility between
12490         boxed valuetypes and object. fix corner case test for enums.
12491
12492         * verify.c (do_cmp_op): proper verification of cgt.un in case
12493         of reference types.
12494
12495         * verify.c (do_invoke_method): fix error message.
12496
12497         * verify.c (do_store_indirect
12498
12499         * verify.c (check_is_valid_type_for_field_ops): proper verification
12500         of managed pointers to valuetypes and boxed valuetypes. proper verification
12501         of null literals.
12502
12503         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
12504         allow token to be a reference type.
12505
12506         * verify.c (do_cast): proper handling of boxes valuetypes.
12507
12508         * verify.c (do_stelem): proper handling of storing a boxed valuetype
12509         in object[].
12510
12511         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
12512         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
12513         fixed the decoding of unbox_any
12514
12515 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
12516
12517         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
12518
12519 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
12520
12521         * verify.c (do_newobj): do delegate verification.
12522
12523         * verify.c (verify_delegate_compatibility): perform delegate
12524         verification.
12525
12526         * verify.c (verify_ldftn_delegate): perform tests related to
12527         ldftn delegates.
12528
12529         * verify.c (mono_delegate_signature_equal): perform the
12530         slightly diferent signature comparison required by delegates.
12531
12532         * metadata.c (mono_metadata_type_equal_full): added and exported
12533         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
12534         allows signature only comparison.
12535
12536         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
12537         as MONO_INTERNAL.
12538
12539 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
12540
12541         * verify.c: added a bunch of stack_slot_* functions to
12542         make access to stack slot type easier. This is required to
12543         allow optional flags, like null literal, boxed value and
12544         this pointer.
12545         All access paths to IlStackDesc::stype have been changed 
12546         to use these new funcions.
12547         Removed a bunch of unused functions and cleared all warnings.
12548         This patch introduces the usage of the this pointer and 
12549         boxed value flags.
12550
12551 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
12552
12553         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
12554
12555 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
12556
12557         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
12558         match managed version.
12559
12560         * appdomain.c: Bump corlib version.
12561         
12562         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
12563         argument.
12564
12565 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
12566
12567         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
12568         Set public key token to zero-length byte array if assembly is not
12569         strongnamed.
12570
12571 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12572
12573         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
12574         writing a vtype array elem.
12575
12576 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
12577
12578         * assembly.c (build_assembly_name): return FALSE if length of token is
12579         not 16 (if not "null").
12580         (mono_assembly_name_parse_full): return FALSE if value of version,
12581         culture, token or key is 0.
12582         * icall.c (fill_reflection_assembly_name): add boolean arguments to
12583         specify whether public key and public key token must be set to default
12584         value (zero-length byte array) if not available. Set versioncompat to
12585         SameMachine. If public key is available or the default is set, then
12586         set PublicKey flag.
12587         (ves_icall_System_Reflection_Assembly_FillName): if no public key
12588         is available, use empty byte array as default value. On the 2.0
12589         profile, use default value for public key token if not set.
12590         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
12591         profile, use default value for public key if not set. On the 2.0
12592         profile, use default value for public key token if not set.
12593         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
12594         default values for public key and public key token.
12595
12596 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12597
12598         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
12599         field to keep it in synch with the managed object.
12600
12601         * marshal.c (emit_marshal_object): Add support for byref marshalling of
12602         delegates. Fixes #351520.
12603
12604         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
12605         contains defined memory.
12606         
12607         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
12608
12609         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
12610         
12611         * sgen-gc.c (check_consistency): New helper function to do a consistency check
12612         of the GC data structures.
12613
12614         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
12615
12616         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
12617         
12618         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
12619         barrier.
12620         (mono_array_clone_in_domain): Ditto.
12621         (mono_array_clone_in_domain): Ditto.
12622
12623         * threads.c (start_wrapper): Register the thread start argument as a GC root.
12624         (cache_culture): Use a write barrier.
12625
12626         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
12627         (ves_icall_get_property_info): Ditto.
12628
12629         * object.h (MONO_STRUCT_SETREF): New macro.
12630
12631         * class-internals.h (MonoStats): Add some GC statistics.
12632
12633         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
12634
12635 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
12636
12637         * exception.c (mono_exception_from_name_two_strings):
12638         Break from loop after method is found.
12639
12640 2008-01-04  Dick Porter  <dick@ximian.com>
12641
12642         * process.c (process_module_string_read): Rename variable to
12643         reflect correct usage, after fixing bug 345972.
12644
12645 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
12646
12647         * verify.c (mono_type_create_fnptr_from_mono_method): 
12648         created a MonoType function pointer instance to be used during
12649         verification. The verifier releases this memory at end.
12650
12651         * verify.c (mono_method_is_constructor): extracted repeated
12652         checks for constructor into a single class.
12653
12654         * verify.c (do_push_field): use new extracted method
12655         for constructor check.
12656
12657         * verify.c (do_newobj): same.
12658
12659         * verify.c (do_ldftn): renamed to do_load_function_ptr
12660         and make it verify ldvirtftn too.
12661
12662         * verify.c (mono_method_verify: proper verification
12663         of ldvirtftn. release created MonoMethod instances.
12664
12665 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12666
12667         * verify.c (token_bounds_check): added.
12668
12669         * verify.c (do_ldftn): added.
12670
12671         * verify.c (mono_method_verify): proper verificartion of ldftn.
12672
12673 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12674
12675         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
12676         than the table row count. It's the resposibility of the caller to
12677         make the bounds check and raise the correct error.
12678
12679         * metadata.c (mono_metadata_decode_row_col): Same.
12680
12681         * loader.c (mono_get_method_from_token): perform bounds check
12682         on token for methoddef table.
12683
12684 2007-12-29  Miguel de Icaza  <miguel@novell.com>
12685
12686         * icall.c
12687         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
12688         assert into a negative result, the managed code already coped with
12689         that.
12690
12691         Some folks on Windows reported this error. 
12692
12693 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
12694
12695         * appdomain.c: Bump corlib version.
12696         * icall.c:
12697         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
12698         CultureInfo.CreateCulture to create CultureInfo for name.
12699         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
12700         create CultureInfo for name. Fixes bug #347174.
12701
12702 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12703
12704         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
12705         flags.
12706
12707         * verify.c (is_valid_branch_instruction): allow branching to the
12708         first instruction of the protected block.
12709
12710         * verify.c (is_valid_cmp_branch_instruction): same.
12711
12712         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
12713         avoid double initialization.
12714
12715         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
12716         detect which cases the eval stack should just be copied.
12717
12718         * verify.c (mono_method_verify): check if the eval stack
12719         is empty when entering a protected block.
12720
12721 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12722
12723         * verify.c: added is_clause_in_range, is_clause_inside_range,
12724         is_clause_nested and verify_clause_relationship. They perform
12725         the verifications stated in P1 12.4.2.7.
12726
12727         * verify.c (mono_method_verify): remove some unused variables,
12728         add the new exception clause checks, add instruction border
12729         checks for protected block start/end, improved some error 
12730         messages and fixed a bug in the way invalid instruction access
12731         is detected.
12732
12733 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
12734
12735         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
12736         from GC 7.0 if available.
12737
12738         * object.c: Remove an unused define.
12739         
12740         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
12741
12742         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
12743
12744         * null-gc.c (mono_gc_make_descr_for_array): Implement.
12745
12746         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
12747
12748         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
12749         to take the same arguments as the other make_descr functions.
12750
12751         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
12752
12753         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
12754         directly.
12755
12756         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
12757         mini.c.
12758
12759         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
12760         call to boehm-gc.c.
12761
12762         * boehm-gc.c (mono_gc_register_root): Fix a warning.
12763
12764         * null-gc.c (mono_gc_register_root): Fix a warning.
12765
12766         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
12767
12768         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
12769         (mono_gc_base_init): Call GC_init ().
12770
12771         * null-gc.c: Define mono_gc_register_root () as a no-op.
12772
12773         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
12774
12775 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
12776
12777         * verify.c: add prototype for merge_stacks at top
12778
12779         * verify.c (do_switch): added.
12780
12781         * verify.c (merge_stacks): on some cases the stack merging
12782         was not happening properly. Unequal stack sizes at merge
12783         points should be invalid.
12784
12785         * verify.c (mono_method_verify): added more debug info on stack state.
12786         verify switch properly.
12787
12788 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
12789
12790         * method-builder.h: New file, moved the mono_mb_ declarations here from 
12791         marshal.h.
12792
12793         * boehm-gc.c marshal.c: Include method-builder.h.
12794
12795         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
12796
12797         * marshal.c: Remove some code which is now in method-builder.c.
12798
12799 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
12800
12801         * method-builder.c: New file, extraction of the method builder functionality 
12802         from marshal.c.
12803
12804         * marshal.c: Move the mb functions into method-builder.c.
12805
12806         * marshal.h marshal.c: Export some mono_mb_... functions.
12807
12808         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
12809
12810         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
12811         the caller.
12812
12813         * class.c (mono_class_get_full): Check the token type in the dynamic case.
12814
12815         * loader.c (mono_field_from_token): Ditto.      
12816
12817         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
12818         type as well.
12819         
12820         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
12821         Fixes #342565.
12822
12823         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
12824         a helper function for setting it.
12825
12826         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
12827
12828         
12829         * assembly.c: Significally simplify code now that referenced assemblies are 
12830         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
12831
12832         * threads.h: Don't include  the internal threads-types.h header file. Fixes
12833         #349952.
12834
12835 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
12836
12837         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
12838         instructions that were target of branches or are at protected block boundaries.
12839
12840         * verify.c (in_same_block): handle filter clauses.
12841
12842         * verify.c (is_valid_branch_instruction): added. checks the target of
12843         instructions br or brtrue/false.
12844
12845         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
12846         binary branch instructions such as beq and bge.
12847
12848         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
12849         and made it pin the instruction as been part of the exception block.
12850
12851         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
12852         of in_same_block.
12853
12854         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
12855         of in_same_block.
12856
12857         * verify.c (do_ret): ret from a protected block is unverifiable and
12858         not invalid.
12859
12860         * verify.c (do_static_branch): verify br and br.s instructions.
12861
12862         * verify.c (merge_stacks): add extra param to support detection
12863         of branches in the middle of instructions.
12864         
12865         * verify.c (mono_method_verify): verify branches and exception blocks
12866         that target the middle of instructions. Proper verification of br and br.s.
12867
12868 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
12869
12870         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
12871         skip_visibility field.
12872         (reflection_methodbuilder_from_dynamic_method): Ditto.
12873
12874         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
12875         registrations. Fixes #348193.
12876
12877         * threads.h: Move the internal mono_thread_get_pending_exception () to
12878         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
12879
12880 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
12881
12882         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
12883         icall registration. Fixes #348193.
12884
12885         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
12886         for corlib classes into object. Fixes #349621.
12887
12888 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
12889
12890         * icall.c (property_accessor_nonpublic): new function to determine
12891         whether an accessor allows a property to be considered non-public.
12892         Returns false for private accessor(s) from parent class, and internal
12893         accessor(s) from parent on 2.0 profile (and higher).
12894         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
12895         to determine whether property should be included if NonPublic flag
12896         is set. Fixes bug #349078.
12897
12898 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
12899
12900         * verify.c (init_stack_with_value): added.
12901
12902         * verify.c (mono_method_verify): extracted common
12903         code for exception initialization into init_stack_with_value.
12904
12905         * verify.c (mono_method_verify): initialize the exception
12906         for handler clauses as well.
12907
12908         * verify.c (mono_method_verify): fix the exception clause
12909         ordering rules, it should use handler end offset and not
12910         start offset.
12911
12912 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
12913
12914         * rawbuffer.c: remove useless warning.
12915
12916 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
12917
12918         * threads.h, threads-types.h: move functions to the correct header
12919         (fixes bug#349952).
12920
12921 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12922
12923         * verify.c (mono_method_verify): proper verification
12924         of exception handling clauses ranges and fallthru in
12925         and out of protected blocks.
12926
12927 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12928
12929         * verify.c (mono_method_verify): fixed compilation issue.
12930
12931 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12932
12933         * verify.c (mono_method_verify): a printf slipped in, changed
12934         to use verifier debug macro.
12935
12936 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
12937
12938         * verify.c (is_correct_leave): check for filter clauses.
12939
12940         * verify.c (do_filter): added.
12941
12942         * verify.c (mono_method_verify): property verification of leave.
12943
12944
12945 2007-12-18  Mark Probst  <mark.probst@gmail.com>
12946
12947         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
12948         Win32 build, until we figure out how to do the proper thing on
12949         Win32.
12950
12951 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
12952
12953         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
12954         by the previous patch.
12955         
12956         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
12957         the assembly resolve handler for refonly assemblies.
12958
12959 2007-12-17  Mark Probst  <mark.probst@gmail.com>
12960
12961         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
12962         Make sure only one thread is allowed to commence shutdown, and
12963         don't allow new threads to be started once shutdown is in
12964         progress.
12965
12966 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
12967
12968         * verify.c (is_correct_endfilter): added.
12969
12970         * verify.c (is_unverifiable_endfilter): added.
12971
12972         * verify.c (do_endfilter): added.
12973
12974         * verify.c (mono_method_verify): property verification of endfilter
12975         and fixed a corner case or endfinally.
12976
12977 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
12978
12979         * verify.h: new flags to support fail fast of unverifiable code and
12980         do non-strict verification. Non-strict verification is required to
12981         have MS runtime compatibility. There are a huge amount of unverifiable
12982         code that it accepts as verifiable. The strict mode verifies the code
12983         as the specs says.
12984         Non-strict mode will be required in cases where code needs to be
12985         accepted as verifiable but fails under strict mode.
12986
12987         * pedump.c: added support to fail fast and non-strict verification.
12988
12989         * verify.c: added support for both fail fast and non-strict verification.
12990
12991 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
12992
12993         * verify.c (is_correct_endfinally): added.
12994
12995         * verify.c (mono_method_verify): property verification of endfinally.
12996
12997 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
12998
12999         * verify.c (in_any_block): check for filter clauses.
13000
13001         * verify.c (is_correct_rethrow): added.
13002
13003         * verify.c (mono_method_verify): property verification of rethrow.
13004
13005         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
13006
13007 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
13008
13009         * verify.c (do_throw): added.
13010
13011         * verify.c (mono_method_verify): property verification of throw
13012
13013 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
13014
13015         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
13016         assemblies. Fixes #346425.
13017
13018 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
13019
13020         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
13021         FieldBuilders.
13022
13023         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
13024
13025         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
13026         prevent asserts when this is called with a token which might not be valid.
13027
13028         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
13029         lookup_dynamic_token_class with valid_token == FALSE.
13030
13031         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
13032
13033         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
13034
13035         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13036         
13037 2007-12-10  Mark Probst  <mark.probst@gmail.com>
13038
13039         * gc.c: Don't delay threadpool thread finalization unless Mono is
13040         shutting down.
13041
13042 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13043
13044         * threads.c: turn an assert into a non-fatal warning.
13045
13046 2007-12-09  Robert Jordan  <robertj@gmx.net>
13047
13048         * icall.c (GetVirtualMethod): Add missing argument validation.
13049
13050 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13051
13052         * verify.c (do_cast): added.
13053
13054         * verify.c (mono_method_verify): property verification of castclass and isinst.
13055
13056
13057 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13058
13059         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
13060
13061         * verify.c (do_stelem): added.
13062
13063         * verify.c (mono_method_verify): property verification of stelem.X.
13064
13065 2007-12-07  Mark Probst  <mark.probst@gmail.com>
13066
13067         * class.c, class-internals.h: Introduce an environment variable
13068         (MONO_GENERIC_SHARING) through which the extent of generic code
13069         sharing can be controlled (share all classes, share only corlib
13070         classes, or share nothing).
13071
13072         * object.c: Only create runtime generic context for classes for
13073         which sharing is enabled.
13074
13075 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13076
13077         * verify.c (do_ldelem): refactor it to work with ldelem.any.
13078
13079         * verify.c (mono_method_verify): property verification of ldelem.any.
13080
13081 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13082
13083         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
13084         added ldelem.X opcodes.
13085
13086         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
13087
13088         * verify.c: proper verification of ldelem.X 
13089
13090 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
13091
13092         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
13093
13094 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
13095
13096         * verify.c (mono_method_verify): null literal requires special handling,
13097         the value pushed on stack need to be flagged as so.
13098
13099         * verify.c (do_ldelema): Verify ldelema properly.
13100
13101 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
13102
13103         * verify.c: Verify ldlen properly.
13104
13105 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
13106
13107         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
13108         to the target object's type. Fixes #346160.
13109
13110 2007-12-05  Dick Porter  <dick@ximian.com>
13111
13112         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
13113         Solaris needs the same workaround as BSD-derived systems.  Fixes
13114         bug 323524, patch by Burkhard Linke
13115         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
13116
13117 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
13118
13119         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
13120         handle to use when error dialog is shown; otherwise, update mask
13121         to show no error dialog when an error occurs.
13122
13123 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
13124
13125         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
13126
13127         * class.c (mono_class_get_field_default_value): New helper function to initialize
13128         field->def_type and field->data.
13129
13130 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
13131
13132         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
13133         the general one.
13134
13135         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
13136
13137         * marshal.c: Avoid depending on delegate->method_info being set.
13138
13139         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
13140         
13141         * object.c (mono_delegate_ctor): Set delegate->method.
13142
13143         * object-internals.h (struct _MonoDelegate): Add 'method' field.
13144
13145         * appdomain.c: Bump corlib version.
13146
13147 2007-11-27  Raja R Harinath  <harinath@gmail.com>
13148
13149         * metadata.c (mono_generic_inst_equal_full): Short-circuit
13150         equality check if we're comparing canonicalized MonoGenericInsts.
13151
13152 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
13153
13154         * class.c (generic_array_methods): Call mono_class_setup_methods () before
13155         accessing class->methods.
13156
13157 2007-11-22  Dick Porter  <dick@ximian.com>
13158
13159         * threads.c: Ensure that the synch_cs is set before trying to use
13160         it.
13161
13162 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
13163
13164         * profiler.c: r89126 broke the statistial profiler, unbreak.
13165
13166 2007-11-22  Martin Baulig  <martin@ximian.com>
13167
13168         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
13169
13170         * mono-debug.c
13171         (mono_debug_debugger_version): Bump to 3.
13172         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
13173         -> mono_debugger_class_initialized().
13174
13175         * mono-debug-debugger.c
13176         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
13177
13178         * class.c
13179         (mono_debugger_start_class_init_func): Removed.
13180         (mono_debugger_class_loaded_methods_func): Added.
13181         (mono_class_setup_methods): Call it here.
13182
13183 2007-11-22  Martin Baulig  <martin@ximian.com>
13184
13185         * mono-debug.c
13186         (mono_debug_add_delegate_trampoline): New public method.
13187         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
13188
13189         * mono-debug.h
13190         (MonoSymbolTable): Added `global_data_table'.
13191         (MonoDebuggerTypeKind): Removed.
13192
13193 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
13194
13195         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
13196         these methods.
13197
13198         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13199         
13200 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
13201
13202         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
13203
13204 2007-11-20  Martin Baulig  <martin@ximian.com>
13205
13206         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
13207
13208         * mono-debug-debugger.c
13209         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
13210         (mono_debugger_remove_breakpoint): Likewise.
13211         (mono_debugger_check_breakpoints): Likewise.
13212         (mono_debugger_register_class_init_callback): New public method.
13213         (mono_debugger_remove_class_init_callback): Likewise.
13214         (mono_debugger_add_type): Likewise.
13215
13216         * mono-debug-debugger.h
13217         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
13218
13219 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
13220
13221         * class.c: more interface implementations needed for the
13222         array enumerator (fixes bug #341112).
13223
13224 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
13225
13226         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
13227         fix ParamName of ArgumentNullExceptions.
13228
13229 2007-11-17  Miguel de Icaza  <miguel@novell.com>
13230
13231         * reflection.c (mono_reflection_encode_sighelper): Generate the
13232         modopts and modreqs.   I have a useless test that crashes monodis,
13233         but that shows the code working.
13234
13235 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
13236
13237         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
13238         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
13239
13240 2007-11-15  Dick Porter  <dick@ximian.com>
13241
13242         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
13243         When joining a thread, it's the thread that's calling Join that
13244         gets WaitSleepJoin state not the target.  Fixes the standalone
13245         test case in bug 334740, and hopefully the whole bug too.
13246
13247 2007-11-15  Dick Porter  <dick@ximian.com>
13248
13249         * process.c: Read file version info from the files pointed at by
13250         process modules, not the current process.  Fixes bug 315969.
13251
13252         Use windows typedef names in some places to fix warnings on the
13253         windows build.
13254
13255 2007-11-15  Mark Probst  <mark.probst@gmail.com>
13256
13257         * image.c, metadata-internals.h: Added a generic_class_cache hash
13258         to MonoImage for looking up generic classes when sharing generics.
13259
13260 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13261
13262         * sgen-gc.c: warning cleanups.
13263
13264 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
13265
13266         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
13267         inherited properties.
13268
13269 2007-11-14  Mark Probst  <mark.probst@gmail.com>
13270
13271         * object.c, class-internals.h: Added more information to the
13272         runtime generic context.
13273
13274 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
13275
13276         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
13277         instead of just the target method. Generalize the abstract method handling to
13278         handle any non-static method.
13279
13280         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13281         mono_marshal_get_delegate_invoke () signature change.
13282
13283 2007-11-13  Mark Probst  <mark.probst@gmail.com>
13284
13285         * class.c, class-internals.h: Made
13286         mono_type_get_basic_type_from_generic () public.  Fixed member
13287         access check for shared generics.
13288
13289         * loader.c: Don't insert field into field cache if it's part of a
13290         non-inflated generic class.
13291
13292         * domain.c, domain-internals.h: The generic sharing context is now
13293         part of the jit info data structure.  Added two accessor
13294         functions.
13295
13296 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
13297
13298         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
13299         the array Get/Set/Address methods, since the JIT inlines them.
13300
13301         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
13302
13303         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
13304         (mono_image_init): Initialize runtime_invoke_direct_cache.      
13305
13306         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13307         mono_marshal_get_delegate_invoke signature change.
13308
13309         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
13310         an additional argument. Add support for invoking abstract methods.
13311
13312         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
13313
13314         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
13315
13316 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13317
13318         * class.c: Do field layout for open generic classes as well.
13319
13320 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13321
13322         * gc.c, gc-internal.h: Don't finalize threadpool threads with
13323         other objects, because the threadpool is still around.  Put them
13324         in a list instead and after finalizing all other objects in the
13325         root domain shut down the thread pool and then finalize the
13326         threads.  Fixes bug #337383.
13327
13328         * threads.c, thread-types.h: New mono_thread_create_internal()
13329         function for marking a thread with the threadpool flag before it
13330         started.  Set synch_cs to NULL after freeing it.
13331
13332         * threadpool.c: Mark threadpool threads before they start.
13333
13334 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
13335
13336         * reflection.h, reflection.c: don't export random functions
13337         and lazy load dbnull and missing objects.
13338
13339 2007-11-07  Jonathan Chambers <joncham@gmail.com>
13340
13341         * class.c: Initialize COM types if COM interfaces
13342         are present (not just COM classes).
13343         
13344         Code is contributed under MIT/X11 license.
13345
13346 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13347         * reflection.c:
13348         create_dynamic_mono_image: hook module profiler events (dynamic case).
13349         mono_image_basic_init: hook assembly profiler events (dynamic case).
13350
13351 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13352         * profiler.c:
13353         simple_appdomain_unload: completely terminate the profiler
13354         instead of only processing the statistical samples.
13355         simple_shutdown: make sure this is really called exactly once,
13356         even in multithreaded applications, and always listen to
13357         appdomain events.
13358         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
13359         here, the "[un]load" functions will do it.
13360         Fixes bugs #333791 and #325261.
13361
13362 2007-11-07  Geoff Norton  <gnorton@novell.com>
13363
13364         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
13365         rather than depend on __APPLE__.
13366
13367 2007-11-07  Mark Probst  <mark.probst@gmail.com>
13368
13369         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
13370
13371 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
13372
13373         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
13374         UTF16 MonoString. Fix the crash from bug #335488
13375
13376 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
13377
13378         * marshal.c: Correct (for non-Win32 OS) length != size in 
13379         mono_string_from_bstr. Fix #339530.
13380
13381 2007-11-06  Geoff Norton  <gnorton@novell.com>
13382
13383         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
13384         to succeed
13385
13386 2007-11-05  KornĂ©l Pál  <kornelpal@gmail.com>
13387
13388         * process.c: Added run-time GetProcessId API detection for Windows.
13389
13390 2007-11-04  Miguel de Icaza  <miguel@novell.com>
13391
13392         * reflection.c  (mono_param_get_objects): If a parameter has the
13393         attribute [System.Runtime.InteropServices.Optional] we should
13394         set the DefaultValue of the ParameterInfo to be
13395         System.Reflection.Missing instead of DBNull.
13396
13397         See bug #339013.
13398
13399         (mono_get_reflection_missing_object): New method,
13400         returns the System.Reflection.Missing.Value singleton instance.
13401
13402 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
13403
13404         * culture-info-table.h : regenerated.
13405
13406 2007-11-02  Jonathan Chambers <joncham@gmail.com>
13407
13408         * icall.c: Use GetEnvironmentStrings on windows
13409         so we are using the same environment block as 
13410         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
13411         #333740.
13412         
13413         Code is contributed under MIT/X11 license.
13414
13415 2007-10-31  Martin Baulig  <martin@ximian.com>
13416
13417         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
13418
13419         * mono-debug-debugger.h
13420         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
13421
13422 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
13423
13424         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
13425         classes.
13426
13427 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
13428
13429         * culture-info-table.h : regenerated.
13430
13431 2007-10-30  Robert Jordan  <robertj@gmx.net>
13432
13433         * icall-def.h, icall.c:
13434         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
13435
13436         Code is contributed under MIT/X11 license.
13437
13438 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13439
13440         * class.c (mono_class_setup_vtable): Find the inflated methods in the
13441         inflated class instead of inflating them again.
13442         
13443         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
13444         dynamic case.
13445
13446         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
13447         Call setup_supertypes () after klass->parent is set.
13448         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
13449
13450         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
13451         for inflated instances of not yet created dynamic generic classes.
13452         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
13453         times from inflated_method.
13454         (methodbuilder_to_mono_method): Ditto.
13455
13456 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
13457
13458         * gc.c: code cleanup and removed old untested option of not creating the
13459         finalizer thread.
13460
13461 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13462
13463         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
13464         creating a jump trampoline for dynamic methods.
13465
13466 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
13467
13468         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
13469         generic TypeBuilders when called from another method of the same type (bug #335131).
13470
13471
13472 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
13473
13474         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
13475         doesn't seem to work perfectly.
13476         
13477         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
13478         called multiple times.
13479         (methodbuilder_to_mono_method): Ditto.
13480         (resolve_object): Inflate FieldBuilder's.
13481
13482 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13483
13484         * string-icalls.c, string-icalls.h, appdomain.c: patch from
13485         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
13486         RemoveEmptyEntries in the string.Split implementation (bug #322375).
13487
13488 2007-10-26  Dick Porter  <dick@ximian.com>
13489
13490         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
13491         Thread initialisation changes
13492
13493 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
13494
13495         * verify.c: fix compatibility check between arrays and System.Array
13496
13497 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
13498
13499         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
13500         too. Fixes #336999.
13501
13502 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
13503
13504         * object.c (mono_value_box): Use typed allocation here.
13505
13506 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
13507
13508         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
13509         trampoline instead of compiling the method right away.
13510
13511         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
13512
13513 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
13514
13515         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
13516         related fields for dynamic classes. Fixes #334493.
13517
13518 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
13519
13520         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
13521         
13522         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
13523
13524         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
13525         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
13526
13527         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
13528
13529         * reflection.c (create_generic_typespec): Initialize klass->generic_container
13530         if needed.
13531         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
13532
13533 2007-10-18  Jonathan Chambers <joncham@gmail.com>
13534
13535         * marshal.c: Use correct key when removing item
13536         from ccw_hash.
13537         
13538         Code is contributed under MIT/X11 license.
13539
13540 2007-10-17  William Holmes  <billholmes54@gmail.com>
13541
13542         *marshal.c: Adding a case to marshal booleans to U1
13543
13544         Code is contributed under MIT/X11 license.
13545
13546 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
13547
13548         * class.c (mono_class_from_name): Search the modules compromising dynamic
13549         assemblies. Fixes #331601.
13550
13551 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
13552
13553         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
13554         exception if the type name contains an assembly component. Fixes #334203.
13555
13556         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
13557         modules inside dynamic assemblies. Fixes #334200.
13558         
13559         * reflection.c: Set image->public_key and image->public_key_length;
13560
13561         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
13562         fields.
13563
13564         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
13565         
13566 2007-10-16  Mark Probst  <mark.probst@gmail.com>
13567
13568         * metadata.c: Implemented correct comparing of generic classes.
13569         An inflated generic class can be equal to a non-inflated one if it
13570         is inflated with generic type variables as type arguments.  Fixes
13571         bug #333798.
13572
13573 2007-10-15  Dick Porter  <dick@ximian.com>
13574
13575         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
13576         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
13577         81646.
13578
13579         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
13580         instead of a monitor lock.  This means that monitor_try_enter and
13581         co can set the thread state safely.
13582         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
13583         thread_interrupt_requested, so interrupt actually works.
13584
13585         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
13586         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
13587         state accessor function
13588
13589 2007-10-15  Martin Baulig  <martin@ximian.com>
13590
13591         * mono-debug.h
13592         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
13593         the debugger with the current runtime.
13594
13595 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
13596
13597         * object.c, object-internals.h: added the ability to set a single
13598         trampoline for all the slots in a vtable.
13599
13600 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13601
13602         * marshal.c: deal with a possible race condition during multicast
13603         delegate invocation.
13604
13605 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13606
13607         * class.c: ensure value type methods don't have the synchronized
13608         flag set.
13609
13610 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
13611
13612         * string-icalls.c, string-icalls.h: reverted unapproved patch that
13613         breaks the build.
13614
13615 2007-10-11  Joel Reed  <joelwreed@comcast.com>
13616
13617         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
13618         to take an options parameter so that empty entries can be removed during
13619         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
13620
13621 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13622
13623         * marshal.c: make sure we don't store the signature from a dynamic
13624         method into the runtime invoke cache (bug #327189).
13625
13626 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13627
13628         * marshal.c: make sure the wrapper methods are properly initialized.
13629
13630 2007-10-11  Mark Probst  <mark.probst@gmail.com>
13631
13632         * metadata.c, metadata-internals.h: Generalized
13633         mono_type_stack_size() to mono_type_stack_size_internal() which
13634         takes an additional argument specifying whether it allows open
13635         types.
13636
13637 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
13638
13639         * verify.c (do_invoke_method): handle typedbyref params
13640         correctly and check for unverifiable return values.
13641
13642         * verify.c (do_newobj): fix a warning.
13643
13644 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13645
13646         * verify.c: don't tread typedbyref as allways unverifable,
13647         so uses, like (ld/st)loc.0 are valid. verify for the cases
13648         that it matters, like boxing related operations.
13649
13650 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13651
13652         * verify.c: add verification of the newobj opcode. verification
13653         of delegate instantation still missing due ldftn and virldftn not
13654         pushing the function type on stack
13655
13656 2007-10-08  Mark Probst  <mark.probst@gmail.com>
13657
13658         * class-internals.h: Runtime generic context data structure
13659         definition.
13660
13661         * object.c: Initialization of runtime generic context at runtime
13662         vtable creation time.
13663
13664 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
13665         * class.c (mono_class_create_from_typedef,
13666         mono_class_from_generic_parameter, mono_ptr_class_get,
13667         mono_fnptr_class_get, mono_bounded_array_class_get)
13668         * domain.c (mono_domain_create, mono_domain_free)
13669         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
13670         * image.c (do_mono_image_load, mono_image_close):
13671         Hooked up load-unload profiler events.
13672
13673 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
13674
13675         * domain.c: track statistics about the actual amount of native code
13676         allocated.
13677
13678 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13679
13680         * class.c: the valuetype enumerators don't have the additional
13681         supertypes interfaces.
13682
13683 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13684
13685         * class.c: need more interfaces setup for the IEnumerator<T>
13686         object created for arrays (tests/ienumerator-interfaces.2.cs).
13687
13688 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
13689
13690         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
13691
13692 2007-10-05  Alp Toker  <alp@atoker.com>
13693
13694         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
13695         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
13696         #315863.
13697
13698 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13699
13700         * verify.c (verify_type_compatibility_full): verification of
13701         compatibility improved, validates correctly non-strict checks between
13702         native int and I4 types different than (unsigned)int32.
13703
13704         * verify.c (do_store_indirect): added, do all verification of
13705         ldind.X opcodes. 
13706
13707         * verify.c (get_load_indirect_mono_type): renamed to
13708         get_indirect_op_mono_type, as it now returns the MonoType for 
13709         ldind.X and stind.X opcodes.
13710
13711 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13712
13713         * reflection.c: Fix the encoding of generic type definition for
13714         TypeBuilders.
13715
13716         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
13717         mono_image_typedef_or_ref but allows to specify if typespec lookups should
13718         be made. Typespec check is done prior to typeref cache lookup.
13719
13720         * reflection.c (mono_image_typedef_or_ref): now just delegate to
13721         mono_image_typedef_or_ref_full.
13722
13723         * reflection.c (encode_generic_class): encode the generic class
13724         directly instead of calling encode_type.
13725
13726         * reflection.c (encode_type): encode the generic type definition
13727         MonoClass as a generic instantiation.
13728
13729         * reflection.c (create_typespec): cache typespec tokens in
13730         the assembly->typespec cache. Don't create typespec for a generic
13731         instance MonoClass. Create typespec for the generic type defintion.
13732
13733         * reflection.c (create_generic_typespec): encode the generic
13734         class directly instead of calling encode_type.
13735
13736         * reflection.c (mono_image_create_token): encode the generic
13737         type definition not using a typespec for MonoType instances.
13738
13739
13740 2007-10-04  Raja R Harinath  <rharinath@novell.com>
13741
13742         Fix #328812
13743         * class.c (mono_image_init_name_cache): Don't return nested
13744         'protected internal' classes.
13745         (mono_class_from_name_case): Likewise.
13746
13747 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
13748
13749         * icall-def.h, icall.c : get_bundled_machine_config() is now the
13750           common function used by both DefaultConfig in System.dll and
13751           InternalConfigurationHost in System.Configuration.dll.
13752
13753 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13754
13755         * class.c: automatically add to vectors only a few essential explicit
13756         generic interfaces. The rest of the interfaces that arrays should
13757         provide are currently implicitly added (but still not lazily, see the
13758         design in the discussion of bug#325495 for the details of what is
13759         needed for that). Additionally, implicit interfaces are assigned the
13760         same vtable slot as the explicit interfaces (as they are compatible):
13761         this enables huge memory savings since we don't need to instantiate
13762         as many memthods and as large vtables anymore. Also, Since
13763         GetEnumerator<T> returns an instance of a type that is required to
13764         support a similarly large set of interfaces as arrays, we add
13765         implicit interfaces and interface offset sharing support to those
13766         types, too. This change adds all the required interfaces so that
13767         the anonarray.cs test case in the bug report works (we don't add
13768         all the interfaces to arrays of arrays 3-level deep and more because
13769         of the memory requirements explained in the bug and since they are much
13770         less common: the lazy-loading support will enabled them to work, too).
13771
13772 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13773
13774         * verify.c (merge_stacks): major clean up, all type compatibility
13775         checks are done by verify_type_compatibility. This fix my earlier lack
13776         of understanding of the CLR type system and merge_stacks no longer looks
13777         scary.
13778
13779         * verify.c: fixed some bad spelling.
13780
13781 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13782
13783         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
13784         a given stack slock.
13785         
13786         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
13787         verify_type_compatibility_full. This removed a near indentical function and fixed
13788         handling of Int32 and IntPtr across all opcodes.
13789
13790 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
13791
13792         * class.c: only vectors have the additional generic interfaces.
13793
13794 2007-10-01  Jonathan Chambers <joncham@gmail.com>
13795
13796         * mono-config.c: Use g_strcasecmp instead of
13797         strcasecmp like everywhere else to fix
13798         compilation with MSVC.
13799         
13800         Code is contributed under MIT/X11 license.
13801
13802 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13803
13804         * object.c, object-internals.h: refactored the IMT code to enable
13805         building a single slot at a time and lazily creating the IMT trampolines
13806         and thunks.
13807
13808 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
13809
13810         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
13811
13812         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
13813         Fixes #328501.
13814         
13815 2007-09-29  Raja R Harinath  <harinath@gmail.com>
13816
13817         * loader.c (method_from_methodspec): Rearrange to avoid
13818         un-necessary exposition.  Don't assert out if the method's
13819         declaring type is a generic type definition.
13820
13821 2007-09-28  Martin Baulig  <martin@ximian.com>
13822
13823         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
13824
13825 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
13826
13827         * class-internals.h: optimize field layout of MonoClass to
13828         requires less cachelines at runtime and save a few bytes on 64 bit
13829         systems.
13830
13831 2007-09-28  Jb Evain  <jbevain@novell.com>
13832
13833         * reflection.c: when encoding type names in custom attributes,
13834         if the type is a closed generic type, its generic arguments
13835         have to be serialized as AssemblyQualifiedName, so that when
13836         they are deserialized, it's possible to re-create them properly.
13837         Fixes #329450.
13838
13839
13840 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
13841
13842         * object.c, class-internals.h: added delegate-creation counter.
13843
13844 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
13845
13846         * class.c: cleanup of the code that synthetizes interfaces for
13847         arrays in 2.0: saves quit a bit of corlib mempool memory.
13848         Code to fix bug #325495 ifdeffed out for now until the issues
13849         with memory usage and O(n^2) behaviour are fixed.
13850
13851 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13852
13853         * marshal.c: when possible, do not duplicate the name of the methods
13854         in the method builder and in the generated MonoMethod.
13855
13856 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13857         * verify.c: added support for type checking ldind_* opcodes.
13858
13859 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13860
13861         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
13862         which is used to distinguish the fully open instantiation of a TypeBuilder
13863         with the rest. This temporary hack is required to restore the property that
13864         the fully open instantiation is the same type of the generic type definition.
13865
13866         * class-internals.h (mono_generic_class_is_generic_type_definition):
13867         new function as part of the internal API.
13868
13869         * class.c (inflate_generic_type): return NULL when the generic inst is
13870         fully open. The fully open generic type is now the same as the generic type
13871         definition for non TypeBuilder types.
13872
13873         * class.c (mono_generic_class_get_class): removed assert since it is
13874         no longer valid, gklass->cached_class can point to the generic type definition.
13875
13876         * class.c (mono_generic_class_is_generic_type_definition): new.
13877
13878         * metadata.c (mono_generic_class_hash): added is_tb_open field
13879         to the hash calculation.
13880
13881         * metadata.c (free_generic_class): if the generic class is associated
13882         with the generic type definition, its field will come from the mempool and
13883         must not be freed.
13884
13885         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
13886         new, this function identifies the corner case of a TypeBuilder fully open
13887         instantiation.
13888
13889         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
13890         for lookup. Set gclass->cached_class to be the container class in case of
13891         the fully open instantiation of non TypeBuilder types.
13892
13893         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
13894         to compare generic classes.
13895
13896         * reflection.c (method_encode_methodspec): remove assert that
13897         no longer is valid.
13898
13899         * reflection.c (mono_reflection_generic_class_initialize): add
13900         an aditional assert to ensure the proper type is used.
13901
13902 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
13903
13904         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
13905         to enjoy it.
13906
13907 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13908
13909         * verify.c (push_arg): Fixed support for ldarga
13910         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
13911         MonoType used as first arg in case of instance calls.
13912
13913 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13914
13915         * verify.c: Support for verifying VAR and MVAR types, 
13916
13917 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
13918
13919         * icall.c (ves_icall_get_property_info): Set the reflected type of the
13920         accessors correctly.
13921
13922 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
13923
13924         * threads.c: support OSX and other systems in
13925         mono_thread_get_stack_bounds (bug #328026).
13926
13927 2007-09-25  Martin Baulig  <martin@ximian.com>
13928
13929         * mono-debug.h
13930         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
13931
13932 2007-09-24  Martin Baulig  <martin@ximian.com>
13933
13934         * mono-debug.h
13935         (MonoDebugClassEntry): Moved the definition of this struct into
13936         mono-debug.c to make it private.
13937
13938         * mono-debug.c
13939         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
13940         type table per symbol file, we don't need to store the symfile id
13941         any longer.
13942
13943 2007-09-24  Martin Baulig  <martin@ximian.com>
13944
13945         Create one type table per symbol file, since a `MonoClass *' gets
13946         invalid when its image is unloaded.
13947
13948         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
13949         (MonoDebugHandle): Added `type_table'.
13950
13951 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13952
13953         * mempool.c, mempool.h: added mono_mempool_new_size () API
13954         to be able to specify a smaller initial size for the pool.
13955         Adjusted the code to slowly increase pool size before using
13956         the previous default size.
13957         * image.c: use a small initial size for image mempools.
13958
13959 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
13960
13961         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
13962         Fixes ##320990.
13963
13964         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
13965         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
13966
13967 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
13968
13969         * metadata.c (mono_type_create_from_typespec): Remove an invalid
13970         free. Fixes #327438.
13971
13972 2007-09-21  Raja R Harinath  <harinath@gmail.com>
13973
13974         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
13975         generic instantiations, etc.
13976         <MONO_TYPE_ARRAY>: Likewise.
13977
13978 2007-09-21  Martin Baulig  <martin@ximian.com>
13979
13980         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
13981         these structs were never defined.
13982         (MonoDebugHandle): Removed the `_priv' field, it was never used.
13983
13984 2007-09-21  Martin Baulig  <martin@ximian.com>
13985
13986         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
13987
13988 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
13989
13990         * image.c: removed the guid hash tables: we can get the same info
13991         without the additional memory usage hit (partially fixes also bug #327052).
13992
13993 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13994
13995         * profiler.h, profiler-private.h, profiler.c: add a new profiler
13996         event to handle unloading methods. After the event is called, the
13997         corresponding MonoMethod* must be considered invalid.
13998         * loader.c (mono_free_method): call the new mono_profiler_method_free
13999         event.
14000
14001 2007-09-20  Mark Probst  <mark.probst@gmail.com>
14002
14003         * domain-internals.h: New flag in MonoJitInfo which marks shared
14004         generic methods.  New hash table (shared_generics_hash) in
14005         MonoDomain to keep track of shared generic methods.  Prototypes
14006         for functions to register and lookup shared generic methods.
14007
14008         * domain.c: Support for registering and looking up shared generic
14009         methods via a hash table (shared_generics_hash) in MonoDomain.
14010
14011         * class-internals.h: New exception to signal failure of shared
14012         compilation of a generic method.  New counters for generics
14013         sharing in MonoStats.
14014
14015 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
14016
14017         * image.c, metadata-internals.h: don't keep a file descriptor open
14018         for loaded assemblies (bug#325988).
14019
14020 2007-09-19  Raja R Harinath  <rharinath@novell.com>
14021
14022         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
14023         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
14024         use the corresponding datatypes.
14025         (type_in_image): Update to changes.
14026         (CleanForImageUserData): Simplify.
14027         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
14028         Avoid quadratic behaviour in handling the "stolen" list by
14029         separating the filter predicate out, and by prepending the stolen
14030         items rather than appending them.
14031         (steal_ginst_in_image): Likewise.
14032         (mono_metadata_clean_for_image): Update to changes.
14033
14034 2007-09-19  Martin Baulig  <martin@ximian.com>
14035
14036         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
14037
14038 2007-09-19  Martin Baulig  <martin@ximian.com>
14039
14040         * mono-debug.c (mono_debug_cleanup): Don't call
14041         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
14042
14043 2007-09-19  Raja R Harinath  <harinath@gmail.com>
14044
14045         Fix crash on 'make run-test' in mcs/errors
14046         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
14047         Avoid more potential allocations in mono_class_from_mono_type.
14048         (ginst_in_image): Update to changes.
14049         (gclass_in_image): Rearrange slightly.
14050
14051 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
14052
14053         * class.c (mono_class_init): Move the code that sets up class->methods to 
14054         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
14055
14056         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
14057         canonical instance of an inflated generic signature.
14058         (mono_type_create_from_typespec): Remove an invalid free.
14059
14060         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
14061
14062 2007-09-18  Marek Habersack  <mhabersack@novell.com>
14063
14064         * domain-internals.h: added a declaration of the
14065         mono_assembly_load_full_nosearch internal function.
14066
14067         * assembly.c (mono_assembly_load_with_partial_name): use
14068         mono_try_assembly_resolve return value properly.
14069         (mono_assembly_load_full_nosearch): copied the function body from
14070         mono_assembly_load_full, without the code to invoke assembly
14071         search hooks.
14072         (mono_assembly_load_full): calls the above new function and if the
14073         assembly is not resolved, invokes the search hooks.
14074
14075         * appdomain.c (mono_runtime_init): restore the global postload
14076         assembly search handlers.
14077
14078 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
14079
14080         * class.c (mono_class_init): Make sure class->methods and class->properties
14081         are never NULL in the generics case.
14082
14083         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
14084
14085 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
14086
14087         * metadata.c (free_generic_class): Disable some code to fix the build.
14088
14089         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
14090
14091         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
14092         from the image mempool.
14093
14094         * metadata.c (free_generic_class): Free more data from the inflated class.
14095
14096         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
14097
14098         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
14099         mempool.
14100         (mono_type_create_from_typespec): Ditto.
14101
14102         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
14103         MonoImage to the caller.
14104         (mono_init_internal): Save the opened image in a global variable.
14105         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
14106
14107         * reflection.c (resolve_object): Fix a leak.
14108
14109         * metadata.c: Fix the freeing of data in the generics caches.
14110         
14111         * metadata.c (free_generic_inst): Comment this out to fix the build.
14112         (free_generic_class): Ditto.
14113
14114         * metadata.c: Free cached generic methods, instantinations and classes when
14115         they are removed from the caches.
14116         (mono_metadata_free_type): Free the type itself.
14117
14118         * class.c: Free the result of mono_class_inflate_generic_type () in a few
14119         places.
14120
14121 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14122
14123         * boehm-gc.c: restrict managed allocs to __thread supporting
14124         architectures.
14125
14126 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
14127
14128         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
14129         (mono_generic_class_get_class): Fix a leak.
14130
14131         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
14132         mono_metadata_free_type ().
14133         (mono_metadata_inflate_generic_inst): Fix a leak.
14134
14135 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14136
14137         * mono-debug.c (free_header_data): Fix a leak missed earlier.
14138
14139         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
14140         mempool.
14141
14142         * mono-debug.c (mono_debug_close_image): Fix call to 
14143         g_hash_table_remove ().
14144
14145 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
14146
14147         * icall-def.h: redirect all the string ctor to the managed
14148         CreateString () methods.
14149         * string-icalls.c, string-icalls.h: removed dead code for string
14150         ctors and icalls.
14151
14152 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14153
14154         * mono-debug.c: Fix memory leaks.
14155
14156 2007-09-14  Jonathan Chambers <joncham@gmail.com>
14157
14158         * threads-types.h: Implement mono_hazard_pointer_set and 
14159         mono_hazard_pointer_clear macros using do/while(0) to fix
14160         compilation with MSVC.
14161         
14162         Code is contributed under MIT/X11 license.
14163
14164 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14165
14166         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
14167         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
14168
14169 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14170
14171         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
14172         icalls.
14173
14174 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14175
14176         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
14177         managed-code allocated as well.
14178
14179 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
14180
14181         * class.c (mono_class_is_assignable_from): Add support for generic variance.
14182
14183 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
14184
14185         * boehm-gc.c: fixed the build after the AOT changes.
14186
14187 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
14188
14189         * wrapper-types.h: Add an ALLOC wrapper type.
14190
14191         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
14192         reference managed allocator methods.
14193
14194 2007-09-12  Marek Safar  <marek.safar@gmail.com>
14195
14196         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
14197         of Type array and not MonoType, a fix suggested by Hari.
14198         
14199 2007-09-12  Jonathan Chambers <joncham@gmail.com>
14200
14201         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
14202         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
14203         
14204         Code is contributed under MIT/X11 license.
14205
14206 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
14207
14208         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
14209
14210 2007-09-12  Marek Habersack  <mhabersack@novell.com>
14211
14212         * image.c (do_mono_image_open): if assembly file fails to open and
14213         MONO_IOMAP is in effect, try to find the path in a
14214         case-insensitive way.
14215
14216         * appdomain.c (mono_runtime_init): do not install postload hooks -
14217         tests show that MS.NET doesn't use anything of that sort to
14218         trigger the AppDomain.AssemblyResolve event.
14219         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
14220         made non-static.
14221         (mono_runtime_init): init portability helpers here.
14222
14223         * assembly.c (mono_assembly_load_with_partial_name): if other   
14224         attempts fail, trigger the AppDomain.AssemblyResolve event handler
14225         to resolve the assembly.
14226
14227         * domain-internals.h: added mono_try_assembly_resolve and marked
14228         it as internal.
14229
14230 2007-09-11  Jb Evain  <jbevain@novell.com>
14231
14232         * object-internals.h (MonoReflectionDynamicMethod): add
14233         a `MonoReflectionType *owner` field. The owner is used
14234         * reflection.c:
14235         (mono_reflection_create_dynamic_method): use the owner of the dynamic
14236         method as the class declaring the dynamic method.
14237         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
14238         dynamic method to the declaring type of the methodbuilder.
14239
14240 2007-09-11  Mark Probst  <mark.probst@gmail.com>
14241
14242         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
14243         rules for calling methods via reflection.
14244
14245 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
14246
14247         * reflection.c (resolve_object): Add support for MonoGenericClass. 
14248         Inflate MonoType's.
14249
14250 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
14251
14252         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
14253         provide a managed method that does fast allocations without needing
14254         a managed->unmanaged transition. Boehm GC implementation currently
14255         enabled for ptrfree objects on sane architectures.
14256
14257 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
14258
14259         * marshal.c, marshal.h: exported a couple of useful functions and
14260         added mono_mb_get_label () to easily handle backward branches.
14261
14262 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
14263
14264         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
14265
14266 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
14267
14268         * loader.c (find_method): Fixed the regression introduced while
14269         fixing bug #81466.
14270
14271 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
14272
14273         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
14274         well.
14275         
14276         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
14277         icall.c reflection.c: Pass a MonoGenericContext argument to 
14278         mono_lookup_dynamic_token ().
14279
14280         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
14281         #82744.
14282         
14283 2007-09-09  Robert Jordan  <robertj@gmx.net>
14284
14285         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
14286         for generic methods.
14287
14288         * object.c (mono_object_get_virtual_method): Handle generic methods.
14289         Fixes bug #78882.
14290
14291         Code is contributed under MIT/X11 license.
14292
14293 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
14294
14295         * image.c: fix locking in mono_image_load_file_for_image ().
14296
14297 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
14298
14299         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
14300         used only as a cache: added an icall to fill it.
14301
14302 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
14303
14304         * reflection.h: exposed mono_reflection_free_type_info
14305         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
14306         since mono_reflection_bind_generic_parameters makes a copy of it.
14307         * reflection.c (free_type_info): subinfos should be freed.
14308         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
14309         made non static.
14310         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
14311         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
14312         this fixes #82695 and #81726.
14313    
14314
14315 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
14316
14317         * process.h, process.c:  added support for user profile/info in
14318           ProcessStartInfo. For now only Windows works.
14319
14320 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
14321
14322         * metadata.c: consider the generic arguments when comparing
14323         signatures (bug #82614).
14324
14325 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14326
14327         * cil-coff.h, image.c: updated assembly loader to cope with the
14328         PE32+ 64 bit file format.
14329
14330 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14331
14332         * assembly.c, class.c, domain.c, loader.c: remove useless
14333         inclusion of cil-coff.h.
14334
14335 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
14336
14337         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
14338         if interface is marked with CoClassAttribute. 
14339    
14340         Code is contributed under MIT/X11 license.
14341
14342 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14343
14344         * sgen-gc.c: ensure no object from the to space is copied again or finalized
14345         if it's seen twice in major collections.
14346
14347 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
14348
14349         * sgen-gc.c: big objects are not copied to the gray area, but they
14350         need to be considered for scanning, too, if they are brought alive
14351         by an object ready for finalizations or a survived one.
14352
14353 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
14354
14355         * sgen-gc.c: properly account the number of disappearing links when
14356         they are nullified.
14357
14358 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
14359
14360         * sgen-gc.c: share the code to scan the registered roots between the
14361         different types of collections.
14362
14363 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14364
14365         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
14366
14367 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14368
14369         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
14370         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
14371
14372 2007-08-28  Mark Probst  <mark.probst@gmail.com>
14373
14374         * security-manager.c (mono_security_manager_get_methods):
14375         LinkDemandSecurityException now has 2 arguments instead of 3.
14376
14377 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
14378
14379         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
14380         platforms which need it.
14381
14382 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14383
14384         * sgen-gc.c: unregister thread data structures with a pthread_key_t
14385         dtor.
14386
14387 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
14388
14389         * threads.c: free the thread static data on thread exit.
14390
14391 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
14392
14393         * class.c: walk the hierarchy to find the generic definition for
14394         a class (fixes runtime part of bug #82498).
14395
14396 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14397
14398         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
14399         ...
14400
14401         * image.c (mono_image_close): Here. Hopefully fixes #82510.
14402
14403 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14404
14405         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
14406
14407 2007-08-24  Robert Jordan  <robertj@gmx.net>
14408
14409         * appdomain.c: don't perform the ':'->';' substitution on Win32.
14410
14411 2007-08-24  Jb Evain  <jbevain@novell.com>
14412
14413         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
14414         for byref types.
14415
14416 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14417
14418         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
14419         #82286.
14420
14421 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14422
14423         * assembly.c: Fix a warning.
14424         
14425 2007-08-23  Marek Habersack  <mhabersack@novell.com>
14426
14427         * appdomain.c: parse the <runtime> section looking for the probing
14428         element with the 'privatePath' attribute, which sets additional
14429         directories in which the runtime should look for assemblies.
14430
14431 2007-08-23  Robert Jordan  <robertj@gmx.net>
14432
14433         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
14434         Fixes #82499.
14435
14436 2007-08-23  Martin Baulig  <martin@ximian.com>
14437
14438         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
14439         _mono_debug_init_corlib() and remove it from the header file.
14440
14441 2007-08-23  Martin Baulig  <martin@ximian.com>
14442
14443         * mono-debug-debugger.c
14444         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
14445         don't notify the debugger about it.
14446
14447         * mono-debug-debugger.h
14448         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
14449
14450 2007-08-23  Robert Jordan  <robertj@gmx.net>
14451
14452         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
14453         Code is contributed under MIT/X11 license.
14454
14455 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14456
14457         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
14458
14459 2007-08-22  Martin Baulig  <martin@ximian.com>
14460
14461         * mono-debug.c: Store debugging info on a per-domain basis and
14462         free it on domain unload.  Add support for unloading symbol files.
14463
14464         * mono-debug.h
14465         (MonoDebugList): New typedef.
14466         (MonoSymbolTable):
14467         - add `data_tables and `type_table'.
14468         - replace 'symbol_files' and `num_symbol_files' with a
14469           `MonoDebugList *'.
14470         (mono_debug_data_table): Removed.
14471         (mono_debug_list_add): New public function.
14472         (mono_debug_list_remove): New public function.
14473         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
14474         (mono_debug_init_2_memory): Renamed into
14475         mono_debug_open_image_from_memory().
14476         (mono_debug_close_image): New public function.
14477         (mono_debug_domain_create): Likewise.
14478         (mono_debug_domain_unload): Likewise.
14479         (MONO_DEBUGGER_VERSION): Bump to 60.
14480
14481         * mono-debug-debugger.h
14482         (MonoDebuggerEvent):
14483         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
14484         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
14485         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
14486         - rename `THREAD_CREATED' and `THREAD_EXITED' into
14487           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
14488         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
14489           meaning.
14490         (mono_debugger_add_symbol_file): Removed.
14491         (mono_debugger_add_type): Removed.
14492         (mono_debugger_lookup_type): Removed.
14493         (mono_debugger_lookup_assembly): Removed.
14494
14495         * domain.c
14496         (mono_domain_create): Call mono_debug_domain_create().
14497         (mono_init_internal): Call mono_debug_init_corlib().
14498
14499         * assembly.c
14500         (mono_assembly_close): Call mono_debug_close_image().
14501
14502 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
14503
14504         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
14505         mmap call.
14506
14507 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14508
14509         * sgen-gc.c: ensure section->pin_queue_end is initialized
14510         correctly when non pinning objects in the section have been found.
14511
14512 2007-08-22  Marek Habersack  <mhabersack@novell.com>
14513
14514         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
14515         containing a list of directories separated by ':'. MSDN docs say
14516         the directories should be separated with ';'. Part of a bugfix for
14517         bug #81446
14518
14519 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
14520
14521         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
14522         it should MonoType and not MonoClass.
14523
14524 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
14525
14526         * culture-info-table.h : regenerated.
14527
14528 2007-08-20  William Holmes  <billholmes54@gmail.com>
14529
14530         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
14531          to call ReplaceFile Kernel32 on windows or in io-layer.
14532         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
14533         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
14534          as an internal call.
14535
14536         Code is contributed under MIT/X11 license.
14537
14538 2007-08-20  Jb Evain  <jbevain@novell.com>
14539
14540         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
14541         and MONO_EXCEPTION_FIELD_ACCESS.
14542
14543         * debug-helpers.[c|h]: new mono_field_full_name function.
14544
14545 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14546
14547         * class.c: Removed class_security_level() and moved it to
14548         security-core-clr.c.
14549
14550         * security-core-clr.c, security-core-clr.h: class_security_level()
14551         is now public and renamed to mono_security_core_clr_class_level().
14552         It also looks for security attributes in the classes a class is
14553         nested in.
14554
14555 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14556
14557         * security-core-clr.c, security-core-clr.h: CoreCLR security
14558         utility functions.
14559
14560         * Makefile.am: Added security-core-clr.[ch].
14561
14562         * security-manager.c, security-manager.h: Functions and enum for
14563         setting and getting the security mode.
14564
14565         * class.c: CoreCLR security checks.
14566
14567 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
14568
14569         * icall-def.h, process.c, process.h: implemented icall to get
14570         user/system processor times.
14571
14572 2007-08-17  Mark Probst  <mark.probst@gmail.com>
14573
14574         * domain.c, threads.c, class-internals.h, domain-internals.h: New
14575         reader-lock-free jit_info_table.
14576
14577 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
14578
14579         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
14580
14581         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
14582
14583         * object-internals.h (MonoException): Add missing _data member.
14584
14585 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14586
14587         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
14588         checking that only methods with matching qname or fqname are picked
14589         from implemented interfaces.
14590
14591 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14592
14593         * verify.c (do_newarr):added, do type verification of
14594         newarr ops, push the right value on the eval stack.
14595         * verify.c (mono_method_verify): use do_newarr
14596
14597
14598 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14599
14600         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
14601         factored the common code into get_boxable_mono_type, which
14602         is now using mono_type_get_full, this fixed byref related tests.
14603
14604 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14605
14606         * class.c: added mono_type_get_full, this function has the same
14607         behavior of mono_class_get_full but the returned MonoType has
14608         all metadata of the associated token in case of a typespec token.
14609         * class.c: added mono_type_retrieve_from_typespec, used by 
14610         mono_type_get_full to retrieve the token type.
14611         * class.c (mono_class_create_from_typespec): changed to use
14612         mono_type_retrieve_from_typespec.
14613         * class.c (mono_ldtoken): changed to use mono_type_get_full
14614         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
14615         * class-internals.h: exported mono_type_get_full for internal use.
14616
14617 2007-08-16  Jb Evain  <jbevain@novell.com>
14618
14619         * domain.c (supported_runtimes): add entry for
14620         the 'moonlight' runtime version.
14621
14622 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14623
14624         * verify.c (mono_method_verify): small typo sliped in.  
14625
14626 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14627
14628         * verify.c (do_unbox_value): added, do type verification of
14629         unboxing ops
14630         * verify.c (mono_method_verify): use do_unbox_value
14631
14632
14633 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14634
14635         * verify.c (dump_stack_value): fixed typo, was printing string
14636         instead of object on stack.
14637         * verify.c (do_box_value): moved the byref check up as it leads
14638         to invalid code and should be done earlier.
14639         * verify.c: improved error messages for and ldobj
14640
14641 2007-08-15  William Holmes  <billholmes54@gmail.com>
14642
14643         * marshal.c (emit_marshal_custom): Omit the call to 
14644           marshal_native_to_managed when calling native to managed 
14645           and the argument is specified as an out argument.
14646
14647         Code is contributed under MIT/X11 license.
14648
14649 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14650
14651         * verify.c: fixed the type checks for generics, function pointers and vectors.
14652         Added type verification for ldobj and ldtoken. The verifier
14653         would segfault if header or signature of a method contained references
14654         to non-existant types.
14655
14656 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14657
14658         * marshal.c (cominterop_get_ccw): Patch from
14659         Bill Holmes to no walk up interface hierarchy. 
14660         All parent methods should be present in the interface for COM.
14661    
14662         Code is contributed under MIT/X11 license.
14663
14664 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14665
14666         * marshal.c (emit_marshal_com_interface): Patch from
14667         Bill Holmes to handle COM Interfaces as return values
14668         for native->managed calls.
14669    
14670         Code is contributed under MIT/X11 license.
14671
14672 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
14673
14674         * marshal.c (cominterop_get_idispatch_for_object): Implement
14675         for runtime callable wrappers.
14676    
14677         Code is contributed under MIT/X11 license.
14678
14679 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
14680
14681         * pedump.c (main): changed from mono_init to mono_init_from_assembly
14682         so 2.0 types are accessible
14683
14684
14685 2007-08-13  Miguel de Icaza  <miguel@novell.com>
14686
14687         * domain.c (mono_init_internal): Call mono_assembly_load_friends
14688         once we load mscorlib.   Due to the order in which we initialize,
14689         the mono_assembly_load_full routine that loads mscorlib did not
14690         load friends.   We now load it once we load the
14691         mono_defaults.internals_visible_class class. 
14692
14693         * assembly.c: Expose the mono_load_friend_assemblies method.
14694
14695 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
14696
14697         * verify.c: improved the handling of boxing, better
14698         type checking for unary ops and conversion. Fix bug
14699         regarding managed pointer compatibility checking
14700
14701 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
14702
14703         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
14704
14705         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
14706
14707 2007-08-09  Raja R Harinath  <rharinath@novell.com>
14708
14709         * reflection.c (dup_type): Remove.
14710         * class.c (dup_type): Remove.
14711         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
14712         instead of the dodgy 'dup_type'.
14713         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
14714         handle the case where 'dup_type' needed the second argument.
14715
14716 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
14717
14718         * domain.c: Fix a warning.
14719
14720 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14721
14722         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
14723         checking that methods with the same fqname are not overridden
14724         with a method from an ancestor.
14725
14726 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
14727
14728         * threads.c (free_thread_static_data_helper): Avoid a crash if
14729         thread->static_data is not yet set.
14730
14731 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
14732
14733         * marshal.c: Use correct image when emitting
14734         native wrapper for COM calls.
14735    
14736         Code is contributed under MIT/X11 license.
14737
14738 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
14739
14740         * icall-def.h, security.c, security.h :
14741           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
14742
14743 2007-08-07  Martin Baulig  <martin@ximian.com>
14744
14745         * mono-debug-debugger.h
14746         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
14747
14748         * domain.c (mono_domain_free): Call
14749         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
14750
14751 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
14752
14753         * verify.c (check_underflow, check_overflow): error message now returns IL offset
14754         * verify.c (in_same_block): code should test if either offset is inside the clauses
14755         * verify.c (mono_method_verify): push the exception into the eval stack of exception
14756         and filter blocks
14757
14758 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14759
14760         * image.c (mono_image_close): Fix a leak.
14761
14762         * object.c (mono_runtime_invoke_array): Avoid using alloca.
14763
14764         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
14765
14766 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
14767
14768         * domain.c, threads.c, threads-types.h: fix memory retention issue
14769         with thread static variables not being cleared on domain unload.
14770         Reuse thread static slots after domain unload.
14771
14772 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14773
14774         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
14775         nullable type.
14776
14777         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
14778         now done in mono_runtime_invoke_array.
14779
14780         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
14781         receiver is a nullable type.
14782
14783         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
14784         generic parameter.
14785
14786 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
14787
14788         * marshal.c: Implement COM Objects as return type for 
14789         managed->unmanaged calls. Added Release calls for COM Object
14790         out/return values in managed->unmanaged calls.
14791
14792         Code is contributed under MIT/X11 license.
14793
14794 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
14795
14796         * threads.h, threads-type.h: move the hazard pointer declarations
14797         to the private header.
14798
14799 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
14800
14801         * file-io.c, appdomain.c: memory leak fixes.
14802
14803 2007-08-02  Dick Porter  <dick@ximian.com>
14804
14805         * socket-io.c
14806         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
14807         SO_REUSEADDR setting into io-layer/sockets.c.
14808
14809 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
14810
14811         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
14812         from Object when called on a generic parameter. Fixes #82211.
14813
14814 2007-08-01  Dick Porter  <dick@ximian.com>
14815
14816         * file-io.c (convert_share): Test FileShare values bit-by-bit.
14817         Fixes bug 79250 yet again.
14818
14819 2007-07-30  Martin Baulig  <martin@ximian.com>
14820
14821         Merged the `debugger-dublin' branch.
14822
14823         * mono-debug.h
14824         (MonoDebugDataTable): New typedef.
14825         (MonoDebugMethodAddressList): New typedef.
14826         (MonoDebugWrapperData): Removed.
14827         (MonoDebugSymbolTable): Removed `current_data_table',
14828         `current_data_table_size', `current_data_table_offset'.
14829         (MonoDebugDataItemType): Moved into mono-debug.c.
14830         (MonoDebugMethodJitInfo): Remove `address'.
14831         (mono_debug_data_table): New global variable.
14832         (mono_debug_lookup_method_addresses): New public function.
14833         (mono_debug_find_method): Take a `MonoMethod *', not a
14834         `MonoDebugMethodInfo *'.
14835
14836         * mono-debug.c: Drop support for the old symbol tables.
14837
14838 2007-06-28  Martin Baulig  <martin@ximian.com>
14839
14840         * mono-debug.c (mono_debug_debugger_version): New public variable.
14841
14842 2007-07-31  William Holmes  <billholmes54@gmail.com>
14843
14844         * metadata.c Changed mono_type_create_from_typespec to not insert
14845           the type into the hash map until after
14846           do_mono_metadata_parse_type has completed.
14847         Fixes Bug #82194
14848         Code is contributed under MIT/X11 license.
14849
14850 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
14851
14852         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
14853         generic parameter. Fixes #82211.
14854
14855 2007-07-27  Jb Evain  <jbevain@novell.com>
14856
14857         * pedump.c (dump_metadata, dump_metadata_header): dump
14858         versions contained in the metadata header.
14859
14860 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
14861
14862         * threads.c: register small_id_table with the GC.
14863
14864 2007-07-27  Mark Probst  <mark.probst@gmail.com>
14865
14866         * threads.c, threads.h, class-internals.h, object-internals.h:
14867         Hazard pointers, to be used by lock-free parallel algorithms.
14868
14869 2007-07-26  Dick Porter  <dick@ximian.com>
14870
14871         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
14872         routine on non-windows platforms, as I've not managed to think of
14873         a non-kludgy way of doing this.  Finishes off bug 78739.
14874
14875 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
14876
14877         * object.c: properly setup interface_bitmap in proxy vtables.
14878
14879 2007-07-25  Marek Habersack  <mhabersack@novell.com>
14880
14881         * appdomain.c (get_shadow_assembly_location): do not use TickCount
14882         to create unique shadow copy target directories, use the domain's
14883         serial number instead. Each domain gets a unique target directory
14884         that way.
14885
14886         * domain.c (mono_domain_create): added code to increment domain
14887         shadow copy serial number and cache the value in the current
14888         domain structure.
14889
14890         * domain-internals.h (struct _MonoDomain): added a new field -
14891         shadow_serial to hold the serial number used in generation of
14892         shadow-copy directories. This is to make sure that the directory
14893         name is unique for each and every domain created. We avoid a race
14894         condition with overriding assemblies already in use by other app
14895         domains.
14896
14897 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
14898
14899         * class.c (mono_bounded_array_class_get): fixed memory leak when 
14900         binding generic parameters.
14901
14902 2007-07-24  Raja R Harinath  <rharinath@novell.com>
14903
14904         * metadata.c (do_mono_metadata_parse_generic_class): Use
14905         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
14906         error.
14907
14908 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
14909
14910         * loader.c, class-internals.h, reflection.c: removed the per-method
14911         generics hashtable: we use the global one through the call of
14912         mono_class_inflate_generic_method ().
14913
14914 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14915
14916         * class.c, metadata.c, class-internals.h: introduce yet another
14917         generics global cache for inflated methods (fixes 98% of the perf
14918         issue in bug #81806).
14919
14920 2007-07-23  Raja R Harinath  <rharinath@novell.com>
14921
14922         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
14923         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
14924         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
14925         return a MonoGenericInst containing (a copy) of those types.
14926         (mono_metadata_inflate_generic_inst): Update to changes.
14927         (mono_metadata_parse_generic_inst): Likewise.
14928         (mono_get_shared_generic_inst): Likewise.
14929         * reflection.c (mono_class_bind_generic_parameters): Likewise.
14930         (mono_reflection_bind_generic_method_parameters): Likewise.
14931         * metadata-internals.h: Likewise.
14932         * icall.c (free_generic_context): Kill.
14933         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
14934
14935         * reflection.c (reflection_methodbuilder_to_mono_method): Use
14936         mono_metadata_type_dup.
14937         * marshal.c (mono_mb_create_method): Likewise.
14938
14939         * metadata.c (mono_metadata_type_dup): Rename from
14940         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
14941         MonoImage.  Handle a few more cases, esp. when no mempool is given.
14942         * marshal.c, metadata-internals.h: Update to changes.
14943
14944 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14945
14946         * class.c: fixed a small leak for array classes and removed warning.
14947
14948 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
14949
14950         * loader.c (mono_method_get_param_token): Make this work on generic methods.
14951         Return 0x8000000 for return parameters. Fixes #82161.
14952
14953 2007-07-21  Marek Habersack  <grendello@gmail.com>
14954
14955         * appdomain.c (get_shadow_assembly_location): append the current
14956         ticks value to the path. Avoids overwriting the same assemblies by
14957         several threads at the same time.
14958
14959 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14960         and Raja R Harinath  <rharinath@novell.com>
14961
14962         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
14963         Simplify slightly.
14964         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
14965         property for testing if a method is a generic method definition.
14966
14967 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14968
14969         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
14970
14971 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14972
14973         * verify.c: used function from private branch, reverted to the one in class.h 
14974
14975 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14976
14977         * verify.c: a typo slipped in and the code wont compile
14978
14979 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14980
14981         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
14982         disabled box instruction as it is doing the wrong thing
14983         improved stack dump messages, now it is easier to debug type related issues
14984
14985
14986 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
14987
14988         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
14989
14990 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14991
14992         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
14993         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
14994         grouped with class and valuetype. This change will simply 
14995         the code as it should be handled just like unmanaged pointers.
14996
14997 2007-07-19  Mark Probst  <mark.probst@gmail.com>
14998
14999         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
15000
15001 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
15002
15003         * verify.c: several stack merge issues fixed, reference comparisons now
15004         check the type size. strict type check now works correctly.
15005         added more uses of IS_MANAGED_POINTER macro.
15006         fixed issues pointed by running the test suite against .net.
15007         
15008
15009 2007-07-19  Mark Probst  <mark.probst@gmail.com>
15010
15011         * class.c, loader.c, class-internals.h: Removed the
15012         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
15013         defines.
15014
15015         * icall.c: Better error checking in some internal reflection
15016         methods.
15017
15018 2007-07-18  William Holmes  <billholmes54@gmail.com>
15019
15020         * filewatcher.c : removed unused variable 'filename' in 
15021           ves_icall_System_IO_FSW_SupportsFSW
15022
15023 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
15024
15025         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
15026         obsolete, removed.
15027
15028 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
15029
15030         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
15031         
15032         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
15033
15034 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
15035
15036         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
15037         Implement generics support.
15038         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
15039
15040         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
15041         type_args and method_args arguments.
15042         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
15043         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
15044         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
15045
15046 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
15047
15048         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
15049           It adds a rootimage parameter to mono_reflection_get_type_internal,
15050           adds new function mono_reflection_get_type_with_rootimage and use
15051           the rootimage to resolve the types instead of the current image
15052
15053 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
15054
15055         * culture-info-table.h: Forgot to update after r78304.
15056
15057 2007-07-13  Raja R Harinath  <rharinath@novell.com>
15058
15059         * class.c (mono_class_is_open_constructed_type)
15060         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
15061
15062 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
15063
15064         * class.c (mono_bounded_array_class_get):  method fails if used with
15065         an incomplete TypeBuilder enum (no basetype field), fixed it by 
15066         avoiding calculating the size for such array as it cannot be instantiated.
15067         Fix bug #82015
15068
15069 2007-07-12  Raja R Harinath  <rharinath@novell.com>
15070
15071         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
15072         field.
15073         * metadata.c, reflection.c: Update to changes.
15074
15075 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
15076
15077         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
15078         mono_class_is_valid_enum, they are used to valide a enum when loading.
15079         * reflection.c: used new functions to throw TypeLoadException when and
15080         invalid enum is build with TypeBuilder. Fixes #82018
15081   
15082 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
15083
15084         * object.c: forgot commit of mono_class_setup_methods () to access
15085         iface->methods.
15086         * object-internals.h: added a few more handy fields to
15087         MonoIMTCheckItem.
15088
15089 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
15090
15091         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
15092         iface->methods.
15093
15094 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
15095
15096         * class-internals.h, object-internals.h, object.c: IMT-based
15097         interface invocation core from Massimiliano Mantione
15098         (massi@ximian.com) with a reworked arch-specific interface,
15099         bsearch implementation and a few bugfixes and memory savings by me.
15100
15101 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
15102
15103         * class.c (mono_class_create_from_typedef): mono would segfault if 
15104         an enum did not have a __value field. It now throws a TypeLoadException
15105         for such cases. Fix bug #82022
15106
15107 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
15108
15109         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
15110
15111 2007-07-09  Mark Probst  <mark.probst@gmail.com>
15112
15113         * class.c (mono_class_init): If a class is already inited but has
15114         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
15115
15116 2007-07-09  Mark Probst  <mark.probst@gmail.com>
15117
15118         * class.c: Properly handle the case of an unimplemented interface
15119         method.  Fixes: 81673.
15120
15121 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
15122
15123         * class-internals.h, object.c: cleanup patch from massi: use
15124         MonoVTable->interface_bitmap since the vtable interfaces offset array
15125         is going away.
15126
15127 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
15128
15129         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
15130         GetMDStreamVersion icall instead.
15131
15132 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
15133
15134         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
15135         not use mono_dl_build_path() with a full library name: makes
15136         fallbacks to libgaim and libfam work.
15137
15138 2007-07-06  William Holmes  <billholmes54@gmail.com>
15139
15140         * assembly.c: Added a continue statement in probe_for_partial_name when
15141          parse_assembly_directory_name fails.  Fixes : 82002
15142
15143 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
15144
15145         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
15146         and added a verification  for TYPEDBYREF.
15147         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
15148         make native int interchangeable with int32 and some small cleanup and formating.
15149         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
15150         handle byref of byref.
15151         * verify.c (push_local): handle byref of byref.
15152         * verify.c (do_binop): invalid mix of values is unverifiable
15153         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
15154         added visibility checks
15155         * verify.c (field related method): added visibility checks
15156         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
15157
15158 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
15159
15160         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
15161         string.
15162
15163 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
15164
15165         * profiler.c (mono_profiler_load): Fix an off-by-one error.
15166
15167         * marshal.c (emit_marshal_string): When returning a string from managed code,
15168         allways make a copy even for unicode strings. Fixes #81990.
15169
15170 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
15171
15172         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
15173         of byref generic inst types (bug #81997).
15174
15175 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
15176
15177         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
15178         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
15179
15180 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
15181
15182         * marshal.c (emit_marshal_string): Add support for unicode strings in
15183         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
15184
15185 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
15186
15187         * verify.c: field load/store are now verified, missing only access checks now
15188
15189 2007-06-28  Martin Baulig  <martin@ximian.com>
15190
15191         * mono-debug.c (mono_debug_debugger_version): New public variable.
15192
15193 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
15194
15195         * locales.c: When constructing DateTimeFormat or NumberFormat for
15196         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
15197         MonoCultureInfo contructed from the current locale is always
15198         read-only and has UseUserOverride set to true. All MonoCultureInfo
15199         instances returned for GetCultures have both IsReadOnly and
15200         UseUserOverride set to true. Fixes part of bug #81930.
15201
15202 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
15203
15204        * icall-def.h: Update System.__ComObject icalls
15205        * marshal.c: Avoid managed transition (and object creation)
15206        when looking up COM interface in RCW.
15207        * marshal.h: Ditto.
15208        
15209        Code is contributed under MIT/X11 license.
15210
15211 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
15212
15213         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
15214         to avoid crashes during assembly unloading.
15215
15216 2007-06-22  Raja R Harinath  <rharinath@novell.com>
15217
15218         Fix MethodInfo.IsGenericMethodDefinition
15219         * reflection.c (mono_reflection_bind_generic_method_parameters):
15220         Rearrange code to ensure we always uses a generic method definition.
15221         * class.c (mono_class_inflate_generic_method_full): Set
15222         'generic_container' field only for generic method definitions.
15223         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
15224         Use presense of 'generic_container' field as indication of being a
15225         generic method definition.
15226
15227 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
15228
15229         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15230
15231         * object-internals.h: Reflect changes in the layout of the managed Delegate
15232         class.
15233         
15234         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
15235         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
15236         runtime memory used by the dynamic method. Fixes #77146.
15237
15238 2007-06-21  Dick Porter  <dick@ximian.com>
15239
15240         * file-io.h: 
15241         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
15242         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
15243         81767.
15244
15245 2007-06-21  Raja R Harinath  <rharinath@novell.com>
15246
15247         * reflection.c (method_encode_methodspec): Add a tripwire.
15248         * class.c (inflate_generic_type): The fully open generic type is
15249         not the same as the generic type definition.
15250
15251 2007-06-21  Martin Baulig  <martin@ximian.com>
15252
15253         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
15254
15255         * mono-debug-debugger.h
15256         (MonoDebuggerBreakpointInfo): Removed.
15257         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
15258         (mono_debugger_remove_breakpoint): Likewise.
15259         (mono_debugger_breakpoint_callback): Likewise.
15260         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
15261
15262 2007-06-21  Raja R Harinath  <rharinath@novell.com>
15263
15264         * metadata.c (mono_metadata_lookup_generic_class): The fully open
15265         generic type is not the same as the generic type definition.
15266         * class.c (mono_generic_class_get_class): Likewise.
15267
15268 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
15269
15270         * icall.c: The second argument to 
15271         System.Reflection.MethodBase.GetMethodFromHandleInternalType
15272         is a MonoType not a MonoClass.
15273
15274 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
15275
15276         * verify.c: support for function pointers in the verifier
15277
15278 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
15279
15280         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
15281
15282 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
15283
15284         * assembly.c: removed Mono.Data.SqliteClient from the list of
15285         forward-compatible assemblies as it breaks the ABI (bug #81899).
15286
15287 2007-06-19  Raja R Harinath  <rharinath@novell.com>
15288
15289         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
15290         lookup/update with the loader lock.
15291         * reflection.c (mono_class_bind_generic_parameters): No need to
15292         protect mono_metadata_lookup_* with the loader lock.
15293         * class.c (inflate_generic_type): Likewise.
15294         
15295         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
15296         on a generic instantiated type.
15297
15298 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
15299
15300         *verify.c: produce meanfull error messages on verification error
15301         *verify.c: fixed some cases of verification errors reported as validation errors
15302         *pedump.c: fixed the error name array, now it shows validation errors properly
15303         *verify.h: fixed the contant that should be used for verification errors
15304
15305 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
15306
15307         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
15308         for bug #77596, 81858 and 80743 (generics data structures on domain
15309         unload).
15310
15311 2007-06-15  Raja R Harinath  <rharinath@novell.com>
15312
15313         Avoid allocating 'MonoGenericContext' on the heap.
15314         * class-internals (_MonoMethodInflated::context): Make field
15315         inline, not a pointer.
15316         * loader.c (method_from_methodspec): Allocate 'new_context' on the
15317         stack.  Use the context embedded within the inflated method as the
15318         hash key, rather than 'new_context'.
15319         * class.c (inflate_generic_context): Simplify.  Return a struct
15320         rather than allocating on the heap.
15321         (mono_class_inflate_generic_method_full): Update to changes.  Now,
15322         doesn't salt away a copy of the context -- simplifying the
15323         lifetime rules of a 'MonoGenericContext *'.
15324         (mono_method_get_context): Return pointer to embedded context.
15325         (setup_generic_array_ifaces): Allocate temporary context on stack.
15326         * reflection.c (inflate_mono_method): Likewise.
15327         (mono_reflection_bind_generic_method_parameters): Likewise.
15328         Use the context embedded within the inflated method as the hash key.
15329
15330         Avoid a source of allocation of 'MonoGenericContext'.
15331         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
15332         and 'cached_context' fields into embedded 'MonoGenericContext' field.
15333         * class.c: Update to changes.
15334         (mono_generic_class_get_context): Simplify drastically.  Now just
15335         returns a pointer to the field.
15336         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
15337         argument as a const pointer.
15338         (mono_metadata_generic_context_equal): Likewise.
15339         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
15340         Update to changes.
15341
15342 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
15343
15344         * verify.c improved the handling of brtrue/brfalse, factored out common code
15345
15346 2007-06-14  Raja R Harinath  <rharinath@novell.com>
15347
15348         Kill MonoGenericMethod.
15349         * class-internals.h (MonoGenericContext::method_inst): Rename from
15350         'gmethod' and convert to a MonoGenericInst.
15351         (MonoGenericMethod): Remove.
15352         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
15353         * loader.c (method_from_methodspec): Update to changes.  Use a
15354         MonoGenericContext as the key to the hashtable.
15355         * metadata.c (mono_metadata_generic_context_equal): Rename from 
15356         'mono_metadata_generic_method_equal' and take MonoGenericContext.
15357         (mono_metadata_generic_context_hash): Likewise from
15358         'mono_metadata_generic_method_hash'.  Change hash function.
15359         (mono_metadata_load_generic_params): Update to changes.
15360         (mono_get_shared_generic_method): Remove.
15361         * metadata-internals.h (mono_get_shared_generic_method): Remove.
15362         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
15363         (inflate_generic_context): Likewise.
15364         (mono_class_inflate_generic_method_full): Likewise.
15365         (setup_generic_array_ifaces): Likewise.
15366         (mono_class_create_from_typespec): Likewise.
15367         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
15368         (method_encode_methodspec): Update callsite.
15369         (reflection_methodbuilder_to_mono_method): Update to changes.
15370         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
15371         MonoGenericContext as the key to the hashtable.
15372         (inflate_mono_method): Update to changes.
15373
15374         * class-internals.h (MonoGenericMethod::container): Remove.
15375         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
15376
15377 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
15378
15379         * profiler-private.h, profiler.c, profiler.h: added API to profile
15380         exception events.
15381
15382 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15383
15384         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
15385
15386 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15387
15388         * verify.c: method invocation is now validated, now we verify parameter types on stack.
15389         Fixed overflow and underflow not aborting the verification process.
15390
15391 2007-06-13  Mark Probst  <mark.probst@gmail.com>
15392
15393         * class-internals.h (MonoStats): Added stats entries for dynamic
15394         code allocations.
15395
15396 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
15397
15398         * loader.c (mono_free_method): Free header->locals and header->clauses.
15399
15400         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
15401         dynamic case.
15402
15403         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
15404
15405         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
15406
15407 2007-06-12  Raja R Harinath  <rharinath@novell.com>
15408
15409         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
15410         the tables.
15411
15412 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15413
15414         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
15415
15416 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15417
15418         MonoGenericMethod on a diet
15419         * class-internals.h (_MonoMethodInflated::reflection_info): Move
15420         here ...
15421         (_MonoGenericMethod::reflection_info): ... from here.
15422         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
15423         Update to changes.
15424         * reflection.c (inflate_mono_method): Likewise.
15425         (mono_reflection_bind_generic_method_parameters): Likewise.
15426
15427 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15428
15429         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
15430         *verify.c: factored long ldarg forms to share code with short forms
15431
15432 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15433
15434         *verify.c: fixed code formating factored some duplicate code
15435         into a new function
15436
15437         *verify.h: fixed binary incompatibility introduced earlier
15438
15439         *pedump.c: fixed formating
15440
15441 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15442
15443         Fix assertion when disassembling Mono.C5.dll
15444         * loader.c (method_from_methodspec): Avoid inflating a method
15445         twice with the same context.  If the methodref is inflated, use
15446         the declaring method instead.
15447
15448         * class.c (mono_class_from_generic_parameter): Fix case similar to
15449         bug #81830 handled below, but for method containers.
15450
15451 2007-06-10  Raja R Harinath  <harinath@gmail.com>
15452
15453         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
15454         get_shared_generic_class.  Directly inflate the instance.
15455         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
15456         (inflate_generic_class): Delete.
15457         (get_shared_generic_class): Delete.  Move setting of
15458         'cached_class' and 'cached_context' ...
15459         * metadata.c (mono_metadata_lookup_generic_class): ... here.
15460
15461         * metadata.c (mono_metadata_lookup_generic_class): Change
15462         signature to take the components of a MonoGenericClass rather than
15463         an allocated MonoGenericClass.  Change semantics to be intern-like.
15464         * reflection.c (mono_class_bind_generic_parameters): Update to
15465         changes.  Make locking region tighter.
15466         * class.c (inflate_generic_class): Update to changes.
15467         (get_shared_generic_class): Likewise.
15468         * metadata-internals.h: Likewise.
15469
15470         * reflection.c (mono_class_bind_generic_parameters): Take and
15471         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
15472         (mono_reflection_bind_generic_parameters): Use
15473         'mono_class_bind_generic_parameters' rather than duplicate the code.
15474         * class.c (mono_bounded_array_class_get): Update to changes.
15475         * object-internals.h: Likewise.
15476
15477         * reflection.c (mono_class_bind_generic_parameters): Only support
15478         parameterizing generic type definitions.  Remove support for other
15479         open types.
15480
15481 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
15482
15483         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
15484
15485         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
15486         in the dynamic case.
15487
15488 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
15489
15490         * threads.c: When cleaning up thread, reset the Background bit.
15491         Fixes bug #81720.
15492
15493 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
15494
15495        * metadata.c: Move variable declarations to top of scope.
15496        * verify.c: Move variable declarations to top of scope.
15497
15498        Code is contributed under MIT/X11 license.
15499
15500 2007-06-08  Raja R Harinath  <rharinath@novell.com>
15501
15502         * reflection.c (mono_class_bind_generic_parameters): Replace
15503         open-coded loop with mono_metadata_inflate_generic_inst.
15504
15505         * class.c (get_shared_generic_class): Don't call
15506         mono_get_shared_generic_inst.  Use the container's own
15507         'class_inst'.
15508
15509         * metadata.c (mono_metadata_load_generic_params): Move
15510         initialization of 'context' field here from ...
15511         * class.c (mono_class_create_from_typedef): ... here, and ...
15512         * loader.c (mono_get_method_from_token): ... here.
15513
15514         * class.c (get_shared_generic_class): Rename from
15515         mono_get_shared_generic_class and make static.
15516         (mono_get_shared_generic_inst): Move to metadata.c.
15517         * loader.c (mono_get_shared_generic_method): Likewise.
15518         * class-internals.h, metadata-internals.h: Update to changes.
15519
15520         Fix #81830
15521         * class.c (mono_class_from_generic_parameter): Don't assume a
15522         generic container owner exists.  Generic containers from monodis
15523         don't have any.
15524
15525 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
15526
15527         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
15528         * verify.h: new typedefs to returns the non-verifiable status
15529         * verify.c: initial implementation of generics, stack merging and object compatibility check
15530
15531 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15532
15533         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15534         a MonoInternalHashTable again (fixed bug in internal hash table
15535         code).
15536
15537 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15538
15539         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15540         MonoInternalHashTable again (fixed bug in internal hash table
15541         code).
15542
15543 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15544
15545         * class.c, image.c, class-internals.h, domain.c,
15546         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
15547         changes.  Have to figure out what makes them break the SWF
15548         regression.
15549
15550 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15551
15552         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15553         a MonoInternalHashTable now.
15554
15555 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15556
15557         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15558         MonoInternalHashTable now.
15559
15560 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
15561
15562         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
15563         invoke_impl code.
15564
15565         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
15566
15567         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
15568         dependent trampoline.
15569
15570         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15571
15572         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
15573
15574 2007-05-29  Robert Jordan  <robertj@gmx.net>
15575
15576         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
15577
15578 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
15579
15580         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
15581
15582 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
15583
15584        * marshal.c: Fix interface lookup loops for
15585        cominterop_get_com_slot_for_method and 
15586        cominterop_get_method_interface. Only need to lookup
15587        if type is a class, else use interface type method is on.
15588
15589        Code is contributed under MIT/X11 license.
15590
15591 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
15592
15593         * reflection.c: HasSecurity can be present even if no specially 
15594         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
15595         SecurityAttribute). Fix CAS regression tests on buildbot.
15596
15597 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
15598
15599        * appdomain.c: Add configure checks for header files.
15600        * image.c: Add configure checks for header files.
15601        * file-io.c: Add configure checks for header files.
15602        * debug-mono-symfile.c: Add configure checks for header files.
15603        * threadpool.c: Add configure checks for header files.
15604        * console-io.c: Add configure checks for header files.
15605        * profiler.c: Add configure checks for header files.
15606        * rawbuffer.c: Add configure checks for header files.
15607        * icall.c: Add configure checks for header files.
15608        * rand.c: Add configure checks for header files.
15609        * socket-io.c: Add configure checks for header files.
15610
15611        Code is contributed under MIT/X11 license.
15612
15613 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
15614
15615         * reflection.c (mono_custom_attrs_from_builders): Remove the 
15616         assertion as it breaks the build.
15617         
15618         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
15619
15620         * reflection.c (lookup_custom_attr): Make a copy here too.
15621
15622         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
15623         dynamic images.
15624
15625         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
15626         images.
15627
15628         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
15629         info.
15630
15631 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
15632
15633         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
15634         (load_cattr_value): Ditto.
15635
15636 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
15637
15638         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
15639
15640 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
15641
15642         * threads.c: In "start_wrapper", set apartment_state to MTA if
15643         apartment_state is Unknown and we're running on 2.0 profile or
15644         higher.
15645         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
15646         to main method, then set apartment_state to Unknown on 1.0 profile,
15647         and MTA on 2.0 profile.
15648
15649 2007-05-16  Jb Evain  <jb@nurv.fr>
15650
15651         * class-internals.h (MonoDefaults): Add an attribute_class and
15652           customattribute_data_class.
15653         * domain.c (mono_init_internal): Populate them.
15654         * reflection.c: Use them to remove duplicates. Make a vew
15655         MonoClass variables `static'.
15656
15657 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
15658
15659         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
15660         step in implementing IMT, so that all isinst checks now can go
15661         through the bitmap.
15662         This was needed because vtables for TransparentProxy need to look
15663         like the vtable of the "target" class, so they need to point to
15664         its interface bitmap directly.
15665
15666         * object.c: inside "mono_class_create_runtime_vtable" and
15667         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
15668
15669 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
15670
15671         * object-internals.h
15672           culture-info.h : added territory field in MonoCulture and
15673           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
15674         * locales.c : fill territory field above too.
15675         * culture-info-table.h : regenerated.
15676
15677 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
15678
15679         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
15680         Fixes #81599.
15681
15682 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
15683
15684         * object.c: Always initialize apartment, even if 
15685         there is no custom attributes on entry point.
15686         
15687         Code is contributed under MIT/X11 license.
15688
15689 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
15690
15691         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
15692         * metadata.c: If no encoding is set, check for unicode
15693         on class.
15694         
15695         Code is contributed under MIT/X11 license.
15696
15697 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15698
15699         * threads.c: Handle if mono_thread_current returns NULL 
15700         
15701         Code is contributed under MIT/X11 license.
15702
15703 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15704
15705         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
15706         in start_wrapper. Added mono_thread_init_apartment_state and
15707         mono_thread_cleanup_apartment_state.
15708         * object.c: Initialize thread apartment state on main thread
15709         by checking for STAThreadAttribute on entry point.
15710         * object-internals.h: Add apartment_state field to MonoThread.
15711         * threads-types.h: Add unmanaged definition of 
15712         System.Threading.ApartmentState, MonoThreadApartmentState.
15713         
15714         Code is contributed under MIT/X11 license.
15715         
15716 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
15717
15718         * class.c: Fix windows build.
15719         * class-internals.h: Fix windows build.
15720         
15721         Code is contributed under MIT/X11 license.
15722
15723 2007-05-08  Robert Jordan  <robertj@gmx.net>
15724
15725         * process.c (CreateProcess_internal):
15726         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
15727         .CreateNoWindow was specified. Fixes #81496.
15728
15729 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15730
15731         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
15732         step in implementing IMT, replaced it with two compact arrays
15733         (interfaces_packed and interface_offsets_packed) and a bitmap that
15734         is used for isinst checks (interface_bitmap).
15735
15736         * class.c: (compare_interface_ids): compare function to pass to
15737         bsearch when looking for an interface with a given id.
15738         (mono_class_interface_offset): reimplemented using bsearch on
15739         interfaces_packed, getting the offset from interface_offsets_packed.
15740         (print_implemented_interfaces): utility debugging function.
15741         (setup_interface_offsets): reworked to initialize interfaces_packed,
15742         interface_offsets_packed and interface_bitmap.
15743
15744         * object.c: replaced all accesses to "MonoClass.interface_offsets"
15745         with uses of interfaces_packed and interface_offsets_packed.
15746
15747 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15748
15749         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
15750         mono_class_interface_offset prototype to wrap all accesses to
15751         "MonoClass.interface_offsets".
15752
15753         * class.c: Implemented mono_class_interface_offset, and wrapped all
15754         accesses to "MonoClass.interface_offsets".
15755
15756         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
15757         "MonoClass.interface_offsets".
15758
15759 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
15760
15761         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
15762         GetMethodFromHandle overloads (bug #78637).
15763
15764 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
15765
15766         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
15767         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
15768
15769 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
15770
15771         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
15772         #81498.
15773
15774         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
15775         gracefully.
15776         (mono_custom_attrs_from_index): Ditto.
15777
15778         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
15779         Fixes #81501.
15780
15781 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
15782
15783         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
15784         is now allocated from a mempool.
15785
15786 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
15787
15788         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
15789         caller holds threads_lock, leading to deadlocks. Fixes #81476.
15790
15791 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
15792
15793         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
15794         mono_loader_clear_error () too late. Fixes #81463.
15795
15796 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
15797
15798         * culture-info-table.h : regenerated.
15799
15800 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
15801
15802         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
15803         is missing.
15804
15805 2007-04-25  Dick Porter  <dick@ximian.com>
15806
15807         * Makefile.am: Put the mingw enforced-optimisation back into the
15808         PLATFORM_WIN32 section.
15809
15810 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
15811
15812         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
15813         patch.
15814
15815         * image.c (mono_image_load_module): New API function to load a module reference.
15816
15817         * image.c (load_modules): Load modules lazily. Fixes #80812.
15818
15819         * class.c (mono_class_from_typeref): Use mono_image_load_module.
15820         
15821         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
15822
15823         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
15824         to mono_image_load_module_dynamic.
15825
15826 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
15827
15828         * marshal.c: Fix calling convention for CCW on non-windows
15829         platforms. STDCALL on windows, CDECL everywhere else to work 
15830         with XPCOM and MainWin COM.
15831         
15832         Code is contributed under MIT/X11 license.
15833
15834 2007-04-23  Martin Baulig  <martin@ximian.com>
15835
15836         Fix #80969.
15837
15838         * loader.c
15839         (method_from_memberref): Added `gboolean *used_context' argument.
15840         (mono_get_method_from_token): Likewise.
15841         (mono_get_method_full): Don't insert the method in the cache when
15842         `used_context' is true.
15843
15844 2007-04-23  Raja R Harinath  <rharinath@novell.com>
15845
15846         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
15847
15848         * reflection.c (mono_reflection_bind_generic_parameters): Don't
15849         create new MonoTypes for returned types.
15850         * class.c (mono_generic_class_get_class): Export mono-internal.
15851         * class-internals.h: Update to changes.
15852
15853 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
15854
15855         * threadpool.c, threadpool.h, icall-def.h: patch from
15856         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
15857
15858 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
15859
15860         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
15861         
15862         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
15863
15864         * threads.c (mono_thread_get_stack_bounds): New helper function.
15865
15866         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
15867         Correctly compute stack bounds when attaching. Fixes #81394.
15868
15869 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
15870
15871         * reflection.c: fix handling of doubles in custom attributes
15872         for the arm-fpa format (bug #81368).
15873
15874 2007-04-18  Raja R Harinath  <rharinath@novell.com>
15875
15876         * reflection.c (assembly_add_win32_resources): Mildly relax an
15877         bounds check to let the end pointer point just past the end of the
15878         allocated buffer.  (may fix #81384)
15879
15880 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
15881
15882         * culture-info-table.h : regenerated.
15883
15884 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
15885
15886         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
15887         the thread is aborted early.
15888
15889 2007-04-05  Dick Porter  <dick@ximian.com>
15890
15891         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
15892         FindFirstFile()/FindNextFile() to find entries.  This lets the
15893         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
15894         81038.
15895
15896         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
15897         the parameters of
15898         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
15899
15900 2007-04-04  Martin Baulig  <martin@ximian.com>
15901
15902         * debug-helpers.c
15903         (mono_method_desc_full_match): Add support for nested classes.
15904
15905 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
15906
15907         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
15908
15909 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
15910
15911         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
15912         waiting for too many threads.
15913
15914 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
15915
15916         * environment.c: Fix return value check on uname so we can get the 
15917         executing version on Solaris operating systems.
15918
15919 2007-03-28  Jb Evain  <jbevain@gmail.com>
15920
15921         * class.c (mono_type_get_name_recurse): Complete the
15922         fix for the creation of assembly qualified names for
15923         pointer types. Fixes #81208.
15924
15925 2007-03-27  Dick Porter  <dick@ximian.com>
15926
15927         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
15928         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
15929         changed.
15930
15931         * threads.c
15932         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
15933         the value of ReleaseMutex().
15934
15935 2007-03-27  Dick Porter  <dick@ximian.com>
15936
15937         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
15938         in little-endian order, not network endian, so must be converted
15939         to host endian here.  Fixes bug 80593.
15940
15941 2007-03-22  Jb Evain  <jbevain@gmail.com>
15942
15943         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
15944         qualified names for pointer types. Fixes #81208.
15945
15946 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
15947
15948         * marshal.c: Add support for PreserveSigAttribute. 
15949         
15950         Code is contributed under MIT/X11 license.
15951
15952 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
15953
15954         * process.c: Fix endianness issues. Fixes #81126.
15955
15956         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
15957         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
15958
15959         * image.c (mono_image_lookup_resource): Make this work on big-endian
15960         machines.Change API contract so the caller needs to free the return value.
15961         
15962         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
15963         API change.
15964         
15965 2007-03-14  Martin Baulig  <martin@ximian.com>
15966
15967         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
15968         mono_type_get_desc() as well.
15969
15970 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
15971
15972         * icall.c:  Fix environ access in VS.  
15973         
15974 2007-03-13  Alp Toker  <alp@atoker.com>
15975
15976         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
15977         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
15978         #63841.
15979
15980 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
15981
15982         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
15983         circular references among dynamic methods. Fixes #81091.
15984
15985         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
15986
15987 2007-03-09  Martin Baulig  <martin@ximian.com>
15988
15989         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
15990
15991 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
15992
15993         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
15994         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
15995         
15996         Code is contributed under MIT/X11 license.
15997         
15998 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
15999
16000         * loader.c: Reapply patch for bug #79424.
16001
16002 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
16003
16004         * metadata.c (mono_type_to_unmanaged): Only convert object to
16005         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
16006
16007 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
16008
16009         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
16010         (and incorrectly set) is_reference field from MonoGenericInst.
16011
16012 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
16013
16014         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
16015         a little earlier.
16016
16017         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
16018
16019         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
16020
16021 2007-03-05  Miguel de Icaza  <miguel@novell.com>
16022
16023         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
16024         FileOptions.1 value to mean "temporary", map that to
16025         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
16026
16027         Fixes 80688
16028
16029 2007-03-03  Marek Habersack  <mhabersack@novell.com>
16030
16031         * appdomain.c: implement MS .Net style shadow copying. Copies of
16032         the assemblies are made in a subdirectory of the dynamic base
16033         directory, the assembly names are preserved.
16034         Copy .mdb and .config files along with the assemblies being shadowed.
16035
16036 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
16037
16038         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
16039         (emit_marshal_handleref): Ditto.
16040
16041         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
16042         on Visual C++. Fixes #80671.
16043
16044 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
16045
16046         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
16047         for clone operations.
16048
16049 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
16050
16051         * marshal.c: Fix warnings.
16052
16053 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
16054
16055         * loader.c: allow case-insensitive matching of the dll name
16056         in dllmap handling when prefixed with "i:".
16057
16058 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
16059
16060         * threads.c: Fix #ifdef for dummy_apc function for VS.
16061
16062 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
16063
16064         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
16065
16066 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
16067         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
16068         giving precedence to the methods with a fully qualified name
16069         (InterfaceName.MethodName) when building the interface sections
16070         of the vtable.
16071
16072 2007-02-16  Dick Porter  <dick@ximian.com>
16073
16074         * threadpool.c (append_job): Fix fast-path array handling, so it's
16075         less likely the array will grow exponentially when the load is
16076         heavy.
16077
16078 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
16079
16080         * metadata-internals.h, loader.c: fix dllmap lookup order
16081         for non-function maps, too, and prepare for fallback code.
16082
16083 2007-02-12  Robert Jordan  <robertj@gmx.net>
16084
16085         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
16086         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
16087         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
16088         GlobalFree. Fixes a part of bug #77075.
16089
16090 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
16091
16092         * loader.c: implemented typedef parent in field memberref.
16093
16094 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
16095
16096         * marshal.c: Fix warnings and remember to call Release on
16097         IUnknown of RCW.
16098         
16099         Code is contributed under MIT/X11 license.
16100
16101 2007-02-10  Miguel de Icaza  <miguel@novell.com>
16102
16103         * class-internals.h: Add MonoHandleRef definition, and
16104         handleref_class to mono_defaults. 
16105
16106         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
16107         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
16108
16109         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
16110         (do nothing on this stage)
16111         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
16112         (emit_marshal_handleref): New method, used for argument handling
16113         of HandleRefs. 
16114
16115 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
16116
16117         * class.c (mono_class_setup_parent): Lazily init com types.
16118         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
16119         init com types.
16120         * object.c (mono_remote_class_vtable): Lazily init com types.
16121         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
16122         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
16123         * domain-internals.h: Expose mono_init_com_types.
16124         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
16125         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
16126         Add support for COM Callable Wrapper marshalling.
16127         * marshal.h: Add icall definitions.
16128         * gc.c: Handle freeing of CCWs in finalizer code.
16129         
16130         Code is contributed under MIT/X11 license.
16131
16132 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
16133
16134         * reflection.c: changed all the signature encoding code to use
16135         a variable-sized buffer.
16136
16137 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
16138
16139         * marshal.c: locking fixes: never take the loader lock
16140         or other runtime locks when holding the marshal lock
16141         (fixes bug#80664).
16142
16143 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
16144
16145         * marshal.c: make the delegate function pointer mapping
16146         work for the moving GC.
16147
16148 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
16149
16150         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
16151         for bug #80618.
16152
16153 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
16154
16155         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
16156         gmodule.
16157
16158 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
16159
16160         * threadpool.c: made the code moving-GC safe.
16161
16162 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
16163
16164         * assembly.c, boehm-gc.c, class-internals.h, class.c,
16165         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
16166         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
16167         warning cleanup.
16168         * reflection.c: warning cleanup, some threading and moving GC fixes.
16169
16170 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
16171
16172         * class.c, loader.c: create the needed Set/Get/Address array methods
16173         as well as the .ctors in mono_class_init (), fixes bug #80567.
16174
16175 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
16176
16177         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
16178         we doesn't decrease its alignment. Should fix the sparc build.
16179
16180 2007-01-24  Dick Porter  <dick@ximian.com>
16181
16182         * socket-io.c
16183         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
16184         Create the returned object if we need to ignore an unsupported
16185         socket option.  Fixes a segfault reported by Atsushi.
16186
16187 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
16188
16189         * class.c, object.c: restrict GC-tracked fields to
16190         UIntPtr fields used inside corlib, so we provide better
16191         type info to the GC and also allow broken packing as in
16192         bug #80580.
16193
16194 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
16195
16196         * sgen-gc.c: removed duplicated function.
16197
16198 2007-01-19  Miguel de Icaza  <miguel@novell.com>
16199
16200         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
16201         value that means that the value is not supported, but that we
16202         should not return a failure, but instead report this as a
16203         successful operation.
16204
16205 2007-01-19  Raja R Harinath  <rharinath@novell.com>
16206
16207         Fix tests/bug79956.2.il
16208         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
16209         (mono_generic_class_get_class): If the generic definition in an
16210         enum, copy over other fields related to it.
16211
16212 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
16213
16214         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
16215         genericinst enums (bug #79215).
16216
16217 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
16218         * class.c: Fix bug 80307.
16219
16220 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
16221
16222         * image.c: if the file table is not present, try to load
16223         all the modules, since we don't have info about them
16224         having or not metadata (bug #80517).
16225         * assembly.c: allow mono_assembly_load_references () to
16226         work for netmodules.
16227
16228 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
16229
16230         * image.c, metadata-internals.h, object.c: execute module
16231         cctors when running on the 2 runtime if present (bug #80487).
16232
16233 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
16234
16235         * icall.c: optimized InitializeArray() on bigendian.
16236
16237 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
16238
16239         * icall.c: fix for the broken ARM FPA double format.
16240
16241 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
16242
16243         * icall.c: handle endian issues for r4 and r8 types, too, in
16244         the InitializeArray() icall.
16245
16246 2007-01-15  Miguel de Icaza  <miguel@novell.com>
16247
16248         * loader.c (mono_loader_error_prepare_exception): Clear the error
16249         once we have extracted the information from it, do this before we
16250         call into the JIT's class loading mechanisms.
16251
16252         * object.c (mono_class_create_runtime_vtable): Do not clear the
16253         loader error before calling mono_class_get_exception_for_failure
16254         as the loader error is needed inside
16255         mono_class_get_exception_for_failure to throw the error (thinko).
16256
16257         Fixes #80521
16258         
16259 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
16260
16261         * reflection.c: align fields rva data so it's faster to load at
16262         runtime.
16263
16264 2007-01-12  Raja R Harinath  <rharinath@novell.com>
16265
16266         Prepare to simplify GenericMethod handling.
16267         * class-internals.h (mono_method_get_context): New accessor function.
16268         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
16269         rather than directly accessing '->context' field.
16270
16271         * class-internals.h (_MonoGenericParam.method): Move ...
16272         (_MonoGenericContainer): ... here.  Add into union with klass field.
16273         * class.c, icall.c, loader.c, metadata.c, reflection.c:
16274         Update to changes.
16275
16276 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
16277
16278         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
16279         the wrapper type enum and reduce relocations.
16280
16281 2007-01-12  Raja R Harinath  <rharinath@novell.com>
16282
16283         * reflection.c (inflate_mono_method): Reuse method instantiation
16284         from the generic method, if available.
16285
16286 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16287
16288         * marshal.c (emit_marshal_variant): Fix conv_arg
16289         type in last commit, based on whether parameter is byref.
16290         
16291 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16292
16293         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
16294         marshalling.
16295         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
16296         MONO_TYPE_OBJECT back for VARIANT support.
16297
16298 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16299
16300         * marshal.c, marshal.h, icall-def.h: Implement 
16301         Marshal.ReAllocCoTaskMem.
16302
16303 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
16304
16305         * marshal.c: memory retention fixes: use the proper
16306         image cache for runtime_invoke method lookups.
16307
16308 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
16309
16310         * mempool.c: added code to help debug mempool allocations.
16311
16312 2007-01-11  Dick Porter  <dick@ximian.com>
16313
16314         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
16315         support (experimenting with faking it with IP_MTU_DISCOVER for
16316         systems that don't have IP_DONTFRAGMENT.)
16317         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
16318         icall.
16319
16320         * icall-def.h: new System.Net.Sockets.Disconnect icall.
16321
16322         * socket-io.h: Add new fields to MonoSocketAsyncResult
16323         corresponding to the new ones in Socket.cs.
16324
16325 2007-01-11  Raja R Harinath  <rharinath@novell.com>
16326
16327         Fix IronPython regression mentioned in #80249
16328         * metadata.c (do_mono_metadata_parse_generic_class): Clear
16329         'cached_context' field, since it may have been initialized as a
16330         side-effect of metadata parsing.
16331
16332         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
16333         (_MonoGenericClass.cached_class): Move here and rename from lone
16334         remaining field of ...
16335         (_MonoInflatedGenericClass): ... this.  Remove.
16336         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
16337         to changes.
16338
16339         Fix mcs/tests/test-128.cs regression.
16340         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
16341         2007-01-10 change below.
16342         [MONO_TYPE_OBJECT]: Recurse into array case.
16343
16344 2007-01-11  Raja R Harinath  <harinath@gmail.com>
16345
16346         * class-internals.h (mono_get_inflated_generic_class): Remove.
16347         * class.c (mono_get_inflated_generic_class): Remove.
16348         (mono_generic_class_get_class): Rename from
16349         mono_class_create_generic.
16350         (mono_class_from_mono_type) [GENERICINST]: Use it.
16351         * reflection.c, metadata.c: Update to changes.  Use
16352         'mono_class_from_mono_type'.
16353
16354 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
16355
16356         * reflection.c: use passed type when encoding an array element
16357         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
16358
16359 2007-01-09  Robert Jordan  <robertj@gmx.net>
16360
16361         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
16362         result arguments (someDelegate.EndInvoke (unrelatedAres)).
16363         Fixes bug #80392.
16364
16365 2007-01-09  Raja R Harinath  <rharinath@novell.com>
16366
16367         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
16368
16369         * object.c (set_value): Avoid aliasing between type->data.klass
16370         and type->data.generic_class.
16371
16372         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
16373
16374 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16375
16376         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
16377         between type->data.klass and type->data.generic_class.
16378
16379 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
16380
16381         * marshal.c: In MS.NET, StringBuilder objects are not copied by
16382         value in out parameters.
16383
16384 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16385
16386         Simplify invariant for MonoGenericClass::klass field.
16387         * class.c (mono_class_create_generic): Verify 'klass' is null.
16388         * metadata.c (do_mono_metadata_parse_generic_class): Don't
16389         initialize 'klass' field.
16390
16391 2007-01-05  Raja R Harinath  <rharinath@novell.com>
16392
16393         Ongoing work to avoid redundant data and simplify invariants.
16394         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
16395         'generic_class', and change type to a GenericInst.
16396         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
16397         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
16398
16399 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
16400
16401         * class.c : skip io-layer under PLATFORM_WIN32.
16402
16403 2007-01-03  Tor Lillqvist  <tml@novell.com>
16404
16405         Fix #80305: In a bundled executable, look in the bundled exe
16406         assembly to determine the runtime version. Add the possibility to
16407         bundle also the machine.config file.
16408         
16409         * assembly.c (mono_assembly_open_from_bundle): Make
16410         non-static. Allow being called even if we have no bundled
16411         assemblies, and return NULL right away in that case.
16412
16413         * domain-internals.h: Declare mono_assembly_open_from_bundle()
16414         here.
16415
16416         * domain.c (app_config_parse): Take an assembly exe file name as
16417         parameter instead of a config file name. Check for a bundled
16418         config file for that assembly by calling
16419         mono_config_string_for_assembly_file() (see below) before looking
16420         for one in the file system.
16421         (get_runtimes_from_exe): Corrsponding change to call of
16422         app_config_parse().
16423         (get_runtimes_from_exe): Check for bundled assembly exe file first
16424         by calling mono_assembly_open_from_bundle(). If no bundled
16425         assembly exe file is found, call mono_image_open() as before to
16426         look it up in the file system.
16427
16428         * mono-config.c: Add variable bundled_machinec_onfig.
16429         (mono_config_string_for_assembly_file): New function.
16430         (mono_config_for_assembly): Move code snippet that looks for a
16431         bundled assembly .config file into the above new function. Call
16432         it.
16433         (mono_register_machine_config, mono_get_machine_config): New
16434         functions to set and retrieve
16435
16436         * assembly.h: Declare mono_register_machine_config().
16437
16438         * mono-config.h: Declare mono_get_machine_config() and
16439         mono_config_string_for_assembly_file().
16440
16441         * icall.c: No declaration of environ necessary on Win32. It is
16442         declared (as a macro expanding to a function call) in stdlib.h.
16443         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
16444         New internal mono function. Returns the value of
16445         mono_get_machine_config() as a Mono string.
16446
16447         * icall-def.h: Add get_bundled_machine_config().
16448
16449 2007-01-04  Raja R Harinath  <rharinath@novell.com>
16450
16451         Remove redundant field
16452         * class-internals.h (_MonoGenericContext.container): Remove field.
16453         * loader.c (mono_method_get_signature_full): Don't parse a
16454         "container" for a signature parse when the signature is inflated
16455         immediately.
16456         (method_from_methodspec): Likewise, for a generic_inst.
16457         * class.c, metadata.c, reflection.c: Update to changes.
16458
16459 2006-01-04  Raja R Harinath  <rharinath@novell.com>
16460
16461         * class-internals.h (_MonoGenericClass): Rename 'context' field to
16462         'cached_context', and change semantics -- it starts off NULL, and
16463         is initialized on demand.
16464         * class.c (mono_generic_class_get_context): New accessor to
16465         replace 'context' field accesses.
16466         (mono_class_get_context): New helper.
16467         (*): Update to changes.
16468         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
16469
16470 2007-01-03  Miguel de Icaza  <miguel@novell.com>
16471
16472         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
16473         before the memcpy.   Fixes Marshal2 regression.
16474
16475 2007-01-02  Jb Evain  <jbevain@gmail.com>
16476
16477         * blob.h: add a MONO_TYPE_ENUM definition
16478         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
16479         fix the encoding of arrays of enums in custom attributes.
16480
16481         Fixes #79666.
16482
16483 2007-01-01  Miguel de Icaza  <miguel@novell.com>
16484
16485         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
16486         string is null terminated, but only cut the string short if it
16487         overflows the buffer.   
16488         
16489         (mono_string_to_byvalstr): Also fix this routine.   The code here
16490         was not properly terminating a string (it was only terminated
16491         because of the previous catch-all memset). 
16492
16493         I left the memset, because I do not know if applications expect
16494         the runtime to clear this region. 
16495
16496         Fixes #79944.
16497
16498         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
16499         Clear the error before returning to unmanaged code to prevent the
16500         runtime from being confused later on (fixes  80420).
16501         (ves_icall_type_from_name): Always call mono_loader_clear_error
16502         after parsing a type that could have failed.
16503         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
16504
16505         * loader.c (mono_loader_clear_error): Fix indentation.
16506
16507 2006-12-28  Martin Baulig  <martin@ximian.com>
16508
16509         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
16510
16511 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
16512
16513         * reflection.c: patch from Rolf Bjarne Kvinge to fix
16514         getting a token for an EnumBuilder.
16515
16516 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
16517
16518         * reflection.c: be more careful in case resource generation
16519         fails to create the data array.
16520
16521 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
16522
16523         * sgen-gc.c: write barrier for clone and fix unregister handles.
16524
16525 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
16526
16527         * reflection.c: some fixes needed in the generics code for the moving GC.
16528
16529 2006-12-22  Robert Jordan  <robertj@gmx.net>
16530
16531         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
16532         account. Fixes bug #80299.
16533
16534 2006-12-21  Raja R Harinath  <rharinath@novell.com>
16535
16536         Fix WaitHandle usage in delegates.
16537         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
16538         * object.c (mono_wait_handle_new): Use the property set method to
16539         initialize the handle.
16540         (mono_wait_handle_get_handle): New.
16541         * threadpool.c (mono_async_invoke): Use it.
16542         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
16543         Likewise.
16544         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
16545
16546 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
16547
16548         * marshal.c (emit_marshal): Call emit_marshal_variant and
16549         emit_marshal_com_interface when applicable.
16550         (emit_marshal_variant, emit_marshal_com_interface): Add
16551         methods for this case and remove if's from emit_marshal_object.
16552         
16553 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
16554
16555         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
16556
16557 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
16558
16559         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
16560         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
16561         and GlobalFree on Windows. Remove FIXME.
16562
16563 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
16564
16565         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
16566         implementation for managed objects.
16567
16568 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
16569
16570         * object.c: implemented code to be used for checking
16571         that no reference field overlaps with non-references.
16572
16573 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16574
16575         * threadpool.c: fix queue code to be compatible with the
16576         moving GC.
16577
16578 2006-12-18  Miguel de Icaza  <miguel@novell.com>
16579
16580         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
16581         in structures by throwing ArgumentNullException.
16582
16583         (emit_marshal_safehandle): Also when they are null parameters.
16584
16585         (emit_marshal_safehandle): Add support for ref
16586         SafeHandles parameters
16587
16588 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16589
16590         * profiler.c: updated to use the mono-dl API instead of
16591         gmodule.
16592
16593 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16594
16595         * profiler.c: updated to use the mono-dl dynamic loading
16596         API instead of gmodule.
16597
16598 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
16599
16600         * profiler.c: use readlink, older versions of glib don't have
16601         g_file_read_link ().
16602
16603 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16604
16605         * profiler.c: try to detect the path to mono if libc fails to provide
16606         a useful name (bug #80286).
16607
16608 2006-12-16  Raja R Harinath  <rharinath@novell.com>
16609
16610         Fix #80242
16611         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
16612         instance, use the generic type definition instead.
16613         (ves_icall_Type_GetNestedTypes): Likewise.
16614         * class.c (mono_class_create_generic): Always set the
16615         nested_classes of a generic instance to NULL, even if the generic
16616         type definition has nested types.
16617
16618 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
16619
16620         * marshal.c (mono_string_from_bstr): Revert previous Windows change
16621         and fix on Linux.
16622         
16623 2006-12-15  Miguel de Icaza  <miguel@novell.com>
16624
16625         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
16626         my arguments were in the wrong order.   I also fixed the Windows
16627         version which seems to have had the same issue.
16628
16629         (mono_free_bstr): On Unix, this is g_free.
16630         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
16631         conversions (for the tests in corlib to pass).
16632
16633 2006-12-14  Miguel de Icaza  <miguel@novell.com>
16634
16635         * marshal.c (emit_ptr_to_object_conv): For now, ignore
16636         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
16637         exception if a ref SafeHandle in a struct has changed).
16638         
16639         (emit_struct_conv): Do not perform layout checks for classes
16640         derived from SafeHandle, as those are specially handled. 
16641
16642         (emit_object_to_ptr_conv): Add support for
16643         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
16644
16645         (emit_marshal_safehandle): Implement conversion of return values
16646         of safehandles (MARSHAL_ACTION_CONV_RESULT).
16647         
16648         * threads.c: WaitHandle now is compiled with two different handles
16649         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
16650         for 2.0.
16651         
16652         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
16653         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
16654         these routines to cope with both kinds of fields.
16655
16656 2006-12-12  Miguel de Icaza  <miguel@novell.com>
16657
16658         * metadata.c (mono_type_to_unmanaged): Handle the case where
16659         type->data.klass is a SafeHandle, and in that case, return the
16660         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
16661         MONO_MARSHAL_CONV_SAFEHANDLE. 
16662
16663 2006-12-11  Miguel de Icaza  <miguel@novell.com>
16664
16665         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
16666         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
16667         calling emit_marshal_object.
16668
16669         (emit_marshal_safehandle): Implement marshalling of
16670         SafeHandle parameters (no ref support yet).
16671
16672         (MarshalAction): Document the defines as I implement
16673         them for SafeHandle.
16674
16675         (emit_marshal_object): indentation police.
16676
16677         * class-internals.h: Define MonoSafeHandle.
16678         Add safehandle_class to MonoDefaults type.
16679
16680         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
16681         list of classes to check for fields. 
16682
16683         * domain.c (mono_init_internal): Add SafeHandle to the list of
16684         mono_defaults loaded.
16685
16686 2006-12-15  Raja R Harinath  <rharinath@novell.com>
16687
16688         Fix #80253
16689         * reflection.c (mono_reflection_bind_generic_parameters): If the
16690         generic type definition is a type builder, ensure that it is fully
16691         initialized before instantiating it.  Kill some dead code.
16692
16693 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
16694
16695         * object.c: clear the loader_error () before loading
16696         more metadata stuff (bug #80258).
16697
16698 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
16699
16700         * icall.c, icall-defs.h: type modifiers icalls for
16701         parameters and properties.
16702
16703 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
16704
16705         * object.c, icall.c: fixed warnings.
16706
16707 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16708
16709         * marshal.c: fixed a couple of leaks and coding style in a few places.
16710
16711 2006-12-08  Dick Porter  <dick@ximian.com>
16712
16713         * process.c: Cope with NULL ProcessStartInfo arguments on windows
16714         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
16715         80173.
16716
16717 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
16718
16719         * process.c: ProcessStartInfo may have only filename set and
16720         arguments can be NULL.
16721
16722 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16723
16724         * icall.c: fix leak found by Robert Jordan.
16725
16726 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16727
16728         * marshal.c, marshal.h: generate managed method to access an element
16729         of a multi-dimensional array.
16730
16731 2006-11-30  Paolo Molaro (lupus@ximian.com)
16732
16733         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
16734
16735 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16736
16737         * icall.c: back out GetFields () fix until the serialization code is
16738         fixed to not depend on the incorrect behaviour.
16739
16740 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
16741
16742         * profiler.c: provide defaults if none are set.
16743
16744 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
16745
16746         * Makefile.am, attrdefs.h: new public header file with
16747         constants for attributes for use by embedders.
16748
16749 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
16750
16751         * icall.c: GetFields () fix for bug #80064.
16752
16753 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
16754
16755         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
16756         removed long unused icalls.
16757
16758 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
16759   
16760         * marshal.c: 
16761                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
16762                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
16763                 can be generated without a delegate class.
16764                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
16765         
16766         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16767
16768 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16769
16770         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
16771         #80069.
16772
16773 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16774
16775         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
16776         icall-def.h: added icalls needed by System.GC.
16777
16778 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
16779
16780         * loader.c: ensure the class in catch clauses is handled
16781         correctly for generics methods (fixes bug#79980).
16782
16783 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
16784
16785         * monitor.h, monitor.c: added mono_locks_dump () function
16786         to help debug deadlocks involving managed locks.
16787
16788 2006-11-13  Dick Porter  <dick@ximian.com>
16789
16790         * file-io.c (get_file_attributes): If the file is a symlink try
16791         and get the stat data for the target, but also add the
16792         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
16793         the specs for the windows symlink support, but will probably have
16794         to be reworked when I have test data from a vista machine.  Fixes
16795         bug 79887.
16796
16797 2006-11-13  Dick Porter  <dick@ximian.com>
16798
16799         * gc.c (mono_domain_finalize): 
16800         * marshal.c (mono_delegate_begin_invoke): 
16801         * threadpool.c (socket_io_init, mono_thread_pool_init)
16802         (mono_thread_pool_finish): 
16803         * monitor.c (mono_monitor_try_enter_internal): 
16804         * threads.c (mono_thread_resume, mono_thread_init)
16805         (mono_thread_suspend_all_other_threads)
16806         (mono_thread_execute_interruption): 
16807         * appdomain.c (mono_domain_unload): Check for NULL error returns
16808         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
16809         75733.
16810
16811 2006-11-11  Miguel de Icaza  <miguel@novell.com>
16812
16813         * process.c
16814         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
16815         Only close the handle if the value of the handle is not
16816         INVALID_HANDLE_VALUE.  This just makes the process a bit more
16817         robust.
16818
16819         Improvement for #75733, so that we do not run into this problem. 
16820
16821         
16822         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
16823         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
16824         internal variables.  Fixes #79462 
16825         
16826
16827 2006-11-09  Dick Porter  <dick@ximian.com>
16828
16829         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16830         Use poll() not select().  Fixes bug 79397.
16831
16832 2006-11-09  Raja R Harinath  <rharinath@novell.com>
16833
16834         Fix #79872
16835         * assembly.c (mono_assembly_load_from_full): Check that the given
16836         image has an assembly manifest.
16837
16838 2006-11-09  Ankit Jain  <jankit@novell.com>
16839
16840         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
16841         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
16842         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
16843
16844 2006-11-07  Dick Porter  <dick@ximian.com>
16845
16846         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16847         Put the old resolver behaviour back for pre-2.0 profiles.
16848
16849 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
16850
16851         * threadpool.c: precise GC and locking fixes.
16852
16853 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
16854
16855         * class.c: don't load types that have an explicit unaligned
16856         managed reference. Provide better info in the TypeLoad exception.
16857         Part of the fix for bug #79744.
16858         * object.c: use the correct check for class type load issues.
16859
16860 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
16861
16862         * class.c: enforce alignment of fields with managed references
16863         even when Pack=1 is forced by the user (bug #77788).
16864
16865 2006-11-03  Dick Porter  <dick@ximian.com>
16866
16867         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16868         If the address reverse lookup fails, return it as the hostname
16869         anyway.  Fixes bug 79721.
16870
16871 2006-11-03  Dick Porter  <dick@ximian.com>
16872
16873         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
16874         Fix build on Windows.
16875
16876 2006-11-02  Dick Porter  <dick@ximian.com>
16877
16878         * icall-def.h: 
16879         * object-internals.h: 
16880         * exception.c (mono_get_exception_thread_interrupted): 
16881         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
16882         Fixes bug 74525.
16883
16884         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
16885         Check for pending Thread.Interrupt.
16886
16887 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
16888         * loader.c: Fixed bug 79684.
16889
16890 2006-10-27  Dick Porter  <dick@ximian.com>
16891
16892         * file-io.c (get_file_attributes): Force symlinks to directories
16893         to be returned as a regular file.  Fixes bug 79733.
16894 2006-10-26  Dick Porter  <dick@ximian.com>
16895
16896         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
16897         CreateFile to open a directory then we need to set the
16898         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
16899
16900 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
16901
16902         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
16903         friends.
16904
16905 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16906
16907         * sgengc.c: small cleanup of timer code.
16908
16909 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16910
16911         * sgen-gc.c: fix some warnings and start adding support for
16912         complete object removal on domain unload.
16913
16914 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
16915
16916         * assembly.c: build_assembly_name should not consider a version
16917         number without build or revision number invalid. Fixes bug #79715.
16918
16919 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
16920
16921         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
16922         call kernel32 function OutputDebugString directly.
16923         
16924         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16925         
16926 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
16927
16928         * reflection.c: small cleanup, using a function to insert a MonoString
16929         in the string heap.
16930
16931 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
16932
16933         * reflection.c: moving GC fixes.
16934
16935 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
16936
16937         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
16938         all the objects with finalizers belonging to an unloading appdomain.
16939
16940 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
16941
16942         * sgen-gc.c: added ability to allocate even when the nursery is fully
16943         pinned and fixed a couple of bugs.
16944
16945 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16946
16947         * threads.h: Revert the last change for now.
16948
16949         * threads.h (mono_thread_get_pending_exception): Rename this to
16950         mono_thread_get_undeniable_exception ().
16951
16952 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
16953
16954         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
16955         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
16956         when fname does not refer to valid assembly. This result in a more
16957         meaningful error message.
16958         * exception.c: added mono_get_exception_bad_image_format2 which 
16959         constructs a BadImageFormatException using the ctor taking a custom
16960         message and the file name. Passing in a NULL msg results in a default
16961         message.
16962         * exception.h: define mono_get_exception_bad_image_format2 function.
16963         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
16964         when file name pointed to an invalid IL image. Use 
16965         mono_get_exception_file_not_found2 to construct FileNotFoundException,
16966         as this results in a more meaningful error message.
16967
16968 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16969
16970         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
16971         #79465.
16972
16973 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
16974
16975         * metadata.c (mono_type_size): Change the align parameter to guint32 for
16976         consistency with the other _size functions.
16977         (mono_type_stack_size): Ditto.
16978
16979         * class.c object.c icall.c: Fix warnings caused by the above change.
16980
16981         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
16982
16983         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
16984
16985         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
16986
16987 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
16988
16989         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
16990         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
16991         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
16992         threadpool.h, threads-types.h: mark more internal functions.
16993
16994 2006-10-11  Dick Porter  <dick@ximian.com>
16995
16996         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16997         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
16998         reproduce the bug even before applying the fix.)
16999
17000 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
17001
17002         * reflection.c: allow retrieving attributes for arguments in generic
17003         methods (bug #79241).
17004
17005 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
17006
17007         * debug-mono-symfile.c: properly check fopen () result (found by
17008         coverity).
17009
17010 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
17011
17012         * reflection.c: make error message clearer and fixed two
17013         issuelets found by Coverity.
17014
17015 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
17016
17017         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
17018
17019 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
17020
17021         * object-internals.h, gc-internal.h, profiler-private.h:
17022         mark internal functions.
17023
17024 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
17025
17026         * reflection.c: put data in the text section.
17027         * icall.c: recognize more types in type_from_typename ().
17028         * process.c, marshal.c: added some GC FIXMEs.
17029
17030 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
17031
17032         * loader.c: check for NULL before initializing.
17033
17034 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
17035
17036         * gc.c (finalizer_thread): Use a non-alertable wait here.
17037
17038         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
17039         until the correct solution is found.
17040
17041 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
17042
17043         * reflection.c (mono_module_get_object): Avoid an assert when operating on
17044         modules with no metadata. Fixes #79596.
17045
17046         * image.c (load_metadata_ptrs): Put back the error message when
17047         the #- heap is encountered since the support is not complete yet.
17048
17049 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
17050
17051         * gc.c: do not allow the user to SuppressFinalize () a
17052         delegate because it would leak the trampoline if present.
17053
17054 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
17055
17056         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
17057         PropertyPtr table.
17058
17059 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
17060
17061         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
17062
17063         * metadata.c (mono_metadata_get_param_attrs): Ditto.
17064
17065         * row-indexes.h: Add definitions for *Ptr tables.
17066
17067         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
17068
17069         * metadata.c (mono_metadata_translate_token_index): New helper function to
17070         translate table indexes used in uncompressed metadata.
17071         (mono_metadata_decode_table_row): Ditto.
17072         (mono_metadata_decode_table_row_col): Ditto.
17073
17074         * metadata.c: Add table schema for *Ptr tables.
17075
17076         * class.c loader.c: Use the new helper function to access the affected metadata
17077         tables.
17078         
17079         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
17080         #38532.
17081         
17082 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
17083
17084         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
17085         sequences which can be unbounded in size. Fixes #79583.
17086
17087 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
17088
17089         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
17090         static initialization.
17091
17092         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
17093
17094         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
17095
17096         * domain.c (mono_domain_free): Free up type_init_exception_hash.
17097
17098         * object.c (mono_runtime_class_init): Implement correct semantics when a static
17099         ctor fails, i.e. throw the same exception on subsequent accesses.
17100         
17101 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
17102
17103         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
17104         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
17105         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
17106         Handle marshalling of interfaces and VARIANTs contained in structs.
17107         
17108         Code is contributed under MIT/X11 license.
17109         
17110 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
17111
17112         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
17113         
17114         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
17115         mempool.
17116
17117 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17118
17119         * console-io.c: ignore previous SIGINT handler.
17120
17121 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
17122
17123         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
17124         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
17125         #79460, #79461, #79485.
17126
17127         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
17128
17129         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
17130         #79217.
17131
17132 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
17133
17134         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
17135         could be generated from it.
17136
17137 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
17138
17139         * rand.c: fix read loop to correctly handle EINTR.
17140
17141 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
17142
17143         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
17144         internal calls are defined to keep methods closer to the declaring
17145         type and allow a significant reduction in runtime relocations and
17146         memory usage.
17147
17148 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
17149
17150         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
17151         exception message to have FileNotFoundException use the default
17152         assembly load error message. Fixes bug #79426.
17153         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
17154
17155 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17156
17157         * threadpool.c: (start_thread_or_queue) use the root domain when
17158         creating the thread instead of the async object one.
17159
17160 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
17161
17162         * class.c, object.c, class-internals.h, reflection.c:
17163         for arrays, store element_size inside MonoClass (speedup
17164         for array object creation).
17165
17166 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
17167
17168         * icall.c: fixed CodeBase to use the file name and not the module
17169         name (bug #79365).
17170
17171 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
17172
17173         * mono-debug.c, mono-debug.h: export find_method as
17174         mono_debug_find_method ().
17175
17176 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
17177
17178         * debug-helpers.c, class-internals.h: added a few functions useful
17179         when debugging under gdb.
17180
17181 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17182
17183         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
17184         characters that need special handling.
17185
17186 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
17187
17188         * mono-config.c: make the os/cpu specification more flexible,
17189         allowing lists and negation.
17190
17191 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
17192
17193         * marshal.c: COM Interop fixes. Handle case where method->klass.
17194         is interface. Handle BSTR/MonoString when null. Use CDECL as 
17195         calling convention on non-windows platforms. This is for
17196         compatibility with XPCOM and MainWin COM.
17197         
17198         Code is contributed under MIT/X11 license.
17199         
17200
17201 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
17202
17203         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
17204         correctly. Fixes #79217.
17205
17206         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
17207
17208 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
17209
17210         * mono-config.c: allow both an os and cpu attribute for dllmap
17211         and dllentry elemnets to enable a single config file to be used
17212         for multiple architectures.
17213
17214 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
17215
17216         * loader.c: MonoLoaderError was cleared too soon on load failure.
17217         Fixes bug #79424.
17218
17219 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
17220
17221         * icall.c: use the defining class vtable when accessing a
17222         static field, not a pobblibly derived class.
17223
17224 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
17225
17226         * icall.c string-icalls.c: Remove references to unicode.h.
17227
17228         * unicode.h unicode.c Makefile.am: Remove these unused source files.
17229
17230         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
17231
17232         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
17233         indicating the image where custom marshaller types should be looked up.
17234         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
17235         custom marshallers, instead of corlib. Fixes #79425.
17236
17237 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
17238
17239         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
17240
17241 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
17242
17243         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
17244         Implement Environment.ProcessorCount.
17245         
17246         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
17247         Implement Environment.ProcessorCount.
17248         
17249         * icall.c: 
17250         Add Environment.ProcessorCount icall.
17251         
17252         Patch by Jason McFall.
17253
17254 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17255
17256         * assembly.c: don't append .exe/.dll when the filename already contains
17257         one of those extensions.
17258
17259 2006-09-12  Martin Baulig  <martin@ximian.com>
17260
17261         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
17262         to array interfaces.
17263
17264 2006-09-11  Martin Baulig  <martin@ximian.com>
17265
17266         * reflection.c (mono_image_build_metadata): Create the
17267         MethodImpl's after emitting all types and methods, so we don't
17268         need another fixup pass for them.
17269
17270 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
17271
17272         * class.c (mono_class_from_name_case): Fix regression introduced by the last
17273         change.
17274
17275 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
17276
17277         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
17278         unload.
17279
17280 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
17281
17282         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
17283         args is not set. Fixes #78926.
17284
17285 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
17286
17287         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
17288
17289         * image.c (load_class_names): Move this to class.c, and rename it to 
17290         'mono_image_init_name_cache'.
17291         (load_modules): Fix a warning.
17292
17293         * class.c icall.c image.c: Initialize image->name_cache lazily.
17294
17295         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
17296         on its name using information in the AOT file.
17297
17298         * class.c (mono_class_from_name): Use the new hook function.
17299
17300 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
17301
17302         * reflection.c (mono_param_get_objects): Handle enum default parameter values
17303         correctly.
17304
17305         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
17306         Fixes #79289.
17307         
17308 2006-09-06  Martin Baulig  <martin@ximian.com>
17309
17310         * icall.c (mono_lookup_internal_call): Small fix.
17311
17312 2006-09-05  Raja R Harinath  <rharinath@novell.com>
17313
17314         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
17315         double g_free.
17316
17317 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
17318
17319         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
17320         when --debug is specified.
17321
17322 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
17323
17324         * class.c (setup_generic_array_ifaces): Fix a warning.
17325
17326 2006-09-04  Miguel de Icaza  <miguel@novell.com>
17327
17328         * Temporarily remove the patch to assemly.c that checks the
17329         assembly versions as it breaks our gacutil.
17330
17331 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
17332
17333         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
17334
17335         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
17336         a net 1.0 runtime.
17337
17338         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
17339         created using the default ctor. Fixes #79152.
17340         (mono_string_builder_to_utf16): Ditto.
17341
17342 2006-09-01  Martin Baulig  <martin@ximian.com>
17343
17344         Fix handling of the generic array interfaces.
17345
17346         * class-internals.h
17347         (MonoDefaults): Removed `generic_array_class' and added
17348         `generic_ilist' class.
17349
17350         * class.c
17351         (mono_bounded_array_class_get): Add the new generic array interfaces.
17352         (setup_generic_array_ifaces): New static method; create vtable
17353         entries for each method in the generic array interfaces.
17354
17355         * metadata.c
17356         (select_container): Allow "parent-less" generic methods.
17357
17358         * marshal.c
17359         (mono_marshal_get_generic_array_helper): New public method.
17360
17361         * icall.c
17362         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
17363         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
17364         moved the interncall into System.Array.
17365
17366 2006-09-01  Raja R Harinath  <rharinath@novell.com>
17367
17368         A few more cases of avoiding work on types with ->byref set.
17369         Has the real fix for #79238
17370         * icall.c (is_generic_parameter): New helper.
17371         (ves_icall_Type_GetGenericParameterPosition): Use it.
17372         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
17373         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
17374         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17375         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
17376         reference types.
17377         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
17378         reference types.
17379         (ves_icall_Type_get_IsGenericInstance): Likewise.
17380         (ves_icall_Type_get_IsGenericType): Likewise.
17381
17382 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
17383
17384         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
17385         class if possible.
17386
17387         * mempool.h (mono_mempool_get_allocated): New helper function.
17388
17389         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
17390         change.
17391
17392         * mempool.c: Fix warnings and the calculation of stats.
17393
17394         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
17395
17396         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
17397
17398         * loader.c (mono_get_method_from_token): Update method_count stat.
17399
17400         * class-internals.h (MonoStats): Add some stats.
17401
17402 2006-08-31 Robert Jordan  <robertj@gmx.net>
17403
17404         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
17405         with managed variants.
17406         All code is contributed under the MIT/X11 license.
17407         
17408 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
17409
17410         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
17411         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
17412
17413         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
17414
17415         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
17416         with cycles in classes.
17417
17418         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
17419
17420         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
17421         missing a [MarshalAs] directive. Fixes #79203.
17422
17423         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
17424         klass->marshal_info. Fixes #79217.
17425
17426 2006-08-30  Martin Baulig  <martin@ximian.com>
17427
17428         Committing a patch from Joachim Ante <joe@otee.dk>:
17429         Add support for binary data symbol stores.
17430
17431         * debug-mono-symfile.c
17432         (mono_debug_open_mono_symbol_file): Renamed into
17433         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
17434         arguments.
17435
17436         * mono-debug.c
17437         (mono_debug_open_image): Added `raw_contents' and `size' args.
17438         (mono_debug_init_2_memory): New public function.
17439
17440 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
17441
17442         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
17443
17444 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17445
17446         * appdomain.c: implement support for ShadowCopyFiles.
17447
17448 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
17449
17450         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
17451         when value is NULL (and should remove CID #51).
17452
17453 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17454
17455         * image.c: moved 2 functions to ../utils.
17456
17457 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
17458
17459         * gc.c: cope with the target object of a GC handle being NULL
17460         (bug #78877).
17461
17462 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
17463
17464         * class.c: recursively check parent's explicit implementations
17465         of interface methods (fixes bug #79125).
17466
17467 2006-08-19  Miguel de Icaza  <miguel@novell.com>
17468
17469         * filewatcher.c: Avoid warnings when building, do not redefine
17470         constants that are defined.
17471
17472         Remove warnings.
17473
17474 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17475
17476         * image.c: don't fail when the link points to an absolute path.
17477
17478 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
17479
17480         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
17481         Fix CID #3.
17482
17483 2006-08-17  Miguel de Icaza  <miguel@novell.com>
17484
17485         * image.c (full_path): A new method used to obtain the actual path
17486         of an assembly even in the presence of symbolic links.  
17487
17488         This is necessary for the case where we are running a binary that
17489         has been GACed, but we are using the "published" path name
17490         ($prefix/mono/1.0/blah.exe) which happens to point to the real
17491         file in the GAC.
17492
17493         This was the source of the failure for the `xsp' command with the
17494         recent AppDomain changes, as far as the runtime was concerned,
17495         there were two different assemblies: $prefix/mono/1.0/blah.exe and
17496         $prefix/mono/gac/blah/version/blah.exe.
17497
17498         (do_mono_image_open): use full path
17499
17500 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17501
17502         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
17503
17504 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
17505
17506         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
17507         domain_id is supplied. Fix CID #241 and corlib's unit tests.
17508
17509 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17510
17511         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
17512         small structures. Fixes #78990.
17513
17514 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17515
17516         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
17517
17518         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
17519
17520 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17521
17522         * appdomain.c:
17523         * marshal.c: don't load all the assemblies from a domain into newly
17524         created ones. The new domains might have different rules and load
17525         assemblies from different locations. Fixes bug #76757.
17526
17527         Patch by Lluis. Conflicts resolved by Brian Crowell.
17528
17529 2006-08-16  Alp Toker  <alp@atoker.com>
17530
17531         * socket-io.c: First half of the fix for #79084.
17532         Set sa_size to the length of the content, not that of the struct.
17533         Don't add NULL suffix to the content, this should be done in
17534         managed code if needed.
17535
17536 2006-08-14  Raja R Harinath  <rharinath@novell.com>
17537
17538         Fix part of #79012
17539         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
17540         mono_metadata_parse_type returns NULL.
17541
17542 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
17543
17544         * normalization-tables.h : new file for string normalization data.
17545         * locales.c, locales.h, icall.c :
17546           added load_normalization_resource() for string normalization,
17547           and icall as well.
17548         * Makefile.am : added normalization-tables.h to the sources.
17549
17550 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
17551
17552         * marshal.c: Add more helper functions to reduce code duplication and use them
17553         everywhere.
17554
17555 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
17556
17557         * marshal.c: Fix non-x86 stdcall warnings.
17558         
17559         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
17560         them everywhere.
17561
17562 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
17563
17564         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
17565         type check on multi-dimensional arrays. Fixes #79000.
17566
17567 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
17568
17569         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
17570         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
17571         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
17572         * class-internals.h: add is_com_object to class structure.
17573         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
17574         null checks to COM object marshalling. Fix .ctor call on RCW.
17575         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
17576         
17577         All code is contributed under the MIT/X11 license.
17578
17579 2006-08-09  Dick Porter  <dick@ximian.com>
17580
17581         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
17582         racing mono_monitor_allocator_lock() somewhere, so don't delete
17583         the critical section for now.  Found by running and exiting
17584         monodevelop.
17585
17586 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
17587
17588         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
17589         (ves_icall_System_ComObject_FindInterface): Ditto.
17590         (ves_icall_System_ComObject_CacheInterface): Ditto.
17591
17592         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
17593         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
17594
17595 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17596
17597         * threadpool.c: treat pipes from process asynchronous reads as sockets
17598         when reading from them, so we get select/poll or epoll to wait for
17599         data.
17600
17601 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
17602
17603         * loader.c: Fix a typo (CID #233) in the null check.
17604
17605 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
17606
17607         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
17608         Hopefully fixes #78949.
17609         
17610         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
17611         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
17612         bytes. Fixes #78972.
17613
17614 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17615
17616         * filewatcher.c: we need to set errno here.
17617
17618 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17619
17620         * filewatcher.c: let Win32Exception get the error value.
17621
17622 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17623
17624         * filewatcher.c: translate errno into win32 errors for Win32Exception
17625         to know what happened.
17626
17627 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
17628
17629         * threadpool.c: Fix more warnings.
17630
17631         * assembly.c (search_loaded): Fix warnings.
17632
17633         * threadpool.c (mono_thread_pool_finish): Fix warnings.
17634         (mono_async_invoke): Ditto.
17635
17636 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
17637
17638         * object.c (mono_remote_class_vtable): Need to create proxy vtable
17639         entries for __ComObject type in addition to ComImport types.
17640         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
17641         about hash table.
17642         
17643         All code is contributed under the MIT/X11 license.
17644
17645 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
17646
17647         * image.c: avoid tentative loading of modulerefs that contain
17648         no metadata (P/Invoke library names).
17649
17650 2006-07-28  Dick Porter  <dick@ximian.com>
17651
17652         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
17653         mono_loader_lock() somewhere, so don't delete the critical section
17654         for now.  Found by running and exiting monodevelop.
17655
17656 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17657
17658         * filewatcher.c: define the inotify syscalls when we're building on
17659         linux and have sys/syscall.h. The build system might not have support
17660         for inotify but the target system might have it.
17661
17662 2006-07-26  Miguel de Icaza  <miguel@novell.com>
17663
17664         * domain.c: Documentation updates.
17665
17666         * loader.c (mono_free_method): Do not release the method
17667         information if we are being profiled, as profilers will use this
17668         information at shut down to present some data to the user.
17669
17670         This is needed so that the profiler does not crash, as the
17671         profiler tends to keep MonoMethods around, and they might become
17672         invalid if we free these.
17673
17674         (mono_get_method_constrained): Return the original CIL stream
17675         method as well, so verification can be performed against it.
17676
17677 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17678
17679         * filewatcher.[ch]: support for inotify file system watcher.
17680         * icall.c: add new internal calls for the inotify file system watcher.
17681
17682 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17683
17684         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
17685         #78888.
17686
17687 2006-07-20  Dick Porter  <dick@ximian.com>
17688
17689         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
17690         warning.
17691
17692 2006-07-20  Dick Porter  <dick@ximian.com>
17693
17694         * threads.c (start_wrapper): Do the thread cleanup while we still
17695         hold a reference to its object.  Fixes bug 78123.
17696
17697 2006-07-18  KornĂ©l Pál  <kornelpal@gmail.com>
17698
17699         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
17700         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
17701           "managed-to-managed".
17702         * icall.c: Redirect string constructors that take sbyte* to
17703           ves_icall_System_String_ctor_RedirectToCreateString.
17704         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
17705           to CreateString () methods with matching signature.
17706         * reflection.c: Use original security informations for
17707           MONO_WRAPPER_MANAGED_TO_MANAGED.
17708         * security-manager.c: Use original security informations for
17709           MONO_WRAPPER_MANAGED_TO_MANAGED.
17710         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
17711           that is a placeholder and only its address should be used.
17712         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
17713           that is a placeholder and only its address should be used.
17714
17715 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
17716
17717         Begin implementing COM Interop.
17718         * appdomain.c: Increment corlib version.
17719         * class.c: Set ComImport classes' parent to __ComObject.
17720         * loader.c: Mark cominterop methods as such.
17721         * domain.c: Add __ComObject class to MonoDefaults structure.
17722         * image.c: Add 2 hashtables to the image for COM Interop related methods
17723         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
17724         using the mempool allocator
17725         
17726         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
17727         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
17728         declaration for mono_metadata_type_dup_mp.
17729         
17730         * debug-helpers.c: Added strings for two additional wrapper types
17731         * object.c: Create proxy objects for ComImport classes
17732         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
17733         and added __ComObject class to MonoDefaults structure.
17734         
17735         * object-internals.h: Finish MonoRealProxy definition, and add definition of
17736         MonoComInteropProxy and MonoComObject.
17737         
17738         * marshal.c: Added support for COM Interop
17739         (signature_cominterop): Converts managed signature to corresponding
17740         unmanaged COM signature.
17741         (cominterop_get_function_pointer): gets unmanaged function pointer via
17742         COM object vtable
17743         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
17744         (cominterop_get_method_interface): returns interface type that method is defined on
17745         (mono_mb_emit_cominterop_call): emits native call to function pointer
17746         gotten from vtable
17747         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
17748         that matches signature of unmanaged function.
17749         (cominterop_get_native_wrapper): wrapper around adjusted method call.
17750         (cominterop_get_invoke): forwards call from proxy to __ComObject
17751         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
17752         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
17753         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
17754         
17755         * marshal.h: Added Marshal icall declarations.
17756         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
17757         so we can access them in finalizer
17758         
17759 2006-07-14  Dick Porter  <dick@ximian.com>
17760
17761         * object.c (mono_type_initialization_cleanup): Fix a race
17762         condition by temporarily commenting out the critical section
17763         deletion.
17764
17765 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
17766
17767         * reflection.c (create_custom_attr): Fix some warnings.
17768         (create_custom_attr_data): Ditto.
17769         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
17770         types. Fixes #78855.
17771
17772 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
17773
17774         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
17775
17776         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
17777
17778 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
17779
17780         * reflection.c (resolve_object): Add support for DynamicMethod.
17781
17782         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
17783         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
17784
17785 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
17786
17787         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
17788         don't leak GPtrArray's pdata has we have no use (nor free) for it.
17789
17790 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
17791
17792         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
17793         Fixes #77888.
17794
17795 2006-06-30  Raja R Harinath  <rharinath@novell.com>
17796
17797         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
17798         slightly: remove a shadow local variable.
17799
17800 2006-06-29  Raja R Harinath  <rharinath@novell.com>
17801
17802         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
17803         definition that introduces the virtual function slot.
17804         Also fix Coverity #105.
17805
17806 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
17807
17808         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
17809         for dynamic assemblies. Fixes #78724.
17810
17811 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
17812
17813         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
17814         Fixes #78722.
17815
17816 2006-06-21  Martin Baulig  <martin@ximian.com>
17817
17818         * reflection.c
17819         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
17820         fixes #76484.
17821
17822 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
17823
17824         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
17825
17826 2006-06-20  Raja R Harinath  <rharinath@novell.com>
17827
17828         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
17829         nor TYPEREFs.
17830         * class.c (mono_class_create_from_typespec): Add 'context' argument.
17831         Inflate result if necessary.
17832         (mono_class_get_full): Remove old version.  Rename from
17833         'mono_class_get' and add 'context' argument.  Pass it to
17834         ..._create_from_typespec.
17835         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
17836         (mono_ldtoken): Revert change below.
17837
17838 2006-06-20  Martin Baulig  <martin@ximian.com>
17839
17840         * class.c (mono_ldtoken): Don't pass the generic context to
17841         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
17842
17843 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
17844
17845         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
17846         and later freeing it. Fixes #78638.
17847
17848 2006-06-15  Miguel de Icaza  <miguel@novell.com>
17849
17850         * icall.c (mono_class_get_throw): Revert over-zealous error
17851         throwing, the caller for mono_class_get_throw will cope with
17852         errors when classes are not properly initialized already.
17853
17854         The code still copes with loader exceptions though.
17855
17856         Fixes the regression in reftype1 and reftype3 from the CAS tests.
17857         
17858 2006-06-14  Miguel de Icaza  <miguel@novell.com>
17859
17860         Fixes the `make run1' version of RuntimeAbort (to be commited,
17861         source is in Bugzilla).
17862         
17863         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
17864         FALSE on class loading failure instead of returning true.
17865
17866         * class.c (mono_class_create_from_typedef): It is possible for
17867         mono_metadata_interfaces_from_typedef_full to fail if a class is
17868         not found, cope with this.
17869         
17870
17871 2006-06-14  Dick Porter  <dick@ximian.com>
17872
17873         * socket-io.c: 
17874         * process.c: Fix a bunch of signed/unsigned warnings from gcc
17875         4.1.1
17876
17877 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
17878
17879         * culture-info-table.h : oops, forgot to make it nsync with r61548.
17880
17881 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17882
17883         * icall.c: Another fix for building mono in Visual Studio.
17884
17885 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17886
17887         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
17888         
17889 2006-06-09  Martin Baulig  <martin@ximian.com>
17890
17891         * debug-mono-symfile.c: Put this back and really fix it this
17892         time. Sorry for all the trouble.
17893
17894 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
17895
17896         * icall.c (mono_class_get_throw): Fix a warning.
17897         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
17898         ReflectionTypeLoadException if needed. Fixes #78606.
17899
17900         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
17901         (mono_class_init): Ditto.
17902
17903         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
17904         ref_only exceptions.
17905         (mono_loader_clear_error): Make this work even if there is no error.
17906
17907 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
17908
17909         * object-internals.h marshal.c marshal.h icall.c: Implement method 
17910         Marshal.GetComSlotForMethodInfo using internal call.
17911
17912 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
17913
17914         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
17915         a function for signalling it.
17916
17917         * class.c (mono_class_from_typeref): Use the new kind of loader error when
17918         a referenced assembly is not found.
17919
17920         * loader.c (mono_loader_error_prepare_exception): Add support for 
17921         LOADER_ERROR_ASSEMBLY. Fix formatting.
17922
17923 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
17924
17925         * domain.c appdomain.c class-internals.h marshal.c: Add support 
17926         for VARIANT marshalling on windows and increment corlib version
17927         since Variant struct was added.
17928
17929 2006-06-03  Miguel de Icaza  <miguel@novell.com>
17930
17931         * debug-mono-symfile.c: Revert Martin's previous patch which broke
17932         stack trace line information:
17933
17934         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
17935         (Martin) when looking up B which is between A and C, return A not C.
17936
17937         Bug is #78573.
17938
17939         Thanks to Alexander Olk for tracking this down.
17940
17941 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
17942
17943         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
17944         
17945         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
17946         avoid clobbering its value.
17947         (mono_string_to_lpstr): Fix a warning on windows.
17948
17949 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17950
17951         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
17952
17953         * reflection.c loader.c: Removed references to 'dummy' flag.
17954
17955         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
17956
17957         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
17958         it gets GC tracking.
17959
17960         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
17961         GC tracking.
17962         
17963         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
17964
17965         * marshal.c threadpool.c: Update callers of mono_async_result_new.
17966
17967         * appdomain.c: Bump corlib version.
17968
17969 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17970
17971         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17972         CEE_STIND_REF when working with object references.
17973
17974 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17975
17976         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
17977         Fixes #78539.
17978
17979 2006-05-30  Miguel de Icaza  <miguel@novell.com>
17980
17981         * loader.c (method_from_memberref): Fix argument value for
17982         mono_loader_set_error_method_load (I was passing the MonoClass
17983         instead of the class name char *).
17984
17985 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17986
17987         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17988         CEE_STIND_REF when working with object references.
17989
17990 2006-05-30  Martin Baulig  <martin@ximian.com>
17991
17992         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
17993         mono_method_full_name() change and replace the ':' with a '.'
17994         here.
17995
17996 2006-05-30  Martin Baulig  <martin@ximian.com>
17997
17998         * debug-mono-symfile.c
17999         (mono_debug_symfile_lookup_location): Fix the algorithm:
18000         when looking up B which is between A and C, return A not C.
18001
18002 2006-05-29  Martin Baulig  <martin@ximian.com>
18003
18004         * mono-debug.h
18005         (MonoDebugMethodInfo): Make the typedef public.
18006         (MonoDebugSourceLocation): New public struct.
18007
18008         * mono-debug.c
18009         (mono_debug_source_location_from_address): Removed.
18010         (mono_debug_source_location_from_il_offset): Removed.
18011         (mono_debug_il_offset_from_address): Removed.
18012         (mono_debug_address_from_il_offset): Removed.
18013         (mono_debug_lookup_method): New public function.
18014         (mono_debug_lookup_source_location): New public function; replaces
18015         the old mono_debug_source_location_from_*() functions; see the
18016         inline documentation.
18017         (mono_debug_free_source_location): New public function.
18018         (mono_debug_print_stack_frame): New public function; see the
18019         inline documentation.
18020
18021         * debug-mono-symfile.c
18022         (mono_debug_find_source_location): Renamed into
18023         mono_debug_symfile_lookup_location(); only take a
18024         `MonoDebugMethodInfo *' and an `offset' argument; added inline
18025         documentation.
18026         (mono_debug_find_method): Renamed into
18027         mono_debug_symfile_lookup_method().
18028
18029 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
18030
18031         * assembly.c (mono_assembly_open_full): Dont overwrite the status
18032         returned by mono_image_open_full ().
18033
18034         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
18035         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
18036         #78517.
18037
18038         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
18039         #78518.
18040
18041 2006-05-27  Miguel de Icaza  <miguel@novell.com>
18042
18043         * class.c (mono_class_from_typeref): handle missing images
18044         earlier, deals with bug #78418.   Refactor code; 
18045
18046         Fix a warning introduced in my previous commit (some stale code
18047         from before I revisited my patch).
18048
18049         * class.c (mono_class_create_from_typedef): On failure, remove the
18050         class from the MonoImage->class_cache as the class is not
18051         initialized;   Fixes the leak pointed out by Paolo.
18052
18053 2006-05-25  Dick Porter  <dick@ximian.com>
18054
18055         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
18056         DeleteCriticalSections until I figure out which one may still be
18057         sometimes locked when mono_thread_cleanup is called.
18058
18059 2006-05-24  Dick Porter  <dick@ximian.com>
18060
18061         * threads.c (mono_thread_cleanup): Move the threading cleanup out
18062         of mono_thread_manage and back into its own function, so it can be
18063         called after the finalizer thread has finished.
18064
18065         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
18066
18067 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
18068
18069         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
18070         Fixes #78495.
18071
18072         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
18073         with non-blittable elements.
18074         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
18075
18076 2006-05-24  Martin Baulig  <martin@ximian.com>
18077
18078         * mono-debug-debugger.h (MonoDebuggerEvent): Added
18079         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
18080
18081         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
18082         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
18083         `mono_debugger_event_handler' to NULL.
18084
18085 2006-05-24  Martin Baulig  <martin@ximian.com>
18086
18087         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
18088
18089 2006-05-24  Martin Baulig  <martin@ximian.com>
18090
18091         * mono-debug-debugger.h
18092         (mono_debugger_create_notification_function): Added
18093         `MonoCodeManager *' argument.
18094
18095 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
18096
18097         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
18098
18099 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
18100
18101         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
18102         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
18103         implementation.
18104
18105 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
18106
18107         * icall.c: precise GC support: objects can't be stored in unmanaged
18108         memory anymore, even if they are kept alive by other references: since
18109         they can move the GC needs to be able to always find them.
18110
18111 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
18112
18113         * object.c: precise GC support for static fields. Support
18114         for moving GCs: write barriers and pinned allocation for interned
18115         strings.
18116
18117 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
18118
18119         * domain.c, domain-internals.h: precise GC support for the MonoDomain
18120         structure.
18121
18122 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
18123
18124         * class.c, gc.c: sgen and precise GC updates.
18125
18126 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
18127
18128         * marshal.h, marshal.c: added write barrier wrapper and precise type
18129         fixes.
18130
18131 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
18132
18133         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
18134         support.
18135
18136 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
18137
18138         * reflection.c: precise and sgen GC updates.
18139
18140 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
18141
18142         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
18143
18144 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
18145
18146         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
18147
18148 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
18149
18150         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
18151         MONO_TYPE_OBJECT. Fixes #78462.
18152
18153 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
18154
18155         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
18156         and blittable types.
18157
18158 2006-05-17  Miguel de Icaza  <miguel@novell.com>
18159
18160         * class.c (mono_class_get_exception_for_failure): Implement parts
18161         of a TODO: if the loader error is set (instead of the class
18162         error), we return a Loader exception that can be properly thrown
18163         elsewhere.
18164
18165         This was exposed by some Winforms 2.0 code that I tried to run
18166         (Atsushi pointed me to it).
18167
18168 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
18169
18170         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
18171         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
18172         
18173         * marshal.c (emit_marshal_vtype): Add limited support for 
18174         UnmanagedType.LPStruct. Fixes #78427.
18175
18176         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
18177         Applied a patch from kangaroo to fix #77523.
18178
18179 2006-05-17  Martin Baulig  <martin@ximian.com>
18180
18181         * threads.c
18182         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
18183         (debugger_thread_created): Removed.
18184         (debugger_thread_exited): Removed.
18185
18186 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
18187
18188         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18189
18190         * object-internals.h (MonoReflectionResource): Sync with managed version.
18191
18192 2006-05-12  Wade Berrier <wberrier@novell.com>
18193
18194         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
18195
18196 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
18197
18198         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
18199         functions try to allocate from the image mempool.
18200
18201 2006-05-12  Dick Porter  <dick@ximian.com>
18202
18203         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
18204
18205 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
18206
18207         * object.c: The FieldGetter and FieldSetter methods require the full
18208         name of the class, not only the name. Fixes bug #78277.
18209
18210 2006-05-11  Miguel de Icaza  <miguel@novell.com>
18211
18212         * loader.c (method_from_memberref): Do not pass the NULL klass to
18213         mono_loader_set_error_() methods.  Pass the non-NULL value
18214         (class). 
18215
18216 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
18217
18218         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
18219         (mono_assembly_close): Null out assembly->image->references after freeing it.
18220
18221         * image.c (mono_image_close): Free image->references.
18222         
18223         * reflection.c (mono_image_basic_init): Fix a small memory leak.
18224
18225 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
18226
18227         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
18228         before checking if it's NULL (g_assert).
18229
18230 2006-05-10  Martin Baulig  <martin@ximian.com>
18231
18232         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
18233         I thought I already killed that two months ago, but now it somehow reappeared.
18234
18235 2006-05-10  Martin Baulig  <martin@ximian.com>
18236
18237         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
18238
18239 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
18240
18241         * reflection.c: Allocate memory for dynamically created methods in the image
18242         mempools.
18243
18244 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
18245
18246         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
18247         don't use the ad pointer before checking if it's NULL (g_assert).
18248
18249 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
18250
18251         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
18252         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
18253
18254         * marshal.c: Allocate all signatures from mempools.
18255
18256         * marshal.c: Allocate some more signatures from mempools.
18257
18258 2006-05-09  Miguel de Icaza  <miguel@novell.com>
18259
18260         * object.c (mono_load_remote_field): The code used to provide a
18261         temporary variable for returning results if the user did not
18262         provide a result pointer.  But our temporary variable was allocted
18263         on the satck.
18264
18265         Fix calling code to always pass a result area.   Coverity ID 103.
18266
18267 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
18268
18269         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
18270         value, not the old. Fixes #78312.
18271         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
18272
18273         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
18274         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
18275         per-image cache.
18276
18277         * assembly.c (mono_assembly_close): Free image->references.
18278
18279         * assembly.c (mono_assembly_names_equal): Fix a warning.
18280         (mono_assemblies_cleanup): Cleanup more global data.
18281
18282         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
18283
18284         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
18285         ptr_cache and image->modules.
18286
18287         * image.c (mono_image_init): Allocate array_cache lazily.
18288         
18289 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18290
18291         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
18292         behavior was changed recently and has bad side effects.
18293
18294 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
18295
18296         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
18297         
18298         * assembly.c (mono_assembly_close): Remove a debug printf.
18299
18300         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
18301
18302         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
18303         to also allow for temporary references between mono_image_open ()/close ().
18304
18305         * domain.c (get_runtimes_from_exe): Add a FIXME.        
18306
18307 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
18308
18309         * marshal.c: Fix support for dynamic methods.
18310
18311         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
18312
18313         * marshal.c (mono_marshal_cleanup): New cleanup function.
18314
18315         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
18316         image mempools.
18317
18318         * class.c (mono_class_init): Fix leaking class->nested_classes.
18319
18320         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
18321
18322         * image.c (mono_image_init): Initialize the new cashes.
18323
18324         * image.c (mono_image_close): Destroy the new cashes.
18325
18326         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
18327
18328         * mempool.c (mono_mempool_strdup): New helper function.
18329
18330         * class-internals.h: Add prototype for mono_loader_unlock ().
18331
18332         * domain.c (mono_jit_info_table_find): Fix a warning.
18333         (mono_debugger_check_runtime_version): Ditto.
18334
18335         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
18336         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
18337         functions to these modules.
18338
18339         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
18340         metadata modules.
18341         
18342         * marshal.c (mono_free_bstr): Fix a warning.
18343
18344         * assembly.c (mono_assembly_open_full): Fix another small leak.
18345
18346         * object.c: Fix some unload leaks in the remoting code.
18347
18348         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
18349         function.
18350
18351         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
18352
18353         * reflection.c: Fix some unload leaks in dynamic assemblies.
18354
18355 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
18356
18357         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
18358         * marshal.h: Add BSTR support on Win32
18359         * icall.c: Add BSTR icalls
18360         * metadata.h: Add BSTR enums
18361
18362 2006-04-28  Miguel de Icaza  <miguel@novell.com>
18363
18364         Work to catch the crash from #76795 and turn it into an
18365         exception.   As I stubbed out pieces of the VisualBasic support,
18366         I found a number of places where the code was failing and I added
18367         checks to those places. 
18368         
18369         * metadata.c (do_mono_metadata_parse_generic_class): Make this
18370         function return a status code.  If we fail to parse the signature
18371         from mono_metadata_parse_generic_inst, return FALSE.
18372
18373         * loader.c (mono_get_method_from_token): If we fail to load the
18374         method (mono_class_get) return NULL.   
18375
18376         * (method_from_memberref): Return NULL if we are unable to parse
18377         the method signature
18378
18379         (mono_loader_error_prepare_exception): Since we now use the
18380         loader_error flag internally to stop processing, and obtaining
18381         exceptions that might be thrown will walk this code path the
18382         proper way of going from a MonoLoaderError into a
18383         MonoException was convoluted.   This new routine encapsulates the
18384         process of turning the error into an exception and *clearing* the
18385         error afterwards.
18386         
18387 2006-04-27  Miguel de Icaza  <miguel@novell.com>
18388
18389         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
18390         with missing assemblies), and to cope with:
18391
18392                 * Missing fieldref from a non-existing assembly.
18393                 * Missing methodref from a non-existing assembly.
18394
18395         The first batch of work to address *some* of the issues from 76661.
18396         
18397         * object.c (mono_class_create_runtime_vtable): If we fail to
18398         initialize the class raise the exception here. 
18399
18400         * metadata.c (mono_class_get_overrides_full): If any methods fail
18401         to load return the failure to the caller.
18402
18403         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
18404         flagging assemblies that failed to load.   
18405
18406         Do not crash if we are unable to load the assembly.
18407
18408         (mono_assembly_close): Do nothing with REFERENCE_MISSING
18409         assemblies. 
18410
18411         * loader.c (mono_loader_set_error_type_load): Change the
18412         convention to always pass unallocated strings, so we make our own
18413         copies (I know our own code had duplicated strings before, but
18414         this keeps the normal conventions).
18415         (method_from_memberref): Call mono_loader_set_error_method_load
18416         for all possible failures of loading the class. 
18417         Remove assert, turn into a loader error.
18418
18419         (mono_loader_error_to_exception): Move this routine from mini
18420         (mini_loader_error_to_exception) there was no need to have that in
18421         mini. 
18422
18423         * class.c (mono_class_from_typeref): If we were not able to load
18424         the assembly with mono_assembly_load_reference, call the
18425         mono_loader_set_error_type_load to register the problem.
18426
18427         (mono_class_setup_fields): If we fail to load the type from
18428         mono_metadata_parse_type_full, call mono_class_set_failure and
18429         break from the loop.
18430
18431         If class->exception_type is set, we do not layout the fields as
18432         that might crash the runtime, and instead return (from breaking
18433         from the previous loop).
18434
18435         (mono_class_setup_vtable): This now returns a boolean indicating
18436         whether the table was properly setup.   The decision is driven by
18437         mono_class_get_overrides_full which might run into non-existing
18438         methods. 
18439         
18440         (mono_class_init): Returns TRUE on success or FALSE if there was a
18441         problem in loading the type (incorrect assemblies, missing
18442         assemblies, methods, etc).
18443
18444         When we call mono_class_setup_fields we also check for a potential
18445         error inside this call (either a class exception or a general
18446         loader exception).
18447
18448         (mono_class_create_from_typedef): If the parent fails to load
18449         (calling mono_class_get_full) return NULL.
18450         
18451         ** Important **
18452
18453         calls to mono_metadata_parse_type_full should be checked
18454         everywhere and set the mono_class_set_failure
18455         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
18456
18457         The current patch checks the places where my manually constructed
18458         tests show the errors are showing up, but we should do it
18459         everywhere. 
18460
18461         ** Important2 **
18462
18463         mono_class_init return values should be tested everywhere, like
18464         the previous case this is something that we should audit
18465         everywhere and not only on the cases exposed by the tests I
18466         created. 
18467
18468 2006-04-26  Miguel de Icaza  <miguel@novell.com>
18469
18470         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
18471         boolean parameter and instead pass the information on `options'
18472         parameter (FileOptions).
18473
18474         * icall.c: Register the new signature for MonoIO.Open.
18475
18476         * debug-helpers.c (dis_one): Trying to understand how coverity
18477         works.  Fix Run 5, item 78.
18478
18479 2006-04-26  Dick Porter  <dick@ximian.com>
18480
18481         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
18482         dereference.
18483
18484 2006-04-25  Martin Baulig  <martin@ximian.com>
18485
18486         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
18487
18488         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
18489         debugger_thread_created().
18490         (debugger_gc_push_all_stacks): Don't handle the main thread in any
18491         special way.
18492         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
18493         (mono_debugger_finalize_threads): New function; undo the effects
18494         of mono_debugger_init_threads().
18495         (mono_debugger_create_all_threads): Removed.
18496
18497 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
18498
18499         * image.c (mono_image_close): Tidy up trace messages.
18500
18501         * assembly.c (mono_assembly_close): Ditto.
18502
18503         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
18504         no longer references an already freed assembly. Fixes #78168.
18505
18506 2006-04-21  Dick Porter  <dick@ximian.com>
18507
18508         * threads.c (mono_thread_detach): Fix reference counting when
18509         detaching threads.
18510
18511 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
18512
18513         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
18514         #78155.
18515
18516 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
18517
18518         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
18519         (mono_type_to_stind): Ditto.
18520
18521         * marshal.c: Use the new helper functions to simplify code.
18522
18523         * image.c (mono_image_close): Add some code for help debug assembly unloading
18524         problems.
18525
18526         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
18527         image mempool.
18528
18529         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
18530         assembly was already loaded in another appdomain. Fixes #78083.
18531
18532 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
18533
18534         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
18535         referenced assemblies.
18536         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
18537
18538         * domain.c (mono_domain_free): Add a trace message.
18539
18540         * appdomain.c (add_assemblies_to_domain): Ditto.        
18541
18542         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
18543         field.  
18544
18545 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18546
18547         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
18548
18549 2006-04-12  Martin Baulig  <martin@ximian.com>
18550
18551         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
18552         `USE_INCLUDED_LIBGC'.   
18553
18554 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18555
18556         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
18557         the patch contains ../ and a small directory name later. Hopefully fixes
18558         #78035.
18559
18560 2006-04-10  Martin Baulig  <martin@ximian.com>
18561
18562         Clean up the debugger's thread-handling code.
18563
18564         The debugger's thread-handling code has been moved from
18565         ../mini/debug-debugger.c to threads.c.  We now iterate directly
18566         over the `threads' hash, keep track of exiting threads and also
18567         use proper locking.
18568
18569         We can now debug XSP and XSP based applications with the debugger.
18570
18571         * object-internals.h (MonoThread): Added `gpointer end_stack'.
18572
18573         * threads.h
18574         (MonoThreadCallbacks): Removed; this was only used by the debugger.
18575         (mono_install_thread_callbacks): Likewise.      
18576
18577         * threads.c (mono_thread_callbacks): Removed.
18578         (debugger_thread_created, debugger_thread_exited): New static functions.
18579         (start_wrapper): Call debugger_thread_created().
18580         (thread_cleanup): Call debugger_thread_exited().
18581         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
18582         (mono_debugger_init_threads): New public function.
18583         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
18584         iterate directly over the `threads' hash and also use proper locking.
18585
18586         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
18587
18588         * mono-debug-debugger.h
18589         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
18590
18591 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
18592
18593         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
18594         argument type=array. Fixes #78057.
18595
18596 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
18597
18598         * culture-info-table.h : regenerated. Fixed bug #69652.
18599
18600 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
18601
18602         * loader.c metadata.c: Reapply a variant r59116.
18603         
18604         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
18605
18606         * class.c (mono_class_setup_interface_offsets): New internal function.
18607
18608         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
18609         interfaces too. Fixes #77398.
18610
18611         * reflection.c (encode_cattr_value): Add support for 
18612         parameter type=object, argument type=array.
18613         (load_cattr_value): Ditto. Fixes #77916.
18614
18615         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
18616         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
18617
18618         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
18619         a byval char array and CharSet is Ansi.
18620
18621         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
18622
18623 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
18624
18625         * metadata.c: Add some locking comments.
18626         
18627         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
18628         mempool.
18629         (mono_metadata_free_method_signature): Don't free the signature itself.
18630
18631         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
18632
18633         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
18634         reference the same MonoImage.
18635         (mono_assembly_load_from_full): Add an assert.
18636
18637 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
18638
18639         * image.c (mono_image_close): Don't put the image we are about to free into the
18640         loaded_images_guid_hash.
18641
18642         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
18643         to reduce code duplication.
18644
18645         * marshal.c: Register the native functions called by this module as icalls, to
18646         somewhat centralize the creation of MonoMethodSignature's.
18647
18648         * loader.c (mono_method_signature): Add a cache for method signatures.
18649
18650         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
18651         the parameter attributes of a method.
18652         (mono_metadata_parse_method_signature_full): Refactored the computation of
18653         parameter attributes into a separate function. Also avoid one allocation in
18654         most cases.
18655
18656         * assembly.c (mono_assembly_close): Ditto.
18657
18658         * image.c (mono_image_close): Log trace messages with INFO level.
18659
18660         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
18661
18662         * image.c reflection.c: Correct reference counting of image modules.
18663         
18664         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
18665         of this function from the image mempool.
18666         
18667         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
18668         to allow more cached types to be used.
18669
18670         * mono-debug.c (mono_debug_add_method): Appled patch from
18671         David S. Miller  <davem@sunset.davemloft.net>: Access 
18672         minfo->lexical_blocks[] entry elements using read32().
18673
18674 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
18675
18676         * loader.c (mono_free_method): No longer free the method header for non-dynamic
18677         methods as it is allocated from the mempool.
18678
18679         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
18680         image mempool.
18681
18682         * metadata-internals.h: Add comments describing the reference counting scheme
18683         used for MonoImage and MonoAssembly.
18684
18685         * image.c assembly.c reflection.c: Rework reference counting of images and 
18686         assemblies so they are freed when the runtime is shut down. Free some 
18687         additional memory structures when an image is unloaded.
18688         
18689 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
18690
18691         * class.c loader.c reflection.c: Allocate more data structures in
18692         the image mempool.
18693
18694 2006-03-31  Miguel de Icaza  <miguel@novell.com>
18695
18696         * icall.c
18697         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
18698         build on pre glib 2.4 systems.
18699
18700 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
18701
18702         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
18703
18704         * icall.c: Fix some warnings.
18705
18706 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
18707
18708         * culture-info-table.h : regenerated.
18709
18710 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
18711
18712         * threads.c, object-internals.h, verify.c: changed the culture caching
18713         code to use a normal MonoArray for storage so the GC can keep track of
18714         them easily. Fixed bits of the cache logic, too and simplified the
18715         code.
18716
18717 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
18718
18719         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
18720         thread for non-Boehm GCs.
18721
18722 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
18723
18724         * domain.c, object.c, domain-internals.h: reduce the amount of memory
18725         needed to keep track of the data for static fields.
18726
18727 2006-03-29  Raja R Harinath  <rharinath@novell.com>
18728
18729         Fix #75172
18730         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
18731         for interface classes.  Use 'num_methods' instead.
18732         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
18733         before using '->vtable_size' field.
18734
18735 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
18736
18737         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
18738         doesn't contain managed pointers, so use a normal hashtable.
18739
18740 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
18741
18742         * reflection.c, class-internals.h, domain.c: fixed handling of types
18743         used as values for objects in custom attributes (bug #77915):
18744
18745 2006-03-24  Martin Baulig  <martin@ximian.com>
18746
18747         * class.c (mono_class_setup_fields): Added support for generic
18748         instances; fixes #77580.
18749
18750 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18751
18752         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
18753
18754 2006-03-24  Dick Porter  <dick@ximian.com>
18755
18756         * file-io.c (get_file_attributes): More stat macro breakage.
18757         Fixes bug 77759.
18758
18759 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
18760
18761         * profiler.c: added the file=filename option in the default profiler
18762         to output the profile data to filename.
18763
18764 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18765
18766         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
18767         bug #77877.
18768
18769 2006-03-22  Martin Baulig  <martin@ximian.com>
18770
18771         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
18772         allocated `MonoClassField *' in `fb->handle'.
18773
18774 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
18775
18776         * class.c, image.c, metadata-internals.h: implemented new mechanism to
18777         allocate interface ID to save memory and allow better ID reuse on
18778         appdomain unload. setup_generic_vtable () removal from Martin.
18779
18780 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
18781
18782         * object.h, appdomain.c, domain.c, exception.c, icall.c,
18783         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
18784         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
18785         write barriers for reference stores with managed objects accessed with
18786         C structures in the runtime and in embedding programs.
18787
18788 2006-03-20  Raja R Harinath  <rharinath@novell.com>
18789
18790         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
18791         'interface_id' and 'max_interface_id' fields of MonoClasses
18792         representing open generic types.
18793
18794 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
18795
18796         * object.h, object.c, icall.c: added functions to deal with
18797         storing valuetypes that contain references in managed objects.
18798         * reflection.c, string-icalls.c, threads.c, marshal.c: small
18799         fixes and comments around uses of mono_array_addr ().
18800
18801 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
18802
18803         * object.h, icall.c, monitor.c: object.GetHashCode ()
18804         implementation that supports the moving garbage collector.
18805
18806 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
18807
18808         * icall.c, threads-types.h, threads.c: implemented finalizer for
18809         LocalDataStoreSlot.
18810
18811 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
18812
18813         * metadata.c (mono_type_size): Add a fixme.
18814         (mono_type_stack_size): Ditto.
18815
18816         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
18817         'type_forwarders' field.
18818
18819         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
18820         attribute from net 2.0.
18821
18822         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
18823         from class.c.
18824
18825         * class.c (mono_class_setup_fields): Fix a warning.
18826         
18827         * class.c (mono_class_from_name): Add support for assemblyref entries
18828         in the EXPORTEDTYPE table.
18829
18830         * reflection.c: Add support for handling type forwarders under net 2.0.
18831
18832         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
18833         
18834 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
18835
18836         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
18837         overwriting entries in ModuleBuild->types, also clean up the code
18838         a little. Fixes #77774.
18839
18840 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
18841
18842         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
18843         load friend assembly info when present.
18844
18845 2006-03-14  Raja R Harinath  <rharinath@novell.com>
18846
18847         Fix crasher on gtest-158.cs.
18848         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
18849         the return value if the MonoClass we want is yet in an
18850         inconsistent state.
18851         * class.c (mono_class_create_from_typedef): Add an comment
18852         explaining an order dependency between mono_class_setup_parent and
18853         mono_class_setup_mono_type.
18854
18855 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
18856
18857         * class.c: documentation updates and events bug fix.
18858
18859 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
18860
18861         * class.c: some cleanup, locking fixes.
18862
18863 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
18864
18865         * class.c: fix the generics code to setup nested
18866         type info to the instantiated type (bug #77770).
18867
18868 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
18869
18870         * marshal.c: fixed a few type correctness issues.
18871
18872 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
18873
18874         * loader.c: the Set/Get/Addrtess array methods should be public.
18875
18876 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
18877
18878         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
18879         
18880         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
18881         info->wrapper.
18882
18883 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
18884
18885         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
18886
18887         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
18888
18889         * mempool.c (mono_mempool_alloc): Speed this up a bit.
18890         (mono_mempool_alloc0): Ditto.
18891
18892 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18893
18894         * socket-io.c:
18895         (create_object_from_sockaddr): it was allocating 4 extra bytes
18896         for the AF_UNIX data. Fixes bug #77747.
18897
18898 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
18899
18900         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
18901
18902 2006-03-09  Dick Porter  <dick@ximian.com>
18903
18904         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
18905         Fixes bug 76966 again.
18906
18907 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
18908
18909         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
18910         names from r57532
18911         * appdomain.c: Bumped corlib version to 48 (due to r57532)
18912
18913 2006-03-07  Martin Baulig  <martin@ximian.com>
18914
18915         * object.c
18916         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
18917
18918 2006-03-07  Martin Baulig  <martin@ximian.com>
18919
18920         * class.c
18921         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
18922         regression introduced in r56970; see gtest-252.cs.
18923
18924         * loader.c (mono_get_method_constrained): Correctly handle generic
18925         methods; see gtest-253.cs.
18926
18927 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
18928
18929         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
18930
18931 2006-03-04  Martin Baulig  <martin@ximian.com>
18932
18933         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
18934         compute the parent type at runtime, just like we're already doing
18935         it for interfaces.
18936
18937         * reflection.c
18938         (mono_reflection_bind_generic_parameters): Don't compute the
18939         parent type anymore.
18940
18941         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
18942
18943 2006-03-04  Martin Baulig  <martin@ximian.com>
18944
18945         * mono-debug-debugger.h
18946         (mono_debugger_create_notification_function): Allocate memory at
18947         runtime and return a pointer to it.
18948
18949 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
18950
18951         * assembly.c: Fix windows build.
18952         
18953         * assembly.c: Fix build.
18954
18955         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
18956
18957         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
18958         
18959 2006-03-03  Dick Porter  <dick@ximian.com>
18960
18961         * process.c
18962         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18963         Check parameters before dereferencing them.  Fixes Aaron's part of
18964         bug 77393.
18965
18966 2006-03-03  Raja R Harinath  <rharinath@novell.com>
18967
18968         Fix performance regression.
18969         * loader.c (find_method_in_class): Add 'from_class' argument.
18970         Rename 'klass' argument to 'in_class'.  The signature is compared
18971         against the method in 'in_class', and the corresponding method is
18972         returned from 'from_class'.
18973         (find_method): Walk both 'in_class' and 'from_class' in parallel.
18974         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
18975         type definition and generic instantiation in parallel.
18976         (mono_get_method_constrained): Update to changes.
18977
18978 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
18979
18980         * threads.c: make sure the domain is correct, too when doing
18981         mono_thread_attach ().
18982
18983 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
18984
18985         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
18986         windows. Fixes #77683.
18987
18988 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
18989
18990         * object.h, *: introduced specific way to set elements of an array
18991         of references to be used as write barrier. Still need to audit the
18992         uses of mono_array_addr.
18993
18994 2006-03-01  Miguel de Icaza  <miguel@novell.com>
18995
18996         * object-internals.h: New field to cache the assmebly name, patch
18997         from Tambet Ingo (tambet@ximian.com)
18998
18999 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
19000
19001         * decimal.h, class-internals.h, metadata-internals.h,
19002         file-io.h: mark a few function declarations as internal, to
19003         reduce the number of PLT entries.
19004
19005 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19006
19007         * file-io.c: fix typo in warning message.
19008
19009 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
19010
19011         * loader.c: on unix, lookup the "*A" version of a function
19012         if charset is auto as a second option before failing.
19013
19014 2006-02-28  Raja R Harinath  <rharinath@novell.com>
19015
19016         * class.h (mono_class_inflate_generic_method): Revert to two
19017         argument version.
19018         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
19019         (mono_class_inflate_generic_method_full): Add.
19020         * class.c (mono_class_inflate_generic_method_full): Rename from
19021         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
19022         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
19023         * loader.c, reflection.c: Update to changes.
19024
19025 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
19026
19027         * icall.c: const fixes and small improvements.
19028
19029 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19030
19031         * threadpool.c: for asynchronous connect(), enable the same workaround
19032         for BSD 6 as for the Mac. Fixes bug #77637.
19033
19034 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
19035
19036         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
19037         formatted classes. Fixes #77524.
19038
19039 2006-02-24  Raja R Harinath  <rharinath@novell.com>
19040
19041         * class.c (inflate_generic_type): Add a couple more
19042         micro-optimizations.
19043         (inflate_generic_context): Don't use the 'gmethod' from
19044         'inflate_with'.
19045         (mono_class_inflate_generic_method): If the method has generic
19046         parameters, but the passed-in context doesn't have a 'gmethod',
19047         create one.  Use the possibly simplified generic instantiation
19048         from the declaring class instead of the one passed in.
19049
19050 2006-02-24  Raja R Harinath  <harinath@gmail.com>
19051
19052         Make generic method signature and method header handling lazy.
19053         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
19054         (inflate_generic_header): Likewise.
19055         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
19056         parameter to avoid inflating types.
19057         (mono_get_inflated_method): Empty out.
19058         * class.h (mono_class_inflate_generic_method): Update to changes.
19059         * loader.c (mono_get_method_from_token): Don't parse signature for
19060         generic methods, nor methods of generic classes.
19061         (mono_method_signature): Rename from 'mono_method_signature'.
19062         Inflate signature on demand.
19063         (mono_method_get_header): Inflate method header on demand.
19064         * reflection.c: Update to changes.
19065
19066 2006-02-23  Raja R Harinath  <rharinath@novell.com>
19067
19068         * metadata.c (mono_metadata_inflate_generic_inst): If the
19069         instantiation is closed, don't bother expanding it in the new
19070         context.
19071         * class.c (inflate_generic_class): If the generic instantiation
19072         doesn't change after inflation, return the argument itself.
19073         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
19074         Add bounds checks.
19075         (inflate_generic_context): If neither the generic class nor the
19076         generic method instantiations change, return the original context.
19077         * reflection.c (mono_method_get_object): Do
19078         'mono_get_inflated_method' before accessing the ->klass field.
19079         (inflate_mono_method): Don't create a MonoGenericMethod unless
19080         necessary.
19081         (inflate_method): Don't pass a constructed type as the declaring
19082         type of a methodbuilder.
19083
19084 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
19085
19086         * object.c: fix memory overwrite.
19087
19088 2006-02-22  Dick Porter  <dick@ximian.com>
19089
19090         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
19091         it doesn't work any more.
19092         (mono_threads_request_thread_dump): Fix unused variable warnings.
19093
19094 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
19095
19096         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
19097         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
19098         the public header file.
19099
19100 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
19101
19102         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
19103
19104 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
19105
19106         * class-internals.h, object.c: reduce the size of MonoVTable
19107         and store the interface_offsets array at negative offsets.
19108
19109 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
19110
19111         * metadata.c: tweak table descriptors data structures to reduce
19112         size and runtime relocations.
19113
19114 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
19115
19116         * marshal.c: fix some types and opcodes to be type-safe
19117         in marshaling wrappers.
19118
19119 2006-02-21  Ankit Jain  <jankit@novell.com>
19120
19121         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
19122
19123 2006-02-21  Raja R Harinath  <rharinath@novell.com>
19124
19125         * metadata.c (get_constraints): Relax debugging checks for monodis.
19126
19127 2006-02-21  Ankit Jain  <jankit@novell.com>
19128
19129         * metadata.c (mono_metadata_load_generic_params): Move the code
19130         checking for ambiguous generic params from here to mono/dis/get.c
19131         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
19132
19133 2006-02-21  Raja R Harinath  <harinath@gmail.com>
19134
19135         Fix assertion triggered when compiling nemerle.
19136         * class.c (mono_get_shared_generic_inst): Rename from
19137         get_shared_inst and make non-static.
19138         * loader.c (mono_get_shared_generic_method): New.  Used to create
19139         the MonoGenericContext-equivalent of a MonoGenericContainer.
19140         (mono_get_method_from_token): Initialize the 'context' field of
19141         the created MonoGenericContainer.
19142         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
19143         * metadata.c (get_constraints): Add sanity check.
19144         * class-internals.h: Add new internal methods.
19145
19146         * reflection.c (verify_safe_for_managed_space): New sanity check.
19147         Currently checks that owner-less generic parameters aren't allowed
19148         in managed space.
19149         (mono_type_get_object): Use it.
19150         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
19151         that are now in mono_type_get_object.
19152         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
19153
19154 2006-02-19  Raja R Harinath  <harinath@gmail.com>
19155
19156         * metadata.c (mono_type_create_from_typespec): Rename from
19157         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
19158         argument and caching of types in the generic container.
19159         (unwrap_arrays, find_generic_param): Remove.
19160         * metadata-internals.h: Update.
19161         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
19162
19163 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
19164
19165         * class.c (mono_class_get_exception_for_failure): Fix a warning.
19166
19167         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
19168         return values. Fixes #77581.
19169
19170         * class.c (mono_fnptr_class_get): Switch name and name_space.
19171
19172         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
19173         classes and add support for [In, Out] attributes.
19174         (mono_marshal_free_asany): Ditto. Fixes #77524.
19175
19176 2006-02-18  Raja R Harinath  <harinath@gmail.com>
19177
19178         * class.c (mono_class_from_generic_parameter): Make more robust to
19179         incomplete MonoGenericContainers from monodis.
19180
19181 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
19182
19183         * class-internals.h: added some more exception types.
19184         * class.c, metadata.c: added a few checks to handle missing
19185         types.
19186
19187 2006-02-17  Raja R Harinath  <rharinath@novell.com>
19188
19189         Use owner-less generic-params some more.
19190         * class.c (my_mono_class_from_generic_parameter): Remove.
19191         (mono_class_from_generic_parameter): Handle null image,
19192         param->name and param->owner.
19193         (mono_class_from_mono_type): Update.
19194         (mono_class_create_from_typespec): Remove 'container' parameter.
19195         If that parameter is non-null, the result is always inflated by
19196         'mono_class_get_full' anyway.
19197         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
19198         parameter.
19199         (mono_class_get_full): Update.
19200
19201         * class.c (inflate_generic_type) [GENERICINST]: If the generic
19202         instance is not open, don't bother inflating.
19203         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
19204         parse metadata for inflated classes.
19205         (_mono_class_get): Change GenericContext* parameter to
19206         GenericContainer*.
19207         (mono_class_create_from_typespec): Likewise.  Simplify, and
19208         implement trivially.  All the cases are handled in
19209         mono_class_from_mono_type.  Don't inflate returned class.
19210         (mono_class_get_full): Delegate GENERICINST optimization to
19211         inflate_generic_type.
19212         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
19213
19214 2006-02-16  Dick Porter  <dick@ximian.com>
19215
19216         * socket-io.c (create_object_from_sockaddr): Fix typo.
19217         (create_sockaddr_from_object): Check array lengths before
19218         potentially accessing items off the end.
19219         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
19220         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
19221         (ves_icall_System_Net_Sockets_Socket_Send_internal)
19222         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
19223         length checks to avoid wraparound overflows.
19224         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
19225         contents of the array of sockets
19226         (hostent_to_IPHostEntry2)
19227         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
19228         Check return value of inet_ntop ().
19229         (addrinfo_to_IPHostEntry): Fix typo
19230
19231 2006-02-16  Raja R Harinath  <rharinath@novell.com>
19232
19233         Type metadata parsing doesn't use generic-instantiation information.
19234         * metadata.c (mono_metadata_parse_array_full): Change
19235         MonoGenericContext* parameter to MonoGenericContainer*.
19236         (mono_metadata_parse_type_full): Likewise.
19237         (mono_type_create_from_typespec_full): Likewise.
19238         (mono_metadata_parse_mh_full): Likewise.
19239         (mono_metadata_parse_generic_inst): Likewise.
19240         (do_mono_metadata_parse_generic_class): Likewise.
19241         (do_mono_metadata_parse_type): Likewise.
19242         * metadata-internals.h: Update to changes.
19243         * class.c (mono_class_find_enum_basetype): Likewise.
19244         (mono_class_setup_fields): Likewise.
19245         (mono_class_create_from_typespec): Likewise.
19246         * loader.c (method_from_methodspec): Likewise.
19247         (mono_get_method_from_token): Likewise.
19248         (mono_method_get_header): Likewise.
19249
19250 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
19251
19252         * marshal.c: handle additional GENERICINST case (patch from
19253         Thong Nguyen <tum@veridicus.com>).
19254         Fix a few cases where LDIND_I/STIND_I was used for references.
19255
19256 2006-02-16  Raja R Harinath  <rharinath@novell.com>
19257
19258         * reflection.c (mono_reflection_get_token): Remove unused variable.
19259
19260 2006-02-16  Martin Baulig  <martin@ximian.com>
19261
19262         * reflection.c (mono_reflection_get_token): Add support for fields
19263         in instantiated generic types.
19264
19265         * icall.c
19266         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
19267
19268 2006-02-15  Martin Baulig  <martin@ximian.com>
19269
19270         * icall.c
19271         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
19272         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
19273         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
19274         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
19275
19276 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
19277
19278         * class.c, metadata.c, metadata.h, object.c, icall.c,
19279         marshal.c: changed mono_type_get_underlying_type () to do
19280         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
19281         Fixed handling of instantiated generic valuetypes (bug #75479).
19282
19283 2006-02-15  Raja R Harinath  <rharinath@novell.com>
19284
19285         * metadata.c (mono_metadata_decode_signed_value): Simplify.
19286         Delegate to mono_metadata_decode_value, and work on the returned value.
19287
19288         * icall.c (ves_icall_MonoType_GetGenericArguments):
19289         Add consistency check here too.
19290         
19291 2006-02-15  Ankit Jain  <jankit@novell.com>
19292
19293         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
19294         char/short etc.
19295
19296 2006-02-15  Ankit Jain  <jankit@novell.com>
19297
19298         * metadata.c (mono_metadata_decode_signed_value): New function to decode
19299         signed values, used only for representing lower bounds of arrays.
19300         (mono_metadata_parse_array_full): Use new
19301         mono_metadata_decode_signed_value to decode lower bounds.
19302
19303 2006-02-14  Martin Baulig  <martin@ximian.com>
19304
19305         * reflection.c
19306         (mono_reflection_get_token): Support "MonoGenericMethod" and
19307         "MonoGenericCMethod" and allow generic instances / methods.
19308
19309 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
19310
19311         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
19312         to obtain the terminal size using an ioctl.
19313
19314         * object.c (mono_nullable_init): Revert this as nullable reference
19315         types are not valid.
19316         (mono_nullable_box): Ditto.
19317
19318 2006-02-09  Dick Porter  <dick@ximian.com>
19319
19320         * threads.c (mono_thread_detach): Drop a reference to the thread
19321         we're detaching.
19322
19323 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
19324
19325         * object.c (mono_nullable_init): Handle nullable reference types.
19326         (mono_nullable_box): Ditto. Fixes #77446.
19327
19328 2006-02-07  Martin Baulig  <martin@ximian.com>
19329
19330         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
19331
19332 2006-02-07  Ankit Jain  <jankit@novell.com>
19333
19334         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
19335         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
19336         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
19337         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
19338         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
19339         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
19340
19341 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
19342
19343         * class.c (mono_class_create_generic): Set type_token as well.
19344
19345         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
19346         compatible with MS.
19347
19348 2006-02-02  Martin Baulig  <martin@ximian.com>
19349
19350         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
19351         has never been used so far.
19352
19353 2006-02-02  Martin Baulig  <martin@ximian.com>
19354
19355         * mono-debug-debugger.h: Changed comment at the top of this file;
19356         the header is not installed, but it's safe to #include it from
19357         within the JIT.
19358
19359         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
19360         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
19361
19362 2006-02-02  Martin Baulig  <martin@ximian.com>
19363
19364         * mono-debug.h
19365         (MonoSymbolTable): Removed the `metadata_info' field.
19366
19367         * mono-debug.c
19368         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
19369
19370         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19371         (mono_debugger_add_builtin_types): Removed.
19372         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
19373         (mono_debugger_create_notification_function): We now operate on a
19374         pre-allocated area; take a `gpointer' and return `void'.
19375
19376         * mono-debug-debugger.c
19377         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
19378         (mono_debugger_add_builtin_types): Removed.
19379
19380 2006-02-02  Martin Baulig  <martin@ximian.com>
19381
19382         * threads.c (mono_debugger_create_all_threads): New public method.
19383
19384 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
19385
19386         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
19387         breaks on several platforms.
19388
19389 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
19390
19391         * assembly.c: the VS.NET build doesn't supply default values for
19392         MONO_ASSEMBLIES and MONO_CFG_DIR.
19393
19394 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
19395
19396         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
19397         helper function.
19398
19399         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
19400
19401         * loader.c (method_from_memberref): Fix a warning.
19402
19403         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
19404
19405         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
19406         with explicit layout. Fixes #77433.
19407
19408 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
19409
19410         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
19411         max_interface_id is initialized before using it. Fixes #77398.
19412         (ves_icall_Type_GetInterfaces): Ditto.
19413
19414 2006-01-30  Raja R Harinath  <rharinath@novell.com>
19415
19416         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19417         allocate memory for parameter attributes when parsing memberref
19418         signatures.
19419         * loader.c (mono_loader_set_error_method_load): Don't warn.
19420         (method_from_memberref): Ensure MissingMethodException gets thrown
19421         if method is not found.  Make warning more informative.
19422
19423 2006-01-29  Raja R Harinath  <harinath@gmail.com>
19424
19425         Fix #77397
19426         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
19427         return true if is byref.
19428         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
19429         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
19430         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
19431
19432 2006-01-27  Raja R Harinath  <rharinath@novell.com>
19433
19434         Fix tests/find-method.2.il
19435         * loader.c (find_method, find_method_in_class): Remove is_inflated
19436         argument.  Revert 2006-01-18 change.
19437         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
19438         is generic, search for method in its generic definition.
19439         * class.c (mono_class_setup_vtable_general): Print generic
19440         arguments of generic types in debugging printf.
19441
19442 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
19443
19444         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
19445
19446         * threads.c (mono_threads_request_thread_dump): New helper function.
19447
19448 2006-01-25  Raja R Harinath  <rharinath@novell.com>
19449
19450         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
19451
19452 2006-01-25  Ankit Jain  <jankit@novell.com>
19453
19454         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
19455         move definition to ..
19456         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
19457         
19458 2006-01-25  Ankit Jain  <jankit@novell.com>
19459             Raja R Harinath  <rharinath@novell.com>
19460
19461         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
19462         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
19463         as necessary.
19464
19465 2006-01-25  Martin Baulig  <martin@ximian.com>
19466
19467         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
19468         `MonoDebuggerThread' into debug-debugger.c.
19469
19470 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
19471
19472         * profiler.c: fix printing of data.
19473
19474 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
19475
19476         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
19477           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
19478
19479 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
19480
19481         * object.c: fix deadlock related to string interning.
19482
19483 2006-01-23  Martin Baulig  <martin@ximian.com>
19484
19485         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19486
19487         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
19488
19489 2006-01-23  Martin Baulig  <martin@ximian.com>
19490
19491         * mono-debug.h: Moved the prototypes of some functions which are
19492         used by the JIT here from mono-debug-debugger.h.
19493
19494 2006-01-21  Martin Baulig  <martin@ximian.com>
19495
19496         * Makefile.am: Don't install mono-debug-debugger.h.
19497
19498 2006-01-21  Martin Baulig  <martin@ximian.com>
19499
19500         * mono-debug-debugger.h: Enforce the private status of this header
19501         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
19502         Moved some stuff from mono-debugger-jit-wrapper.h here.
19503
19504 2006-01-20  Raja R Harinath  <rharinath@novell.com>
19505
19506         * class.c (mono_class_from_typeref): Add a sanity test to help
19507         catch lack of assembly load/search hooks.
19508
19509 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
19510
19511         * marshal.c (emit_struct_conv): Relax the fields with same offset
19512         check even more. Fixes #77230.
19513
19514 2006-01-18  Martin Baulig  <martin@ximian.com>
19515
19516         * loader.c (find_method_in_class): Added `gboolean is_inflated'
19517         argument; if false, we compare the uninstantiated signatures.
19518         (method_from_memberref): Compare the uninstantiated signatures;
19519         fixes #76417.
19520
19521 2006-01-18  Robert Jordan  <robertj@gmx.net>
19522
19523         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
19524         Clear the weak link. Fixes bug #77170.
19525
19526         * gc.c (mono_gchandle_free):
19527         Reflect *-gc.c changes (tiny optimization).
19528
19529 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
19530
19531         * metadata.c (mono_metadata_signature_dup): Applied patch from
19532         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
19533         Fixes #77288.
19534
19535 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
19536
19537         * marshal.c (emit_struct_conv): Allow fields with the same offset when
19538         marshalling from native to managed code. Fixes #77230.
19539
19540 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19541
19542         * threadpool.c: fix problem (Mac only) when more than one asynchronous
19543         connect. Fixes bug #77020.
19544
19545 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
19546
19547         * class.c: fixed id assignement for nested interfaces (bug #77275).
19548         Added also better info for --print-vtable debugging.
19549
19550 2006-01-12  Martin Baulig  <martin@ximian.com>
19551
19552         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
19553         interfaces on-the-fly; fixes #76625.
19554
19555         * class-internals.h
19556         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
19557         don't need that anymore.
19558
19559 2006-01-12  Miguel de Icaza  <miguel@novell.com>
19560
19561         * socket-io.c
19562         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
19563         To avoid initing the nested_classes when not needed I turned the
19564         PeerCredData as a toplevel internal class, as it has to be shared
19565         anyways. 
19566
19567         Fixes the CASA issue.
19568
19569 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
19570
19571         * domain.c: Accessors for MonoJitInfo
19572
19573         * profiler-private.h: Add jitinfo to the end jit hook
19574
19575         * profiler.[ch]: Define new hooks, called after jitting which give
19576         the MonoJitInfo that was compiled
19577
19578 2006-01-10  Martin Baulig  <martin@ximian.com>
19579
19580         * class.c (mono_class_setup_events): Add support for generic
19581         classes; fixes #76440.
19582
19583 2006-01-06  Raja R Harinath  <rharinath@novell.com>
19584
19585         Fix #77160.
19586         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
19587         on passed-in method.
19588
19589 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19590
19591         * object.c (mono_runtime_invoke_array): Add Nullable support.
19592
19593         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
19594
19595 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
19596
19597         * file-io.c: Don't consider sockets as directory and avoid an endless
19598         loop. Fix bug #76966.
19599
19600 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19601
19602         * object.c (mono_nullable_init): New helper function.
19603         (mono_nullable_box): Ditto.
19604
19605         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
19606
19607         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
19608
19609         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
19610         
19611 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
19612
19613         * class.c (mono_class_is_assignable_from): Make T assignable to 
19614         Nullable<T>.
19615
19616 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
19617
19618         * appdomain.c: Bump corlib version to 46.
19619         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
19620         serialization purpose) and changed ves_icall_System_Reflection_
19621         Assembly_get_code_base signature to accept a boolean (to escape, or 
19622         not, the assembly code base).
19623
19624 2005-12-23  Dick Porter  <dick@ximian.com>
19625
19626         * icall.c: 
19627         * threads-types.h: 
19628         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
19629         CreateEvent icall now returns "created" boolean parameter.
19630
19631 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
19632
19633         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
19634         #76967.
19635
19636         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
19637         when attr_klass is an interface. Fixes #77045.
19638
19639 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
19640
19641         * marshal.c (emit_struct_conv): Fix previous patch.
19642         
19643         * marshal.c (emit_struct_conv): Add a check for fields with the same
19644         offset.
19645
19646 2005-12-20  Raja R Harinath  <rharinath@novell.com>
19647
19648         Fix regression in Mono.C5.
19649         * class.c (mono_class_create_generic): If 'klass' is an interface
19650         set up the interface offsets.
19651         (mono_class_is_assignable_from): Don't throw away generic arguments.
19652
19653 2005-12-19  Raja R Harinath  <rharinath@novell.com>
19654
19655         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
19656         type parameters.
19657
19658 2005-12-15  Raja R Harinath  <rharinath@novell.com>
19659
19660         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
19661         dead store.
19662         (do_mono_metadata_parse_generic_class): Don't pass the current
19663         generic context when parsing the type being instantiated: it
19664         cannot use it, anyway.
19665
19666         * loader.c (method_from_memberref): Don't inflate a signature if
19667         it doesn't contain any type parameters.
19668
19669 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
19670
19671         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
19672
19673 2005-12-14  Martin Baulig  <martin@ximian.com>
19674
19675         * class.c
19676         (mono_type_get_name_recurse): Don't return null for type
19677         parameters and open generic classes.
19678         (mono_class_setup_methods): Don't exclude generic instances.
19679         (mono_get_unique_iid): Use different IDs for different
19680         instantiations of the same generic type.
19681         (mono_class_setup_vtable): Only use setup_generic_vtable() for
19682         open generic instances; create a normal vtable for closed generic
19683         instances.
19684         (mono_class_setup_vtable_general): We're now also called for
19685         closed generic instances.
19686
19687         * reflection.c
19688         (mono_reflection_bind_generic_parameters): Correctly use
19689         mono_metadata_lookup_generic_inst() everywhere.
19690
19691 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
19692
19693         * object.c (mono_class_create_runtime_vtable): Call 
19694         mono_class_setup_vtable ().
19695
19696         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
19697         function.
19698         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
19699         #76959.
19700
19701         * loader.c (mono_loader_set_error_type_load): Print the type load
19702         warnings to the console so they are more visible to the user.
19703         (mono_loader_set_error_method_load): Ditto.
19704
19705         * reflection.c (ensure_runtime_vtable): Revert the last change as it
19706         is still broken.
19707         
19708         * reflection.c (ensure_runtime_vtable): Fix build.
19709
19710         * reflection.c (ensure_runtime_vtable): Disable an optimization which
19711         doesn't work in all cases.
19712
19713 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
19714
19715         * object.c (mono_array_new_full): Treat a single dimensional array
19716         with 0 lower bounds as an szarray. Fixes #76973.
19717
19718         * reflection.c (custom_attr_visible): Really fix this.
19719
19720 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
19721
19722         * reflection.c (custom_attr_visible): Allow nested public attributes
19723         as well.
19724
19725         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
19726         interface check.
19727
19728 2005-12-12  Raja R Harinath  <harinath@gmail.com>
19729
19730         * class.c (set_generic_param_owner): Delete.
19731         (mono_class_create_from_typedef): Don't set ->owner field of
19732         generic parameters to "param containers" of enclosing classes.
19733         * reflection.c (mono_reflection_initialize_generic_parameter):
19734         Likewise.
19735
19736 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
19737
19738         * reflection.c (custom_attr_visible): Fix build.
19739
19740 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
19741
19742         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
19743         private attributes.
19744         
19745         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
19746         handling of null parameter defaults.
19747
19748 2005-12-09  Raja R Harinath  <rharinath@novell.com>
19749
19750         * class.c (mono_class_from_generic_parameter): Don't set
19751         klass->generic_container.
19752         (my_mono_class_from_generic_parameter): Likewise.
19753
19754 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
19755
19756         * reflection.c (load_public_key): Fix a warning.
19757         (method_encode_code): Fix unaligned accesses.
19758
19759 2005-12-07  Martin Baulig  <martin@ximian.com>
19760
19761         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
19762
19763         * reflection.c
19764         (write_generic_param_entry): Encode our custom attrs.
19765
19766         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
19767
19768 2005-12-07  Martin Baulig  <martin@ximian.com>
19769
19770         * reflection.c (encode_new_constraint): Removed; we don't use the
19771         `NewConstraintAttribute' anymore.
19772
19773 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
19774
19775         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
19776         not fire a TypeResolve event when Assembly.GetType () is called.
19777
19778 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
19779
19780         Beginning of support for nullable types in the runtime. Parts of
19781         this patch are from Martin.
19782
19783         * appdomain.c (MONO_CORLIB_VERSION): Bump
19784
19785         * domain.c (mono_init_internal): get the nullable type
19786
19787         * class.c (mono_class_is_nullable): New method
19788         (mono_class_get_nullable_param): New mehod
19789         (mono_class_create_generic): In types T? set cast_class to T
19790
19791         * class-internals.h (MonoDefaults): new nullable default class
19792         (mono_class_get_nullable_param, mono_class_get_nullable_param):
19793         new methods.
19794
19795 2005-12-05  Raja R Harinath  <rharinath@novell.com>
19796
19797         * metadata.c (select_container): New.  Refactor code to select the
19798         appropriate GenericContainer given the type of generic parameter
19799         we are looking for.
19800         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
19801         not a MonoGenericContext.  Use select_container.  Update parameters.
19802         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
19803         and MONO_TYPE_MVAR.
19804         (unwrap_arrays): Remove duplicate tests.
19805         (find_generic_param): Rename from 'has_same_context'.  Now walks a
19806         generic instantiated class to find any arguments that are generic
19807         parameters.
19808         (mono_type_create_from_typespec_full): Use find_generic_param to
19809         avoid evicting some generic instantiations from the typespec
19810         cache.
19811
19812 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
19813
19814         * reflection.c: fixed writing of doubles on ARM FPA.
19815
19816 2005-12-02  Robert Jordan  <robertj@gmx.net>
19817
19818         * icall.c: Fixed EventInfo.ReflectedType (#76829).
19819
19820 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19821
19822         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
19823         least on SUSE 10 they are not the same (on debian, they are just the
19824         same thing).
19825
19826 2005-12-01  Raja R Harinath  <rharinath@novell.com>
19827
19828         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
19829         DeclaringType for VARs and MVARs.
19830         * class.c (set_generic_param_owner): Fix initialization of owner
19831         fields.
19832
19833 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
19834
19835         * icall.c: fixed Enum.ToObject() to correctly convert the values.
19836
19837 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19838
19839         * threadpool.c: workaround for a bug that shows up on the Mac:
19840         select()+connect() on a blocking socket is not like it should
19841         be, so we proceed to connect() in that case, wasting the I/O
19842         threadpool thread until connect succeedes. Fixes bug #75436.
19843
19844 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19845
19846         * threadpool.c: fix typo when setting file descriptor states.
19847
19848 2005-11-28  Raja R Harinath  <rharinath@novell.com>
19849
19850         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
19851         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19852         create a temporary signature container.
19853         (mono_metadata_parse_generic_param): Update to changes.
19854         (mono_type_create_from_typespec_full): Update to changes.
19855         * loader.c (method_from_memberref): Don't use a
19856         MonoGenericContainer while parsing a memberref signature.
19857         (method_from_methodspec): Remove dead-store of the 'container'
19858         variable.  It's overwritten before use.
19859
19860         * metadata.c (mono_type_create_from_typespec_full): Make debugging
19861         checks tighter.
19862         (mono_metadata_parse_generic_param): Likewise.
19863         * loader.c (find_method_in_class): Does not need a
19864         MonoGenericContainer.  Use 'mono_method_signature' rather than
19865         'mono_method_signature_full'.
19866         (find_method, mono_get_method_constrained, method_from_memberref):
19867         Update to changes.
19868
19869         * metadata.c (mono_type_create_from_typespec_full): Ensure that
19870         owner-less generic-parameters are never evicted from the typespec
19871         cache.
19872
19873         * loader.c (method_from_memberref): Don't use the current context
19874         when parsing signatures.
19875         (method_from_methodspec, mono_get_method_from_token): Update to changes.
19876
19877         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
19878         side-effects in g_assert.
19879         * loader.c (mono_get_method_from_token): Resolve klass earlier so
19880         that we don't potentially lose information.
19881
19882 2005-11-26  Dick Porter  <dick@ximian.com>
19883
19884         * icall.c:
19885         * threads.c: icalls to implement basic (ie, not named)
19886         System.Threading.Semaphore.
19887
19888 2005-11-24  Dick Porter  <dick@ximian.com>
19889
19890         * process.c
19891         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
19892         Use GetProcessId() if it's available.
19893
19894 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
19895
19896         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
19897
19898 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19899             Ankit Jain  <jankit@novell.com>
19900
19901         * loader.c (mono_get_method_from_token): Initialize 'method' field
19902         of all generic parameters before parsing the signature.  Remove
19903         code that "fixed"-up MVAR references.
19904
19905 2005-11-23  Ankit Jain  <jankit@novell.com>
19906
19907         * metadata.c (mono_metadata_has_generic_params):
19908         (mono_metadata_load_generic_param_constraints):
19909         (mono_metadata_load_generic_params): Move duplicate code ...
19910         (mono_metadata_get_generic_param_row): ... here. Returns the
19911         first row-id in GenericParam table for a given owner (token).
19912         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
19913         prototype.
19914
19915 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19916             Ankit Jain  <jankit@novell.com>
19917
19918         * metadata.c (mono_metadata_class_equal): Pass signature_only when
19919         comparing VARs too.
19920         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
19921         type->data.generic_param only if the type is an MVAR.
19922         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
19923         leak owner-less VARs and MVARs into managed space.
19924
19925 2005-11-21  Martin Baulig  <martin@ximian.com>
19926
19927         * class-internals.h
19928         (MonoMethod): Moved the `generic_container' here from
19929         `MonoMethodNormal' since we now also need it for
19930         `MonoMethodPInvoke';
19931         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
19932         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
19933         an union containing both `MonoMethodNormal' and
19934         `MonoMethodPInvoke'.
19935
19936         * loader.c
19937         (mono_get_method_from_token): Allow implementing generic methods
19938         as interncalls.
19939
19940         * threads.c
19941         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
19942         icall.
19943
19944 2005-11-17  Dick Porter  <dick@ximian.com>
19945
19946         * icall.c: 
19947         * process.h: 
19948         * process.c: Split the Process Start_internal icall into
19949         ShellExecuteEx_internal and CreateProcess_internal, which are
19950         called depending on whether UseShellExecute is true.  Fixes bug
19951         76670.
19952
19953         * appdomain.c (MONO_CORLIB_VERSION): Incremented
19954
19955 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
19956
19957         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
19958         'msize' parameters, use the information in 'mspec' instead.
19959         (emit_object_to_ptr_conv): Ditto.
19960
19961         * marshal.c (emit_struct_conv): Handle explicit layout structs with
19962         fields out of order. Fixes #76733.
19963
19964 2005-11-17  Ankit Jain  <jankit@novell.com>
19965
19966         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
19967
19968 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
19969
19970         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
19971           bug #76575.
19972
19973 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19974
19975         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
19976         for types with non-auto layout. Fixes #76717.
19977
19978 2005-11-16  Ankit Jain  <jankit@novell.com>
19979
19980         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
19981         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
19982         if generic_context is null.
19983           (mono_metadata_generic_param_equal): param->owner can be null.
19984           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
19985         null.
19986
19987 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19988
19989         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
19990         the correct value.
19991
19992 2005-11-15  Martin Baulig  <martin@ximian.com>
19993
19994         * object.c (set_value): Use mono_class_from_mono_type() instead of
19995         the hack for generic instances; fixes #76136.
19996
19997 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
19998
19999         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
20000         fields.
20001
20002         * image.c (load_metadata_ptrs): Initialize the new fields.
20003
20004         * reflection.c (create_dynamic_mono_image): Ditto.
20005
20006         * reflection.c (build_compressed_metadata): Use the new fields.
20007
20008         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
20009         icall.
20010
20011         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
20012         icall.
20013         
20014 2005-11-15  Ankit Jain  <jankit@novell.com>
20015             Raja R Harinath  <harinath@gmail.com>
20016
20017         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
20018         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
20019         new per-generic_container cache if the cached MonoType's context matches
20020         the current context.
20021           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
20022         to the expected context.
20023           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
20024
20025 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20026
20027         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
20028         we changed the signature of an icall.
20029         * icall.c: Modify to mono_double_ParseImpl return true/false 
20030         depending on the success, instead of throwing the exception. This will
20031         help us in Double.TryParse methods.
20032         
20033 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
20034
20035         * marshal.c (emit_marshal_object): Throw an exception when
20036         marshalling 'object' instead of crashing. Fixes #76696.
20037
20038 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
20039
20040         * class-internals.h: Add prototype for mono_type_get_full_name ().
20041
20042 2005-11-11  Dick Porter  <dick@ximian.com>
20043
20044         * threads.c (mono_thread_manage): Make sure the main thread has
20045         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
20046
20047 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
20048
20049         * loader.c (mono_loader_set_error_type_load): Log a warning to the
20050         console about the missing type.
20051         (mono_loader_set_error_method_load): Ditto.
20052
20053 2005-11-09  Miguel de Icaza  <miguel@novell.com>
20054
20055         * mono-config.c (mono_get_config_dir): Set the system defaults if
20056         none is specified.
20057
20058         * assembly.c (mono_set_dirs): New API entry point to set the
20059         assembly and the config directory in one call
20060
20061 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
20062
20063         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
20064         the ftnptr was created from a delegate in a domain other than the
20065         current domain. Fixes #75377.
20066
20067         * exception.h exception.c: Add mono_get_exception_not_supported ().
20068
20069 2005-11-08  Martin Baulig  <martin@ximian.com>
20070
20071         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
20072
20073 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
20074
20075         * security-manager.h: Added definitions to deal with strongname key 
20076         pairs bigger (and smaller) than 1024 bits.
20077         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
20078         adjust wrt the public key length being used.
20079
20080 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
20081
20082         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
20083           Windows build (r51396-51397).
20084
20085 2005-11-03  Martin Baulig  <martin@ximian.com>
20086
20087         * class.c (mono_class_setup_vtable_general): Also add generic
20088         methods to the vtable; fixes #76581.
20089
20090 2005-11-01  Miguel de Icaza  <miguel@novell.com>
20091
20092         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
20093         sure that we lookup GetString method from the System.Text.Encoding
20094         class, not the derived class or we get an empty method.
20095
20096         Fixed class #76612.
20097
20098 2005-10-25  Miguel de Icaza  <miguel@novell.com>
20099
20100         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
20101         if it has been previously set (embedders). 
20102
20103         Make mono_set_rootdir available also on Unix.
20104
20105 005-10-24  Robert Jordan  <robertj@gmx.net>
20106
20107         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
20108
20109 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
20110
20111         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
20112         only calls which are made to native code use this flag.
20113
20114         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
20115
20116 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
20117
20118         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
20119         Add support for FieldBuilders.
20120
20121 2005-10-29  Martin Baulig  <martin@ximian.com>
20122
20123         * mono-debug.c
20124         (mono_debug_using_mono_debugger): New public method; returns
20125         whether we're running inside the debugger.
20126
20127 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
20128
20129         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
20130         for Method/Constructor/FieldBuilders.
20131
20132 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
20133
20134         * reflection.c (module_add_cattrs): Save custom attributes for global methods
20135         and fields as well.
20136
20137 2005-10-26  Martin Baulig  <martin@ximian.com>
20138
20139         * mono-debug-debugger.c
20140         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
20141
20142 2005-10-24  Raja R Harinath  <harinath@gmail.com>
20143
20144         * icall.c (base64_to_byte_array): Don't pass an out-of-range
20145         integer to isspace.
20146
20147 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
20148
20149         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
20150         when passing valuetypes byref. Fixes #76502.
20151
20152 2005-10-19  Jackson Harper  <jackson@ximian.com>
20153
20154         * profiler.c: Don't put a . in front of types that are not in a
20155         namespace.
20156
20157 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
20158
20159         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
20160
20161 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
20162
20163         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
20164         #76436.
20165         (mono_marshal_get_ldflda_wrapper): Fix a warning.
20166
20167 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20168
20169         * assembly.c metadata-internals.h icall.c: Define an additional
20170         parameter for mono_assembly_name_parse_full, so we can avoid creating
20171         S.R.AssemblyName.Version when no version info wasn't passed.
20172         
20173 2005-10-09  Miguel de Icaza  <miguel@novell.com>
20174
20175         * class.c (mono_type_get_full_name): Reimplement method that was
20176         removed. 
20177
20178         * image.c: Some docs
20179
20180 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
20181
20182         * profiler.c (output_newobj_profile): Fix printing of Total memory
20183         on x86.
20184
20185 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
20186
20187         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
20188
20189 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
20190
20191         * threads.c: remove debug output.
20192
20193 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
20194
20195         * threads.c (mono_thread_manage): Fix crashes if more than 64
20196         threads need to be aborted. Hopefully fixes #75899.
20197
20198         * assembly.c (mono_stringify_assembly_name): New helper function.
20199
20200         * class.c: Use mono_stringify_assembly_name instead of the similar
20201         static function.
20202
20203         * assembly.h assembly.c: Add support for calling a postload search 
20204         hook if an assembly cannot be loaded.
20205
20206         * appdomain.c: Register new search hooks which call the AssemblyResolve
20207         events in AppDomain. Fixes #75231
20208
20209 2005-10-07  Martin Baulig  <martin@ximian.com>
20210
20211         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
20212         methods without debug info.
20213
20214 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
20215
20216         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
20217         wrappers.
20218
20219 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20220
20221         * file-io.c: now that we return symlinks, use lstat and, when the file
20222         is a symbolic link, stat, to get the file attributes. Also avoid the
20223         conversion to/from utf16/external.
20224
20225 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
20226
20227         * class.c (mono_class_layout_fields): Compute klass->has_references
20228         correctly if an embedded valuetype is not yet initialized. Fixes
20229         #76331.
20230
20231 2005-10-04  Martin Baulig  <martin@ximian.com>
20232
20233         * metadata.c
20234         (mono_metadata_load_generic_param_constraints): New public
20235         function; splitted the constraints loading out from
20236         mono_metadata_load_generic_params().
20237
20238         * class.c (mono_class_create_from_typedef): Call
20239         mono_metadata_load_generic_param_constraints() after setting up
20240         the type and creating our parent; fixes #75329.
20241
20242 2005-10-04  Martin Baulig  <martin@ximian.com>
20243
20244         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
20245         non-dynamic parent classes.
20246
20247 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
20248
20249         * file-io.c : win32 build fix (ETXTBSY seems not found).
20250
20251 2005-10-04  Martin Baulig  <martin@ximian.com>
20252
20253         * reflection.c
20254         (mono_image_get_methodspec_token): Make the cache actually work;
20255         fixes #75974.
20256
20257 2005-10-04  Martin Baulig  <martin@ximian.com>
20258
20259         * class.c (mono_class_name_from_token): Removed the unneccessary
20260         `MonoGenericContext *' argument.
20261
20262 2005-10-04  Martin Baulig  <martin@ximian.com>
20263
20264         * loader.c
20265         (method_from_methodspec): Make the caching work again; fixes the
20266         performance regression from #76262.
20267
20268 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20269
20270         * file-io.c:
20271         * file-io.h:
20272         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
20273         GetFileSystemEntries that performs the same work but without going
20274         into io-layer, locking, etc.
20275
20276 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
20277
20278         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
20279         ThreadState_Stopped as well. Fixes #76047.
20280
20281 2005-09-29  Martin Baulig  <martin@ximian.com>
20282
20283         * class.c
20284         (inflate_generic_context): If the new context has a `gmethod', set
20285         its `container' that that gmethod's `container'.
20286
20287         * metadata.c
20288         (mono_metadata_parse_generic_param): Simplify things;
20289         `generic_container = generic_context->container;' is just fine.
20290
20291         * loader.c (method_from_methodspec): Code cleanups.
20292
20293 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
20294
20295         * decimal.c: fix warning (and let gcc generate correct
20296         code on ARM with optimizations).
20297
20298 2005-09-28  Martin Baulig  <martin@ximian.com>
20299
20300         * loader.c
20301         (method_from_memberref): Added `MonoGenericContext *class_context'
20302         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
20303         (method_from_methodspec): If we're a memberref, use the enclosing
20304         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
20305
20306 2005-09-28  Martin Baulig  <martin@ximian.com>
20307
20308         * object.c (mono_runtime_invoke_array): Added support for
20309         MONO_TYPE_GENERICINST; fixes #75917.
20310
20311 2005-09-27  Martin Baulig  <martin@ximian.com>
20312
20313         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
20314         `k->byval_arg.type' to determine the actual type.
20315
20316         * loader.c (method_from_methodspec): Removed some hacks.
20317
20318 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
20319
20320         * class-internals.h (mono_field_is_deleted): Do the test for
20321         rtspecialname before we check the actual name of the field. This
20322         prevents us from dereferencing a pointer into the string table,
20323         saving us from accessing a few pages
20324
20325         * *.c: Replace the use of {Enter,Leave}CriticalSection with
20326         macros. This will allow a deadlock debugger to easily be plugged
20327         in.
20328
20329 2005-09-27  Martin Baulig  <martin@ximian.com>
20330
20331         * loader.c (method_from_methodspec): Create a "signature"
20332         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
20333
20334 2005-09-27  Martin Baulig  <martin@ximian.com>
20335
20336         * class.c
20337         (inflate_generic_class): Correctly set the new context's
20338         container.
20339
20340         * loader.c
20341         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
20342         instead of a `MonoGenericContext *'.
20343         (mono_method_signature_full): Take a `MonoGenericContainer *'
20344         instead of a `MonoGenericContext *'.
20345
20346         * metadata.c
20347         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
20348         instead of a `MonoGenericContext *'.
20349         (mono_metadata_parse_method_signature_full): Likewise.
20350
20351 2005-09-26  Martin Baulig  <martin@ximian.com>
20352
20353         * class.c
20354         (mono_class_from_generic_parameter): Set `klass->generic_container'
20355         (mono_class_from_generic_parameter): Likewise.
20356         (mono_bounded_array_class_get): We inherit the generic container
20357         from the element class.
20358
20359         * loader.c
20360         (find_method, find_method_in_class): Take a `MonoGenericContext *'
20361         argument rather than computing it here.
20362         (method_from_memberref): Correctly set the generic context before
20363         parsing the signature.  Fixes #75681.
20364
20365 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
20366
20367         * object.c (mono_class_has_special_static_fields): Fix warnings.
20368
20369 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20370
20371         * assembly.c: Add parse_public_key function, to
20372         par the public keys. Also added mono_assembly_name_parse_full,
20373         to define it the parsed key should be freed or not.
20374         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
20375         to parse a long format assembly name.
20376         * metadata-internals.h: Keep mono_assembly_name_parse_full as
20377         private, since calling it to preserve the key requires
20378         freeing it manually.
20379         
20380 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
20381
20382         * locales.c : removed HAVE_ICU part.
20383
20384 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
20385
20386         * object.c (mono_class_create_runtime_vtable): Avoid calling 
20387         field_is_special_static if the klass has no special static fields.
20388
20389         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
20390         (MonoCachedClassInfo): Likewise.
20391
20392         * object.c (mono_class_has_special_static_fields): New helper function.
20393
20394 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20395
20396         * class.c (mono_class_create_from_typedef): Don't call 
20397         interfaces_from_typedef_full for enums.
20398         (mono_class_create_from_typedef): Compute the base types of enums directly
20399         without calling mono_class_setup_fields ().
20400         (mono_class_find_enum_basetype): New helper function.
20401
20402         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
20403         one place inside the string heap.
20404         
20405 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
20406
20407         * class.c: locking fixes, code cleanups, some docs added.
20408         Allocate some data structures in the image mempool.
20409
20410 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20411
20412         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20413         the example code.
20414         
20415 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
20416
20417         * class-internals.h, class.c, reflection.c: reduce memory taken by
20418         MonoClass.
20419
20420 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
20421
20422         * metadata.c, metadata.h, loader.h: documentation updates, code and
20423         API cleanups.
20424
20425 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20426
20427         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20428         the example code.
20429
20430         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
20431         page faults caused by the runtime while reading metadata.
20432
20433 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20434
20435         * socket-io.c: the field names were changed 3 months ago and no one
20436         realized until bug #76077 got filed!
20437
20438 2005-09-20  Martin Baulig  <martin@ximian.com>
20439
20440         * icall.c (assembly_icalls): Removed some unused debugger icalls.
20441
20442 2005-09-20  Martin Baulig  <martin@ximian.com>
20443
20444         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
20445         write the rank into the class entry.
20446
20447 2005-09-20  Martin Baulig  <martin@ximian.com>
20448
20449         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
20450
20451 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
20452
20453         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20454
20455         * icall.c (custom_attrs_defined_internal): New icall.
20456
20457         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
20458         function.
20459         (mono_custom_attrs_construct_by_type): New helper function.
20460
20461 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
20462
20463         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
20464         terminate the resulting string. Fixes #76123.
20465
20466 2005-09-16  Martin Baulig  <martin@ximian.com>
20467
20468         * mono-debug.c
20469         (mono_debug_add_method): Ignore inflated methods for the moment.
20470
20471 2005-09-14  Martin Baulig  <martin@ximian.com>
20472
20473         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
20474
20475 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
20476
20477         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
20478         return a success/failure indication.
20479         (mono_metadata_interfaces_from_typedef_full): Ditto.
20480         (get_constraints): Ditto.
20481
20482 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
20483
20484         * marshal.c (emit_marshal_array): Fix handling of null arrays.
20485         
20486         * marshal.c (emit_marshal_array): Add support for returning string
20487         arrays from delegates. Fixes #76063.
20488
20489         * marshal.c: Use the emit_ldloc/stloc macros where possible.
20490
20491 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
20492
20493         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
20494         icall.
20495
20496 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
20497
20498         * reflection.c icall.c: Fix after mono_get_exception_type_load
20499         signature change.
20500
20501         * assembly.c (mono_assembly_get_assemblyref): New helper function.
20502         (mono_assembly_load_reference): Use the new helper.
20503
20504         * class-internals.h (MonoLoaderError): New structure containing 
20505         information about type loading errors.
20506
20507         * class-internals.h loader.c: Add APIs to store per-thread loader
20508         error information.
20509
20510         * loader.c class.c: Set the loader error if needed.
20511
20512         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
20513
20514 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
20515
20516         * decimal.c: fixed to handle the broken ARM fp format.
20517
20518 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
20519
20520         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
20521         broken.
20522
20523 2005-09-06  Martin Baulig  <martin@ximian.com>
20524
20525         * domain.c (supported_runtimes): Added v2.0.50727.
20526
20527 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
20528
20529         * culture-info.h: reduce the size of some structures.
20530
20531 2005-09-05  Martin Baulig  <martin@ximian.com>
20532
20533         Reflect latest API changes in the August CTP.
20534
20535         * icall.c
20536         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
20537         ("MonoType.HasGenericArguments"): Removed.
20538         ("MonoMethod.BindGenericParameters"): Renamed to
20539         "MakeGenericMethod".
20540         ("MethodBuilder.BindGenericParameters"): Renamed to
20541         "MakeGenericMethod".    
20542
20543 2005-09-05  Martin Baulig  <martin@ximian.com>
20544
20545         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
20546
20547 2005-09-05  Martin Baulig  <martin@ximian.com>
20548
20549         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20550
20551         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
20552         generic_container is non-NULL.
20553
20554 2005-09-05  Martin Baulig  <martin@ximian.com>
20555
20556         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20557
20558         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
20559
20560 2005-08-29  Michal Moskal  <malekith@nemerle.org>
20561
20562         * reflection.c (encode_locals,
20563         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
20564         for large generic types.
20565
20566 2005-09-05  Martin Baulig  <martin@ximian.com>
20567
20568         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20569
20570         * class.c (mono_dup_array_type): New public method.
20571         (mono_metadata_signature_deep_dup): New public method.
20572         (dup_type): Correctly duplicate array and function types.
20573
20574 2005-09-05  Martin Baulig  <martin@ximian.com>
20575
20576         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20577
20578         * reflection.c (get_default_param_value_blobs): Handle generic types
20579         and generic methods.
20580
20581 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
20582
20583         * class.c: Fixed error reporting (method/class were inversed) for 
20584         inheritance demands.
20585         * security-manager.c|h: Added the AppDomain when calling the managed
20586         System.Security.SecurityManager.InheritanceDemand method.
20587
20588 2005-09-01  Raja R Harinath  <rharinath@novell.com>
20589
20590         * reflection.c (encode_marshal_blob): 'marshaltype' and
20591         'marshaltyperef' are alternate sources for the custom marshaler
20592         name.
20593
20594 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
20595
20596         * class.c: fix creation of array classes with rank == 1
20597         (patch by Ankit Jain <jankit@novell.com>).
20598
20599 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
20600
20601         * object.c: fix check for creating the bound data for arrays vs
20602         szarrays.
20603
20604 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20605
20606         * object.c: configuration file name is now based on the executable name,
20607         not the image name. Fixes bug #75931.
20608
20609 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
20610
20611         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
20612         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
20613
20614 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
20615
20616         * rand.c: Use wincrypt.h instead of WinCrypt.h.
20617
20618 2005-08-24  Ankit Jain  <jankit@novell.com>
20619             Raja R Harinath  <rharinath@novell.com>
20620
20621         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
20622           called by it recursively.
20623           (mono_class_init): Remove special case in pending_init handling, since it's
20624           superseded by the fix to mono_class_from_typeref.
20625
20626 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
20627
20628         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
20629         BROKEN_THREAD_START stuff.
20630
20631 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
20632
20633         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
20634         trampoline.
20635
20636         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
20637         
20638         * object.c (mono_delegate_ctor): Replace the original function address with
20639         a delegate trampoline.
20640
20641 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
20642
20643         * icall.c: add boolean argument to base64_to_byte_array and 
20644         InternalFromBase64String to control whether a whitespace-only string
20645         is allowed (or should casue a FormatException to be thrown). We need
20646         this as the behavior has changed between MS.NET 1.x and 2.0, and we
20647         to match the MS behaviour in both profiles.
20648         * appdomain.c: Bump corlib version.
20649
20650 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20651
20652         This patch implements a big portion of publisher policy
20653         support, used to bind assembly versions and redirect
20654         one assembly from version A to version B.
20655
20656         * assembly.c:
20657         New GSList loaded_assembly_bindings, for storing the cached
20658         assembly bindings.
20659         (assembly_binding_maps_name): New static function for checking if a 
20660         assembly binding information maps an assembly name.
20661         (mono_assembly_binding_info_free): New function for freeing
20662         assembly binding information resources.
20663         (get_publisher_policy_info): New static function for retrieving 
20664         assembly binding information from a MonoImage.
20665         (compare_versions): New static function for comparing an assembly
20666         binding information data and the version of an assembly name.
20667         (check_policy_versions): New static function for checking if an
20668         assembly binding info mapping an assembly name is valid for it.
20669         (mono_assembly_load_publisher_policy): New static function for
20670         loading the 'policy.major.minor.MyAssembly' image for an assembly
20671         with an assembly name 'aname'.
20672         (mono_assembly_bind_version): New static function for updating
20673         assembly redirection.
20674         (mono_assembly_apply_binding): New static function for applying
20675         assembly binding.
20676         (search_binding_loaded): New static function for searching 
20677         loaded assembly binding infos in the cache domain.
20678         (mono_assembly_load_full): Don't apply assembly binding for
20679         reflection only assemblies.
20680
20681         * metadata-internals.h: Add MonoAssemblyBindingInfo,
20682         which contains information about assembly binding. Also
20683         declare signature for mono_config_parse_publisher_policy ()
20684         function, used to retrieve pub policy info.
20685         
20686         * mono-config.c:
20687         (publisher_policy_start): New static function used to parse publisher 
20688         policy config files.
20689         (publisher_policy_parser): New static MonoParseHandler containing 
20690         the functions used when parsing config files.
20691         (mono_config_parse_publisher_policy): New function for parsing
20692         publisher policy files.
20693         
20694 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
20695
20696         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
20697
20698         * marshal.c (mono_delegate_free_ftnptr): Ditto.
20699
20700         * object.c (mono_get_addr_from_ftnptr): New helper function.
20701
20702         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
20703
20704         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20705
20706 2005-08-19  Dick Porter  <dick@ximian.com>
20707
20708         * threads.c, threads.h, appdomain.c, appdomain.h,
20709         profiler-private.h, monitor.c, object.c, object-internals.h,
20710         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
20711         store the thread ID, so it can hold a 64 bit value if needed.
20712
20713 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
20714
20715         * reflection.c (mono_reflection_create_dynamic_method): Store the
20716         handle class into the method references as well so ldtoken works in
20717         dynamic methods.
20718
20719         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
20720         types.
20721
20722 2005-08-19  Ankit Jain <jankit@novell.com>
20723
20724         Fix #75847.
20725         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
20726           here rather than using the method signature of a arbitrary function
20727           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
20728           two arguments.
20729           Hack done with Harinath.
20730
20731 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20732
20733         * threadpool.c: disable printing stack traces when we get a exception
20734         in a threadpool thread. I need to do more testing to figure out which
20735         cases actually print this. Fixes bug #75828.
20736
20737 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20738
20739         * icall.c: there might be ignored whitespace after the last '='. This
20740         fixes length computation and bug #75840.
20741
20742 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
20743
20744         * assembly.c (mono_assembly_load_full): Consider .exe extension as
20745         well. Fixes #75809.
20746
20747         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
20748         #75784.
20749         
20750         * reflection.c (create_custom_attr_data): Ditto.
20751
20752 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
20753
20754         * locales.c, culture-info.h : removed RegionLCIDMap.
20755         * culture-info-tables.h : regenerated.
20756
20757 2005-08-16  Martin Baulig  <martin@ximian.com>
20758
20759         * class.c (mono_type_get_name_recurse): Small fix.
20760
20761 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
20762
20763         * locales.c : indentation fixie.
20764
20765 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
20766
20767         * object-internals.h,
20768           locales.h,
20769           locales.c,
20770           culture-info.h,
20771           icall.c : added RegionInfo table support.
20772         * culture-info-table.h : regenerated for region support.
20773
20774 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
20775
20776         * reflection.c (resolve_object): handle all kinds of MonoMethod
20777         including generic ones
20778
20779 2005-08-12  Ankit Jain <jankit@novell.com>
20780
20781         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
20782           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
20783
20784 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
20785
20786         * process.c: Don't close a thread handle when it's NULL. This is a
20787         workaround for bug #75733.
20788
20789 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
20790
20791         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
20792
20793 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
20794
20795         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
20796
20797 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20798
20799         * threadpool.c: if a work item in the thread pool has a callback that
20800         catches a exception, don't propagate it after invoking the callback.
20801         Fixes bug #75336.
20802
20803 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
20804
20805         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
20806
20807         * class-internals.h (MonoCachedClassInfo): Add some new fields.
20808
20809         * class.c (mono_class_init): Load field info lazily in the AOT case.    
20810
20811         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
20812
20813 2005-08-03  Ankit Jain  <jankit@novell.com>
20814
20815         Fix #75683.
20816         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
20817           PInvoke calling convention is 0.
20818
20819 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
20820
20821         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
20822         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
20823
20824 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
20825
20826         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
20827         to handle threads not started by the GC (patch by Michael Meeks
20828         <michael.meeks@novell.com>).
20829
20830 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
20831
20832         * reflection.c: Make buffer used in emitting types larger for some
20833         big generic types (patch by Michal Moskal).
20834
20835 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
20836
20837         * mono-debug.c: Fix some (not all) alignment problems.
20838
20839 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20840
20841         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
20842         Invoke mono_image_load_from_data_full passing the refonly
20843         parameter.
20844
20845         * assembly.c
20846         (mono_assembly_open_from_bundle): Add the refonly argument, 
20847         in order to pass it to other methods it calls to.
20848         (do_mono_assembly_open): Add the refonly argument, in order 
20849         to pass it to other methods it calls to.
20850         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
20851         the refonly parameter to it.
20852
20853         * image.c: Add loaded_images_refonly_hash and
20854         loaded_images_refonly_guid_hash to cache the reflection
20855         only loaded images.
20856         (mono_images_init): Initialize the hash tables used for
20857         caching the reflection only images.
20858         (load_modules): Invoke mono_image_open_full passing the refonly
20859         parameter to load the modules the correct way.
20860         (build_guid_table): Add the refonly argument, to re-build the 
20861         correct hash table.
20862         (do_mono_image_open): Added the refonly argument, in order to
20863         define it for the loaded image.
20864         (mono_image_loaded_full): New function, which receives an
20865         additional parameter to look for the image in the refonly or
20866         non-refonly section.
20867         (mono_image_loaded): Updated, using mono_image_loaded_full.
20868         (mono_image_loaded_by_guid_full): The same case that happens
20869         with mono_image_loaded_full.
20870         (mono_image_loaded_by_guid): Likewise.
20871         (register_image): Use the ref_only variable inside MonoImage
20872         to decide in which hash table store the current image.
20873         (mono_image_open_from_data_full): Rename
20874         mono_image_open_from_data to mono_image_open_from_data_full,
20875         adding the refonly argument, to define the ref_only variable 
20876         inside MonoImage.
20877         (mono_image_open_from_data): Return 
20878         mono_image_open_from_data_full.
20879         (mono_image_open_full): Rename mono_image_open to
20880         mono_image_open_full, receiving the new refonly argument,
20881         to pass it to inner methods.
20882         (mono_pe_file_open): Update this function, to open
20883         a MonoImage as a non-refonly image.
20884         (mono_image_close): Use the refonly variable inside
20885         MonoImage to remove the image from the correct caches.
20886
20887         * image.h: Add the signatures of mono_image_open_full,
20888         mono_image_open_from_data_full, mono_image_loaded_full,
20889         mono_image_loaded_by_guid_full.
20890
20891         * metadata-internals.h: Add the ref_only field to 
20892         MonoImage.
20893         
20894 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20895
20896         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
20897         Fix the last behavior, which used to load the assemblies and
20898         extract MonoReflectionAssemblyName information, instead of
20899         extract it from the metadata tables. Needed for Reflection
20900         Only assemblies.
20901         
20902 2005-07-29  Martin Baulig  <martin@ximian.com>
20903
20904         * mono-debug-debugger.c
20905         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
20906         not initialized.
20907
20908         * mono-debug.c
20909         (mono_debug_address_from_il_offset): Check whether we have
20910         debugging support before attempting to take the lock.
20911         (mono_debug_source_location_from_address): Likewise.
20912         (mono_debug_source_location_from_il_offset): Likewise.
20913         (mono_debug_il_offset_from_address): Likewise.
20914         (mono_debug_address_from_il_offset): Likewise.
20915
20916 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
20917
20918         * class.c (mono_class_from_name_case): Add support for dynamic images.
20919         Fixes #75650.
20920
20921         * object.c (mono_class_compute_gc_descriptor): Add a workaround
20922         for #75479.
20923
20924 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20925         
20926         * reflection.c (mono_method_get_object): Fix warning.
20927
20928 2005-07-28  Martin Baulig  <martin@ximian.com>
20929
20930         * mono-debug.c
20931         (mono_debug_add_wrapper): Also write the wrapper type.
20932
20933 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20934
20935         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
20936         
20937         * class.c (mono_class_init): Avoid reading nested classes if the AOT
20938         data indicates the class has none.
20939
20940 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
20941
20942         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
20943         loader lock with the debugger lock. Prevents deadlocks for beagle.
20944
20945         Beagle can now run on an smp box for a weekend without any
20946         issues. Woohoo!
20947
20948 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
20949
20950         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
20951         in a module. Fixes #75629.
20952
20953 2005-07-26  Martin Baulig  <martin@ximian.com>
20954
20955         * mono-debug.c (mono_debug_add_wrapper): New static method.
20956         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
20957         interncall or a wrapper.
20958
20959         * mono-debug.h (MonoDebugWrapperData): New public typedef.
20960         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
20961         (MONO_DEBUGGER_VERSION): Bump to 51.
20962
20963         * mono-debug-debugger.c
20964         (mono_debugger_add_type): Removed this empty function.
20965         (mono_debugger_add_method): Likewise.
20966
20967 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
20968
20969         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
20970         before accessing method->slot.
20971
20972 2005-07-21  Jb Evain  <jbevain@gmail.com>
20973
20974         * reflection.c (method_encode_clauses/class): Handle filters clauses.
20975         Fixes #75010.
20976
20977 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
20978
20979         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
20980         #75587.
20981
20982 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
20983
20984         * image.h image.c: Add mono_image_get_guid () API function.
20985
20986 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
20987
20988         There were issues when multiple threads tried to load
20989         assemblies. A deadlock was created between assemblies_mutex and
20990         mono_domain_assemblies_lock. This fixes the issue by making the
20991         assembly ref counting be lock free. See bug 75586.
20992         
20993         * image.c (mono_image_close): The add ref function here was using
20994         Interlocked operations while the unref was using a mutex and a
20995         --. I don't think this was ever a bug that would be exposed in a
20996         non-pendantic way (ie, by an embedder doing a ref on one thread
20997         and an unref on another), but for the sake of correctness, this is
20998         now Interlocked.
20999
21000         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
21001         (mono_assembly_load_reference): Call mono_assembly_addref rather
21002         than touching the refcount ourselves.
21003         (mono_assembly_close): Use InterlockedDecrement to unref the
21004         assembly. Don't acquire the lock unless it is actually needed.
21005
21006 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
21007
21008         * class.c (mono_class_layout_fields): Fix calculation of has_references
21009         for generic types.
21010
21011 2005-07-12  Martin Baulig  <martin@ximian.com>
21012
21013         Applying a patch from Michal Moskal <malekith@nemerle.org>.
21014
21015         * metadata.c
21016         (mono_type_hash): Provide better hashing for generic instances.
21017         (mono_generic_inst_hash): Improve hashing.
21018         (mono_generic_class_hash): Likewise.
21019
21020         * reflection.c (mymono_metadata_type_hash): Improve hashing for
21021         generic instances.
21022
21023 2005-07-12  Martin Baulig  <martin@ximian.com>
21024
21025         * reflection.c (mono_reflection_create_runtime_class): Remove the
21026         hack for generic type definitions and non-`Run' assemblies.
21027         (mono_reflection_bind_generic_parameters): Also use
21028         `klass->wastypebuilder' to check for TypeBuilders.
21029
21030 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
21031
21032         * class.c (mono_class_layout_fields): Fix calculation of has_references
21033         for generic types.
21034
21035         * class.c (inflate_generic_class): Fix a leak.
21036         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
21037         for generic types.
21038
21039 2005-07-11  Martin Baulig  <martin@ximian.com>
21040
21041         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
21042         on error.
21043
21044 2005-07-11  Martin Baulig  <martin@ximian.com>
21045
21046         * loader.c (find_method): Also lookup in
21047         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
21048
21049 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21050
21051         * appdomain.c (mono_domain_unload): Don't free the error message
21052         before passing it to mono_get_exception_...
21053
21054         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
21055         
21056 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
21057
21058         * threads.c: try to better guess an available RT signal (bug #75387).
21059
21060 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21061
21062         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
21063         and CACHE_OBJECT.
21064
21065 2005-07-07  Martin Baulig  <martin@ximian.com>
21066
21067         * class.c (mono_type_get_name_full): Return NULL for
21068         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
21069         fixes #75408.
21070
21071 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21072
21073         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
21074         exit the appdomain as well being aborted.
21075
21076         * threadpool.c: Create all threadpool threads inside the root appdomain, and
21077         change back to the root domain after calling managed code. This enables
21078         appdomains using threadpools to be unloaded.
21079
21080 2005-07-07  Martin Baulig  <martin@ximian.com>
21081
21082         * class-internals.h
21083         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
21084         into `MonoDynamicGenericClass' since we only need it for dynamic
21085         types.
21086
21087         * reflection.c (mono_class_bind_generic_parameters): We don't need
21088         to compute the `parent' here.
21089
21090 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
21091
21092         * culture-info-table.h : regenerated.
21093
21094 2005-07-06  Martin Baulig  <martin@ximian.com>
21095
21096         * icall.c
21097         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
21098
21099         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
21100
21101 2005-07-06  Martin Baulig  <martin@ximian.com>
21102
21103         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
21104         we're doing a signature-only comparision; fixes #74945.
21105
21106 2005-07-06  Martin Baulig  <martin@ximian.com>
21107
21108         * class-internals.h (MonoGenericClass): Moved some things out into
21109         a new `MonoInflatedGenericClass' type.  
21110         (MonoInflatedGenericClass): New type; the `klass' of a
21111         `MonoGenericClass' is now computed lazyly in
21112         mono_get_inflated_generic_class().      
21113
21114         * class.c (mono_get_inflated_generic_class): New public function.
21115         (mono_class_inflate_generic_method): Removed the unused
21116         `MonoClass *' argument.
21117         (setup_generic_vtable): Don't call mono_get_inflated_method() on
21118         all the methods.
21119         (mono_class_create_generic): Make this static and merge it with
21120         mono_class_create_generic_2(); we're now called automatically from
21121         mono_get_inflated_generic_class().
21122
21123         * loader.c (mono_method_signature): Call
21124         mono_get_inflated_method() here.
21125
21126 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
21127
21128         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
21129         type of fields with RVA.
21130
21131         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
21132         for this pseudo class.
21133         (my_mono_class_from_generic_parameter): Likewise.
21134         (mono_class_init): Allow interfaces to have cctors.
21135
21136 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
21137
21138         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
21139         lazily for AOT methods.
21140
21141 2005-07-05  Martin Baulig  <martin@ximian.com>
21142
21143         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
21144         returns FALSE for a successful match, not TRUE.
21145
21146 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
21147
21148         * loader.c (mono_method_get_index): Optimize this a bit.
21149
21150 2005-07-04  Martin Baulig  <martin@ximian.com>
21151
21152         * class.c
21153         (class_compute_field_layout): Move the check for generic type
21154         definitions into mono_class_layout_fields().  Fixes #74684.
21155         (mono_class_from_generic_parameter): Correctly compute
21156         `klass->parent'; fixes #75457.
21157
21158         * reflection.c (register_assembly, register_module): Make sure
21159         `domain->rejobject_hash' is already created.
21160
21161 2005-07-02  Martin Baulig  <martin@ximian.com>
21162
21163         * class-internals.h
21164         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
21165         `MonoDynamicGenericClass'.      
21166
21167 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
21168
21169         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
21170         returned by a field getter is null, since null is a valid value.
21171
21172 2005-07-01  Martin Baulig  <martin@ximian.com>
21173
21174         * reflection.c (mono_reflection_generic_class_initialize): Update
21175         the `dgclass->fields [i].parent' to the correct class.
21176         (mono_image_get_fieldref_token): Use the declaring type, not the
21177         reflected type.
21178
21179 2005-07-01  Martin Baulig  <martin@ximian.com>
21180
21181         * loader.c (find_method): Also look in the interfaces; fixes #75429.
21182
21183 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
21184
21185         * threads.c (thread_cleanup): assert that thread != NULL
21186         (wait_for_tids_or_state_change): We were using the wrong variable
21187         when accessing wait->threads. `i' was always out of the bounds of
21188         the array.
21189
21190 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21191
21192         * loader.c: map user32 and kernel32 to libMonoSupportW
21193
21194 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
21195
21196         * appdomain.c (unload_thread_main): Mark this as WINAPI.
21197
21198 2005-06-28  Martin Baulig  <martin@ximian.com>
21199
21200         * loader.c (method_from_methodspec): Fix #75334.
21201
21202 2005-06-28  Martin Baulig  <martin@ximian.com>
21203
21204         Fix #74953 - Arrays now implement the generic IList<T> interface
21205         on the 2.0 platform.
21206
21207         * class-internals.h (MonoDefaults): Added `generic_array_class'.
21208
21209         * reflection.c (mono_class_bind_generic_parameters): New public
21210         function; similar to mono_reflection_bind_generic_parameters(),
21211         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
21212
21213         * domain.c (mono_init_internal): Try to initialize.
21214         `mono_defaults.generic_array_class' here; this'll only succeed if
21215         we're using the 2.0 corlib.
21216
21217         * icall.c
21218         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
21219         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
21220         (mono_lookup_internal_call): Added support for nested classes.
21221
21222         * loader.c
21223         (mono_get_method_from_token): Set `result->signature->pinvoke' if
21224         we're an interncall and have generic arguments.
21225
21226         * class.c
21227         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
21228         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
21229         instance of System.Array.InternalArray<T> for arrays, so they
21230         implement the generic IList<T> interface.
21231
21232 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
21233
21234         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
21235         (chastamar@yahoo.com). Fixes #75374.    
21236
21237 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
21238
21239         * culture-info-table.h: regenerated.
21240
21241 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21242
21243         * icall.c: handle spaces correctly for base64 strings.
21244
21245 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
21246
21247         * *.c: Kill some warnings.
21248
21249 2005-06-23  Duncan Mak  <duncan@novell.com>
21250
21251         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
21252         that this builds on Solaris 10 (x86).
21253
21254 2005-06-23  Martin Baulig  <martin@ximian.com>
21255
21256         * class.c
21257         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
21258         generic type definitions.
21259
21260 2005-06-23  Martin Baulig  <martin@ximian.com>
21261
21262         Fix #75331.
21263
21264         * metadata.c (mono_class_get_overrides): Renamed to
21265         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
21266         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
21267         pass it to mono_get_method_full().
21268
21269 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
21270
21271         * reflection.c (mono_reflection_create_runtime_class): take the
21272         mono_domain_lock in this method. Prevents deadlocks
21273
21274 2005-06-22  Martin Baulig  <martin@ximian.com>
21275
21276         * loader.c (method_from_methodspec): Fix #75330.
21277
21278 2005-06-22  Martin Baulig  <martin@ximian.com>
21279
21280         * reflection.c (type_get_qualified_name): Use
21281         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
21282         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
21283         argument; use it if we don't have an assembly name.
21284
21285 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
21286
21287         * object.c: In mono_message_init, set "copy out" flag for in
21288         parameters with the [Out] flag.
21289
21290 2005-06-21  Martin Baulig  <martin@ximian.com>
21291
21292         * class.c
21293         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
21294         and MONO_TYPE_PTR.
21295
21296 2005-06-21  Martin Baulig  <martin@ximian.com>
21297
21298         * class.c (mono_class_init): Don't initialize `class->fields' for
21299         generic instances since they're initialized again in
21300         compute_field_layout(). 
21301         (compute_field_layout): Set the field's `generic_info' here; fix
21302         #75320. 
21303
21304 2005-06-21  Martin Baulig  <martin@ximian.com>
21305
21306         * class-internals.h
21307         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
21308
21309         * metadata.c (mono_metadata_generic_method_equal): Also
21310         distinguish the `generic_class'; fixes #75334.
21311
21312 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21313
21314         * domain.c:
21315         * appdomain.c:
21316         * domain-internals.h:
21317         * reflection.c: 'domain_assemblies' field is now protected by its own
21318         lock. Don't call into managed code to run the AssemblyLoad event if we
21319         now there are no registered delegates for it.
21320
21321 2005-06-20  Martin Baulig  <martin@ximian.com>
21322
21323         * class.c (mono_class_is_assignable_from): Use a custom version of
21324         mono_class_has_parent() to make things work for generic instances;
21325         fix #75300.
21326
21327 2005-06-20  Martin Baulig  <martin@ximian.com>
21328
21329         * loader.c (method_from_methodspec): Apply a patch from
21330         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
21331
21332 2005-06-20  Martin Baulig  <martin@ximian.com>
21333
21334         * class.c (mono_class_init): Reverted Zoltan's last change; it
21335         breaks generics.
21336
21337 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
21338
21339         * threads.c (wait_for_tids_or_state_change): Add missing locking.
21340
21341 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21342
21343         * socket-io.c: fix the index in the socket array for writable/error
21344         sockets. Fixes bug #75306.
21345
21346 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
21347
21348         * class.c (mono_class_init): Allow interfaces to have static ctors.
21349
21350 2005-06-17  Martin Baulig  <martin@ximian.com>
21351
21352         * loader.c (method_from_methodspec): Use `context->container' when
21353         parsing the `gmethod->inst'.
21354
21355 2005-06-17  Martin Baulig  <martin@ximian.com>
21356
21357         * class.c (mono_type_get_name_recurse): Don't add the assembly
21358         name for type arguments.
21359
21360 2005-06-15  Martin Baulig  <martin@ximian.com>
21361
21362         * reflection.c (mono_image_get_inflated_method_token): Encode
21363         correct klass; fixes #75260.
21364
21365 2005-06-13 Michal Moskal <malekith@nemerle.org>
21366
21367         * icall.c: Make GetCorrespondingMethod/Constructor take
21368         MonoReflectionMethod method not MonoMethod. Removed
21369         MonoType.GetCorrespondingField, and make
21370         MonoGenericType.GetCorrespondingField take name not
21371         MonoClassField.
21372
21373 2005-06-13  Michal Moskal <malekith@nemerle.org>
21374
21375         * reflection.c (field_encode_signature, encode_locals):
21376          Make sizes of buffers for types larger (for big generic types).
21377          (create_generic_typespec,
21378          mono_reflection_sighelper_get_signature_local,
21379          mono_reflection_sighelper_get_signature_field):
21380          Add asserts for too small buffers.
21381
21382 2005-06-15  Martin Baulig  <martin@ximian.com>
21383
21384         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
21385         if our parent is not a dynamic type.
21386
21387 2005-06-15  Martin Baulig  <martin@ximian.com>
21388
21389         * class-internals.h (MonoTypeNameFormat): New enum.
21390
21391         * class.c
21392         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
21393         (mono_type_get_full_name): Removed.
21394         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
21395         argument instead of the boolean's.
21396
21397         * icall.c (ves_icall_System_MonoType_getFullName):
21398         Added `gboolean assembly_qualified'.    
21399
21400         * reflection.h
21401         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
21402
21403         * reflection.c (mono_reflection_parse_type): Parse the new type
21404         name format.
21405
21406 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21407
21408         * icall.c: no need to convert from utf16 to utf8 and then back again
21409         after the call to GetLogicalDrives.
21410
21411 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21412
21413         * icall.c: frombase64. Fix problems exposed by new tests.
21414
21415 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21416
21417         * icall.c: added internal calls for converting char [] and strings in
21418         base64 into byte [].
21419
21420 2005-06-10  Martin Baulig  <martin@ximian.com>
21421
21422         * class.c (mono_class_create_generic_2): Read the nested classes
21423         from the metadata rather than from `gklass->nested_classes' since
21424         `gklass' might not be initialized yet.
21425
21426 2005-06-09  Duncan Mak  <duncan@novell.com>
21427
21428         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
21429         all public headers. Fixes #74919.
21430
21431 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
21432
21433         * domain.c: The key for proxy_vtable_hash is now a pointer
21434         array. Added new GHashFunc and GCompareFunc functions for this.
21435
21436         * class.h: The list of interfaces in MonoRemoteClass is known in
21437         advance and can't grow (we create a new MonoRemoteClass if needed),
21438         so now the interface array can be allocated together with
21439         MonoRemoteClass.
21440         
21441         * object.c: Added a new method create_remote_class_key.
21442         Fixed mono_remote_class so it does not depend on
21443         mono_upgrade_remote_class.
21444         Removed extend_interface_array.
21445         Added new method clone_remote_class(), which makes a copy of a remote
21446         class and adds a new interface or class to it.
21447         mono_upgrade_remote_class() now creates a new remote class (or gets
21448         it from the cache) if an vtable upgrade is needed. In this way
21449         we make sure that other objects sharing the same remote class
21450         don't get the new vtable with unwanted interfaces.
21451         
21452         * object-internals.h:
21453         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
21454         
21455         * marshal.c: Track changes in mono_upgrade_remote_class().
21456
21457 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
21458         * icall.c: Add runtime methods for obtaining members of inflated
21459         class, which were created from supplied non-inflated members. It
21460         is used in internal Get{Method,Constructor,Field} methods in
21461         System.Type
21462
21463 2005-06-09  Martin Baulig  <martin@ximian.com>
21464
21465         * reflection.c
21466         (mono_reflection_bind_generic_method_parameters): Fix #75169.
21467
21468 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21469         * reflection.c (mono_image_basic_init): Define
21470         Version in MonoDynamicAssembly. 
21471         
21472 2005-06-08  Martin Baulig  <martin@ximian.com>
21473
21474         Fix #75136.
21475
21476         * loader.c
21477         (mono_method_signature_full): New public method; takes a
21478         `MonoGenericContext *'.
21479         (find_method): Use mono_method_signature_full() and pass the
21480         klass'es context to it.
21481
21482         * class.c (mono_class_is_inflated_method): Use
21483         mono_method_signature_full() and pass the context to it.
21484
21485 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
21486
21487         * object.c: add proper locking in mono_remote_class_vtable(),
21488         fixes possible memory corruption.
21489
21490 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
21491
21492         * marshal.c (mono_remoting_marshal_init): set
21493         initialized after initialization.
21494
21495 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21496
21497         * locales.c : hush.
21498
21499 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
21500
21501         * object.c (extend_interface_array): fix really silly
21502         memory corrupting / comparison bug.
21503
21504 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21505
21506         * reflection.c: Functions added to support the creation
21507         of CustomAttributeData, which includes Attribute data
21508         used by ReflectionOnly methods.
21509
21510         * reflection.h:  mono_reflection_get_custom_attrs_data and
21511          mono_custom_attrs_data_construct added (functions exposed).
21512
21513          * icall.c: Added mono_reflection_get_custom_attrs_data
21514          as icall.
21515         
21516 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
21517
21518         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
21519         lupus's request.
21520
21521 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
21522
21523         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
21524
21525         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
21526         dynamic DllImportAttribute.
21527
21528         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
21529         dynamic DllImportAttribute.
21530
21531         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
21532         Fixes #75162.
21533
21534 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21535
21536         * threads.c: avoid segfault when an unstarted thread is aborted.
21537
21538 2005-06-05  KornĂ©l Pál <kornelpal@hotmail.com>
21539
21540         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
21541         Returns the name and version of the runtime for reporting.
21542
21543 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21544
21545         * appdomain.c: bump corlib version.
21546         * object-internals.h: new field in MonoReflectionAssembly.
21547
21548 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21549
21550         * object-internals.h: Carlos forgot to add this field.
21551
21552 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21553
21554         * icall.c: Added create_version to create instances
21555         of Version of MonoReflectionAssemblyName. This change helps
21556         the AssemblyName tests to keep running fine.
21557         
21558 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
21559   
21560         * object.c (mono_method_return_message_restore): A somehow less
21561         intrusive fix for #75138.
21562
21563 2005-06-03  Raja R Harinath  <rharinath@novell.com>
21564
21565         * object.c (mono_method_return_message_restore): Fix computation
21566         of expected number of out args.
21567
21568 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21569
21570         * reflection.c (mono_image_get_method_info): Fix the case when the
21571         charset is empty.
21572
21573 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
21574
21575         * object.c: Added missing null check in
21576           mono_method_return_message_restore.
21577
21578 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21579
21580         * reflection.c (mono_image_get_method_info): Handle the case when
21581         dllentry is empty.
21582
21583 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
21584
21585         * object.c: When creating the vtable for a proxy, take into account
21586         all inherited interfaces, not only the ones registered in
21587         iclass->interfaces. This fixs bug #74996.
21588         Also, in mono_method_return_message_restore, verify that the array
21589         of out args has the expected lengh.
21590
21591 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21592
21593         * socket-io.c: update the timeout in Poll when the call is interrupte.
21594
21595 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21596
21597         * socket-io.c: support abort/suspend in Select_internal after last
21598         change.
21599
21600 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21601
21602         * threadpool.c: remove warning.
21603
21604 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21605
21606         * icall.c:
21607         * socket-io.[ch]: Select_internal uses poll() now when available, thus
21608         removing the 1024 limit from select(). Runtime part of the fix for
21609         bug #71203.
21610
21611 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21612
21613         * socket-io.c: when resolving the addresses for the same
21614         host returned by gethostname(), get the local IPs from the interface
21615         list. Loopback addresses are discarded if the are interfaces up with
21616         non-loopback ones. Fixes bug #63265.
21617
21618 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
21619
21620         * appdomain.c, verify.c, object-internals.h, reflection.c:
21621         bumped corlib number to 36, and added new extra_flags field
21622         to ReflectionMethodBuilder and friends.  Fixes #75060.
21623
21624 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
21625
21626         * gc.c: register a new weak link only if the object is non-null
21627         (fixes bug#75047).
21628
21629 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21630
21631         * culture-info.h : short time pattern too.
21632
21633 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21634
21635         * culture-info.h : expand long time pattern string length.
21636
21637 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21638
21639         * culture-info-table.h : update (more French date format; #72788).
21640
21641 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
21642
21643         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
21644         the method is static. Fixes #75029.
21645
21646 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
21647
21648         * reflection.c: Update the table_idx field of method builders after
21649         saving the module, since it can change. This is a workaround for
21650         bug #74914. 
21651
21652 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21653
21654         * culture-info-table.h : update (additional French date format).
21655
21656 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
21657
21658         * icall.c (ves_icall_type_Equals): Revert last change.
21659         
21660         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
21661
21662         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
21663
21664 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
21665
21666         * class-internals.h: Added executioncontext_class field to 
21667         MonoDefaults structure.
21668         * domain.c: Cache System.Threading.ExecutionContext class in 
21669         mono_defaults.
21670         * object.c: Capture the ExecutionContext for asynchroneous calls in
21671          mono_async_result_new.
21672         * object-internals.h: Added execution_context and original_context 
21673         fields to MonoAsyncResult. Added execution_context to MonoThread.
21674         * security-manager.c|.h: Added mono_get_context_capture_method to 
21675         return the capture method (if required by the security manager or by
21676         the framework version used).
21677         * threadpool.c: Apply capture (if present) ExecutionContext in 
21678         mono_async_invoke and revert to original context after it completes.
21679
21680 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
21681
21682         * culture-info-table.h : updated (real hacky solution for zh-CHT).
21683
21684 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
21685
21686         * culture-info-table.h : zh-CHT related workaround.
21687
21688 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21689
21690         * marshal.c (emit_marshal_custom): Add some error checking and call the
21691         methods in the ICustomMarshaler interface. Fixes #74875.
21692         
21693         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
21694         native->managed wrappers.
21695
21696 2005-05-12  Martin Baulig  <martin@ximian.com>
21697
21698         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
21699         here and use the loader lock.
21700
21701         * mono-debug.c: Properly lock when the debugger is not attached.
21702         (mono_debug_init): Release the initial lock if we're not running
21703         in the debugger.
21704
21705 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21706
21707         * marshal.c (emit_marshal_custom): Pass through NULL values without
21708         calling the custom marshalling routines.
21709
21710         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
21711         conversion in structures. Fixes #74882.
21712
21713 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
21714
21715         * culture-info-table.h : zh-* cultures were missing.
21716
21717 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
21718
21719         * threads.c: Added a new event background_change_event which is signaled
21720         when a thread changes its background mode.
21721         Moved here several checks previously done in managed code. The checks
21722         require the thread lock, and using the thread lock in managed code
21723         can result in deadlocks.
21724         Merged Start_internal and Thread_internal into a single method. Now 
21725         Thread_internal does all work of creating and starting a thread.
21726         Added icalls for setting and getting the state of the object. Moved from
21727         managed code to avoid locking there.
21728         Added wait_for_tids_or_state_change() which is called instad of
21729         wait_for_tids when waiting for non-backround threads to end. This method
21730         will return if one of the threads ends or the background_change_event
21731         is signaled.
21732         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
21733         the background mode. This method signals the background_change_event
21734         event.
21735         * icall.c:
21736         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
21737         removed Start_internal.
21738         
21739 2005-05-11  Martin Baulig  <martin@ximian.com>
21740
21741         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
21742         to order of some fields to get proper alignment on 64-bit machines.
21743
21744 2005-05-11  Martin Baulig  <martin@ximian.com>
21745
21746         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
21747         changes as they're broken and completely fuck up the debugger.
21748
21749         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
21750
21751 2005-05-10  Martin Baulig  <martin@ximian.com>
21752
21753         * reflection.c (mono_reflection_generic_class_initialize): Don't
21754         call mono_class_setup_parent() here.
21755
21756 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21757
21758         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
21759         send/receive timeout use an integer in milliseconds. We were using a
21760         struct timeval.
21761
21762 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21763
21764         * locales.c:
21765         (internal_get_cultures): reserve the first slot of the array for the
21766         InvariantCulture, which will be filled in managed code.
21767
21768 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
21769
21770         * reflection.c (mono_image_fill_module_table): Initialize the
21771         GENERATION field as well.
21772
21773 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21774
21775         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
21776         Monitor.Enter on the object.
21777
21778 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
21779
21780         * threads.c: Enable the wait for running threads when exiting.
21781         * icall.c: Suspend all threads before exiting.
21782
21783 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
21784
21785         * assembly.c (mono_assembly_load_reference): Fix warning.
21786
21787 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21788
21789         * threadpool.c: changed the default number of threads per cpu. From now
21790         on, the default will be 20 + (5 * number of cpus) instead of 50.
21791
21792 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
21793
21794         * loader.c (mono_method_get_signature_full): Add locking here.
21795
21796 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
21797
21798         * appdomain.c: Moved methods for parsing and freeing assembly
21799         names to assembly.c.
21800         * assembly.c, domain-internals.h: Created public methods for parsing
21801         assembly names. Fixed mono_assembly_load_with_partial_name:
21802         it now finds the best match, taking into account the version,
21803         token and culture specified in the partial name. Also return
21804         the latest version if no version information is specified.
21805
21806 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
21807
21808         * threadpool.c: replace check for SocketAsyncCall class.
21809
21810 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21811
21812         * threadpool-internals.h:
21813         * Makefile.am: added threadpool-internals.h
21814
21815         * threadpool.c: call mono_unhandled_exception on exceptions not handled
21816         that happen in threadpool threads (tested on MS).
21817         (mono_thread_pool_remove_socket): new function that dispatch any pending
21818         AIO call on a socket that is closing. By now only epoll really needs it,
21819         as select/poll wake up when the socket closes.
21820
21821
21822         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
21823
21824 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
21825
21826         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
21827
21828 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
21829
21830         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
21831
21832 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
21833
21834         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
21835         has an abort request, convert it into a suspend request.
21836
21837 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
21838
21839         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
21840         warning for the usage of `UnmanagedFunctionPointerAttribute' which
21841         is not supported yet.
21842
21843 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21844
21845         * image.c: register assemblies loaded from data (bundles) in the loaded
21846         assemblies hash. Fixes bug #74772.
21847
21848 2005-04-29  Martin Baulig  <martin@ximian.com>
21849
21850         * class.c (mono_type_get_name_recurse): Update to the new naming
21851         schema from the latest .NET 2.x beta2.
21852         (mono_class_setup_vtable_general): If we're a generic instance,
21853         copy the vtable from our generic type definition and inflate all
21854         the methods in it.
21855
21856         * loader.c (find_method): Update to the new naming schema from the
21857         latest .NET 2.x beta2.
21858
21859 2005-04-29  Raja R Harinath  <harinath@gmail.com>
21860
21861         * class.c (mono_class_init): Add a mono_loader_unlock to the
21862         #74734 fix.
21863
21864 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
21865
21866         * icall.c (ves_icall_System_Environment_Exit): Remove the 
21867         suspend_all_other_threads () call for the time being, since it can hang.
21868
21869         * threads.c (mono_thread_manage): Similarly, disable the waiting for
21870         the background threads to exit, since it can also hang.
21871
21872         * class.c (mono_class_init): Applied patch from Ankit Jain 
21873         (radical@gmail.com). Avoid pending init errors when a field refers
21874         to a nested class using a typeref. Fixes #74734.
21875
21876         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
21877         this for dynamic modules.
21878
21879 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21880
21881         * threads.c: don't wait for threads that are in the process of aborting
21882         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
21883         and waiting for background threads to finish. This makes xsp and
21884         mod-mono-server exit without random length delays and/or hangs.
21885
21886 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21887
21888         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
21889
21890 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
21891
21892         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
21893         dynamic types to prevent infinite loops. Fixes #74727.
21894
21895         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
21896         ..._is_assignable_to.
21897
21898 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
21899
21900         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
21901
21902 2005-04-25  Martin Baulig  <martin@ximian.com>
21903
21904         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
21905
21906         * domain.c
21907         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
21908
21909         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
21910
21911         * reflection.c (build_compressed_metadata): Set metadata header
21912         version to 2.0.
21913
21914 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
21915
21916         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
21917         number into an integral and a decimal part. Fixes #70473.
21918
21919         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
21920
21921 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
21922
21923         * culture-info-table.h : reflected the latest locale-builder output.
21924
21925 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21926
21927         * threadpool.c: check for SuspendRequested too when deciding if
21928         mono_thread_interruption_checkpoint should be called.
21929
21930 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21931
21932         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
21933         * threads.c: remove interruption_mutex and use Interlocked instead. When
21934         suspending all the threads, wait for all the suspended events at once.
21935         If we're shutting down and get an APC that is going to be queued,
21936         call mono_thread_execute_interruption immediately, as the thread might
21937         be sleeping on a pthread condition or mutex.
21938
21939         * icall.c: call mono_runtime_set_shutting_down before suspending the
21940         threads.
21941
21942         Fixes bug #74693. And now xsp is happier when exiting.
21943
21944 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
21945
21946         * loader.c (mono_stack_walk): Fix #74690.
21947
21948 2005-04-22  Martin Baulig  <martin@ximian.com>
21949
21950         * mono-debug.h (MonoDebugMethodJitInfo): Added
21951         `MonoDebugMethodJitInfo *jit'.
21952
21953         * mono-debug.c (mono_debug_read_method): Cache the
21954         MonoDebugMethodJitInfo in `address->jit'.
21955         (mono_debug_free_method_jit_info): New public method.
21956
21957 2005-04-22  Martin Baulig  <martin@ximian.com>
21958
21959         * class.c (mono_class_is_assignable_from): Disallow
21960         type parameter -> interface.
21961
21962 2005-04-21  Dick Porter  <dick@ximian.com>
21963
21964         * threads.c (mono_thread_create): Turn an assertion into an error.
21965
21966 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
21967
21968         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
21969         
21970         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
21971         Fix some gcc 4.0 warnings.
21972
21973 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
21974
21975         * file-io.c: fix alt dir separator char on unix systems
21976         and cleanup (fixes bug #71214).
21977
21978 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
21979
21980         * marshal.c: Use CALLVIRT instead of CALL when dispatching
21981         a call to a remote domain, since the method may be an
21982         interface method in the client domain. This fixes bug #74192.
21983
21984 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21985
21986         * threadpool.c: recv/send are now performed before going back to managed
21987         code to save one transition.
21988
21989 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21990
21991         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
21992
21993         * metadata/threadpool.c: removed hack to workaround the bug above.
21994
21995         Fixes bug #74618.
21996
21997 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
21998
21999         * reflection.c reflection.h: Fix handling of parameter defaults in
22000         dynamic methods. Also fixes handling of parameter attributes.
22001         Fixes #74609.
22002
22003         * mono-debug.c (mono_debug_close_image): Fix warning.
22004
22005 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22006
22007         * socket-io.h: replaced old unused field with new 'blocking'.
22008         * threadpool.c: restore socket blocking state on windows(tm).
22009
22010 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
22011
22012         * icall.c: don't return the codebase in the AssemblyName[] returned by
22013         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
22014         * object-internals.h: Removed FIXME (fields were presents) and fixed
22015         versioncompat declaration.
22016
22017 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22018
22019         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
22020         not closed, so don't cleanup when it happens.
22021
22022 2005-04-13  Chris Toshok  <toshok@ximian.com>
22023
22024         * mono-debug-debugger.h: change prototype for
22025         mono_debugger_lookup_type.
22026
22027         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
22028         this function, although it should probably be named
22029         mono_debugger_init_type.
22030
22031 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22032
22033         * threadpool.c: fix non-AIO case.
22034
22035 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
22036
22037         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
22038         the built-in profiler to measure just JIT compilation times.
22039
22040 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22041
22042         * threadpool.c: the epollfd might be closed by another thread at
22043         any time, so ignore EBADF at treat it as a "we're closing" sign.
22044
22045 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22046
22047         * threadpool.c: release the semaphores with a count equals to the number
22048         of working threads in both IO and regular pools. Fixed typo that messed
22049         up the count of IO pool threads. Don't initialize the pipe handles if
22050         we're using epoll.
22051
22052 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22053
22054         * threadpool.c: some systems don't like a NULL when deleting the socket
22055         from epoll.
22056
22057 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22058
22059         * threadpool.c: fix semaphore allocation.
22060
22061 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22062
22063         * threadpool.c: added epoll() based implementation for asynchronous IO
22064         that is used instead of the default poll() when available.
22065         It can be disabled by setting MONO_DISABLE_AIO.
22066
22067 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22068
22069         * threadpool.c: windows needs 'closesocket' and instead of returning
22070         0 when the stream is closed while in select, it returns -1. Fixes bug
22071         #74573.
22072
22073 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
22074
22075         * class.c (class_compute_field_layout): Fix the regression caused by
22076         the previous try.
22077
22078 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22079
22080         * threadpool.c: separate pool for socket async. IO.
22081         * threadpool.h: mono_max_worker_threads is not a global any more.
22082
22083 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
22084
22085         * class.c (class_compute_field_layout): Fix #74549.
22086
22087 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22088
22089         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
22090         use 2 connected sockets instead.
22091
22092 2005-04-08  Miguel de Icaza  <miguel@novell.com>
22093
22094         * mono-config.c: Add new entry point for mkbundle
22095         mono_config_parse_memory. 
22096
22097 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22098
22099         * threadpool.c: removed another unused function.
22100
22101 2005-04-08  Ankit Jain  <radical@corewars.org>
22102
22103         * reflection.c (get_default_param_value_blobs): Add 'types'
22104         parameter to get the types encoded in the constant table.
22105         (mono_param_get_objects): Use the type from the constant table,
22106         not the type of the parameter, when creating default values.
22107         Handle null default values correctly.
22108
22109 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22110
22111         * file-io.c:
22112         * file-io.h:
22113         * threadpool.c:
22114         * threadpool.h:
22115         * icall.c:
22116         * socket-io.c: removed dead code for async IO.
22117
22118 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22119
22120         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
22121
22122         * threadpool.c: intercept socket async. calls and pass them to a thread
22123         that is polling and dispatching the job items to the threadpool as
22124         socket become ready. Fixes bugs #71217, #71933.
22125
22126         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
22127         between char and short/ushort arrays.
22128
22129         * socket-io.c: remove dead code.
22130
22131 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
22132
22133         * locales.c,
22134           icall.c : removed InternalToUpper_Comp() and
22135           InternalToLower_Comp().
22136
22137 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
22138
22139         * char-conversions.h : The tables were incorrectly generated. Should
22140           be generated against invariant culture.
22141
22142 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
22143
22144         * object.c (mono_runtime_invoke_array): Fix return value when 
22145         passing pre-created valuetype objects to ctors.
22146
22147         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
22148         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
22149         Fixes #74338.
22150
22151 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
22152
22153         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
22154         only used with --security and hides the wrong corlib version error.
22155
22156 2005-03-30  Joshua Tauberer  <tauberer@for.net>
22157
22158         * class.c: Changed mono_class_name_from_token so that types
22159         outside of a namespace don't have an initial period.  Improved
22160         the g_warning message used in _mono_class_get when loading
22161         fails.
22162         * assembly.c: In mono_assembly_load_reference, when an assembly
22163         can't be found, "No such file or directory" is misleading and
22164         unhelpful because a few paths were checked for the presence of
22165         the assembly.  When that happens (ENOENT), display a nicer
22166         message indicating the directories that were searched.  In all
22167         cases, the warning is made easier to read for non-hackers.
22168
22169 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
22170
22171         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
22172         project/solution.
22173         * appdomain.h|domain.c: Removed inline from functions.
22174         * appdomain.c: Reduced warnings when compiling on windows.
22175         * icall.c: Fixed output_debug declaration to gunichar2*.
22176         * mono-config.c: Reduced warnings when compiling on windows.
22177         * rand.c: Added missing "windows.h". Added missing return value.
22178         * rawbuffer.c: Added missing winsock2.h for windows.
22179         * sysmath.h: Added mono-compiler.h header to allow/ease 
22180         compilation with non-GCC compilers.
22181         * threads.c: Fixed declarations to compile with VS.NET C compiler.
22182         Removed cast warnings.
22183
22184         Adapted from the work of J Lothian (for VC6).
22185
22186 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
22187
22188         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
22189         from default_path.
22190
22191 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
22192
22193         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
22194         the 2.0 profile.
22195
22196 2005-03-27  Raja R Harinath  <harinath@gmail.com>
22197
22198         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
22199         has to be in $(exec_prefix).  $(prefix) is for arch-independent
22200         stuff, and it would probably use $(prefix)/share rather than
22201         $(prefix)/lib.
22202
22203 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22204
22205         * console-io.c: added 2 includes that might be missing.
22206
22207 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
22208
22209         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
22210         profile.
22211
22212         * reflection.c (create_custom_attr): Allocate the params array using
22213         alloca so it gets GC tracking.
22214
22215 2005-03-23  Chris Toshok  <toshok@ximian.com>
22216
22217         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
22218         out some spew.
22219
22220 2005-03-24  Raja R Harinath  <rharinath@novell.com>
22221
22222         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
22223         changes to pick up any changes in prefix, etc.
22224
22225 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
22226
22227         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
22228         
22229         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
22230         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
22231
22232 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
22233
22234         * class-internals.h object-internals.h class.c reflection.c: Extend the
22235         mono_lookup_dynamic_token () function to return the class of the
22236         token as well. 
22237
22238         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
22239         well. Fixes #73848.
22240
22241 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
22242
22243         * security-manager.c: Skip inheritance checks for intra-corlib
22244         class inheritance and method overrides. This skips a lot of checks
22245         and (anyway) permissions cannot work until corlib is loaded.
22246
22247 2005-03-23  Martin Baulig  <martin@ximian.com>
22248
22249         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
22250         MONO_TYPE_GENERICINST.  
22251
22252 2005-03-23  Martin Baulig  <martin@ximian.com>
22253
22254         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
22255
22256 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22257
22258         * class.c: added locking comments to some functions.
22259         Cache the interface offsets arrays (saves about 20 KB
22260         of runtime memory in a typical app).
22261         Reduce the time overhead in mono_class_setup_supertypes ().
22262
22263 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
22264
22265         * icall.c: speedup and fix leaks in GetMethodsByName and
22266         GetPropertiesByName.
22267
22268 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22269
22270         * reflection.c: some locking fixes.
22271
22272 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22273
22274         * metadata.c: added missing break in case statement.
22275
22276 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
22277
22278         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22279         typedbyref return values. Fixes #73941.
22280
22281 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
22282
22283         * security-manager.c|h: Added demandunmanaged method and 
22284         suppressunmanagedcodesecurity class to MonoSecurityManager.
22285         Renamed aptc class to allowpartiallytrustedcallers.
22286
22287 2005-03-17  Martin Baulig  <martin@ximian.com>
22288
22289         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
22290
22291 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22292
22293         * file-io.c: disabled file async. IO using aio_*. It uses the
22294         threadpool now. Workaround for bug #73718.
22295
22296 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22297
22298         * assembly.h, mono-config.c: added code to deal with bundled configs
22299         for bundled assemblies.
22300
22301 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
22302
22303         * *.c, private.h: cleanup, removing old private.h header file.
22304
22305 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
22306
22307         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
22308         and throw_on_unmappable_char attributes.
22309
22310 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
22311
22312         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
22313         _ProcessName_internal.
22314
22315 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
22316
22317         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
22318         #73631.
22319
22320         * icall.c threads.c threads-types.h: Remove slothash icalls as they
22321         are no longer used.
22322
22323 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
22324
22325         * object.c (compute_class_bitmap): Add support for generics. Fixes
22326         #73527.
22327
22328 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22329
22330         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
22331
22332 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22333
22334         * filewatcher.c: commented out the code for windows watcher, as we don't
22335         use it (we use the managed implementation instead).
22336
22337 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22338
22339         * object-internals.h (MonoThread): Remove 'unused1' field.
22340
22341         * appdomain.c: Bump corlib version.
22342
22343         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
22344
22345         * reflection.c (mono_reflection_create_runtime_class): Remove the
22346         AssemblyBuilder.Save optimization since it causes too many problems.
22347
22348 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
22349
22350         * exception.c|h: Added mono_get_exception_reflection_type_load to
22351         create a ReflectionTypeLoadException object.
22352         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
22353         to return NULL is a InheritanceDemand fails during reflection. Updated
22354         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
22355         ReflectionTypeLoadException if an InheritanceDemand fails during 
22356         reflection. Added icall mapping for GetLinkDemandSecurity.
22357         * security-manager.c|h: Added ves_icall_System_Security_
22358         SecurityManager_GetLinkDemandSecurity internal call to return the
22359         class and methods permissions set for a LinkDemand. Removed unused
22360         fields in MonoSecurityManager.
22361
22362 2005-03-10  Martin Baulig  <martin@ximian.com>
22363
22364         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
22365         it's a generic instance.
22366
22367 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
22368
22369         * reflection.c (mono_get_object_from_blob): Applied patch from
22370         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
22371
22372         * class.c (mono_class_is_assignable_from): Another try at fixing 
22373         #73469 without breaking anything.
22374
22375 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
22376
22377         * class.c: (mono_class_is_assignable_from): Revert the last changes
22378         since they don't work with generics.
22379         
22380         * class.c (mono_class_is_assignable_from): Fix build bustage.
22381
22382         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
22383         the managed IsAssignableFrom method. Fixes #73469.
22384
22385         * reflection.c (mono_reflection_call_is_assignable_from): New helper
22386         function.
22387
22388 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
22389
22390         * object.c (mono_load_remote_field_new): Fix returning uninitialized
22391         memory when the remoting callback does not sets the out arguments.
22392         Fixes #73007.
22393
22394         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
22395         by mistake.
22396
22397         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
22398
22399         * object-internals.h (MonoStackFrame): Sync with managed object layout.
22400
22401         * appdomain.c: Bump corlib version.
22402
22403 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
22404
22405         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
22406         function.
22407
22408         * threads.c (mono_thread_attach): Detect threads which are not started
22409         by the GC pthread wrappers.
22410
22411 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
22412
22413         * icall.c: Added new icall for RNG.
22414         * rand.c|h: Added new icall to open the RNG. This allows to share a 
22415         single handle on Linux to access /dev/urandom and fix #73183.
22416
22417 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
22418
22419         * object.c: setting the new vtable in a transparent proxy object must
22420         not change the GC descriptor.
22421
22422 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22423
22424         * object.c: fixed compilation without GCJ support.
22425         * reflection.c: for runtime-created types ensure klass->has_references
22426         is correct (bug #73215).
22427
22428 2005-03-02  Martin Baulig  <martin@ximian.com>
22429
22430         * class.c (mono_class_is_assignable_from): Make this work if
22431         `oklass' is a generic instance; fixes #72831.
22432
22433 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22434
22435         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
22436         with hasthis set.
22437         
22438         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
22439
22440         * marshal.c: Reorganize native->managed marshalling code to also use
22441         the emit_marshal_... functions.
22442
22443 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22444
22445         * object.c: typed allocs have issues with bitmap sizes > 30,
22446         so check for max_set >= 30.
22447
22448 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22449
22450         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
22451         managed code. Fixes #73012.
22452
22453         * metadata.h (MonoMarshalSpec): Add elem_mult field.
22454
22455         * metadata.c reflection.c: Load/Emit elem_mult as well.
22456         
22457         * metadata.h (MonoMarshalSpec): Add comment.
22458
22459         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
22460
22461         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
22462         num_elem to -1 if not given.
22463
22464         * object-internals.h (MonoReflectionMarshal): Add has_size field.
22465
22466         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
22467         given values.
22468
22469 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
22470
22471         * null-gc.c (mono_gc_free_fixed): Was not compilable.
22472
22473 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
22474
22475         * reflection.c (encode_marshal_blob): Encode param_num field as well.
22476
22477         * object-internals.h (MonoReflectionMarshal): Add param_num field.
22478
22479 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22480
22481         * object.c: generalized the reference bitmap creation
22482         and added hooks for the new GC.
22483         * class-internals.c: removed the gc_bitmap field from MonoClass.
22484
22485 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22486
22487         * domain.c: help the compiler to produce better code
22488         in mono_jit_info_table_find ().
22489
22490 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22491
22492         * object.c: make all allocations look typed.
22493
22494 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22495
22496         * socket-io.c: load Mono.Posix if it's not loaded already
22497         (fixes bug#73033).
22498
22499 2005-02-24  Martin Baulig  <martin@ximian.com>
22500
22501         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
22502         * reflection.c (dup_type): Likewise.
22503
22504 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
22505
22506         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
22507         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
22508
22509 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22510
22511         * domain.c, threads.c, object-internals.h: make the critical thread
22512         local vars use the fast access mode (even when we're compiled in
22513         a lib). Provide accessors to be used by the jit during codegen.
22514
22515 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
22516
22517         * appdomain.c: Changed hook functios behavior to include
22518         support for the reflection only assemblies. Some icalls were changed
22519         to support the mentioned assemblies too. Signatures of static methods
22520         try_assembly_resolve and real_load now have an additional parameter:
22521         refonly.
22522
22523         * assembly.c: General changes to mono_assembly_ methods to support
22524         reflection only api. Functions mono_assembly_open, mono_assembly_load,
22525         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
22526         suffix, to support an additional gbool parameter to specify whether
22527         the assembli is reflection only or not. Created some new hook functions 
22528         to add support for reflection only assemblies. Signatures of static 
22529         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
22530         have now an additional parameter: refonly.
22531
22532         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
22533         indicating whether the assembly is reflection only or not.
22534
22535         * exception.c: Add mono_get_exception_invalid_operation.
22536
22537         * icall.c: Throw an InvalidOperationException when trying to invoke
22538         a property/method/event, or trying to set/get the value of a field.
22539         Also add an icall to retrieve the ref_only flag to the
22540         MonoReflectionAssembly.
22541
22542 2005-02-23  Chris Toshok  <toshok@ximian.com>
22543
22544         Part of fix for #72827.
22545         * mono-debug.c (mono_debug_add_method): add lexical block data to
22546         the info we write.  Kind of a hack at the moment - we copy the
22547         lexical block info from the MonoDebugMethodInfo to the
22548         MonoDebugMethodJitInfo here, before writing it.
22549         (mono_debug_read_method): read the lexical block info.
22550
22551         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
22552
22553         * debug-mono-symfile.h: add lexical block support.
22554
22555         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
22556         support.
22557
22558 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22559
22560         * loader.c (mono_lookup_pinvoke_call): Fix warning.
22561
22562         * object.c (mono_runtime_free_method): Call mono_free_method () and
22563         put the TODOs there.
22564
22565         * loader.c (mono_free_method): Free up most memory allocated for 
22566         dynamic methods.
22567
22568 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22569
22570         * reflection.c: properly flag a Type argument to a
22571         named custom attr value (bug #72248).
22572
22573 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22574
22575         * reflection.c: reduce code duplication in named custom
22576         attribute encoding.
22577
22578 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
22579
22580         * reflection.c: properly encode custom attrs of type object
22581         (bug #72649).
22582
22583 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22584
22585         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
22586
22587 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
22588
22589         * socket-io.c: load System.dll if it's not loaded already
22590         (bug #72850 and #70477).
22591
22592 2005-02-21  Martin Baulig  <martin@ximian.com>
22593
22594         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22595         generic instances.
22596
22597 2005-02-21  Martin Baulig  <martin@ximian.com>
22598
22599         * reflection.c (mono_image_build_metadata): We also need to
22600         "fixup" the MethodImpl table after we computed the final method
22601         indices.  Call fixup_methodimpl() to do that.
22602         (fixup_methodimpl): New private method.
22603
22604 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22605
22606         * assembly.c: special case mscorlib.dll (bug#72536),
22607         patch from Carlos Alberto Cortez.
22608
22609 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
22610
22611         * threads-types.h threads.c: Fix build bustage.
22612
22613         * threads.c: Use a union for long<->double conversions.
22614
22615         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
22616         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
22617
22618         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
22619         containing the checkpoint call with NOT_TAKEN.
22620         
22621         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
22622         checkpoint before pushing the arguments, so they won't have to be
22623         spilled to stack.
22624
22625 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22626
22627         * domain.c, assembly.c, domain-internals.h: make some data
22628         const and relocation-free.
22629
22630 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
22631
22632         * object.c, appdomain.c, class-internals.h: introduce the
22633         MonoClassRuntimeInfo structure to hold the info needed to
22634         use a class at runtime. Made mono_class_vtable() lock-free
22635         for all the appdomains.
22636
22637 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
22638
22639         * metadata-internals.h, image.c: introduce a per-image mempool to
22640         be used for memory that has the same lifetime as the image.
22641
22642 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
22643
22644         * domain.c: In mono_init_internal(), instead of selecting the first
22645         runtime version supported by an executable, get a list of all
22646         supported versions and select the one for which an mscorlib exists
22647         (since even if the runtime supports a given version, it doesn't mean
22648         that the framework for that version is installed).
22649         Modified get_runtimes_from_exe to support this behavior.
22650         In supported_runtimes, added information about additional system
22651         assembly versions.
22652         
22653         * assembly.c: Added support for more than one system assembly version
22654         per runtime version. Updated the assembly list.
22655         In mono_assembly_remap_version, removed the initial version check,
22656         since we don't know to which version we need to compare until we
22657         get the version set on which the assembly is based.
22658         Moved the code for loading corlib into the new method
22659         mono_assembly_load_corlib(), so it can be used by the initialization
22660         code.
22661         
22662         * domain-internals.h: Updated data structures and added declaration
22663         for mono_assembly_load_corlib.
22664
22665 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22666
22667         * reflection.c (resolve_object): Fix the creation of the signature in 
22668         the SignatureHelper case.
22669
22670         * assembly.c (mono_assembly_remap_version): Fix binary search.
22671         
22672 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
22673  
22674         * class.c: Added inheritance check when a method is overloaded (from a
22675         virtual method or when implementing an interface) and when a class is
22676         inherited. Added functions to set a failure for a class and to 
22677         retreive the exception from a failure.
22678         * class-internals.h: Added fields to MonoClass to keep the exception
22679         information status for inheritance (or other exceptions) to be thrown
22680         later (i.e. not at load time).
22681         * object.c: Throw the inheritance SecurityException when a type is to 
22682         be created with either class or method inheritance violations.
22683         * reflection.c|h: Fix when getting declsec from a class. Removed 
22684         unrequired code for class. Improved sanity in parameter naming.
22685         * security-manager.c|h: Added functions to check for class and method
22686         inheritance.
22687
22688 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22689
22690         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
22691         and has_finalize in dynamic types as well.
22692
22693 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
22694
22695         * culture-info-table.h : fixed currency format for en-GB (and so on).
22696
22697 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
22698
22699         * gc.c: ensure the GC handles never have 0 as a value.
22700
22701 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22702
22703         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
22704         a pointer to a struct to unmanaged code. Fixes #72625.
22705
22706 2005-02-16  Martin Baulig  <martin@ximian.com>
22707
22708         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
22709
22710 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22711
22712         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
22713
22714 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22715
22716         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
22717
22718         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
22719         UnmanagedFunctionPointerAttribute, use it for determining calling convention
22720         etc. Fixes #71471.
22721
22722         * reflection.c (mono_custom_attrs_get_attr): New helper function.
22723
22724         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
22725
22726 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
22727
22728         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
22729         changes to make the current context a field in MonoThread.
22730
22731 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22732
22733         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
22734         the last change.
22735         
22736         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
22737         extracted from mono_marshal_get_native_wrapper.
22738
22739         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
22740         to create wrappers around native functions.
22741
22742         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
22743         delegates for arbitrary function pointers. Fixes #71472.
22744
22745 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
22746
22747         * threads.c: cleaned up the code a little.
22748
22749 2005-02-15  Martin Baulig  <martin@ximian.com>
22750
22751         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
22752         the data table.
22753
22754         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
22755         allocate larger chunks if needed.
22756
22757 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22758
22759         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
22760         in by mistake.
22761
22762 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
22763
22764         * domain.c: keep the domains in an array and ensure the domain ids
22765         are kept small, so they can be used as indexes to domain-specific data
22766         with a small memory overhead.
22767
22768 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22769
22770         * icall.c: Handle byref types in Type icalls. Fixes #72544.
22771
22772 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
22773
22774         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
22775
22776 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
22777
22778         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
22779
22780         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
22781         values.
22782
22783         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
22784         
22785 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
22786
22787         * domain-internals.h: add the hashtable here.
22788
22789         * class-internals.h: Remove `info' from MonoMethod
22790
22791         * domain.c: Add a new hashtable, jit_trampoline_hash
22792
22793 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
22794
22795         * object.c: don't set the value of static fields
22796         (fixes bug#72494).
22797
22798 2005-02-11  Martin Baulig  <martin@ximian.com>
22799
22800         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
22801         (mono_debug_add_method): Silently ignore the method if it's too big.
22802         (mono_debug_add_type): Likewise.
22803
22804 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
22805
22806         * threads.c, appdomain.c: remove #ifdefs from the code.
22807
22808 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
22809
22810         * metadata-internals.h: Added flags to MonoAssembly to cache the most
22811         common security informations. This allows us to stay in unmanaged code
22812         when doing LinkDemand and it's special cases (except for the first 
22813         time for initialization). The flags a very much used with --security.
22814         * reflection.c|h: Added code to get declarative security attributes 
22815         for LinkDemand and InheritanceDemand. This required to refactor the
22816         existing code for Demand.
22817         * security-manager.c|h: Added new method fields for the special cases
22818         of LinkDemand.
22819
22820 2005-02-10  Martin Baulig  <martin@ximian.com>
22821
22822         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
22823         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
22824
22825 2005-02-10  Martin Baulig  <martin@ximian.com>
22826
22827         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
22828         debugging code; this is almost a complete rewrite.
22829
22830         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
22831
22832 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22833
22834         * domain.c, object.h: expose mono_string_equal () and 
22835         mono_string_hash ().
22836         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
22837         it's implemented in managed code.
22838
22839 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22840
22841         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
22842         lo leak objects between appdomains.
22843
22844 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22845
22846         * assembly.c: old compilers compilation fix from 
22847         robertj@gmx.net (Robert Jordan).
22848
22849 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
22850
22851         * class-internals.h: Little reminder for the future.
22852
22853         * debug-helpers.c: Fix up wrapper_type_names
22854
22855 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22856
22857         * image.c, metadata-internals.h: when loading an image from a file,
22858         mmap all of it and use the same codepaths as when using a
22859         in-memory image: the code is simpler and we use less memory
22860         (both writable and readonly).
22861
22862 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22863
22864         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
22865         API to alloc runtime data structures that need to be tracked by the
22866         GC and contain pointers.
22867         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
22868         make the code more readable and eventually use a different GC.
22869
22870 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
22871
22872         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
22873         for out arguments.
22874         
22875 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
22876
22877         * object.c: In release_type_locks(), don't release the cctor lock
22878         if it has already been released. This fixes a crash in the
22879         thread5 test.
22880
22881 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22882
22883         * gc.c, marshal.c, icall.c: register a delegate for finalization
22884         only when the native function pointer has been allocated for it.
22885
22886 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22887
22888         * object.c: cleaned up some code, allocate objects that are
22889         pointer free with the atomic malloc variant. Allocate memory
22890         for static data from the mempool if it's pointer-free.
22891         Allocate the bounds array at the end of the array data, when needed.
22892         * object-internals.h, object.h: move a private function in a private
22893         header.
22894         * class.c: handle missing case in tracking references in fields.
22895
22896 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22897
22898         * class.c, class-internals.h: keep track if a type has
22899         reference fields in either the instance or static fields.
22900
22901 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
22902
22903         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
22904         and renamed to MonoRuntimeInfo. Added fields to store the expected
22905         framework assembly version. Changed mono_get_framework_version and
22906         mono_get_runtime_version for a single mono_get_runtime_info method.
22907         
22908         * assembly.c: Added method to remap system assembly versions to the
22909         current executing runtime version. Removed old mapping code.
22910         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
22911         
22912         * icall.c, reflection.c: Track api changes.
22913
22914 2005-02-06  Miguel de Icaza  <miguel@novell.com>
22915
22916         * loader.c (method_from_memberref): Improve error reporting,
22917         produce the class name instead of the typeref/typedef index. 
22918
22919 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
22920
22921         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
22922
22923 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22924
22925         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
22926         stdcall and charset name mangling.  Reorganize the code and add
22927         some tracing stuff.
22928
22929 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22930
22931         * monodiet.c: More iters!
22932
22933         * marshal.c: Iter usage.
22934
22935         * icall.c: Iter usage.
22936
22937         * object.c: Use iters.
22938
22939         * debug-helpers.c: More iters
22940
22941 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22942
22943         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
22944         under win32.
22945
22946 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22947
22948         * mono-debug-debugger.c: use iters
22949
22950         * class.c, class-internals.h: mono_class_setup_events is static
22951         now
22952
22953         * All callers: use iters
22954
22955 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22956
22957         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
22958         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
22959
22960 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22961
22962         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
22963
22964         * marshal.h: Add prototypes for ldfld/stfld_remote.
22965
22966         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
22967         this is called during startup.
22968         
22969 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
22970
22971         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
22972         MonoThreadsSync struct private in monitor.c. Changed the way
22973         MonoThreadsSync is allocated so it's faster and there is no
22974         need to keep track of it with a finalizer and it uses less memory.
22975         This also finally allows us to allocate mono objects as ptrfree when
22976         there are no reference fields.
22977
22978 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
22979
22980         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
22981         disappearing link to the GC interface and use them to simplify
22982         the gchandles code.
22983
22984 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22985
22986         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
22987         stfld_remote which call mono_load/store_field_new. This allows methods
22988         calling ldfld/stfld wrappers to be AOTed.
22989
22990         * console-io.c: Include sys/filio.h under solaris.
22991         
22992         * console-io.c: Include curses.h if needed correctly.
22993
22994 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
22995         
22996         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
22997         method->klass as well.
22998
22999         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
23000
23001         * class.c (mono_class_init): Switch on lazy initialization of 
23002         methods.
23003
23004         * class.c (mono_class_get_finalizer): Handle the case when the 
23005         finalizer is inherited.
23006
23007 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23008
23009         * console-io.c: <curses.h> is needed by term.h on solaris.
23010
23011 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
23012
23013         * icall.c, class-internals.h, monodiet.c, class.c: Remove
23014         mono_class_setup_properties where possible. Remove this ftn from
23015         the header file, and make it static.
23016
23017 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
23018
23019         * loader.c: Add missing setup_... call.
23020
23021         * class.c: Add missing setup_... calls.
23022
23023         * class.c (mono_class_init): Switch on lazy initialization of 
23024         the generic vtable.
23025         
23026         * class.c (mono_class_init): Fix generics broken by the recent changes.
23027
23028         * monodiet.c (handle_type): Add missing setup_... calls.
23029
23030         * class.c: Back out garbage in previous patch.
23031         
23032         * class.c: Add missing setup_... calls.
23033
23034         * class.c (mono_class_get_method_from_name_flags): Avoid calling
23035         mono_class_setup_methods () if possible.
23036
23037         * class-internals.h (MonoClass): Add 'has_cctor' flag.
23038
23039         * class-internals.h (MonoCachedClassInfo): New structure.
23040
23041         * class.c: Initialize properties and events fields of MonoClass lazily.
23042
23043         * class.c: Add infrastructure for lazily initializing the methods and
23044         vtable fields of MonoClass. Not yet used.
23045
23046         * class.c (mono_class_get_finalizer): New helper function.
23047
23048         * class.c: Add infrastructure for loading some class related data from
23049         an AOT file.
23050
23051         * object.c: Add infrastructure for initializing the vtable from data
23052         in the AOT file.
23053
23054         * gc.c (run_finalize): Use mono_class_get_finalizer ().
23055
23056         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
23057         appropriate initialization function before accessing parts of the
23058         MonoClass structure.
23059
23060         * marshal.c: Fix warnings.
23061         
23062         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
23063
23064         * mono-debug-debugger.c (get_exception_message): Use 
23065         mono_class_get_method_from_name_flags ().
23066
23067 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
23068
23069         * reflection.c, appdomain.c: Replace a few manual searches that
23070         Zoltan missed. (Paolo approved this part of my initial patch).
23071
23072 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
23073
23074         * profiler.c: disable recording statistical events at report time.
23075
23076 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
23077
23078         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
23079         to byteswap arrays of enum values, too (bug #72080).
23080
23081 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
23082
23083         * appdomain.c (set_domain_search_path): Allow this to be called if
23084         domain->setup is not yet set.
23085
23086         * loader.c (mono_method_get_index): New helper function.
23087
23088         * loader.c reflection.c: Use mono_method_get_index ().
23089
23090         * class.c (mono_class_get_method_from_name_flags): New helper method.
23091
23092         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
23093         this.
23094
23095         * class.c (mono_class_get_cctor): New helper method.
23096
23097         * string-icalls.c object.c class.c marshal.c reflection.c: Use
23098         mono_class_get_method () to look up methods.
23099
23100 2005-02-01  Miguel de Icaza  <miguel@novell.com>
23101
23102         * console-io.c: Fix the build, this should work on Windows.
23103
23104 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
23105
23106         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
23107         be set to null to keep things valid
23108
23109 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23110
23111         * icall.c: added Console 2.0 icalls.
23112         * Makefile.am: added console-io.[ch]
23113         * console-io.[ch]: internal calls for Console 2.0 API.
23114
23115 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
23116
23117         * class.c: make sure we consider all the interfaces
23118         when calculating max_interface_id (bug found by
23119         Jeroen Frijters running ikvm).
23120
23121 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
23122
23123         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
23124         valuetype fields to null.
23125
23126         * object.c (set_value): Ditto. Fixes #71669.    
23127
23128 2005-01-31  Martin Baulig  <martin@ximian.com>
23129
23130         * metadata.c (mono_metadata_has_generic_params): New public
23131         function; checks whether something is a generic method.
23132
23133 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
23134
23135         * appdomain.c: fix infinite recursion when adding assemblies.
23136
23137 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
23138
23139         * object.c: Fix small typo to return all items for Environment.
23140         GetCommandLineArgs.
23141
23142 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
23143
23144         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
23145         reflection.c: more domain and assembly-unload related fixes
23146         and memory leaks plugs.
23147
23148 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
23149
23150         * 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.
23151
23152 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
23153
23154         * loader.c (mono_method_signature): Make this method lazy
23155         (mono_get_method_from_token): Don't computate the signature here.
23156
23157         Doing this saves quite a bit of memory. I got 90 kb on starting up
23158         monodoc. It should also save some disk reads on startup.
23159
23160         * *: MonoMethod->signature might be NULL now. You *MUST* use
23161         mono_method_signature.
23162
23163 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
23164
23165         * object.c (mono_runtime_get_main_args): Return an array from the
23166         current domain here. Fixes #71938.
23167
23168 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
23169
23170         * monitor.c: formatting changes to comply with the
23171         mono coding style and remove #ifdefs from the code.
23172
23173 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
23174
23175         * metadata.c, private.h: remove some unneeded data
23176         and use a more compact representation for table schemas.
23177
23178 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
23179
23180         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
23181         to get a better distribution in hash tables.
23182         * *.c: use mono_aligned_addr_hash() where appropriate.
23183         * assembly.c: make var static.
23184
23185 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
23186
23187         * domain-internals.h: Put MonoJitInfo on a diet.
23188
23189         * domain.c: Fix a warning.
23190
23191 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
23192
23193         * gc.c: rework the gc handles code to reuse handles
23194         when freed.
23195
23196 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
23197
23198         * domain.c: fixed long standing bug in mono_string_equal() which
23199         was brought to light with the ldstr changes.
23200
23201 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
23202
23203         * reflection.c: Remove warning by adding missing include for marshal.h
23204
23205 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
23206
23207         * domain.c, object.c: change the ldstr_table to hold
23208         MonoString* as keys: makes the runtime isinterned lookup
23209         faster and simplifies memory management.
23210
23211 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
23212  
23213         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
23214         possible to add imperative security checks before calling the icall.
23215         * reflection.c: Return security attributes on the original MonoMethod
23216         (and not the wrapped one). This fix permissions on icalls.
23217
23218 2005-01-25  Dick Porter  <dick@ximian.com>
23219
23220         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
23221         the check for mktime() support actually test the mktime() return
23222         value.  "Fixes" bug 71682, though the output is still different to
23223         MS.
23224
23225 2005-01-25  Martin Baulig  <martin@ximian.com>
23226
23227         * class.c (mono_class_is_assignable_from): Make this work for
23228         generic instances.
23229
23230 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
23231
23232         * marshal.c (mono_string_utf8_to_builder)
23233         (mono_string_builder_to_utf16): We might not have ownership of the
23234         string. In thise case, we need to create a new buffer.
23235
23236         * object-internals.h (mono_stringbuilder_capacity): sb->str might
23237         be null, in which case, use the default capacity.
23238
23239 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
23240
23241         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
23242         GC events to the profiler.
23243
23244 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
23245
23246         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
23247         if you don't want the GC to run.
23248
23249 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
23250
23251         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
23252         start providing a GC API and keeping different implementations in
23253         their own file.
23254         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
23255
23256 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
23257
23258         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
23259         mmap rather than allocating a huge buffer.
23260         (mono_debug_close_mono_symbol_file): Free the buffer allocated
23261         above.
23262
23263 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
23264
23265         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
23266         and CheckExecutionRights.
23267         * reflection.c|h: Keep the index of the declarative security to be 
23268         used, instead of the pointer, when AOT compiler is used. Also add 
23269         class initialization when requesting demands.
23270         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
23271         CheckExecutionRights. Both properties are now FALSE by default, and
23272         unmodifiable, unless the --security option is used.
23273
23274 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
23275
23276         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
23277         reflection.c: properly refcount images and assemblies, many leaks fixed.
23278
23279 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23280
23281         * threadpool.c: increase the timeout for threads in the thread pool to
23282         10s.  Fixes bug #67159.
23283
23284 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
23285
23286         * class-internals.h: Sun's compiler insists on explicit
23287         signed on bit fields to handle then correctly.
23288
23289 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
23290
23291         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
23292         Make the size of the array fit only the number of invalid path
23293         chars that we have.
23294
23295         * class.c (_mono_class_get): Improve the error reporting when a
23296         class referenced is not found, to assist debugging. 
23297
23298 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
23299
23300         * threads.c: fix off-by-one error.
23301         * domain.c: free data allocated in the domain.
23302
23303 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23304
23305         * reflection.c (mono_method_body_get_object): Fill out exception info
23306         as well.
23307
23308         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
23309         structure.
23310         
23311 2005-01-19  Martin Baulig  <martin@ximian.com>
23312
23313         * loader.c (mono_get_method_constrained): Make this work again.
23314
23315 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23316
23317         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
23318         guint16 to match the managed side.
23319
23320         * reflection.c (mono_reflection_body_get_object): Fill out local
23321         variables array.
23322
23323         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
23324         as well.
23325
23326         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
23327         'local_var_sig_token'.
23328
23329 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
23330
23331         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
23332         System.Drawing.
23333
23334         * reflection.c (mono_method_body_get_object): Handle abstract and
23335         runtime methods.
23336
23337 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
23338
23339         * marshal.c, loader.c, class-internals.h, reflection.c:
23340         store the emthod data for a wrapper in an array instead of a list.
23341
23342 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
23343
23344         * marshal.c: change the code to allocate memory more
23345         conservatively for method wrappers.
23346
23347 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
23348
23349         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
23350         fields from MonoClass to the marshal info structure where they belong.
23351
23352 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
23353
23354         * class.c, object.c, class-internals.h, marshal.c: rearrange
23355         some fields and tweak some types to lower memory usage.
23356
23357 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
23358
23359         * threads.c (signal_thread_state_change): Handle the case when the
23360         target thread is the current thread.
23361
23362         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
23363
23364         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
23365         emit_ptr_to_object_conv. 
23366
23367         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
23368         marshalling. Fixes #71352.
23369
23370 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
23371
23372         * metadata.h, blob.h: move table enum to blob.h so it can be included
23373         in any header.
23374         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
23375         cut the size of MonoImage/MonoDynamicImage.
23376
23377 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
23378
23379         * profiler.c (mono_profiler_install_simple): Fix default arguments.
23380
23381 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
23382
23383         * reflection.c, reflection.h, icall.c: add a function to check
23384         if an attribute type is defined for a metadata object.
23385
23386 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
23387
23388         * object-internals.h: Added some needed fields from StringBuilder class.
23389         * marshal.c: Set the maxCapacity when creating a StringBuilder.
23390
23391 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
23392
23393         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
23394         threads before shutting down the runtime.
23395
23396         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
23397
23398 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
23399
23400         * object-internal.h, threads.c: implement stacksize and 
23401         parameterized thread start functionality (requires
23402         matching corlib). Marked broken code for later removal.
23403
23404 2005-01-12  Martin Baulig  <martin@ximian.com>
23405
23406         * class-internals.h (MonoGenericClass): Moved the `initialized'
23407         flag to MonoDynamicGenericClass, removed `init_pending'.
23408         (MonoGenericInst): Added `is_reference' flag.
23409
23410 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
23411
23412         * reflection.c (mono_image_create_pefile): Only set the pe_offset
23413         inside the MSDOS header. Fixes #71201.
23414
23415         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
23416         gc thread.
23417         (mono_domain_finalize): Ditto.
23418
23419 2005-01-12  Martin Baulig  <martin@ximian.com>
23420
23421         * class.c (mono_get_shared_generic_class): Use the cache for
23422         non-dynamic generic classes.
23423
23424         * class-internals.h (mono_class_create_generic_2): Removed
23425         function prototype, this function is now static inside class.c.
23426
23427         * class.c (mono_class_create_generic_2): Made this static, only
23428         call it from mono_class_init() and mono_class_setup_parent().
23429         (collect_implemented_interfaces_aux): Call mono_class_init() on
23430         the interfaces we collect.
23431         (mono_class_setup_vtable): Call mono_class_init (class->parent).
23432
23433 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23434
23435         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
23436         it a real thread handle.
23437
23438         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
23439         MonoJitExceptionInfo, since each catch clause needs its own variable.
23440         
23441 2005-01-11  Dick Porter  <dick@ximian.com>
23442
23443         * image.c (mono_pe_file_open): New variant on mono_image_open()
23444         that does not set up the CLI metadata; used for FileVersionInfo so
23445         it can get the data for windows binaries too.
23446         
23447         * process.c (process_read_string_block): Don't read off the end of
23448         the StringTable block.
23449
23450         These both fix bug 70766.
23451
23452 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
23453
23454         * gc.c: set some fields to NULL at GC cleanup time.
23455         * threads.c: if we quit the main thread, call exit ().
23456
23457 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23458
23459         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
23460
23461 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
23462
23463         * threads.h, threads.c, object.c: added accessor and settor for
23464         main_thread. Handle it specially when exiting from it: wait
23465         for other foreground threads to exit.
23466
23467 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
23468
23469         * process.c, verify.c: remove some bloat.
23470
23471 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
23472
23473         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
23474         the calling convention to cdecl under win32.
23475
23476 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
23477
23478         * object.c (mono_object_get_size): New function to get the size of
23479         an object instance.
23480
23481         * profiler.c (simple_allocation): Use above.
23482
23483 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
23484
23485         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
23486         ves_icall_System_AppDomain_getRootDomain (as it's not required to
23487         get an appdomain by it's id and we can't assume the root's id is 0).
23488         * domain-internals.h: Change the function prototype to match.
23489         * icall.c: Change the icall table for AppDomain.
23490
23491 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * locales.c (string_invariant_compare_char): Only compute
23494         GUnicodeTypes in the case where we need them.  Test for ordinality
23495         first and return if so.
23496
23497         From the commit:
23498
23499                 /*
23500                  * FIXME: here we must use the information from c1type and c2type
23501                  * to find out the proper collation, even on the InvariantCulture, the
23502                  * sorting is not done by computing the unicode values, but their
23503                  * actual sort order.
23504                  */
23505
23506 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
23507
23508         * loader.c: for P/Invoke methods, allow the "Internal" shared
23509         library name to refer to the calling process symbol namespace.
23510
23511 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
23512
23513         * Makefile.am: Add the security manager to the build.
23514         * security-manager.c|h: New. Initialization of the security manager.
23515
23516 2005-01-07  Dick Porter  <dick@ximian.com>
23517
23518         * threads.c: 
23519         * monitor.c: Update thread state during Monitor and WaitHandle
23520         waits.  Fixes bug 71031.
23521
23522 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
23523
23524         * reflection.c (property_encode_signature): Correctly handle when the
23525         property has no methods.
23526
23527 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
23528
23529         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
23530         
23531         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
23532         fields from mb, not rmb. Fixes #71017.
23533
23534         * marshal.c (emit_ptr_to_str_conv): Add support for 
23535         ByValTStr -> string conversion. Fixes #71015.
23536
23537         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
23538
23539         * mempool.c (mono_mempool_contains_addr): New helper function.
23540
23541 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23542
23543         * metadata.c (mono_metadata_compute_size): Fix size calculation of
23544         HasSematics encoded fields.
23545         
23546         * metadata.c (mono_type_to_unmanaged): Improve error message for 
23547         invalid string marshalling.
23548
23549         * metadata.c: Fix warnings.
23550         
23551 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
23552
23553         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
23554         profiler support.
23555
23556 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23557
23558         * domain.c object.c domain-internals.h: Revert part of r38077 since the
23559         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
23560         tests.
23561
23562 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
23563
23564         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
23565         so methods containing these can be AOTed.
23566
23567 2005-01-03  Martin Baulig  <martin@ximian.com>
23568
23569         * loader.c (find_method): Removed the hack for generic instances.
23570         (method_from_memberref): If our parent is a generic instance, pass
23571         its generic type definition to find_method() and then inflate the
23572         method.
23573         (mono_get_method_constrained): Pass the generic type definition to
23574         find_method() and inflate the method later.
23575
23576         * class-internals.h (MonoStats): Added `generic_class_count'.
23577
23578         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
23579         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
23580
23581         * reflection.c (mono_custom_attrs_from_params): Don't ignore
23582         generic type definitions.
23583
23584 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
23585
23586         * loader.c icall.c: Fix warnings.
23587
23588 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
23589
23590         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
23591         blittable types. Fixes #70864.
23592
23593 2004-12-29  Martin Baulig  <martin@ximian.com>
23594
23595         * icall.c
23596         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
23597
23598         * reflection.c (mono_method_get_object): Create a
23599         "System.Reflection.MonoGenericMethod" for inflated methods; don't
23600         call mono_get_inflated_method().
23601
23602         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
23603
23604 2004-12-27  Martin Baulig  <martin@ximian.com>
23605
23606         * class-internals.h (MonoMethod): Added `is_inflated' flag.
23607         (MonoMethodInflated): Added `inflated' field.
23608
23609         * class.c (mono_class_inflate_generic_method): Don't really
23610         inflate the method here; just set the `is_inflated' flag in the
23611         MonoMethod.
23612         (mono_class_get_inflated_method): Actually inflate the method here
23613         if it's not already inflated; we use the MonoMethodInflated's new
23614         `inflated' field as a cache.
23615
23616 2004-12-26  Martin Baulig  <martin@ximian.com>
23617
23618         * class.c
23619         (inflate_generic_class): Moved some code out of inflate_generic_type().
23620         (mono_class_inflate_generic_method): If we're already inflated,
23621         inflate the context and use the declaring method; ie. make sure
23622         the declaring method of an inflated method is always the generic
23623         method definition.
23624         (mono_class_create_from_typedef): Create
23625         `class->generic_container->context->gclass'.
23626
23627 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
23628
23629         * metadata-internals.h, marshal.c, reflection.c: More
23630         MonoGHashTable->GHashTable.
23631
23632         * domain-internals.h, class.c: Change MonoGHashTable's into
23633         GHashTables for some cases where no gc stuff is used
23634
23635         All users: update apis
23636
23637 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
23638
23639         * metadata.c (builtin_types): Make this `const'. Makes this get
23640         put into the shareable section.
23641         (mono_metadata_init): Casts to make gcc happy.
23642
23643 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
23644
23645         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
23646
23647 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
23648
23649         * icall.c: Added an internal call to retrieve the position and length
23650         of assembly-level declarative security attributes (RequestMinimum, 
23651         RequestOptional and RequestRefuse). This is used by the Assembly class
23652         to re-create the corresponding permission sets.
23653
23654 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
23655
23656         * marshal.c: fix the stelemref wrapper to be type correct
23657         (and faster).
23658
23659 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
23660
23661         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
23662         to do key & 0x7fffffff. Hashtable already does this. It just
23663         results in longer code.
23664
23665 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
23666
23667         * appdomain.c: Bump corlib version.
23668         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
23669         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
23670         * reflection.c|h: Add functions to get declarative security infos
23671         (blob position and length) for assemblies, classes and methods.
23672
23673 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
23674
23675         * reflection.c: sort the constant table (bug #70693).
23676
23677 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
23678
23679         * object-internals.h, threads.c, domain.c: add accessors for
23680         the MonoThread and MonoDomain tls keys.
23681
23682 2004-12-18  Martin Baulig  <martin@ximian.com>
23683
23684         * class.c (inflate_generic_type): If we're inflating a generic
23685         instance, set `ngclass->context->container = context->container';
23686         ie. the container we inflated into.
23687
23688         * metadata.c (mono_metadata_parse_generic_param): Reflect above
23689         inflate_generic_type() changes.
23690
23691 2004-12-17  Martin Baulig  <martin@ximian.com>
23692
23693         * class-internals.h
23694         (MonoGenericClass): Replaced `MonoType *generic_type' with
23695         `MonoClass *generic_class'.  Removed `dynamic_info'; if
23696         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
23697         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
23698
23699 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
23700
23701         * exception.c (mono_exception_from_token): New helper function.
23702
23703 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
23704
23705         * assembly.c (mono_assembly_load_with_partial_name): Call 
23706         mono_assembly_loaded before invoking the preload hooks. Fixes
23707         #70564.
23708
23709         * object-internals.h (MonoThread): Change culture_info and 
23710         ui_culture_info into an array.
23711
23712         * threads.c: Cache culture info objects from more than one appdomain.
23713
23714         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
23715         current UI culture.
23716
23717 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
23718
23719         * threads.h threads.c appdomain.c: Clear the culture_info field of
23720         all threads during unloading if they point to an object in the dying
23721         appdomain.
23722
23723 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
23724
23725         * culture-info.h (TextInfoEntry): New struct
23726         * object-internals.h: sync with managed
23727         * locales.c: fill the `text_info_data' field
23728         * culture-info-tables.h: update
23729
23730 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
23731
23732         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
23733         collector.
23734
23735 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
23736
23737         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
23738         (ves_icall_ModuleBuilder_getMethodToken): Ditto
23739
23740 2004-12-12  Martin Baulig  <martin@ximian.com>
23741
23742         * mono-debug-debugger.c (write_type): If we're an enum and the
23743         builtin types have already been initialized, call mono_class_init().
23744
23745 2004-12-11  Martin Baulig  <martin@ximian.com>
23746
23747         * metadata.c (mono_metadata_load_generic_params): Added
23748         `MonoGenericContainer *parent_container' argument; automatically
23749         compute `container->is_method'; pass the correct owner to
23750         get_constraints().      
23751
23752         * reflection.c (compare_genericparam): Sort the GenericParam table
23753         according to increasing owners. 
23754
23755 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
23756
23757         * profiler.c: allow disabling the default profiler.
23758
23759 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
23760
23761         * decimal.c, icall.c: allow disabling System.Decimal support.
23762
23763 2004-12-09  Marek Safar <marek.safar@seznam.cz>
23764
23765         * reflection.c: Add support for null attribute arguments.
23766
23767 2004-12-09  Martin Baulig  <martin@ximian.com>
23768
23769         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
23770         names to get rid of compiler warnings.
23771
23772 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23773
23774         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
23775         mono_marshal_load_type_info (). Fixes #69625.
23776         (mono_marshal_get_ptr_to_struct): Likewise.
23777
23778 2004-12-08  Martin Baulig  <martin@ximian.com>
23779
23780         * mono-debug.h: Bumped version number to 47.
23781
23782         * mono-debug-debugger.c
23783         (mono_debugger_event_handler, mono_debugger_event): Take two
23784         guint64 arguments insteed of a gpointer and a guint32.  
23785
23786 2004-12-08  Martin Baulig  <martin@ximian.com>
23787
23788         * debug-mono-symfile.h
23789         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
23790         `address' to `native_offset'.
23791
23792 2004-12-08  Martin Baulig  <martin@ximian.com>
23793
23794         * class.c (mono_class_create_from_typespec): Only inflate if we
23795         either have `context->gclass' or `context->gmethod'.
23796
23797 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23798
23799         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
23800
23801         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
23802
23803         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
23804
23805         * reflection.c (mono_assembly_get_object): Remove the workaround put
23806         in for the release.
23807         
23808         * appdomain.c: Use the corlib_internal field from MonoAssembly.
23809
23810         * appdomain.c: Bump corlib version.
23811
23812         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
23813         be visible in other appdomains.
23814
23815 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
23816
23817         * threads.c: Interlocked inc and dec for longs were messed up,
23818         use a KISS based impl for this. Fixes 70234
23819
23820 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
23821
23822         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
23823
23824 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
23825
23826         * icall.c: fix to follow policy not to allow struct
23827         arguments in icalls.
23828
23829 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23830
23831         * process.c: make the patch that handles spaces in file paths work
23832         on mono/windows too.
23833
23834 2004-12-06  Martin Baulig  <martin@ximian.com>
23835
23836         * class.c (mono_class_create_generic): Call
23837         mono_class_setup_supertypes() if we're dynamic.
23838         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
23839
23840 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
23841
23842         * object-internals.h: Add new fields to MonoThread.
23843
23844         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
23845
23846         * icall.c threads-types.h threads.c: Add new icalls.
23847
23848         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
23849
23850         * object-internals.h (MonoReflectionAssembly): Sync object layout with
23851         managed side.
23852
23853         * appdomain.c: Bump corlib version.
23854
23855         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
23856         internal assemblies. Fixes #69181.
23857
23858 2004-12-05  Martin Baulig  <martin@ximian.com>
23859
23860         * class.c (mono_class_inflate_generic_signature): Make this a
23861         no-op if `context' is NULL or we don't have any type parameters;
23862         also copy `sentinelpos'.        
23863
23864 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
23865
23866         * image.c: Add unbox_wrapper_cache.
23867
23868         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
23869
23870         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
23871         function generator.
23872         
23873         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
23874         Fixes #70173.
23875
23876         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
23877         
23878 2004-12-04  Martin Baulig  <martin@ximian.com>
23879
23880         * loader.c (mono_method_get_signature_full): New public function;
23881         like mono_method_get_signature(), but with an additional
23882         `MonoGenericContext *' argument.
23883
23884         * class.c (mono_class_inflate_generic_signature): Formerly known
23885         as inflate_generic_signature(); make this public.
23886
23887 2004-12-04  Martin Baulig  <martin@ximian.com>
23888
23889         * metadata.c
23890         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
23891         instead of a `MonoGenericContainer *'.  
23892         (mono_metadata_parse_array_full): Likewise.
23893         (mono_metadata_parse_signature_full): Likewise.
23894         (mono_metadata_parse_method_signature_full): Likewise.
23895         (mono_metadata_parse_generic_inst): Likewise.
23896         (mono_metadata_parse_generic_param): Likewise.
23897         (mono_metadata_parse_mh_full): Likewise.
23898         (mono_type_create_from_typespec_full): Likewise.
23899
23900 2004-12-03  Martin Baulig  <martin@ximian.com>
23901
23902         * class-internals.h (MonoGenericContainer): Replaced the
23903         `MonoGenericContext * pointer with a `MonoGenericContext'
23904         structure and made it the first element.
23905
23906 2004-12-03  Martin Baulig  <martin@ximian.com>
23907
23908         * class.c
23909         (inflate_generic_type): Set the `context->container' when creating
23910         a new MonoGenericContext.
23911         (mono_class_inflate_generic_method): Likewise.
23912         (mono_class_create_from_typespec): Just use `context->container'
23913         to get the container.
23914
23915         * loader.c (method_from_methodspec): Set `context->parent' from
23916         `context->container' - and if that's a method container, use its
23917         parent.  Also set the `context->container' when creating a new
23918         MonoGenericContext.
23919         (mono_get_method_from_token): Use just `context->container' to get
23920         the container.
23921
23922         * metadata.c (do_mono_metadata_parse_generic_class): Also set
23923         `gclass->context->container'.
23924
23925         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
23926         the `context->container' when creating a new MonoGenericContext.
23927
23928 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
23929
23930         * reflection.c (compare_genericparam): Sort params with identical
23931         owner by their number. Fixes gen-111 on sparc.
23932
23933 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23934
23935         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
23936         around the domain changes.
23937
23938         * appdomain.c (mono_domain_unload): Handle the case when the thread
23939         calling Unload is itself being aborted during unloading. Fixes #70022.
23940
23941         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
23942
23943         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
23944         checkpoint_func as an icall so it gets a wrapper.
23945         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
23946         in the cross-appdomain wrappers too.
23947
23948         * threads.c (mono_thread_has_appdomain_ref): Make this public.
23949
23950         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
23951
23952         * reflection.c: Fix some memory leaks.
23953         
23954 2004-12-02  Martin Baulig  <martin@ximian.com>
23955
23956         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
23957
23958         * metadata.c (generic_class_cache): New static hashtable.
23959         (mono_metadata_lookup_generic_class): New public method.
23960
23961 2004-12-02  Martin Baulig  <martin@ximian.com>
23962
23963         * class.c (mono_class_create_from_typedef): Call
23964         mono_class_setup_parent() and mono_class_create_mono_type() before
23965         parsing the interfaces.
23966
23967 2004-12-02  Martin Baulig  <martin@ximian.com>
23968
23969         * metadata.c (generic_inst_cache): New static hashtable.
23970         (mono_metadata_lookup_generic_inst): New public function.
23971         (mono_metadata_inflate_generic_inst): New public function.
23972         (mono_metadata_parse_generic_inst): New public function.
23973         (do_mono_metadata_parse_generic_class): Use the new
23974         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
23975         since this'll also use the cache.
23976
23977         * reflection.c (mono_reflection_bind_generic_method_parameters):
23978         Use mono_metadata_lookup_generic_inst() to use the new cache.
23979
23980         * class.c (inflate_mono_type): Use
23981         mono_metadata_inflate_generic_inst() to inflate a generic
23982         instance; this'll also use the new cache.
23983
23984         * loader.c (method_from_methodspec): Use
23985         mono_metadata_parse_generic_inst() and
23986         mono_metadata_inflate_generic_inst() rather than parsing it
23987         manually, so we can use the new cache.
23988
23989 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23990
23991         * threads.c (wait_for_tids): Do not incorrectly free threads when 
23992         the wait times out.
23993
23994 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
23995
23996         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
23997         iter->args based on whether parameters are passed in registers (i.e.
23998         MONO_ARCH_REGPARMS is defined)
23999
24000 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
24001
24002         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
24003         the exception message. Fixes #70070.
24004         (method_from_methodspec): Fix warnings.
24005
24006 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24007
24008         * process.c: (complete_path) return the path quoted
24009
24010 2004-12-01  Martin Baulig  <martin@ximian.com>
24011
24012         * class-internals.h (MonoGenericInst): New structure.
24013         (MonoGenericClass): Replaced `type_argc', `type_argv' and
24014         `is_open' with `MonoGenericInst *inst'.
24015         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
24016         `is_open' with `MonoGenericInst *inst'.
24017
24018 2004-11-30  Martin Baulig  <martin@ximian.com>
24019
24020         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
24021
24022         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
24023         to `generic_class_cache'.
24024
24025         * metadata.c
24026         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
24027         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
24028         (mono_generic_inst_is_valuetype): Renamed to
24029         mono_generic_class_is_valuetype().
24030
24031         * class-internals.h
24032         (MonoGenericInst): Renamed to MonoGenericClass.
24033         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
24034         (MonoClass): Renamed `generic_inst' to `generic_class'.
24035         (MonoGenericContext): Renamed `ginst' to `gclass'.
24036
24037         * object-internals.h
24038         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
24039
24040         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
24041         mono_reflection_generic_class_initialize().
24042
24043         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
24044         now known as "System.Reflection.MonoGenericClass".
24045         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
24046
24047 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
24048
24049         * class-internals.h: Added a flag field to MonoClass to cache the
24050         declarative security attributes actions associated with the class.
24051         * domain-internals.h: Added booleans to MonoJitInfo to cache the
24052         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
24053         applicable to the JITted method.
24054         * reflection.c|h: Added functions to extract (as flags) which security
24055         actions are available (declaratively) for a method, class or assembly.
24056         * metadata.c|h: Added functions to search the declarative security
24057         table in the metadata.
24058         
24059 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
24060
24061         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
24062         EXPORTEDTYPES are already in the class name cache, so there is no
24063         need to add extra code here to look at them. Just removes a bit of
24064         cruft.
24065
24066         (ves_icall_System_Environment_get_TickCount): No need for #if
24067         WINDOWS. We already have the code in io-layer.
24068
24069 2004-11-28  Martin Baulig  <martin@ximian.com>
24070
24071         * loader.c
24072         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
24073         Fixes gen-112.cs.
24074
24075 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
24076
24077         * assembly.c (do_mono_assembly_open): Instead of having a
24078         conditional WITH_BUNDLE, incorporate support for bundles here, by
24079         having a global `bundles' variable holding a pointer to the actual
24080         bundles. 
24081
24082         (mono_register_bundled_assemblies): New API call used by the
24083         bundle code. 
24084
24085         See mkbundle.1 for details.
24086         
24087 2004-11-27  Martin Baulig  <martin@ximian.com>
24088
24089         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
24090         the vtable for generic methods.
24091
24092 2004-11-26  Martin Baulig  <martin@ximian.com>
24093
24094         * metadata.c
24095         (mono_metadata_generic_method_hash): New public function.
24096         (mono_metadata_generic_method_equal): Likewise.
24097
24098         * class-internals.h
24099         (MonoGenericContainer): Added `GHashTable *method_hash'.
24100
24101         * reflection.c (ReflectionMethodBuilder): Added
24102         `MonoGenericContainer *generic_container'.
24103         (reflection_methodbuilder_to_mono_method): Don't create a new
24104         MonoGenericContainer each time we're called.
24105         (mono_reflection_bind_generic_method_parameters): Use
24106         `container->method_hash' to cache the results so we don't create a
24107         different method if we're called several times with the same
24108         arguments.
24109
24110         * loader.c (method_from_methodspec): Use the new
24111         `container->method_hash' here, too.
24112
24113 2004-11-26  Martin Baulig  <martin@ximian.com>
24114
24115         * class.c (inflate_generic_signature): Correctly compute
24116         `res->has_type_parameters'.
24117         (mono_class_vtable): Use the `has_type_parameters' flag to
24118         determine whether we're a generic method.
24119
24120         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
24121
24122 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
24123
24124         * object.c (mono_runtime_run_main): Fix a small memory leak.
24125
24126 2004-11-25  Martin Baulig  <martin@ximian.com>
24127
24128         * class.c (set_generic_param_owner): Fixed the loop.
24129
24130 2004-11-25  Martin Baulig  <martin@ximian.com>
24131
24132         * object.c (mono_class_vtable): Don't create any JIT wrappers for
24133         generic methods.
24134
24135 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
24136
24137         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
24138         names. Fixes #69787.
24139
24140 2004-11-24  Martin Baulig  <martin@ximian.com>
24141
24142         * class.c (mono_class_create_generic_2): If we don't have a
24143         `ginst->parent', inflate `gklass->parent' to get our parent.
24144
24145 2004-11-24  Martin Baulig  <martin@ximian.com>
24146
24147         * reflection.c (compare_genericparam): Correctly sort the
24148         GenericParam table; fixes #69779.
24149
24150 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
24151
24152         * reflection.c: When writing a PE file, don't create a huge
24153         buffer in memory. Just write the arrays we have to the file.
24154         This reduces memory usage.
24155
24156         * metadata-internals.h: MonoDynamicStream pefile is no longer used
24157         globally.
24158
24159 2004-11-17  Martin Baulig  <martin@ximian.com>
24160
24161         * class.c (mono_class_init): Don't setup `class->parent' for
24162         dynamic instances; moved this to mono_class_generic_2().
24163         (mono_class_create_generic): Also set `klass->inited' for dynamic
24164         generic instances.
24165         (mono_class_create_generic_2): Don't do anything for dynamic
24166         generic instances.  Set `klass->parent' here and also call
24167         mono_class_setup_parent() here. 
24168
24169         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
24170         `MonoType *parent' argument; set `ginst->parent' before calling
24171         mono_class_create_generic_2(), so we set the correct parent.
24172
24173 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
24174
24175         * reflection.c: allow getting attributes from ModuleBuilder
24176         (used by ikvm).
24177
24178 2004-11-17  Martin Baulig  <martin@ximian.com>
24179
24180         * class.c (mono_class_create_from_typedef): If a type parameter is
24181         inherited from an outer class, set its owner to that class.
24182
24183 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
24184
24185         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
24186           for (int*) written size. This fixes bug #69592.
24187
24188 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
24189
24190         * icall.c: Added IsAuthenticodePresnet internal call.
24191         * image.c|h: New function that check a MonoImage for an Authenticode
24192         signature in the certificate PE data directory.
24193         * security.c|h: New internal call to ask the runtime if an 
24194         Authenticode signature seems referenced in the PE header.
24195
24196 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
24197
24198         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
24199
24200         * reflection.c (mono_image_create_pefile): Free the assembly streams
24201         after writing out the assembly file.
24202
24203         * object.c (mono_runtime_run_main): Fix small memory leak.
24204
24205         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
24206         property access modifiers. Fixes #69389.
24207
24208 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
24209
24210         * domain.c, object.c, object-internals.h, domain-internals.h,
24211         object.h, marshal.c: keep dynamic code info per domain.
24212
24213 2004-11-15  Martin Baulig  <martin@ximian.com>
24214
24215         * class.c (mono_type_get_name_recurse): Put type arguments in
24216         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
24217         see bug #68387.
24218
24219 2004-11-15  Martin Baulig  <martin@ximian.com>
24220
24221         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
24222         (mono_class_setup_vtable): When computing `the_cname' for a
24223         generic instance, don't include the namespace since we'd otherwise
24224         add it twice.
24225
24226 2004-11-15  Martin Baulig  <martin@ximian.com>
24227
24228         * class.c (mono_class_create_generic): Changed return type to void.
24229         (mono_class_create_generic_2): New public function; setup
24230         `class->method', `class->field' and `class->interfaces' here
24231         instead of in mono_class_init().
24232
24233         * class.h (mono_class_create_generic): Moved to class-internals.h.
24234
24235 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
24236
24237         * reflection.c (mono_image_create_pefile): take a file HANDLE.
24238         rather than writing to memory, write to this file. Right now,
24239         we are just writting into a buffer, and copying that. However
24240         we can avoid the buffer later.
24241
24242         (mono_dynamic_stream_reset): new function
24243
24244         * icall.c, object-internals.h: update for the above.
24245
24246 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
24247
24248         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
24249         have been using gc'd memory. First it is slower, unlikely
24250         the comment in the source code said, secondly, it increases
24251         our footprint to do it in the gc.
24252
24253         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
24254         the method so that it does not have to copy to managed code.
24255
24256 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
24257
24258         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
24259
24260 2004-11-12  Martin Baulig  <martin@localhost>
24261
24262         * reflection.c (mono_image_create_token): Allow generic method
24263         definitions here, since they may appear in an `.override'; see
24264         gen-98/gen-99 for an example.
24265
24266 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
24267
24268         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
24269         #69365.
24270
24271         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
24272         descriptive.
24273
24274 2004-11-11  Martin Baulig  <martin@ximian.com>
24275
24276         * class.c (mono_class_setup_vtable): In an explicit interface
24277         implementation, the method name now includes the arity.
24278
24279 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
24280
24281         * object.c (mono_array_full_copy): Fix warning.
24282
24283 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
24284
24285         * appdomain.c: Removed look_for_method_by_name(). Use the new method
24286         mono_class_get_method_from_name() instead.
24287         
24288         * class-internals.h: Added two new types of wrappers. 
24289         Added MonoRemotingTarget enum. Added new trampoline function type, which
24290         takes an additional MonoRemotingTarget value as parameter, so it is
24291         possible to request a trampoline for a specific target.
24292         
24293         * class.c: Added new mono_class_get_method_from_name() method.
24294         
24295         * class.h: In MonoRemoteClass, we can have now to vtables, one for
24296         general remoting sinks and one specific for cross domain calls.
24297         
24298         * debug-helpers.c: Added new wrapper names.
24299         
24300         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
24301         of a remote class.
24302         
24303         * image.c: Porperly delete value objects form the remoting invoke hashtable.
24304         
24305         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
24306         with several other methods (mono_marshal_get_xappdomain_dispatch,
24307         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
24308         and others) can generate a fast remoting wrapper for cross domain calls.
24309         More information can be found in docs/remoting.
24310         Other changes: Removed mono_find_method_by_name, and used
24311         mono_class_get_method_from_name instead.
24312         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
24313         is stored in the remoting invoke hashtable.
24314         
24315         * marshal.h: published the new method for getting the xdomain wrapper,
24316         and also added a method for getting the adequate wrapper for a given
24317         method and target.
24318         
24319         * object-internals.h, object.c: Added a couple of methods for capying and
24320         cloning arrays.
24321         Modified mono_install_remoting_trampoline, which takes the new remoting
24322         trampoline that has a remoting target as parameter.
24323         mono_class_proxy_vtable now also takes a remoting target as parameter, and
24324         will return the most suitable vtable for the target.
24325         Added mono_remote_class_vtable, which returns the vtable of a remote class
24326         (which can be the normal remoting vtable or the xdomain vtable).
24327         
24328         * threads.c: the xdomain invoke and dispatch wrappers must also be
24329         protected against interruptions.
24330
24331 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24332
24333         * icall.c: use memmove in BlockCopyInternal when the source and
24334         destination arrays are the same.
24335
24336 2004-11-09  Martin Baulig  <martin@ximian.com>
24337
24338         * class-internals.h (MonoGenericContainer): Removed `method' and
24339         `signature', replaced them with `is_method' and `is_signature'
24340         flags.  Added `context'.
24341
24342         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
24343         instead of a `MonoGenericContainer *'.
24344
24345         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
24346         for dynamic type parameters.
24347         (mono_metadata_load_generic_params): Setup `container->context'.
24348
24349         * reflection.c (mono_reflection_setup_generic_class): Setup
24350         `tb->generic_container->context'.
24351         (do_mono_reflection_bind_generic_parameters): Use
24352         mono_class_inflate_generic_type() to correctly inflate types,
24353         rather than using our own hack just for MONO_TYPE_VAR.
24354
24355 2004-11-09  Martin Baulig  <martin@ximian.com>
24356
24357         * class.c (mono_class_inflate_generic_method): Small fix; don't
24358         crash here.
24359
24360         * icall.c
24361         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
24362         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
24363         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
24364         (ves_icall_Type_BindGenericParameters): Likewise.
24365         (ves_icall_Type_get_IsGenericInstance): Likewise.
24366         (ves_icall_Type_GetGenericParameterPosition): Likewise.
24367         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
24368         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
24369         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
24370
24371 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
24372
24373         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
24374         assembly versions and public key tokens. Fixes #69113.
24375
24376 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
24377
24378         * metadata.c: fix bug introduced with the type cache changes
24379         on 2004-11-06.
24380
24381 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
24382
24383         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
24384         the MonoClass pointer instead of the token in exception clauses.
24385         * reflection.c: updates for the above and make the code not depend
24386         on the structure of MonoExceptionClause.
24387
24388 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
24389
24390         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24391         Add support for dynamic assemblies. Fixes #69114.
24392
24393         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
24394
24395 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
24396
24397         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
24398         since most only those methods use it. the code member of
24399         MonoMethodPInvoke was dead, so that can be removed too. Also,
24400         remove inline_count (again, not used), and move slot so that it
24401         can share bits with some other flags. This saves 8 bytes in the
24402         structure and gives us about 50 kb back for mcs helloworld.cs
24403
24404         * *.[ch]: Do naming changes for the above.
24405
24406         * loader.c (mono_method_get_header): Lazily init the header
24407         on first access.
24408         (mono_get_method_from_token): don't init the header here
24409         (mono_free_method): the header may never be allocated
24410
24411         Overall, this saves 150 kb of unmanaged allocations
24412         for mcs helloworld.cs. That accounts for 10% of the unmanaged
24413         memory at runtime.
24414         
24415         * loader.c, loader.h (mono_method_get_header): new accessor.
24416
24417         * *.[ch]: use the above method. Prepares us to lazily load
24418         the header.
24419
24420         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
24421         three warnings, which are actual bugs (see 69206).
24422
24423         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
24424         unused. Saves a cool 4 bytes / method.
24425
24426 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
24427
24428         * metadata.c (builtin_types): Add types for System.Object here.
24429         (mono_metadata_parse_type_full): Cache MonoType*'s that are
24430         for a class or valuetype from klass->this_arg or klass->byval_arg.
24431
24432         On mcs for a hello world, this gets us down from 21836 MonoType's
24433         to 14560.
24434
24435         (mono_metadata_free_type): Account for the above change.
24436
24437 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
24438
24439         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
24440         exception instead of asserting if name is null.
24441         (ves_icall_System_AppDomain_GetData): Ditto.
24442
24443 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
24444
24445         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
24446         EnumBuilder.
24447
24448         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
24449         Return NULL when the domain does not have entry_assembly set.
24450
24451         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
24452         Add a 'resource_modules' argument.
24453         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
24454
24455         * reflection.c (mono_reflection_create_runtime_class): Move setting
24456         of wastypebuilder here, so mono_get_type_object () returns a MonoType
24457         for enums too.
24458
24459         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
24460         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
24461         Throw an ArgumentNullException if 'ptr' is null.
24462
24463         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
24464         assemblies here. Fixes #69020.
24465
24466 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
24467
24468         * reflection.c (build_compressed_metadata): Fix the previous patch for
24469         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
24470         the stack.
24471
24472 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
24473
24474         * assembly.c (mono_assembly_names_equal): Allow a match if one of
24475         the cultures is false. Fixes #69090.
24476
24477         * reflection.c (build_compressed_metadata): Fix invalid memory read 
24478         detected by valgrind.
24479         
24480         * reflection.c (mono_reflection_get_type): Avoid triggering a 
24481         TypeResolve multiple times for the same type. Fixes #65577.
24482
24483 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
24484
24485         * marshal.c: Avoid using ldftn to call managed functions. It is
24486         much slower than just a call.
24487
24488         * reflection.c (mono_module_get_object): free the basename we
24489         allocate here from glib.
24490         
24491         * reflection.c (ensure_runtime_vtable): make sure to free
24492         overrides.  Also, we were allocating an array of MonoMethod not an
24493         array of MonoMethod*.
24494
24495         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
24496
24497         * image.c (mono_image_close): free image->guid here.
24498
24499 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
24500
24501         * reflection.c: Fix some spec conformance issues with the PE file
24502         structures so mcs compiled apps run on the Net 2.0 beta.
24503
24504 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
24505
24506         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
24507         Implement this. Fixes #67264.
24508
24509         * debug-helpers.h debug-helpers.c marshal.c: Move 
24510         mono_find_method_by_name to debug-helpers.c.
24511
24512 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
24513
24514         * object.c (mono_release_type_locks): type_initialization_hash is
24515         a GHashTable.
24516
24517         * reflection.c object.c object-internals.h: Fix warnings.
24518
24519         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
24520         without accessors. Fixes #61561.
24521
24522         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
24523         application base from the root domain if not set. Fixes #65641.
24524         (mono_runtime_init): Fix warning.
24525
24526 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24527
24528         * appdomain.c: call mono_thread_pool_init.
24529         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
24530         of worker threads based on the number of CPUs and the environment
24531         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
24532         for non-windows (windows) systems.
24533
24534 2004-10-27  Chris Toshok  <toshok@ximian.com>
24535
24536         * mono-debug-debugger.c (write_class): don't call mono_class_init
24537         here, as even with the check for (!klass->init_pending), we get
24538         into a situation where we're hitting cycles in class
24539         initialization.  Fixes #68816.
24540
24541 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
24542
24543         * image.c: Avoid overwriting values in the loaded_images_hash when an
24544         assembly is loaded multiple times. Fixes #61152.
24545
24546         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
24547         so multiple satellite assemblies for the same name can be loaded.
24548         Fixes #68259.
24549
24550         * mono_domain_assembly_preload: Actually return the loaded assembly, 
24551         not NULL.
24552
24553         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
24554         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
24555
24556         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
24557         pending finalizers are not invoked after the appdomain has been 
24558         unloaded. Fixes #67862.
24559
24560 2004-10-22  Martin Baulig  <martin@ximian.com>
24561
24562         * mono-debug-debugger.c
24563         (mono_debugger_runtime_invoke): Don't box valuetypes.
24564
24565 2004-10-22  Chris Toshok  <toshok@ximian.com>
24566
24567         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
24568         don't hide private methods.
24569
24570 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
24571
24572         * icall.c: Allows the runtime to "share" (when known) the public key
24573         token of an assembly. This avoid the need to recalculate the token 
24574         (from the public key) in managed code.
24575
24576 2004-10-21  Chris Toshok  <toshok@ximian.com>
24577
24578         * debug-helpers.c (append_class_name): argh, revert last patch.
24579         
24580 2004-10-21  Chris Toshok  <toshok@ximian.com>
24581
24582         * debug-helpers.c (append_class_name): use '+' as the delimiter,
24583         not '/', so that it matches what the debugger uses to look up
24584         methods.
24585
24586 2004-10-21  Martin Baulig  <martin@ximian.com>
24587
24588         * mono-debug-debugger.c (mono_debugger_throw_exception): New
24589         public method; this is called each time an exception is thrown and
24590         allows the debugger to use exception catch points.
24591
24592 2004-10-21  Martin Baulig  <martin@ximian.com>
24593
24594         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
24595         the stack pointer and the exception object in some struct and pass
24596         that to the debugger.
24597
24598 2004-10-21  Chris Toshok  <toshok@ximian.com>
24599
24600         * mono-debug-debugger.c (do_write_class): add instance/static
24601         event support.  We don't expose "raise" or "other" yet.
24602         (event_is_static): new method.
24603
24604 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
24605
24606         * mono-debug-debugger.c
24607         (mono_debugger_handle_exception): Remove
24608         bogus return value for fussy compilers.
24609
24610 2004-10-20  Martin Baulig  <martin@ximian.com>
24611
24612         * mono-debug-debugger.c
24613         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
24614         (mono_debugger_handled_exception): Likewise.
24615
24616 2004-10-20  Martin Baulig  <martin@ximian.com>
24617
24618         * mono-debug-debugger.h (MonoDebuggerEvent): Added
24619         MONO_DEBUGGER_EVENT_EXCEPTION.
24620
24621         * mono-debug-debugger.c (mono_debugger_handle_exception): New
24622         public function to send the debugger a notification for an
24623         exception and inform it about a catch/finally clause.
24624
24625 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
24626
24627         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
24628         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
24629         fix 2.95 build. 
24630
24631         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
24632
24633 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
24634
24635         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
24636         marshalled as [In,Out]. Fixes #58325.
24637
24638 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
24639
24640         * reflection.c (mono_method_body_get_object): Implement some fields.
24641
24642 2004-10-12  Martin Baulig  <martin@ximian.com>
24643
24644         * reflection.c (mono_reflection_bind_generic_parameters): Small
24645         fix, correctly retrieve our parent from a generic instance.
24646
24647 2004-10-12  Martin Baulig  <martin@ximian.com>
24648
24649         * metadata.c (mono_metadata_generic_param_equal): We always have
24650         an owner.
24651
24652         * class.c
24653         (mono_class_from_generic_parameter): We need to have an owner.
24654         (my_mono_class_from_generic_parameter): Likewise.
24655
24656         * reflection.c (mono_reflection_setup_generic_class): Renamed to
24657         mono_reflection_create_generic_class() and added a new
24658         mono_reflection_setup_generic_class().  
24659         (mono_reflection_initialize_generic_param): If we're a nested
24660         generic type and inherited from the containing class, set our
24661         owner to the outer class.
24662
24663 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
24664
24665         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
24666
24667         * reflection.c (mono_method_body_get_object): New function to create
24668         a MethodBody object.
24669
24670         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
24671
24672 2004-10-11  Martin Baulig  <martin@ximian.com>
24673
24674         * metadata.c (_mono_metadata_type_equal): Renamed to
24675         do_mono_metadata_type_equal() and made static.
24676
24677 2004-10-11  Martin Baulig  <martin@ximian.com>
24678
24679         * appdomain.c: Bump corlib version number to 28.
24680
24681 2004-10-10  Martin Baulig  <martin@ximian.com>
24682
24683         * class-internals.h
24684         (MonoGenericInst): Added `MonoGenericContainer *container'.
24685         (MonoGenericMethod): Likewise.
24686         (MonoGenericContext): Likewise.
24687         (MonoGenericParam): Added `MonoGenericContainer *owner'.
24688
24689         * metadata.c
24690         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
24691         (do_mono_metadata_parse_generic_inst): Likewise.
24692         (mono_metadata_parse_type_full): New public method.  This is the actual
24693         mono_metadata_parse_type() implementation - with an additional
24694         `MonoGenericContainer *' argument.
24695         (mono_metadata_parse_array_full): Likewise.
24696         (mono_metadata_parse_signature_full): Likewise.
24697         (mono_metadata_parse_method_signature_full): Likewise.
24698         (mono_metadata_parse_mh_full): Likewise.
24699         (mono_type_create_from_typespec): Likewise.
24700         (mono_metadata_interfaces_from_typedef_full): New public method;
24701         this is similar to the other _full() methods, but we take a
24702         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
24703         (mono_metadata_parse_generic_param): Take an additional
24704         `MonoGenericContainer *' argument and lookup the MonoGenericParam
24705         from that container.
24706         (mono_metadata_generic_param_equal): New static method to compare
24707         two type parameters.
24708         (_mono_metadata_type_equal): New static method; takes an
24709         additional `gboolean signature_only' argument - if true, we don't
24710         compare the owners of generic parameters.
24711         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
24712         with a TRUE argument - do a signature-only comparision.
24713
24714         * loader.c: Use the new _full() methods and pass the
24715         MonoGenericContainer to them.
24716
24717         * object-internals.h (MonoReflectionTypeBuilder): Added
24718         `MonoGenericContainer *generic_container' field.
24719         (MonoReflectionMethodBuilder): Likewise.
24720
24721 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
24722
24723         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
24724         case initial images of dynamic assemblies.
24725
24726         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
24727
24728         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
24729
24730         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
24731         length of event->other array.
24732         (typebuilder_setup_events): Ditto.
24733
24734         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
24735         'assembly_by_name' and add an 'assemblies' list.
24736
24737         * assembly.h assembly.c: Add a new search hook for determining whenever
24738         an assembly is already loaded. Use this instead of searching in the
24739         loaded_assemblies list.
24740
24741         * domain.c appdomain.c: Implement the new search hook so loaded 
24742         assemblies are now scoped by appdomain. Fixes #67727.
24743
24744 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
24745
24746         * threads.c (mono_thread_attach): Initialize synch_lock field so
24747         mono_thread_detach works again.
24748
24749         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
24750         'lib' too. Fixes #63130.
24751
24752 2004-10-06  Jackson Harper  <jackson@ximian.com>
24753
24754         * culture-info-tables.h: regenerated.
24755
24756 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
24757
24758         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
24759         implemented by other interfaces in the result. Fixes #65764.
24760         
24761         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24762         Handle unloadable modules without crashing.
24763
24764         * image.c (load_modules): Revert the previous patch since modules must
24765         have a fixed index inside the array.
24766         
24767         * image.c (load_modules): Don't include native modules in the modules
24768         array.
24769
24770 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
24771
24772         * reflection.h: Add param_defaults field.
24773
24774         * reflection.c: Add support for parameter defaults in dynamic methods.
24775         Fixes #64595.
24776
24777         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
24778         an empty string when a type has no namespace. Fixes #64230.
24779
24780 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
24781
24782         * tabledefs.h: Added "internal" security actions to support non-CAS
24783         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
24784         Note: they do not seems to be used anymore in 2.0 (new metadata format)
24785
24786 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
24787
24788         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
24789         constructor of abstract class. Fixes #61689.
24790
24791 2004-10-04  Martin Baulig  <martin@ximian.com>
24792
24793         * class-internals.h (MonoGenericContainer): New type.
24794         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
24795         `MonoGenericContainer *generic_container'.
24796         (MonoClass): Replaced `gen_params' and `num_gen_params' with
24797         `MonoGenericContainer *generic_container'.
24798
24799         * metadata.c (mono_metadata_load_generic_params): Return a
24800         `MonoGenericContainer *' instead of a `MonoGenericParam *';
24801         removed the `num' argument.
24802
24803 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
24804
24805         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
24806         for dynamic images.
24807
24808         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
24809         machine fields.
24810
24811         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
24812
24813         * reflection.c: Save pe_kind and machine values into the generated
24814         image file.
24815
24816         * appdomain.c: Bump corlib version number.
24817
24818         * object-internals.h: Reorganize layout of LocalBuilder.
24819
24820         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
24821         New helper function.
24822
24823         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
24824         created MonoType for dynamic types. Fixes #66180.
24825
24826 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
24827
24828         * threadpool.c: the ares hashtable needs a critical section around it.
24829         this prevents some nasty segfaults
24830
24831 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
24832
24833         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
24834         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
24835         bug 67324).
24836         
24837 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24838
24839         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
24840         
24841 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
24842
24843         * image.c: Always canonicalize image file names, to avoid loading
24844         the same assembly twice when referenced using a relative path.
24845
24846 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24847
24848         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
24849
24850         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
24851
24852         * marshal.c: Fix warnings.
24853
24854 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
24855
24856         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
24857         attempting to marshal the delegate_trampoline as the method_addr.
24858         This patch has a static hashtable of marshalled delegates so that 
24859         we can map delegate_trampoline addresses back to delegates.  This
24860         allows a delegate passed to managed code to be passed back into native
24861         code.  Fixes #67039
24862
24863 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24864
24865         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
24866
24867         * reflection.c (method_encode_code): Align method headers properly.
24868         Fixes #66025.
24869
24870 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24871
24872         * marshal.c: In the runtime invoke wrapper, reset the abort
24873         exception if it is cached. This avoids the automatic rethrowal of 
24874         the exception after the catch of the wrapper. Also check for pending
24875         interruptions before calling the managed method. This is done using
24876         the new method emit_thread_force_interrupt_checkpoint, since the
24877         normal checkpoint method is ignored when running the invoke wrapper.
24878         * object.c: If the abort exception is rethrown, set the abort_exc
24879         field of the thread, so it will be rethrown aftere every catch.
24880         * threadpool.c: Only run an interruption checkpoint if what has been
24881         requested is a stop of the thread (aborts will be ignored).
24882         * threads.c: By default, a thread will now never be interrumped while
24883         running the runtime invoke wrapper (this ensures that runtime_invoke
24884         will always return to the caller if an exception pointer is provided).
24885         There is a new special method mono_thread_force_interruption_checkpoint()
24886         to force an interruption checkpoint even if running a protected
24887         wrapper, which is used by the same runtime invoke wrapper to do a check
24888         at a safe point.
24889
24890 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24891
24892         * object.c, object-internals.h: Implemented mono_release_type_locks,
24893         which releases the cctor locks held by a thread.
24894         * threads.c, threads.h: In thread_cleanup, release cctor locks held
24895         by a thread. Added mono_thread_exit() method to be used to safely stop
24896         a thread.
24897
24898 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24899
24900         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24901         Move null check before dereference.  Avoid indexing beyond the end
24902         of the 'modules' array.
24903
24904 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24905
24906         * metadata-internals.h (MonoImage): Add module_count field.
24907         * image.c (load_modules): Set image->module_count.
24908         (mono_image_load_file_for_image): Use image->module_count.
24909         * reflection.c (mono_image_load_module): Append to image->modules array 
24910         of dynamic assembly.
24911         (mono_module_get_object): Fix loop to actually increment index.
24912         Use image->module_count.
24913         * assembly.c (mono_assembly_load_references): Use image->module_count.
24914         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
24915         Likewise.
24916
24917 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24918
24919         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
24920         Avoid assert on generic types.
24921
24922 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
24923
24924         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
24925
24926         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
24927
24928         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
24929         function to convert a MarshalSpec structure to its managed counterpart.
24930
24931         * reflection.c: Fix warnings.
24932         
24933         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
24934         field.
24935
24936         * icall.c (mono_create_icall_signature): Fix build.
24937
24938 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
24939
24940         * icall.c: Add MakePointType icall.
24941
24942         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
24943         warnings.
24944
24945 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24946
24947         * threadpool.c: reuse allocated slots in the queue.
24948
24949 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
24950
24951         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
24952
24953         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
24954
24955         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
24956         previous change.
24957
24958         * tabledefs.h: Add constants for pinvoke attributes BestFit and
24959         ThrowOnUnmappableChar.
24960
24961         * icall.c (ves_icall_Type_GetPacking): New icall.
24962
24963 2004-09-24  Martin Baulig  <martin@ximian.com>
24964
24965         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
24966
24967 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24968
24969         * appdomain.c:
24970         (mono_domain_set): allow setting a domain that is being unloaded.
24971         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
24972         being unloaded.
24973
24974 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24975
24976         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
24977         the GetCustomAttributes icall.
24978
24979 2004-09-23  Martin Baulig  <martin@ximian.com>
24980
24981         * object-internals.h (MonoReflectionGenericParam): Replaced
24982         'has_ctor_constraint', `has_reference_type' and `has_value_type'
24983         with `guint32 attrs'.
24984
24985 2004-09-23  Martin Baulig  <martin@ximian.com>
24986
24987         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
24988
24989 2004-09-23  Martin Baulig  <martin@ximian.com>
24990
24991         * object-internals.h (GenericParameterAttributes): New enum.
24992
24993 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24994
24995         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
24996         
24997         * class.c (init_events): Fill out event->other field.
24998
24999         * class.c: Fix warnings.
25000
25001         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
25002
25003 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
25004
25005         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
25006         walk which doesn't supply the IL offset.
25007
25008 2004-09-22  Martin Baulig  <martin@ximian.com>
25009
25010         * reflection.c (mono_reflection_setup_internal_class): If we're
25011         System.ValueType, System.Object or System.Enum, set
25012         `klass->instance_size' and create the vtable.
25013         (mono_reflection_create_internal_class): If we're an enum type,
25014         get the base class from our current corlib.
25015
25016 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
25017
25018         * reflection.h (MonoResolveTokenError): New type.
25019
25020         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
25021         icall.
25022
25023         * icall.c: Add an 'error' argument to the ResolveToken icalls.
25024
25025 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
25026
25027         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
25028         Support also calling constructors, but only for already allocated objects.
25029
25030 2004-09-17  Geoff Norton <gnorton@customerdna.com>
25031
25032         * reflection.c (type_get_qualified_name): If the klass is null
25033         return the typename to avoid a NullRefEx.
25034         (encode_cattr_value): Get the qualified name of the boxed type,
25035         not the underlying enumtype.  Fixes #62984.
25036
25037 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
25038
25039         * marshal.c: Fix problems with previous checkin.
25040
25041 2004-09-21    <vargaz@freemail.hu>
25042
25043         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
25044         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
25045
25046         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
25047
25048 2004-09-21  Geoff Norton <gnorton@customerdna.com>
25049
25050         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
25051         should only return a type for pointers, arrays, and passbyref types.
25052         Fixes bug #63841.
25053
25054 2004-09-21  Martin Baulig  <martin@ximian.com>
25055
25056         * domain.c (mono_debugger_check_runtime_version): New public
25057         function.
25058
25059         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
25060
25061 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
25062
25063         * reflection.c: Added missing sort to the declarative security 
25064         attributes table. MS implementation stops seeing the attributes if the
25065         token number regress in the table (as shown by ildasm and permview).
25066
25067 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
25068
25069         * object-internals.h (MonoReflectionModule): Add 'token' field.
25070         
25071         * reflection.c (mono_reflection_get_token): Add support for Module
25072         and Assembly.
25073         (mono_module_get_object): Set 'token' field.
25074         (mono_module_file_get_object): Set 'token' field.
25075
25076         * icall.c: Add new Assembly and Module icalls.
25077
25078         * appdomain.c: Bump corlib version.
25079
25080 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
25081
25082         * loader.h loader.c class.h class.c: Add helper functions for obtaining
25083         tokens of metadata objects.
25084
25085         * reflection.h reflection.c (mono_reflection_get_token): New function
25086         to obtain the token of a metadata object.
25087
25088         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
25089
25090 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
25091
25092         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
25093         
25094         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
25095
25096 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
25097
25098         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
25099         * object-internals.h: Added 3 MonoArray* members to MonoReflection
25100         AssemblyBuilder to access the permissions set in the class lib.
25101         * reflection.c: Added security attributes encoding step in 
25102         mono_image_build_metadata.
25103         * tabledefs.h: Added new security actions defined in 2.0:
25104         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
25105
25106 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
25107
25108         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
25109         macro parameter.
25110
25111 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
25112  
25113         * locales.c: nullify the ICU_collator member of CompareInfo when it is
25114           finalized. There where random SIGSEVs at program termination, when
25115           an object being finalized was trying to do a string comparison and
25116           the current culture was already finalized.
25117  
25118 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25119
25120         * threads.c: call thread_cleanup before finishing the thread if we get
25121         there.
25122
25123 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
25124
25125         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
25126         assemblies from the parent. Fixes #65665.
25127
25128 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
25129
25130         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
25131         modifiers.
25132
25133 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
25134
25135         * reflection.h: add prototype for mono_get_dbnull_object
25136         * reflection.c: add prototypes for get_default_param_value_blobs 
25137         and mono_get_object_from_blob for fussier compilers
25138
25139 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
25140  
25141         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
25142         false deadlock checks in class initialization.
25143  
25144 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
25145
25146         * image.c (mono_image_addref): Fix comment.
25147
25148         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
25149         possible.
25150
25151 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
25152
25153         * reflection.c (mono_param_get_objects): Modified to return
25154         ParameterInfo.DefaultValue object.
25155
25156         (get_default_param_value_blobs):
25157         (mono_get_object_from_blob):
25158         (mono_get_dbnull_object): New helper routines. 
25159
25160         * object.c (mono_get_constant_value_from_blob): New helper routine
25161         carved out from get_default_field_value ()
25162
25163         * object-internals.h (mono_get_constant_value_from_blob): Added
25164         function declaration.
25165
25166 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
25167
25168         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
25169         referenced assemblies. Fixes #62135.
25170
25171         * exception.h exception.c (mono_get_exception_file_not_found2): New
25172         helper function.
25173
25174 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
25175
25176         * class.h class.c: Add mono_type_get_underlying_type ().
25177
25178 2004-09-09  Geoff Norton <gnorton@customerndna.com>
25179
25180         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
25181         Fix GetTypes() to support dynamically created assemblies.
25182
25183 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
25184
25185         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
25186         
25187         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
25188         previous patch.
25189
25190         * reflection.h reflection.c loader.c: Allow dynamic construction of
25191         pinvoke methods. Fixes #65571.
25192         
25193         * reflection.c (mono_reflection_get_type): Revert previous change since
25194         it causes regressions.
25195
25196 2004-09-08  Martin Baulig  <martin@ximian.com>
25197
25198         * class.c (class_compute_field_layout): Don't call
25199         mono_class_layout_fields() for open generic instances.
25200
25201 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
25202         * threads.c appdomain.c: fix typo in GC macro
25203
25204 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25205
25206         * threads.c: don't call mono_thread_detach() in start_wrapper(),
25207         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
25208
25209 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
25210
25211         * image.c (mono_image_close): Applied patch from 
25212         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
25213         assembly is loaded multiple times from data.
25214         
25215         * image.c (mono_image_open): Fix warning.
25216
25217 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25218
25219         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
25220         once. Fixes #58334.
25221         
25222         * reflection.c (mono_reflection_create_runtime_class): Initialize
25223         klass->nested_classes. Fixes #61224.
25224
25225 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
25226
25227         * threads.c: sched_yield() on exit, to allow threads to quit.
25228
25229 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25230
25231         * object.c (mono_unhandled_exception): Remove leftover debug code.
25232
25233 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
25234
25235         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
25236
25237 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25238
25239         * marshal.c (emit_marshal_array): Really null terminate string arrays.
25240         
25241         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
25242
25243 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25244
25245         * marshal.c (emit_marshal_array): Null terminate string arrays.
25246         
25247         * marshal.c (raise_auto_layout_exception): Fix warning.
25248
25249         * reflection.c (mono_param_get_objects): Initialize the default value
25250         with DBNull.Value, not null. Fixes #62123.
25251
25252 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
25253
25254         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
25255         throw an exception with a cute explanation.
25256
25257 2004-09-06  Dick Porter  <dick@ximian.com>
25258
25259         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
25260         Close the new process's thread handle, as we don't use it.  The
25261         handle stays around forever otherwise.
25262
25263 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25264
25265         * object.c (arith_overflow): Fix warning.
25266
25267         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
25268         calling conventions in method refs. Fixes #65352.
25269
25270         * reflection.c: Fix warnings.
25271
25272 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
25273
25274         * icall.c: Add a new icall for Array.Clear
25275
25276 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
25277
25278         * object.c: When allocating an array, we have to throw
25279         an overflow exception if any of the lengths are < 0.
25280
25281 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25282
25283         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
25284         properly. Also move implementation of string array marshalling to 
25285         managed code. Fixes #42316.
25286
25287 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25288
25289         * assembly.c: provide more information when loading an assembly fails.
25290
25291 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25292
25293         * filewatcher.c: don't expect the development fam package to be
25294         installed.
25295
25296 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
25297
25298         * marshal.c: Make a copy of the signature cookie since it will be
25299         freed by the caller.
25300         
25301         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
25302
25303         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
25304
25305         * metadata.c (mono_metadata_free_marshal_spec): New function to free
25306         marshal specs.
25307
25308         * marshal.c: More refactoring.
25309         
25310         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
25311         smaller functions.
25312
25313 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
25314
25315         * object.c: In mono_message_invoke, fill the output parameter array after
25316           calling the managed method (it was done before the call). This fixes
25317           bug #59299.
25318
25319 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25320
25321         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
25322         as well.
25323
25324 2004-09-02  Martin Baulig  <martin@ximian.com>
25325
25326         * class.c (mono_class_instance_size): Don't allow generic type
25327         definitions or open generic instances.
25328         (mono_class_array_element_size): If we're a value type, call
25329         mono_class_instance_size() on the original class.
25330
25331         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
25332         handle generic instances.
25333
25334         * mono-debug-debugger.c (write_type): Handle generic instances
25335         like classes.
25336
25337 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25338
25339         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
25340         the allocation request fails. Fixes #65089.
25341
25342         * object.c (mono_runtime_free_method): Do not call mono_free_method.
25343         
25344         * object.c (mono_runtime_free_method): New function to free a dynamic
25345         method.
25346
25347         * marshal.c (mono_delegate_free_ftnptr): New function to free the
25348         delegate trampoline.
25349
25350         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
25351         with hasthis as dynamic,
25352
25353         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
25354
25355         * domain.c (mono_jit_info_table_remove): New function to remove an
25356         entry from the jit info table.
25357
25358         * class-internals.h (MonoMethod): Add 'dynamic' field.
25359
25360         * loader.c: Fix warnings.
25361
25362 2004-09-01  Martin Baulig  <martin@ximian.com>
25363
25364         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
25365         instead of mono_debugger_lock() because the latter one is a no-op
25366         unless running in the debugger.
25367
25368 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25369
25370         * class.c (class_compute_field_layout): Classes with auto-layout or
25371         reference fields are not blittable.
25372         
25373 2004-09-01  Dick Porter  <dick@ximian.com>
25374
25375         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
25376         mono_image_get_filename() to get the assembly location.
25377
25378         * icall.c:
25379         * metadata.h: Fix compile warnings
25380
25381 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25382
25383         * class.c (class_compute_field_layout): System.Object is blittable.
25384
25385         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
25386         as in/out. Fixes #59909.
25387
25388 2004-09-01  Martin Baulig  <martin@ximian.com>
25389
25390         * metadata.h (MONO_TYPE_ISREFERENCE): Call
25391         mono_metadata_generic_inst_is_valuetype() if we're a generic
25392         instance to check whether our underlying type is a reference type.
25393
25394 2004-09-01  Martin Baulig  <martin@ximian.com>
25395
25396         * metadata.c (mono_type_size): If we're a generic instance, call
25397         mono_class_value_size() for value types.
25398
25399 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
25400
25401         * marshal.c: Implement more custom marshalling functionality. Fixes
25402         #64915.
25403
25404 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
25405
25406         * mono-debug.c, debug-mono-symfile.c: add some locking love.
25407
25408 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
25409
25410         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
25411
25412         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
25413
25414         * icall.c: Fix some warnings.
25415
25416         * threads.c (abort_appdomain_thread): Fix unref errors.
25417         (mono_thread_current): Fix THREAD_DEBUG define.
25418
25419 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
25420
25421         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
25422
25423         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
25424
25425 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
25426
25427         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
25428         string arrays.
25429
25430 2004-08-28  Martin Baulig  <martin@ximian.com>
25431
25432         * metadata.c
25433         (mono_metadata_generic_inst_is_valuetype): New public function.
25434
25435         * metadata.h (MONO_TYPE_ISSTRUCT): Call
25436         mono_metadata_generic_inst_is_valuetype() if we're a generic
25437         instance to check whether our underlying type is a valuetype.
25438
25439 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
25440
25441         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
25442         #63768.
25443
25444 2004-08-25  Martin Baulig  <martin@ximian.com>
25445
25446         * loader.c (mono_get_method_from_token): Abstract methods can also
25447         be generic and thus have type parameters.
25448
25449         * metadata-internals.h
25450         (MonoDynamicImage): Added `GPtrArray *gen_params'.
25451
25452         * reflection.c (mono_image_get_generic_param_info): Don't create a
25453         metadata row, just add an entry to the `gen_params' array.
25454         (build_compressed_metadata): Sort the `gen_params' array and then
25455         actually create the metadata.
25456
25457 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25458
25459         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
25460
25461 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
25462
25463         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
25464
25465 2004-08-24  Martin Baulig  <martin@ximian.com>
25466
25467         * class.cs (mono_class_is_subclass_of): Like an interface, a
25468         generic instance also derives from System.Object.
25469
25470 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
25471
25472         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
25473         custom modifiers to be in any order. Fixes #61990.
25474
25475 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
25476
25477         * object.c: Register mono_object_new_fast icall.
25478         
25479         * object.c (mono_class_get_allocation_ftn): Return to calling
25480         mono_object_new_fast, since it seems faster to compute the object 
25481         size in unmanaged code than passing it as a parameter.
25482
25483         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
25484
25485         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
25486         this function with Boehm as the oom handler, so we don't have to check
25487         the result of GC_malloc.
25488
25489         * object.c: Remove checks for oom.
25490
25491         * object.h object.c (mono_class_get_allocation_ftn): New function to
25492         return the icall which can be used to allocate an instance of a given
25493         class. 
25494
25495         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
25496
25497         * class-internals.h: Add 'enabled' field.
25498
25499 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
25500
25501         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
25502
25503 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
25504         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
25505         value 0x0010.
25506
25507 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
25508
25509         * appdomain.c: use the Tls function for appdomain too,
25510         at Zoltan's request. Actually return in mono_context_get
25511
25512         * appdomain.c, profiler.c, threads.c: use __thread
25513
25514 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
25515
25516         * appdomain.c threads.c: Call GC_CreateThread on windows.
25517
25518         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
25519         multiple libraries since this don't work on windows.
25520
25521 2004-08-18  Martin Baulig  <martin@ximian.com>
25522
25523         * class-internals.h
25524         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
25525         MonoMethodHeader.
25526
25527         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
25528         MonoMethodNormal since we also need it for abstract and interface
25529         methods.
25530
25531         * reflection.c
25532         (build_compressed_metadata): Sort the GenericParam table.
25533         (mono_image_create_token): Added `gboolean create_methodspec'
25534         argument; this is false when generating a MethodImpl token.
25535         (reflection_methodbuilder_to_mono_method): Abstract and interface
25536         methods may also have generic parameters.
25537
25538 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
25539
25540         * appdomain.c: thread local alloc
25541
25542 2004-08-17  Martin Baulig  <martin@ximian.com>
25543
25544         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
25545
25546         * icall.c
25547         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
25548         argument.
25549
25550         * class.c (mono_type_get_full_name): New public function.
25551         (mono_type_get_name): Don't include the type arguments.
25552
25553 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
25554
25555         * Makefile.am: Build static versions of libmetadata and libmonoruntime
25556         for inclusion into the mono executable.
25557
25558 2004-08-16  Martin Baulig  <martin@ximian.com>
25559
25560         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
25561         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
25562
25563 2004-08-14  Martin Baulig  <martin@ximian.com>
25564
25565         * class.c (dup_type): Also copy the `byref' field.
25566
25567 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
25568
25569         * reflection.c (create_dynamic_mono_image): Revert the last change 
25570         since it breaks bootstrap.
25571
25572 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
25573
25574         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
25575
25576         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
25577         not free them with g_free.
25578
25579 2004-08-11  Martin Baulig  <martin@ximian.com>
25580
25581         * reflection.c (mono_reflection_setup_internal_class): Also call
25582         mono_class_setup_mono_type() if we already have a `tb->type.type'.
25583
25584 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
25585
25586         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
25587         called during default (first) AppDomain creation. Keep track of
25588         Evidence when loading assemblies.
25589
25590 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
25591
25592         * opcodes.c, opcodes.h: reduce runtime relocations.
25593
25594 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
25595
25596         * culture-info.h, locales.c: fixes and chages to sue the new
25597         optimized format of the locale data.
25598         * culture-info-tables.h: regenerated.
25599
25600 2004-08-06  Geoff Norton <gnorton@customerdna.com>
25601         
25602         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
25603
25604 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
25605
25606         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
25607         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
25608         * domain-internals.h: icall declaration.
25609         * icall.c: icall registration.
25610         * object-internals.h: New fields in MonoAssembly for CAS.
25611
25612 2004-08-05  Duncan Mak  <duncan@ximian.com>
25613
25614         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
25615         CEE_LDELEM_ANY.
25616
25617 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
25618
25619         * reflection.c: fix to deal with object[] arrays in custom ctors
25620         (bug #62550).
25621
25622 2004-08-05  Martin Baulig  <martin@ximian.com>
25623
25624         * class.c (mono_class_array_element_size): Added support for
25625         generic instances and correctly handle "recursive" types.
25626
25627 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
25628
25629         * assembly.c: Fix warnings.
25630
25631 2004-08-04  Martin Baulig  <martin@ximian.com>
25632
25633         * class.c
25634         (mono_type_get_name_recurse): Added `gboolean include_arity'
25635         argument specifying whether or not we should include the generic
25636         arity in the type name.
25637         (_mono_type_get_name): New static function.
25638         (mono_class_setup_vtable): If we're a generic instance, don't
25639         include the generic arity in the names of explicit method
25640         implementations.        
25641
25642 2004-08-03  Martin Baulig  <martin@ximian.com>
25643
25644         * class.c (mono_type_get_name_recurse): Enclose the generic type
25645         arguments in `<', '>'.
25646
25647 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25648
25649         * gc.c: make GC warning messages use the trace API, they are just
25650         noise to most of the users.
25651
25652 2004-08-03  Martin Baulig  <martin@ximian.com>
25653
25654         * debug-mono-symfile.c (read_string): Correctly read the string.
25655
25656 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
25657
25658         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
25659         
25660         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
25661         icalls.
25662         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
25663
25664 2004-07-30  Martin Baulig  <martin@ximian.com>
25665
25666         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
25667         Reflect latest symbol writer changes.   
25668
25669 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25670
25671         * object.c: always create an object if null is passed
25672         to Invoke() where a valuetype is expected.
25673
25674 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
25675
25676         * marshal.c (mono_marshal_init): make managed
25677         signatures match native ones better for 64bits.
25678
25679 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25680
25681         * appdomain.c: hack to build correctly the private bin path on windows.
25682         Fixes bug #61991.
25683
25684 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
25685
25686         * assembly.c: Load mscorlib from the correct framework directory
25687           (mono/<version>/mscorlib.dll).
25688         * appdomain.h: Added prototypes for new functions.
25689         * internals.h: Added some prototypes.
25690         * domain.c: When initializing the runtime, get from the executable and
25691           the configuration files the runtime version that the app supports.
25692           Added support methods for reading app.exe.config. Added list of versions
25693           supported by the JIT. Added two new methods: mono_init_from_assembly,
25694           which initializes the runtime and determines the required version from
25695           the provided exe file, and mono_init_version, which initializes
25696           the runtime using the provided version.
25697         * icall.c: Get machine.config from version-specific directory.
25698         * reflection.c: When generating an image, embed the version number
25699           of the current runtime.
25700
25701 2004-07-28  Dick Porter  <dick@ximian.com>
25702
25703         * socket-io.c
25704         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
25705         returned sockaddr size before creating the remote address object.
25706         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
25707         61608.
25708
25709 2004-07-28  Dick Porter  <dick@ximian.com>
25710
25711         * locales.c (string_invariant_compare_char): Fix invariant char
25712         compares between upper and lower cases.  Fixes bug 61458.
25713
25714 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
25715         
25716         * marshal.c: actually cache stelem.ref wrappers.
25717         
25718 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
25719
25720         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
25721         sections and remove the mono_cli_rva_map () function.
25722
25723 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
25724
25725         * debug-mono-symfile.c: fix one more endianess issue, from a patch
25726         by Geoff Norton (<gnorton@customerdna.com>).
25727
25728 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25729
25730         * class.c: fix class loads for pointer types (typeof(int) !=
25731         typeof(int*)).
25732
25733 2004-07-27  Martin Baulig  <martin@ximian.com>
25734
25735         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
25736         reading the debugging information from an external ".mdb" file.
25737
25738 2004-07-24  Martin Baulig  <martin@ximian.com>
25739
25740         * reflection.c (mono_image_get_type_info): Only write a class
25741         layout entry if we actually have a size or a packing size.
25742
25743 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25744
25745         * reflection.c (type_get_fully_qualified_name): 
25746         insert cast to get type checking of ?: with non-gcc compilers
25747
25748 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25749
25750         * rand.c: use g_getenv for both lookups of
25751         MONO_EGD_SOCKET
25752
25753 2004-07-17  Martin Baulig  <martin@ximian.com>
25754
25755         * reflection.c (mono_reflection_bind_generic_method_parameters):
25756         Set `gmethod->reflection_info'.
25757
25758 2004-07-17  Martin Baulig  <martin@ximian.com>
25759
25760         * class.c (mono_class_create_from_typedef): Insert the newly
25761         created class into the hash table before computing the interfaces
25762         since we could be called recursively.
25763
25764 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
25765
25766         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
25767         function to implement stelem.ref in managed code
25768         * class-internals.h, debug-helpers.c: a new wrapper type
25769         for the above.
25770
25771 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25772
25773         * gc.c: allow GC handles to work even when no GC is compiled in.
25774         Fix part of bug #61134 (GetAddrOfPinnedObject).
25775
25776 2004-07-13  Peter Williams  <peter@newton.cx>
25777  
25778         * process.c (complete_path): Make sure we don't attempt to execute
25779         directories.
25780  
25781 2004-07-12  Geoff Norton <gnorton@customerdna.com>
25782
25783         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
25784           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
25785           and will add/subtract the hour if needed
25786
25787 2004-07-12  Martin Baulig  <martin@ximian.com>
25788
25789         * reflection.c (mono_field_get_object): If we have
25790         `field->generic_info', take the attributes from
25791         `field->generic_info->generic_type'.    
25792
25793 2004-07-12  Martin Baulig  <martin@ximian.com>
25794
25795         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
25796         This function must be called before initializing the runtime.
25797         (mono_debug_init_1): New function; call this after initializing
25798         the runtime, but before loading the assembly.  It tells the
25799         debugger to load corlib and the builtin types.
25800
25801         * mono-debug-debugger.c: Did some larger changes in the debugging
25802         code; support recursive class declarations, make sure we actually
25803         add all classes.
25804
25805 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25806
25807         * debug-helpers.c: undo my previous patch and fixed the real issue in
25808         ../mini/exceptions-x86.c
25809
25810 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25811
25812         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
25813         when no HOME env. variable was set and a NullRef was thrown in a .cctor
25814         called from other .cctors.
25815
25816 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
25817
25818         * loader.c: Removed the mono_loader_wine_init hack now that we are
25819         doing a managed version of Windows.Forms.
25820
25821 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
25822
25823         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
25824         threadpool.c, threads.c: remove static data from rootset.
25825
25826 2004-07-09  Dick Porter  <dick@ximian.com>
25827
25828         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
25829         Don't do any more processing if the matched length was 0.  It was
25830         increasing the size of the string before.  Fixes bug 61167.
25831
25832 2004-07-09  Dick Porter  <dick@ximian.com>
25833
25834         * socket-io.h:
25835         * socket-io.c
25836         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
25837         Add support for SO_PEERCRED if its available.
25838
25839 2004-07-09  Peter Bartok <pbartok@novell.com>
25840         * loader.c: winelib.exe.so error message is now only displayed if
25841         MONO_DEBUG is set. To help us avoid questions when people are trying
25842         out the new Managed.Windows.Forms.
25843
25844 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
25845
25846         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
25847         for isinst and castclass wrappers.
25848
25849         * class-internals.h icall.c: Move registration and lookup of JIT icalls
25850         to libmetadata from the JIT, so they could be used by the marshalling
25851         code and the interpreter.
25852
25853         * marshal.c: Register marshalling related JIT icalls here instead of
25854         in mini.c. Use CEE_MONO_ICALL instead of the family of 
25855         CEE_MONO_PROC<x> opcodes to call marshalling functions.
25856
25857         * metadata.h: Remove unneeded marshalling conversions.
25858
25859         * opcodes.c: Update for new opcodes.
25860         
25861 2004-07-08  Martin Baulig  <martin@ximian.com>
25862
25863         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
25864         (mono_debug_get_domain_data): Make this function static.
25865
25866 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25867
25868         * gc.c, object.h: add nice GC handle API for embedders.
25869
25870 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
25871
25872         * reflection.c: more changes for the new api
25873
25874         * object.c: When we reflect on a field w/ a constant value, it
25875         will not have a memory location, so we must access metadata. Also,
25876         allow easier reading of strings so that we can read them from
25877         the constant data.
25878
25879         * class.c (mono_class_layout_fields): no need for literal fields here.
25880
25881         * class-internals.h: api changes for const fields
25882
25883         * icall.c (ves_icall_get_enum_info): use new apis for const fields
25884
25885 2004-07-06  Martin Baulig  <martin@ximian.com>
25886
25887         * mono-debug.h: Increment version number to 44.
25888
25889         * mono-debug.c (mono_debug_add_wrapper): The second argument is
25890         now a gpointer, rewrote this whole method.
25891
25892         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
25893         function.  Add information about the wrapper in a new "misc table".
25894
25895         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
25896         for the new misc table.
25897
25898 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
25899
25900         * metadata-internals.h image.c: Add a cache for helper signatures.
25901
25902         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
25903
25904 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
25905
25906         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
25907         delegates from a delegate. Fixes #61033.
25908         
25909         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
25910         marshalling of stringbuilder arrays. Fixes #59900.
25911
25912 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
25913
25914         * icall.c: Add EnumBuilder:setup_enum_type icall.
25915
25916 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
25917
25918         * icall.c: Added a new icall for the property version of
25919         OffsetOfStringData.
25920
25921 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
25922
25923         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
25924         it has a constant size across platforms.
25925
25926         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
25927         stack trace.
25928
25929 2004-06-29  Martin Baulig  <martin@ximian.com>
25930
25931         * mono-debug.c (mono_debug_add_method): Protect the whole function
25932         in mono_debugger_lock(), not just parts of it.
25933
25934 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
25935
25936         * reflection.c: make sure padding bytes in heaps are zeroed.
25937
25938 2004-06-24  David Waite  <mass@akuma.org>
25939
25940         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
25941         image.c, loader.c, locales.c, marshal.c, metadata.c,
25942         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
25943         string-icalls.c, threads.c: change to C90-style comments from C99 /
25944         C++ -style
25945
25946 2004-06-24  Dick Porter  <dick@ximian.com>
25947
25948         * threads.c
25949         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
25950         return createdNew.  Fixes bug 60412.
25951
25952         * threads-types.h: 
25953         * icall.c: Add createdNew parameter to CreateMutex icall
25954
25955 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
25956
25957         * reflection.c, object-internals.h: save default value in params.
25958
25959 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25960
25961         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
25962         no need to build a new path combining that with the application base.
25963         Fixes bug #60442.
25964
25965 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
25966
25967         * reflection.c: fixed minor standard compliance issues.
25968
25969 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25970
25971         * reflection.c: fixed issue with encoding some custom attributes
25972         (arrays in properties and fields, bug #60411).
25973
25974 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25975
25976         * reflection.c: fix start address when copying the public key token.
25977
25978 2004-06-23  Martin Baulig  <martin@ximian.com>
25979
25980         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
25981         the `exc' object in a static object to put it into the GC's root set.
25982
25983 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
25984
25985         * reflection.c: make mono_reflection_setup_internal_class ()
25986         callable a second time to setup a new parent class.
25987
25988 2004-06-23  Dick Porter  <dick@ximian.com>
25989
25990         * threads.c: Check for WAIT_IO_COMPLETION return values.
25991
25992 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
25993
25994         * appdomain.c: Removed the g_free on the public key token. Now copy 
25995         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
25996         * assembly.c: Added public key token string value when loading 
25997         assemblies. Fix bug #60439.
25998         * icall.c: Added missing informations (like public key) in 
25999         GetReferencedAssemblies. Fix #60519.
26000         * image.h: Changed definition for public key token from const char*
26001         public_tok_value to guchar public_key_token [17];
26002         * reflection.c: Updated for changes to public key token.
26003
26004 2004-06-22  Lluis Sanchez Gual
26005
26006         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
26007         for the field in base classes.
26008
26009 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
26010
26011         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
26012         mark headers as not supported, they are installed only for use by the
26013         debugger.
26014
26015 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
26016
26017         * *.c, *.h: avoid namespace pollution in public headers.
26018
26019 2004-06-21  Martin Baulig  <martin@ximian.com>
26020
26021         * exception.c (mono_get_exception_security): It's in
26022         "System.Security", not in "System".
26023
26024         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
26025         the exception classes.
26026
26027 2004-06-21  Martin Baulig  <martin@ximian.com>
26028
26029         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
26030         Protect the exception object from being finalized.
26031
26032 2004-06-21  Martin Baulig  <martin@ximian.com>
26033
26034         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
26035         public function.
26036
26037 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
26038
26039         * reflection.c: Load the assembly in mono_reflection_type_from_name,
26040         if it was not loaded before. Fix parts of #60439.
26041
26042 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
26043
26044         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
26045         code that was broken since Ben's change: wrappers are now
26046         dependent on the method signature only again.
26047
26048 2004-06-21  Martin Baulig  <martin@ximian.com>
26049
26050         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
26051         added interface support.
26052
26053 2004-06-21  Martin Baulig  <martin@ximian.com>
26054
26055         * class.c (mono_vtable_get_static_field_data): New public method.
26056
26057 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
26058
26059         * filewatcher.c : Windows build fix to be compliant with API changes.
26060
26061 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
26062
26063         * class.h, class.c: more accessors.
26064         * metadata.h, metadata.c: prepare for hiding MonoType and
26065         MonoMethodSignature: people should use the accessors from now on
26066         outside of the tree.
26067
26068 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
26069
26070         * *.c, *.h: more API cleanups.
26071
26072 2004-06-18  Jackson Harper  <jackson@ximian.com>
26073
26074         * assembly.c: Trace loading assemblies.
26075         * loader.c: Trace loading native libraries.
26076         * mono-config.c: Trace loading config files.
26077         
26078 2004-06-18  Dick Porter  <dick@ximian.com>
26079
26080         * locales.c: Tell ICU the lengths of strings, it can cope with
26081         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
26082
26083 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
26084
26085         * image.c: swapped name/filename;
26086
26087 2004-06-18  Martin Baulig  <martin@ximian.com>
26088
26089         * mono-debug-debugger.c (write_class): Write the parent class at
26090         the end of the header.
26091
26092 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
26093
26094         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
26095
26096 2004-06-17  Raja R Harinath  <rharinath@novell.com>
26097
26098         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
26099         (bundle_obj): New conditional define.
26100         (BUILT_SOURCES): Remove.
26101         ($(bundle_srcs)): Make parallel-make safe.
26102         (libmonoruntime_la_LIBADD): Make unconditional.
26103         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
26104         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
26105
26106 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
26107
26108         * culture-info-tables.h: It was inconsistent with the latest
26109           supp info files.
26110
26111 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
26112
26113         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
26114         be loaded.
26115
26116         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
26117         with gcc 2.95.
26118
26119 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
26120
26121         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
26122         cleaned up public header threads.h.
26123
26124 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
26125
26126         * Makefile.am, *.c, *.h: more API cleanups.
26127
26128 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
26129
26130         * Makefile.am: removed monosn from compilation.
26131         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
26132         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
26133         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
26134         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
26135         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
26136         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
26137
26138 2004-06-15  Jackson Harper  <jackson@ximian.com>
26139
26140         * assembly.c: Make locales lower case when searching the GAC for
26141         assemblies. gacutil will always make locales lowercase when
26142         installing so this effectively makes them case insensitive.
26143         
26144 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
26145
26146         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
26147         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
26148           parameter which allows to choose whether the wait can be interrupted or 
26149           not. Also added the method mono_monitor_enter(), which locks the monitor
26150           using an infinite wait and without allowing interruption.
26151           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
26152           interrupted.
26153         * object.h: Added new fields in MonoThread. suspend_event holds the event
26154           used to susped/resume the thread. synch_lock is the lock object to use for
26155           modifying the thread state.
26156         * threads.c: Use the new synch_lock object for locking, instead of "this",
26157           which can generate deadlocks.
26158           Moved thread state change in Thread.Sleep and Thread.Join from managed
26159           to unmanaged code. This avoids a deadlock when the thread was suspended
26160           just after acquiring the thread lock.
26161           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
26162           Implemented Thread.Suspend using an event instead of ThreadSuspend,
26163           which is not fully implemented in the io-layer.
26164         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
26165
26166 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
26167
26168         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
26169         threads-types.h: more API cleanups.
26170
26171 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
26172
26173         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
26174         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
26175         threadpool.c, threads.c: first pass at the exported API cleanup.
26176
26177 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
26178
26179         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
26180
26181 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26182
26183         * icall.c: added internalGetHome.
26184
26185 2004-06-14  Dick Porter  <dick@ximian.com>
26186
26187         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
26188         possible to return successfully when '.' or '..' were the only
26189         entries in a directory, but were skipped.  The MonoIOStat was not
26190         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
26191         Fixes bug 59574.
26192
26193 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
26194
26195         * reflection.c: make binaries run on .Net 1.1 by default.
26196
26197 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
26198
26199         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
26200
26201 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
26202
26203         * marshal.c: keep track of struct size with explicit layout
26204         (bug #59979).
26205
26206 2004-06-12  Martin Baulig  <martin@ximian.com>
26207
26208         * mono-debug-debugger.c: Comment out a debugging g_message().
26209
26210 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
26211
26212         * reflection.c, reflection.h: do not free custom attrs that are cached.
26213         * icall.c: use braces to make code clearer.
26214
26215 2004-06-11  Martin Baulig  <martin@ximian.com>
26216
26217         * class.h (MonoInflatedField): New type.
26218         (MonoClassField): Replaced `MonoType *generic_type' with
26219         `MonoInflatedField *generic_info'.
26220
26221         * icall.c
26222         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
26223
26224 2004-06-11  Martin Baulig  <martin@ximian.com>
26225
26226         * reflection.c (mono_image_create_method_token): Correctly encode
26227         varargs methods.
26228
26229 2004-06-11  Martin Baulig  <martin@ximian.com>
26230
26231         * metadata.c (mono_metadata_parse_method_signature): When parsing
26232         a MethodDef which has VarArgs, also set sentinelpos if we don't
26233         have any parameters.
26234
26235 2004-06-11  Martin Baulig  <martin@ximian.com>
26236
26237         * verify.c (mono_method_verify): In CEE_CALL, use
26238         mono_method_get_signature() to get the method's signature, unless
26239         we're a PInvoke method.
26240
26241 2004-06-10  Jackson Harper  <jackson@ximian.com>
26242
26243         * assembly.c: Use <path>/lib/mono/gac for the extra paths
26244         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
26245         logical name as the supplied path is just a prefix to the gac not
26246         the direct path to it.
26247         
26248 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
26249
26250         * reflection.c: make the token for a created method match
26251         the token of the MethodBuilder it was created from
26252         (IKVM requires this behaviour now).
26253
26254 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
26255
26256         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
26257         reflection.c, socket-io.c: leak fixes.
26258
26259 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
26260
26261         * icall.c: handle sentinel pos in vararg methods in position different
26262         from 0.
26263
26264 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26265
26266         * culture-info-tables.h: freshly generated.
26267
26268 2004-06-09  Martin Baulig  <martin@ximian.com>
26269
26270         * loader.c (mono_get_method_constrained): Call `mono_class_init
26271         (constrained_class)'.   
26272
26273 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
26274
26275         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
26276         any methods. Fixes #59629.
26277
26278 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26279
26280         * culture-info-tables.h: reflecting locale-builder updates.
26281
26282 2004-06-08  Dick Porter  <dick@ximian.com>
26283
26284         * object.h:
26285         * locales.c: Fixed compile warnings, including a real bug in
26286         CompareInfo_internal_compare.
26287         
26288 2004-06-08  Dick Porter  <dick@ximian.com>
26289
26290         * locales.c
26291         (ves_icall_System_Globalization_CompareInfo_internal_index):
26292         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26293         Double-check the resuls of usearches, because ICU currently
26294         ignores most of the collator settings here.  Fixes bug 59720.
26295         
26296 2004-06-08  Dick Porter  <dick@ximian.com>
26297
26298         * locales.c
26299         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26300         Fix memory leak and segfault-causing typo.  No idea how this one
26301         lasted so long without being noticed.
26302
26303 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
26304
26305         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
26306         any methods. Fixes #59629.
26307
26308 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26309
26310         * assembly.c:
26311         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
26312         own the critical section before). Removed dead code (that's done
26313         in the preload hook).
26314
26315         (mono_assembly_load_with_partial_name): call the preload hook.
26316
26317 2004-06-08  Martin Baulig  <martin@ximian.com>
26318
26319         * metadata.c (mono_metadata_signature_alloc): Default
26320         `sentinelpos' to -1.
26321
26322         * reflection.c (mono_image_get_array_token): Likewise.
26323
26324 2004-06-08  Martin Baulig  <martin@ximian.com>
26325
26326         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
26327
26328         * metadata.c (mono_metadata_parse_method_signature): When parsing
26329         a MethodDef which has VarArgs, set sentinelpos.
26330
26331         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
26332         `gint16' since we're using -1 for non-varargs methods.
26333
26334         * reflection.c
26335         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
26336         (method_encode_signature): Added varargs support.
26337         (method_builder_encode_signature): Likewise.
26338         (mono_image_get_varargs_method_token): New static method.
26339         (mono_image_create_method_token): New public method; this is
26340         called via an icall instead of mono_image_create_token() when
26341         calling a varargs method.       
26342
26343 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
26344
26345         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
26346
26347 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26348
26349         * culture-info-tables.h : Reflecting the latest locale-builder that
26350           fixed empty array representation ({} to {0}).
26351
26352 2004-06-07  Jackson Harper  <jackson@ximian.com>
26353
26354         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
26355         looking up extra gac paths. This allows MONO_GAC_PATH to act
26356         exactly like a prefix.
26357         
26358 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26359
26360         * reflection.c (mono_reflection_type_from_name): Make a copy of the
26361         type name before modifying it. Fixes #59405.
26362
26363 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26364
26365         * culture-info.h: added fields for "all datetime patterns".
26366         * locales.c: (  ves_icall_System_Globalization_CultureInfo
26367           _construct_datetime_format ()): fill xxx_patterns fields.
26368         * object.h: added fields for "all datetime patterns" to
26369           MonoDateTimeFormatInfo.
26370         * culture-info-tables.h: reflecting locale-builder updates.
26371
26372 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26373
26374         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
26375         the event has no add and remove methods. Fixes #59629.
26376
26377 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
26378
26379         * object.c: Fixed possible integer overflow when allocating large
26380         strings.
26381
26382 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26383
26384         * culture-info-tables.h: reflecting locale-builder updates.
26385
26386 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26387
26388         * culture-info-tables.h: reflecting locale-builder updates.
26389
26390 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
26391
26392         * culture-info-tables.h: reflecting locale-builder updates.
26393
26394 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
26395
26396         * threads.c: Made Thread.Sleep abortable.
26397
26398 2004-06-02  Martin Baulig  <martin@ximian.com>
26399
26400         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
26401
26402         * debug-mono-symfile.h: Bumped symbol file version number to 37.
26403
26404 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
26405
26406         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
26407
26408 2004-05-30  Jackson Harper  <jackson@ximian.com>
26409
26410         * reflection.c: Do not hardcode assembly versions or public key
26411         tokens anymore. All of this except the corlib section was dead
26412         code anyways.
26413         
26414 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
26415
26416         * object.c (mono_runtime_invoke_array): Automatically create boxed
26417         objects for byref valuetypes if needed. Fixes #59300.
26418         
26419         * object.c (mono_method_return_message_restore): Handle 
26420         MONO_TYPE_OBJECT as well.
26421
26422 2004-05-28  Jackson Harper  <jackson@ximian.com>
26423
26424         * reflection.c: The modified type encoding was causing build
26425         problems. Reverted for now.
26426         
26427 2004-05-28  Jackson Harper  <jackson@ximian.com>
26428
26429         * reflection.c/h: Take an assembly ref so that we dont create
26430         fully qualified names when encoding types in the same assembly as
26431         the custom attribute being emitted.
26432         * appdomain.c: Increment version number.
26433         
26434 2004-05-26  Duncan Mak  <duncan@ximian.com>
26435
26436         * icall.c
26437         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
26438         Set the full version number (major, minor, build, revision).
26439
26440 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
26441
26442         * marshal.c (emit_struct_conv): increment src/dst after blit
26443         (mono_marshal_get_managed_wrapper,
26444         mono_marshal_get_native_wrapper): make sure we have marshalling
26445         info before marshalling params (info computation affects
26446         blittable)
26447
26448         * class.c (class_compute_field_layout): correctly deal with
26449         blittable
26450         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
26451         value types (as per what windows dows by default)
26452         (mono_class_setup_mono_type): System.ValueType is blittable
26453         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
26454         blittable
26455
26456         * marshal.c (mono_marshal_load_type_info): flag types  as
26457         non-blittable if the native layout doesn't match the managed
26458         layout
26459
26460 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26461
26462         * appdomain.c: don't add stuff in the private search path that is
26463         above the application base. If application base is not set, there's
26464         no private search path.
26465
26466 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
26467
26468         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
26469         byref struct arguments in native->managed marshalling.
26470
26471 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
26472
26473         * marshal.c (mono_marshal_get_runtime_invoke): correctly
26474         cache methods using signature (special case for methods
26475         that are value type or string class)
26476         
26477         * image.c (mono_image_close): clean up allocated GSList's
26478         in runtime_invoke_cache.
26479
26480 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26481
26482         * mono-config.c: set the correct path for mono_cfg_dir on windows when
26483         there's no MONO_CFG_DIR environment variable defined.
26484
26485 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26486
26487         * threads.c: windows version must be >= 0x0500 to include OpenThread.
26488
26489 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
26490
26491         * threadpool.c: Really wait for 500ms after the async call, even if the wait
26492           is interrumped.
26493         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
26494           before waiting for it, and call CloseHandle after the wait to unref it.
26495           This will make sure that handles are not disposed too early.
26496
26497 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26498
26499         * appdomain.c:
26500         * appdomain.h:
26501         * icall.c: removed
26502         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
26503         needed now.
26504
26505         * object.c: se the application_base only for the domain that runs
26506         Main. Fixes bug #59216,
26507
26508 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26509
26510         * appdomain.c:
26511         * object.c: only the domain in which Main is run have
26512         SetupInformation.ConfigurationFile set, so moved a few lines from
26513         appdomain.c to object.c.
26514
26515 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26516
26517         * appdomain.c: we tried to load [name].(dll|exe), but according
26518         to bug #57710, we must also try [culture]/[name].(dll|exe) and
26519         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
26520         There's a test case attached to bug #58922.
26521
26522 2004-05-27  Dick Porter  <dick@ximian.com>
26523
26524         * icall.c:
26525         * file-io.c: Implemented icalls for locking and unlocking regions
26526         in a file.
26527         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
26528         FALSE on error (fixes both compiler warning and real bug.)
26529
26530 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
26531
26532         * culture-info-tables.h: reflecting locale-builder updates.
26533
26534           (Added missing ChangeLog entry for 05/26)
26535
26536 2004-05-27  Jackson Harper  <jackson@ximian.com>
26537
26538         * locales.c: Fix some cut and paste errors.
26539         
26540 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26541
26542         * mono-config.c: set the correct path for config. directory on windows.
26543
26544 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26545
26546         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
26547           on win32.
26548
26549 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26550
26551         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
26552         from pinvoke functions.
26553         
26554         * marshal.c (mono_ftnptr_to_delegate): Implement this.
26555
26556 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26557
26558         * culture-info-tables.h: reflecting locale-builder updates.
26559
26560 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26561
26562         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
26563         #59086.
26564
26565 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
26566
26567         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
26568         * icall.c: Modified icalls for RNG.
26569         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
26570         Windows (CryptoAPI).
26571
26572 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26573
26574         * locales.c: Fix build.
26575
26576 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
26577
26578         * culture-info-tables.h: reflecting locale-builder updates.
26579
26580 2004-05-25  Jackson Harper  <jackson@ximian.com>
26581
26582         * locales.c: When creating the current culture use the $LANGs
26583         specific culture. So DateTimeFormat and NumberFormat entries are created.
26584         
26585 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26586
26587         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
26588         a char array as parameter.
26589
26590 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
26591
26592         * image.c: In mono_image_open(), always use an absolute path name to
26593           look for already loaded images.
26594
26595 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
26596
26597         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
26598         missing in the windows build (like older cygwin include files).
26599
26600 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
26601
26602         * icall.c: Fixed check for possible integer overflow in Buffer_
26603         BlockCopy icall. Replaced comments style // by /* */.
26604
26605 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
26606
26607         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
26608         
26609         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
26610         check after MONO_VTADDR. Fixes pinvoke2.exe.
26611
26612         * marshal.h marshal.c metadata.h: Add beginnings of support for
26613         ftnptr -> delegate marshalling.
26614
26615 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
26616
26617         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
26618         * threads.c: Fix warnings.
26619
26620 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
26621
26622         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
26623         * icall.c: Registered icalls for Suspend and Resume.
26624         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
26625           Thread.Abort.
26626         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
26627         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
26628         * process.c: Use WaitForSingleObjectEx.
26629         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
26630           checkpoints.
26631         * threads.c, threads.h: Make use of new Ex wait methods. Improved
26632           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
26633           for Suspend and Resume. Added new mono_thread_stop, used for stoping
26634           background threads. Added basic support for Abort in Windows.
26635           Start new threads using a managed delegate invoke wrapper. This wrapper
26636           has an interruption checkpoint that is needed since an interruption
26637           can be requested before the thread leaves the unmanaged code that starts 
26638           the thread.
26639         * marshal.c: Added interruption checkpoint after every native call, and
26640           also before managed calls for wrappers called from unmanaged code to
26641           go into managed code.
26642         * object.h: Added new field in MonoThread to keep track of interruption
26643           requests.
26644
26645 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
26646
26647         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
26648         calls.
26649
26650 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26651
26652         * appdomain.c:
26653         * assembly.c:
26654         * gc.c:
26655         * locales.c:
26656         * mono-config.c:
26657         * rand.c: getenv -> g_getenv (windows!)
26658
26659         * process.c: complete_path is also used on non-windows platforms.
26660
26661 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26662
26663         * icall.c: new signature for Process_Start.
26664
26665         * process.[ch]: new signature for Process_Start. If we're on windows
26666         and UseShellExecute is false, we have to search for the program by
26667         ourselves if we don't get a full path.
26668
26669 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
26670
26671         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
26672         marshalling and call CleanUpNativeData if needed. Fixes #58646.
26673
26674 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26675
26676         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
26677         Fixes bug #58373.
26678
26679 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26680
26681         * process.c: use double quotes to quote program name and arguments on
26682         windows. Fixes bug #58575.
26683
26684 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26685
26686         * file-io.c: don't return "." and ".." when using windows Find*File.
26687
26688 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
26689
26690         * marshal.c: Don't pass wrappers to message init because method 
26691         addressed used to lookup metadata. part of remoting[2|3] fix.
26692
26693 2004-05-15  Jackson Harper  <jackson@ximian.com>
26694
26695         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
26696         path is essentially the same as MONO_PATH except that it points to
26697         GACs instead of lib directories.
26698         * loader.h: The user gac is gone so we dont need function to
26699         enable/disable it.
26700         * mono-config.c: user gac option is now gone.
26701         
26702 2004-05-15  Jackson Harper  <jackson@ximian.com>
26703
26704         * culture-info.h: Make defines more consistent, add calendar data
26705         to the culture info table.
26706         * culture-info-tables.h: Add basic calendar data. Basically
26707         everyone gets default gregorian until all the data is
26708         updated.
26709         * locales.c: Use the new consistent defines. Set calendar data for
26710         culture info objects.
26711         * object.h: add a field for calendar data to CultureInfo
26712         
26713 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
26714
26715         * image.c: image->runtime_invoke_cache is keyed on signatures now.
26716         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
26717         a signature.
26718         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
26719         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
26720         an extra param that is the pointer of the method to invoke. The IL for
26721         the invoke method is no longer specific to the method, but to the
26722         signature of the method. Thus, we can share the same code for multiple
26723         methods. This reduces the number of methods that have to be compiled.
26724
26725 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
26726
26727         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
26728
26729         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26730
26731         * icall.c: Optimize Buffer.BlockCopy.
26732
26733 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26734
26735         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
26736         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
26737         quote). Changed them to "MMMM yyyy".
26738
26739 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
26740
26741         * rand.c
26742         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
26743
26744 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
26745
26746         * reflection.h: Updated after changes to managed structures.
26747
26748         * appdomain.c: Bump corlib version.
26749
26750 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26751
26752         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
26753         windows.
26754
26755 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26756
26757         * Makefile.am: link to ../os/libmonoos.la on windows.
26758
26759         * assembly.c:
26760                 -If MONO_DEBUG, warn about non-existing directories in
26761                 MONO_PATH.
26762                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
26763                 compile time variable.
26764                 -Removed init_default_path and call mono_set_rootdir from
26765                 libmonoos.a instead (windows only).
26766
26767         * assembly.h: declare mono_assembly_getrootdir().
26768
26769         * domain.c:
26770         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
26771
26772         * loader.c: s/getenv/g_getenv/
26773
26774 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
26775
26776         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
26777
26778         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
26779
26780         * metadata.h: Add new marshalling conversions.
26781
26782         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
26783         function.
26784
26785         * reflection.c (mono_reflection_get_type): Lookup the type in all
26786         modules of a multi-module assembly. Fixes #58291.
26787
26788 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
26789
26790         * threads.c: Before aborting a background, set the StopRequested
26791         state.  This avoids throwing the Abort exception.
26792         In mono_thread_manage, don't continue with the shutdown until all
26793         aborted threads have actually stopped.
26794
26795 2004-05-10  Jackson Harper  <jackson@ximian.com>
26796
26797         * locales.c: Remove the modifier from culture names.
26798         
26799 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26800
26801         * Makefile.am: monosn is not installed any more. It has been deprecated
26802         in favor of sn.
26803
26804 2004-05-07  Jackson Harper  <jackson@ximian.com>
26805
26806         * locales.c
26807         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
26808         Fix array construction, add bailout if the length is 0.
26809
26810 2004-05-07  Dick Porter  <dick@ximian.com>
26811
26812         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
26813         machine doesn't have a DNS entry.  Patch by Urs Muff
26814         (umuff@quark.com), fixes bug 57928.
26815
26816 2004-05-06  Jackson Harper  <jackson@ximian.com>
26817
26818         * reflection.c: Handle null PublicTokens properly. alloc mem for
26819         assembly names culture so we dont crash when freeing it.
26820         
26821 2004-05-06  Jackson Harper  <jackson@ximian.com>
26822
26823         * assembly.c: Check the usergac when loading with partial names.
26824         
26825 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26826
26827         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
26828         does nothing for now (not required for Linux/Windows) but the class
26829         library can call it (and a newer or modified runtime could need it).
26830         * icall.c: Registred icall.
26831
26832 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26833
26834         * loader.c: prints a message on module loading error we set MONO_DEBUG
26835         environment variable.
26836
26837 2004-05-05  Jackson Harper  <jackson@ximian.com>
26838
26839         * appdomain.c: Handle PublicKeyToken=null properly.
26840         
26841 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26842
26843         * environment.c|h: Added icall ves_icall_System_Environment_
26844         GetOSVersionString to get the current OS version as a string.
26845         * icall.c: Registred icall.
26846
26847 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
26848
26849         * object.c: in mono_object_get_virtual_method(), take into account that
26850         non-virtual methods don't have a slot in the vtable. Check needed when
26851         the object is a proxy.
26852
26853 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
26854
26855         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
26856         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
26857
26858         * object.c (mono_class_compute_gc_descriptor): Fix warning.
26859
26860         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
26861         passed when a valuetype is expected.
26862
26863         * object.c (mono_unhandled_exception): Only set the exit code if the
26864         exception happens in the main thread. Fixes thread5.exe.
26865
26866         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
26867         invalid names. Fixes #58047.
26868
26869 2004-05-03  Jackson Harper  <jackson@ximian.com>
26870
26871         * assembly.c: This line was committed accidently and is unneeded.
26872         
26873 2004-05-03  Jackson Harper  <jackson@ximian.com>
26874
26875         * icall.c: Add new icall for Assembly::LoadWithPartialName
26876         * assembly.c/.h: new function that probes the GAC to load partial
26877         assembly names by Paolo Molaro.
26878         
26879 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26880
26881         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
26882         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
26883         (type_get_fully_qualified_name): Added PublicKeyToken when building a
26884         full type name.
26885
26886 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26887
26888         * appdomain.c: fixed check for 'neutral' culture and removed warning.
26889         * reflection.c: fix bug when parsing a full type name and Version is not
26890         the last thing in the string.
26891
26892 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
26893
26894         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
26895         crashes when it is freed.
26896
26897 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26898
26899         * assembly.c: print the compat warning to stderr.
26900
26901 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
26902
26903         * assembly.c (mono_assembly_load_references): Add a compatibility
26904         hack to run old applications that might be still referencing the
26905         3300-based assemblies, only do this for System.xxx.
26906
26907 2004-05-01  Jackson Harper  <jackson@ximian.com>
26908
26909         * appdomain.c: If the culture is neutral we set it to "".
26910         
26911 2004-04-29  Jackson Harper  <jackson@ximian.com>
26912
26913         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
26914
26915 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
26916  
26917         * string-icalls.c: added low overhead function for copying chars
26918         * icall.c: added needed icall for the above function
26919  
26920 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26921
26922         * icall.c: fix return value of get_global_assembly_cache.  Implemented
26923         Environment.GetLogicalDrives.
26924
26925 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
26926
26927         * rand.c: try and talk to egd or prngd
26928         for random bytes if opening devices fail.
26929
26930 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
26931
26932         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
26933         alignment for the type using the native alignment of its members 
26934         instead of using klass->min_align.
26935
26936         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
26937
26938 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26939
26940         * file-io.c:
26941         * socket-io.c: added check for sys/aio.h.
26942
26943 2004-04-28  Dick Porter  <dick@ximian.com>
26944
26945         * threads.c: Don't abort a thread thats already aborting, when
26946         terminating everything.
26947
26948 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26949
26950         * icall.c: added 2 new async calls for Socket.
26951
26952         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
26953         IO on *nix systems.
26954
26955         * threadpool.c: removed unused variable.
26956
26957 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
26958
26959         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
26960
26961 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
26962
26963         * locales.c: put back string_invariant_tolower () and
26964         string_invariant_toupper ().
26965
26966 2004-04-26 David Waite <mass@akuma.org>
26967
26968         * file-io.h:
26969         * socket-io.h:
26970         * threads.h:
26971         * unicode.h: remove comma from end of enumeration declarations
26972
26973 2004-04-26 David Waite <mass@akuma.org>
26974
26975         * debug-mono-symfile.h:
26976         * decimal.c:
26977         * mono_debug.h:
26978         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
26979
26980
26981 2004-04-26  Jackson Harper  <jackson@ximian.com>
26982
26983         * appdomain.c: Increment version number.
26984         
26985 2004-04-26  Jackson Harper  <jackson@ximian.com>
26986
26987         * appdomain.c: Set assembly references public token value when
26988         PublicKeyToken is specified, not the hash_value. Free public token
26989         values when free assembly name data. Previously the public key
26990         token was hex decoded, however we are using hex encoded public key
26991         tokens, so this is not neccasary.
26992         * assembly.c: Lookup assemblies in the gac if their public token
26993         value is set. Add function to allow enabling user gac
26994         lookups. Specify whether or not the assembly was loaded from the
26995         GAC. Compare full assembly names when checking the cache for
26996         assemblies (Temporarily disabled see comment in code). Remove
26997         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
26998         specifies trace-loader they get extra info to stdout on the
26999         loading of assemblies.
27000         * image.h: Add a field for an assembly references public token
27001         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
27002         whether an assembly has been loaded from the GAC.
27003         * image.c: Remove a corlib -> mscorlib name mapping.
27004         * loader.h: Add function to enable/disable the user gac.
27005         * mono-config.c: Check if the usergac is enabled in the config
27006         file.
27007         * icall.c: New icall to determine whether or not an assembly has
27008         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
27009         * tabldefs.h: Add constant for assemblyref flag that specifies a
27010         full public key is used instead of a public token.
27011         * reflection.c: Remove mscorlib -> corlib mappings. Set
27012         PublicTokenValue instead of hash value. This value is a hex
27013         string so it does not need to be expanded.
27014
27015 2004-04-26  Martin Baulig  <martin@ximian.com>
27016
27017         * mono-debug-debugger.c (mono_debugger_initialize): Set
27018         `mono_debugger_initialized' before calling mono_debug_lock().
27019
27020 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
27021
27022         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
27023           InternalToUpper/InternalToLower.
27024         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
27025           removed invariant culture shortcut.  This is now done in managed code.
27026         * locales.c: (string_invariant_toupper/tolower) removed.
27027
27028 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27029
27030         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
27031         Added Poll internal call.
27032
27033         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
27034         call for Poll. Select was too heavy for polling a single socket.
27035
27036         * threadpool.[ch]: added mono_threadpool_cleanup.
27037         * threads.c: use it. Don't use Thread_Abort on windows.
27038
27039 2004-04-23  Martin Baulig  <martin@ximian.com>
27040
27041         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
27042
27043 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
27044
27045         * icall.c: Registred new icalls for key pair protection and added an
27046         icall for Environment.GetFolderPath on Windows.
27047         * security.c|h: Added new icalls for key pair protection.
27048
27049 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27050
27051         * socket-io.c: don't display the non-supported family warning for known
27052         families. Now this is not displayed on windows when checking support
27053         for IPv4/IPv6.
27054
27055 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27056
27057         * class.c: don't display the layout warning for static fields.
27058
27059 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
27060
27061         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
27062         * locales.c, locales.h: Added new icalls for culture-specific
27063         Char.ToLower and Char.ToUpper.
27064
27065 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27066
27067         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
27068         by David Waite.
27069
27070 2004-04-20  Martin Baulig  <martin@ximian.com>
27071
27072         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
27073         of the type name before passing it to mono_reflection_type_from_name().
27074
27075 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
27076
27077         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
27078         encodings here. Fixes #56965.
27079
27080 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
27081
27082         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
27083         fix test on strstr result not that I can see anything that
27084         relies on the result.
27085
27086 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
27087
27088         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
27089         Fixes #57081.
27090
27091         * marshal.c (mono_marshal_get_string_encoding): New helper function.
27092
27093         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
27094         function to determine which marshalling to use for strings. Fixes
27095         #56965.
27096
27097         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
27098
27099         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
27100
27101 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
27102
27103         * icall.c: #include mono-config.h
27104
27105 2004-04-15  Jackson Harper  <jackson@ximian.com>
27106
27107         * culture-info-tables.h: Fix date formats for en-US culture.
27108         
27109 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
27110
27111         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
27112         ThreadPool.SetMinThreads.
27113         * threadpool.c: Implemented ThreadPool.GetMinThreads and
27114         ThreadPool.SetMinThreads.
27115
27116 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
27117
27118         * mono-config.c: also load the .config file in the directory
27119         where the assembly was found.
27120
27121 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
27122
27123         * assembly.c: load per-assembly config files.
27124         * icall.c: decrapified code to get the config dir and moved to
27125         mono-config.c.
27126         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
27127         per-assembly config files. When doing a dll map lookup give precedence
27128         to the per-assembly data.
27129
27130 2004-04-14  Martin Baulig  <martin@ximian.com>
27131
27132         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
27133         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
27134         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
27135
27136         * mono-debugger-debugger.c: While the debugger is locked, remember
27137         whether the symbol tables have changes and send one single
27138         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
27139
27140 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
27141
27142         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
27143
27144         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
27145         function.
27146
27147         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
27148         account when marshalling string arrays. Fixes #56965.
27149
27150 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
27151
27152         * icall.c: Add new icalls mapping for security.
27153         * security.c|h: Add internal calls for WindowsIdentity,
27154         WindowsImpersonationContext and WindowsPrincipal.
27155
27156 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
27157
27158         * class.c: Added comment to ensure the System.MonoDummy class
27159         is removed when no longer necessary
27160
27161 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
27162
27163         * appdomain.c: Pass arguments to the bootstraping exceptions to
27164         minimize JITed methods at boot
27165
27166         * metadata.c (mono_exception_from_name_two_strings): Allow for the
27167         second string to be null.
27168
27169         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
27170         Change the protocol to minimize the JIT methods at startup.  Now
27171         it Returns the internal codepage, if the value of "int_code_page"
27172         is 1 at entry, and we can not compute a suitable code page
27173         number, returns the code page as a string.
27174
27175 2004-04-13  Jackson Harper  <jackson@ximian.com>
27176
27177         * culture-info-tables.h: Fix number of decimal digits for all
27178         english locales.
27179
27180 2004-04-13  Jackson Harper  <jackson@ximian.com>
27181
27182         * icall.c: Clairfy out of sync error message. It is not always
27183         your corlib that is out of sync.
27184
27185 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
27186
27187         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
27188         properties when only the set accessor is overriden. Fixes #55874.
27189
27190 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
27191
27192         * assembly.c (mono_assembly_load_references): Make this thread safe.
27193         Fixes #56327.
27194
27195 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
27196
27197         * monosn.c: Add missing initialization calls.
27198
27199 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
27200
27201         * locales.c:
27202         ves_icall_System_Globalization_CultureInfo_construct_number_format
27203         Fix g_assert so it compiles on fussier compilers re int/ptr
27204         mismatch
27205
27206 2004-04-08  Dick Porter  <dick@ximian.com>
27207
27208         * socket-io.h:
27209         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
27210         53992.  Also rearrange the code so that the internal calls return
27211         an error value and exceptions are thrown from managed code.
27212
27213         * icall.c: Add type info to the socket icalls.
27214
27215 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27216
27217         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
27218         owes me a beer.
27219
27220 2004-04-07  Martin Baulig  <martin@ximian.com>
27221
27222         * class.c (mono_class_from_generic_parameter): Don't default
27223         `klass->parent' to `mono_defaults.object_type'.
27224
27225 2004-04-07  Martin Baulig  <martin@ximian.com>
27226
27227         * reflection.c (mono_reflection_initialize_generic_parameter): Set
27228         `param->pklass->reflection_info'.       
27229
27230 2004-04-07  Jackson Harper  <jackson@ximian.com>
27231
27232         * culture-info-tables.h: Fix date separator symbol.
27233         
27234 2004-04-07  Martin Baulig  <martin@ximian.com>
27235
27236         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
27237         from System.Type to System.MonoType.
27238
27239 2004-04-07  Martin Baulig  <martin@ximian.com>
27240
27241         * reflection.h
27242         (MonoReflectionGenericParam): Added `has_reference_type' and
27243         `has_value_type' fields.
27244
27245         * reflection.c (mono_image_get_generic_param_info): Encode the
27246         correct flags if we have the `class' or `struct' constraint.
27247
27248 2004-04-07  Martin Baulig  <martin@ximian.com>
27249
27250         * reflection.h
27251         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
27252
27253 2004-04-07  Jackson Harper  <jackson@ximian.com>
27254
27255         * appdomain.c: Revert extra patches, just wanted to bump the
27256         version number.
27257         
27258 2004-04-07  Jackson Harper  <jackson@ximian.com>
27259
27260         * Makefile.am: Add culture-info private headers.
27261         * icall.c: Add new icalls for contructing locales.
27262         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
27263         * locales.h: Declare new culture info construction methods.
27264         * object.h: Add new fields used to avoid the CultureMap to
27265         MonoCultureInfo.
27266         * culture-info.h: Definition of structs used in the culture info
27267         tables.
27268         * culture-info-tables.h: Autogenerated tables that contain culture
27269         info data. This file was generated with the locale-builder tool.
27270         * appdomain.c: Incement corlib version number.
27271         
27272 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
27273
27274         * appdomain.c: (mono_runtime_init) move mono_thread_init
27275         to before mono_object_new calls so critical sections
27276         are initialized before use.
27277
27278 2004-04-07  Martin Baulig  <martin@ximian.com>
27279
27280         * icall.c
27281         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
27282         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
27283         (ves_icall_MonoGenericParam_initialize): Removed.
27284         (monogenericparam_icalls): Removed.
27285         (generictypeparambuilder_icalls): Added new table for
27286         System.Reflection.Emit.GenericTypeParameterBuilder.
27287
27288         * reflection.c
27289         (mono_reflection_define_generic_parameter): Removed.
27290         (mono_reflection_initialize_generic_parameter): This is now called
27291         from GenericTypeParameterBuilder's .ctor.
27292
27293 2004-04-06  Martin Baulig  <martin@ximian.com>
27294
27295         * class.c (mono_class_init): Don't inflate nested classes in a
27296         generic instance.
27297         (mono_type_get_name_recurse): Include the generic arguments for
27298         generic instances and generic type declarations.
27299         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
27300         (_mono_class_get_instantiation_name): Removed.
27301         (mono_class_create_generic): Always use `gklass->name' as our name.
27302
27303         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
27304
27305         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
27306         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
27307         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
27308         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
27309         closed generic methods here.
27310
27311         * reflection.c
27312         (mono_reflection_generic_inst_get_nested_types): Removed.
27313         (inflate_mono_method): Copy the generic parameters from the
27314         MonoMethodHeader into out MonoGenericMethod.
27315
27316 2004-04-06  Martin Baulig  <martin@ximian.com>
27317
27318         * row-indexes.h
27319         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
27320
27321         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
27322
27323         * reflection.c (build_compressed_metadata): If we have any entries
27324         in the GenericParam, MethodSpec or GenericParamConstraint tables,
27325         set the header version to 1.1.
27326
27327 2004-04-06  Martin Baulig  <martin@ximian.com>
27328
27329         * class.c (mono_class_init): If we're a generic instance,
27330         initialize our nested classes, too.
27331         (_mono_class_get_instantiation_name): Deal with the new `!%d'
27332         suffix. 
27333
27334 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27335
27336         * process.c: quote the argument passed to the shell on windows.
27337
27338 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
27339
27340         * threads.c (mono_alloc_special_static_data): Allow this to be
27341         called during startup.
27342
27343 2004-04-02  Martin Baulig  <martin@ximian.com>
27344
27345         * icall.c
27346         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
27347
27348 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
27349
27350         * icall.c: Fix build.
27351
27352 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
27353
27354         * Makefile.am: Added security.c|h.
27355         * icall.c: Added icall for get_UserName;
27356         * security.c: New file for security related icalls. Added function
27357         get_UserName for System.Environment (fix #56144).
27358         * security.h: New. Header file for security.c
27359
27360 2004-04-02  Dick Porter  <dick@ximian.com>
27361
27362         * icall.c: Deleted the icalls that were obsoleted some time ago
27363         by the ICU string code, and which were mixed into the icall
27364         rearranging.  Fixes bug 55969.
27365
27366         * string-icalls.h: 
27367         * string-icalls.c: Deleted the code that those icalls reference.
27368
27369 2004-04-01  Martin Baulig  <martin@ximian.com>
27370
27371         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
27372
27373         * class.c (mono_class_from_generic_parameter): Don't set 
27374         TYPE_ATTRIBUTE_INTERFACE.
27375         (my_mono_class_from_generic_parameter): Likewise.
27376
27377 2004-04-01  Martin Baulig  <martin@ximian.com>
27378
27379         * loader.c (find_method): Added an optional `MonoClass *ic'
27380         argument to search in a specific interface.
27381         (mono_get_method_constrained): New public function.
27382
27383 2004-04-01  Martin Baulig  <martin@ximian.com>
27384
27385         * reflection.c (mono_image_get_generic_field_token): Use the
27386         `handleref' cache here.
27387
27388 2004-04-01  Martin Baulig  <martin@ximian.com>
27389
27390         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
27391
27392         * reflection.c (create_generic_typespec): Use the `typespec' hash
27393         here, not the `typeref' one.    
27394
27395 2004-04-01  Martin Baulig  <martin@ximian.com>
27396
27397         * class.c (mono_class_inflate_generic_type): Moved the
27398         functionality into a new static inflate_generic_type() which
27399         returns NULL if it didn't do anything.  Only increment the
27400         `mono_stats.inflated_type_count' if we actually inflated
27401         something.
27402         (mono_class_get_full): Check the classes type to see whether we
27403         need to inflate it; also inflate MONO_TYPE_(M)VAR.
27404
27405 2004-04-01  Jackson Harper  <jackson@ximian.com>
27406
27407         * reflection.c: Set culture for assembly references.
27408         
27409 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
27410
27411         * reflection.[ch], icall.[ch], Fix support for pinning variables.
27412
27413 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27414
27415         * assembly.c:
27416         (do_mono_assembly_open): the critical section also covers
27417         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
27418
27419 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27420
27421         * threads.c:
27422         (mono_manage_threads): abort the background threads when finishing.
27423         Fixes bug #47232.
27424
27425 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27426
27427         * gc.c: only close the done_event handle if there was no timeout.
27428         C-ified comments.
27429
27430 2004-03-30  Martin Baulig  <martin@ximian.com>
27431
27432         * icall.c (icall_entries): It's called "System.Activator", not
27433         "System.Activation".    
27434
27435 2004-03-30  Martin Baulig  <martin@ximian.com>
27436
27437         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
27438         (mono_class_create_from_typespec): Likewise.
27439
27440 2004-03-30  Martin Baulig  <martin@ximian.com>
27441
27442         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
27443         `has_ctor_constraint' and `initialized'.
27444
27445 2004-03-30  Martin Baulig  <martin@ximian.com>
27446
27447         * reflection.c (encode_new_constraint): New static function to add
27448         the constructor constraint attribute to a type parameter.
27449         (encode_constraints): Call encode_new_constraint() if necessary.
27450
27451         * reflection.h
27452         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
27453
27454         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
27455         
27456 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
27457
27458         * reflection.c, icall.c: add support for pinning variables. 
27459
27460 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
27461
27462         * marshal.c (mono_marshal_get_managed_wrapper):
27463         init bool local with zero rather than null.
27464
27465 2004-03-29  Martin Baulig  <martin@ximian.com>
27466
27467         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
27468         the "official" behavior here.
27469         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
27470
27471 2004-03-29  Martin Baulig  <martin@ximian.com>
27472
27473         * icall.c: Reflect latest API changes.
27474
27475 2004-03-29  Martin Baulig  <martin@ximian.com>
27476
27477         * loader.c (mono_get_method_from_token): Also call
27478         mono_metadata_load_generic_params () for abstract and interface
27479         methods; replace the type arguments in the method signature with
27480         the ones which are loaded from the metadata.
27481
27482 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
27483
27484         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
27485         of the lock is not the current thread. MS.NET don't do it, in spite of
27486         what the documentation says. See bug #56157.
27487
27488 2004-03-28  Martin Baulig  <martin@ximian.com>
27489
27490         * class.c (mono_class_init): Don't call init_properties() and
27491         init_events() for generic instances; set `prop->parent' when
27492         inflating properties.
27493
27494         * reflection.c (mono_generic_inst_get_object): Call
27495         `mono_class_init (ginst->klass)'.
27496         (mono_type_get_object): Only create a MonoGenericInst if your
27497         generic type is a TypeBuilder.
27498         (do_mono_reflection_bind_generic_parameters): Only set
27499         `ginst->is_dynamic' if our generic type is a TypeBuilder.
27500
27501 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
27502
27503         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
27504         Fixes #56091.
27505
27506 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27507
27508         * icall.c: added Kill_internal icall.
27509         * process.[ch]: added Kill_internal icall.
27510
27511 2004-03-25  Martin Baulig  <martin@ximian.com>
27512
27513         * class.h (MonoStats): Added `generic_instance_count',
27514         `inflated_method_count', `inflated_type_count' and
27515         `generics_metadata_size'.       
27516
27517 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27518
27519         * reflection.c: no warnings now.
27520
27521 2004-03-25  Martin Baulig  <martin@ximian.com>
27522
27523         * class.c (mono_class_get_full): New public function; does a
27524         mono_class_get(), but also takes a `MonoGenericContext *'.
27525
27526         * loader.c (mono_field_from_memberref): Renamed to
27527         `field_from_memberref', made static and added `MonoGenericContext *'
27528         argument.
27529         (mono_field_from_token): Added `MonoGenericInst *' argument.
27530         (method_from_memberef): Likewise.
27531         (mono_get_method_from_token): Likewise.
27532         (mono_get_method_full): New public function; does a
27533         mono_get_method(), but also takes a `MonoGenericContext *'.
27534
27535         * verify.c (mono_method_verify): Get the method's generic context
27536         and pass it to mono_field_from_token(), mono_get_method_full() and
27537         mono_class_get_full().
27538
27539 2004-03-25  Martin Baulig  <martin@ximian.com>
27540
27541         * class.c (mono_class_inflate_generic_type): Take a
27542         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
27543         `MonoGenericMethod *'.
27544
27545 2004-03-25  Martin Baulig  <martin@ximian.com>
27546
27547         * loader.h (MonoMethodInflated): Store the MonoGenericContext
27548         instead of the MonoGenericMethod here.
27549
27550 2004-03-25  Martin Baulig  <martin@ximian.com>
27551
27552         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
27553         each time we create a new MonoGenericInst, we also create a new
27554         context which points back to us.
27555
27556         * class.c (inflate_method): Use `ginst->context' instead of
27557         creating a new context.
27558
27559         * loader.c (method_from_memberref): Use
27560         `klass->generic_inst->context' instead of creating a new context.
27561
27562 2004-03-25  Martin Baulig  <martin@ximian.com>
27563
27564         * class.h (MonoGenericContext): New struct.
27565         (MonoGenericMethod): Removed `generic_inst'.
27566
27567         * class.c (mono_class_inflate_generic_method): Take a
27568         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
27569
27570 2004-03-25  Martin Baulig  <martin@ximian.com>
27571
27572         * loader.h (MonoMethodInflated): New typedef.
27573
27574         * metadata.h (MonoMethodSignature): Removed `gen_method', make
27575         `generic_param_count' consume just 30 bits, added `is_inflated'
27576         and `has_type_parameters' flags (one bit each).
27577
27578         * class.c (mono_class_inflate_generic_method): Create a
27579         MonoMethodInflated instead of a MonoMethodNormal and set
27580         `is_inflated' in the method signature.
27581
27582         * class.h (MonoGenericMethod): Removed `generic_method'.
27583
27584 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
27585
27586         * image.c: Make sure the name of a MonoImage is always an absolute path.
27587           This fixes bug #54415.
27588
27589 2004-03-24  Martin Baulig  <martin@ximian.com>
27590
27591         * class.c (mono_class_setup_vtable): If we're a generic instance,
27592         use our generic type's vtable size.
27593
27594 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
27595
27596         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
27597         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
27598         problems.
27599
27600 2004-03-23  Martin Baulig  <martin@ximian.com>
27601
27602         * class.h (MonoDynamicGenericInst): Added `int count_events' and
27603         `MonoEvent *events'.
27604
27605         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
27606         (typebuilder_icalls): Added "get_event_info"; calls
27607         mono_reflection_event_builder_get_event_info(). 
27608
27609         * reflection.c (mono_reflection_generic_inst_initialize): Added
27610         `MonoArray *events'.
27611         (mono_reflection_event_builder_get_event_info): New function.
27612
27613 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
27614
27615         * object.h: add mono_type_initialization_init
27616
27617         * object.c (mono_runtime_class_init): 
27618         implement class constructor synchronization rules
27619         to cope with threading issues.  
27620         add mono_type_initialization_init
27621
27622         * appdomain.c (mono_runtime_init): call 
27623         mono_type_initialization_init
27624
27625         * class.h: removing initializing field from MonoVTable
27626
27627 2004-03-23  Martin Baulig  <martin@ximian.com>
27628
27629         * class.c (my_mono_class_from_generic_parameter): Use
27630         `param->name' if it's not NULL. 
27631
27632 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
27633
27634         * class.c: do not insert non-virtual methods in the vtable.
27635         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
27636         that means the method is non-virtual. This never would have
27637         happened before.
27638
27639 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
27640
27641         * profiler.c: Added lock for accessing coverage_hash.
27642
27643 2004-03-22  Martin Baulig  <martin@ximian.com>
27644
27645         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
27646         `method->method->signature->generic_param_count != 0' to make it
27647         work for interface methods.
27648
27649 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27650
27651         * process.c: quote the string passed to the shell using g_shell_quote.
27652
27653 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27654
27655         * threads.c:
27656         (mono_threads_manage): don't remove the finalizer thread and self
27657         from the threads hash table so that mono_thread_manage can be called
27658         more than once.
27659
27660 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27661
27662         * process.c: quote the arguments when UseShellExecute is true. Fixes
27663         bug #55790.
27664
27665 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27666
27667         * threads.c: set mono_thread_detach as a cleanup routine for every
27668         thread. This way it's always executed upon thread termination, either
27669         aborted or finished normally. No more xsp hangs!
27670
27671 2004-03-17  Martin Baulig  <martin@ximian.com>
27672
27673         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
27674         `int count_nested' and a `MonoType **nested'.
27675
27676         * reflection.c (mono_reflection_bind_generic_parameters): Moved
27677         most of the functionality into a new static
27678         do_mono_reflection_bind_generic_parameters() and don't take a
27679         `MonoType *nested_in' argument any more.  Don't compute nested
27680         types here.
27681         (mono_reflection_generic_inst_get_nested_types): New public method
27682         to get nested types.
27683
27684         * class.c (mono_class_create_generic): Set `klass->nested_in' if
27685         we're a nested class.
27686
27687         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
27688         mono_reflection_generic_inst_get_nested_types() to compute the
27689         nested types.
27690
27691 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27692
27693         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
27694         descriptive error message under windows.
27695         
27696 2004-03-17  Martin Baulig  <martin@ximian.com>
27697
27698         * class.c (dup_type): Added `const MonoType *original' argument;
27699         copy the attrs from the original type.
27700
27701 2004-03-17  Martin Baulig  <martin@ximian.com>
27702
27703         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
27704         `m->generic_inst_cache' here.
27705
27706 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27707
27708         * exception.h exception.c: Add stack_overflow_exception.
27709
27710 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27711
27712         * threadpool.c:
27713         (overlapped_callback): call SetEvent *after* invoking the callback.
27714         No need to call CloseHandle.
27715
27716 2004-03-16  Martin Baulig  <martin@ximian.com>
27717
27718         * reflection.c (mono_image_get_fieldref_token): Take a
27719         `MonoReflectionField *' instead of a `MonoClassField *' and a
27720         `MonoClass *'; store the `MonoReflectionField *' in the hash.
27721
27722 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27723
27724         * appdomain.c: don't add the culture to the filename we're looking for
27725         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
27726
27727 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27728
27729         * locales.c: don't ignore symbols when doing case insensitive compares.
27730         Thanks Dick! Fixes bug #54046.
27731
27732         * threads.c: surround 'threads' usage with enter/leave in
27733         mono_thread_manage.
27734
27735 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
27736
27737         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
27738         implicitly marshalled as [Out]. Fixes #55450.
27739
27740         (mono_marshal_get_runtime_invoke): Zero out the result if there is
27741         an exception.
27742
27743 2004-03-16  Martin Baulig  <martin@ximian.com>
27744
27745         * class.c (mono_class_from_generic_parameter): Use the actual
27746         parameter name. 
27747
27748 2004-03-16  Martin Baulig  <martin@ximian.com>
27749
27750         * reflection.c (type_get_signature_size): New static function.
27751         Compues the size of the type in a method signature.
27752         (method_get_signature_size): New static function; calls
27753         type_get_signature_size() to compute the actual size of the
27754         method's signature.
27755         (method_encode_signature): Use method_get_signature_size() to get
27756         the signature's size rather than using `nparams * 10'.
27757
27758 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27759
27760         * file-io.h: define here WapiOverlapped on windows. I don't want the
27761         regular OVERLAPPED one.
27762
27763         * file-io.c:
27764         * threadpool.c: somehow, BindIoCompletionCallback is not found.
27765         Disabling AIO on windows.
27766
27767 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27768
27769         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
27770         bug #55385.
27771
27772 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27773
27774         * appdomain.c: upgraded corlib version.
27775
27776         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
27777         and BeginWrite. Allow opening files for asynchrnous operations.
27778
27779         * file-io.h: new struct that maps FileStreamAsyncResult.
27780         * icall.c: added new icalls.
27781         * process.[ch]: support setting child process environment variables
27782         and use the SHELL or COMSPEC when UseShellExecute is true.
27783
27784         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
27785         callback for async. IO is here and also BindHandle.
27786
27787         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
27788         from here.
27789
27790 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
27791
27792         * reflection.c (create_custom_attr): Allow len == 0.
27793
27794         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
27795         computation on big-endian machines.
27796
27797 2004-03-13  Martin Baulig  <martin@ximian.com>
27798
27799         * class.h (MonoGenericInst): Added `int count_ifaces'.
27800
27801         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
27802         `ginst->count_ifaces' instead `klass->interface_count' since we
27803         may get called before the vtable is created.
27804
27805         * loader.c (mono_method_get_param_names): If we're a generic
27806         instance, return and don't initialize the class.
27807
27808         * reflection.c (mono_reflection_setup_generic_class): Don't call
27809         ensure_runtime_vtable().
27810         (mono_reflection_bind_generic_parameters): Set
27811         `ginst->count_ifaces'.
27812
27813 2004-03-11  Jackson Harper <jackson@ximian.com>
27814
27815         * icall.c:
27816         * unicode.c:
27817         * unicode.h: Remove unused System.Char icalls.
27818         
27819 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
27820
27821         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
27822         code when we P/Invoke the first library in Windows.Forms, instead
27823         of when we first open the assembly.
27824
27825         * assembly.c: Drop the lookup from here.
27826
27827 2004-03-10  Martin Baulig  <martin@ximian.com>
27828
27829         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
27830         class for properties, fields and events.  Finally fixes #54945.
27831
27832 2004-03-10  Martin Baulig  <martin@ximian.com>
27833
27834         * metadata.c (mono_metadata_class_equal): New static function;
27835         checks whether two generic instances or two generic parameters are
27836         equal.
27837         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
27838         compare classes.        
27839
27840 2004-03-10  Martin Baulig  <martin@ximian.com>
27841
27842         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
27843
27844         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
27845         argument and write it into the `reflection_info' field.
27846
27847         * icall.c
27848         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
27849         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
27850
27851 2004-03-09  Jackson Harper  <jackson@ximian.com>
27852
27853         * char-conversions.h: use 8 bits for numeric data its all we need
27854         * icall.c: numeric data is only 8 bits now.
27855
27856 2004-03-09  Martin Baulig  <martin@ximian.com>
27857
27858         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
27859
27860         * class.c (init_properties, init_events): Initialize the new
27861         `parent' field.
27862
27863         * reflection.c (typebuilder_setup_properties): Likewise.
27864         (typebuilder_setup_events): Likewise.
27865
27866         * reflection.h (MonoEventInfo): Replaced `parent with
27867         `declaring_type' and `reflected_type'.
27868
27869         * icall.c (ves_icall_get_property_info): Distinguish between
27870         declaring and reflected type.
27871         (ves_icall_get_event_info): Likewise.
27872
27873 2004-03-09  Martin Baulig  <martin@ximian.com>
27874
27875         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
27876         (ves_icall_Type_GetField): Correctly set field->klass.
27877
27878 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
27879
27880         * loader.h: Fix warning.
27881
27882 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
27883
27884         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
27885         library routine if present.  Notice that it will still continue
27886         executing even if its missing, for those working on the Gtk#
27887         edition of Windows.Forms.
27888
27889         * assembly.c (do_mono_assembly_open): If loading the
27890         System.Windows.Forms call mono_loader_wini_init.
27891
27892 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
27893
27894         * class.h: Added MonoRemoteClass struct.
27895         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
27896         function for MonoStrings.
27897         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
27898         Added internal call for getting the proxy type.
27899         * marshal.c: Get the type of transparent proxies from its remote_class.
27900         Added methods that generate the IL for type checks and casts:
27901         mono_marshal_get_isinst, mono_marshal_get_castclass, 
27902         mono_marshal_get_proxy_cancast.
27903         * marshal.h: Declaration of the previous new methods.
27904         * object.c: Added new moethods for creating and updating MonoRemoteClass
27905         instances: mono_remote_class, mono_upgrade_remote_class, 
27906         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
27907         * verify.c: FIx transparent_proxy_fields layout.
27908         * appdomain.c: Bump corlib version.
27909
27910 2004-03-04  Jackson Harper  <jackson@ximian.com>
27911
27912         * icall.c: Add icall to access char conversion tables.
27913         * char-conversions.h: Character conversion tables.
27914         * Makefile.am: Add char-conversions.h private header file.
27915         
27916 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
27917
27918         * appdomain.c (unload_thread_main): Increase unloading timeout to
27919         10 sec as a temporary workaround for Nant problems.
27920
27921 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
27922
27923         * gc.c: Add checks for GC_enable and GC_disable.
27924
27925         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
27926         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
27927         (bug #54988).
27928         
27929 2004-02-27  Martin Baulig  <martin@ximian.com>
27930
27931         * reflection.c (mono_reflection_bind_generic_parameters): Take a
27932         `MonoReflectionType *' instead of a `MonoType *'.
27933
27934 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
27935
27936         * gc.c (run_finalize): Avoid finalizing the object representing the
27937         finalizer thread.
27938         (finalizer_thread): Fix warning.
27939
27940 2004-02-25  Martin Baulig  <martin@ximian.com>
27941
27942         * class.c (_mono_class_get_instantiation_name): Added `int offset'
27943         argument for nested types.
27944         (mono_class_create_generic): Added support for nested generictypes.
27945
27946         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
27947         `GList *nested'.
27948
27949         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
27950
27951         * reflection.c (method_encode_signature): Increase the minimum
27952         value of `size' from 10 to 11.
27953         (mono_reflection_bind_generic_parameters): Take `int type_argc'
27954         and `MonoType **types' arguments instead of the `MonoArray
27955         *types'; added `MonoType *nested_in'.  Recursively instantiate
27956         nested classes. 
27957
27958 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
27959
27960         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
27961         stack_overflow_ex members which are used by exception handling.
27962
27963         * appdomain.c (mono_runtime_init): Initialize the new members.
27964
27965         * gc.c (mono_gc_enable): New helper function.
27966         * gc.c (mono_gc_disable): New helper function.
27967
27968 2004-02-23  Martin Baulig  <martin@ximian.com>
27969
27970         * icall.c: I must have been really stupid - make it actually work
27971         this time ;-)
27972
27973 2004-02-23  Martin Baulig  <martin@ximian.com>
27974
27975         * loader.c (method_from_memberref): Only inflate the method if
27976         it's in another klass.
27977
27978 2004-02-23  Martin Baulig  <martin@ximian.com>
27979
27980         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
27981         (mono_class_init): If we're a generic instance and an interface,
27982         compute `class->interface_id'; also create `class->interfaces'
27983         here and inflate them.
27984
27985         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
27986         `ginst->is_open'.
27987         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
27988
27989         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
27990
27991 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
27992
27993         * reflection.c (method_encode_code): Improved the error message
27994         generated by the exception.
27995
27996 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27997
27998         * icall.c: Martin did not do what he said in the ChangeLog for
27999         2004-02-18, but put back the changes for properties and events.
28000         Commenting those changes out again and adding comment to bug #54518.
28001         
28002         * process.c: removed warning.
28003
28004 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
28005
28006         * marshal.c (emit_struct_conv): Print an error message instead of
28007         asserting when a type does not have the StructLayout attribute.
28008
28009 2004-02-20  Martin Baulig  <martin@ximian.com>
28010
28011         * reflection.c (mono_type_get_object): Also use the cache for
28012         generic instances.
28013         (mono_reflection_bind_generic_parameters): Always compute
28014         `ginst->ifaces'.        
28015
28016 2004-02-20  Martin Baulig  <martin@ximian.com>
28017
28018         * class.h (MonoGenericMethod): Removed `klass'.
28019
28020         * class.c (mono_class_inflate_generic_method): Added `MonoClass
28021         *klass' argument.
28022
28023 2004-02-20  Martin Baulig  <martin@ximian.com>
28024
28025         * reflection.c (method_encode_methodspec): Actually use the
28026         uninflated signature for the memberref.
28027
28028 2004-02-20  Martin Baulig  <martin@ximian.com>
28029
28030         * class.h (MonoGenericMethod): Removed `declaring'.
28031
28032         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
28033         is NULL, compute it here.
28034
28035 2004-02-20  Martin Baulig  <martin@ximian.com>
28036
28037         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
28038
28039         * metadata.c (mono_metadata_generic_inst_hash): New method.
28040         (mono_metadata_generic_inst_equal): New method.
28041
28042         * reflection.c (mono_reflection_bind_generic_parameters): Use the
28043         `klass->image->generic_inst_cache' cache to avoid creating
28044         duplicate MonoGenericInst's.
28045
28046         * class.c (mono_class_inflate_generic_type): Use the cache.
28047
28048 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
28049
28050         * object.c: fixed gc descriptor calculation for embedded valuetypes.
28051
28052 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28053
28054         * icall.c: added Socket.WSAIoctl icall.
28055
28056         * socket-io.[ch]: implemented
28057         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
28058
28059 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
28060
28061         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
28062
28063 2004-02-18  Urs C Muff  <umuff@quark.com>
28064
28065         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
28066         this work on PPC and other big-endian architectures.
28067
28068         * debug-mono-symfile.h: Prepended the names of all the `guint32'
28069         fields with an underscore to make sure they're only accessed by
28070         the read32() macro.
28071
28072 2004-02-18  Martin Baulig  <martin@ximian.com>
28073
28074         * icall.c: Put the klass->refclass changes back for methods and
28075         fields, but not for properties and events.  We're currently not
28076         distinguishing between DeclaringType and ReflectedType for
28077         properties and events, that's what caused the regressions.
28078
28079 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28080
28081         * object.c:
28082         (mono_async_result_new): the handle can be NULL.
28083
28084         * threadpool.c: Use an event instead of a semaphore, don't initialize
28085         it until needed. This saves quite a few semaphores from being created
28086         when using the threadpool.
28087
28088 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
28089
28090         * object.c (mono_string_is_interned_lookup): Fix interning of long
28091         strings. Fixes #54473.
28092
28093         * domain.c (ldstr_equal): Optimize if the two strings are equal.
28094
28095         * icall.c: Revert the klass->refclass changes since they introduce
28096         regressions (bug #54518).
28097
28098 2004-02-18  Martin Baulig  <martin@ximian.com>
28099
28100         * class.c (mono_class_init): If we're a generic instance and don't
28101         come from a TypeBuilder, inflate our members here.
28102         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
28103         (mono_class_create_generic): New public method.
28104         (mono_class_initialize_generic): Removed.
28105         (get_instantiation_name): Renamed to
28106         _mono_class_get_instantiation_name() and made it public.
28107
28108 2004-02-18  Martin Baulig  <martin@ximian.com>
28109
28110         * class.c (mono_class_inflate_generic_type): Clear the new
28111         instance's `nginst->klass' when inflating a generic instance.
28112         (mono_class_is_subclass_of): Added (basic) support for generic
28113         instances.
28114
28115 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
28116
28117         * appdomain.h, domain.c: use a MonoCodeManager instead of a
28118         MonoMempool to hold compiled native code.
28119
28120 2004-02-17  Martin Baulig  <martin@ximian.com>
28121
28122         * class.h (MonoDynamicGenericInst): Added `count_properties' and
28123         `properties'.
28124
28125         * reflection.c (mono_reflection_generic_inst_initialize): Added
28126         `MonoArray *properties' argument.
28127
28128         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
28129
28130 2004-02-17  Martin Baulig  <martin@ximian.com>
28131
28132         * icall.c (ves_icall_Type_GetFields): Renamed to
28133         ves_icall_Type_GetFields_internal() and added a
28134         `MonoReflectionType *rtype' argument; pass it to
28135         mono_field_get_object() to set the field's "reflected" type.
28136         (ves_icall_Type_GetConstructors): Likewise.
28137         (ves_icall_Type_GetEvents): Likewise.
28138         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
28139         argument; pass it to mono_method_get_object() to set the method's
28140         "reflected" type.       
28141
28142 2004-02-17  Martin Baulig  <martin@ximian.com>
28143
28144         * class.h (MonoDynamicGenericInst): New type.
28145         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
28146
28147         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
28148         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
28149         (ves_icall_MonoGenericInst_GetFields): New interncall.
28150
28151         * class.c (mono_class_from_generic): Don't call
28152         mono_class_initialize_generic() if this is a dynamic instance;
28153         ie. it's being created from a TypeBuilder.
28154         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
28155         `class->byval_arg.type'.
28156
28157         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
28158         to `inflate_method' and made static.
28159         (mono_reflection_inflate_field): Removed.
28160         (mono_reflection_generic_inst_initialize): New public method.
28161
28162         * reflection.h (MonoReflectionGenericInst): Removed `methods',
28163         `ctors' and `fields'; added `initialized'.
28164
28165 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
28166
28167         * debug-helpers.c (mono_method_full_name): Fix output for empty
28168         namespaces.
28169
28170 2004-02-12  Martin Baulig  <martin@ximian.com>
28171
28172         * class.h (MonoClassField): Added `MonoType *generic_type'.
28173
28174         * reflection.c (mono_image_get_fieldref_token): Added support for
28175         instantiated generic types.
28176         (field_encode_inflated_field): Removed.
28177         (mono_image_get_inflated_field_token): Removed.
28178         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
28179
28180         * reflection.h (MonoReflectionInflatedField): Removed.
28181
28182 2004-02-12  Martin Baulig  <martin@ximian.com>
28183
28184         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
28185         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
28186
28187         * reflection.c (mono_image_get_methodspec_token): Take a
28188         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
28189         (mono_image_create_token): Check whether we have a
28190         `method->signature->gen_method' and call
28191         mono_image_get_methodspec_token() if appropriate.
28192         (inflated_method_get_object): Removed.
28193         (mono_reflection_bind_generic_method_parameters): Return a
28194         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
28195         (mono_reflection_inflate_method_or_ctor): Likewise.
28196
28197         * reflection.h (MonoReflectionInflatedMethod): Removed.
28198
28199 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
28200
28201         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
28202         for custom valuetype marshalling.
28203
28204         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
28205
28206 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28207
28208         * icall.c: fixed WSAGetLastError_internal name.
28209
28210 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
28211
28212         * threads.c (mono_thread_attach): Allow this to be called multiple
28213         times for a thread.
28214         
28215         * threads.c (build_wait_tids): Do not wait for ourselves.
28216
28217         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
28218         appdomain list is empty.
28219
28220         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
28221         memory returned by mono_string_builder_to_utf16, since it points into
28222         managed memory. Thanks to Bernie Solomon for noticing this.
28223
28224         * icall.c: Add AppDomainSetup icalls.
28225
28226         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
28227
28228         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
28229         types.
28230
28231         * reflection.c (reflection_methodbuilder_to_mono_method): Save
28232         custom attributes to the method_aux struct. Also fix array indexes etc.
28233
28234         * loader.c (mono_method_get_param_names): Make dynamic case work again.
28235         
28236 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
28237
28238         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
28239         (both static and runtime) and reduce startup time.
28240
28241 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
28242
28243         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
28244         AsAny marshalling conversion instead of crashing.
28245
28246         * marshal.c: Fix warnings.
28247
28248 2004-02-09  Martin Baulig  <martin@ximian.com>
28249
28250         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
28251
28252         * reflection.h (MonoReflectionInflatedMethod): Removed the
28253         `declaring' field, it's now in the unmanaged MonoGenericMethod.
28254
28255         * reflection.c (method_encode_methodspec): Removed the `method'
28256         argument; we get it from `gmethod->declaring'.
28257         (inflated_method_get_object): Removed the `declaring' argument.
28258
28259 2004-02-09  Martin Baulig  <martin@ximian.com>
28260
28261         * class.h (MonoGenericMethod): New type.
28262         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
28263         `generic_method'.
28264
28265         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
28266         a `MonoGenericMethod *gen_method' one.
28267
28268         * class.c (mono_class_inflate_generic_type): Take an additional
28269         `MonoGenericMethod * argument.  This is only non-NULL if we're
28270         inflating types for a generic method.   
28271         (mono_class_inflate_generic_signature): Renamed to
28272         inflate_generic_signature() and made static; take a
28273         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
28274         (inflate_generic_header): Take a `MonoGenericMethod *' argument
28275         instead of a `MonoGenericInst *' one.
28276         (mono_class_inflate_generic_method): Likewise.
28277
28278         * reflection.c (encode_generic_method_sig): Take a
28279         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
28280         (method_encode_methodspec): Likewise.
28281         (inflated_method_get_object): Likewise. 
28282
28283         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
28284         field with a `MonoGenericMethod *gmethod' one.  
28285
28286 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
28287
28288         * class.h (mono_class_has_parent): add parens to expansion
28289         so you can ! this.
28290
28291 2004-02-08  Martin Baulig  <martin@ximian.com>
28292
28293         * image.h (MonoImage): Removed `generics_cache'.
28294
28295         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
28296         instead of a `MonoType *' argument; removed the `inflate_methods'
28297         argument.  Don't inflate methods here.
28298
28299         * loader.c (find_method): If it's a generic instance, call
28300         mono_class_init() on the `sclass->generic_inst->generic_type'.
28301
28302         * metadata.c (mono_type_size): Make this work on uninitialized
28303         generic instances; call it on the `ginst->generic_type's class.
28304
28305         * reflection.c (mono_reflection_bind_generic_parameters): Call
28306         mono_class_from_generic() to create the `ginst->klass'.
28307
28308 2004-02-08  Martin Baulig  <martin@ximian.com>
28309
28310         * class.h (MonoClass): Changed type of `generic_inst' from
28311         `MonoType *' to `MonoGenericInst *'.
28312
28313 2004-02-08  Martin Baulig  <martin@ximian.com>
28314
28315         * icall.c (ves_icall_Type_BindGenericParameters): Just call
28316         mono_type_get_object(), this is now creating a `MonoGenericInst'
28317         for MONO_TYPE_GENERICINST.
28318         (ves_icall_MonoGenericInst_GetParentType): Likewise.
28319         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
28320
28321         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
28322         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
28323         (inflated_method_get_object): Added `MonoClass *refclass' argument.
28324         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
28325         and reflected type.
28326
28327         * reflection.h (MonoReflectionInflatedMethod): Removed
28328         `declaring_type' and `reflected_type'.
28329
28330 2004-02-08  Martin Baulig  <martin@ximian.com>
28331
28332         * class.h (MonoGenericInst): Added `MonoType *parent' and
28333         `MonoType **ifaces'.
28334
28335         * reflection.h (MonoReflectionGenericInst): Removed `klass',
28336         `parent' and `interfaces'.
28337
28338         * reflection.c (mono_reflection_bind_generic_parameters): Take a
28339         `MonoType *' argument and return a `MonoType *'.
28340
28341         * icall.c
28342         (ves_icall_MonoGenericInst_GetParentType): New interncall.
28343         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
28344
28345 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28346
28347         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
28348         valuetype marshalling.
28349
28350 2004-02-06  Martin Baulig  <martin@ximian.com>
28351
28352         * class.c
28353         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
28354         (my_mono_class_from_generic_parameter): Likewise.
28355
28356 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28357
28358         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
28359         contents of the symbol files lazily.
28360
28361         * object.h (MonoThread): Add 'name' and 'name_len' fields.
28362
28363         * threads.h threads.c icall.c: New icalls for getting and setting the
28364         threads name.
28365
28366 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
28367
28368         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
28369         Raise an exception when the domain is not found.
28370
28371 2004-02-03  Martin Baulig  <martin@ximian.com>
28372
28373         * reflection.c (mono_image_get_methodspec_token): Use the
28374         uninflated signature; fixes gen-33.
28375
28376 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
28377
28378         * gc.c threads.c: Make the finalizer thread a normal managed thread so
28379         the finalizer code can use thread functionality.
28380
28381         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
28382         the finalizer thread.
28383
28384         * threads.c: Make some functions more robust.
28385
28386         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
28387
28388         * metadata.h: Add new marshalling conventions.
28389
28390         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
28391         stringbuilder marshalling. Fixes #53700.
28392
28393         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
28394
28395         * reflection.c (mono_image_get_type_info): Save declarative security
28396         info.
28397
28398         * reflection.c (mono_image_get_field_info): Handle uninitialized 
28399         unmanaged fields as well.
28400
28401         * appdomain.c: Bump corlib version.
28402
28403 2004-02-01  Martin Baulig  <martin@ximian.com>
28404
28405         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
28406         method type arguments.  
28407
28408 2004-01-30  Duncan Mak  <duncan@ximian.com>
28409
28410         * marshal.h: Add prototype for
28411         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
28412         and
28413         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
28414         fix the build.
28415
28416 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
28417
28418         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
28419         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
28420
28421 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28422
28423         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28424         custom marshalling of valuetypes.
28425
28426         * marshal.c: Fix some warnings.
28427
28428 2004-01-29  Martin Baulig  <martin@ximian.com>
28429
28430         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
28431         for generic method parameters.
28432
28433         * reflection.c (method_encode_methodspec): Write the uninflated
28434         signature into the methodspec table.
28435         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
28436         is always the uninflated method.
28437         (reflection_methodbuilder_to_mono_method): Copy the generic
28438         parameters from the MethodBuilder into `header->gen_params'.
28439
28440 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28441
28442         * class.c (mono_class_from_generic_parameter): Fix warning.
28443
28444 2004-01-27  Martin Baulig  <martin@ximian.com>
28445
28446         * class.c (mono_class_from_generic_parameter): Don't create
28447         `klass->methods' here.  
28448
28449 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
28450
28451         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
28452         extension since it does not work with libraries named lib<FOO>.dll.so.
28453
28454 2004-01-25  Martin Baulig  <martin@ximian.com>
28455
28456         * class.c (mono_class_inflate_generic_type): Added support for
28457         MONO_TYPE_GENERICINST.
28458
28459         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
28460         inflate methods on open constructed types.      
28461
28462 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28463
28464         * object.c: fire ProcessExit event in the root AppDomain after running
28465         Main. Fixes bug #53299.
28466
28467 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
28468
28469         * socket-io.c: include the new socket-wrappers.h header.
28470         Use the wrappers instead of the unix socket functions to make the code
28471         more clear.
28472
28473 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
28474
28475         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
28476
28477         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28478         Fixes #22532.
28479
28480 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
28481
28482         * reflection.c (mono_image_create_pefile): Handle the case when the
28483         entry point is not a MethodBuilder.
28484
28485         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28486         field to ReflectionMethod since it is not allways a builder.
28487
28488         * reflection.c (type_get_fully_qualified_name): New helper function to
28489         return the fully qualified name of a type.
28490
28491         * reflection.c (encode_marshal_blob): Always emit the fully qualified
28492         type name for custom marshallers.
28493
28494         * reflection.c (mono_marshal_spec_from_builder): Ditto.
28495
28496         * class.c (mono_class_setup_vtable): If a parent class already 
28497         implements an interface, use the implementing methods from that class.
28498         Fixes #53148.
28499
28500 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28501
28502         * threadpool.c: just return instead of ExitThread to allow for thread
28503         clean up earlier.
28504
28505 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
28506
28507         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
28508         when closing resource modules.
28509
28510         * reflection.c (mono_image_create_pefile): Handle the case when the
28511         entry point is not a MethodBuilder.
28512
28513         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28514         field to ReflectionMethod since it is not allways a builder.
28515
28516 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
28517
28518         * marshal.c (mono_marshal_get_managed_wrapper): 
28519         mono_marshal_alloc takes native int so CONV_I
28520         the arg for 64bits.
28521
28522 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
28523
28524         * reflection.c (fixup_cattrs): New function to fixup the methoddef
28525         tokens in the cattr table. Fixes #53108.
28526
28527 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28528
28529         * loader.c: don't trim ".dll" before looking up in the config file.
28530         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
28531
28532 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
28533
28534         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
28535         Return the module which contains the resource as well.
28536         (ves_icall_System_Reflection_Module_Close): New icall.
28537
28538         * appdomain.c: Bump corlib version number.
28539
28540         * image.c (mono_image_addref): New public function.
28541
28542         * assembly.c: Call mono_image_addref.
28543
28544         * reflection.c (mono_module_get_object): Increase reference count of 
28545         the image.
28546
28547         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28548         Fixes #22532.
28549
28550         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
28551         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
28552         proper exceptions on DllImport problems.
28553
28554 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
28555
28556         * class.c, metadata.c: eliminate CSIZE macro.
28557
28558 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
28559
28560         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
28561         * object.h: Added async_callback field in MonoAsyncResult.
28562         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
28563         * verify.c: Added async_callback in MonoAsyncResult layout.
28564
28565 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
28566
28567         * reflection.c (mono_reflection_get_custom_attrs): Add support
28568         for Modules.
28569
28570 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28571
28572         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
28573         marshalling.
28574         (mono_marshal_method_from_wrapper): Add null pointer check.
28575
28576 2004-01-16  Martin Baulig  <martin@ximian.com>
28577
28578         * debug-mono-symfile.h: Set version number to 36 and reflect
28579         latest symbol writer changes.
28580
28581 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28582
28583         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
28584         multi-dimensional arrays.
28585         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
28586         (mono_class_from_mono_type): Use bounded_array_class_get.
28587         
28588         * class.c (mono_bounded_array_class_get): New function which takes
28589         a 'bounded' bool argument to distinguish vectors from one dimensional
28590         arrays.
28591
28592         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
28593         bounded_array_class_get if the array has bounds.
28594
28595         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
28596         Search modules loaded using AssemblyBuilder:AddModule as well.
28597
28598 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28599
28600         * appdomain.c: increased corlib version.
28601         * filewatcher.c: removed g_print.
28602         * icall.c:
28603         (get_property_info): only allocate what is actually requested.
28604         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
28605
28606 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28607
28608         * Makefile.am: added filewatcher.[ch]
28609         * filewatcher.[ch]: FileSystemWatcher runtime support.
28610         * icall.c: added new FSW icalls.
28611
28612 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
28613
28614         * string-icalls.c: fix stringbuilder regression as suggested by
28615         Iain McCoy <iain@mccoy.id.au>.
28616
28617 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
28618
28619         * process.c (process_read_stringtable_block): Recognize '007f' as
28620         a language neutral stringtable block.
28621
28622 2004-01-12  Patrik Torstensson
28623
28624         * object.h (MonoStringBuilder) : Changed layout to support our
28625         new stringbuilder class.
28626         * marshal.c: Change marshalling to support the new layout of 
28627         string builder.
28628         * appdomain.c: increased version number because new layout of
28629         string builder.
28630
28631 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
28632
28633         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
28634         assembly name as an string instead of an AssemblyName, since it is
28635         easier to extract info from it.
28636
28637         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
28638         the culture subdirectories too. Fixes #52231.
28639
28640 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28641
28642         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
28643         It takes 2 new parameters with an optional name for the method to look
28644         for and case ignoring info.
28645
28646         * threadpool.c: removed unused variable.
28647
28648 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28649
28650         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
28651         It takes 2 new parameters with an optional name for the property to look
28652         for and case ignoring info.
28653         Fixes bug #52753.
28654
28655 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
28656
28657         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
28658         Fix #52451.
28659
28660 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28661
28662         * appdomain.c:
28663         * assembly.c: escape the uri before passing it to g_filename_from_uri.
28664         Fixes bug #52630.
28665
28666 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
28667
28668         * reflection.c: Add support for more than one unmanaged resource.
28669
28670         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
28671         in field->def_value, as done in all other cases.
28672
28673         * reflection.c (mono_reflection_get_custom_attrs): Add support for
28674         TypeBuilders.
28675
28676         * reflection.c (mono_reflection_create_runtime_class): Remove 
28677         errorneous assignment to klass->element_class, since it is already
28678         done in mono_reflection_setup_internal_class.
28679
28680 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28681
28682         * gc.c: added missing LeaveCriticalSection.
28683         * icall.c: indented a couple of lines.
28684         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
28685         if we call EndInvoke inside a callback. Fixes bug #52601.
28686
28687 2004-01-07  Martin Baulig  <martin@ximian.com>
28688
28689         * mono-debug-debugger.h
28690         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
28691
28692 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
28693
28694         * appdomain.c: Use messages in NotImplementedException.
28695
28696         * exception.c (mono_get_exception_not_implemented): Now this takes
28697         a message argument.
28698
28699         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
28700         exception instead of g_asserting an aborting when something is not
28701         implemented.
28702
28703         Add some inline docs.
28704
28705 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
28706
28707         * reflection.h: Update after changes to object layout.
28708
28709         * reflection.c: Implement saving of unmanaged aka win32 resources.
28710
28711         * appdomain.c: Bump version number.
28712
28713         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
28714         Handle missing domains gracefully.
28715
28716 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
28717
28718         * file-io.c : On Windows, there are much more invalid_path_chars.
28719
28720 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
28721
28722         * class.h, object.c: prepare for GetType () speedup.
28723
28724 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
28725
28726         * profiler.c: workaround for --profile null reference exception on
28727           cygwin. Patch by Patrik Torstensson.
28728
28729 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
28730
28731         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
28732         make work for unaligned access.
28733
28734 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
28735
28736         * class.c: small cleanup (class->fields [i] -> field).
28737         * image.c: check address of metadata is valid.
28738
28739 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
28740
28741         * assembly.h assembly.c (mono_assembly_loaded): New public function to
28742         search the list of loaded assemblies.
28743
28744         * reflection.c (mono_reflection_type_from_name): Use 
28745         mono_assembly_loaded instead of mono_image_loaded.
28746
28747         * reflection.c: Fix warnings.
28748
28749 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
28750
28751         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
28752         is dynamic. This is needed since an assembly can contain both dynamic and
28753         non-dynamic images.
28754
28755         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
28756         assembly->dynamic.
28757
28758         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
28759
28760         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
28761         to store modules loaded using AddModule.
28762
28763         * reflection.c (mono_image_fill_file_table): Generalize this so it works
28764         on Modules.
28765
28766         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
28767
28768         * reflection.c (mono_image_fill_export_table_from_module): New function to
28769         fill out the EXPORTEDTYPES table from a module.
28770
28771         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
28772         into a separate function. Also handle loaded non-dynamic modules.
28773
28774         * reflection.c (mono_image_basic_init): Fix memory allocation.
28775
28776         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28777
28778         * assembly.c (mono_assembly_load_references): Make this public.
28779
28780 2003-12-19  Martin Baulig  <martin@ximian.com>
28781
28782         * class.c (mono_class_initialize_generic): Made this static, take
28783         a `MonoGenericInst *' instead of a `MonoClass *'.
28784         (mono_class_from_generic): Call mono_class_initialize_generic()
28785         unless we're already initialized or being called from
28786         do_mono_metadata_parse_generic_inst().
28787
28788         * class.h (MonoGenericInst): Added `initialized' and
28789         `init_pending' flags.
28790
28791         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
28792         `mono_class_init (gklass)' or mono_class_initialize_generic()
28793         here; set `generic_inst->init_pending' while parsing the
28794         `type_argv'.
28795
28796 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
28797
28798         * locales.c: include string.h for memxxx prototypes
28799
28800 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
28801
28802         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
28803         constructor when accessing literal fields.
28804
28805 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
28806
28807         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28808
28809         * reflection.c (assembly_add_resource_manifest): New function to fill
28810         the MANIFESTRESOURCE table.
28811
28812         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
28813
28814         * reflection.h: Update to changes in class layout.
28815
28816         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
28817         Reenable call to mono_runtime_is_shutting_down ().
28818
28819         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
28820         determine if the runtime is shutting down.
28821
28822 2003-12-16  Jackson Harper <jackson@ximian.com>
28823
28824         * icall.c: comment out call to mono_runtime_is_shutting_down to
28825         fix build.
28826         
28827 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
28828
28829         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
28830         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
28831
28832 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
28833
28834         * reflection.c: move definition of swap_with_size
28835         to before its first call
28836
28837 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
28838
28839         * appdomain.c (mono_runtime_is_shutting_down): New public function.
28840
28841         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
28842         icall.
28843
28844         * object.c: Fix warnings.
28845
28846         * icall.c (ves_icall_Type_Get...): Only consider inherited static
28847         members if FlattenHierarchy is set.
28848
28849         * reflection.c (mono_image_add_decl_security): New function to emit
28850         declarative security.
28851
28852         * reflection.h reflection.c: Add support for declarative security.
28853
28854         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28855         
28856 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
28857
28858         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28859         
28860         * appdomain.c verify.c: Moved corlib version checking into its own
28861         function in appdomain.c since it needs to create vtables etc.
28862
28863 2003-12-13  Patrik Torstensson <p@rxc.se>
28864
28865         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
28866         instead of unwrapped server.
28867
28868 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
28869
28870         * verify.c (check_corlib): Fix field index.
28871
28872 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
28873
28874         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
28875         GetGacPath icall.
28876
28877 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
28878
28879         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
28880         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
28881         cope with sizeof(size_t) != sizeof(guint32).
28882
28883 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28884
28885         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
28886         in case of failure.
28887
28888 2003-12-10  Mark Crichton <crichton@gimp.org>
28889
28890         * icall.c: removed the GetNonZeroBytes.  We now handle this case
28891         in managed code.
28892
28893         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
28894
28895 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
28896
28897         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
28898         marked as deleted.
28899
28900 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
28901
28902         * verify.c (check_corlib): Handle the case when the version field is 
28903         initialized by a static constructor.
28904
28905 2003-12-08  Patrik Torstensson  <p@rxc.se>
28906
28907     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
28908
28909 2003-12-08  Martin Baulig  <martin@ximian.com>
28910
28911         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
28912         a MonoReflectionGenericParameter, also take the parameter index
28913         and name as arguments.
28914         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
28915         (ves_icall_MonoGenericParam_initialize): New interncall.
28916         (ves_icall_Type_make_byref_type): New interncall.
28917
28918         * reflection.h (MonoReflectionGenericParam): Derive from
28919         MonoReflectionType, not just from MonoObject.  Added `refobj' and
28920         `index' fields.
28921
28922         * reflection.c (mono_reflection_define_generic_parameter): Create
28923         and return a new MonoReflectionGenericParam; don't initialize the
28924         constraints here.
28925         (mono_reflection_initialize_generic_parameter): New public method;
28926         initializes the constraints and creates the `param->pklass'.
28927
28928 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
28929
28930         * reflection.h reflection.c: Use the new fields 'num_types', 
28931         'num_fields' and 'num_methods' to track the number of types etc.
28932
28933         * verify.c (check_corlib): Check corlib version number.
28934
28935 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
28936
28937         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
28938         function works on all methods.
28939
28940 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
28941
28942         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
28943         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
28944         the custom_type_info flag of the transparent proxy.
28945         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
28946         objects that supports IRemotingTypeInfo.
28947         * object.h: Added custom_type_info field in transparent proxy.
28948
28949 2003-12-06  Martin Baulig  <martin@ximian.com>
28950
28951         * class.c (mono_class_create_from_generic): Removed.
28952         (mono_class_from_generic): Check `ginst->klass' before doing
28953         anything else.  This is important to fully support "recursive"
28954         generic types.
28955
28956         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
28957         empty `generic_inst->klass' before doing anything else.
28958
28959 2003-12-06  Dick Porter  <dick@ximian.com>
28960
28961         * verify.c: 
28962         * object.h:
28963         * icall.c:
28964         * locales.c: Use C structs to access class fields.  Don't do a
28965         conversion between MonoString and UChar because both are
28966         platform-endian UTF-16.  Compare now takes startindex and count
28967         parameters.  Add a char overload for IndexOf.  Speed up the
28968         invariant string IndexOf.
28969
28970 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
28971
28972         * Makefile.am (monosn_LDADD): Fix parallel build.
28973
28974 2003-12-04  Martin Baulig  <martin@ximian.com>
28975
28976         * icall.c
28977         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28978         (ves_icall_Type_make_array_type): New interncall.       
28979
28980 2003-12-04  Martin Baulig  <martin@ximian.com>
28981
28982         * locales.c: also change it in the !HAVE_ICU case.
28983
28984 2003-12-04  Dick Porter  <dick@ximian.com>
28985
28986         * icall.c:
28987         * locales.c: construct_compareinfo is now in CompareInfo, not
28988         CultureInfo.
28989
28990 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
28991
28992         * image.c (mono_image_load_file_for_image): Cache loaded images in the
28993         image->files array.
28994
28995         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
28996         table as well.
28997
28998         * assembly.c (mono_assembly_load_references): Only load references
28999         once.
29000
29001         * class.c (mono_class_from_name): Avoid linear search of the 
29002         EXPORTEDTYPE table.
29003
29004         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
29005
29006 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
29007
29008         * image.h (MonoImage): Add 'field_cache' field.
29009
29010         * loader.c (mono_field_from_token): Cache field lookups.
29011         
29012         * reflection.c (mono_module_get_object): Fix name property.
29013
29014         * icall.c (ves_icall_get_enum_info): Update after changes to 
29015         mono_metadata_get_constant_index ().
29016
29017         * icall.c: Get rid of get_type_info icall, use a separate icall for
29018         each type property to avoid needless memory allocations. Fixes #51514.
29019
29020         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
29021         to avoid needless binary searches.
29022
29023         * class.c (class_compute_field_layout): Move the initialization of
29024         field->def_value to mono_class_vtable ().
29025
29026         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
29027         non-corlib types.
29028
29029         * object.c (mono_object_allocate): Make it inline.
29030
29031         * object.c (mono_object_allocate_spec): Make it inline.
29032         
29033 2003-12-02  Dick Porter  <dick@ximian.com>
29034
29035         * locales.c (create_NumberFormat): NumberFormatInfo construction.
29036         Patch by Mohammad DAMT (mdamt@cdl2000.com).
29037
29038 2003-12-01  Dick Porter  <dick@ximian.com>
29039
29040         * threads.c: Fix signature and call in CreateMutex and
29041         CreateEvent.
29042
29043 2003-12-01  Dick Porter  <dick@ximian.com>
29044
29045         * icall.c: 
29046         * locales.c: Implement string compares and searching
29047
29048         * object.h: Add extra Thread field
29049
29050 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
29051
29052         * reflection.c (fixup_method): Add support for MonoCMethod.
29053
29054 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
29055
29056         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
29057
29058         * reflection.c (assembly_name_to_aname): Allow extra characters in
29059         assembly names. Fixes #51468.
29060
29061 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
29062
29063         * exception.c (mono_exception_from_name_domain): New helper function.
29064
29065         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
29066         exception object in the correct domain.
29067
29068         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
29069         formatting + make a copy a the input data.
29070
29071         * loader.c (mono_get_method_from_token): Methods which contain
29072         native code do not have entries in the ImplMap.
29073
29074         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
29075         Thanks to Gonzalo for spotting this.
29076         
29077         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
29078         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
29079
29080         * assembly.h (mono_assembly_load_from): Split the second part of 
29081         assembly loading into a new public function.
29082
29083         * exception.h (mono_get_exception_bad_image_format): New function.
29084
29085 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
29086
29087         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
29088         Enumerate all modules inside a dynamic assembly. Fixes #51293.
29089         
29090         * icall.c: Add new icall for creating dynamic methods.
29091
29092         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
29093
29094         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
29095
29096         * reflection.c (mono_reflection_create_dynamic_method): New icall to
29097         create a dynamic method.
29098
29099         * reflection.c (resolve_object): New helper function.
29100
29101         * reflection.c: Generalize ReflectionMethodBuilder and the functions
29102         which manipulate it so they can also work on dynamic methods.
29103
29104         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
29105         creating the MonoReflectionMethodAux structure if it is not needed.
29106         
29107         * reflection.h verify.c: Update after changes to object layout.
29108
29109         * reflection.c (method_builder_encode_signature): Fix compilation on
29110         gcc 2.95.x.
29111
29112 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
29113
29114         * appdomain.h: Added support for context static fields. Added static_data
29115           field to MonoAppContext and renamed thread_static_fields to a more
29116           generic special_static_fields in MonoAppDomain, since it can now contain
29117           context static fields.
29118         * domain.c: Updated hashtable name.
29119         * object.c: Replaced field_is_thread_static() for a more generic
29120           field_is_special_static() which also checks for context static attribute.
29121           In mono_class_vtable(), added support for static context fields.
29122         * threads.c: Changed methods that manage thread static fields to more
29123           generic methods so they can be reused both for thread and context static
29124           data.
29125         * threads.h: Declared some new methods.
29126
29127 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
29128
29129         * reflection.h: Update after changes to the managed types.
29130
29131         * reflection.c (encode_custom_modifiers): New helper function.
29132
29133         * reflection.c (method_encode_signature): Emit custom modifiers.
29134
29135         * reflection.c (field_encode_signature): Emit custom modifiers.
29136
29137 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
29138
29139         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
29140
29141         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
29142         implementation.
29143
29144         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
29145         icall.
29146
29147         * object.c (mono_field_get_value_object): New function.
29148
29149         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
29150         specific.
29151
29152 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
29153
29154         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
29155         return a preallocated out-of-memory exception instance.
29156
29157         * object.c (out_of_memory): Use the new function.
29158
29159         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
29160         flag is before the custom modifiers. Fixes #49802.
29161
29162 2003-11-16  Martin Baulig  <martin@ximian.com>
29163
29164         * class.c (mono_class_is_open_constructed_type): Implemented the
29165         MONO_TYPE_GENERICINST case.
29166
29167 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
29168
29169         * assembly.c (mono_assembly_fill_assembly_name): New function to
29170         fill out the MonoAssemblyName structure.
29171         (mono_assembly_open): Use the new function.
29172
29173         * icall.c (fill_reflection_assembly_name): New helper function.
29174
29175         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
29176         new function.
29177
29178         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
29179
29180 2003-11-15  Martin Baulig  <martin@ximian.com>
29181
29182         * class.c (mono_class_is_open_constructed_type): New public
29183         function; checks whether a type is an open constructed type,
29184         ie. whether it still contains type parameters.
29185         (mono_class_inflate_generic_type): If we're a type parameter and
29186         the inflated type is also a MONO_TYPE_(M)VAR, return the original
29187         type.
29188
29189         * class.h (MonoGenericInst): Added `guint32 is_open'.
29190
29191         * loader.c (method_from_methodspec): Check whether we're an open
29192         or closed constructed type and set `ginst->is_open'.
29193
29194         * reflection.c (mono_reflection_bind_generic_parameters): Check
29195         whether we're an open or closed constructed type and set
29196         `ginst->is_open'.
29197         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
29198         from open constructed types.
29199
29200 2003-11-15  Martin Baulig  <martin@ximian.com>
29201
29202         * reflection.c (mono_reflection_bind_generic_parameters): If we're
29203         a generic instance (instead of a generic type declaration) with
29204         unbound generic parameters, bind them to our actual types.
29205
29206 2003-11-14  Martin Baulig  <martin@ximian.com>
29207
29208         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
29209
29210         * reflection.c (mono_reflection_bind_generic_parameters): If we're
29211         an interface type, populate `res->interfaces' with instantiated
29212         versions of all the interfaces we inherit.
29213
29214 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
29215
29216         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
29217         when MONO_PATH is set but doesn't contain the install dir.
29218
29219 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29220
29221         * icall.c:
29222         (ves_icall_Type_GetInterfaces): don't return an interface twice when
29223         it's also implemented in base classes. Fixes bug #50927.
29224
29225 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
29226
29227         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
29228         if this method is called from a finalizer. Fixes #50913.
29229
29230 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
29231
29232         * threads.c: Implement VolatileRead/VolatileWrite
29233
29234         * icall.c: Add new icalls for VolatileRead/VolatileWrite
29235
29236 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29237
29238         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
29239         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
29240         2.95.3.
29241
29242         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
29243         from Peter Ross (pro@missioncriticalit.com).
29244         
29245 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
29246
29247         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
29248
29249 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29250
29251         * assembly.c (mono_assembly_load_references): Disable check because it
29252         triggers on older corlibs which lots of people have.
29253
29254 2003-11-12  Jackson Harper  <jackson@ximian.com>
29255
29256         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
29257         load corlib.dll if mscorlib.dll is not found.
29258         * assembly.h: Remove corlib name define.
29259         * class.c:
29260         * domain.c:
29261         * image.c: Change corlib name to mscorlib.
29262         
29263 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29264
29265         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
29266
29267 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
29268
29269         * appdomain.h: Added loader_optimization here to sync with the C#
29270         code, and add disallow_binding_redirects field.
29271
29272 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
29273
29274         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
29275
29276         * reflection.c (mono_image_build_metadata): Fix crash on modules
29277         with no types.
29278
29279         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
29280
29281         * icall.c (ves_icall_get_method_info): Return callingConvention as
29282         well.
29283
29284         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
29285         namespaces from the EXPORTEDTYPE table as well.
29286
29287         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
29288         from all modules inside the assembly.
29289         
29290 2003-11-11  Martin Baulig  <martin@ximian.com>
29291
29292         * reflection.c (mono_reflection_bind_generic_parameters): Make
29293         this work for interfaces.
29294
29295 2003-11-11  Martin Baulig  <martin@ximian.com>
29296
29297         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
29298
29299 2003-11-11  Martin Baulig  <martin@ximian.com>
29300
29301         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
29302         "MonoInflatedMethod" and "MonoInflatedCtor".
29303
29304 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
29305
29306         * reflection.c (resolution_scope_from_image): Use the assembly table
29307         from the manifest module, since other modules don't have it.
29308
29309         * debug-helpers.c (mono_type_full_name): New helper function.
29310
29311         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
29312
29313         * image.c (mono_image_load_file_for_image): New public function which
29314         is a replacement for the load_file_for_image in class.c.
29315
29316         * assembly.c (mono_assembly_load_module): A wrapper for the function
29317         above which does assembly association and reference loading too.
29318
29319         * class.c (mono_class_from_name): Call mono_assembly_load_module.
29320
29321 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29322
29323         * appdomain.c: not all of the attributes for the full assembly name
29324         are required and the order doesn't matter. Fixes bug #50787.
29325
29326 2003-11-10  Dick Porter  <dick@ximian.com>
29327
29328         * locales.c: Use platform-endian UTF16
29329
29330 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29331
29332         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29333         
29334 2003-11-10  Martin Baulig  <martin@ximian.com>
29335
29336         * metadata.c
29337         (mono_metadata_load_generic_params): Make this actually work.
29338
29339         * reflection.c (mono_reflection_bind_generic_parameters): If our
29340         parent is a generic instance, pass all the `types' to it, no
29341         matter whether it has the same number of type parameters or not.
29342
29343 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29344
29345         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29346
29347         * assembly.c (mono_assembly_load_references): Move the image<->assembly
29348         assignment code to this function so it gets called recursively for all
29349         modules.
29350
29351         * image.c (load_modules): Remove the assembly assignment since it is
29352         now done by mono_assembly_load_references.
29353         
29354         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
29355         Add 'module' argument.
29356         (mono_module_get_types): New helper function.
29357         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
29358
29359 2003-11-08  Martin Baulig  <martin@ximian.com>
29360
29361         * class.c (mono_class_inflate_generic_method): Interface method
29362         don't have a header.
29363
29364         * reflection.c (mono_image_get_methodspec_token): Take an
29365         additional `MonoGenericInst *' argument instead of reading it from
29366         the header; this is necessary to support interfaces.
29367         (mono_image_create_token): Pass the `MonoGenericInst *' from the
29368         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
29369         (inflated_method_get_object): Take an additional `MonoGenericInst *'
29370         argument.
29371
29372         * reflection.h (MonoReflectionInflatedMethod): Added
29373         `MonoGenericInst *ginst'.
29374
29375 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
29376
29377         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
29378
29379 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
29380
29381         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
29382
29383 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
29384
29385         * reflection.c 
29386         (reflection_methodbuilder_from_method_builder):
29387         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
29388         initialize a ReflectionMethodBuilder structure.
29389         (mono_image_get_methodbuilder_token):
29390         (mono_image_get_ctorbuilder_token): New functions to emit memberref
29391         tokens which point to types in another module inside the same assembly.
29392
29393         * reflection.c: Use the new helper functions.
29394         
29395         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
29396
29397         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
29398         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
29399
29400         * reflection.c (resolution_scope_from_image): Emit a moduleref if
29401         neccesary.
29402
29403         * reflection.c (mono_image_build_metadata): Emit metadata only for the
29404         current module. Emit the manifest only for the main module.
29405
29406         * reflection.c (mono_image_create_token): Add assertion when a 
29407         memberref needs to be created.
29408
29409         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
29410
29411         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
29412         larger buffer for the custom attribute blob. Fixes #50637.
29413         
29414 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29415
29416         * threadpool.c: notify listener on async processing handles after
29417         invoking the async callback. Thanks to Zoltan.
29418
29419 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29420
29421         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
29422         avoid code duplication.
29423
29424         * reflection.h (MonoDynamicImage): New type which is currently unused,
29425         but will be used through the ref.emit code in place of 
29426         MonoDynamicAssembly.
29427
29428         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29429         object layout.
29430
29431         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
29432         a MonoDynamicImage instead of just a MonoImage.
29433         
29434         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
29435         icalls to ModuleBuilder but keep their semantics, so they will work
29436         with moduleb->assemblyb. This will change later.
29437         
29438 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29439
29440         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29441         object layout.
29442
29443         * reflection.c (mono_image_build_metadata): Avoid creation of a default
29444         main module, since it is now done by the managed code.
29445
29446 2003-11-03  Martin Baulig  <martin@ximian.com>
29447
29448         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
29449         `ginst->klass' here.
29450         (method_encode_methodspec): Don't use the `ginst->generic_method's
29451         klass if it's a generic instance, use `ginst->klass' in this case.
29452
29453 2003-11-03  Martin Baulig  <martin@ximian.com>
29454
29455         * reflection.c (mono_image_get_generic_method_param_info):
29456         Removed, use mono_image_get_generic_param_info() instead.
29457         (mono_image_get_type_info): Write the GenericParam table before
29458         the Method table.  This is neccessary because in the GenericParam
29459         table, type parameters of the class (ie. '!0' etc.) must come
29460         before the ones from its generic methods (ie. '!!0' etc).
29461
29462 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29463
29464         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
29465
29466 2003-11-02  Martin Baulig  <martin@ximian.com>
29467
29468         * reflection.c (create_generic_typespec): Take a
29469         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
29470         the generic parameters from it.
29471
29472 2003-11-02  Martin Baulig  <martin@ximian.com>
29473
29474         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
29475         instead of a `MonoClassField *' since we just need the type.
29476         (create_generic_typespec): New static function.  Creates a
29477         TypeSpec token for a generic type declaration.
29478         (mono_image_get_generic_field_token): New static function.
29479         (mono_image_create_token): If we're a FieldBuilder in a generic
29480         type declaration, call mono_image_get_generic_field_token() to get
29481         the token.
29482
29483 2003-11-02  Martin Baulig  <martin@ximian.com>
29484
29485         * reflection.h
29486         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
29487         `MonoReflectionGenericInst *declaring_type' and
29488         `MonoReflectionGenericInst *reflected_type' fields.
29489
29490         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
29491         `MonoReflectionGenericInst *declaring_type' and a
29492         `MonoReflectionGenericInst *reflected_type' argument instead of a
29493         single `MonoReflectionGenericInst *type' one.  Set
29494         `res->declaring_type' and `res->reflected_type' from them.
29495         (mono_reflection_inflate_field): Likewise.      
29496
29497 2003-11-02  Martin Baulig  <martin@ximian.com>
29498
29499         * class.c (mono_class_setup_vtable): Don't store generic methods
29500         in the vtable.  
29501
29502 2003-11-02  Martin Baulig  <martin@ximian.com>
29503
29504         * reflection.h (MonoReflectionGenericInst): Added
29505         `MonoReflectionType *declaring_type'.
29506
29507         * reflection.c (mono_reflection_bind_generic_parameters): Use
29508         `if (tb->parent)' instead of `klass->parent'.
29509
29510 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
29511
29512         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
29513         with an empty ASSEMBLY table.
29514
29515         * reflection.c (mono_image_build_metadata): Avoid using the same loop
29516         variable in the inner and outer loops.
29517
29518 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
29519
29520         * metadata.h (mono_metadata_make_token): Put parentheses around macro
29521         argument.
29522
29523         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
29524         
29525         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
29526         icalls. Instead, do everything in managed code. This is needed since
29527         it is hard to restore the original domain etc. in unmanaged code in the
29528         presence of undeniable exceptions.
29529
29530         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
29531         New icalls to push and pop appdomain refs.
29532
29533 2003-10-31  Martin Baulig  <martin@ximian.com>
29534
29535         * class.c (inflate_generic_type): Renamed to
29536         mono_class_inflate_generic_type() and made it public.
29537
29538         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
29539         New interncall.
29540
29541         * loader.c (mono_field_from_memberref): Also set the retklass for
29542         typespecs.
29543
29544         * fielder.c (mono_image_get_inflated_field_token): New static
29545         method; creates a metadata token for an inflated field.
29546         (mono_image_create_token, fixup_method): Added support for
29547         "MonoInflatedField".
29548         (fieldbuilder_to_mono_class_field): New static function.
29549         (mono_reflection_inflate_field): New public function.
29550
29551         * reflection.h
29552         (MonoReflectionGenericInst): Added `MonoArray *fields'.
29553         (MonoReflectionInflatedField): New typedef.     
29554
29555 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
29556
29557         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
29558         for Solaris and other platforms without s6_addr16
29559
29560 2003-10-30  Martin Baulig  <martin@ximian.com>
29561
29562         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
29563         argument instead of two.
29564         (mono_class_inflate_generic_signature): Likewise.
29565         (inflate_generic_header): Likewise.
29566         (mono_class_inflate_generic_method): Likewise.  In addition, if
29567         `ginst->klass' is set, it becomes the new `method->klass'.
29568
29569         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
29570         field.
29571
29572         * reflection.c (encode_generic_method_sig): Write a 0xa as the
29573         first byte. [FIXME]
29574         (method_encode_methodspec): If we have generic parameters, create
29575         a MethodSpec instead of a MethodRef.
29576         (fixup_method): Added support for "MonoInflatedMethod" and
29577         "MonoInflatedCtor".
29578         (mono_image_create_token): Added support for "MonoInflatedMethod"
29579         and "MonoInflatedCtor".
29580         (inflated_method_get_object): New static function; returns a
29581         managed "System.Reflection.MonoInflatedMethod" object.
29582         (mono_reflection_bind_generic_method_parameters): Return a
29583         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
29584         (mono_reflection_inflate_method_or_ctor): Likewise.
29585         (mono_image_get_generic_method_param_info): Initialize unused
29586         fields to zero.
29587         (mono_image_get_generic_param_info): Likewise.
29588
29589         * reflection.h (MonoReflectionInflatedMethod): New public
29590         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
29591         "S.R.MonoInflatedCtor" classes.
29592
29593         * loader.c (method_from_memberref): If we're a TypeSpec and it
29594         resolves to a generic instance, inflate the method.
29595
29596 2003-10-28  Dick Porter  <dick@ximian.com>
29597
29598         * object.c (mono_runtime_run_main): Convert command-line arguments
29599         into utf8, falling back to the user's locale encoding to do so.
29600
29601 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
29602
29603         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
29604         at this time.
29605
29606         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
29607
29608         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
29609         up icalls at method definition time. Partially fixes #33569.
29610
29611 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
29612
29613         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
29614         marshalling of arrays. Fixes #50116.
29615
29616         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
29617
29618         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
29619         points to a vtable in the dying appdomain.
29620
29621         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
29622         listeners into unmanaged code inside the lock.
29623
29624         * object.c (mono_class_vtable): Turn off typed allocation in non-root
29625         domains and add some comments.
29626
29627 2003-10-25  Martin Baulig  <martin@ximian.com>
29628
29629         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
29630
29631         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
29632
29633         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
29634         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
29635         currently parsing.  Create the generic class and store it in
29636         `generic_inst->klass' before parsing the type arguments.  This is
29637         required to support "recursive" definitions; see mcs/tests/gen-23.cs
29638         for an example.
29639         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
29640         to support recursive typespec entries.
29641
29642         * class.c (mono_class_setup_parent): If our parent is a generic
29643         instance, we may get called before it has its name set.
29644         (mono_class_from_generic): Splitted into
29645         mono_class_create_from_generic() and mono_class_initialize_generic().
29646
29647 2003-10-25  Martin Baulig  <martin@ximian.com>
29648
29649         * icall.c (ves_icall_Type_BindGenericParameters): Return a
29650         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
29651         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
29652         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
29653
29654         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
29655         (create_typespec): Likewise.
29656         (mono_reflection_bind_generic_parameters): Return a
29657         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
29658         (mono_reflection_inflate_method_or_ctor): New public function.
29659
29660         * reflection.h (MonoReflectionGenericInst): New typedef.        
29661
29662 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
29663
29664         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
29665         inside the domain lock. Fixes #49993.
29666         
29667         * object.c (mono_class_vtable): When typed allocation is used, 
29668         allocate vtables in the GC heap instead of in the mempool, since the
29669         vtables contain GC descriptors which are used by the collector even
29670         after the domain owning the mempool is unloaded.
29671
29672         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
29673
29674         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
29675         reflect what it does. Also invalidate mempools instead of freeing
29676         them if a define is set.
29677
29678         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
29679         of the appdomain.
29680         
29681         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
29682         hold the finalizable objects in this domain.
29683
29684         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
29685         appdomain.
29686
29687         * appdomain.c (mono_domain_set): New function to set the current
29688         appdomain, but only if it is not being unloaded.
29689
29690         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
29691         appdomain which is being unloaded.
29692         
29693         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
29694         unloading of the root appdomain.
29695
29696         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
29697         icall to execute a method in another appdomain. Intended as a 
29698         replacement for InternalSetDomain, which can confuse the code 
29699         generation in the JIT.
29700
29701         * appdomain.c (mono_domain_is_unloading): New function to determine
29702         whenever an appdomain is unloading.
29703
29704         * appdomain.c (mono_domain_unload): New function to correctly unload
29705         an appdomain.
29706
29707         * assembly.c (mono_assembly_load_references): Check that an assembly
29708         does not references itself.
29709
29710         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
29711         domain manually, it asks the finalizer thread to do it, then waits for
29712         the result. Also added a timeout.
29713
29714         * icall.c: Register the new icalls.
29715
29716         * threads.h threads.c: Export the mono_gc_stop_world and 
29717         mono_gc_start_world functions.
29718         
29719         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
29720         function to fill out the mempool with 0x2a.
29721
29722 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
29723
29724         * reflection.h (MonoReflectionMethodAux): New structure to store
29725         information which is rarely used, thus is not in the MonoMethod
29726         structure.
29727
29728         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
29729         store the aux info.
29730
29731         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
29732         and marshalling info into the aux structure.
29733
29734         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
29735         from the aux structure.
29736
29737         * loader.c (mono_method_get_param_names): Retrieve the param names from
29738         the aux structure.
29739         
29740 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
29741
29742         * exception.h exception.c: Add AppDomainUnloadedException && fix 
29743         warning.
29744
29745 2003-10-21  Dick Porter  <dick@ximian.com>
29746
29747         * socket-io.c
29748         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
29749         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
29750
29751 2003-10-21  Martin Baulig  <martin@ximian.com>
29752
29753         * reflection.c (mono_reflection_bind_generic_parameters):
29754         `klass->parent' is NULL for interfaces.
29755
29756 2003-10-21  Martin Baulig  <martin@ximian.com>
29757
29758         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
29759
29760 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
29761
29762         * exception.c (mono_exception_from_name_msg): New helper function for
29763         creating exceptions and initializing their message field.
29764
29765         * exception.c: Simplify functions using the new helper.
29766
29767         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
29768         New function.
29769
29770         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
29771         mono_raise_exception, since otherwise gcc doesn't generate the function
29772         epilog for raise_exception, confusing the stack unwinding in the JIT.
29773         Fixes #45043.
29774
29775         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
29776         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
29777         Fixes #49499.
29778
29779 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29780
29781         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
29782         utf8.
29783
29784 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
29785
29786         * icall.c: Removed GetUninitializedObject method because
29787           AllocateUninitializedClassInstance does the same.
29788
29789 2003-10-18  Martin Baulig  <martin@ximian.com>
29790
29791         * class.c (inflate_generic_signature): Renamed to
29792         mono_class_inflate_generic_signature() and made it public.
29793         (my_mono_class_from_generic_parameter): New static function; if we
29794         don't already have the generic parameter's MonoClass, create a
29795         very simple one which is just used internally in the runtime and
29796         not passed back to managed code.
29797
29798         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
29799
29800         * metadata.h (MonoMethodSignature): Moved the
29801         `MonoGenericParam *gen_params' to the MonoMethodHeader.
29802         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
29803
29804         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
29805         ves_icall_MonoMethod_GetGenericArguments(); this is now an
29806         interncall on the MonoMethod class, not on MethodInfo.
29807         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
29808         calling mono_reflection_bind_generic_method_parameters() directly.
29809
29810         * loader.c (mono_method_get_signature): If this is a MethodSpec;
29811         return the already computed `method->signature'.
29812         (method_from_methodspec): New static function to load a method
29813         from a MethodSpec entry.
29814         (mono_get_method_from_token): Call the new method_from_methodspec()
29815         for MethodSpec tokens.  
29816         (mono_get_method_from_token): If we're a generic method, load the
29817         type parameters.
29818
29819         * reflection.c (mono_image_get_memberref_token): Allow
29820         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
29821         table.
29822         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
29823         (mono_image_create_token): First check whether it's a generic
29824         method (so we'd need to create a MethodSpec), then do the other
29825         two alternatives.
29826         (mono_reflection_bind_generic_method_parameters): Return a
29827         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
29828         called directly from the interncall.
29829
29830 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
29831
29832         * reflection.c (load_public_key): Move loading of the public key
29833         into managed code.
29834
29835         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
29836
29837         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
29838         fields.
29839
29840         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
29841         culture, hash_alg and public_key. Fixes #49555.
29842
29843 2003-10-17  Martin Baulig  <martin@ximian.com>
29844
29845         * class.h (MonoGenericInst): Moved this declaration here and added
29846         `MonoMethod *generic_method'.
29847
29848         * icall.c
29849         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
29850         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
29851
29852         * metadata.c (mono_metadata_type_equal): Two types of
29853         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
29854         index; ie. don't compare the address of the `MonoGenericParam'
29855         structure.
29856         (mono_metadata_load_generic_params): Removed the `MonoMethod
29857         *method' argument.
29858
29859         * metadata.h (MonoGenericInst): Moved declaration to class.h.
29860         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
29861
29862         * reflection.c (method_encode_signature): Encode the number of
29863         generic parameters.
29864         (encode_generic_method_sig): New static function.
29865         (method_encode_methodspec): New static function; creates an entry
29866         in the MethodSpec table for a generic method.
29867         (mono_image_get_methodspec_token): New static function.
29868         (mono_image_create_token): Call mono_image_get_methodspec_token()
29869         for generic methods.
29870         (mono_reflection_bind_generic_method_parameters): New public
29871         function.  Instantiates a generic method.
29872
29873 2003-10-16  Martin Baulig  <martin@ximian.com>
29874
29875         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
29876         *gen_params' here from MonoMethodHeader.
29877
29878         * metadata.c (mono_metadata_parse_method_signature): If we have
29879         generic parameters, initialize `method->gen_params' and then set
29880         the correct `type->data.generic_param' in all the parameters.
29881
29882 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
29883
29884         * threads.c (mono_threads_get_default_stacksize): New function to 
29885         return the default stacksize.
29886
29887         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
29888         termination of the finalizer thread, since the previous method had
29889         race conditions. Fixes #49628.
29890
29891         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
29892         as for the other managed threads.
29893
29894 2003-10-16  Martin Baulig  <martin@ximian.com>
29895
29896         * class.c (inflate_generic_signature): Copy `generic_param_count'
29897         and `gen_params'.
29898
29899         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
29900         New interncall.
29901
29902         * metadata.c (mono_metadata_parse_method_signature): Actually set
29903         the `method->generic_param_count' here.
29904         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
29905
29906 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
29907
29908         * object.h: Add a new field to TypedRef to simplify the implementation
29909         of the REFANY opcodes in the JIT.
29910
29911         * icall.c: Make use of the new field.
29912
29913         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
29914         dynamically.
29915
29916 2003-10-15  Martin Baulig  <martin@ximian.com>
29917
29918         * class.c (mono_class_from_gen_param): Renamed to
29919         mono_class_from_generic_parameter() and moved most of the
29920         functionality from mono_reflection_define_generic_parameter()
29921         here; ie. we create a "real" class here.
29922         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
29923         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
29924         previously been called.
29925
29926         * class.h (MonoGenericParam): Moved the declaration of this struct
29927         here from metadata.h and added `MonoMethod *method'.
29928
29929         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
29930         interncall.
29931
29932         * loader.c (mono_get_method_from_token): If we have any generic
29933         parameters, call mono_metadata_load_generic_params() to read them
29934         from the MONO_TABLE_GENERICPAR.
29935
29936         * metadata.c (mono_metadata_load_generic_params): Added
29937         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
29938
29939         * metadata.h (MonoMethodSignature): Replaced
29940         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
29941         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
29942
29943         * reflection.c (mono_reflection_define_generic_parameter): Moved
29944         most of the functionality into the new
29945         mono_class_from_generic_parameter(); set the `method' field if
29946         we're a method parameter.       
29947
29948 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
29949
29950         * marshal.c (emit_struct_conv): if native size is 0
29951         emit no code.
29952
29953 2003-10-14  Martin Baulig  <martin@ximian.com>
29954
29955         * icall.c: The generics API has changed in the spec since it was
29956         added to System.Type; these modifications make it match the spec
29957         again.
29958         (ves_icall_Type_GetGenericParameters): Renamed to
29959         `ves_icall_Type_GetGenericArguments'.
29960         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
29961         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
29962         `ves_icall_MonoType_get_HasGenericArguments'.
29963         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
29964         `ves_icall_MonoType_get_IsGenericParameter'.
29965         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
29966         this is no interncall anymore.
29967         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
29968         `ves_icall_TypeBuilder_get_IsGenericParameter'.
29969
29970 2003-10-14  Martin Baulig  <martin@ximian.com>
29971
29972         * reflection.c (mono_reflection_bind_generic_parameters): Also
29973         inflate generic methods if we're reading the class from IL.
29974
29975 2003-10-13  Martin Baulig  <martin@ximian.com>
29976
29977         * reflection.c (mono_reflection_define_generic_parameter): This
29978         method isn't called directly from the icall anymore; take a
29979         `MonoReflectionAssemblyBuilder *' so we can use this for type and
29980         method generic parameters.
29981         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
29982         (method_builder_encode_signature): Encode generic parameters.
29983         (mono_image_get_method_info): Write generic params to the
29984         MONO_TABLE_GENERICPARAM table.
29985
29986         * reflection.h (MonoReflectionMethodBuilder): Added
29987         `MonoArray *generic_params'.
29988
29989         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
29990
29991         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
29992         wrapper for mono_reflection_define_generic_parameter().
29993         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
29994
29995 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
29996
29997         * marshal.h: Add missing function to fix build.
29998
29999         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
30000         the SetLastError pinvoke attribute.
30001
30002         * marshal.c (mono_marshal_set_last_error): New helper function called
30003         by the generated code.
30004         
30005         * marshal.c (mono_mb_emit_branch): New helper function.
30006
30007         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
30008
30009         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
30010         classes as parameters and return values of delegates. Fixes #29256. 
30011
30012 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
30013
30014         * locales.c: use gint32 in non HAVE_ICU case
30015
30016 2003-10-11  Martin Baulig  <martin@ximian.com>
30017
30018         * mono-debug.c (mono_debug_add_method): Added a workaround for
30019         bug #48591.
30020
30021 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
30022
30023         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
30024         delegates passed to native code must use the STDCALL calling 
30025         convention. Fixes #35987.
30026
30027 2003-10-10  Martin Baulig  <martin@ximian.com>
30028
30029         * class.c (inflate_generic_type): If we're inflating for a generic
30030         type instance (and not for a generic method), return
30031         MONO_TYPE_MVAR unchanged.
30032
30033 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30034
30035         * string-icalls.c: Join ignores null strings in the source array.
30036         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
30037         * threads.c: GetAvailableTheads is slightly more accurate.
30038
30039 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
30040
30041         * threads.h threads.c : add mono_threads_set_default_stacksize
30042         and pass default to CreateThread calls.
30043
30044 2003-10-09  Dick Porter  <dick@ximian.com>
30045
30046         * icall.c:
30047         * locales.h:
30048         * locales.c: Internal calls for constructing CultureInfo and
30049         related objects from libicu (if its available.)
30050
30051 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
30052
30053         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
30054
30055 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30056
30057         * threadpool.c: added an argument to async_invoke_thread that is the
30058         item to process, pass the MonoAsyncResult to the thread start function
30059         when creating a new thread. This way we don't need to acquire any lock
30060         when we're creating a new thread. Readded a semaphore for faster
30061         response times (instead of that Sleep i added).
30062
30063 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
30064
30065         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
30066         get daylight change dates better on Windows, fix handling
30067         of platforms without tm_gmtoff.
30068
30069 2003-10-06  Martin Baulig  <martin@ximian.com>
30070
30071         * class.c (inflate_generic_method): Renamed to
30072         mono_class_inflate_generic_method() and made public.
30073         (mono_class_init): Don't inflate the generic methods here.
30074         (mono_class_from_generic): Added `gboolean inflate_methods'
30075         argument.  Inflate the methods here.
30076
30077         * loader.c (mono_method_get_param_names): Ignore instances of
30078         generic types for the moment.
30079
30080         * reflection.c (fixup_method): Added support for inflated methods.
30081         (mono_image_create_token): Use mono_image_get_methodref_token()
30082         for inflated methods.
30083         (mono_custom_attrs_from_param): Ignore instances of generic types
30084         for the moment.
30085         (mono_reflection_bind_generic_parameters): New public function.
30086         Moved all the functionality from
30087         ves_icall_Type_BindGenericParameters() here and added support for
30088         dynamic types.
30089         (mono_reflection_define_generic_parameter): Initialize
30090         `klass->methods' here.
30091
30092         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
30093         functionality into mono_reflection_define_generic_parameter().
30094         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
30095         TypeBuilder, return that TypeBuilder.
30096
30097 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30098
30099         * appdomain.c: removed mono_delegate_semaphore.
30100
30101         * threadpool.c:
30102         (mono_thread_pool_add): moved hash table creation inside and the thread 
30103         creation outside of the critical region.
30104         (mono_thread_pool_finish): removed obsolete code.
30105         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
30106         continue or exit the thread depending on the queue.
30107
30108 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
30109
30110         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
30111         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
30112         handle more bool marshalling options
30113
30114 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
30115
30116         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
30117         arrays of structs. Also add a more descriptive error message when
30118         a structure member is marshalled as LPArray.
30119
30120 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
30121
30122         * marshal.c (mono_marshal_get_native_wrapper): Add support for
30123         marshalling arrays of complex types. Fixes #29098. Also remove an
30124         usused and incomplete function.
30125
30126 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
30127
30128         * gc.c: report heap_size - free_bytes as total memory allocated
30129         (bug#49362).
30130
30131 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
30132
30133         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
30134         fix timezone handling problems on Windows.
30135         
30136         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
30137         asserts when the year is outside the range handled by ms the functions.
30138
30139         * class.c (setup_interface_offsets): If the class is an interface,
30140         fill out its interface_offsets slot.
30141
30142 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30143
30144         * threadpool.c: mark threadpool threads as background.
30145
30146 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
30147
30148         * decimal.c - define DECINLINE to nothing if not using GCC
30149
30150 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
30151
30152         * assembly.c: More refcount fixes.
30153
30154 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30155
30156         * string-icalls.c: if we're not trimming, return the same string.
30157         When not splitting, don't create a new string.
30158
30159 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30160
30161         * image.c:
30162         (mono_image_open): increment the ref_count inside the critical section.
30163
30164 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
30165
30166         * image.c (mono_image_open): Fix reference counting bug.
30167
30168 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
30169
30170         * marshal.c (mono_marshal_type_size) struct alignment changed for 
30171         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
30172         64bits. Avoid leak in mono_marshal_get_native_wrapper when
30173         mono_lookup_pinvoke_call throws.        
30174
30175 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
30176
30177         * reflection.c (mono_reflection_parse_type): Fix #49114.
30178
30179         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
30180         temporary workaround for cygwin header problem.
30181
30182         * object.c (mono_object_isinst): Synchronize this with the code
30183         generated by the JIT for casts.
30184
30185 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
30186
30187         * reflection.c (encode_type): Fix #38332.
30188
30189 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
30190
30191         * marshal.c (mono_marshal_method_from_wrapper): New function to return
30192         the original method from the wrapper method.
30193
30194 2003-09-25  Martin Baulig  <martin@ximian.com>
30195
30196         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
30197         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
30198         (ves_icall_Type_get_IsGenericInstance): New interncall.
30199
30200 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
30201
30202         * object.c: fix cast warning in big endian code.
30203
30204 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
30205
30206         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
30207         
30208 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30209
30210         * assembly.c: don't call check_env from mono_assembly_load. It's
30211         already done once in mono_assemblies_init and may cause headaches when
30212         multiple threads are loading assemblies.
30213
30214 2003-09-19  Martin Baulig  <martin@ximian.com>
30215
30216         * reflection.c (mono_reflection_define_generic_parameter): Don't
30217         allocate `klass->methods', set `klass->flags' to
30218         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
30219
30220 2003-09-18  Martin Baulig  <martin@ximian.com>
30221
30222         * class.c (mono_class_init): Don't create `class->methods' if it's
30223         already initialized.
30224
30225         * metadata.c (mono_metadata_load_generic_params): Make this
30226         actually work.
30227
30228         * reflection.c (mono_reflection_define_generic_parameter): Set
30229         parent class and interfaces from the constraints.
30230
30231         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
30232         to keep this struct in sync with the declaration in TypeBuilder.cs.
30233
30234 2003-09-17  Martin Baulig  <martin@ximian.com>
30235
30236         * metadata.h (MonoType): Replaced the data's `int type_param'
30237         field with `MonoGenericParam *generic_param'.
30238         (MonoGenericParam): Added `MonoClass *klass'.
30239
30240         * class.c (mono_class_from_gen_param): Removed the
30241         `MonoImage *image' and `int type_num' arguments.
30242
30243         * metadata.c (mono_metadata_parse_generic_param): New static
30244         method; creates a MonoGenericParam which just contains the index.
30245         (do_mono_metadata_parse_type): Call
30246         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
30247         MONO_TYPE_MVAR.
30248
30249         * reflection.c (mono_image_typedef_or_ref): Generic type
30250         parameters may be in the same assembly, but never use a typedef
30251         for them.
30252         (mono_reflection_define_generic_parameter): We're now creating a
30253         "real" class for the type parameter; it's now safe to call
30254         mono_class_from_mono_type() on the class'es type, it'll do the
30255         right thing.
30256
30257 2003-09-16  Martin Baulig  <martin@ximian.com>
30258
30259         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
30260         `symfile->range_entry_size' and `symfile->class_entry_size' here;
30261         the `symfile' data structure must be fully initialized before it
30262         gets added to the table.
30263
30264 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
30265
30266         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
30267
30268         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
30269         class init trampolines.
30270
30271 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
30272
30273         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
30274         to the built-in profiler to turn off time and allocation profiling
30275         respectively.
30276
30277 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
30278
30279         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
30280         g_direct_equal.
30281
30282         * debug-helpers.c (mono_method_full_name): Print the wrapper type
30283         in human readable form.
30284
30285 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
30286
30287         * reflection.c icall.c: Fixed warnings.
30288
30289         * image.c (load_class_names): Use a temporary hash table to hold the
30290         namespaces in order to avoid doing many string comparisons.
30291
30292         * image.h: Fix typo.
30293
30294         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
30295         Pass NULL instead of g_direct_equal to the GHashTable constructor 
30296         since the NULL case is short-circuited inside g_hash_table_lookup, 
30297         leading to better performance.  
30298
30299         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
30300         obtain the first custom attribute for a given index. Depends on the
30301         CustomAttribute table being sorted by the parent field.
30302
30303         * reflection.c (mono_custom_attrs_from_index): Use the new function 
30304         for better performance.
30305
30306 2003-09-07  Martin Baulig  <martin@ximian.com>
30307
30308         * class.c (mono_class_init): If we're a generic instance, inflate
30309         all our methods instead of loading them from the image.
30310         (mono_class_from_generic): Set `class->methods = gklass->methods'.
30311
30312 2003-09-07  Martin Baulig  <martin@ximian.com>
30313
30314         * mono-debug-debugger.c: Added support for constructors.
30315
30316 2003-09-06  Martin Baulig  <martin@ximian.com>
30317
30318         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
30319         New interncall.
30320
30321         * reflection.c (mono_reflection_setup_generic_class): Call
30322         ensure_runtime_vtable() to create the vtable.
30323
30324 2003-09-05  Martin Baulig  <martin@ximian.com>
30325
30326         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
30327         MONO_TYPE_MVAR.
30328
30329 2003-09-04  Martin Baulig  <martin@ximian.com>
30330
30331         * reflection.c (mono_reflection_define_generic_parameter): Generic
30332         parameters start with zero.
30333
30334 2003-09-04  Martin Baulig  <martin@ximian.com>
30335
30336         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
30337
30338         * reflection.h (MonoReflectionGenericParam): New typedef.
30339         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
30340         the generic parameters from the managed TypeBuilder.
30341
30342         * reflection.c (mono_reflection_define_generic_parameter): New function.
30343         (mono_reflection_create_runtime_class): Encode generic parameters.
30344         (mono_reflection_setup_generic_class): New function; this is
30345         called after adding adding all generic params to the TypeBuilder.
30346         (encode_type): Added MONO_TYPE_VAR.
30347
30348 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
30349
30350         * class.h class.c (mono_class_needs_cctor_run): Moved this method
30351         here from the JIT.
30352
30353         * assembly.h assembly.c: Moved the AOT loading code into an assembly
30354         load hook.
30355
30356 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
30357
30358         * reflection.h reflection.c class.h class.c: Delete duplicate 
30359         definition of mono_type_get_name () from reflection.c and export the
30360         one in class.c.
30361
30362         * class.c: Class loading fixes from Bernie Solomon 
30363         (bernard@ugsolutions.com).
30364
30365         * reflection.c: Endianness fixes from Bernie Solomon 
30366         (bernard@ugsolutions.com).
30367         
30368 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
30369
30370         * assembly.h assembly.c: Define a file format version for AOT
30371         libraries.
30372         
30373         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
30374
30375         * appdomain.h (MonoJitInfo): New field to determine whenever the
30376         code is domain neutral.
30377         
30378 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
30379
30380         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
30381
30382 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
30383
30384         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
30385         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
30386         Avoid caching the result since strings must be domain specific. Fixes
30387         #48050.
30388
30389 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
30390
30391         * marshal.c (mono_marshal_init): Make this callable multiple times
30392         since it is hard to find a correct place to call it.
30393
30394         * object.c (mono_runtime_class_init): Execute static constructors in
30395         the correct appdomain.
30396
30397         * image.c (build_guid_table): Handle the case when multiple images have
30398         the same GUID.
30399
30400 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30401
30402         * icall.c: added a couple of icalls for System.Web.
30403
30404 2003-08-28  Martin Baulig  <martin@ximian.com>
30405
30406         * icall.c (ves_icall_Type_BindGenericParameters): Use
30407         `klass->generic_inst' instead of `&klass->byval_arg' in the
30408         mono_type_get_object() call.  The returned type must be
30409         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
30410
30411 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
30412
30413         * NOTES: New file.
30414
30415         * object.c (mono_class_proxy_vtable): Make it thread safe.
30416
30417         * pedump.c: Fix warning.
30418
30419         * object.c appdomain.h: Get rid of metadata_section. 
30420         It is no longer needed and it was causing deadlocks with domain->lock.
30421
30422         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
30423
30424 2003-08-26  Martin Baulig  <martin@ximian.com>
30425
30426         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
30427
30428 2003-08-26  Martin Baulig  <martin@ximian.com>
30429
30430         * pedump.c (main): Call mono_metadata_init(),
30431         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
30432         and mono_loader_init().
30433
30434 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
30435
30436         * loader.h: Add missing include to fix build.
30437
30438         * image.h: mono_image_load_references is no more.
30439
30440         * assembly.c: Reworked assembly loading to make it really thread safe.
30441         After these changes, the assembly returned by mono_assembly_open is
30442         fully initialized, i.e. all its references assemblies are loaded.
30443
30444         * assembly.c (mono_image_load_references): Renamed to 
30445         mono_assembly_load_references, and made private, since clients no
30446         longer need to call it.
30447
30448         * class.c: Removed calls to mono_assembly_load_references, since it was
30449         a source of deadlocks.
30450
30451         * loader.h loader.c class.h class.c: Protect data structures using a 
30452         new lock, the loader lock.
30453
30454         * class.c (mono_class_setup_vtable): Create temporary hash tables and
30455         GPtrArrays only when needed.
30456
30457         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
30458         into empty structures by mcs. Fixes pinvoke7.cs.
30459         
30460         * domain.c (mono_init): Call a new initialization function.
30461
30462         * appdomain.c (mono_runtime_init): Call the new initializer function
30463         of the marshal module.
30464
30465         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
30466         inserted into empty structures by mcs. Fixes pinvoke7.cs.
30467
30468         * marshal.h marshal.c: Added locks around the wrapper caches to make
30469         this module thread safe.
30470
30471         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
30472         this argument. Fixes pinvoke1.exe.
30473
30474 2003-08-25  Lluis Sanchez <lluis@ximian.com>
30475
30476         * object.h: Added call_type field to MonoMethodMessage and the corresponding
30477         enumeration of values. Removed fields to store remote call output values in
30478         MonoAsyncResult. Not needed any more.
30479         * object.c: Initialize call_type and async_result fields in mono_message_init.
30480         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
30481         dispatching the message.
30482         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
30483         async call to finish. To do it use a message with EndInvoke call type.
30484
30485 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
30486
30487         * loader.h loader.c (mono_method_hash_marhal_info): New function which
30488         determines whenever a method has marshalling info.
30489
30490 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30491
30492         * assembly.c: fix the build on windows.
30493
30494 2003-08-22 Lluis Sanchez <lluis@ximian.com>
30495
30496         * object.cs: Fixed bug #47785.
30497
30498 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
30499
30500         * string-icalls.c (StringReplace): If their are no occurances of
30501         the old string found return a reference to the supplied
30502         string. This saves some memory and matches MS behavoir.
30503         
30504 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30505
30506         * socket-io.c: fixed compilation for systems that define AF_INET6
30507         and don't define SOL_IP/SOL_IPV6.
30508
30509 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
30510
30511         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
30512         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
30513
30514         * rawbuffer.c rawbuffer.h: Make this module thread safe.
30515
30516         * domain.c: Make this module thread safe.
30517
30518         * domain.c (mono_init): Call new initialization function.
30519
30520         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
30521         reference types too. Fixes #38812.
30522
30523         * image.c (mono_image_init): Fixed warnings.
30524
30525         * class.c (mono_class_from_typeref): Handle assembly load failure
30526         correctly.
30527
30528         * appdomain.c (add_assemblies_to_domain): Handle the case when
30529         the references of an assembly are not yet loaded.
30530
30531         * metadata.c image.c assembly.c: Moved initialization of global
30532         variables to a separate function called at startup since lazy 
30533         initialization of these variables is not thread safe.
30534         
30535         * image.c assembly.c: Made this module thread safe by adding locks in 
30536         the appropriate places.
30537
30538         * domain.c (mono_init): Call the new initialization functions of the
30539         three modules.
30540
30541 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
30542
30543         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
30544           make a direct call. It is proxy's work to make the call asynchronous.
30545           mono_delegate_end_invoke(): If the targe is a proxy, just collect
30546           the return values.
30547         * object.cs: mono_method_call_message_new(): read AsyncResult and
30548           state object from parameters list, if this info is requested.
30549         * object.h: Added fields to store remote call output values in
30550           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
30551
30552 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30553
30554         * object.h: add needed fields to MonoThread.
30555         * threads.c, threads.h: allow registering a function to cleanup data
30556         allocated per thread by the JIT.
30557
30558 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30559
30560         * loader.h: portability fix by Bernie Solomon
30561         * <bernard@ugsolutions.com>.
30562
30563 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
30564
30565         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
30566         return a MonoArray. This simplifies the code and also ensures that
30567         the cache allways contains an object reference as a value.
30568
30569         * icall.c (ves_icall_get_parameter_info): Simplified using the new
30570         function.
30571
30572 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30573
30574         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
30575         fixes a problem with byte ordering when getting the address family for
30576         a socket.
30577
30578 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
30579
30580         * .cvsignore: Added monosn.
30581
30582         * reflection.h reflection.c loader.c: Added support for parameter
30583         marshalling to dynamically created types. Fixes #47295.
30584
30585 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
30586
30587         * rand.c: remove useless warnings.
30588
30589 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30590
30591         * class.c: implemented ldtoken for methods and fieldrefs.
30592
30593 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30594
30595         * threadpool.c: when mono_async_invoke was called, no one took care of
30596         monitoring the queue. So if the method invoked took some time and we
30597         got new async invoke requests after 500 ms (the thread created waited
30598         that long in WaitForSingleObject), the new async invoke was not called
30599         until the previous one finished.
30600
30601         This is fixed now. Thanks to Totte for helping with it.
30602
30603 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30604
30605         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
30606
30607 2003-08-11  Martin Baulig  <martin@ximian.com>
30608
30609         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
30610
30611 2003-08-06  Martin Baulig  <martin@ximian.com>
30612
30613         * mono-debug-debugger.c: Added support for static fields,
30614         properties and methods.
30615
30616 2003-08-06  Martin Baulig  <martin@ximian.com>
30617
30618         * mono-debug-debugger.c: Don't store the MonoString's vtable to
30619         make this work for applications with multiple application domains.
30620
30621 2003-08-04  Martin Baulig  <martin@ximian.com>
30622
30623         * mono-debug-debugger.c: Completely reworked the type support; the
30624         most important thing is that we're now just using one single
30625         `MonoType' instance per type.
30626
30627 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
30628
30629         * mono-endian.h, mono-endian.c, icall.c: Added icall
30630         ves_icall_System_Double_AssertEndianity to assert double word endianity
30631         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
30632
30633 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30634
30635         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
30636         support, icalls and fixes.
30637
30638 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
30639
30640         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
30641         classes that are a punctuation character in .NET is not the same a
30642         g_unichar_ispunct.
30643
30644 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30645
30646         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
30647
30648 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
30649
30650         * icall.c: Add new MemCopy internalcall.
30651         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
30652         Simplified code; It is not necessary to handle all the cases here,
30653         as the C# code takes care of it.  Only handle the case of the name
30654         resource embedded into the assembly.
30655
30656         Changed signature to return the data pointer and the size of the
30657         data. 
30658
30659 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
30660
30661         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
30662         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
30663
30664 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30665
30666         * socket-io.c: ignore EINTR error in select.
30667
30668 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
30669
30670         * class.h, class.c: removed unused subclasses field in MonoClass.
30671
30672 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30673
30674         * icall.c: improve fix of get_base_definition(). If the parent class
30675           doesn't have the mehod, look at the parent of the parent.
30676         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
30677           to check if a parameter is an in or out parameter
30678           (PARAM_ATTRIBUTE_IN is not set by default).
30679           mono_method_return_message_restore(): Use mono_class_value_size to
30680           get the size of a value type. mono_type_stack_size (parameterType)
30681           does not return the correct value if parameterType is byRef.
30682           mono_load_remote_field(), mono_load_remote_field_new(),
30683           mono_store_remote_field(), mono_store_remote_field_new():
30684           raise exception if the remote call returns an exception.
30685
30686 2003-07-28  Martin Baulig  <martin@ximian.com>
30687
30688         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
30689         method.  This is a wrapper around mono_runtime_invoke() which
30690         boxes the instance object if neccessary.
30691
30692 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30693
30694         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
30695         metadata.h, row-indexes.h, verify.c: first cut of generics support.
30696
30697 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30698
30699         * icall.c: disable mcs bug workaround.
30700
30701 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
30702
30703         * object.c (mono_runtime_class_init): Take the metadata_section
30704         mutex before obtaining the domain mutex.
30705
30706         * appdomain.h: Added definition of metadata_section mutex here. 
30707
30708         * object.c: define metadata_mutex here.
30709
30710 2003-07-24  Ravi Pratap  <ravi@ximian.com>
30711
30712         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
30713         fixed.
30714
30715 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
30716
30717         * reflection.c: Fix bug #46669
30718
30719 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30720
30721         * exception.c:
30722         * exception.h:
30723         * icall.c:
30724         * object.h: fill in the type name for TypeLoadException.
30725
30726 2003-07-23  Ravi Pratap  <ravi@ximian.com>
30727
30728         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
30729         relationship between TypeBuilders while compiling corlib) and bug
30730         45993 (Array types returned from the runtime while compiling
30731         corlib were from the loaded corlib).
30732
30733 2003-07-22  Martin Baulig  <martin@ximian.com>
30734
30735         * mono-debug-debugger.c: Reworked the type support a bit more;
30736         distinguish between types and classes.
30737
30738 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
30739
30740         * icall.c: add IsArrayImpl icall.
30741
30742 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
30743
30744         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
30745         initializing real_size only once. Also fix bug #46602.
30746
30747 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
30748
30749         * object.c: Renamed mono_metadata_section to metadata_section.
30750
30751 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
30752
30753         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
30754           empty array if the type is an array. Fixed.
30755           ves_icall_MonoMethod_get_base_definition: if the base method
30756           is abstract, get the MethodInfo from the list of methods of
30757           the class.
30758         * reflection.c: ParameterInfo.PositionImpl should be zero-based
30759           and it was 1-based. Fixed in mono_param_get_objects.
30760
30761 2003-07-20  Martin Baulig  <martin@ximian.com>
30762
30763         * mono-debug.h: Set version number to 31.
30764         (mono_debug_init): Added `MonoDomain *' argument.
30765
30766         * mono-debug-debugger.c: Reworked the type support; explicitly
30767         tell the debugger about builtin types; pass the `klass' address to
30768         the debugger.
30769
30770 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
30771
30772         * image.c: Allow new metadata tables to be loaded without a
30773         warning. Also update the warning message to give the new constant value.
30774                 
30775 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
30776
30777         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
30778         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
30779         array type representation changes.
30780
30781 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30782
30783         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
30784         on Environment.Exit () call.
30785
30786 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30787
30788         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
30789         requires a matching corlib.
30790
30791 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30792
30793         * Changelog: My editor decided to add a CR to each line. Sorry about that.
30794           Committed again without the CRs.
30795         
30796 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30797
30798         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
30799           getting it from the "this" socket instance. Did not work
30800           if the socket is a subclass of Socket.
30801           Also fixed bug #35371.
30802
30803 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
30804
30805         * metadata.c: fixed size for TypedByRef.
30806         * loader.c: when searching for a method, consider the vararg amrker.
30807         * unicode.c, decimal.c: constify some arrays.
30808
30809 2003-07-15  Dick Porter  <dick@ximian.com>
30810
30811         * socket-io.c: Fixed compilation for gcc < 3.2.
30812
30813         Fixed compilation for machines that don't have AF_INET6 (thanks to
30814         Bernie Solomon <bernard@ugsolutions.com> for that part.)
30815
30816         Fixed compile warnings.
30817         
30818         Fixed formatting and line endings.
30819
30820 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
30821
30822         * socket-io.h:
30823         * socket-io.c: Added IPv6 support.
30824
30825 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
30826
30827         * class.c (mono_class_is_assignable_from): New function to implement
30828         the is_assignable_from logic. Used by mono_object_isinst, 
30829         Type::IsAssignableFrom () and the interpreter.
30830
30831         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
30832         Object, even interfaces.
30833         
30834         * object.c (mono_object_isinst): Implement in terms of 
30835         is_assignable_from.
30836
30837         * icall.c (ves_icall_type_is_assignable_from): New icall.
30838
30839 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
30840
30841         * domain.c (foreach_domain): fix compiler warning.
30842
30843 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
30844
30845         * image.c (load_metadata_ptrs): use g_strndup because strndup is
30846         not available on all plattforms
30847
30848 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
30849
30850         * image.h image.c: Store the metadata version string in MonoImage.
30851         * icall.c: New icall to retrieve the image version.
30852         * reflection.c (create_dynamic_image): Fill in the image version field
30853         * reflection.c (build_compressed_metadata): Use the image version
30854         from the image structure.
30855
30856 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30857
30858         * appdomain.c: modified comment.
30859         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
30860         That will be its last iteration when mono_gc_cleanup is called from
30861         mono_runtime_cleanup and before the domain is unloaded.
30862
30863         Fixes bug #45962.
30864
30865 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
30866
30867         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
30868         attributes.
30869
30870 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30871
30872         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
30873         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
30874         Bernie Solomon <bernard@ugsolutions.com>.
30875
30876 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
30877
30878         * object.c, object.h: provide mono_object_new_fast() for faster
30879         allocation in some special cases.
30880
30881 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
30882
30883         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
30884         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
30885
30886 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
30887
30888         * threadpool.c: fix leaks.
30889
30890 2003-07-01  Dick Porter  <dick@ximian.com>
30891
30892         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
30893         using MonoGHashTables.  Fixes threadpool bug posted to list.
30894
30895 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
30896
30897         * image.h, image.c: added support to load an assembly from a byte array.
30898         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
30899         assembly bundle support.
30900
30901 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
30902
30903         * threadpool.c (mono_thread_pool_add): keep a reference to the
30904         AsyncResult to prevent GC
30905
30906 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30907
30908         * class.c: leak fix.
30909
30910 2003-06-25  Dick Porter  <dick@ximian.com>
30911
30912         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
30913         for the async object, the WaitHandle object will close the handle.
30914         Fixes bug 45321.
30915
30916 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
30917
30918         * class.c: in mono_array_class_get (), lookup from the hash with the
30919         same type we insert: this works around a bug in
30920         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
30921         lluis. The real fix will have to wait for after the release.
30922
30923 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30924
30925         * icall.c: fix memory leak when getting type members.
30926
30927 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30928
30929         * reflection.c: added more pubtoken special cases.
30930
30931 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
30932
30933         * class.c: handle field offset correctly when class size
30934         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
30935
30936 2003-06-20  Martin Baulig  <martin@ximian.com>
30937
30938         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
30939         *image' field.
30940
30941 2003-06-20  Martin Baulig  <martin@ximian.com>
30942
30943         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
30944
30945 2003-06-20  Martin Baulig  <martin@ximian.com>
30946
30947         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
30948         just distinguish between variables in registers and variables at
30949         an offset relative to a register.
30950
30951 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30952
30953         * icall.c: #ifdef out latest changes until mcs is fixed.
30954
30955 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30956
30957         * icall.c: return members in metadata order.
30958
30959 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30960
30961         * icall.c: avoid infinite loop in GetTimeZoneData.
30962
30963 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
30964
30965         * icall.c: added Marshal.Prelink/All icalls.
30966
30967 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30968
30969         * object.c, object.h: fix warnings and do some overflow checking
30970         when creating arrays.
30971
30972 2003-06-17  Dick Porter  <dick@ximian.com>
30973
30974         * file-io.h:
30975         * file-io.c: File attributes need to be tweaked slightly when
30976         passed from the managed to the w32 world.
30977
30978 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30979         * profiler.h profiler-private.h profiler.c: Rework last patch
30980         based on suggestion by Paolo.
30981         
30982 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30983
30984         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
30985         instruction level coverage data collection.
30986         * profiler.h profiler.c (: Added new callback function which can be
30987         used by the profiler to limit which functions should have coverage
30988         instrumentation.
30989         * profiler.c (mono_profiler_load): Call g_module_build_path to
30990         generate the file name of the profiler library.
30991
30992 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30993
30994         * profiler.c, profiler.h, profiler-private.h: added basic block 
30995         coverage profiling API.
30996
30997 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
30998
30999         * reflection.c (mono_reflection_create_runtime_class): Add support
31000         for events in dynamically generated code.
31001
31002         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
31003         not allocated.
31004
31005 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
31006
31007         * icall.c: when getting timezone info, return reasonable values if we
31008         can't get the actual data.
31009
31010 2003-06-14  Dick Porter  <dick@ximian.com>
31011
31012         * threads.c (start_wrapper): Remove the reference to the thread
31013         object in the TLS data, so the thread object can be finalized.
31014         This won't be reached if the thread threw an uncaught exception,
31015         so those thread handles will stay referenced :-( (This is due to
31016         missing support for scanning thread-specific data in the Boehm GC
31017         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
31018
31019 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
31020
31021         * reflection.c: ensure streams and tables are first allocated with
31022         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
31023
31024 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
31025
31026         * icall.c: fixed GetElementType for byrefs (bug# 44792).
31027
31028 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
31029
31030         * reflection.c (mono_reflection_create_runtime_class): Add support for
31031         properties to dynamically created classes.
31032         * reflection.c: Fix a few places where non-MonoObjects were inserted
31033         into the tokens hashtable.
31034
31035 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31036
31037         * object.c: some support to handle out of memory exceptions.
31038
31039 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
31040
31041         * marshal.c (mono_marshal_get_native_wrapper): support reference
31042         return types
31043
31044 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
31045
31046         * object.h, object.c: more portability stuff from Bernie Solomon.
31047         Unexport mono_object_allocate(). Added mono_object_unbox ().
31048         Set exitcode when an unhandled exception is thrown.
31049
31050 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
31051
31052         * marshal.c (mono_marshal_get_native_wrapper): use custom
31053         marshaler for return types.
31054
31055 2003-06-10  Dick Porter  <dick@ximian.com>
31056
31057         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
31058         ip_mreq is available
31059
31060 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
31061
31062         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
31063         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
31064         by Bernie Solomon <bernard@ugsolutions.com>.
31065
31066 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
31067
31068         * gc.c (mono_gc_init): Avoid error message on shutdown when
31069         GC_DONT_GC=1 is used.
31070
31071         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
31072         New icall to return the GUID of a module.
31073
31074 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
31075
31076         * class.c: ensure instance size always includes the parent's size
31077         even whem class size is set explicitly (fixes bug#44294).
31078
31079 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
31080
31081         * profiler.h, profiler.c: made the simple profiler thread-safe,
31082         get more accurate timing info. Allow the loading of an
31083         externally-developed profiler module.
31084
31085 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
31086
31087         * marshal.c (mono_marshal_get_native_wrapper): improved
31088         class/byref arguments.
31089         (mono_marshal_get_native_wrapper): better string marshaling support.
31090
31091 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
31092
31093         * class.c: ensure .pack and .size are handled correctly and
31094         simplified layout of static fields.
31095
31096 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
31097
31098         * appdomain.c
31099         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
31100
31101         * loader.c (mono_lookup_pinvoke_call): look for modules in the
31102         current directory (fix bug 44008)
31103
31104 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
31105
31106         * marshal.c (mono_marshal_get_native_wrapper): started support for
31107         custom marshalers.
31108         (mono_delegate_to_ftnptr): consider marshalling specifications
31109
31110 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
31111
31112         * reflection.c, reflection.h: emit custom marshal info.
31113
31114 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31115
31116         * object.c: free the GError.
31117         * icall.c: added CloseEvent_internal.
31118         * threads.[ch]:
31119         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
31120         call.
31121
31122 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
31123
31124         * loader.c (mono_method_get_signature): Add support for dynamic
31125         assemblies.
31126
31127 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
31128
31129         * reflection.c: fixed bug #43905.
31130
31131 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
31132
31133         * class.c, domain.c, icall.c, metadata.h, object.h: support for
31134         handling TypedReference and ArgIterator.
31135         * loader.c, loader.h: added function to get signature at call site.
31136
31137 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31138
31139         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
31140         data readonly. Buglets and warning fixes. Some MethodSpec support.
31141
31142 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
31143
31144         * class.h, class.c, object.c: remove relative numbering support.
31145
31146 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
31147
31148         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
31149         free the string, until we get a chance to fix Gtk#
31150
31151 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31152
31153         * marshal.c: revert last patch.
31154
31155 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
31156
31157         * icall.c: updates for new mono_class_vtable() not calling
31158         the type constructor anymore.
31159
31160 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
31161
31162         * object.h, object.c: separate vtable creation from type
31163         initialization. Make running the .cctor thread safe.
31164
31165 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
31166
31167         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
31168
31169 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
31170
31171         * loader.c (mono_get_method): consider calling convention
31172
31173 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
31174
31175         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
31176         to return the invisible global type for a module.
31177
31178         * reflection.c (mono_image_build_metadata): Emit global fields too.
31179
31180 2003-05-20  Peter Williams  <peterw@ximian.com>
31181
31182         * loader.c (mono_lookup_internal_call): Add a few newlines.
31183
31184 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
31185
31186         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
31187         literal strings.
31188
31189         * appdomain.c (set_domain_search_path): Recalculate search path when
31190         AppDomainSetup.PrivateBinPath changes.
31191
31192         * object.c (mono_class_compute_gc_descriptor): It turns out some
31193         parts of the class libs (like System.Thread) holds pointers to
31194         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
31195         to treat native int a pointer type here.
31196         
31197 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
31198
31199         * appdomain.h, domain.c: add hashtable for jump target resolution.
31200
31201 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
31202
31203         * reflection.h reflection.c icall.c: Added new icalls 
31204         GetManifestResourceInfoInternal, GetModulesInternal and support
31205         infrastructure.
31206
31207 2003-05-16  Dick Porter  <dick@ximian.com>
31208
31209         * icall.c:
31210         * file-io.h:
31211         * file-io.c: Implement System.IO.MonoIO::GetTempPath
31212
31213 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
31214
31215         * object.c: mono_store_remote_field: little fix to previous patch.
31216
31217 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
31218
31219         * class.c: add constructors to array classes.
31220         * icall.c: special case array construction for InternalInvoke (),
31221
31222 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
31223
31224         * class.h class.c reflection.c object.c: Added support for field
31225         defaults in dynamically generated classes.
31226
31227 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
31228
31229         * reflection.c: properly encode charset for ddlimport.
31230
31231 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
31232
31233         * threads.c: allow compiling without GC.
31234
31235 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
31236
31237         * appdomain.h, object.c, object.h, threads.c, threads.h: added
31238         handling of thread static data.
31239
31240 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
31241
31242         * reflection.h, reflection.c: added mono_custom_attrs_free ().
31243
31244 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
31245
31246         * class.c (mono_array_class_get): always set the serializable flags
31247         (mono_array_class_get): always set the SEALED attribute for array types
31248
31249 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
31250
31251         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
31252         attributes (fix for bug 42021).
31253
31254 2003-05-12  Dick Porter  <dick@ximian.com>
31255
31256         * gc.c: Don't run finalizers when the finalizer thread is
31257         finishing up, because the default domain has already been
31258         destroyed.
31259
31260 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
31261
31262         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
31263         value is null, we should throw an exception.   This is slightly
31264         different than the other conventions used for the constructor.
31265
31266 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31267
31268         * socket-io.c: fixed windows build.
31269
31270 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31271
31272         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
31273
31274 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
31275
31276         * object.c (mono_string_new_wrapper): Compatibility fix for MS
31277         compilers.
31278
31279 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
31280
31281         * class.c (mono_class_layout_fields): Add experimental GC aware
31282         auto layout facility. Requires class library changes to work correctly.
31283
31284         (mono_class_setup_vtable): Avoid overriding explicit interface
31285         method implementations. Fixes iface3.exe test.
31286
31287         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
31288         object reference.
31289         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
31290         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
31291
31292         * metadata.h: Add new type classification macro which determines
31293         whenever the type holds an object reference.
31294
31295 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
31296
31297         * marshal.c (mono_marshal_get_native_wrapper): cleanups
31298
31299 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
31300
31301         * gc.c (finalizer_thread): Work around a GC bug.
31302
31303 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
31304
31305         * marshal.c (emit_struct_conv): allow unions
31306
31307         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
31308
31309 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
31310
31311         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
31312
31313 2003-05-06  Martin Baulig  <martin@ximian.com>
31314
31315         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
31316
31317 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31318
31319         * socket-io.c:
31320         (Select_internal): allow NULLs, don't create arrays if not needed.
31321         Coupled with Socket.cs changes.
31322
31323         * threadpool.c:
31324         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
31325         register a finalizer for it that will close the semaphore handle. This
31326         fixes the leak and make Lupus' test run with > 4080 loops.
31327
31328 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
31329
31330         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
31331         Jerome Laban (bug #42287)
31332
31333 2003-05-02  Martin Baulig  <martin@ximian.com>
31334
31335         * debug-mono-symfile.h
31336         (MonoSymbolFile): Moved declaration into mono-debug.h.
31337         (MonoDebugMethodJitInfo): Likewise.
31338         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
31339         argument.
31340         (_mono_debug_address_from_il_offset): Take a
31341         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
31342
31343         * mono-debug.h
31344         (MonoDebugDomainData): New struct.
31345         (mono_debug_get_domain_data): New function.
31346         (mono_debug_add_method): Take an additional `MonoDomain *'
31347         argument.
31348         (mono_debug_source_location_from_address): Likewise.
31349         (mono_debug_il_offset_from_address): Likewise.
31350         (mono_debug_address_from_il_offset): Likewise.
31351
31352 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
31353
31354         * reflection.c: one more check for null type in custom attrs.
31355
31356 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31357
31358         * reflection.c: avoid warning (comparison is always false due to limited
31359         range of data type).
31360
31361 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31362
31363         * icall.c: throw an exception in Type.GetField if the argument 'name'
31364         is NULL.
31365
31366 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
31367
31368         * reflection.c: fixed handling of enums in named arguments to custom
31369         attributes (bug #42123).
31370
31371 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
31372
31373         * reflection.c: use the right array element type and handle
31374         a null for a Type argument, too.
31375
31376 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
31377
31378         * reflection.c: handle arrays as arguments to custom attributes.
31379
31380 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
31381
31382         * reflection.c: handle a string value in a custom attr
31383         ctor that takes an object.
31384
31385 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
31386
31387         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
31388         (fix bug #42063)
31389
31390 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
31391
31392         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
31393
31394 2003-04-27  Martin Baulig  <martin@ximian.com>
31395
31396         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
31397         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
31398         MONO_DEBUGGER_EVENT_BREAKPOINT.
31399         (mono_breakpoint_trampoline_code): Removed.
31400         (mono_debugger_event_handler): The last argument is now a
31401         `guint32'.
31402         (mono_debugger_insert_breakpoint_full): Removed the
31403         `use_trampoline' argument.
31404         (mono_debugger_method_has_breakpoint): Likewise.
31405         (mono_debugger_trampoline_breakpoint_callback): Renamed to
31406         mono_debugger_breakpoint_callback(); take the method and
31407         breakpoint number as arguments.
31408
31409 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
31410
31411         * metadata.c: fix off by one when loading parameters attributes.
31412
31413 2003-04-24  Martin Baulig  <martin@ximian.com>
31414
31415         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
31416
31417 2003-04-24  Martin Baulig  <martin@ximian.com>
31418
31419         * mono-debug-debugger.c: Moved all code which interacts with the
31420         Mono Debugger here.
31421
31422         * debug-mono-symfile.c: This code now just deals with the symbol
31423         file itself, the debugger code is now in mono-debug-debugger.c.
31424
31425 2003-04-23  Martin Baulig  <martin@ximian.com>
31426
31427         * mono-debug.c (mono_debug_source_location_from_il_offset):
31428         New method; like mono_debug_source_location_from_address(), but
31429         takes an IL offset instead of a machine address.
31430
31431 2003-04-23  Martin Baulig  <martin@ximian.com>
31432
31433         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
31434         `line' field; this is now computed by the debugger.
31435
31436 2003-04-23  Martin Baulig  <martin@ximian.com>
31437
31438         * mono-debug.[ch]: New files.  This is the new debugging interface.
31439
31440         * mono-debug-debugger.[ch]: New files.  Moved all code which
31441         interacts with the Mono Debugger here.
31442
31443 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
31444
31445         * domain.c (mono_init): initialize mono_defaults.monitor_class
31446
31447 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
31448
31449         * reflection.c (method_encode_code): Add a spicy exception to help
31450         future compiler authors.
31451
31452 2003-04-21  Martin Baulig  <martin@ximian.com>
31453
31454         * icall.c
31455         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
31456         Make this work with relative pathnames; g_filename_to_uri() needs
31457         an absolute filename.
31458
31459 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
31460
31461         * icall.c: Track name changes in Object and ValueType.
31462
31463 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
31464
31465         * metadata.c (mono_type_stack_size): size should be a multiple of
31466         sizeof (gpointer)
31467
31468 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31469
31470         * gc.c:
31471         (internal_domain_finalize): moved into mono_domain_finalize. No need
31472         to create another thread because the finalizers will be run in the
31473         finalizer thread.
31474         
31475         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
31476         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
31477         to be run (MS does this too).
31478
31479 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
31480
31481         * object.c (mono_class_compute_gc_descriptor): Update comment.
31482
31483         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
31484
31485         * image.h: Add synchronized wrapper cache.
31486
31487         * image.c (do_mono_image_open): Initialize cache.
31488
31489         * reflection.c (create_dynamic_mono_image): Initialize cache.
31490
31491 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31492
31493         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
31494         ves_icall_System_Buffer_ByteLengthInternal.
31495
31496 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31497
31498         * reflection.c: setup klass->nested_in earlier. Allow
31499         a dash in the assembly name.
31500
31501 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
31502
31503         * metadata.c (mono_type_to_unmanaged): dont access
31504         type->data.klass for MONO_TYPE_OBJECT
31505         (mono_type_to_unmanaged): consider System.Delegate class
31506
31507 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
31508
31509         * class.c: just setup supertypes in the proper place instead of
31510         initializing the full element class for arrays.
31511
31512 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
31513
31514         * class.c: ensure the element class of arrays is initialized.
31515         Setup the supertype info for array classes, too.
31516
31517 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
31518
31519         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
31520
31521 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31522
31523         * Makefile.am: re-added -m option when running cygpath. This way,
31524         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
31525         separator.
31526         * mono-config.c: same codepath for locating mono config file for WIN32
31527         and the rest.
31528         * assembly.c: if mono_assembly_setrootdir is called, don't override
31529         the value set.
31530
31531 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31532
31533         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
31534         MONO_ASSEMBLIES variable.
31535
31536 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
31537
31538         * icall.c: added Assembly::GetNamespaces() icall.
31539
31540 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31541
31542         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
31543
31544 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
31545
31546         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
31547         * object.c: fixed bug in the construction of vtable for proxies
31548
31549 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
31550
31551         * object.c (mono_array_new): Mark mono_array_new as an icall.
31552
31553 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31554
31555         * class.c: fixed test for public method when overriding interfaces.
31556         Closes bug #40970.
31557
31558 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
31559
31560         * appdomain.h, domain.c: added mono_domain_foreach() to
31561         be able to access the currently loaded appdomains.
31562         * object.c: make string interning work across sppdomains.
31563         Mark some functions for use as icalls.
31564
31565 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
31566
31567         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
31568
31569         * reflection.h reflection.c: Allocate long living data using 
31570         GC_MALLOC_ATOMIC so the collector does not need to scan it.
31571
31572         * reflection.c: Double the allocation size in streams instead of
31573         increasing it, to prevent unneccesary copying on large assemblies.
31574         
31575         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
31576         creation if the assembly does not have the Run flag set.
31577
31578 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
31579
31580         * class.h: avoid the C++ keywords in header files (Jerome Laban
31581         spotted and fixed this).
31582
31583 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31584
31585         * object.c:
31586         (mono_unhandled_exception): fill in the arguments for the
31587         UnhandledException event. Only trigger that event for the default
31588         domain (as MS does).
31589
31590 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
31591
31592         * object.c: Improve typed allocation stuff based on suggestions from
31593         Paolo. Also turn it on if the GC library supports it.
31594
31595 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31596
31597         * object.c object.h class.h: Added experimental typed allocation
31598         facility using the interfaces in gc_gcj.h.
31599
31600         * os/gc_wrapper.h: Added new include files.
31601         
31602 2003-04-03  Martin Baulig  <martin@ximian.com>
31603
31604         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
31605         which is not yet enabled by default.
31606
31607         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
31608         functions.
31609         (mono_gc_lock, mono_gc_unlock): New static functions.
31610
31611         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
31612         functions; stop/start the world for the garbage collector.  This
31613         is using the windows API; we need to complete the SuspendThread()/
31614         ResumeThread() implementation in the io-layer to make this work on Unix.
31615         (mono_gc_push_all_stacks): New public function; tells the garbage
31616         collector about the stack pointers from all managed threads.
31617
31618 2003-04-03  Martin Baulig  <martin@ximian.com>
31619
31620         * object.h (MonoThread): Added `gpointer stack_ptr'.
31621
31622         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
31623
31624 2003-04-03  Martin Baulig  <martin@ximian.com>
31625
31626         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
31627
31628 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31629
31630         * reflection.c (typebuilder_setup_fields): Initialize field.first and
31631         field.last.
31632
31633 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
31634
31635         * loader.c (mono_lookup_internal_call): Report the corlib that is
31636         out of sync.
31637
31638 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
31639
31640         * icall.c (ves_icall_type_GetTypeCode): fixed check for
31641         System.DBNull (it's class not valuetype).
31642
31643 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
31644
31645         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
31646         if the array method was already assigned a token (fixes bug#40646).
31647
31648 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
31649
31650         * reflection.c (mono_reflection_get_type): Attempt type resolve even
31651         if no assembly is given.
31652
31653 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
31654
31655         * metadata.h: Added the new tables.
31656
31657         * row-indexes.h: Added definitions for new tables.
31658
31659         * metadata.c: Add schemas for new tables, and add support for
31660         computing the sizes of them.
31661
31662         * class.c: Update for handling the new type cases.
31663
31664 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
31665
31666         * metadata.h (MONO_TYPE_IS_VOID): new macro
31667
31668 2003-03-31  Martin Baulig  <martin@ximian.com>
31669
31670         * threads.h (MonoThreadCallbacks): Added `thread_created'.
31671
31672         * threads.c (mono_thread_new_init): Call `thread_created' in the
31673         mono_thread_callbacks.
31674
31675 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
31676
31677         * loader.h: added marshalbyrefobject_class to mono_defaults
31678         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
31679         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
31680           generation of output parameters.
31681           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
31682         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
31683           contextbound and the target object belongs to the context of the caller.
31684         * object.h: added context and unwrapped_server variables in MonoRealProxy.
31685         * object.c: Implemented support for interfaces and abstract classes
31686           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
31687           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
31688
31689 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
31690
31691         * class.h class.c (mono_class_is_subclass_of): New function.
31692         
31693         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
31694         routines for most common case (calls from ArrayList::ToArray).
31695
31696         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
31697         routine so programs which call Environment::Exit() can be profiled.
31698
31699         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
31700         Added MONO_ARCH_SAVE_REGS.
31701
31702         * icall.c (ves_icall_type_is_subtype_of): Use new function.
31703
31704 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
31705
31706         * blob.h: Add a couple of new MonoType types definitions.
31707
31708         * tabledefs.h: Add a couple of new call convs.
31709
31710 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
31711
31712         * reflection.h (MonoReflectionDynamicAssembly): track changes in
31713         the layout of the class.
31714
31715         * reflection.c (alloc_table): double the size on overflow to avoid
31716         unnecessary copying.
31717
31718         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
31719         avoid filling out metadata tables and blobs. Also set mb->ilgen to
31720         null so it can be garbage collected.
31721         
31722 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
31723
31724         * reflection.c (mono_reflection_get_type): Return the resolved type
31725         only if it is in the assembly we searched.
31726
31727         * reflection.c (ensure_runtime_vtable): Initialize method slots.
31728
31729         * class.c (mono_class_setup_vtable): Set the slot of the overriding
31730         method.
31731
31732 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31733
31734         * appdomain.c:
31735         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
31736         the right one is 'file:///blah', but MS allows it.
31737         * assembly.c:
31738         (mono_assembly_open): allow 'file://blah'
31739
31740         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
31741
31742 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
31743
31744         * socket-io.c: fixes bug #40310.
31745
31746 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
31747
31748         * reflection.c (mono_reflection_parse_type): handle deeply nested
31749         types correctly.
31750
31751         * reflection.c (mono_image_create_token): Use unique token values
31752         since they will be put into a hash table.
31753
31754         * class.c (mono_class_setup_vtable): If a method occurs in more than
31755         one place in the vtable, and it gets overriden, then change the
31756         other occurances too.
31757
31758         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
31759         object as return type.
31760
31761 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31762
31763         * icall.c: Deleted "ToString" implementation for double and float
31764         because they are full implemented in managed code.
31765
31766 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31767
31768         * reflection.c, reflection.h: implemented and exported functions
31769         to retrieve info about custom attributes.
31770
31771 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31772
31773         * appdomain.c: moved Uri handling to assembly.c
31774         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
31775         work when using a file Uri in *nix and windows.
31776
31777         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
31778         GetReferencedAssemblies.
31779
31780 2003-03-18  Dick Porter  <dick@ximian.com>
31781
31782         * icall.c: Rename a couple of internal calls
31783
31784         * threads.c: Set the thread state to Stopped when a thread exits.
31785         Fixes bug 39377.
31786
31787 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
31788
31789         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
31790         New icall.
31791
31792         * object.c (mono_class_vtable): fix warning.
31793
31794 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
31795
31796         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
31797
31798         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
31799         memory.
31800         (method_encode_clauses): Create exception info structures in the right
31801         order.
31802         (mono_reflection_setup_internal_class): Initialize supertypes field.
31803
31804         * class.c object.c: Handle interfaces which implement other interfaces 
31805         correctly.
31806
31807         * class.h class.c: Move the supertypes array initialization code into 
31808         a separate function so it can be used for dynamic types too. Also call
31809         it earlier, in mono_class_init(), since it can be used before the
31810         type is initialized.
31811
31812 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31813
31814         * Makefile.am:
31815         * assembly.c:
31816         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
31817
31818         * appdomain.c:
31819         * appdomain.h:
31820         * marshal.c:
31821         * object.c: remove warnings.
31822
31823 2003-03-13  Martin Baulig  <martin@ximian.com>
31824
31825         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
31826         (MonoDebugLexicalBlockEntry): New types.
31827
31828         * debug-mono-symfile.c
31829         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
31830
31831 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31832
31833         * process.c: ret can be any non-zero value accroding to MS doc.
31834
31835 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
31836
31837         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
31838         fixing a warning for a miss-used prototype, would have cause
31839         random memory corruption.
31840
31841 2003-03-07  Martin Baulig  <martin@ximian.com>
31842
31843         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
31844         getting really annoying ....
31845
31846 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
31847
31848         * reflection.c (fixup_method): added support for array methods.
31849
31850 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
31851
31852         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
31853         (pointed out by Michael Adams).
31854
31855 2003-03-04  Dick Porter  <dick@ximian.com>
31856
31857         * icall.c: Temporarily reverted the Double and Single ToString()
31858         change, because it broke nunit.
31859
31860 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
31861
31862         * object.h, threads.h: make include files compatible with C++
31863         (patch by Jerome Laban <jlaban@wanadoo.fr>).
31864
31865 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31866
31867         * icall.c: Erased ToString helper functions for Double and Single.
31868         Now, that implementations ar all in managed code (Double and Single
31869         Formatters).
31870
31871 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
31872
31873         * appdomain.c: Added method for initializing the default context of
31874         a domain. Added internal call for getting the default context.
31875         * appdomain.h: Added context variable in MonoDomain struct.
31876         * domain.c: mono_domain_set also sets the default context of the domain
31877         * icall.c: Mapped internal method InternalGetDefaultContext.
31878         * object.c: mono_object_get_virtual_method returns always a remoting
31879         wrapper if the object is a transparent proxy.
31880         mono_runtime_invoke_array: when creating an object by calling the
31881         constructor, if the created object is a proxy, then the constructor should
31882         be called using the a remoting wrapper.
31883
31884 2003-03-03  Dick Porter  <dick@ximian.com>
31885
31886         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
31887         variable so it compiles on solaris.  Problem spotted by
31888         Christopher Taylor <ct@cs.clemson.edu>
31889
31890 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31891
31892         * appdomain.c:
31893         (get_info_from_assembly_name): don't leak value.
31894
31895         * icall.c:
31896         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
31897         result.
31898
31899 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
31900
31901         * assembly.c: export mono_image_load_references ().
31902         * class.c: handle function pointers. mono_class_from_name() now
31903         supports nested type names directly.
31904
31905 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
31906
31907         * reflection.h reflection.c: Encode already created dynamic methods 
31908         and fields correctly as a DEF instead of a REF.
31909
31910         * reflection.c: Get rid of the force_ref argument to 
31911         mono_image_typedef_or_ref since it was wrong in the first place.
31912
31913         * string-icalls.c: add error checking to string constructors according
31914         to the MSDN docs.
31915
31916         * reflection.c: Emit types in the order their TypeBuilders were 
31917         created. Previously, a new table index was assigned to each type before
31918         the tables were emitted. This was wrong because the signature blob
31919         might already refer to a type by its original table index.
31920
31921 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
31922
31923         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
31924         change.
31925         
31926 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31927
31928         * Makefile.am: make assemblies dir have \ instead of / on windows.
31929
31930 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
31931
31932         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
31933         iterate over the NESTEDCLASS table using a linear search since the
31934         table is not guaranteed to be sorted by the secondary key.
31935
31936         * class.c (mono_class_create_from_typedef): fixed up call to
31937         mono_metadata_nesting_typedef.
31938         
31939 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
31940
31941         * marshal.c (mono_string_to_byvalstr): clear the memory as
31942         suggested by Jerome Laban <jlaban@wanadoo.fr>
31943
31944 2003-02-26  Dick Porter  <dick@ximian.com>
31945
31946         * process.c: Cope with padding in .rsrc blocks
31947
31948 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31949
31950         * metadata.h: reverted the filter_len change, it breaks reflection
31951         
31952 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31953
31954         * metadata.h: added a new field to store the filter_len
31955         
31956
31957 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
31958
31959         * reflection.c: handle custom attributes for types and members
31960         created with Reflection.Emit (bug#38422).
31961
31962 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
31963
31964         * reflection.c: define RTSpecialName automatically for constructors for
31965         compatibility with MS.NET.
31966
31967         * reflection.c (mono_reflection_create_runtime_class): initialize
31968         nested_in field of dynamically created classes.
31969
31970 2003-02-22  Martin Baulig  <martin@ximian.com>
31971
31972         * debug-mono-symfile.h: Incremented version number.
31973
31974 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31975
31976         * object.h icall.c process.c: fix warnings.
31977
31978 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31979
31980         * appdomain.h appdomain.c:
31981         (mono_domain_try_type_resolve): split the 
31982         name_or_tb argument into a name and a tb argument.
31983         (mono_domain_has_type_resolve): new function to check whenever the
31984         application has registered a TypeResolve event handler.
31985         
31986         * icall.c reflection.h reflection.c: move the type resolve logic into
31987         mono_reflection_get_type () so it will be invoked when 
31988         Assembly::GetType () is called.
31989
31990         * reflection.c:
31991         (mono_reflection_get_type): renamed to get_type_internal.
31992         (mono_reflection_get_type): fixed type name generation so it works 
31993         for nested types too.
31994         (mono_reflection_get_type): call has_type_resolve () to avoid the 
31995         costly type name generation if there is no resolve event handler.
31996
31997 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31998
31999         * class.c, image.c: load exported types from file references.
32000
32001 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
32002
32003         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
32004           used to cache the managed methods used to create proxies and make 
32005           remote invocation of methods.
32006         * class.h: Added in MonoVTable a flag to indicate that a class needs 
32007           to be remotely created.
32008         * object.c: Modified the method mono_class_vtable(). It now initializes 
32009           the remote flag of the vtable. Modified mono_object_new_specific(), 
32010           so now it checks the remote flag.
32011         * icall.c: Added a couple of internal methods, one for enabling instance 
32012           creation interception for a type, and one for creating objects bypassing
32013           the remote check.
32014
32015 2003-02-18  Martin Baulig  <martin@ximian.com>
32016
32017         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
32018         New interncall to get a method's metadata token.
32019
32020         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
32021         New interncall for the debugger.
32022
32023 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
32024
32025         * class.c (mono_class_setup_vtable): allocate supertype array
32026
32027 2003-02-18  Martin Baulig  <martin@ximian.com>
32028
32029         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
32030
32031 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32032
32033         * reflection.c:
32034         (assembly_name_to_aname): jump over unknown properties (i've found
32035         something like: 'type, assembly, version=xxx, custom=null, public...',
32036         so now will ignore custom=null and still get the rest of the values).
32037
32038 2003-02-17  Dick Porter  <dick@ximian.com>
32039
32040         * threads.c: Have Thread.Start() wait for a semaphore to signal
32041         that the thread has set up all its local data.  This fixes bug
32042         34323, where Abort() raced the new thread's TLS data.
32043
32044         Also removes the handle_store() call from start_wrapper, because
32045         threads are now always created suspended and there is no longer a
32046         race between the parent and child threads to store the info.
32047
32048 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
32049
32050         * image.c: explain the #- heap issue in a message, hopefully
32051         avoiding FAQs on mono-list.
32052
32053 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32054
32055         * icall.c:
32056         (GetEntryAssembly): if the domain has not invoked
32057         AppDomain.ExecuteAssembly yet, return the assembly of the default
32058         AppDomain.
32059
32060 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
32061
32062         * class.c (mono_ldtoken): make it work in dynamic assemblies.
32063
32064 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
32065
32066         * metadata.c, reflection.c: simple speedup to type hash
32067         and equals code.
32068
32069 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
32070
32071         * image.c, image.h, class.c, assembly.c: move module loading
32072         to MonoImage. When loading metadata, consider alignemnet from
32073         the start of metadata, not from the metadata address in memory.
32074
32075 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
32076
32077         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
32078         AssemblyBuilder objects. Factored out custom attribute creation into
32079         a separate function.
32080         (create_custom_attr): new function to create custom attributes.
32081
32082 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
32083
32084         * Makefile.am: Got tired of typing the full pathname to pedump.
32085         Until there is another option, am installing this.
32086
32087 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
32088
32089         * class.c (class_compute_field_layout): always set field->parent 
32090         (mono_ldtoken): use mono_defaults.fieldhandle_class;
32091
32092 2003-02-11  Dick Porter  <dick@ximian.com>
32093
32094         * threads-types.h:
32095         * monitor.c: Rewrote Monitor, making lock much faster and
32096         Pulse/Wait work as specified.  Also uses much fewer handles, and only
32097         creates them as needed.
32098
32099         * exception.c: Added SynchronizationLockException
32100
32101         * threads.c: Deleted old Monitor implementation.  The new one is
32102         in a new file.
32103
32104 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
32105
32106         * class.c: handled TypedReference type code. Set the correct size for
32107         class data. Setup interface_offsets for interface classes, too.
32108
32109 2003-02-09  Martin Baulig  <martin@ximian.com>
32110
32111         * debug-mono-symfile.h: Reflect latest symbol writer changes.
32112
32113 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
32114
32115         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
32116         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
32117         * object.c: fixed mono_object_get_virtual_method () for interfaces.
32118         * verify.c: check for code that runs after the end of the method.
32119
32120 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
32121
32122         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
32123         "System.Math::Round2".
32124         * sysmath.h: Added Floor, Round and Round2 definitions.
32125         * sysmath.c: Modified certain functions that were not 100% compliant
32126         with MS.NET (math precision) and added the implementation of Floor,
32127         Round and Round2.
32128
32129 2003-02-07  Martin Baulig  <martin@ximian.com>
32130
32131         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
32132
32133 2003-02-07  Martin Baulig  <martin@ximian.com>
32134
32135         * debug-mono-symfile.c: Reflected latest symwriter changes.
32136         (mono_debug_create_mono_symbol_file): Removed.
32137         (mono_debug_open_mono_symbol_file): Take an argument which
32138         specifies whether to create a dynamic symbol file.
32139
32140 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
32141
32142         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
32143
32144 2003-02-05  Martin Baulig  <martin@ximian.com>
32145
32146         * reflection.c (mono_image_build_metadata): Make this public,
32147         protect it against being called multiple times, don't create
32148         resources and don't build the compressed metadata here.
32149         (mono_image_create_pefile): Do this here.
32150
32151         * icall.c
32152         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
32153
32154 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32155
32156         * socket-io.c: fixed bug #36322.
32157
32158 2003-02-06  Piers Haken <piersh@friskit.com>
32159
32160         * appdomain.[ch]:
32161         * class.h:
32162         * debug-mono-symfile.c:
32163         * icall.c:
32164         * loader.c:
32165         * mono-config.c:
32166         * monosn.c:
32167         * reflection.c:
32168         * socket-io.c: warning cleanups
32169
32170 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
32171
32172         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
32173         function. works like remoting invoke, but does a check for the Proxy first.
32174
32175 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
32176
32177         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
32178
32179 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
32180
32181         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
32182         array of pointers.
32183         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
32184         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
32185
32186         * object.c (mono_store_remote_field_new): used by the new jit
32187         instead of mono_store_remote_field
32188         (mono_load_remote_field_new): used by the new jit
32189         instead of mono_load_remote_field
32190
32191 2003-02-05  Patrik Torstensson
32192
32193         * appdomain.c: changed unload to take the domain id instead
32194         of domain
32195         
32196         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
32197
32198
32199 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32200
32201         * appdomain.c: don't look for assemblies in ApplicationBase if
32202         PrivateBinPathProbe is set.
32203
32204 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32205
32206         * object.c: make the first argument in main_args contain the absolute
32207         path to the assembly. Fixes bug #37511.
32208
32209 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32210
32211         * icall.c: get correct UTC offset for countries not using daylight
32212         time saving. Fixes bug #30030.
32213
32214 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32215
32216         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
32217         and 1 are the family).
32218
32219 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
32220
32221         * icall.c (ves_icall_InternalExecute): removed wrong assertion
32222
32223         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
32224
32225 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
32226
32227         * reflection.c: added support for SignatureHelper tokens, which is
32228         needed by the Calli opcode.
32229
32230         * reflection.h: track changes to SignatureHelper class.
32231
32232         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
32233
32234 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32235
32236         * appdomain.c: fixed loading assemblies from PrivateBinPath.
32237
32238 2003-02-03  Patrik Torstensson
32239         * appdomain.[c|h], domain.c : 
32240          - Added support for getting a domain via domain id
32241          - Support for setting and getting domain from System.AppDomain 
32242            (used in cross appdomain channel)
32243          - Added support for get/set for a MonoAppContext on a thread 
32244            (Context class in System.Runtime.Remoting.Contexts),
32245          - Removed hack in Get/SetData and ExecuteAssembly.
32246         
32247         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
32248         the managed world to get control when a proxy is created.
32249
32250         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
32251         
32252 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
32253
32254         * icall.c
32255         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
32256         Populate the codebase field as well.
32257
32258 2003-02-02  Martin Baulig  <martin@ximian.com>
32259
32260         * debug-mono-symfile.c
32261         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
32262         (mono_debug_symfile_add_method): Allow interncalls.
32263
32264 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32265
32266         * icall.c: throw parse exception if strtod fails or the string is empty.
32267
32268 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
32269
32270         * marshal.c: handle object type separately from defined
32271         class types.
32272
32273 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
32274
32275         * marshal.c: handle NATIVE_LPSTR for strings when it's
32276         explicitly specified.
32277
32278 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
32279
32280         * reflection.c, reflection.h, icall.c: setup the reflection
32281         handle cache for ModuleBuilders and AssemblyBuilders.
32282
32283 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
32284
32285         * reflection.c (reflection_methodbuilder_to_mono_method): set
32286         pinvoke flag
32287
32288 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32289
32290         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
32291
32292 2003-01-29  Dick Porter  <dick@ximian.com>
32293
32294         * threads.c: No need for the fake_thread kludge now that Thread
32295         doesn't run a class constructor
32296         
32297 2003-01-29  Dick Porter  <dick@ximian.com>
32298
32299         * threads.c: Use g_direct_hash instead of the rather bogus
32300         g_int_hash
32301
32302 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
32303
32304         * marshal.c (mono_marshal_get_native_wrapper): add check for null
32305         (fix pinvoke12.exe)
32306         (mono_marshal_get_struct_to_ptr): generate valid IL code
32307         (mono_marshal_get_ptr_to_struct): generate valid IL code
32308         (*): correctly set sig->pinvoke, we need to memdup the signature
32309         to do that
32310
32311 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
32312
32313         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
32314         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
32315
32316 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32317
32318         * profiler.c: provide more callers information.
32319
32320 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
32321
32322         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
32323
32324         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
32325
32326         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
32327
32328 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32329
32330         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
32331         exception instead of going into an infinite loop on dates which it 
32332         can't yet handle.
32333
32334         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
32335         out-of-range exception if needed.
32336
32337         * class.c (mono_class_setup_vtable): allow a virtual method to provide
32338         an implementation for an interface method and to override an inherited
32339         method at the same time. 
32340         Imagine a scenario when a virtual method is used to override a
32341         virtual abstract method in a parent class, and this same method 
32342         provides an implementation for an method inherited from an interface. 
32343         In this case, the interface resolution code will set im->slot, which 
32344         means that the virtual method override pass will skip this method 
32345         which means a pointer to the abstract method inherited from the parent
32346         will remain in the vtable of this non-abstract class.
32347
32348         * class.c: (mono_class_setup_vtable): continue search for a real 
32349         method if only an abstract method is found.     
32350
32351 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32352
32353         * reflection.c: add size to encoding for ByValStr and ByValArray
32354         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
32355
32356 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32357
32358         * class.c (mono_class_setup_vtable): pass the override info as an
32359         argument.
32360
32361         * class.c (mono_class_setup_vtable): set the slot of overriding methods
32362         correctly.
32363         
32364         * reflection.c (ensure_runtime_vtable); add support for method 
32365         overrides.
32366         
32367 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32368
32369         * reflection.c (resolution_scope_from_image): Hack to work to work with
32370         dynamic assemblies.
32371
32372         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
32373         added a 'force_ref' argument to force this function to allways return 
32374         a TypeRef. This is needed by mono_image_get_memberref_token ().
32375         
32376 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32377
32378         * reflection.c (mono_image_get_type_info): interfaces really don't have
32379         a parent.
32380
32381         * reflection.c (mono_image_basic_init): fill out missing fields of
32382         image structure.
32383
32384         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
32385         dynamic assemblies. This is required so dynamic assemblies show up in
32386         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
32387         Type::GetType() etc. This is consistent with MS behaviour.
32388
32389         * image.c image.h reflection.c: add newly created classes to the name 
32390         cache so mono_class_get () will find them.      
32391
32392 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32393
32394         First part of changes to get IKVM.NET running under mono.
32395         
32396         * appdomain.h, appdomain.c: added new function 
32397         mono_domain_try_type_resolve() which will emit TypeResolve events. 
32398         This function will call AppDomain::DoTypeResolve to do the actual work.
32399
32400         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
32401         moved existing code dealing with dynamic tokens to a new function 
32402         called mono_reflection_lookup_dynamic_token (). This function will 
32403         raise TypeResolve events when appropriate. Since reflection.c is not 
32404         part of libmetadata, a new hook function called 
32405         mono_lookup_dynamic_token() is added to class.c which will call this.
32406
32407         * assembly.h assembly.c: make the invoke_load_hook function public,
32408         so it can be called for dynamic assemblies.
32409
32410         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
32411
32412         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
32413         type isn't found.
32414
32415         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
32416         MonoGHashTable, since it contains pointers to objects which the GC 
32417         needs to track.
32418
32419         * assembly.c (search_loaded): remove unused variable.
32420         
32421 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
32422
32423         * object.c: fixed issue exposed by gcc-generated IL programs
32424         that use RVA data for pointers.
32425
32426 2003-01-25  Martin Baulig  <martin@ximian.com>
32427
32428         * threads.c (start_wrapper): Moved the initialization of
32429         `start_func' above the mono_new_thread_init() call to which we
32430         pass it as argument.
32431
32432 2003-01-24  Martin Baulig  <martin@ximian.com>
32433
32434         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
32435         the MonoThread pointer.
32436
32437 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
32438
32439         * icall.c: Rename `PowImpl' to Pow.
32440
32441 2003-01-23  Dick Porter  <dick@ximian.com>
32442
32443         * threads.c (start_wrapper): Create a Thread object if needed, so
32444         the Main() thread can do the class initialisation in a subthread
32445         that has been set up to allow managed code execution.
32446
32447         Pass the thread ID instead of the MonoThread pointer to the thread
32448         start and attach callbacks.  This change is required, because the
32449         jit thread start callback must be called _before_ the Thread
32450         object can be created.
32451         
32452         (mono_thread_init): Removed much object creation code that is no
32453         longer needed.  No managed code is called from here now.
32454
32455         * object.c (mono_runtime_exec_managed_code): Create a subthread
32456         for Main, and call back to the runtime to use it.
32457         Set the exit code when Main exits.
32458
32459         * gc.c: Make sure domain finalisation happens in a subthread.
32460         Re-enable threaded GC, fixing bug 31333 (again).
32461
32462         * environment.c: System.Environment internall calls (so far just
32463         ExitCode is here, the others are still in icall.c)
32464
32465         * appdomain.c (mono_runtime_cleanup): All threads running managed
32466         code should have finished before mono_runtime_cleanup() is
32467         reached, so no need to clean up threads.
32468
32469 2003-01-22  Martin Baulig  <martin@ximian.com>
32470
32471         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
32472         `gpointer func' arguments.      
32473         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
32474         but added `MonoThread *thread' argument.
32475         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
32476
32477         * threads.c (mono_new_thread_init): Added `gpointer func' argument
32478         and pass it to the mono_thread_start_cb callback.
32479         (mono_install_thread_callbacks): New public function to install a
32480         set of callbacks which are set by the debugger.
32481         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
32482
32483 2003-01-22  Martin Baulig  <martin@ximian.com>
32484
32485         * Makefile.am: Install debug-mono-symfile.h.
32486
32487 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
32488
32489         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
32490
32491 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
32492
32493         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
32494         * class.c (mono_ptr_class_get): correctly set access levels of pointers
32495         (mono_array_class_get): correctly set access levels of arrays
32496
32497 2003-01-20      Patrik Torstensson
32498         * image.h (MonoAssemblyName): changed major, minor, build, revision
32499         from signed to unsigned.
32500
32501 2003-01-20  sean kasun <skasun@azstarnet.com>
32502
32503         * reflection.c (load_cattr_value): Now this handles
32504         MONO_TYPE_SZARRAY.  Fixes bug #35629
32505
32506 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
32507
32508         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
32509         integer value
32510
32511 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32512
32513         * decimal.c: fixed bug #26056.
32514
32515 2003-01-17  Martin Baulig  <martin@ximian.com>
32516
32517         * gc.c: Raise an ExecutionEngineException instead of using g_error().
32518
32519 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32520
32521         * exception.[ch]:
32522         (mono_get_exception_type_initialization): new function.
32523
32524         * object.c: throw a TypeInitializationException when an exception is
32525         thrown invoking the class constructor.
32526
32527 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32528
32529         * reflection.c: fixed attribute reading.
32530
32531 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32532
32533         * icall.c:
32534         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
32535         provided, look for the type in the calling assembly and then in
32536         mscorlib; if the assembly name is provided, only try that one.
32537
32538 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
32539
32540         * object.c: register the vtable before there is a chance it's
32541         queried again recursively.
32542
32543 2003-01-13  Duncan Mak  <duncan@ximian.com>
32544
32545         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
32546         gc-internal.h. 
32547         
32548 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
32549
32550         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
32551
32552 2003-01-11  Martin Baulig  <martin@ximian.com>
32553
32554         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
32555         this to 20 for the release.
32556
32557 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
32558
32559         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
32560
32561         * loader.c (mono_method_get_marshal_info): bug fix
32562
32563         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
32564         structures with explicit layout
32565
32566 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32567
32568         * profiler.c: made the output more readable (and sorted). 
32569         Added caller information for the allocation profiler.
32570
32571 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
32572
32573         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
32574
32575 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32576
32577         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
32578         to get value types.
32579         
32580 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
32581
32582         * object.c, profiler.h, profiler.c, profiler-private.h:
32583         Added object allocation profiler.
32584
32585 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
32586
32587         * reflection.h, reflection.c: handle global methods.
32588         Compress blob entries.
32589
32590 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
32591
32592         * marshal.c: fix compilation.
32593
32594 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
32595
32596         * loader.c (mono_method_get_marshal_info): impl.
32597
32598         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
32599
32600 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32601
32602         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
32603         for reference types.
32604
32605 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
32606
32607         * loader.c: fixed off by one error in loaded parameter names.
32608
32609 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
32610
32611         * marshal.c (mono_marshal_get_icall_wrapper): like
32612         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
32613         instead of a MonoMethod.
32614
32615 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32616
32617         * decimal.c: fixed bug #36537.
32618
32619 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
32620
32621         * marshal.c: throw a missing method exception if a
32622         P/Invoke method is not found.
32623
32624 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32625
32626         * icall.c: allow a null this for constructors.
32627
32628 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
32629
32630         * icall.c: raise the proper exceptions if the arguments to the
32631         internal Invoke are incorrect.
32632
32633 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
32634
32635         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
32636
32637 2003-01-03  Martin Baulig  <martin@ximian.com>
32638
32639         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32640
32641 2002-12-31  Martin Baulig  <martin@ximian.com>
32642
32643         * debug-mono-symfile.c: Completely rewrote the type section.
32644         Instead of using individual malloc()ed fields, we use one big
32645         continuous memory area and offsets into this area.
32646         See the comments in the source code for details.
32647
32648 2002-12-30  Martin Baulig  <martin@ximian.com>
32649
32650         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
32651
32652 2002-12-30  Martin Baulig  <martin@ximian.com>
32653
32654         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
32655         line number table in this data blob instead of using an external
32656         pointer.
32657
32658 2002-12-28  Martin Baulig  <martin@ximian.com>
32659
32660         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32661
32662 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
32663
32664         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
32665         as a boxed return type.
32666
32667 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
32668
32669         * appdomain.c
32670         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
32671         g_build_filename to properly get separators on the filename created.
32672
32673         * object.h: Small change, introduce MonoMarshalByRefObject to
32674         track the layout of that structure in the C# universe as we make
32675         changes there.
32676
32677 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
32678
32679         * object.c: removed assert to allow static fields on interfaces.
32680         * loader.c: a TypeSpec may be used for any type, not just arrays.
32681
32682 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
32683
32684         * class.c, class.h: added mono_class_array_element_size ().
32685         Ignore static methods in interfaces.
32686
32687 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32688
32689         * threads.c: fixed the build under cygwin.
32690
32691 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
32692
32693         * reflection.c: handle nullref constants. Allocate keys for
32694         reflection handles with the GC.
32695
32696 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32697
32698         * threads.c, threads.h: added mono_thread_get_abort_signal()
32699         to get a suitable signal for thread abort.
32700
32701 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32702
32703         * metadata.c: fix handling of ExportedType table.
32704
32705 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32706
32707         * icall.c: added WriteWindowsDebugString internal call.
32708
32709 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32710
32711         * reflection.h: added fields to match C# implementation.
32712
32713 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32714
32715         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
32716
32717 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
32718
32719         * gc.h, gc-internal.h: Rename header for GC internal calls to
32720         gc-internal.h from gc.h as to not clash with Boehm GC having its
32721         header installed as <gc.h> in outside include paths.
32722         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
32723         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
32724
32725 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32726
32727         * icall.c: assign minor, build and revision in FillName.
32728
32729 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
32730
32731         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
32732         Added support for running code generated by Reflection.Emit.
32733
32734 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32735
32736         * appdomain.c: check for NULL argument in LoadFrom.
32737
32738 2002-12-10  Dick Porter  <dick@ximian.com>
32739
32740         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
32741
32742 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32743
32744         * appdomain.c: fix buglet when building exe file name.  Handle full
32745         assembly name (needed after latest changes to AssemblyName).
32746         * image.c:
32747         (mono_image_close): free some hashtables.
32748
32749 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
32750
32751         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
32752         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
32753         on some systems (redhat 7.3) 
32754
32755 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
32756
32757         * threads.c: delete the critical section of a sync block,
32758         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
32759
32760 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
32761
32762         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
32763
32764 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32765
32766         * appdomain.[ch]: handle the assembly preload event to try loading the
32767         assemblies using the paths we have in the current domain.
32768
32769         * assembly.[ch]: created an assembly preload hook that is called to try
32770         loading the assembly by other means that the ones provided here.
32771
32772         * domain.c: initialize the domain search path.
32773
32774         From now on, assemblies (TODO: except corlib and System) are loaded
32775         according to these rules when using mono_assembly_load ():
32776
32777                 1. It tries to load the assembly from the ApplicationBase
32778                 of the current domain appending .dll and .exe (TODO: have to
32779                 try loading from name/name.dll and name/name.exe).
32780
32781                 2. It tries the search path specified in PrivateBinPath for the
32782                 current domain (if any).
32783
32784                 3. Previous behavior.
32785
32786 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
32787
32788         * icall.c: implemented GetInterfaceMap() related icall.
32789         * domain.c, loader.h: load MethodInfo in mono_defaults.
32790
32791 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
32792
32793         * gc.c: disable the finalizer thread for now, untill all the issues
32794         with it are resolved.
32795
32796 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32797
32798         * string-icalls.c: handle embedded nulls in string ctor when the
32799         length is specified.
32800
32801 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
32802
32803         * class.c: look for explicit interface implementation in parent
32804         classes, too.
32805
32806 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
32807
32808         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
32809
32810 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
32811
32812         * gc.c: protect handles with a critical section.
32813
32814 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32815
32816         * icall.c:
32817         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
32818         parameters. If no assembly specified, try getting the type from all
32819         the assemblies in the current domain, else, load the assembly and get
32820         the type from it.
32821
32822 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32823
32824         * marshal.c: applied patch from Aleksey Demakov that fixes
32825         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
32826
32827 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32828
32829         * icall.c: fixed get_location.
32830
32831 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
32832
32833         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
32834         declarations to make it work with older gcc. 
32835
32836         * loader.c (mono_get_method): set signature->pinvoke for native calls
32837
32838 2002-11-20  Dick Porter  <dick@ximian.com>
32839
32840         * threads.c (mono_thread_init): Set the main thread's handle
32841
32842 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
32843
32844         * gc.c: allow compilation without GC support. Changed to match the
32845         mono coding style.
32846
32847 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
32848
32849         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
32850
32851 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
32852
32853         * reflection.c: set a public key token on the core assemblies.
32854
32855 2002-11-18  Dick Porter  <dick@ximian.com>
32856
32857         * threads.c: Split out some thread initialisation so that other
32858         files can set the start callback function.
32859
32860         * gc.c: Run finalisers in a separate thread, to avoid stack
32861         overflow.  Fixes bug 31333.
32862
32863         * appdomain.c: Set up GC finalisation thread.
32864
32865         * reflection.c: 
32866         * object.c: 
32867         * domain.c: Use gc.h macros for GC_malloc
32868         
32869 2002-11-15  Dick Porter  <dick@ximian.com>
32870
32871         * threadpool.c: 
32872         * threads.c:
32873         * appdomain.c: Removed mono_runtime_init_with_attach(),
32874         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
32875         merging the extra parameter with the existing function.  Removed
32876         unneeded code in mono_thread_attach().
32877
32878 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
32879
32880         * image.c (mono_image_loaded_by_guid): a method to get loaded
32881         images by guid. 
32882         (load_metadata_ptrs): we store the guid as string.
32883
32884 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
32885
32886         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
32887
32888         * metadata.c (mono_guid_to_string): imported method form Zoltan
32889         Varga (slightly modified)
32890
32891         * assembly.c (mono_assembly_open): load precompiled code
32892
32893         * loader.h (MonoMethod): we store the method token for use in the
32894         aot compiler. 
32895
32896 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32897
32898         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
32899         the hook function called when an assembly is loaded.
32900         
32901         * domain.c: Modified file.
32902         (mono_domain_assembly_load): removed hash table insertion of assemblies.
32903
32904         Fixes bug #33196.
32905
32906 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
32907
32908         * reflection.c: Map PEFileKind to the value expected by the WinNT
32909         image loader. 
32910
32911 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32912
32913         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
32914         Read until the buffer is filled completely.
32915
32916 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32917
32918         * icall.c: implemented MonoType.InternalGetEvent ().
32919
32920 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32921
32922         * appdomain.c: implemented InitAppDomainSetup. Delayed
32923         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
32924         the entry_assembly.
32925
32926         * assembly.c: base_dir is now an absolute path ending with
32927         G_DIR_SEPARATOR.
32928
32929         * icall.c: modified get_location according to the above changes.
32930
32931         * object.c: init AppDomain.SetupInformation for the default domain after
32932         we have the entry assembly.
32933
32934         * domain.c: when unloading a domain, setup = NULL.
32935
32936 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
32937
32938         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
32939
32940 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
32941
32942         * object.h, object.c: introduced mono_object_get_virtual_method ()
32943         to lookup the method invoked on an object when a callvirt is done on
32944         a method.
32945         * icall.c: make MethodInfo::Invoke() always do a virtual call.
32946
32947 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32948
32949         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
32950         current domain when loaded an assembly and failed to load it.
32951
32952         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
32953
32954 2002-10-31  Dick Porter  <dick@ximian.com>
32955
32956         * icall.c: 
32957         * file-io.h: 
32958         * file-io.c: Return the error status in a parameter, as the
32959         GetLastError() value has long since been blown away if we try and
32960         look it up in a subsequent internal call invocation.  Delete the
32961         GetLastError() internal call, because it's useless.
32962
32963 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
32964
32965         * class.[ch]: added cast_class to fix bug 29517
32966
32967 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
32968
32969         * marshal.c: create valid IL code in the filter clause:
32970         the new JIT is less forgiving:-)
32971
32972 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32973
32974         * icall.c: removed get_property internal call.
32975
32976 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
32977
32978         * appdomain.h domain.c: Added an ID to appdomains.
32979         
32980         * threads.c threads.h icall.c: Implement icall
32981         Thread:GetDomainID(), and remove unused icall 
32982         CurrentThreadDomain_internal.
32983
32984 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32985
32986         * icall.c: Don't recurse through the base types in GetConstructor.
32987         Fixes bug #32063. 
32988
32989 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
32990
32991         * mempool.h, mempool.c: added mono_mempool_empty() and
32992         mono_mempool_stats().
32993
32994 2002-10-23  Dick Porter  <dick@ximian.com>
32995
32996         * file-io.c: 
32997         * file-io.h: 
32998         * icall.c: Added MonoIO.GetFileType internal call
32999
33000 2002-10-17  Dick Porter  <dick@ximian.com>
33001
33002         * appdomain.c (mono_runtime_cleanup): Don't signal the async
33003         delegate semaphore before waiting for all threads to finish,
33004         because new threads can also call async delegates.  Fixes bug
33005         32004.
33006
33007         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
33008         of 3 seconds, in case another async job is queued.  (This part is
33009         needed because the bug fix reintroduced the 3s exit lag.)  This
33010         makes the mono_runtime_shutdown flag superfluous.
33011
33012 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
33013
33014         * reflection.c: include ehader size in method section headers.
33015         Really check for suplicated modules entries.
33016
33017 2002-10-17  Martin Baulig  <martin@gnome.org>
33018
33019         * debug-mono-symfile.c: Added back support for locals.
33020
33021 2002-10-14  Martin Baulig  <martin@gnome.org>
33022
33023         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
33024         MONO_TYPE_VOID.
33025
33026 2002-10-14  Martin Baulig  <martin@gnome.org>
33027
33028         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
33029         mono_class_get() instead of looking in the class cache. 
33030
33031 2002-10-13  Martin Baulig  <martin@gnome.org>
33032
33033         * debug-mono-symfile.c: Set version number to 28, include the
33034         signature in method names.
33035
33036 2002-10-13  Martin Baulig  <martin@gnome.org>
33037
33038         * debug-mono-symfile.h: Set version number to 27.
33039
33040 2002-10-11  Martin Baulig  <martin@gnome.org>
33041
33042         * gc.c: Don't register/unregister NULL pointers as disappearing links.
33043
33044 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33045
33046         * metadata.c, metadata.h: added helper function to allocate signatures.
33047
33048 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33049
33050         * icall.c: added internal call to get the location of machine.config.
33051
33052 2002-10-08  Martin Baulig  <martin@gnome.org>
33053
33054         * debug-mono-symfile.c: Ignore classes with a pending init for the
33055         moment.
33056
33057 2002-10-03  Dick Porter  <dick@ximian.com>
33058
33059         * threads.c: Freebsd pthread_t is a pointer
33060
33061 2002-10-03  Dick Porter  <dick@ximian.com>
33062
33063         * socket-io.c: Implemented GetHostName_internal
33064
33065 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33066
33067         * mono-config.c:
33068         (mono_config_parse_file): don't leak the text.
33069
33070 2002-10-02  Martin Baulig  <martin@gnome.org>
33071
33072         * debug-mono-symfile.c: Added support for methods.
33073
33074 2002-10-01  Martin Baulig  <martin@gnome.org>
33075
33076         * debug-mono-symfile.c: Don't emit methods and line numbers for
33077         the dynamic symbol file, just write the type table.  We can easily
33078         have an external helper program which creates a symbol file for an
33079         IL file.        
33080
33081 2002-10-01  Dick Porter  <dick@ximian.com>
33082
33083         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
33084         Only add the handle to the cleanup array when we're about to
33085         launch the thread.  Bug 31425 deadlocked when the test was run on
33086         mono under w32.
33087
33088 2002-10-01  Martin Baulig  <martin@gnome.org>
33089
33090         * debug-mono-symfile.c: Added support for properties.
33091
33092 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33093
33094         * reflection.c: unaligned store fix from Mark Crichton
33095         <crichton@gimp.org>.
33096
33097 2002-09-27  Martin Baulig  <martin@gnome.org>
33098
33099         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
33100         New interncall.
33101
33102 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
33103
33104         * assembly.h, assembly.c: use a sane API to hook into the assembly
33105         loading process instead of a useless special-purpouse hack
33106         (ngen needs a hook, too, for example).
33107
33108 2002-09-27  Dick Porter  <dick@ximian.com>
33109
33110         * threads.c (mono_thread_init): Call GetCurrentProcess() so
33111         io-layer can set up some process handle info.  Not needed on w32,
33112         but doesn't hurt either.
33113
33114         * process.c: Pass the program name in the second parameter to
33115         CreateProcess, so the path is searched.  Include the working
33116         directory. Implemented process name, process enumeration, and some
33117         process detail internal calls.
33118         
33119         * icall.c: Added internal calls for process lookup, and some
33120         process details
33121
33122 2002-09-26  Martin Baulig  <martin@gnome.org>
33123
33124         * assembly.c (mono_install_open_assembly_hook): New global
33125         function to install a function to be invoked each time a new
33126         assembly is loaded.
33127         (mono_assembly_open): Run this callback function if set.
33128
33129         * debug-mono-symfile.c: Put back line numbers for the dynamic
33130         symbol file and also record the .il file as source file.  This
33131         allows us to install the temporary symbol file as `file.dbg' just
33132         like a compiler-generated one.
33133
33134 2002-09-26  Nick Zigarovich <nick@chemlab.org>
33135
33136         * Corrected typo in gc.c (BOHEM vs BOEHM).
33137
33138 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33139
33140         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
33141         GetProperties. Also avoid calling g_slist_length in GetProperties and
33142         GetMethods.
33143
33144 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33145
33146         * reflection.c: avoid unaligned stores (bug spotted by
33147         Mark Crichton  <crichton@gimp.org>).
33148
33149 2002-09-25  Martin Baulig  <martin@gnome.org>
33150
33151         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
33152         instead of guint64 for addresses and added prologue/epilogue info.
33153
33154 2002-09-25  Martin Baulig  <martin@gnome.org>
33155
33156         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
33157         store line number info.  For the dynamic symbol file, we only need
33158         to provide the JIT generated dynamic line number info for the dynamic
33159         symbol file.
33160
33161 2002-09-25  Martin Baulig  <martin@gnome.org>
33162
33163         * debug-mono-symfile.h: Incremented version number.
33164
33165 2002-09-24  Martin Baulig  <martin@gnome.org>
33166
33167         * class.c (mono_debugger_class_init_func): New global function
33168         pointer variable.
33169         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
33170         call it.
33171
33172         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
33173         function.  This is called via the mono_debugger_class_init_func
33174         hook to add all types to the dynamic type table.
33175         (ves_icall_MonoDebugger_GetType): New interncall to get a class
33176         from its metadata token.
33177
33178         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
33179         New interncall for the debugger.
33180
33181 2002-09-24  Nick Drochak <ndrochak@gol.com>
33182
33183         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
33184         before using it in case it is null.
33185         
33186 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33187
33188         * metadata.c: allow custom modifiers in local var signatures
33189         (bug spotted by Zoltan Varga).
33190
33191 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33192
33193         * class.c: deal with the <Module> class that may have a NULL vtable.
33194         Eliminate warnings.
33195
33196 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33197
33198         * image.c, image.h: more strong name helpers.
33199         * monosn.c: more work: convert pem keys to cryptoapi format.
33200
33201 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33202
33203         * string-icalls.c: speedup IndexOf.
33204
33205 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33206
33207         * icall.c: updates from Zoltan.2.Varga@nokia.com.
33208
33209 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33210
33211         * icall.c: cleanup: use mono_object_domain ().
33212
33213 2002-09-23  Martin Baulig  <martin@gnome.org>
33214
33215         * debug-mono-symfile.c: Improved type support.
33216
33217 2002-09-22  Martin Baulig  <martin@gnome.org>
33218
33219         * debug-mono-symfile.c: Added support for reference types and strings.
33220
33221 2002-09-22  Martin Baulig  <martin@gnome.org>
33222
33223         * debug-mono-symfile.c: Started to work on the type table.
33224
33225 2002-09-21  Martin Baulig  <martin@gnome.org>
33226
33227         * debug-mono-symfile.c: Largely reworked the symbol table format.
33228         The symbol table is now incrementally updated each time a new
33229         method is added.  We're now also using our own magic and version
33230         so that you don't need to recompile all your classes if the
33231         dynamic table changes.
33232         (mono_debug_update_mono_symbol_file): Removed.
33233         (mono_debug_symfile_add_method): New function to add a method.
33234
33235 2002-09-21  Martin Baulig  <martin@gnome.org>
33236
33237         * icall.c
33238         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
33239         New interncall.
33240
33241         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
33242         New interncall to get a method from its metadata token.
33243
33244 2002-09-21  Martin Baulig  <martin@gnome.org>
33245
33246         * debug-mono-symfile.c: Create type table.
33247
33248 2002-09-20  Martin Baulig  <martin@gnome.org>
33249
33250         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
33251
33252 2002-09-20  Martin Baulig  <martin@gnome.org>
33253
33254         * debug-mono-symfile.c: Provide information about params and locals.
33255
33256 2002-09-20  Martin Baulig  <martin@gnome.org>
33257
33258         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
33259         New interncall.
33260
33261         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
33262         interncall to get a method from its metadata token.
33263
33264 2002-09-20  Martin Baulig  <martin@gnome.org>
33265
33266         * debug-mono-symfile.c: Added a few checks for method->header
33267         being non-NULL.  This should never happen, but for the moment
33268         let's use a g_warning() rather than a g_assert().
33269
33270 2002-09-19  Mark Crichton  <crichton@gimp.org>
33271
33272         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
33273         even if support for it isn't present.  Added an #ifdef to fix this.
33274
33275         * socket-io.c: Added checks back for Solaris support.
33276
33277 2002-09-19  Martin Baulig  <martin@gnome.org>
33278
33279         * debug-mono-symfile.c (read_string, write_string): Reflect latest
33280         changes in the symbol file format.
33281
33282 2002-09-18  Martin Baulig  <martin@gnome.org>
33283
33284         * debug-mono-symfile.c: Set version number to 21.
33285
33286 2002-09-18  Dick Porter  <dick@ximian.com>
33287
33288         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
33289         on netbsd.  Fixes bug 30051.
33290
33291 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33292
33293         * reflection.c:
33294         (set_version_from_string): little fix.
33295
33296 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33297
33298         * monosn.c, Makefile.am: added strong name utility.
33299         * reflection.h, reflection.c: implemented delayed signing,
33300         locale, version and hash id assembly attributes.
33301
33302 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33303
33304         * loader.c, metadata.c: load param attributes in signatures.
33305
33306 2002-09-16  Martin Baulig  <martin@gnome.org>
33307
33308         * debug-mono-symfile.c: Added string table with all method names.
33309
33310 2002-09-14  Martin Baulig  <martin@gnome.org>
33311
33312         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
33313         fast method lookup.
33314
33315 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33316
33317         * reflection.c: record the public key token of referenced assemblies.
33318
33319 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33320
33321         * image.c, image.h: added functions to get the strong name and the
33322         public key of an assembly.
33323         * pedump.c: use them.
33324
33325 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
33326
33327         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
33328
33329 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
33330
33331         * marshal.c (mono_marshal_get_managed_wrapper): Added
33332         MONO_TYPE_BOOLEAN 
33333
33334 2002-09-11  Martin Baulig  <martin@gnome.org>
33335
33336         * gc.c: Call GC_unregister_disappearing_link() on all links when
33337         finalizing them, this is necessary to aviod a crash in boehm's
33338         finalize handler.
33339
33340 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33341
33342         * gc.c: handle GetTarget for finalized objects spotted and fixed by
33343         nick@chemlab.org.
33344
33345 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
33346
33347         * icall.c: implemented MonoType::Module.
33348         * reflection.c, reflection.h: mono_module_get_object () from
33349         Tomi Pakarinen <tomi.pakarinen@welho.com>.
33350
33351 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33352
33353         * icall.c: ignore overridden methods in GetMethods ().
33354         Fix for FieldInfo::SetValue().
33355         * object.c: handle float/double in runtime invoke.
33356
33357 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33358
33359         * object.c: allow a constructor to be called again on an object.
33360
33361 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33362
33363         * class.h, class.c: move field layout code to it's own function and
33364         export it. Get an interface id earlier. Move fields in MonoClass
33365         so they are more cache friendly and align the bitfields.
33366         * loader.c: temporary handle get_param_names() for a runtime method.
33367         * reflection.c, reflection.h: more code to handle runtime creation of
33368         types.
33369
33370 2002-09-09  Martin Baulig  <martin@gnome.org>
33371
33372         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
33373         signature with the pinvoke field being set for the actual call.
33374
33375 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33376
33377         * icall.c: removed some unused icalls. Start of map of glib charsets
33378         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
33379
33380 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33381
33382         * debug-helpers.c: break infinite loop (found and fixed by
33383         Holger Arnold <harnold@gmx.de>).
33384
33385 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33386
33387         * icall.c: target may be null in create_delegate.
33388
33389 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33390
33391         * marshal.c: handle a boolean return type.
33392
33393 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33394
33395         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
33396
33397 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33398
33399         * gc.c: fix weakreferences.
33400
33401 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
33402
33403         * icall.c: added icall to get default codepage.
33404
33405 2002-09-03  Dick Porter  <dick@ximian.com>
33406
33407         * threads.h: 
33408         * threads.c: Use MonoThread instead of MonoObject where
33409         apropriate.
33410
33411         Store running thread objects in a hash table, so that we have all
33412         the info to hand when waiting for them to finish
33413         (means we don't need OpenThread() any more, so mingw builds should
33414         be fully functional again.)
33415
33416         * verify.c:
33417         * object.h: Added thread ID to MonoThread
33418
33419 2002-09-03  Martin Baulig  <martin@gnome.org>
33420
33421         * icall.c (System.Reflection.Assembly::get_location): New interncall.
33422
33423 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33424
33425         * icall.c: fixed leak in get_temp_path. Thanks lupus.
33426
33427 2002-09-03  Martin Baulig  <martin@gnome.org>
33428
33429         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
33430         argument to store the end address of the disassembled instruction.
33431
33432         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
33433         here from debug-symfile.h.
33434         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
33435         JIT into this struct.
33436         (MonoSymbolFile): Added `char *image_file' field.
33437         (MonoDebugGetMethodFunc): Removed.
33438         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
33439         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
33440         (mono_debug_find_method): New method.
33441
33442         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
33443         create a full symbol file.
33444         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
33445         and static symbol files.
33446         (mono_debug_find_method): The symbol file keeps an internal method hash,
33447         call this to get a MonoDebugMethodInfo from a MonoMethod.
33448
33449         * debug-symfile.[ch]: Removed.
33450
33451 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
33452
33453         * image.c (do_mono_image_open): Remove linker version check.
33454
33455 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
33456
33457         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
33458         wrappers for instance methods.
33459         
33460 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33461
33462         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
33463
33464 2002-08-28  Dick Porter  <dick@ximian.com>
33465
33466         * Makefile.am: Export HOST_CC for w32 builds
33467
33468 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33469
33470         * file-io.c process.c: MonoString are null terminated, no
33471         need for mono_string_to_utf16() anymore.
33472
33473 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33474
33475         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
33476
33477 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
33478
33479         * icall.c, reflection.h: speedup System.MonoType.
33480
33481 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33482
33483         * reflection.c: allow null as the value of a string argument in
33484         custom attributes constructors.
33485
33486 2002-08-27  Martin Baulig  <martin@gnome.org>
33487
33488         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
33489         `trampoline_address' field.
33490
33491 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
33492
33493         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
33494         check (fixes bug #29486) 
33495
33496 2002-08-27  Martin Baulig  <martin@gnome.org>
33497
33498         * debug-mono-symfile.c: Changed the file format in a way that allows us
33499         open it read-only and to use a specially malloced area for all the
33500         dynamic data.  We can now also generate a symbol file on-the-fly if we're
33501         debugging IL code and there is no MCS generated symbol file for it.
33502
33503 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33504
33505         * object.c: added a define for a good string and array
33506         creation speedup (not enabled by default because we need to deal with
33507         the synch stuff).
33508
33509 2002-08-26  Martin Baulig  <martin@gnome.org>
33510
33511         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
33512         function to create a dynamic symbol file.  This is used by the
33513         debugger to create a symbol file for IL code on-the-fly.
33514
33515 2002-08-26  Martin Baulig  <martin@gnome.org>
33516
33517         * loader.c (mono_lookup_pinvoke_call): Include the error message
33518         from g_module_error() in the error message.
33519
33520 2002-08-24  Martin Baulig  <martin@gnome.org>
33521
33522         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
33523         function to update the symbol file.  The symbol file is mmap()ed
33524         writable, but private.  This allows us to install the symbol file
33525         together with the assembly.
33526
33527 2002-08-24  Martin Baulig  <martin@gnome.org>
33528
33529         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
33530         but they can read the new symbol file format which mcs is now creating.
33531
33532         * debug-symfile.c (mono_debug_find_source_location): Moved to
33533         debug-mono-symfile.c; this is now operating on the new symbol file.
33534
33535 2002-08-23  Martin Baulig  <martin@gnome.org>
33536
33537         * debug-helpers.c (mono_method_desc_from_method): New function to get
33538         a MonoMethodDesc from a MonoMethod.
33539
33540 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33541
33542         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
33543         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
33544
33545 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
33546
33547         * string-icalls.[ch]: make helper methods static.
33548
33549 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33550
33551         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
33552         types to it and to SetValueInternal.
33553
33554         * object.c: Moved handle_enum label to its proper place. This was the
33555         f... bug! ;-)
33556
33557         This time i compiled mcs and gtk-sharp and they both work.
33558
33559 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33560
33561         * icall.c: reverted partially my previous patch until 
33562         object.c:set_value handles enums correcly.
33563
33564 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33565
33566         * icall.c:
33567         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
33568         (ves_icall_System_Environment_get_MachineName): removed warning when
33569         compiling under cygwin.
33570
33571 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33572
33573         * object.c: fixed field_get_value() for reference types.
33574
33575 2002-08-22  Dick Porter  <dick@ximian.com>
33576
33577         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
33578         Don't free a buffer while it's still needed.  Patch from Jonathan
33579         Liger <Jonathan.liger@wanadoo.fr>
33580
33581 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
33582
33583         * icall.c (ves_icall_System_Environment_get_Platform): Add new
33584         internal call.
33585
33586 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
33587
33588         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
33589         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
33590
33591         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
33592         we call unmanaged code which throws exceptions.
33593
33594 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33595
33596         * appdomain.h: added per-domain entry_assembly.
33597         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
33598         arguments.
33599         * icall.c: Assembly::GetEntryAssembly icall.
33600         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
33601         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
33602
33603 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33604
33605         * appdomain.h, gc.c: added mono_domain_finalize ().
33606
33607 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33608
33609         * object.c:
33610         (mono_print_unhandled_exception): changed g_warning by g_printerr
33611         because g_log has a 1024 characters limit (yeah, i got a big stack
33612         trace). Don't print exception name, that should be in ToString 
33613         returned string.
33614
33615 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33616
33617         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
33618         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
33619
33620 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33621
33622         * object.c:
33623         (mono_print_unhandled_exception): after previous commit, i realized
33624         that MS calls ToString on the exception. I changed this function to
33625         do that. This way we get stack_trace for free.
33626
33627 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33628
33629         * object.c:
33630         (mono_print_unhandled_exception): invoke Message property instead of
33631         getting 'message' field from Exception. Don't allocate memory for
33632         'trace' and 'message' if not needed.
33633
33634 2002-08-18  Dick Porter  <dick@ximian.com>
33635
33636         * unicode.c: Fix asserts to match Encoder.cs checks
33637
33638 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33639
33640         * marshal.c: fix unaligned store issue and a few wrong
33641         opcode argument types.
33642
33643 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33644
33645         * icall.c: added GetUninitializedObjectInternal internal call.
33646
33647 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
33648
33649         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
33650         to the right domain.
33651
33652 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
33653
33654         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
33655
33656         * class.c (class_compute_field_layout): set blittable to false for Strings
33657
33658         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
33659
33660 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33661
33662         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
33663         first chunk of code to create types at runtime. Code to
33664         handle ReflectedType/DeclaringType. Make reflection handles
33665         domain specific.
33666
33667 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33668
33669         * class.c: set correct name in arrays.
33670
33671 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
33672
33673         * appdomain.c (mono_domain_transfer_object): make it work with
33674         valuetypes. bug fixes.
33675
33676 2002-08-12  Dick Porter  <dick@ximian.com>
33677
33678         * object.h: Rename some parameters to avoid c++ keywords (Patch
33679         from Joseph Wenninger <kde@jowenn.at>)
33680
33681 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
33682
33683         * icall.c: added icall to implement Assembly.GetFile*.
33684
33685 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33686
33687         * reflection.h, reflection.c: code to embed managed resources.
33688
33689 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33690
33691         * class.c: move all the type size stuff into
33692         class_compute_field_layout().
33693
33694 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33695
33696         * class.c: ensure enums have always the correct instance size.
33697         * unicode.c: remove wrong assert.
33698
33699 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33700
33701         * assembly.c: fix mem corruption issue.
33702         * image.h, image.c: added mono_image_get_resource () to access
33703         managed resources.
33704         * icall.c: implemented Assembly.EntryPoint property and some
33705         Managed Resources related internalcalls.
33706
33707
33708 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33709
33710         * image.c, image.h: impemented mono_image_get_entry_point ().
33711         * appdomain.c: use mono_image_get_entry_point.
33712
33713 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33714
33715         * reflection.c: support the object type argument when loading
33716         custom attributes.
33717
33718 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
33719
33720         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
33721         String as return type.
33722
33723 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
33724
33725         * reflection.c: fix encoding of named args for custom attrs to match
33726         the ms implementation. Read them back when instantiating custom
33727         attributes.
33728
33729 2002-08-02  Radek Doulik  <rodo@ximian.com>
33730
33731         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
33732         by Dietmar as quick fix
33733         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
33734         16 as stack size, used on more places as quick fix before Dietmar
33735         will fix it properly
33736
33737 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33738
33739         * object.h, object.c: added accessors for fields and properties.
33740
33741 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33742
33743         * class.c, class.h: made mono_class_get_field_from_name ()
33744         loop on parent types.
33745         Added mono_class_get_property_from_name ().
33746
33747 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33748
33749         * class.c, class.h: move the code to setup the type vtable in its own
33750         function so that it can be reused also for types created at runtime.
33751         Eliminate the "class" identifier from the header file.
33752         * reflection.c: setup the vtable for enums so that we can create
33753         objects for use in SetConstant ().
33754
33755 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
33756
33757         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
33758         instead of the delegate itself as this pointer (bug #28383)
33759
33760 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
33761
33762         * marshal.c (mono_marshal_get_managed_wrapper): added return type
33763         conversions.
33764
33765 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33766
33767         * loader.c: don't set the pinvoke bit on icalls.
33768
33769 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
33770
33771         * debug-helpers.c (mono_method_full_name): only print a number to
33772         indicate wrapper type (so that the output is more readable in traces).
33773
33774 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
33775
33776         * class.c (mono_class_init): include method override patch from Paolo
33777
33778 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
33779
33780         * icall.c: fixed GetTypeCode().
33781
33782 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
33783
33784         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
33785         use real delegate invoke function to make it work with multicast
33786         delegates (fix bug# 28291).
33787
33788 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33789
33790         * object.c: load constant strings.
33791
33792 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33793
33794         * reflection.c: no magic numbers.
33795         * tabledefs.h: security action enum.
33796
33797 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33798
33799         * assembly.c: fix possible memory corruption.
33800
33801 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33802
33803         * reflection.h, reflection.c: added support for linking resources.
33804         * verify.c: check we have an updated corlib.
33805
33806 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
33807
33808         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
33809         string arrays.
33810         (mono_marshal_string_array): null terminate unmanaged string arrays.
33811         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
33812
33813 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33814
33815         * icall.c: Type.GetType () can now return also types from the
33816         calling assembly.
33817
33818 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33819
33820         * loader.h, loader.c: stack walking support.
33821         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
33822         GetCallingAssembly.
33823
33824 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
33825
33826         * marshal.c: added optimisations for blittable types 
33827
33828         * class.c (mono_array_class_get): do not set blittable attribute on arrays
33829         (mono_class_setup_mono_type): set blittable attribute for single
33830         and double.
33831
33832         * marshal.c (mono_string_utf8_to_builder): impl.
33833         (mono_string_builder_to_utf8): impl.
33834         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
33835
33836 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
33837
33838         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
33839         (mono_marshal_get_managed_wrapper): impl. byref types
33840
33841 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33842
33843         * icall.c:
33844         (search_method): don't display debug message. 
33845
33846 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33847
33848         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
33849
33850 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33851
33852         * appdomain.c: set the missing filename when throwing exception.
33853
33854 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33855
33856         * metadata.c (mono_type_size): code cleanup
33857         (mono_type_stack_size): removed some test code
33858
33859 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
33860
33861         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
33862         mono_get_exception_file_not_found now.
33863
33864         * exception.c (mono_exception_from_name_two_strings): New version
33865         that will call a constructor with two string arguments. 
33866         (mono_get_exception_file_not_found): New helper routine, used to
33867         report file-not-found errors.
33868
33869 2002-07-20  Dick Porter  <dick@ximian.com>
33870
33871         * process.h:
33872         * process.c: Pass file handles to CreateProcess
33873         
33874         * icall.c:
33875         * file-io.h:
33876         * file-io.c: Implemented CreatePipe
33877
33878 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33879
33880         * metadata.c (mono_get_param_info): set alignment for value types
33881
33882 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33883
33884         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
33885         Constify mono_domain_assembly_open().
33886         * loader.c: handle null namespace in icalls.
33887
33888 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33889
33890         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
33891         (emit_str_to_ptr_conv): marshal object as structs
33892
33893         * metadata.c (mono_type_to_unmanaged): marshal object as structs
33894
33895         * marshal.c (mono_marshal_get_runtime_invoke): support value types
33896
33897 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
33898
33899         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
33900         (mono_marshal_get_native_wrapper): we an now return value types
33901
33902 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33903
33904         * verify.c: more checks implemented.
33905
33906 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
33907
33908         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
33909         (fix bug #27695)
33910         (mono_marshal_get_native_wrapper): allow byref arguments
33911         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
33912         impl. PtrToStringXXX methods
33913         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
33914         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
33915         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
33916         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
33917         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
33918
33919 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33920
33921         * reflection.c: fix buglet in parsing an assembly name.
33922
33923 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33924
33925         * marshal.c (emit_ptr_to_str_conv): first impl.
33926
33927 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33928
33929         * object.c, class.h: cache the vtable in the class as suggested by
33930         vargaz@freemail.hu (Zoltan Varga).
33931
33932 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33933
33934         * class.h, loader.c: added mono_field_from_token().
33935         * verify.c: first cut of type checking code.
33936
33937 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33938
33939         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
33940
33941 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
33942
33943         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
33944         (fix bug #27782)
33945         (mono_marshal_get_remoting_invoke): impl.
33946         (mono_delegate_begin_invoke): impl.
33947         (mono_mb_emit_save_args): impl.
33948         (mono_delegate_end_invoke): impl.
33949         (mono_marshal_get_delegate_begin_invoke):
33950         (mono_marshal_get_delegate_end_invoke):
33951         (mono_marshal_get_delegate_invoke): generate a special name for
33952         those methods (including the signature) and associate them whith
33953         the delegate class. 
33954
33955 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
33956
33957         * reflection.[ch]: 
33958         (mono_reflection_type_from_name): now it has a MonoImage parameter
33959         which is used as the default image to search the type in. If the image
33960         is NULL or getting the type from it fails, it defaults to corlib.
33961
33962         * icall.c: changed 1 call to mono_reflection_type_from_name to match
33963         new parameter.
33964
33965 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33966
33967         * reflection.c: update the parameter table index.
33968
33969 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33970
33971         * domain.c: don't include the mark byte in the string hash.
33972
33973 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33974
33975         * icall.cs: icall for Type.GetTypeCode ().
33976         * verify: a couple of fixes and disabled local initialization checks.
33977
33978 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
33979
33980         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
33981
33982         * debug-helpers.c (mono_method_full_name): print the type of the
33983         runtime wrapper
33984
33985         * metadata.c (mono_signature_hash): a hash function for signatures
33986         (mono_signature_hash): better hash algorithm
33987
33988         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
33989
33990         * debug-helpers.c (mono_method_full_name): this can now generate
33991         method names with signatures
33992
33993         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
33994         method dont have this pointers.
33995
33996 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33997
33998         * reflection.c: fixup typebuilder tokens.
33999         * image.c: fix buglet.
34000         * marshal.h: remove whitespace.
34001         * metadata.h, metadata.c: reinstate code that was removed.
34002         * verify.c: handle catch directives and fix another couple of bugs.
34003
34004 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
34005
34006         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
34007         (mono_marshal_get_native_wrapper): make it comp. with the old code
34008         (mono_marshal_get_native_wrapper): support boolean
34009         (mono_marshal_get_managed_wrapper): support more types
34010
34011 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
34012
34013         * class.c (class_compute_field_layout): compute class->blittable attribute.
34014
34015 2002-07-09  Dick Porter  <dick@ximian.com>
34016
34017         * threads.c: Make the thread cleaning up cope with threads that
34018         call ExitThread()
34019
34020 2002-07-08  Radek Doulik  <rodo@ximian.com>
34021
34022         * reflection.c (method_encode_code): use non-translated values to
34023         compute finally_start, this fixes exception handling on ppc, yay!
34024
34025         * decimal.h (struct signscale): fix endianess
34026
34027 2002-07-07  Radek Doulik  <rodo@ximian.com>
34028
34029         * reflection.c: swap box_val and not val
34030
34031 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
34032
34033         * reflection.c, reflection.h: handle full assembly info in type name.
34034         Handle Type arguments when loading custom attributes.
34035         * icall.c: updated to use new mono_reflection_type_from_name () method.
34036
34037 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34038
34039         * loader.c:
34040         (method_from_memberref): also print assembly name when method not found.
34041
34042 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34043
34044         * icall.c:
34045         (ves_icall_TypeGetProperties): fixed bug #27473. 
34046
34047 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34048
34049         * reflection.c: display image name and token when cannot find the
34050         .ctor for an attribute.
34051
34052 2002-07-05  Martin Baulig  <martin@gnome.org>
34053
34054         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
34055
34056 2002-07-04  Dick Porter  <dick@ximian.com>
34057
34058         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
34059         compile on mingw.  This will cause mingw builds to not wait for
34060         subthreads to terminate after the main thread does.  I've lodged a
34061         bug with the mingw developers for them to wrap OpenThread().
34062
34063 2002-07-03  Dick Porter  <dick@ximian.com>
34064
34065         * threads.c: Store thread IDs instead of handles, because
34066         GetCurrentThread() returns a pseudohandle and therefore stores
34067         useless values.  mono_thread_cleanup() continues checking the
34068         array of threads until it is empty, to cope with subthreads
34069         spawning new threads after the main thread has finished.
34070
34071         * profiler.h:
34072         * profiler.c:
34073         * profiler-private.h: Pass the thread ID to thread profiler
34074         functions, instead of a handle
34075
34076 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34077
34078         * verify.c: fixes to make it more usable.
34079         * pedump.c: added --verify code to verify IL code in an assembly.
34080
34081 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34082
34083         * reflection.c: turn errors into warnings to allow compiling corlib.
34084
34085 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
34086
34087         * reflection.c: add special cases to compile corlib.
34088
34089 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34090
34091         * reflection.c: handle properties with only a set method.
34092
34093 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34094
34095         * opcodes.h: add enum with opcodes in opval order.
34096
34097 2002-07-01  Dick Porter  <dick@ximian.com>
34098         
34099         * object.h:
34100         * object.c (mono_runtime_run_main): Removed unneeded argument
34101
34102 2002-06-28  Martin Baulig  <martin@gnome.org>
34103
34104         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
34105
34106 2002-06-27  Dick Porter  <dick@ximian.com>
34107
34108         * threads.c: Store the handle in both the parent thread and in the
34109         subthread, to minimise the time between starting a new thread and
34110         storing its ID.
34111
34112 2002-06-26  Dick Porter  <dick@ximian.com>
34113
34114         * appdomain.c (mono_runtime_cleanup): Close the socket library
34115         after all the threads have finished, not before
34116
34117 2002-06-26  Martin Baulig  <martin@gnome.org>
34118
34119         * debug-symfile.c (mono_debug_find_source_location): Added
34120         `guint32 *line_number' argument.  If it's not NULL, store the line number
34121         there and return the file name without the line number.
34122
34123 2002-06-25  Dick Porter  <dick@ximian.com>
34124
34125         * icall.c:
34126         * process.h:
34127         * process.c: Process forking and other support functions
34128
34129 2002-06-25  Dick Porter  <dick@ximian.com>
34130
34131         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
34132         things dont happen when the image is closed.
34133         (mono_image_lookup_resource): Walk the resource section looking
34134         for a particular entry
34135
34136         * cil-coff.h: PE resource section decoding
34137
34138 2002-06-25  Dick Porter  <dick@ximian.com>
34139         
34140         * assembly.h:
34141         * assembly.c: 
34142         (mono_assembly_foreach): Accessor functions to walk the list of
34143         loaded assemblies
34144         (mono_assembly_set_main):
34145         (mono_assembly_get_main): Process methods need to know which
34146         assembly is the "main" one
34147
34148         * object.c (mono_runtime_run_main): Record the main assembly
34149
34150         * debug-helpers.c: Fix typo
34151
34152 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
34153
34154         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
34155         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
34156
34157 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34158
34159         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
34160
34161 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
34162
34163         * image.c (do_mono_image_open): Initialize reference count,
34164         otherwise we leak the MonoImage.
34165
34166 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
34167
34168         * reflection.c: small tweak to handle self-hosting.
34169
34170 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
34171
34172         * reflection.c: fix type name parse code.
34173
34174 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34175
34176         * reflection.c: break out of the loop.
34177         * image.c: special case corlib.
34178
34179 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34180
34181         * reflection.c: add all the custom attrs at the end to ensure the
34182         ctors have been properly initialized when the attributes are defined
34183         in the current assembly.
34184
34185 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34186
34187         * reflection.c: handle correctly multiple-nested types.
34188
34189 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
34190
34191         * row-indexes.h: fix typos.
34192         * reflection.c: adjust for typos and fix method_def_or_ref
34193         encoding in MethodImpl table.
34194
34195 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34196
34197         * reflection.c: fix entry point patching (thanks Serge!).
34198
34199 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
34200
34201         * verify.c: add check for System.Exception
34202
34203 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
34204
34205         * image.c, class.c: minifix for code just c&p'ed.
34206         * reflection.c: warning fix.
34207         * object.h, loader.h, domain.c: load also StringBuilder.
34208
34209 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34210
34211         * marshal.h, marshal.c: some support code to handle complex marshaling.
34212
34213 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34214
34215         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
34216         Better signatures with vtable error dump.
34217
34218 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
34219
34220         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
34221
34222 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
34223
34224         * icall.c (ves_icall_Type_GetField): impl.
34225
34226 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34227
34228         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
34229         to retrieve a marshal description blob for a field or param.
34230
34231 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
34232
34233         * reflection.h, reflection.c: change order of nested type emission
34234         to avoid table corruption. The NestedTypes table is sorted.
34235         * icall.c: change order of GetConstructor results to workaround mcs bug.
34236
34237 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34238
34239         * reflection.h, reflection.c: handle field and param marshal
34240         information.
34241
34242 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
34243
34244         * icall.c, marshal.c marshal.h: more Marshal class implementation.
34245
34246 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34247
34248         * reflection.c: fix call convention.
34249
34250 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34251
34252         * reflection.h, reflection.c: mono_image_get_memberref_token()
34253         takes a type instead of a class, now. Added
34254         mono_image_get_array_token() to create tokens for the special
34255         multi-dim array methods.
34256
34257 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
34258
34259         * assembly.c: handle modules (no assembly table). Split
34260         loading references in its own function.
34261         * class.c: handle moduleref resolution scope.
34262         * image.c, image.h: cache module name in image.
34263
34264 2002-06-07  Martin Baulig  <martin@gnome.org>
34265
34266         * reflection.c (mono_image_get_type_info): Only add a class layout entry
34267         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
34268
34269 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34270
34271         * icall.c: more signature fixes that used uint instead of int.
34272
34273 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34274
34275         * reflection.c: fixed signature of field refs.
34276
34277 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34278
34279         * class.c, reflection.c: handle typerefs of nested types
34280         (both on read and when writing files).
34281
34282 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
34283
34284         * icall.c: fix method signatures that tried to workaround the previous
34285         typo, d'oh!
34286
34287 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34288
34289         * debug-helpers.c: fix typo.
34290
34291 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34292
34293         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
34294         rewrote the PE/COFF writing code (our programs are understood by the
34295         ms runtime, now).
34296
34297 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
34298
34299         * gc.c, gc.h, icall.c: weakreference support.
34300
34301 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34302
34303         * Makefile.am, mono-config.c: use $(sysconfdir).
34304
34305 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34306
34307         * icall.c: changed default precision of Double.ToString() to 15.
34308         Fixed memory leak. Unified with Single.ToString.
34309
34310 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
34311
34312         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
34313
34314 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
34315
34316         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
34317         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
34318         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
34319         and myself.
34320
34321 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34322
34323         * debug-symfile.c, sysmath.c: yet more compilation fixes.
34324
34325 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34326
34327         * reflection.c, socket-io.c: more compilation fixes.
34328
34329 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34330
34331         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
34332         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
34333         unicode.c: warning and compiler compatibility fixes.
34334
34335 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34336
34337         * class.h, metadata.c: fixed warnings/compilation errors.
34338
34339 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34340
34341         * Makefile.am, mono-config.c, mono-config.h: configuration file
34342         support routines.
34343         * loader.c, loader.h: make Dll mapping configurable at runtime in the
34344         config file. Export methods to insert and lookup mappings.
34345
34346 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
34347
34348         * reflection.c: handle types and boxed objects in custom attr
34349         constructors.
34350
34351 2002-05-30  Martin Baulig  <martin@gnome.org>
34352
34353         * debug-symfile.c
34354         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
34355
34356 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
34357
34358         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
34359         to lookup the implmap row for a P/Invoke method.
34360         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
34361         P/Invoke method from the runtime on an as needed basis.
34362
34363 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
34364
34365         * metadata.c (mono_metadata_parse_signature): impl.
34366
34367 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34368
34369         * class.c: handle .pack directive.
34370
34371 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
34372
34373         * object.c: initialize static fields with RVA data.
34374
34375 2002-05-25  Martin Baulig  <martin@gnome.org>
34376
34377         * debug-symfile.c
34378         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
34379
34380 2002-05-24  Martin Baulig  <martin@gnome.org>
34381
34382         * debug-symfile.c
34383         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
34384         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
34385         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
34386
34387 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
34388
34389         * object.c: special case string ctros in invoke.
34390         * gc.c: silly whitespace changes.
34391
34392 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
34393
34394         * threadpool.[ch]: impl. a threadpool that can
34395         be used by mint and mono.
34396
34397 2002-05-22  Martin Baulig  <martin@gnome.org>
34398
34399         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
34400         The first argument is now a `MonoReflectionModuleBuilder *', the return
34401         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
34402         `methods' field to get the method builder.  The `token' argument is the
34403         unfixed token.
34404
34405         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
34406         invalid characters instead of g_assert_not_reached()ing.  This seems
34407         to be the behaviour of mscorlib.
34408
34409 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
34410
34411         * object.c (mono_runtime_invoke_array): applied patch from Rachel
34412         Hestilow to fix bug #25104
34413
34414 2002-05-21  Martin Baulig  <martin@gnome.org>
34415
34416         * debug-symfile.c (mono_debug_find_source_location): New function.
34417         Looks up an IL offset in the line number table and returns the source
34418         location as a string.
34419
34420 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34421
34422         * icall.c:
34423         (mono_double_ToStringImpl): changed %f by %g until we have something
34424         better.
34425
34426 2002-05-21  Nick Drochak  <ndrochak@gol.com>
34427
34428         * icall.c : Use different name for Math.Pow's icall.  Needed to check
34429         parameters first in C#.
34430
34431 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34432
34433         * icall.c, reflection.h: added icall to get info about an event.
34434
34435 2002-05-20  Radek Doulik  <rodo@ximian.com>
34436
34437         * object.c (mono_value_box): don't use memcpy for boxing on BIG
34438         endian
34439         (mono_value_box): don't use memcpy for small sizes on
34440         architectures with unaligned access
34441
34442 2002-05-20  Martin Baulig  <martin@gnome.org>
34443
34444         * reflection.c (mono_reflection_setup_internal_class): Don't crash
34445         if `tb->parent == NULL'.
34446         (mono_reflection_create_internal_class): New function.  This is
34447         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
34448         for enum types.
34449
34450         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
34451         New interncall.
34452
34453 2002-05-19  Martin Baulig  <martin@gnome.org>
34454
34455         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
34456         argument to get the length, don't default to the array length.
34457
34458 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
34459
34460         * assembly.c (mono_assembly_setrootdir): New function used to
34461         override the MONO_ASSEMBLIES directory.
34462
34463 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34464
34465         * icall.c: ValueType_GetHashCode() initialize local var.
34466
34467 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34468
34469         * reflection.c: sort custom attributes table.
34470
34471 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34472
34473         * reflection.c: support named args in custom attributes (write support).
34474
34475 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
34476
34477         * reflection.c: fix finally position calculation.
34478
34479 2002-05-15  Radek Doulik  <rodo@ximian.com>
34480
34481         * reflection.c: fixed endianess at many places
34482
34483         * icall.c (ves_icall_InitializeArray): comment out debug msg
34484
34485 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
34486
34487         * object.c (mono_unhandled_exception): new function to handle
34488         unhandled exceptions.
34489         (mono_unhandled_exception): call the UnhandledException event.
34490         (mono_runtime_delegate_invoke): impl.
34491
34492 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
34493
34494         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
34495         returns the RVA, not the direct pointer to the data. Handle the case
34496         when the class size is fixed.
34497
34498 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
34499
34500         * reflection.c: fix some endianess issues.
34501
34502 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
34503
34504         * object.c (mono_runtime_invoke): is now able to catch exceptions.
34505
34506         * threads.c (mono_thread_init): added a callback which is invoked
34507         at thread start.
34508
34509 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34510         
34511         * icall.c: make GetHashCode return non-negative values.
34512
34513 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34514
34515         * object.c, icall.c, gc.c: revert to address-based hashcode.
34516
34517 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
34518
34519         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
34520
34521 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34522
34523         * icall.c, class.c: special case <Module>.
34524
34525 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
34526
34527         * icall.c: fix bug in GetNow().
34528
34529 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
34530
34531         * object.c (mono_runtime_class_init): make sure that we call all
34532         static class constructors.
34533
34534 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
34535
34536         * reflection.c: sort methodsemantics table.
34537
34538 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
34539
34540         * reflection.h, reflection.c: honour init locals setting.
34541
34542 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
34543
34544         * icall.c: copied Double ToStringImpl for Single ToStringImpl
34545
34546 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34547
34548         * reflection.c: support ContructorBuilders in attribute blob creation.
34549
34550 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34551
34552         * reflection.c: some changes to build a binary that can be run
34553         directly in windows.
34554
34555 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34556
34557         * loader.c: print a big message when an icall can't be found.
34558
34559 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34560
34561         * string-icalls.c: fix bug 24248.
34562
34563 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
34564
34565         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
34566         icall.c, reflection.h: separate assembly loading by pathname and by
34567         assembly name. Use the MONO_PATH env var to search for assemblies.
34568
34569 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34570
34571         * assembly.c, image.h: add some support for assemblies
34572         with multiple modules.
34573         * class.c, class.h: export mono_class_from_typeref().
34574         * loader.c: remove duplicated code and use mono_class_from_typeref(),
34575         instead.
34576
34577 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34578
34579         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
34580         documentation says (the ECMA one is correct).
34581
34582 2002-05-02  Dick Porter  <dick@ximian.com>
34583
34584         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
34585         Don't name the synchronisation mutex.
34586
34587 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
34588
34589         * rand.c
34590         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
34591         Make the prototypes match.
34592         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
34593         Same.
34594
34595         * icall.c
34596         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
34597         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
34598         all systems have tm.tm_zone, so use strftime() with %Z to print
34599         the timezone abreviation into a temp string.
34600
34601         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
34602         rather than mono_array_addr() on a MonoString on Big Endian
34603         machines.
34604
34605 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
34606
34607         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
34608         fix bug 24041
34609
34610 2002-04-30  Dick Porter  <dick@ximian.com>
34611
34612         * socket-io.c: Cope with SOCKET being an integer rather than a
34613         pointer now.
34614
34615         * threads.c: Added Thread_free_internal, to deal with thread
34616         handle cleanup.  Moved calls to handle_store() and handle_remove()
34617         to start_wrapper(), so each can only be called once.  Allocate
34618         synchronisation blocks with GC_malloc(), and use GC finalisation
34619         to close the handles.
34620
34621         * icall.c: added System.Threading.Thread::Thread_free_internal
34622
34623 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34624
34625         * icall.c: support Environment.Exit, CommandLineArgs().
34626
34627 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
34628
34629         * object.c, object.h: added mono_runtime_run_main () and
34630         mono_runtime_get_main_args () for use in System.Environment.
34631
34632 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34633
34634         * gc.c: fix thinko, enable actual finalization since the jit is now
34635         fixed.
34636
34637 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34638
34639         * gc.c, object.c: take into account that an object may be offset wrt the address
34640         returned by GC_malloc().
34641
34642 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
34643
34644         * image.c: handle files without entries in the assembly table (modules).
34645
34646 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
34647
34648         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
34649         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
34650         allowed to be null when it's System.Object class setup.
34651
34652 2002-04-27  Martin Baulig  <martin@gnome.org>
34653
34654         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
34655         if `tb->parent == NULL' rather than crashing.
34656
34657 2002-04-28  Nick Drochak  <ndrochak@gol.com>
34658
34659         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
34660         calling acos() where asin() should have been called.
34661
34662 2002-04-26  Martin Baulig  <martin@gnome.org>
34663
34664         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
34665         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
34666         there's a subdirectory called `System', but we don't want to read that
34667         subdirectory as an assembly.
34668
34669 2002-04-25  Martin Baulig  <martin@gnome.org>
34670
34671         * debug-symfile.c: Reflect latest MonoString changes.
34672
34673 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34674
34675         * rand.c, rand.h: instance method icalls need to have an explicit
34676         this pointer as first argument in the C implementation.
34677
34678 2002-04-25  Nick Drochak <ndrochak@gol.com>
34679
34680         * icall.c: Fix typo in map for GetNonZeroBytes
34681
34682 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34683
34684         * string-icalls.c : String does now passes unit tests without any 
34685         errors, the following changes has been made:
34686         
34687         Implemented replace methods.
34688         Renaming of methods to (try) follow the standard.
34689         Fixed compare ordinal
34690         Made all memory allocated directly to function instead of via icall function.
34691         Small performance fix in is_in_array function
34692                         
34693  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
34694
34695         c (mono_string_Internal_ctor_charp_int_int):
34696         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
34697         sindex < 0, throw ArgumentOutOfRangeException instead of
34698         ArgumentNullException.
34699
34700         Added new check for length == 0, however
34701         I need to make it return String.Empty from the C code.
34702         
34703         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
34704         that calculate the length for us here.
34705         
34706         (mono_string_Internal_ctor_sbytep_int_int): Replaced
34707         mono_string_new_utf16 with mono_string_new, since value is utf8.
34708
34709 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34710
34711         * object.c: register the object for finalization if needed.
34712         Allocate one more char in the string for the terminating 0 char.
34713
34714 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34715
34716         * class.c, class.h, image.c: check if a type implemenst a destructor.
34717         Use the proper key for array class lookups.
34718         * icall.c: register the icalls in the System.GC class.
34719         * gc.c, gc.h: GC-related functions and icalls.
34720
34721 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34722
34723         * icall.c:
34724         * socket-io.c:
34725         * unicode.c: free some strings gotten from mono_string_to_utf8 and
34726         changed a couple of free () by g_free ().
34727
34728         * decimal.c: one-liner in the comments for decimal2string ().
34729
34730 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34731
34732         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
34733
34734 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34735
34736         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
34737         * object.c (mono_runtime_invoke_array) : handle null in params
34738
34739 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34740
34741         * string-icalls.c: fixed bug in split (one off bug)
34742
34743 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34744
34745         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
34746         * icalls.c: added String::Equals as internal method
34747
34748 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34749
34750         * threads.c: fixed bug in the double interlocked functions
34751
34752 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
34753
34754         * threads.c: implemented all of the new interlocked icalls.
34755         * string-icalls.c: fix a bug in insert.
34756         * icalls.c: added the icalls for interlocked, removed old string functions.
34757         
34758 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34759
34760         * loader.c: fix off-by-one error when reading argument names.
34761
34762 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34763
34764         * profiler.c: win32 counter implementation (untested).
34765         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
34766         (the latter needs testing and more complete impl. from win32 folks).
34767
34768 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
34769
34770         * object.c: mono_array_new_full workaround mono_array_class_get
34771         problem.
34772
34773 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34774
34775         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
34776         * object.h (mono_string_chars): Changed casting type.
34777
34778 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34779
34780         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
34781                            method signatures to use gunichar2 instead of gint16.
34782
34783 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
34784
34785         * object.h, object.c: domain-specific versions of mono_object_new and
34786         mono_array_new.
34787
34788 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
34789
34790         * object.c: changed String layout
34791
34792         * string-icalls.c (mono_string_Internal_ctor_chara): added
34793         internal string constructors.
34794
34795 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
34796
34797         * threads.c: pass 'this' to the thread start routine.
34798
34799 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34800
34801         * string-icalls.c: fix IndexOf and LastIndexOf. Now
34802         InternalCompareStr don't call twice mono_string_cmp_char for the last
34803         character. Improved performance in mono_string_cmp_char.
34804
34805 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34806
34807         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
34808         code into its own library: libmonoruntime.
34809
34810 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
34811
34812         * object.h, object.c: changed array format so that szarrays do not
34813         require a bounds structure.
34814         * icall.c, appdomain.c: support for new szarray format.
34815
34816 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34817
34818         * metadata.c: compare also the retuns type when comparing signatures:
34819         we didn't do this as an optimization since really overloaded methods
34820         must differ also in the arguments, but this doesn't work with
34821         low-level IL code (or when using explicit conversion operators: see
34822         bug#23498 for an example).
34823
34824 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34825
34826         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
34827
34828 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
34829
34830         * icall.c: make MonoType::GetElementType its own icall.
34831
34832 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34833
34834         * icall.c: remove MonoMethod_get_Name().
34835         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
34836         object.
34837
34838 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34839
34840         * string-icalls.c: optimized a few methods.
34841
34842 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34843
34844         * icall.c: added all new string internal calls
34845         * string-icalls.c: added, new string internal call implementation.
34846         * object.c: added mono_string_new_size for allocating a string a size
34847
34848 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
34849
34850         * object.c (mono_object_isinst): use the same code as in the
34851         optimized x86 version.
34852
34853 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34854
34855         * profiler.c: TSC-based timer code (faster and more accurate).
34856         Not hooked up in configure, yet (set USE_X86TSC to 1).
34857
34858 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
34859
34860         * profiler.c, profiler.h: track time spent compiling methods.
34861         * threads.c: track thread creation/destruction.
34862
34863 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
34864
34865         * profiler.c, profiler.h, profiler-private.h: profiling interface
34866         and sample implementation. Moved here so that it can be used also by
34867         the jit.
34868
34869 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
34870
34871         * reflection.c, reflection.h: keep types and other handles separate in
34872         the hash tables for referred tokens. Add guid for modules.
34873
34874 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34875
34876         * assembly.c: fix bugs found with valgrind.
34877         * metadata.h, metadata.c: added mono_metadata_guid_heap().
34878
34879 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
34880
34881         * threads: added icall support for getting current domain for
34882                    the thread.
34883  
34884 2002-04-13  Martin Baulig  <martin@gnome.org>
34885
34886         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
34887         (MonoDebugVarInfo): Added `index' field for register based addresses.
34888         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
34889         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
34890         `MonoDebugVarInfo *params' and `guint32 this_offset' with
34891         `MonoDebugVarInfo *this_var'.
34892
34893         * debug-symfile.c (relocate_variable): New static function to write
34894         a location description for a local variable or method parameter.
34895
34896 2002-04-12  Martin Baulig  <martin@gnome.org>
34897
34898         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
34899         stack offset and begin/end scope address of a local variable.
34900         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
34901         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
34902         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
34903
34904         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
34905         Added new relocation types for start/end scope of a local variable.
34906
34907 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34908
34909         * object.h: add mono_object_domain() macro.
34910         * reflection.c: handle typespecs.
34911         * icall.c: MonoMethod::get_Name() implementation.
34912
34913 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34914
34915         * icall.c: String::GetHashCode() icall implementation.
34916
34917 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34918
34919         * icall.c: String::IndexOfAny icall.
34920         * object.c, object.h: make array->max_length more useful.
34921         Intrduced mono_object_class() and mono_string_length() macros.
34922
34923 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34924
34925         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
34926         instead of g_unichar_isdigit.
34927
34928 2002-04-11  Nick Drochak  <ndrochak@gol.com>
34929
34930         * icall.c: Implement a simple Double.ToString().
34931
34932 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34933
34934         * appdomain.h: only io-layer.h is supposed to be included.
34935         * icall.c: explicitly import environ. Fix warning.
34936
34937 2002-04-10  Nick Drochak  <ndrochak@gol.com>
34938
34939         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
34940                 return true even if it's not Daylight Savings time.
34941                 Only return false for the case where the function isn't
34942                 implemented for a plaform (read Windows).
34943
34944 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34945
34946         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
34947         data with a mutex.
34948
34949 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
34950
34951         * mempool.c (mono_mempool_alloc): only use g_malloc when
34952         absolutely necessary.
34953
34954 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34955
34956         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
34957
34958         * class.c (mono_class_vtable): use domain mempool to allocate vtable
34959         (mono_class_proxy_vtable): use domain mempool
34960
34961 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34962
34963         * appdomain.h, appdomain.c: split initialization that requires the
34964         execution engine support into mono_runtime_init().
34965
34966 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34967
34968         * class.c (mono_class_init): don't include vtable inside MonoClass
34969         to save some memory, gather some statistics.
34970         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
34971
34972 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34973
34974         * icall.c: internalcall implementation for ValueType.Equals().
34975
34976 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
34977
34978         * object.c (mono_message_init): moved 
34979         (mono_runtime_exec_main): new arch. independent impl.
34980         (mono_runtime_invoke_array): new method - like
34981         mono_runtime_invoke, but you can pass an array of objects.
34982         (mono_remoting_invoke): new arch. independent impl.
34983         (mono_message_invoke): new arch. independent impl.
34984         (mono_runtime_class_init): new arch. independent impl.
34985         (mono_runtime_object_init): new arch. independent impl.
34986
34987 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34988
34989         * metadata.c, object.c, reflection.c: documented the exported
34990         functions.
34991
34992 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
34993
34994         * icall.c: simpler code to pass the assembly builder data to corlib.
34995         Implement GetNestedTypes() internalcall.
34996
34997 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34998
34999         * class.c: warn if a type can't be loaded.
35000
35001 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
35002
35003         * image.h: typedef MonoImageOpenStatus
35004         * types.h: removed unused file
35005         
35006 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
35007
35008         * icall.c: Enum_ToObject accepts enum value arguments.
35009
35010 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
35011
35012         * class.c: move initialization of properties, events and nested
35013         classes, so that they happen for interfaces, too.
35014
35015 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
35016
35017         * icall.c: cleanup some ugly casts in Array_SetValue*.
35018
35019 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
35020
35021         * icall.c: the values array fro enums is of the correct type, now.
35022         Implement (correctly) getFullName instead of assQualifiedName for
35023         MonoType.
35024         * reflection.h, reflection.c: added mono_type_get_name ().
35025
35026 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
35027
35028         * assembly.c, image.h: for each MonoImage, record from wich assembly
35029         it was loaded.
35030         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
35031         Make Type.Assembly work.
35032
35033 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
35034
35035         * debug-symfile.h: use char* instead of gpointer to avoid
35036         unnecessary casts.
35037
35038         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
35039
35040         * icall.c (ves_icall_InternalExecute): impl. FielSetter
35041         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
35042
35043 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
35044
35045         * icall.c (mono_message_init): impl. (code cleanup)
35046         (ves_icall_InternalExecute): impl. FieldGetter
35047
35048         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
35049         defined we call all (non-static)methods through the vtable. 
35050
35051 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
35052
35053         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
35054         finalizer even though the memory is still referenced (and the chunk of
35055         memory is not freed).
35056
35057 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
35058
35059         * assembly.c: fix brokeness.
35060
35061 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
35062
35063         * class.c: kill some warnings. Check explicit interface method
35064         implementation also without considering the namespace.
35065         Load also literal strings in static class data.
35066
35067 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
35068
35069         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
35070         (default_assembly_name_resolver): Make the resolver take the
35071         "base" directory where the assembly was originally defined, so we
35072         can load DLLs that are in the same directory as the assembly that
35073         is being referenced.
35074
35075 2002-03-28  Dick Porter  <dick@ximian.com>
35076
35077         * file-io.h: 
35078         * file-io.c:
35079         * socket-io.c: 
35080         * unicode.h: 
35081         * unicode.c: Warning cleanups
35082
35083 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
35084
35085         * object.h, reflection.h: use the correct type instead of MonoObject.
35086
35087 2002-03-28  Martin Baulig  <martin@gnome.org>
35088
35089         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
35090         (mono_debug_update_symbol_file): Initialize classes if necessary.
35091
35092 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
35093
35094         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
35095         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
35096
35097 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
35098
35099         * assembly.h: fix function prototype.
35100         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
35101         * mono-endian.h: use const cast.
35102
35103 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
35104
35105         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
35106
35107 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
35108
35109         * loader.c: don't assert when a typeref can't be loaded, give
35110         a chance to the runtime to trow an exception instead.
35111         * loader.h: fix warning.
35112
35113 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
35114
35115         * class.c (mono_class_proxy_vtable): added proxy support
35116
35117 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
35118
35119         * icall.c: removed last of PAL calls, added System.Environment
35120         * file-io.h, file-io.c: MonoIO implementation
35121         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
35122
35123 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
35124
35125         * appdomain.c: do not use the byte marker in ldstr table lookup.
35126         * debug-helpers.c: allow two ':' to separate class and method name.
35127         * object.c: allocate arrays bounds with the GC, too.
35128         * verify: add a few more checks.
35129
35130 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
35131
35132         * reflection.c: output also literal strings. Allocate parameter data
35133         with GC_malloc() (thanks, Martin, for catching this!).
35134
35135 2002-03-26  Martin Baulig  <martin@gnome.org>
35136
35137         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
35138         include the `this' offset in the `param_offsets'.
35139
35140 2002-03-25  Martin Baulig  <martin@gnome.org>
35141
35142         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
35143         mono_debug_get_class() function to get the classes. Added new
35144         relocation types for arrays and strings.
35145         (mono_debug_get_class): New static function to search in all
35146         referenced assemblies for a metadata token.
35147
35148         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
35149
35150 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
35151
35152         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
35153         hold gc-allocated objects. Make the string heap a stream like the
35154         others. Removed duplicated code when writing stream info.
35155         Added asserts to catch possible buffer overflows. Set the sorted map
35156         for tables that need sorting. Added some documentation.
35157
35158 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
35159
35160         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
35161         for interned strings and vtables.
35162
35163 2002-03-24  Martin Baulig  <martin@gnome.org>
35164
35165         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
35166         it in the array since it was created with g_slist_prepend().
35167
35168 2002-03-24  Martin Baulig  <martin@gnome.org>
35169
35170         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
35171         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
35172         (mono_debug_method_from_token): Renamed to
35173         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
35174         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
35175
35176         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
35177         relocation types.
35178
35179         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
35180
35181 2002-03-24  Martin Baulig  <martin@gnome.org>
35182
35183         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
35184         (mono_debug_method_from_token): New func.
35185
35186         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
35187         New interncall, calls mono_debug_local_type_from_signature().
35188         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
35189         calls mono_debug_method_from_token().
35190
35191 2002-03-23  Martin Baulig  <martin@gnome.org>
35192
35193         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
35194         specifies the number of bytes to be converted, not the array size.
35195         Return the number of chars, not the number of bytes.
35196         (ves_icall_iconv_get_chars): The `byteCount' argument
35197         specifies the number of bytes to be converted, not the array size.
35198
35199 2002-03-23  Martin Baulig  <martin@gnome.org>
35200
35201         * reflection.h (MonoReflectionSigHelper): New type.
35202
35203         * reflection.c (mono_reflection_sighelper_get_signature_local),
35204         (mono_reflection_sighelper_get_signature_local): New functions.
35205
35206         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
35207         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
35208         interncalls.
35209
35210 2002-03-23  Martin Baulig  <martin@gnome.org>
35211
35212         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
35213         is_writeable is set.
35214         (mono_raw_buffer_update): New function to write the modified map
35215         back to disk.
35216
35217         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
35218
35219         * debug-symfile.c (mono_debug_update_symbol_file): Call
35220         mono_raw_buffer_update() when done writing.
35221
35222 2002-03-23  Martin Baulig  <martin@gnome.org>
35223
35224         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
35225
35226         * debug-symfile.c: Added support for arguments and local variables.
35227
35228 2002-03-23  Dick Porter  <dick@ximian.com>
35229
35230         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
35231         protected by ifdefs, hence breaking the w32 build.
35232
35233 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35234
35235         * object.c: implement is_interned() the right way.
35236
35237 2002-03-21  Martin Baulig  <martin@gnome.org>
35238
35239         * debug-symfile.[ch]: New files to handle debugging information
35240         files. There's also support to dynamically update these symbol
35241         files to include machine dependent information.
35242
35243 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
35244
35245         * threads.c (mono_thread_create): new function to create thread
35246         from C
35247
35248 2002-03-20  Martin Baulig  <martin@gnome.org>
35249
35250         * icall.c (ves_icall_InternalInvoke): Create a new object if the
35251         method is a constructor.
35252         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
35253         points to ves_icall_InternalInvoke().
35254
35255 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
35256
35257         * file-io.c: Flush shouldn't throw exceptions.
35258
35259 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
35260
35261         * file-io.c: FileStream flush support; FileSetLength now
35262         restores file pointer.
35263
35264 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
35265
35266         * class.c: set image for pointer classes.
35267
35268 2002/03/19  Nick Drochak <ndrochak@gol.com>
35269
35270         * sysmath.c: Forgot one.
35271
35272 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
35273
35274         * sysmath.c: Avoid redefining existing names.
35275
35276 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
35277
35278         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
35279         handled by runtime as icall rather than dllimport from libm.so
35280         * file-io.c, file-io.h: fixed handle argument type.
35281
35282 2002-03-18  Dick Porter  <dick@ximian.com>
35283
35284         * reflection.c (mono_image_get_type_info): rename interface to
35285         iface, because of "#define interface struct" on windows.
35286
35287 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
35288
35289         * class.c, class.h: rename and export mono_ptr_class_get().
35290         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
35291         * reflection.c, reflection.h, icall.c: better/saner type name
35292         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
35293         method signatures.
35294
35295 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
35296
35297         * class.c (mono_class_init): removed hardcoded GHC_SLOT
35298
35299         * icall.c (ves_icall_InternalInvoke): impl.
35300
35301 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35302
35303         * reflection.c: output the interface map table, too.
35304
35305 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35306
35307         * class.c (class_compute_field_layout): separate computation of 
35308         static field layout
35309
35310 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
35311
35312         * icall.c: added System.Buffer support.
35313         * file-io.c: moved file icalls from PAL to FileStream.
35314
35315 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35316
35317         * icall.c (ves_icall_System_Object_GetHashCode): impl.
35318
35319 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
35320
35321         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
35322
35323 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35324
35325         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
35326
35327 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35328
35329         * debug-helpers.{c,h}: moved here from monograph some useful functions
35330         to locate a method by name/signature in a class or image. Included
35331         also a small and flexible IL disassembler.
35332
35333 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35334
35335         * reflection.c: fixup tokens in methods with small header size, too.
35336
35337 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
35338
35339         * object.c (mono_string_to_utf8): remove assert(!error), instead
35340         print a warning. 
35341
35342 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
35343
35344         * icall.c: update to the new mono_Array_class_get interface.
35345
35346 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35347
35348         * appdomain.c, object.c: Boehm-GC enable.
35349         * icall.c: make get_data_chunk() support split data requests.
35350         Ensure a class is initialized in more cases. Return only the first
35351         property found in GetProperties() or the compiler gets confused. 
35352         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
35353         * reflection.h, reflection.c: add fixup mechanism for field and method
35354         tokens. Initialize assembly->typeref in a single place. Output
35355         properties after events. Support custom attributes for events, too.
35356         Typo fix for paramter custom attrs.
35357
35358 2002-03-07  Martin Baulig  <martin@gnome.org>
35359
35360         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
35361
35362 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
35363
35364         * class.c (mono_array_class_get): fix. for multi. dim. arrays
35365
35366 2002-03-06  Martin Baulig  <martin@gnome.org>
35367
35368         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
35369         non-zero lower bounds. See testcases #F10-#F13.
35370
35371 2002-03-05  Martin Baulig  <martin@gnome.org>
35372
35373         * exception.c (mono_get_exception_argument_out_of_range): New exception.
35374
35375         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
35376         ves_icall_System_Array_GetValue(), only calculate the absolute array position
35377         here.
35378         (ves_icall_System_Array_SetValue): Likewise.
35379         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
35380         as argument and does the actual work. This function is used when copying a
35381         multi-dimensional array.
35382         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
35383         now do all the widening conversions of value types.
35384         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
35385
35386 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35387
35388         * class.c: remove some magic numbers and use the smbolic names,
35389         instead. Added init_events() to load event info at class init time.
35390         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
35391         and mono_metadata_methods_from_event().
35392         * reflection.h, reflection.c: added support for writing out the evnets
35393         related information.
35394
35395 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
35396
35397         * reflection.h, icall.c: use a different method (GetInterfaces)
35398         to gather interface info and add isbyref, isprimitive and
35399         ispointer to the ves_icall_get_type_info() return value.
35400
35401 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35402
35403         * class.h: stared adding support for events.
35404         * icall.c: split find_members implementation. Added debug icall to get
35405         the address of an object.
35406         * reflection.c: handle TypeBuilders in mono_type_get_object().
35407
35408 2002-03-01  Martin Baulig  <martin@gnome.org>
35409
35410         * icall.c (ves_icall_System_Array_GetLength): This must throw an
35411         ArgumentOutOfRangeException(), not an ArgumentException().
35412         (ves_icall_System_Array_GetLowerBound): Likewise.
35413         (ves_icall_System_Array_GetValue): Improved argument checking.
35414         (ves_icall_System_Array_SetValue): Improved argument checking.
35415
35416 2002-03-01  Martin Baulig  <martin@gnome.org>
35417
35418         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
35419         called with invalid arguments rather than just dying with g_assert().
35420         (ves_icall_System_Array_SetValue): Likewise.
35421         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
35422         raise a NotImplementedException instead.
35423         (ves_icall_System_Array_GetLength): Added argument checking.
35424         (ves_icall_System_Array_GetLowerBound): Added argument checking.
35425
35426 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
35427
35428         * object.h (mono_assert): new macros mono_assert and
35429         mono_assert_not_reached
35430
35431 2002-02-28  Martin Baulig  <martin@gnome.org>
35432
35433         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
35434         and "System::String::IsInterned" to "System::String::_IsInterned".
35435
35436 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
35437
35438         * icall.c: remove hacks for typebuilder. Added icall to create a
35439         modified type from a tybebuilder.
35440         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
35441         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
35442         to create a backing MonoClass for a TypeBuilder.
35443
35444 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35445
35446         * class.c, class.h: more refactoring of class init.
35447         Export mono_class_setup_mono_type() and mono_class_setup_parent().
35448
35449 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
35450
35451         * marshal.c, marshal.h: start of marshaling interface.
35452
35453 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35454
35455         * icall.c: fix order in assembly qualified name icall.
35456
35457 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35458
35459         * class.c: do not free str, since we store it in the hash table.
35460         * reflection.h: add label field to MonoILExceptionInfo.
35461         * reflection.c: handle references to more than one assembly. Handle
35462         case when there isn't a module created in the assembly.
35463
35464 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
35465
35466         * class.c: Fix typo. Start refactoring of class init code.
35467
35468 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
35469
35470         * appdomain.c: exit with 1 on error.
35471         * class.c: we already have the name in MonoClassField.
35472         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
35473         MonoStreamHeader instead of an offset of image->raw_metadata.
35474
35475 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
35476
35477         * appdomain.c (mono_init): Be even more descriptive about the error.
35478
35479 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
35480
35481         * appdomain.c: give the user an informative message when corlib can't
35482         be loaded.
35483
35484 2002-02-26  Martin Baulig  <martin@gnome.org>
35485
35486         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
35487         New icall to get the time zone data.
35488
35489 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35490
35491         * reflection.c: set virtual and raw size of section correctly.
35492         * threads.c: transfer domain information to newly created threads.
35493
35494 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35495
35496         * class.c: when instancing a class in a domain, load the default
35497         vaules for static fields from the constant table. Fix System.Enum to
35498         not be an enum.
35499         * icall.c: implement Object::GetType() internalcall. Implemented
35500         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
35501         Fixed checking of binding flags in find_members().
35502         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
35503         * reflection.c: handle enumerations when writing to the constant
35504         table. Use a different object cache for types.
35505
35506
35507 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
35508
35509         * object.c (mono_object_isinst): fix for arrays
35510
35511         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
35512
35513 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35514
35515         * object.c: don't use mprotect ()  and fix intern pool hash table
35516         lookup for big endian systems.
35517
35518 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35519
35520         * icall.c: change type_is_subtype_of () signature.
35521
35522 2002-02-21  Mark Crichton  <crichton@gimp.org>
35523
35524         * rand.c, rand.h: Added random number generator for
35525         System.Security.Cryptography classes.
35526
35527         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
35528
35529         * icall.c: Added System.Security.Cryptography calls.
35530
35531 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
35532
35533         * class.c, icall.c, metadata.c: better support for pointer types.
35534         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
35535         * reflection.c: Add support for getting custom attrs for properties
35536         and simplify some code.
35537
35538 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35539
35540         * icall.c: change getToken () and add custom attribute GetBlob()helper
35541         method.
35542         * reflection.h: add custom attrs array to the reflection builder structures.
35543         * reflection.c: encode and emit custom attributes for all the relevant
35544         reflection objects. Cache fieldref and methodref tokens. Change
35545         mono_image_create_token() interface to take a MonoDynamicAssembly.
35546         More complete custom attributes decoder. Load custom attributes for
35547         Assembly, Field, Method and Constructor objects, too. Make the
35548         returned array an Attribute[] one, not object[]. Added
35549         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
35550         custom attribute constructor.
35551
35552 2002-02-20  Dick Porter  <dick@ximian.com>
35553
35554         * icall.c:
35555         * rawbuffer.c:
35556         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
35557         problem code out for now).
35558
35559 2002-02-19  Radek Doulik  <rodo@ximian.com>
35560
35561         * object.c (mono_ldstr): use hash table to avoid multiple swapping
35562
35563 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
35564
35565         * icall.c: register the GetCustomAttributes method.
35566         * object.c, object.h: add mono_string_new_len ().
35567         * reflection.h, reflection.c: added mono_runtime_invoke(),
35568         mono_install_runtime_invoke(). Added
35569         mono_reflection_get_custom_attrs () to load custom attributes and
35570         create the attribute objects.
35571
35572 2002-02-19  Dick Porter  <dick@ximian.com>
35573         * threads-dummy-types.c:
35574         * threads-dummy-types.h:
35575         * threads-dummy.c:
35576         * threads-dummy.h:
35577         * threads-pthread-types.c:
35578         * threads-pthread-types.h:
35579         * threads-pthread.c:
35580         * threads-pthread.h:  Deleted obsolete files
35581
35582 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
35583
35584         * class.c (mono_class_vtable): runtime init the class when we
35585         allocate static class data.
35586
35587         * icall.c (ves_icall_System_Array_SetValue): check for null values.
35588
35589         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
35590         and String - but we will need generic marshalling support in the
35591         future. 
35592         (mono_init): set the domain name in a ms compatible way
35593
35594         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
35595         String[].
35596
35597 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
35598
35599         * object.c (mono_array_clone): use alloca() instead of g_malloc  
35600         for sizes
35601
35602         * appdomain.c (mono_domain_unload): impl.
35603
35604 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35605
35606         * appdomain.c, object.c: fix intern pool implementation.
35607         * class.c: fix alignment code.
35608
35609 2002-02-16  Radek Doulik  <rodo@ximian.com>
35610
35611         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
35612         and s2 > s1, just copy lower bytes to be compatible with little
35613         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
35614         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
35615
35616         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
35617         force big_endian to be 1 for big endian machines 
35618         (ves_icall_iconv_new_decoder): ditto
35619
35620 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
35621
35622         * socket-io.c (convert_sockopt_level_and_name): If the system
35623         doesn't define SOL_IP or SOL_TCP, get them by hand using
35624         getprotobyname() and caching the values (because this could be a
35625         slow operation).
35626         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
35627         Use the appropriate struct when the system does support it. Ie,
35628         not all systems have struct ip_mreqn so use struct ip_mreq when
35629         appropriate.
35630
35631 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
35632
35633         * reflection.c: handle finally clauses.
35634
35635 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
35636
35637         * socket-io.c: use g_snprintf() instead of snprintf.
35638
35639 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35640
35641         * reflection.c (mono_param_get_objects): Cast second argument to
35642         mono_method_get_param_names to a const char** to silence the
35643         compiler warning.
35644
35645         * appdomain.c (mono_domain_assembly_open): Put parens around the
35646         truth statement in the for-loop.
35647
35648         * unicode.c (iconv_convert): Got rid of a compiler warning about
35649         int i being unused when the system has a new iconv.
35650         (iconv_get_length): Same.
35651
35652         * image.c (load_class_names): Cast the second argument to
35653         g_hash_table_insert() to char* to hush compiler warnings about the
35654         arg being a const.
35655         (mono_image_open): Same here.
35656
35657         * socket-io.c: Don't conditionally include sys/filio.h or
35658         sys/sockio.h here anymore since we now get them from
35659         io-layer/io-layer.h
35660         (inet_pton): If the system doesn't support inet_aton, implement
35661         using inet_addr and also #define INADDR_NONE if it isn't defined
35662         by the system.
35663
35664 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
35665
35666         * metadata.c, metadata.h: added function to get packing and size info
35667         of a typedef.
35668         * reflection.h, reflection.c: handle field RVA data. Save info about
35669         the table layout if needed. Assign typedef indexes to all the types
35670         before dumping the info about them to avoid forward reference problems.
35671
35672 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
35673
35674         * socket-io.c (convert_sockopt_level_and_name): ifdef
35675         SO_ACCEPTCONN because it is not defined on my system (old debian)
35676
35677 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35678
35679         * opcode.c: use stddef.h to get NULL.
35680
35681 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35682
35683         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
35684         for FIONBIO, FIONREAD and SIOCATMARK.
35685         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
35686         define INADDR_NONE and besides, inet_addr() is deprecated and
35687         should not be used. Use inet_pton() instead - it also has the
35688         added bonus that it can easily handle IPv6 addresses as well.
35689         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
35690
35691 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
35692
35693         * decimal.c: remove _MSC_VER conditional.
35694
35695 2002-02-13  Dick Porter  <dick@ximian.com>
35696
35697         * socket-io.c: 
35698         * icall.c: Internal calls for Blocking, Select, Shutdown,
35699         GetSocketOption and SetSocketOption
35700
35701 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35702
35703         * assembly.cs: better resolver: use it instead of some kludgy
35704         code.
35705
35706 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
35707
35708         * reflection.c: the best way to speed-up the compiler is to avoid
35709         infinite loops.
35710
35711 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
35712
35713         * class.c (mono_class_vtable): changed the object layout
35714         (obj->vtable->class). 
35715         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
35716
35717 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35718
35719         * assembly.c: look for assemblies in the assembly dir, too.
35720
35721 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35722
35723         * class.c: fix thinko in mono_class_from_type().
35724
35725 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35726
35727         * exception.h, exception.c: added TypeLoadException.
35728         * object.h, object.c: added mono_array_clone ().
35729         * icall.c: handle throwOnError in AssemblyGetType().
35730         Added Array.Clone().
35731         * opcode.h, opcode.c: use a single value for the opcode val.
35732         Compile fix for non-gcc compilers.
35733
35734 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
35735
35736         * opcodes.c, opcodes.h: export interesting info about opcodes.
35737
35738 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
35739
35740         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
35741         icalls. 
35742
35743         * class.c (class_compute_field_layout): set element_class for enums
35744         (mono_class_create_from_typedef): set element_class for normal classes
35745
35746         * icall.c (ves_icall_System_Enum_get_value): impl.
35747
35748         * class.c (mono_class_create_from_typedef): do not set valuetype
35749         flag for System.ValueType and System.Enum
35750
35751 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
35752
35753         * unicode.c (iconv_convert): fix big endian problem.
35754
35755 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35756
35757         * class.c: add asserts if we are ever going to scribble over memory.
35758         * socket-io.c: not all systems have AF_IRDA defined.
35759
35760 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
35761
35762         * class.c (class_compute_field_layout): do not consider static
35763         fields to compute alignment
35764
35765 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
35766
35767         * appdomain.c (mono_appdomain_get): impl.
35768         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
35769
35770 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35771
35772         * icall.c: ignore "file://" prefix when loading an assembly.
35773
35774 2002-01-23  Dick Porter  <dick@ximian.com>
35775
35776         * socket-io.c:
35777         * icall.c:
35778         * Makefile.am: Added socket support
35779
35780 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35781
35782         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
35783         code back.  This should return the assemblies that are loaded by
35784         the runtime on behalf of an application domain. 
35785
35786         The current implementation is still broken, it just returns every
35787         assembly loaded, but until we get real applications domain this
35788         will do.
35789
35790 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
35791
35792         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
35793         AppDomain object.
35794
35795 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35796
35797         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
35798         the mono_class_from_name lookup.
35799         (ves_icall_get_parameter_info): ditto.
35800         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
35801         method.
35802         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
35803
35804 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
35805
35806         * class.c: load also nested classes on class init.
35807         System.ValueType instance methods gets passed boxed
35808         values, unless methods in derived classed that get a pointer to the
35809         data.
35810         * icall.c: use better name parsing code in GetType().
35811         * image.c, image.h: add mono_image_loaded ().
35812         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
35813         * reflection.c, reflection.h: added mono_reflection_parse_type().
35814
35815 2002-01-22  Veronica De Santis <veron78@interfree.it>
35816
35817         * icall.c : Added mapping of internal calls for Manual and Auto reset events
35818         * threads.c : Added the implementation of internal calls for events
35819         * threads.h : Added prototypes of internal calls for events
35820         
35821 2002-01-21  Radek Doulik  <rodo@ximian.com>
35822
35823         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
35824
35825 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
35826
35827         * class.c (mono_class_init): set min_align to 1 (instead of 0)
35828         (mono_class_value_size): use min_align
35829
35830 2002-01-20  Dick Porter  <dick@ximian.com>
35831
35832         * threads.h:
35833         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
35834         so it compiles on w32.
35835
35836 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
35837
35838         * metadata.c (mono_type_stack_size): impl.
35839
35840         * class.c (mono_class_get_field): impl. memberref token
35841
35842 2002-01-16 Veronica De Santis <veron78@@interfree.it>
35843
35844         * icall.h : Added the internal calls mapping for CreateMutex_internal
35845                     and ReleaseMutex_internal.
35846         * threads.h : Added the prototype of mutexes internal calls.
35847         * threads.c : Added the implementations of mutexes internal calls.
35848
35849 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35850
35851         * metaparse.h: removed unused file.
35852         * reflection.c, reflection.h: added stream_data_align () function 
35853         to align data in streams and keep stream aligned. Add support for
35854         exception support in method headers.
35855
35856 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
35857
35858         * unicode.c: make iconv_convert () return the number of bytess written
35859         in the output buffer.
35860
35861 2002-01-15  Dick Porter  <dick@ximian.com>
35862         * threads.c: Make the runtime's idea of infinite timeouts coincide
35863         with the class library's
35864
35865         Fix a particularly egregious bug in mono_thread_cleanup(). That
35866         code was so utterly bogus it must have been written on a Monday.
35867
35868 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35869
35870         * reflection.h: add subtypes field to TypeBuilder.
35871         * reflection.c: encode constants for literal fields.
35872         Handle subtypes. Fix user string token (and add a zero byte)
35873         at the end.
35874         
35875 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
35876
35877         * class.c (mono_class_init): bug fix: assign slot numbers for
35878         abstract methods.
35879
35880 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35881
35882         * reflection.c: don't try to output a code RVA for abstract methods.
35883         Small fixes for method header format. Output parameter info to the
35884         ParamDef table. Save method overriding info to MethodImpl table.
35885         Fix property support. Allow typedef.extends to be a type in the
35886         building assembly.
35887         * verify.c: fix off-by-one error.
35888
35889 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
35890
35891         * class.c: fix mono_class_from_mono_type () for szarray types.
35892         Remove unused cache check in mono_class_from_type_spec().
35893         * icall.c: *type_from_name () functions handle simple arrays and byref.
35894         * reflection.c: handle byref and szarray types. Handle methods without
35895         body (gets P/Invoke compilation working). Handle types and fields in
35896         get_token ().
35897         * reflection.h: add rank to MonoTypeInfo.
35898
35899 2002-01-10  Dick Porter  <dick@ximian.com>
35900
35901         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
35902         internal calls
35903
35904 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35905
35906         * icall.c: initialize class in type_from_handle ().
35907         Loop also in parent classes for get_method ().
35908         * reflection.c: properly encode class and valuetype types.
35909         Start on encoding TypeBuilder types. Handle fieldrefs.
35910         Use correct length when registering a user string.
35911         Handle ConstructorBuilder and MonoMethod in get_token ().
35912         Make mono_type_get_object () aware of cached types.
35913         * object.c: back out change to mono_string_new ().
35914
35915 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
35916         * object.c: mono_string_new should return a NULL when the string 
35917         passed in is NULL -- not try to deference it.
35918         
35919 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
35920
35921         * icall.c: hack to make IsSubType work for TypeBuilders.
35922         * reflection.c: emit constructors before methods.
35923         Retrieve param names in mono_param_get_objects().
35924
35925 2002/01/05  Nick Drochak  <ndrochak@gol.com>
35926
35927         * Makefile.am: fix list of headers and sources so automake 1.5
35928         doesn't complain. Removed \# at end of list.
35929
35930 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35931
35932         * reflection.c: get token for a method ref. Set return type of
35933         constructor to void.
35934         * loader.c: debug message.
35935         * class.c: typo fix.
35936
35937 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
35938
35939         * icall.c: fix array init with rank > 1. FindMembers
35940         loops in parent class as well.
35941         * image.c: do not insert nested types in name cache.
35942         * reflection.c: warning fix.
35943         * reflection.h: add override method (for interface impl).
35944
35945 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
35946
35947         * metadata.c: fix customattr decoding.
35948
35949 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
35950
35951         * rawbuffer.cs: Added native Win32 implementation, avoids using
35952         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
35953
35954 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
35955
35956         * class.c: make the low-level routines handle the cache.
35957
35958 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
35959
35960         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
35961
35962 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
35963
35964         * class.c: fix mono_array_element_size() for objects.
35965         * class.h, class.c: add properties to MonoClass and load them
35966         at init time.
35967         * icall.c: check with isinst() when assigning a value to an array
35968         instead of requiring the classes to match exactly.
35969         Implemented icall for System.Type::GetType().
35970         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
35971         enums. Handle bindingflags when looking for methods and fields.
35972         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
35973         and mono_metadata_methods_from_property().
35974         * reflection.h, reflection.c: added structures for propreties,
35975         parameters and enums. Implemented mono_property_get_object() and
35976         mono_param_get_objects().
35977
35978 2001-12-18  Dick Porter  <dick@ximian.com>
35979
35980         * file-io.c: Use mono_string_to_utf16() instead of
35981         mono_string_chars()
35982
35983         * object.c: Added mono_string_to_utf16(), which copies the non
35984         NULL-terminated MonoString into a new double-null-terminated
35985         buffer.
35986
35987 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
35988
35989         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
35990
35991 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
35992
35993         * file-io.c: raise exceptions if handle is invalid.
35994
35995 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
35996
35997         * assembly.c: yet another check for mscorlib.
35998         * class.c, class.h: load nesting info for classes.
35999         * icall.c: many new functions to support the Reflection classes.
36000         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
36001         * reflection.h, reflection.c: mono_image_create_token(),
36002         mono_assembly_get_object(), mono_type_get_object(),
36003         mono_method_get_object(), mono_field_get_object(): methods to return
36004         objects that parallel the C representation of assemblies, types,
36005         methods, fields.
36006
36007 2001-12-11  Dick Porter  <dick@ximian.com>
36008
36009         * icall.c:
36010         * file-io.c: Internal calls for file IO.
36011
36012 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
36013
36014         * tabledefs.h: missing FileAttributes.
36015         * verify.h, verify.c: use is_valid_string () to simplify and check for
36016         valid strings more correctly. Fix warnings and speeling.
36017         Check more tables: Filed, File, ModuleRef, StandAloneSig.
36018         Check code: branches, maxstack, method calls.
36019
36020 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
36021
36022         * object.c (mono_object_allocate): removed static, so that the jit
36023         can allocate value types.
36024
36025         * icall.c (ves_icall_System_DateTime_GetNow): impl.
36026
36027 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
36028
36029         * class.c: init enum types right away and register the
36030         token->MonoClass map in mono_class_create_from_typedef ().
36031         * verify.h, verify.c: first cut of the verifier.
36032         * pedump.c: add --verify switch to verify metadata tables.
36033         * tabledefs.h: add some missing enums.
36034
36035 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
36036
36037         * class.c (mono_install_runtime_class_init): impl.
36038         (mono_class_init): renamed mono_class_metadata_init to
36039         mono_class_init, also removed the metadata_inited flag
36040
36041         * object.c (mono_object_isinst): use faster algorithm
36042
36043 2001-11-30  Radek Doulik  <rodo@ximian.com>
36044
36045         * mono-endian.h: reverted last change
36046         added function prototypes
36047
36048         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
36049         add mono-endian.c back
36050
36051         * mono-endian.c: returned back, as Paolo pointed out, it's needed
36052         for unaligned access, I've mistaked it with endianess. I am
36053         sorry.
36054         (mono_read16): fix reverted endianess
36055         (mono_read64): ditto
36056         (mono_read32): ditto
36057
36058 2001-11-30  Dick Porter  <dick@ximian.com>
36059
36060         * exception.c: Implement mono_exception_from_name()
36061
36062 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
36063
36064         * metadata.h, metadata.c: remove params_size and locals_size and their
36065         calculation from the metadata code: they are only usefult to the
36066         interp.
36067
36068 2001-11-29  Radek Doulik  <rodo@ximian.com>
36069
36070         * object.c (mono_ldstr): swap bytes here, it's probably not the
36071         best place, but works for me now, I'll redo it once I know mono
36072         better, also note that I add PROT_WRITE and don't reset back, also
36073         note that it's only affects big endians, so x86 should be OK
36074
36075         * mono-endian.h (read16): use just glib macros for both endians
36076
36077         * mono-endian.c: removed as glib macros are used in in
36078         mono-endian.h so we don't need to care about endianess for read
36079         macros as glib does that for us already
36080
36081 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
36082
36083         * class.h, class.h: take minimum alignment into consideration so
36084         that the fields of a class remain aligned also when in an array.
36085
36086 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
36087
36088         * loader.h, loader.c: add mono_method_get_param_names().
36089         * class.c: 0-init class fields.
36090
36091 2001-11-26  Dick Porter  <dick@ximian.com>
36092
36093         * icall.c:
36094         * threads-types.h:
36095         * threads.c: New file that handles System.Threading on all platforms
36096
36097         * object.c: 
36098         * object.h: Remove the synchronisation struct from MonoObject,
36099         replace it with a pointer that gets initialised on demand
36100
36101         * Makefile.am: Replace all the system-specific threading code with
36102         a single file that uses the new wrapper library
36103
36104 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
36105
36106         * class.c, class.h: add mono_install_trampoline() so that the runtime
36107         can register a function to create a trampoline: removes the ugly
36108         requirement that a runtime needed to export arch_create_jit_trampoline.
36109         * object.h, object.c: added mono_install_handler() so that the runtime
36110         can install an handler for exceptions generated in C code (with
36111         mono_raise_exception()). Added C struct for System.Delegate.
36112         * pedump.c: removed arch_create_jit_trampoline.
36113         * reflection.c: some cleanups to allow registering user strings and
36114         later getting a token for methodrefs and fieldrefs before the assembly
36115         is built.
36116         * row-indexes.h: updates and fixes from the new ECMA specs.
36117
36118 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
36119
36120         * class.h, class.c: add enum_basetype field to MonoClass.
36121         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
36122         to get index in the constant table reated to a field, param or
36123         property.
36124         * reflection.h, reflection.c: handle constructors. Set public-key and
36125         version number of the built assembly to 0.
36126         * row-indexes.h: update from new ECMA spec.
36127
36128 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
36129
36130         * class.h, class.c: add a max_interface_id to MonoClass.
36131         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
36132         since it's used to do that. Added mono_type_type_from_obj().
36133         Make GetType() return NULL instead of segfaulting if the type was not
36134         found. Handle simple arrays in assQualifiedName.
36135         * object.h: add a struct to represent an Exception.
36136         * reflection.c: output call convention in method signature.
36137         Add code to support P/Invoke methods and fixed offsets for fields.
36138
36139 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
36140
36141         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
36142         the value.
36143         * icall.c: use mono_array_addr instead of array->vector: fixes the
36144         reflection image writing.
36145         * reflection.c: init call convention byte to 0 in method signature.
36146         Encode the property signature. Don't output property-related methods
36147         twice. Really process the properties for a type (don't cast a field to
36148         a property, my mom always told me that).
36149         Fix 64 bit issues in pointer alignment in a different and more
36150         readable way.
36151
36152 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
36153
36154         * loader.h: Removed type class from MonoDefaults, added monotype
36155
36156         * loader.c: Loaded MonoType, removed loading of Type
36157
36158         * icall.c (my_mono_new_object): Now returns a System.MonoType,
36159         and fills in System.Type._impl with a RuntimeTypeHandle rather
36160         than the actual MonoClass *
36161
36162         (ves_icall_type_from_handle): change from type_class to
36163         monotype_class
36164
36165         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
36166         implemented
36167
36168         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
36169         implemented
36170
36171         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
36172
36173         (ves_icall_System_Reflection_Assembly_GetType): implemented
36174
36175         (ves_icall_System_MonoType_assQualifiedName): implemented
36176
36177         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
36178
36179 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
36180
36181         * assembly.c (mono_assembly_open): Implement a cache for the
36182         assemblies. 
36183
36184         (mono_assembly_close): only destroy the assembly when the last
36185         reference is gone.
36186         
36187 2001-11-09  Dick Porter  <dick@ximian.com>
36188
36189         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
36190
36191 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
36192
36193         * class.c (mono_class_metadata_init): bug fix: compute the right slot
36194
36195 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
36196
36197         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
36198         from Martin Weindel.
36199         * object.h: add mono_string_chars ().
36200
36201 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
36202
36203         * reflection.c (build_compressed_metadata): Eliminates warnings
36204         and uses 64-bit clean code.
36205
36206         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
36207         (mono_type_equal): Change signature to eliminate warnings.
36208
36209 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
36210
36211         * icall.c, loader.c: remove the internalcall array constructors.
36212         Changes to match the new MonoArray structure.
36213         * object.h, object.c: an array object doesn't allocate an extra
36214         vector. Add mono_array_new_full () to create jagged arrays easily.
36215
36216 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
36217
36218         * metadata.h, metadata.c: add mono_metadata_field_info () to
36219         retreive all the info about a field from vairous tables.
36220         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
36221         * class.h, class.c: augment MonoClassField with more info.
36222         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
36223         policy and load a field's RVA if needed.
36224
36225 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
36226
36227         * class.c (mono_class_metadata_init): create a trampoline for all
36228         virtual functions instead of actually compiling them.
36229
36230 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
36231
36232         * class.h, class.c: include name in MonoClassField.
36233         * class.c: fix fundamental type of System.Object and System.String.
36234         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
36235         tokens in ldtoken.
36236         * icall.c: remove internalcalls for the Reflection stuff that is now
36237         done in C# code.
36238         * loader.c: mono_field_from_memberref () implementation.
36239         * mono-endian.c: thinko (s/struct/union/g).
36240         * object.c, object.h: make the mono_string_* prototypes actually use
36241         MonoString instead of MonoObject.
36242         * reflection.c, reflection.h: updates for changes in the reflection
36243         code in corlib: we use C structures that map to the actual C# classes.
36244         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
36245         fat method header if needed and use the info from the ILGenerator for
36246         methods. Handle fields in types. Misc fixes.
36247
36248 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
36249
36250         * class.c (mono_class_metadata_init): bug fix: always allocate
36251         space for static class data
36252
36253 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
36254
36255         * class.c (mono_compute_relative_numbering): use relative
36256         numbering to support fast runtime type checks.
36257
36258 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
36259
36260         * class.c (mono_class_create_from_typeref): added debugging output
36261         to print class name when MonoDummy is returned instead of real class
36262
36263 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
36264
36265         * class.c (mono_class_metadata_init): interface offset table now
36266         contains pointers into the vtable - this is more efficient for the jit
36267
36268 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
36269
36270         * class.c (mono_class_metadata_init): use a temporary vtable (the
36271         old algorithm only worked for the interpreter, but not for the jit)
36272
36273 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
36274
36275         * loader.c (method_from_memberref): use mono_class_get to get the
36276         class of an array instead of using System.Array directly.
36277         (mono_get_method): also add MEMBERREF methods to the method cache
36278         which usefull for arrays.
36279
36280 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
36281
36282         * pedump.c (arch_compile_method): added to compute vtable entry
36283
36284         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
36285         number of interfaces.
36286         
36287         * class.h: merged MonoArrayClass into MonoClass
36288
36289         * class.c (mono_class_create_from_typedef): compute the vtable size and
36290         allocate space to include the vtable inside MonoClass
36291         (mono_class_metadata_init): initialize the vtable
36292
36293 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
36294
36295         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
36296         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
36297         * image.c: endian fixes by Laurent Rioux.
36298         * object.h, object.c: rename MonoStringObject to MonoString and
36299         MonoArrayObject to MonoArray. Change some function names to conform to
36300         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
36301         guint16* as first argument, so don't use char*.
36302         Provide macros to do the interesting things on arrays in a portable way.
36303         * threads-pthread.c: updates for the API changes and #include <sched.h>
36304         (required for sched_yield()).
36305         * icall.c: updates for the API changes above.
36306         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
36307         platforms that need them.
36308
36309 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36310
36311         * class.c: set the correct type for all the fundamental
36312         type when loading the class.
36313
36314 2001-10-05  Dick Porter  <dick@ximian.com>
36315
36316         * threads-pthread.c (pthread_mutex_timedlock): Simple
36317         compatibility version for C libraries that lack this call.
36318
36319 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36320
36321         * class.c: MonoTypes stored in MonoClass are stored as
36322         fundamental MonoTypes when the class represents a
36323         fundamental type (System.Int32, ...).
36324         The TypeHandle return by ldtoken is a MonoType*.
36325         * icall.c: ves_icall_get_data_chunk () write out all the
36326         PE/COFF stuff. Implement ves_icall_define_method (),
36327         ves_icall_set_method_body (), ves_icall_type_from_handle ().
36328         * image.c: properly skip unknown streams.
36329         * loader.h, loader.c: add type_class to mono_defaults.
36330         * metadata.c, metadata.h: export compute_size () as
36331         mono_metadata_compute_size () with a better interface.
36332         Typo and C&P fixes.
36333         * pedump.c: don't try to print the entry point RVA if there is no entry point.
36334         * reflection.c, reflection.h: many cleanups, fixes, output method
36335         signatures and headers, typedef and typeref info, compress the metadata
36336         tables, output all the heap streams, cli header etc.
36337         * row-indexes.h: typo fixes.
36338
36339 2001-10-04  Dick Porter  <dick@ximian.com>
36340
36341         * object.h: Add a synchronisation mutex struct to MonoObject
36342
36343         * object.c (mono_new_object): Initialise the object
36344         synchronisation mutexes
36345
36346         * icall.c: System.Threading.Monitor internal calls
36347         
36348         * threads-pthread.h:
36349         * threads-pthread.c: System.Threading.Monitor internal calls
36350
36351         * threads-types.h: New file, includes the system-specific thread
36352         structures
36353         
36354         * threads-pthread-types.h:
36355         * threads-pthread-types.c: New files, handle pthread-specific
36356         synchronisation types
36357
36358         * threads-dummy-types.h: 
36359         * threads-dummy-types.c: New files of dummy support for
36360         thread-specific types
36361
36362         * metadata.c:
36363         * image.c:
36364         * pedump.c: include mono-endian.h not endian.h
36365         
36366         * Makefile.am: More threads files.
36367         Name mono-endian.h not endian.h
36368
36369 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
36370
36371         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
36372         stuff and implement a few more bits.
36373         * icall.c: a field needs to be dereferenced twice. Do not use the same
36374         name for two variables in the same scope.
36375         * image.c, image.h: cleanups.
36376
36377 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
36378
36379         * class.c (mono_class_metadata_init): bug fix: compute the right size
36380
36381 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
36382
36383         * icall.c: implemented some of the Reflection internalcalls.
36384         * image.c, image.h: start writing out the PE/COFF image.
36385         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
36386         that does the reverse than decode_blob_size ().
36387         * object.c: use mono_metadata_encode_value (). Move here
36388         temporary implementation of mono_string_to_utf8 ().
36389         * rawbuffer.c: make malloc_map static.
36390
36391 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36392
36393         * metadata.c: fix type comparison for arrays.
36394         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
36395         Added a couple of new classes to monodefaults.
36396         * icall.c: added a couple of Reflection-related internalcalls.
36397         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
36398         Added a byval_arg MonoType to MonoClass.
36399
36400 2001-09-28  Dick Porter  <dick@ximian.com>
36401
36402         * icall.c:
36403         * threads-pthread.h: 
36404         * threads-pthread.c: Implemented internal calls for
36405         LocalDataStoreSlot operations.  Applied mutexes around all shared
36406         data.  Reworked the thread creation and Start() operations to
36407         avoid a race condition.
36408         
36409         * threads-dummy.h:
36410         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
36411
36412 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
36413
36414         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
36415
36416 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
36417
36418         * class.c, loader.c: warn and return NULL instead of erroring out.
36419         * icall.c: added System.AppDomain::getCurDomain().
36420         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
36421
36422 2001-09-25  Dick Porter  <dick@ximian.com>
36423
36424         * threads-pthread.h:
36425         * threads-pthread.c: Implemented timed thread joining and added
36426         System.Threading.Thread::Join_internal internal call
36427
36428         * icall.c: Added System.Threading.Thread::Join_internal internal call
36429
36430         * threads-dummy.h:
36431         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
36432
36433 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
36434
36435         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
36436         mono_string_intern () to implement the semantics of the ldstr opcode
36437         and the interning of System.Strings.
36438         * icall.c: provide hooks to make String::IsIntern and String::Intern
36439         internalcalls.
36440
36441 2001-09-23  Dick Porter  <dick@ximian.com>
36442
36443         * threads-dummy.c: 
36444         * threads-dummy.h: New files of dummy threading routines
36445
36446         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
36447         support code based on system specifics
36448
36449         Rename PTHREAD_LIBS to THREAD_LIBS
36450         
36451 2001-09-23  Dick Porter  <dick@ximian.com>
36452
36453         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
36454         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
36455         internal calls.
36456         (mono_thread_init): Set up a Thread object instance to return when
36457         the main thread calls Thread.CurrentThread
36458         (mono_thread_cleanup): Wait for all subthreads to exit
36459
36460         * icall.c: New internal calls for System.Threading.Thread::Sleep
36461         (including Schedule) and CurrentThread
36462
36463         * threads.h: New file, to insulate thread-specific stuff from the
36464         rest of the code
36465
36466 2001-09-21  Dick Porter  <dick@ximian.com>
36467
36468         * threads-pthread.h: 
36469         * threads-pthread.c: New file, for handling pthreads-style
36470         threading support.  Start() now starts a new thread and executes
36471         the ThreadStart delegate instance.
36472
36473         * icall.c: Added the internalcall for
36474         System.Threading.Thread::Start_internal
36475
36476         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
36477
36478 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
36479
36480         * loader.c: work around the different signatures for delegates
36481         constructors csc generates in compiled code vs the ones compiled in mscorlib.
36482
36483 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36484
36485         * class.h, class.c: add mono_class_get_field_from_name ().
36486         * *: Fix C comments and other ANSI C issues.
36487
36488 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
36489
36490         * endian.h, assembly.c: fix some endianness issues.
36491
36492 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
36493
36494         * loader.h, load.c: add delegate_class to mono_defaults.
36495         Handle runtime provided methods in mono_get_method ().
36496
36497 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
36498
36499         * loader.c (mono_get_method): use pinvoke for internal call
36500
36501         * icall.c: use pinvoke for internal call
36502
36503         * loader.c (method_from_memberref): set the method name
36504
36505 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
36506
36507         * metadata.c: help the compiler generate better code for
36508         mono_class_from_mono_type ().
36509
36510 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
36511
36512         * class.c (mono_class_metadata_init): delayed computing of the
36513         class size to mono_class_metadata_init ()
36514
36515 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
36516
36517         * class.c, class.h: add an interfaces member to MonoClass.
36518         * image.c, image.h: add assembly_name field to MonoImage
36519         from the assembly table.
36520         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
36521
36522 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36523
36524         * class.c: Handle Array in mono_class_from_mono_type ().
36525         * metadata.c, pedump.c: some endian fixes.
36526
36527 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36528
36529         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
36530         * metadata.c: fix small problem introduced with the latest commit.
36531
36532 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
36533
36534         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
36535         We don't need a MonoMetadata pointer anymore to compare signatures in
36536         mono_metadata_signature_equal (), update callers.
36537         Reduced memory usage an number of allocations for MonoMethodHeader and
36538         MonoMethodSignature.
36539
36540 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
36541
36542         * metadata.c: added compare for szarray.
36543
36544 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
36545
36546         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
36547         and add a couple more types to it and mono_defaults. Give an hint on
36548         classes that need implementing in our corlib and are referenced
36549         in mscorlib.
36550
36551 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
36552
36553         * class.h, class.c: keep track if a class is also an Enum.
36554         * loader.c: Implement a couple more types for use in libffi
36555         marshalling. Gives better diagnostics when failing to dlopen
36556         a library. Set method->klass for P/Invoke methods, too.
36557
36558 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
36559
36560         * class.c, class.h: add a MonoType this_arg to MonoClass that
36561         represents a pointer to an object of the class' type that
36562         can be used by the interpreter and later the type cache.
36563         Add best guess alignment info for valuetype objects.
36564
36565 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
36566
36567         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
36568         into MonoType: one less level of indirection and allocation and
36569         simplifies quite a bit of code. Added cache for MonoTypes that are
36570         used frequently, so that we don't need to allocate them all the time.
36571
36572 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
36573
36574         * class.c (mono_class_create_from_typedef): System.Enum is also a
36575         value type, although it does not derive from System.ValueType
36576         (maybe a bug in the ms compiler?)
36577
36578         * metadata.c (mono_type_size): return the right size for value types
36579
36580         * loader.c (mono_get_method): only initialize method header if not abstract
36581
36582         * class.c (mono_class_from_mono_type): use mono_default values. 
36583
36584 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
36585
36586         * *: use MonoClass pointers instead of <type_tokens>
36587         
36588         * class.h: new flag: metadata_inited.
36589
36590         * class.c (mono_class_metadata_init): impl.
36591         (mono_class_instance_size): impl.
36592         (mono_class_data_size): impl.
36593
36594 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36595
36596         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
36597         MonoClass now has the name and name_space fields. 
36598         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
36599         mono_get_method () takes and optional MonoClass as argument.
36600         Removed mono_typedef_from_name() and added mono_class_token_from_name()
36601         instead that takes advantage of a map from class names to typedef
36602         tokens in MonoImage.
36603
36604 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
36605
36606         * metadata.c: zero is not a valid alignment boundary.
36607         Merge MONO_TYPE_VOID in default decoding code.
36608
36609 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
36610
36611         * image.h: merged MonoMetadata into MonoImage
36612
36613         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
36614         identify the type of elements.
36615
36616 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
36617
36618         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
36619         * cil-coff.h: split MonoMSDOSHeader and add size info.
36620         * image.c: add some consistency checks.
36621         * metadata.c: fix row size computation: one programmer
36622         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
36623         add explanation for the locator routine.
36624         Fix decoding of size in method header.
36625         
36626 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
36627
36628         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
36629         (g_concat_dir_and_file): Bring g_concat_dir_and_file
36630         function from gnome-libs.  This uses the right path separator
36631         based on the OS, and also works around a bug in some systems where
36632         a double slash is not allowed. 
36633         (default_assembly_name_resolver): Use g_concat_dir_and_file
36634         (mono_assembly_open): ditto.
36635
36636 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
36637
36638         * metadata.c (mono_metadata_signature_equal): impl.
36639
36640         * *: void is now a realy MonoType (instead of using NULL)
36641         
36642         * metadata.c (do_mono_metadata_parse_type): use
36643         mono_metadata_parse_type to parse void value.
36644
36645 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
36646
36647         * metadata.c, metadata.h: in the signature and method header store
36648         only the space required for holding the loca vars and incoming arguments.
36649
36650 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
36651
36652         * metadata.c (do_mono_metadata_parse_type): treat void like any
36653         other type (instead of assigning NULL);
36654
36655 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
36656
36657         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
36658
36659 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
36660
36661         * image.c (do_mono_image_open): added a cache for arrays.
36662
36663 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36664
36665         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
36666         decode a single column from a row in a metadata table and changes
36667         to take advantage of it in the typedef locator (gives a nice speed up).
36668         Store offset info for function params.
36669
36670 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
36671
36672         * image.h (MONO_IMAGE_IS_CORLIB): removed 
36673
36674 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
36675
36676         * assembly.c: how could mono_assembly_close () had ever worked?
36677         * metadata.c, metadata.h: provide offset info for local vars.
36678         Implement mono_type_size () to take care of alignment as well
36679         as size (it was mono_field_type_size in cli/class.c before).
36680
36681 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
36682
36683         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
36684
36685         * assembly.h (CORLIB_NAME): set to corlib.dll
36686
36687         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
36688
36689 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36690
36691         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
36692         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
36693         tokentype.h: massive namespace cleanup.
36694
36695 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36696
36697         * metadata.h, metadata.c: decode exception clauses when parsing method header.
36698
36699 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
36700
36701         * metadata.c (mono_metadata_free_type): added check for type !=
36702         NULL (void) before calling mono_metadata_free_type()
36703
36704 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
36705
36706         * metadata.h, row_indexes.h: added header with enumerations to use
36707         to index in the columns from tables in metadata and to decode coded
36708         tokens: we should start using this instead of embedding magic numbers
36709         all over the code.
36710
36711 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
36712
36713         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
36714         Move metadata_t info from cli_image_info_t to MonoImage, where
36715         it's easily accessible. Changed all the uses accordingly.
36716         Added the method and class caches to MonoImage.
36717         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
36718         and mono_metadata_decode_value () signature to be more consistent
36719         with the other parse functions (and simplify code). Taken advantage
36720         of zero-length array allocation with GCC. Removed reduntant (and
36721         wrong) MonoFieldType struct and use MonoParam instead. Changed
36722         mono_metadata_parse_field_type () to use common code for parsing.
36723         Added mono_metadata_typedef_from_field () and
36724         mono_metadata_typedef_from_method () to lookup a typedef index from a
36725         field or method token.
36726         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
36727
36728 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
36729
36730         * metadata.c (mono_metadata_parse_field_type): Implement. 
36731         (do_mono_metadata_parse_type): Split engine from
36732         mono_metadata_parse_type, so that we can create smaller structures
36733         for things that just have one pointer to the MonoType (look at
36734         the MonoFieldType)
36735
36736 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
36737
36738         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
36739         as Jan Gray found out, it is incorrect. 
36740
36741 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
36742
36743         * assembly.c: Implement asssembly loading.  This loads an image
36744         and loads all the referenced assemblies.  Come to think of it, we
36745         could always do lazy loading of the assemblies. 
36746
36747         * image.c (mono_image_open): Keep loaded images in a hashtable.
36748
36749         * image.h (MonoImage): Add reference count.
36750
36751 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
36752
36753         * assembly.c (mono_assembly_open): Keep track of the file name in
36754         case the assembly has no ASSEMBLY table.
36755
36756         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
36757         from get.c here.
36758
36759 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
36760
36761         * metadata.c, metadata.h: decode local vars in method header
36762         parse function. Change callers accordingly.
36763
36764 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
36765
36766         * metadata.h, cil-coff.h: protect against multiple inclusion.
36767         Added some new structures to hold information decoded from metadata:
36768         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
36769         and relevant decoding/free functions.
36770         * metadata.c: implement decoding functions. Add warning for out of bounds
36771         index in mono_metadata_locate(). Implement mono_get_method () to retreive
36772         all the info about a method signature and invocation. Remove check on
36773         uninitialized local var in parse_mh() and fix memory leak.
36774
36775 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
36776
36777         * metadata.h: More macros.
36778
36779         * tokentype.h: New file.
36780
36781 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
36782
36783         * assembly.c: added a consistency check and initialize
36784         some structures with g_new0().
36785         * metadata.c: fixed a couple more bugs in table size computation
36786         and add other checks for out-of bound access to metadata.
36787
36788 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
36789
36790         * metatada.c: fix bugs computing table sizes. Spew a
36791         warning when index in string heap is out of bounds.
36792
36793 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
36794
36795         * metadata.h: Add a couple of macros to manipulate tokens. 
36796
36797 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36798
36799         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
36800         cli_section_tables).
36801
36802 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
36803
36804         * metadata.c (mono_metadata_user_string): New function, provides
36805         access to the UserString heap. 
36806
36807 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
36808
36809         * metadata.c: Add inline documentation.
36810
36811 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
36812
36813         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
36814         files. 
36815
36816 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
36817
36818         * typeattr.h: New file, TypeAttribute flags. 
36819
36820 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
36821
36822         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
36823         mono_assembly_ensure_section): Section loading code.
36824         (load_section_tables): Load the sections.
36825
36826         * mono/metadata/metadata.c (mono_metadata_locate_token,
36827         mono_metadata_locate): Functions to locate the information
36828         definition given a token or a table and an index.
36829         (mono_metadata_compute_table_bases): New.
36830         (compute_size): New function to compute the sizes of the various
36831         tables.
36832
36833         * mono/metadata/metadata.h: Finish listing the different index
36834         types. 
36835
36836         * mono/metadata/pedump.c: Improve to dump new information.
36837
36838 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
36839
36840         * mono/metadata/metadata.c: Entered all the tables matching
36841         Beta2. 
36842
36843         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
36844
36845
36846
36847