2010-04-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
[mono.git] / mono / metadata / ChangeLog
1 2010-04-05 Gonzalo Paniagua Javier <gonzalo@novell.com>
2
3         * threadpool.c: if there are no waiting threads, try to start a new
4         one. This fixes the not-so-random hangs in System.ServiceModel tests.
5         No need to use InterlockedCompareExchange to read volatile variables.
6
7 2010-04-05 Rodrigo Kumpera  <rkumpera@novell.com>
8
9         * verify.c (verify_type_compatibility_full): Fail mixed valuetype
10         and reference types that point to the same class.
11
12         Fixes #565598.
13
14 2010-04-05 Rodrigo Kumpera  <rkumpera@novell.com>
15
16         * verify.c (verify_stack_type_compatibility_full): Ignore constraints
17         when verifying compatibility between a generic instance and a generic
18         parameter.
19
20         * verify.c (check_is_valid_type_for_field_ops): Improve error message.
21
22         * verify.c (stack_slot_stack_type_full_name): Improve verification type
23         name.
24
25         Fixes #587849.
26
27 2010-04-04  Mark Probst  <mark.probst@gmail.com>
28
29         * sgen-gc.c: Remove superfluous scanning of alloc-pinned objects.
30
31 2010-04-04  Zoltan Varga  <vargaz@gmail.com>
32
33         * threads.c Applied some openbsd changes from Robert Nagy <robert@openbsd.org>.
34
35 2010-04-03  Marek Habersack  <mhabersack@novell.com>
36
37         * process.c: when cross-compiling with MinGW, force GetProcessId
38         lookup using GetProcAddress.
39
40 2010-04-02  Mark Probst  <mark.probst@gmail.com>
41
42         * sgen-gc.c: parse_environment_string_extract_number() must be
43         static.
44
45 2010-04-02  Mark Probst  <mark.probst@gmail.com>
46
47         * sgen-gc.c, sgen-gray.c: Macros for gray_object_enqueue() and
48         gray_object_dequeue(), to make sure they're inlined.
49
50 2010-04-02  Mark Probst  <mark.probst@gmail.com>
51
52         * sgen-gc.c, sgen-gray.c: Fix a few debug levels, put a few
53         asserts in inner loops into DEBUG and lower MAX_DEBUG_LEVEL.
54
55 2010-04-02  Jb Evain  <jbevain@novell.com>
56
57         * exception.c: remove dead code.
58
59 2010-04-02  Zoltan Varga  <vargaz@gmail.com>
60
61         * *-gc.c: Fix the signature of mono_gc_get_used/heap_size () to be consistent
62         with mono-gc.h.
63
64 2010-04-01  Sanjoy Das <sanjoy@playingwithpointers.com>
65
66         * sgen-gc.c: Make the nursery size adjustable by the
67         MONO_GC_PARAMS environment variable.
68
69         Code is contributed under MIT/X11 license.
70
71 2010-04-01 Gonzalo Paniagua Javier <gonzalo@novell.com>
72
73         * threadpool.c: threadpool threads wait is alertable.
74         Fixes bug #592964.
75         Reduced the stack size of the *poll_wait thread.
76
77 2010-04-01  Sebastien Pouliot  <sebastien@ximian.com>
78
79         * exception.c|metadata-internals.h: Add new mono_get_exception_
80         field_access_msg and mono_get_exception_method_access_msg 
81         functions that accept a const char* parameter to provide more 
82         details when the exception is thrown.
83         * security-core-clr.c|h: Rework code to allow logging exceptions
84         (export MONO_LOG_MASK="security") and to supply more details in
85         [TypeLoad|MethodAccess|FieldAccess]Exception thrown. Also added
86         mono_security_core_clr_is_field_access_allowed and 
87         mono_security_core_clr_is_call_allowed to return an exception,
88         with messages and logging, that can be emitted by method-to-ir.c
89
90 2010-04-01  Mark Probst  <mark.probst@gmail.com>
91
92         * sgen-gc.c, sgen-pinning-stats.c: In the heap-dump, dump each
93         pinned object.
94
95 2010-04-01  Zoltan Varga  <vargaz@gmail.com>
96
97         * appdomain.c (mono_domain_assembly_postload_search): Avoid a crash/assert if
98         the assembly name is not well formed utf8. Fixes #567882.
99
100 2010-04-01  Zoltan Varga  <vargaz@gmail.com>
101
102         * reflection.c (mono_reflection_create_generic_class): Set the flags field of
103         the generic parameters from the builder. Fixes #473298.
104
105 2010-03-31  Miguel de Icaza  <miguel@novell.com>
106
107         * object.c (mono_class_proxy_vtable): Eliminate warning. 
108
109         * marshal.c (emit_marshal_boolean): Eliminate possible
110         uninitialized local warning. 
111
112 2010-03-30  Sebastien Pouliot  <sebastien@ximian.com>
113
114         * class.c (mono_class_init): Postpone coreclr inheritance check
115         until the end of the initialization (so we can check up the 
116         default ctor manually for the core-clr inheritance rules).
117         * security-core-clr.c: Add the missing (undocumented) checks on
118         default constructors when verifying inheritance rules.
119
120 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
121
122         * domain-internals.h (MonoJitExceptionInfo): Add new field
123         handler_end to the data union. To be used to point the end
124         of a finally block.
125
126 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
127
128         * reflection.c: Add support for new v4 type
129         System.Reflection.MonoModule that is the concrete version
130         of Module which is abstract unver v4.
131
132 2010-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
133
134         * class.c (mono_class_init): Don't set class failure after
135         inited = 1 is set. It must be done before.
136
137 2010-03-30  Andreas Färber  <andreas.faerber@web.de>
138
139         * mono-config.c: Add support for OS "haiku"
140         * ChangeLog: Fix UTF-8 encoding
141
142         Code is contributed under MIT/X11 license.
143
144 Tue Mar 30 15:53:06 CEST 2010 Paolo Molaro <lupus@ximian.com>
145
146         * console-unix.c: fixed include logic for sys/ioctl.h.
147
148 2010-03-30  Mark Probst  <mark.probst@gmail.com>
149
150         * threads.c: Fix bitmap generation for TLS marking on 64 bit
151         systems.
152
153 2010-03-30  Zoltan Varga  <vargaz@gmail.com>
154
155         * icall.c (ves_icall_System_Enum_get_underlying_type): Don't crash on
156         unfinished/broken typebuilders.
157
158 2010-03-29  Mark Probst  <mark.probst@gmail.com>
159
160         * sgen-gc.c: Use the same heuristic for the LOS target that we use
161         for the minor section allowance.
162
163 2010-03-29  Raja R Harinath  <harinath@hurrynot.org>
164
165         * metadata-verify.c (INVALID_METHOD_IMPLFLAG_BITS): Allow bit 6
166         "NoOptimization".
167
168 2010-03-29  Mark Probst  <mark.probst@gmail.com>
169
170         * sgen-gc.c: Count bytes allocated with heavy statistics.
171
172 2010-03-29  Mark Probst  <mark.probst@gmail.com>
173
174         * sgen-gc.c: More detailed time statistics.
175
176 Mon Mar 29 11:52:34 CEST 2010 Paolo Molaro <lupus@ximian.com>
177
178         * gc-internal.h, sgen-gc.c, threads.c, utils/mono-hash.c:
179         fix the user defined mark interface to pass a pointer
180         to the object location and not the object itself.
181
182 2010-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
183
184         * reflection.c (mono_method_body_get_object): Release
185         the method header before the call to CACHE_OBJECT since
186         this is a macro that returns.
187
188 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
189
190         * class.c (inflate_generic_type): mono_metadata_type_dup
191         already dupes array information, the g_memdup was just
192         leaking memory.
193
194 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
195
196         * verify.c: Add stack_peek function. Fix CEE_DUP
197         to not read from invalid memory if push did expand
198         the stack.
199
200 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
201
202         * verify.c: Remove old table verification code that has
203         been superseeded by the new metadata verifier.
204
205         * verify.h: Remove mono_image_verify_tables from the public
206         API.
207
208         * pedump.c: Fix for removed bits.
209
210 2010-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
211
212         * verify.c: Allocate stack slows lazily to reduce stack usage
213         in case of methods with huge stacks. Reduces memory consumption
214         for mcs yyparse from 459Mb to 1.8Mb.
215
216 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
217
218         * threadpool.c: don't try executing items from domains being
219         unloaded. Fixes appdomain-async-invoke test.
220
221 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
222
223         * threadpool.c: spin while the threadpool initializes.
224         * mono-wsq.c: if the WSQ has not been initialized or has been shut
225         down, don't do anything.
226
227 2010-03-26  Zoltan Varga  <vargaz@gmail.com>
228
229         * threads.c (mono_thread_create_internal): Set the GC type of the
230         threads_starting_up hash table.
231
232 2010-03-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
233
234         * threadpool.c: reset 'state' to avoid returning non-null when the
235         event type is not found.
236
237 Fri Mar 26 19:03:09 CET 2010 Paolo Molaro <lupus@ximian.com>
238
239         * sgen-gc.c: make copy_object () take the address of the
240         slot holding the reference. This allows saving memory stores
241         when not needed and it allows keeping track of oldspace->nursery
242         references for the card table code.
243
244 2010-03-26  Andreas Färber  <andreas.faerber@web.de>
245
246         * null-gc.c (mono_gc_invoke_with_gc_lock): Fix function name.
247
248         Code is contributed under MIT/X11 license.
249
250 Fri Mar 26 11:33:17 CET 2010 Paolo Molaro <lupus@ximian.com>
251
252         * object.c, threads.c, threads-types.h, threads.h: make the
253         managed thread local storage references precisely tracked.
254
255 2010-03-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
256
257         * threadpool.[ch]: reworked the threadpool:
258                 -Threadpool threads use a work-stealing queue. Adding a work
259                 item from a threadpool thread will queue it in the thread
260                 local queue without locking (in most cases).
261                 -epoll events are coalesced before being added to the IO
262                 queue.
263                 -Dynamically change the number of active threads
264                 -Changed the global queue to be more GC friendly
265
266         * class-internals.h: add 2 new performance counters for the number of
267         threads in the threadpool and the IO threadpool.
268
269         * object-internals.h: new field in MonoAsyncResult.
270         * icall-def.h: new internal call for queueing work items.
271
272         * Makefile.am: add 2 new files.
273
274         * appdomain.c: bump up corlib version.
275
276         * mono-wsq.[ch]: an implementation of a work-stealing queue.
277
278         * mono-perfcounters-def.h:
279         * mono-perfcounters.c: added 2 new performance counters.
280
281 2010-03-26  Mark Probst  <mark.probst@gmail.com>
282
283         * sgen-gc.c: More FIXME/TODO updates.
284
285 2010-03-25  Mark Probst  <mark.probst@gmail.com>
286
287         * gc-internal.h, sgen-gc.c, sgen-gc.h, boehm-gc.c, null-gc.c: New
288         function mono_gc_invoke_with_gc_lock() which invokes a function
289         with the guarantee that no collection will occur during its execution.
290
291 2010-03-25  Mark Probst  <mark.probst@gmail.com>
292
293         * sgen-gc.c: Update a few comments.
294
295 2010-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
296
297         * reflection.c: Add support for new v4 type
298         System.Reflection.MonoAssembly that is the concrete version
299         of Assembly which is abstract unver v4.
300
301 2010-03-24  U-anarquia\miguel  <miguel@anarquia>
302
303         * reflection.c (mono_reflection_get_custom_attrs_info): Protect
304         code that uses System.Reflection.Emit in DISABLE_REFLECTION_EMIT.
305
306         Expose a few macros that are needed for SR but not SRE to the
307         world (previous inside the SRE ifdef)
308
309 2010-03-24  Mark Probst  <mark.probst@gmail.com>
310
311         * sgen-gc.c (gc_register_current_thread): We need
312         stack_start_limit as well in the non-attribute pthread case.
313
314 2010-03-23 Rodrigo Kumpera  <rkumpera@novell.com>
315
316         * threads.c: Fix windows build.
317
318 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
319
320         * thread-types.h: Add mono_thread_resume_interruption.
321
322         * threads.c: Add mono_thread_resume_interruption, this
323         function should be called after the last protected handler
324         found at interruption time has finished.
325
326 2010-03-22 Rodrigo Kumpera  <rkumpera@novell.com>
327
328         * threads.c (ves_icall_System_Threading_Thread_ResetAbort):
329         Check MonoInternalThread's ::state instead of ::abort_exc
330         since the later can be lazily created.
331
332         This is specially problematic when running a finally block
333         under AbortRequested state. ResetAbort must work, but the
334         abort_exc object has not been created because interruption
335         has not began.
336
337 2010-03-22  Geoff Norton  <gnorton@novell.com>
338
339         * locales.c: Its possible for CFStringGetCStringPtr
340         to return null and not convert encodings.  Use
341         CFStringGetCString instead.
342
343 Mon Mar 22 18:06:38 CET 2010 Paolo Molaro <lupus@ximian.com>
344
345         * class-internals.h, class.c, object.c: introduce compressed
346         interface bitmaps (for now only under small config): this saves
347         about 600 KB of runtime memory on gmcs bootstraps or monodevelop
348         startups.
349
350 Mon Mar 22 16:03:34 CET 2010 Paolo Molaro <lupus@ximian.com>
351
352         * mono-debug.c: don't try to get the method header, it causes a
353         deadlock and it is not used for anything anymore.
354
355 2010-03-22  Zoltan Varga  <vargaz@gmail.com>
356
357         * loader.c (mono_method_get_marshal_info): Fix the handling of dynamic methods
358         broken by the last change.
359
360 2010-03-21  Andreas Färber  <andreas.faerber@web.de>
361
362         * socket-io.c: Don't depend on AF_SNA, AF_DECnet,
363         SOCK_RDM.
364         
365         Code is contributed under MIT/X11 license.
366
367 2010-03-20  Sanjoy Das <sanjoy@playingwithpointers.com>
368
369         * sgen-gc.c (mono_gc_get_write_barrier): Handle non-aligned
370         nursery.
371
372         Code is contributed under MIT/X11 license.
373
374 2010-03-19  Martin Baulig  <martin@ximian.com>
375
376         * mono-debug.c (MonoDebugWrapperData): Replace `cil_code' with a
377         dummy field, containing an empty string.
378         (mono_debug_add_method): Don't call mono_disasm_code() for wrappers.
379
380
381 Fri Mar 19 17:26:43 CET 2010 Paolo Molaro <lupus@ximian.com>
382
383         * class.c: setup_interface_offsets() refactor to not call
384         mono_class_get_implemented_interfaces () more times than needed and
385         to reduce the runtime memory requirements to be O(num_interfaces)
386         instead of O(max_interface_id).
387
388 2010-03-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
389
390         * mono-mlist.[ch]: add mono_mlist_set_next ().
391
392 2010-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
393
394         * domain-internals.h: Add MonoTryBlockHoleJitInfo struct and
395         associated changes to support holes in the protected range of a
396         try block.
397
398         * domain.c: Add mono_jit_info_get_try_block_hole_table_info, which
399         retrieves the holes table from a given MonoJitInfo.
400
401 Tue Mar 16 13:11:15 CET 2010 Paolo Molaro <lupus@ximian.com>
402
403         * object.h, object-internals.h, object.c, icall.c, gc-internal.h,
404         debug-helpers.c, cominterop.c, process.c, sgen-gc.c, socket-io.c:
405         hide the contents of the MonoString and MonoArray structs from the
406         public API. Change the accessor macros to accessors functions where
407         needed. Adjusted the array API to allow for pointer-sized lengths and
408         starting positions, so 64 bit arrays can be optionally provided in an
409         API compatible way if needed on 64 bit systems.
410
411 Tue Mar 16 10:18:07 CET 2010 Paolo Molaro <lupus@ximian.com>
412
413         * class-internals.h, class.c, loader.c, marshal.c, metadata.c,
414         reflection.c: the MonoMethodNormal struct is now unused, so remove it.
415
416 Mon Mar 15 18:28:00 CET 2010 Paolo Molaro <lupus@ximian.com>
417
418         * class-internals.h: remove the method header from MonoMethod since
419         from now on it will be transient. We have a header pointer for method
420         wrappers, since in that case we need to keep track of it. For this
421         reason, all the Reflection.Emit generated methods use MonoMethodWrapper
422         structs now. The same happens with MonoMethodInflated.
423         * class.c: reset the sre_method flag for inflated method structures:
424         this makes the code that cares look at the header in the MonoMethodInflated
425         structure.
426         * loader.c: lookup the method header in the appropriate field now that
427         it is removed from MonoMethod.
428         * metadata-internals.h: add a flag to the method header to know if it
429         can be freed inside mono_metadata_free_mh ().
430         * method-builder.c: updates after moving the header field from
431         MonoMethod to MonoMethodWrapper.
432         * reflection.c: MonoMethods generated from Reflection.Emit use
433         MonoMethodWrapper structs if they need a method header now (later take
434         advantage of this and remove all the current unsafe uses of method_aux_hash).
435         * metadata.c: make method header parsing not leak when verification
436         fails. Alloc it with g_malloc() and free it in mono_metadata_free_mh().
437         These changes save a few hundred KB of runtime memory in a mcs
438         bootstrap or a monodevelop startup.
439
440 2010-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
441
442         * verify.c: Improve error message.
443
444 2010-03-12  Jb Evain  <jbevain@novell.com>
445
446         * reflection.c (add_exported_type): populate the exported
447         table with the type's nested type.
448
449 2010-03-10  Mark Probst  <mark.probst@gmail.com>
450
451         * sgen-gc.c (STRING_SIZE): Semi-revert r153342.  I'm an idiot who
452         can't read parentheses.
453
454 2010-03-10  Mark Probst  <mark.probst@gmail.com>
455
456         * threads.c (thread_cleanup): Add a guard to dereferencing
457         "thread" to avoid an unlikely race condition.
458
459 2010-03-09  Sebastien Pouliot  <sebastien@ximian.com>
460
461         * assembly.c: Fix crash in moon-unit when aname->culture is NULL
462         instead of an empty string.
463
464 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
465
466         * object-internals.h (_G_BOOLEAN_EXPR): Fix the definition of this to explicitly
467         convert to a boolean, recent gcc versions compile this differently.
468
469 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
470
471        * sgen-gc.c (safe_object_get_size): Avoid a function call so this can really be
472        inlined.
473
474 2010-03-09  Mark Probst  <mark.probst@gmail.com>
475
476         * sgen-gc.c (STRING_SIZE): Off by one.
477
478 2010-03-09  Mark Probst  <mark.probst@gmail.com>
479
480         * sgen-archdep.h: Fix the signal context register access for
481         AMD64.
482
483 2010-03-09  Zoltan Varga  <vargaz@gmail.com>
484
485         * sgen-gray.c: Get rid of the unused 'start' field in GrayQueueSection.
486
487 2010-03-08  Rodrigo Kumpera  <rkumpera@novell.com>
488
489         * verify.c: Store the initial basic block returned by mono_basic_block_split
490         so we can release the whole list and not just the first one.
491
492 Mon Mar 8 17:30:44 CET 2010 Paolo Molaro <lupus@ximian.com>
493
494         * verify.c, debug-helpers.c, profiler.c, loader.c,
495         mono-basic-block.c, mono-debug.c, reflection.c: prepare to make
496         MonoMethodHeader a transient entity.
497
498 2010-03-08  Zoltan Varga  <vargaz@gmail.com>
499
500         * sgen-gc.c (scan_needed_big_objects): Call drain_gray_stack () to avoid
501         uncontrolled growth of the gray stack.
502
503         * sgen-gray.c: Rewrite this so it behaves like a stack, not a queue, so recently
504         added items are removed first, improving cache locality. Avoid freeing queue
505         segments in the fast path, use the list of segments as the free list, truncate
506         it to its max size at the start of collection.
507
508 Mon Mar 8 10:13:52 CET 2010 Paolo Molaro <lupus@ximian.com>
509
510         * metadata-internals.h: more memory savings, both with small config and without.
511
512
513 Sat Mar 6 19:12:12 CET 2010 Paolo Molaro <lupus@ximian.com>
514
515         * appdomain.c, domain-internals.h, domain.c, object.c:
516         make class_vtable_hash into an array to reduce memory usage.
517
518 Sat Mar 6 18:16:35 CET 2010 Paolo Molaro <lupus@ximian.com>
519
520         * mempool.c, class-internals.h, class.c, icall.c, metadata.c,
521         object-internals.h, object.c, reflection.c, threadpool.c:
522         reduce resource usage when the small config is selected.
523         In particular, up to 64K of methods/fields/properties/events
524         are allowed and "other" methods in events are ignored.
525
526 Fri Mar 5 19:05:47 CET 2010 Paolo Molaro <lupus@ximian.com>
527
528         * threads.c: reduce resource usage when compiled for a small config.
529
530 2010-03-05  Mark Probst  <mark.probst@gmail.com>
531
532         * sgen-gc.c: Also collect number of degraded-alloced objects with
533         heavy statistics.
534
535 2010-03-04  Geoff Norton  <gnorton@novell.com>
536
537         * assembly.c: Only support OSX bundling if the bundle is 
538         actually detectable.
539
540 2010-03-04  Geoff Norton  <gnorton@novell.com>
541
542         * loader.c: The marshal specs are freed at the end of the call
543         but it explicitly frees the strings as well as the container,
544         so we need to dup them too to avoid referencing free'd memory.
545
546 2010-03-04  Geoff Norton  <gnorton@novell.com>
547
548         * icall-def.h:
549         * icall.c: Add a new private internal icall to construct
550         an object from its type without running the ctor.
551
552 Thu Mar 4 15:37:09 CET 2010 Paolo Molaro <lupus@ximian.com>
553
554         * profiler.c: allow multiple profiler engines to be loaded
555         at the same time.
556
557 Wed Mar 3 20:19:45 CET 2010 Paolo Molaro <lupus@ximian.com>
558
559         * profiler-private.h, profiler.c, profiler.h, sgen-gc.c: introduce
560         profiler event to track object moves.
561
562 Wed Mar 3 19:20:39 CET 2010 Paolo Molaro <lupus@ximian.com>
563
564         * object.c, profiler.c, profiler.h, string-icalls.c:
565         remove the reduntant MONO_PROFILE_STRING_ALLOC profiler event.
566
567 2010-03-03  Miguel de Icaza  <miguel@novell.com>
568
569         * decimal.c (mono_double2decimal): Add support for reducing the
570         scale of a decimal.  It turns the 0.6000000000000 into 0.6 as
571         expected.
572
573 2010-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
574
575         * icall-def.h:
576         * icall.c: Implement System.MonoType::get_core_clr_security_level icall.
577
578 2010-03-03  Marek Habersack  <mhabersack@novell.com>
579
580         * mono-config.c (mono_config_parse_assembly_bindings): added -
581         parses assembly binding redirections from appdomain's config
582         file.
583
584         * metadata-internals.h: added definition of a new function -
585         mono_config_parse_assembly_bindings - to support parsing assembly
586         binding redirections defined in appdomain's config file.
587
588         * domain-internals.h: added two new fields to _MonoDomain - a list
589         of assembly bindings and a flag to parse the config file only
590         once.
591
592         * assembly.c (assembly_binding_maps_name): empty culture name and
593         NULL culture name are considered equal.
594         (mono_assembly_apply_binding): added support for domain specific
595         assembly binding redirections, read from the appdomain's
596         configuration file. Fixes bug #580185
597
598 Wed Mar 3 11:46:06 CET 2010 Paolo Molaro <lupus@ximian.com>
599
600         * appdomain.c, domain.c, icall.c, image.c, marshal.c, object.c,
601         reflection.c, socket-io.c, threadpool.c, threads.c: removed 1.1/1.0
602         support.
603
604 2010-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
605
606         * reflection.c (mono_image_get_memberref_token): Extract mono_image_add_memberef_row
607         from this function. The new function receive the parent token instead of a type.
608
609         * reflection.c (mono_image_get_methodref_token_for_methodbuilder):
610         * reflection.c (mono_image_get_ctorbuilder_token): Use new function to encode
611         typebuilders. This make it possible to properly encode generic type builders since
612         their unmanaged type don't have generics data while unfinished.
613
614         Fixes #583655.
615
616 2010-03-02  Mark Probst  <mark.probst@gmail.com>
617
618         * sgen-gc.c, sgen-protocol.c, sgen-protocol.h: New facility for
619         writing binary log files (can be enabled by #define'ing
620         BINARY_PROTOCOL) for better debugging of timing-dependent bugs or
621         bugs in longer running programs.
622
623 Mon Mar 1 19:35:32 CET 2010 Paolo Molaro <lupus@ximian.com>
624
625         * metadata.c: added some API documentation.
626
627 2010-03-01  Robert Jordan  <robertj@gmx.net>
628
629         * filewatcher.h: Include glib.h to fix the MSVC build.
630
631 2010-03-01  Zoltan Varga  <vargaz@gmail.com>
632
633         * class-internals.h (MonoClass): Get rid of the reflection_info field, add
634         a GC handle instead. This is a bit slower to access, but avoids burdening the
635         GC with 100s of individual roots.
636
637         * reflection.c (mono_class_get_ref_info):
638         (mono_class_set_ref_info):
639         (mono_class_free_ref_info): New internal helper fuctions.
640
641         * reflection.c appdomain.c icall.c class.c: Use the new helper functions instead
642         of accessing klass->reflection_info directly.
643
644         * sgen-gc.c (alloc_complex_descriptor): Fix the computation of the number of
645         words.
646
647         * gc.c (alloc_handle): Create a GC descriptor for the 'entries' array, free
648         the previous array.
649
650 2010-02-28  Zoltan Varga  <vargaz@gmail.com>
651
652         * marshal.c (get_runtime_invoke_type): Avoid sharing byref with I, as the latter
653         needs an indirection.
654
655 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
656
657         * generic-sharing.c: Removed, moved its contents to mini/mini-generic-sharing.c,
658         so all generic sharing code is in one place.
659
660         * class.c (get_implicit_generic_array_interfaces): Fix the last change so
661         we don't call setup_interface_offsets () for unfinished types.
662
663 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
664
665         * class.c (mono_class_generic_sharing_enabled): Move this to
666         generic-sharing.c.
667
668         * image.c: Add an unload hook which is called before an image is unloaded.
669
670         * generic-sharing.c: Use the unload hook to unregister per-image data, to avoid
671         metadata.c having to depend on generic sharing.
672
673 Fri Feb 26 19:23:18 CET 2010 Paolo Molaro <lupus@ximian.com>
674
675         * class.c: reduce size of ridiculously large cache.
676
677 2010-02-26  Martin Baulig  <martin@ximian.com>
678
679         * mono-debug.h
680         (MONO_DEBUGGER_MINOR_VERSION): Bump to 5.
681
682         * threads.c (mono_thread_internal_reset_abort): New method; resets
683         the abort, but doesn't throw any exception if no abort was requested.
684
685 2010-02-26  Zoltan Varga  <vargaz@gmail.com>
686
687         * class.c (get_implicit_generic_array_interfaces): Call
688         mono_class_setup_interface_offsets () before accessing
689         eclass->interface_offsets_count. This only shows up on platforms without IMT for
690         some reason.
691
692 Thu Feb 25 12:12:44 CET 2010 Paolo Molaro <lupus@ximian.com>
693
694         * environment.c, environment.h, icall.c: make the GetOSVersionString()
695         icall internal.
696
697 Thu Feb 25 11:37:50 CET 2010 Paolo Molaro <lupus@ximian.com>
698
699         * metadata.c, metadata.h: make MONO_TYPE_IS* functional without
700         direct access to the MonoType fields.
701
702 2010-02-25  Zoltan Varga  <vargaz@gmail.com>
703
704         * threads.h: Move some internal functions which were added to this header by
705         mistake to threads-types.h.
706
707         * class.c (mono_class_init): Get rid of mono_setup_vtable_in_class_init.
708
709 Wed Feb 24 17:45:27 CET 2010 Paolo Molaro <lupus@ximian.com>
710
711         * class-internals.h, class.h, object.h: make MonoRemoteClass
712         and mono_remote_class() internal.
713
714 Wed Feb 24 17:05:18 CET 2010 Paolo Molaro <lupus@ximian.com>
715
716         * metadata-internals.h, class-internals.h, metadata.h: make the
717         MonoType guts internal as well.
718
719 Wed Feb 24 16:02:42 CET 2010 Paolo Molaro <lupus@ximian.com>
720
721         * reflection.h: the MonoTypeNameParse guts are internal now.
722         * assembly.c, assembly.h, image.h: the MonoAssemblyName guts
723         are internal now, provide accessors as needed.
724         * metadata.h, metadata-internals.h: the MonoMethodSignature
725         guts are internal now.
726         * Makefile.am: mempool.h is an internal header now.
727         * *.h, *.c: remove glib.h usage from the public headers.
728
729 2010-02-24  Atsushi Enomoto  <atsushi@ximian.com>
730
731         * culture-info-table.h : regenerated.
732
733 2010-02-22  Rodrigo Kumpera  <rkumpera@novell.com>
734
735         * metadata.c: Add mono_method_get_header_summary which returns minimal
736         information about the header of a method. This is the information used
737         by the inline oracle to reject methods.
738
739         This method doesn't decode local variables and doesn't cache it's result,
740         so it should cause a minimal reduction in memory usage.
741
742         * metadata-internals.h: Add MonoMethodHeaderSummary structure and
743         mono_method_get_header_summary.
744
745 2010-02-22  Jeffrey Stedfast  <fejj@novell.com>
746
747         * threads.c (mono_thread_exit): Make sure that the main thread is
748         non-null before dereferencing it.
749
750 2010-02-21  Geoff Norton  <gnorton@novell.com>
751
752         * Makefile.am: Add CoreFoundation linkage on darwin to properly get the current
753         locale.
754         * locaes.c: When running on darwin, try to get the local from CoreFoundation 
755         before falling back to the posix lookup.
756
757 2010-02-19  Zoltan Varga  <vargaz@gmail.com>
758
759         * threads.c (mono_thread_suspend_all_other_threads): Ignore threads which have
760         the DONT_MANAGE flag set.
761
762 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
763
764         * domain.c: Remove old v1 version strings. Let the runtime
765         default to 2.0 instead of failing because it can't find a
766         working 1.0 instalation.
767
768 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
769
770         * domain.c: Add v4 RC version string.
771
772 2010-02-19  Rodrigo Kumpera  <rkumpera@novell.com>
773
774         * mono-basic-block.c (mono_opcode_value_and_size): Use pointer variant
775         of overflow checking function.
776
777 2010-02-18  Rodrigo Kumpera  <rkumpera@novell.com>
778
779         * reflection.c (mono_reflection_method_on_tb_inst_get_handle): Handle non
780         generic methods.
781
782         * reflection.c (mono_reflection_get_custom_attrs_info): Handle compiler context
783         cases for ParameterInfo.
784
785         Fixes #579493.
786
787 2010-02-18  Zoltan Varga  <vargaz@gmail.com>
788
789         * class.c (mono_class_get_cctor): Fix support for dynamic classes, which doesn't
790         have has_cctor set. Fixes #575946.
791
792 2010-02-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
793
794         * appdomain.c: display a warning if the parsing the config file
795         produces any error.
796         Skip the BOM in UTF-8 files.
797         Copy the AppDomainSetup before setting the privateBinPath so that the
798         correct configuration file is read.
799
800 2010-02-15  Zoltan Varga  <vargaz@gmail.com>
801
802         * object.c: Instead of using one vtable trampoline, allow the JIT to use one
803         vtable trampoline per vtable slot index. Not used yet.
804
805 2010-02-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
806
807         * icall-def.h:
808         * icall.c: add internal call that returns the system page size.
809
810 2010-02-13  Zoltan Varga  <vargaz@gmail.com>
811
812         * debug-helpers.c (mono_method_desc_search_in_image): Handle short names like
813         'int' for system classes.
814
815 Fri Feb 12 18:36:02 CET 2010 Paolo Molaro <lupus@ximian.com>
816
817         * icall.c, icall-def.h: new icall to check for sufficient
818         stack space.
819
820 2010-02-12  Mark Probst  <mark.probst@gmail.com>
821
822         * reflection.c (ensure_complete_type): Check that reflection_info
823         is set, too.  Fixes crash of corlib testsuite with -O=-all.
824
825 2010-02-11  Rodrigo Kumpera  <rkumpera@novell.com>
826
827         * attrdefs.h:
828         * tabledefs.h: Add NoOptimization flag.
829
830 2010-02-10  Mark Probst  <mark.probst@gmail.com>
831
832         * sgen-gc.c: Don't consider it a missing remset if the target
833         object is pinned - we might have done the store but not added the
834         remset yet.
835
836 2010-02-10  Mark Probst  <mark.probst@gmail.com>
837
838         * sgen-gc.c: When checking for missing remsets, don't assert on
839         the first one, but print them all and then assert.
840
841 2010-02-10  Mark Probst  <mark.probst@gmail.com>
842
843         * sgen-gc.c (find_in_remset_loc): Handle the small bitmap case.
844
845 2010-02-09  Miguel de Icaza  <miguel@novell.com>
846
847         * console-unix.c: On OSX Control-Y is assigned to
848         VDSUSP (non-Posix), the
849         suspend-program-next-time-it-tries-to-read-input command (this is
850         different than C-z, which suspends immediately).
851
852         Do the same thing that bash does and ignore this setting,
853         making our repl/getline support pasting.
854
855 2010-02-10  Mark Probst  <mark.probst@gmail.com>
856
857         * sgen-gc.c: Simple plausibility check for scan_starts.
858
859 2010-02-10  Mark Probst  <mark.probst@gmail.com>
860
861         * sgen-gc.c: Round up when calculating the number of scan starts.
862
863 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
864
865         * reflection.c: Export mono_get_object_from_blob.
866
867         * object-internals.h: Ditto.
868
869         * icall.c: New icall property_info_get_default_value to get the default
870         value of a property. Since using this is not common, no caching is done.
871
872         * icall-def.h: Add new icall.
873
874 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
875
876         * class.c: Add mono_class_get_property_default_value.
877
878         * class-internal.h: Export mono_class_get_property_default_value.
879
880 2010-02-10  Rodrigo Kumpera  <rkumpera@novell.com>
881
882         * reflection.c (mono_image_get_property_info): Encode the default value of a property.
883
884 Wed Feb 10 14:48:45 CET 2010 Paolo Molaro <lupus@ximian.com>
885
886         * sgen-gc.c: introduced critical regions to allow some lockless
887         operations and increase scalability.
888
889 2010-02-10  Geoff Norton  <gnorton@novell.com>
890
891         * reflection.c: Support building with DISABLE_REFLECTION
892
893 2010-02-09 Gonzalo Paniagua Javier <gonzalo@novell.com>
894
895         * threadpool.c: Fixes for SetMinThreads and SetMaxThreads.
896         Closes bug #566057.
897
898         * exception.c: fix typo in comment.
899
900 2010-02-09  Rodrigo Kumpera  <rkumpera@novell.com>
901
902         * icall.c (param_info_get_type_modifiers): Handle the case when the member object is a
903         property. This happens which instances returned by PropertyInfo::GetIndexParameters ().
904
905         * reflection.c (mono_reflection_get_custom_attrs_info): Ditto.
906
907         * object-internals.h: Export mono_class_is_reflection_method_or_constructor as part of
908         the internal API.
909
910         Fixes #574434.
911
912 2010-02-09  Mark Probst  <mark.probst@gmail.com>
913
914         * threads.c: Removed two assertions that were too strict.  Added a
915         clarifying comment.  Fixes #577090.
916
917 2010-02-08  Zoltan Varga  <vargaz@gmail.com>
918
919         * domain.c (mono_jit_info_table_find): Avoid looking in the root domain, since
920         the caller has no way of knowing the domain which owns the returned MonoJitInfo.
921
922         * appdomain.c (create_exceptions): Call mono_thread_push/popappdomain_ref ().
923
924         * verify.c (mono_type_get_stack_name): Fix a warning.
925
926 2010-02-07  Zoltan Varga  <vargaz@gmail.com>
927
928         * marshal.c (mono_marshal_get_wrapper_info): Rename from
929         mono_marshal_wrapper_info_from_wrapper.
930
931         * marshal.c (mono_marshal_set_wrapper_info): Rename from
932         mono_marshal_method_set_wrapper_data, and export.
933
934         * boehm-gc.c sgen-gc.c null-gc.c: Get rid of mono_gc_get_allocator_type, store
935         the allocator type in a AllocatorWrapperInfo structure instead, which is accesible
936         by calling mono_marshal_get_wrapper_info ().
937
938         * sgen-gc.c (mono_gc_get_managed_allocator): Add a specialized allocator for
939         small objects which does no size checks.
940
941 2010-02-05  Rodrigo Kumpera  <rkumpera@novell.com>
942
943         * icall-def.h: Rename get_MetadataToken to GetMetadataToken.
944
945 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
946
947         * verify.c (mono_method_verify): Use the new basic block formation pass
948         to avoid verifying dead basic blocks. This is the same behavior as the
949         runtime MS verifier.
950
951 2010-02-04  Rodrigo Kumpera  <rkumpera@novell.com>
952
953         * mono-basic-block.c:
954         * mono-basic-block.h: New implementation of a basic block formation pass.
955         The formation pass does static liveness analysis as well to detect dead
956         basic blocks.
957
958 2010-02-04  Zoltan Varga  <vargaz@gmail.com>
959
960         * marshal.c (mono_marshal_get_native_wrapper): Emit a null check for the
961         'this' argument in icalls.
962
963 2010-02-02  Zoltan Varga  <vargaz@gmail.com>
964
965         * reflection.c (resolve_object): Handle MonoArrayMethod. Fixes #575955.
966
967 2010-02-01  Mark Probst  <mark.probst@gmail.com>
968
969         * object.c, domain.c: When using SGen, we must register
970         vtable->type as a root if it's not a MonoType, because then it
971         wasn't pin-alloced.
972
973 2010-02-01  Mark Probst  <mark.probst@gmail.com>
974
975         * sgen-gc.c: Reset to_space_bumper to to_space_section->next_data
976         at the start of nursery collections, because we might have had
977         degraded allocations which changed next_data.
978
979 2010-01-30  Zoltan Varga  <vargaz@gmail.com>
980
981         * marshal.c (mono_marshal_get_managed_wrapper): Avoid constructing the
982         custom attr so this function works in cross-compiling mode.
983
984 2010-01-29  Zoltan Varga  <vargaz@gmail.com>
985
986         * class.c (make_generic_param_class): Initialize interface offsets since we
987         set klass->inited. Fixes #574819.
988
989 2010-01-28  Zoltan Varga  <vargaz@gmail.com>
990
991         * domain.c (mono_domain_free): Send the END_UNLOAD profiler event before
992         calling the JIT domain cleanup hook.
993
994 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
995
996         * pedump.c (main): Properly set the verifier mode when running the metadata
997         verifier.
998
999 2010-01-28  Rodrigo Kumpera  <rkumpera@novell.com>
1000
1001         * verify.c (verify_class_for_overlapping_reference_fields): Properly verify
1002         overlapping fields now that we're called before has_references is set.
1003
1004         * pedump.c (dump_verify_info): Clear any loader error before verifying another
1005         method. Otherwise all sort of weird stuff happens.
1006
1007 2010-01-27  Zoltan Varga  <vargaz@gmail.com>
1008
1009         * object.c (mono_field_get_value_object): Handle nullable types correctly.
1010         Fixes #572874.
1011
1012 2010-01-25  Zoltan Varga  <vargaz@gmail.com>
1013
1014         * icall.c (ves_icall_System_Array_SetValueImpl): Handle nullable types correctly.
1015         Fixes #573322.
1016
1017 2010-01-23  Mark Probst  <mark.probst@gmail.com>
1018
1019         * sgen-pinning.c (evacuate_pin_staging_area): Don't assume
1020         pin_staging_area_index is greater than 0.
1021
1022 2010-01-22 Miguel de Icaza (miguel@novell.com)
1023
1024         * loader.c: Since we do nothing with the error returned, pass NULL
1025         to ignore the error.
1026
1027 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1028
1029         * reflection.c (typebuilder_setup_fields): Pretend field setup already
1030         happened before starting to encode the actual fields. This avoid ciclic
1031         dependencies and eventual crashes.
1032
1033         Fixes #572660.
1034
1035 2010-01-21  Mark Probst  <mark.probst@gmail.com>
1036
1037         * sgen-gc.c, gc-internal.h, object.c: Make string allocation
1038         atomic and remove the half-constructed hack in SGen.
1039
1040 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1041
1042         * metadata-verify.c (parse_generic_inst): Fail a type signature if it 
1043         has a recursive reference to itself.
1044
1045         Fixes #571863.
1046
1047 2010-01-21  Rodrigo Kumpera  <rkumpera@novell.com>
1048
1049         * loader.c (mono_method_signature): Fix error message.
1050
1051 2010-01-21  Mark Probst  <mark.probst@gmail.com>
1052
1053         * sgen-gc.c: Reuse to-space sections between nursery collections.
1054
1055 2010-01-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
1056
1057         * icall.c: don't raise AppDomain.TypeResolve when the type is loaded
1058         from the current assembly or mscorlib. Fixes bug #322957.
1059
1060 2010-01-20  Zoltan Varga  <vargaz@gmail.com>
1061
1062         * marshal.c: Calculate the target class of the delegete invoke wrappers using
1063         get_wrapper_target_class.
1064
1065 2010-01-19  Mark Probst  <mark.probst@gmail.com>
1066
1067         * sgen-gc.c: Fix warnings.
1068
1069 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1070
1071         * verify.c (store_local): Better error message.
1072
1073 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1074
1075         * object.c (mono_object_get_virtual_method): Handle generic interfaces with variant
1076         arguments.
1077
1078 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1079
1080         * icall.c (ves_icall_Remoting_RemotingServices_GetVirtualMethod): This
1081         function is generics variance aware.
1082
1083 2010-01-19  Sebastien Pouliot  <sebastien@ximian.com>
1084
1085         * security-core-clr.c (mono_security_core_clr_can_access_internals):
1086         Handle the case where 'basedir' can be NULL (e.g. SRE assemblies)
1087
1088 2010-01-19  Sylvain Dupont <duposyl@gmail.com>
1089
1090         * cominterop.c marshal.c: Added support for marshalling in, in/byref,
1091           in/out, in/out/byref parameters of type SAFEARRAY[VARIANT].
1092
1093         Code is contributed under MIT/X11 license.
1094
1095 2010-01-19  Rodrigo Kumpera  <rkumpera@novell.com>
1096
1097         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Handle inflated generic methods
1098         on a GTD.
1099
1100 2010-01-19  Zoltan Varga  <vargaz@gmail.com>
1101
1102         * marshal.c (mono_marshal_wrapper_info_from_wrapper): New helper function to
1103         return a point to a wrapper specific info structure describing the wrapper.
1104         (mono_marshal_get_array_address): Store the rank+elem_size in the wrapper info.
1105  
1106 2010-01-18  Mark Probst  <mark.probst@gmail.com>
1107  
1108         * sgen-gc.c: Make minor collection section allowance adaptive,
1109         depending on the amount of memory reclaimed in the last major
1110         collection.  If more memory was reclaimed (i.e. more garbage
1111         produced), do the next collection earlier.
1112
1113 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
1114
1115         * metadata-verify.c (parse_type): Fail a type signature if it has a recursive reference
1116         to itself.
1117
1118         * metadata-verify.c (mono_verifier_verify_typespec_signature): Change signature to take
1119         the token as parameter.
1120
1121         * verify-internals.h: Ditto.
1122
1123         * metadata.c (mono_type_create_from_typespec): Pass token to verifier.
1124
1125         Fixes #571460.
1126
1127 2010-01-18  Mark Probst  <mark.probst@gmail.com>
1128
1129         * sgen-gc.c: Make store_remset_buffer_index long.
1130
1131 2010-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
1132
1133         * class.c (mono_class_from_typeref): Fail loading of self-referencing typeref tokens.
1134
1135         Fixes #569579.
1136
1137 2010-01-18  Zoltan Varga  <vargaz@gmail.com>
1138
1139         * sgen-gc.c (mono_gc_base_init): Add 'conservative_stack_mark' option to turn
1140         off precise marking if it is available.
1141         (mono_gc_get_bitmap_for_descr): Fix the handling of run length descriptors.
1142
1143 2010-01-17  Zoltan Varga  <vargaz@gmail.com>
1144
1145         * sgen-gc.c (mono_gc_conservatively_scan_area): Resurrect this.
1146
1147         * sgen-pinning.c (evacuate_pin_staging_area): Don't assert if there are no
1148         pinned objects.
1149
1150         * sgen-gc.c (create_allocator): Add the missing n > MONO_ARRAY_MAX_INDEX check
1151         to the array allocator.
1152
1153 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
1154
1155         * generic-sharing.c (instantiate_other_info): Don't create ftnptr's from the
1156         result of mono_compile_method (), it already includes an ftnptr.
1157
1158 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
1159
1160         * metadata.c (get_image_set): Remove an assert which can happen in normal use.
1161
1162 2010-01-15  Zoltan Varga  <vargaz@gmail.com>
1163
1164         * metadata.c (mono_metadata_str_hash): New helper function to compute a stable
1165         hash value which doesn't depend on glib/eglib versions.
1166         (mono_metadata_type_hash): Use it.
1167
1168         * object.c (mono_method_get_imt_slot): Ditto.
1169
1170 2010-01-14  Rodrigo Kumpera  <rkumpera@novell.com>
1171
1172         * class.c (mono_type_has_exceptions): Check the generic instance. It can fail
1173         independently of the GTD.
1174
1175         * class.c (mono_class_setup_fields): Fail if field has negative offset.
1176
1177         * class.c (mono_class_setup_fields): Fail if valuetype has zero size. Add sizeof(MonoObject)
1178         to the upper limit since instance_size includes this amount.
1179
1180         * class.c (mono_class_layout_fields): Check if the types of the static fields have failed.
1181
1182         Fixes #569544.
1183
1184 2010-01-14  Zoltan Varga  <vargaz@gmail.com>
1185
1186         * object.c (build_imt_slots): Compute the vtable slot correctly for interfaces
1187         with static methods.
1188
1189         * object.c (build_imt_slots): Avoid asserting when static methods are
1190         encountered in an interface.
1191
1192 2010-01-13  Mark Probst  <mark.probst@gmail.com>
1193
1194         * sgen-gc.c (to_space_expand): Fix assertion.
1195
1196 Wed Jan 13 15:42:28 CET 2010 Paolo Molaro <lupus@ximian.com>
1197
1198         * string-icalls.c: missing declaration fixes.
1199         * sgen-gc.c: portability fixes.
1200
1201 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
1202
1203         * class.c (mono_class_get_implemented_interfaces): Now take a MonoError argument.
1204
1205         * class.c:
1206         * cominterop.c:
1207         * icall.c:
1208         * object.c: 
1209         * class-internals.h: Adjust for new signature of mono_class_get_implemented_interfaces.
1210
1211 2010-01-12  Rodrigo Kumpera  <rkumpera@novell.com>
1212
1213         * class.c (mono_class_setup_interfaces): Now take a MonoError argument and
1214         it can fail loading the type.
1215
1216         * class.c: Add mono_class_inflate_generic_class_checked.
1217
1218         * class.c:
1219         * verify.c:
1220         * class-internals.h: Adjust for new signature of mono_class_setup_interfaces.
1221
1222 2010-01-11  Zoltan Varga  <vargaz@gmail.com>
1223
1224         * loader.c (mono_method_signature_checked): New internal function taking an
1225         MonoError argument.
1226
1227         * socket-io.c (AI_ADDRCONFIG): Applied patch from John Lightsey (jd@cpanel.net).
1228         Fixes build on rh 7.3.
1229
1230 2010-01-10  Aaron Bockover  <abockover@novell.com>
1231
1232         * assembly.c (mono_set_rootdir): Support finding the mono paths on OS X
1233         at runtime in the same way as on Windows, which yields a relocatable
1234         Mono. Uses dyld's _NSGetExecutablePath and realpath to resolve the path
1235         of the running mono process.
1236
1237         On TARGET_ARM, fallback () will always be executed.
1238
1239 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1240
1241         * icall.c (ves_icall_Type_GetInterfaceMapData): This function is generics variance aware.
1242
1243 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1244
1245         * class.c (mono_class_is_assignable_from_slow): Support variant
1246         generic delegates.
1247
1248         * class.c (mono_class_implement_interface_slow): Support types with
1249         variant generic arguments.
1250
1251 2010-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
1252
1253         * verify.c: Remove some code duplication.
1254
1255 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1256
1257         * object.c: Update docs.
1258
1259 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1260
1261         * object.c (add_imt_builder_entry): Improve DEBUG_IMT spew.
1262
1263         * object.c (build_imt_slots): Interfaces with variant generic arguments use the
1264         fallback trampoline as well.
1265
1266         * class.c (mono_class_interface_offset_with_variance): Add new non_exact_match
1267         out argument that is set to TRUE if the match was direct. 
1268
1269         * class.c (mono_class_is_assignable_from): Delegates require variance testing as well.
1270
1271         * class-internal.h: Update prototype of mono_class_interface_offset_with_variance.
1272
1273 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1274
1275         * class.c: Add mono_class_interface_offset_with_variance function that does same
1276         as mono_class_interface_offset but takes variance into account.
1277
1278         * class-internal.h: Export mono_class_interface_offset_with_variance.
1279
1280         * object.c: Fix and improve DEBUG_IMT. Added an assert for IMT thunk building.
1281
1282 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1283
1284         * object.c:
1285         * icall.c:
1286         * class.c: Add some FIXME for due to variant generic arguments.
1287
1288         object.c (mono_object_isinst_mbyref): Interfaces with variant generic arguments
1289         can't use the simple bitfield check, so call mono_class_is_assignable_from if
1290         the bitfield check fails.
1291
1292 2010-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
1293
1294         * class.c (mono_class_is_assignable_from): Rework the generics variance code
1295         to be easier to read and fix bugs in the case a non generic type implements a variant
1296         interface.
1297
1298         * class.c (mono_class_has_variant_generic_params): Make non static.
1299
1300         * class-internals.h: Export mono_class_has_variant_generic_params as part of
1301         the private API.
1302
1303 2010-01-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
1304
1305         * assembly.c: fix MONO_PATH debug output.
1306
1307 2010-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1308
1309         * culture-info-table.h : regenerated.
1310
1311 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1312
1313         * verify.c (mono_verifier_verify_class): Properly check for broken parent. Ignore
1314         types that are meant to not have a parent.
1315
1316 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1317
1318         * marshal.c (mono_marshal_get_runtime_invoke): Make a copy of the signature
1319         from the image mempool, so it is not leaked.
1320
1321 2010-01-04  Zoltan Varga  <vargaz@gmail.com>
1322
1323         * metadata-internals.h (_MonoImage): Remove unused generic_class_cache field.
1324
1325 2010-01-04  Sebastien Pouliot  <sebastien@ximian.com>
1326
1327         * verify.c (verify_valuetype_layout_with_target): Fix case
1328         that can lead to infinite recursion. Fix bug #567861
1329
1330 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1331
1332         * pedump.c: Run code verifier even if image verification fails
1333         due to a failed type we. This allows more errors to be shown.
1334
1335 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1336
1337         * class.c (count_virtual_methods): Remove the assert and now
1338         fail properly.
1339         
1340         * class.c (setup_interface_offsets): This can fail now.
1341
1342         * class.c (mono_class_setup_vtable_general): Check for parent vtable
1343         errors. Check setup_interface_offsets errors.
1344
1345         * class.c (setup_interface_offsets): Simplify the return error logic
1346         and remove class_init_ok.
1347
1348         Fixes #560327.
1349
1350 2010-01-04  Rodrigo Kumpera  <rkumpera@novell.com>
1351
1352         * class.c (mono_class_init): Do class verification at the beginning. Add
1353         some asserts to avoid tripping into invalid memory.
1354
1355         * object.c (compute_class_bitmap): Replace a g_assert_not_reached with a
1356         g_error and a decent message.
1357
1358         * verify.c (mono_verifier_verify_class): Verify for invalid super type.
1359
1360         Fixes #567548.
1361
1362 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1363
1364         * mempool-internals.h (g_list_prepend_mempool): Define this and related functions
1365         as inline functions instead of defining them in mempool.c.
1366
1367         * metadata-internals.h (MonoImageSet): New structure representing a set of
1368         MonoImages, which own a collection of generic instances.
1369
1370         * metadata.c: Get rid of the global generic caches, instead assign each generic
1371         instance to the image set which consists of all the images referenced by the
1372         instance. This greatly speeds up mono_metadata_clean_for_image (), and allows
1373         the memory used by generic instances to be allocated from a per image-set mempool
1374         later.
1375
1376 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1377
1378         * marshal.c (mono_marshal_get_runtime_invoke): Fix a memory leak.
1379
1380 2010-01-03  Zoltan Varga  <vargaz@gmail.com>
1381
1382         * appdomain.c (zero_static_data): Fix a warning.
1383
1384         * locales.c (construct_culture_from_specific_name): Applied patch from
1385         JosĂ© Antonio Sánchez Lázaro <jasl@darcysoft.es>. Fix a crash if a culture was
1386         not found. Fixes #567900.
1387
1388 2009-12-31  Sebastien Pouliot  <sebastien@ximian.com>
1389
1390         * loader.c (mono_method_get_signature_full): Remove two asserts.
1391         Return NULL instead so that the verifier can handle both cases 
1392         gracefully.
1393
1394 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1395
1396         * class.c (mono_class_setup_methods): Use checked version of mono_class_inflate_generic_method_full
1397         so we can properly fail types instead of crashing.
1398
1399         Fixes #567676.
1400
1401 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1402
1403         * reflection.c (reflection_methodbuilder_to_mono_method): Assert in case of a broken
1404         generic method.
1405
1406 2009-12-30  Rodrigo Kumpera  <rkumpera@novell.com>
1407
1408         * marshal.c (mono_mb_emit_restore_result): Properly handle generic enums.
1409
1410 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1411
1412         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait): Don't close the
1413         wait handle if the wait is interrupted, since it is still in mon->wait_list, and
1414         we can't remove it from it since we don't hold the lock.
1415         (mon_new): Free the orphaned events here when a mon structure is added to the
1416         freelist. Fixes #561239. Thanks to Mike Rieker <wmrieker@nii.net> for tracking
1417         this down.
1418
1419 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1420
1421         * verify.c (init_stack_with_value_at_exception_boundary): Do stack overflow checking here
1422         as max stack might be zero.
1423
1424         Fixes #562320.
1425
1426 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1427
1428         Rework all uses of mono_class_setup_methods to accept that it can fail now.
1429
1430         * class.c (mono_class_setup_methods): This function now can fail the class. Do so for generic
1431         instances if the GTD did.
1432
1433         * class.c (mono_class_setup_properties): Ditto.
1434
1435         * class.c (mono_class_setup_events): Ditto.
1436
1437         * class.c (mono_class_setup_vtable): Fail early if the type is already broken.
1438
1439         * class.c (mono_class_setup_vtable_general): Add a few more missing broken type checks. Sanitize
1440         error setting.
1441
1442         * class.c (mono_class_init): Fail if GTD did.
1443
1444         * cominterop.c:
1445         * generic-sharing.c:
1446         * icall.c:
1447         * loader.c:
1448         * object.c:
1449         * verify.c: Properly handle failure of mono_class_setup_methods.
1450
1451 2009-12-26  Rodrigo Kumpera  <rkumpera@novell.com>
1452
1453         * class-internals.c: Add mono_class_inflate_generic_method_full_checked and make
1454         mono_class_inflate_generic_method_full internal.
1455
1456         * class.c (inflate_generic_context): Now takes a MonoError argument.
1457
1458         * class.c (mono_class_inflate_generic_method_full): Now calls the _checked and abort on
1459         errors.
1460
1461 2009-12-26  Zoltan Varga  <vargaz@gmail.com>
1462
1463         * generic-sharing.c (instantiate_other_info): Avoid creating jump trampolines since
1464         they cannot be patched. Partly fixes #564408.
1465
1466 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1467
1468         * metadata-internals.h, reflection.c: Use the
1469         MonoDynamicImage.handleref hash table only with unmanaged keys,
1470         and add a managed hash table handleref_managed for managed keys.
1471
1472 2009-12-24  Mark Probst  <mark.probst@gmail.com>
1473
1474         * sgen-gc.c: Unset to-space bumper between collections.  It might
1475         become invalid due to degraded allocations.
1476
1477 2009-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
1478
1479         * loader.c (mono_method_get_signature_full): Check if the returned signature is compatible
1480         with the one from the original method.
1481
1482         * metadata-verify.c (mono_verifier_is_sig_compatible): New function to verify signature
1483         compatibility.
1484
1485         * verify-internals.h: Add new function to the internal API.
1486
1487 2009-12-18  Dimitar Dobrev  <dpldobrev@yahoo.com>
1488
1489         * culture-info-tables.h: regenerated it to include the Georgian culture.
1490
1491 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1492
1493         * sgen-gc.c: Include mono/utils/memcheck.h.
1494
1495         * reflection.c (mono_reflection_get_type_internal_dynamic): Use assembly->domain
1496         instead of the current domain, since the two might not match if this is called
1497         from the debugger.
1498
1499         * metadata-internals.h (MonoDynamicAssembly): Add a 'domain' field to specify the
1500         domain which created this assembly.
1501
1502 2009-12-18  Zoltan Varga  <vargaz@gmail.com>
1503
1504         * debug-helpers.c (dis_one): Avoid a glib assert on empty strings.
1505
1506 2009-12-17  Mark Probst  <mark.probst@gmail.com>
1507
1508         * sgen-gc.c: Managed implementation of the specialized generic
1509         store write barrier.
1510
1511 2009-12-17  Rodrigo Kumpera  <rkumpera@novell.com>
1512
1513         * icall.c (ves_icall_Type_GetMethodsByName): Don't pin virtual methods if they are newslot.
1514         A private virtual newslot method is used to implement an interface method without exposing
1515         it to users. When querying for public instance methods, such method would hide a public one
1516         on a parent type.
1517
1518         Fixes #564379.
1519
1520 2009-12-17  Zoltan Varga  <vargaz@gmail.com>
1521
1522         * reflection.c (resolve_object): Fix the encoding of unmanaged calling
1523         conventions.
1524
1525 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1526
1527         * reflection.c (mono_type_get_object): Guard against NULL generic param owner.
1528
1529 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1530
1531         * class-internals.h (MonoDynamicGenericClass): Kill property and event related fields
1532         as they are no longer used.
1533         
1534          * metadata.c (free_generic_class_dependents): Remove reference to previous fields
1535
1536         * reflection.c (mono_reflection_generic_class_initialize): Ditto.
1537
1538 2009-12-16  Rodrigo Kumpera  <rkumpera@novell.com>
1539
1540         * reflection.c (mono_type_get_object): If the type is VAR or MVAR check
1541         if the owner class has not been finished before returning reflection_info.      
1542
1543         Fixes #565127.
1544
1545 2009-12-16  Zoltan Varga  <vargaz@gmail.com>
1546
1547         * reflection.c (mono_custom_attrs_from_param): Avoid a crash if a dynamic
1548         param doesn't have custom attributes. Fixes #565117.
1549
1550         * class.c (mono_bounded_array_class_get): Make these classes PUBLIC. Fixes
1551         #565120.
1552
1553 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1554
1555         * class.c (mono_class_setup_fields): Fail valuetypes that are bigger than 1Mb.
1556
1557 2009-12-15  Rodrigo Kumpera  <rkumpera@novell.com>
1558
1559         * pedump.c: Add partial-md mode that doesn't perform full metadata verification. It does the
1560         same amount done by a core-clr enabled runtime.
1561
1562 2009-12-15  Marek Habersack  <mhabersack@novell.com>
1563
1564         * appdomain.c (mono_make_shadow_copy): make sure access mode of
1565         the target files is reset to writable by owner and readable by
1566         everyone else to prevent problems when updating shadow copies of
1567         files whose source is read-only. Fixes bug #556884
1568
1569 2009-12-15  Mark Probst  <mark.probst@gmail.com>
1570
1571         * class.c (mono_generic_class_get_class): Allocate the generic
1572         class via malloc again, so that it can be freed when any one of
1573         the images of its constituent types is closed.
1574
1575         * metadata.c: When closing an image, don't free generic insts and
1576         generic classes right away, but put them into a list for later
1577         freeing.
1578
1579         * image.c, metadata-internals.h: Store the free list and in the
1580         second pass of closing an image, free it.
1581
1582 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1583
1584         * reflection.c (mono_generic_class_get_object): Assert if this is ever called.
1585
1586         * reflection.c (mono_reflection_register_with_runtime): Only register dynamic
1587         types in type_hash.
1588
1589         * reflection.c (resolve_object): Call ensure_complete_type on the inflated field.
1590
1591 2009-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
1592
1593         * reflection.c (mono_reflection_type_get_handle): Properly fail in case of a broken
1594         user type.
1595
1596         * reflection.c (mono_reflection_register_with_runtime): Throws in case a bad user type
1597         is used.
1598
1599 2009-12-14  Miguel de Icaza  <miguel@novell.com>
1600
1601         * verify.c (mono_method_verify): The Unused opcodes produce an
1602         InvalidProgramException on .NET
1603
1604 2009-12-14  Sebastien Pouliot  <sebastien@ximian.com>
1605
1606         * loader.c (mono_method_get_header): Move assert after the verifier
1607         has been called on the method header.
1608
1609 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1610
1611         * object-internals.h: Remove useless field from MonoReflectionGenericClass.
1612
1613         * appdomain.c: Bump corlib version.
1614
1615 2009-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
1616
1617         To properly support user types, MonoGenericClass has to be used for regular, non SRE,
1618         types as well since otherwise generic instances would not return UT as arguments but
1619         their undelying system type.
1620
1621         * object-internals.h: Change field types of MonoGenericClass and *OnTypeBuilderInst
1622         to reflect the fact that they can have now multiple different types.
1623
1624         * reflection.c (mono_image_get_field_on_inst_token): Handle MonoField.
1625
1626         * reflection.c (mono_image_get_ctor_on_inst_token): Handle MonoCMethod.
1627
1628         * reflection.c (mono_image_get_method_on_inst_token): Handle MonoMethod.
1629
1630         * reflection.c (mono_reflection_register_with_runtime): Init super types
1631         if the image is not dynamic.
1632
1633         * reflection.c (mono_reflection_bind_generic_parameters): In case of a MonoGenericClass,
1634         check if the generic type definition is a TypeBuilder.
1635
1636         * reflection.c (mono_reflection_generic_class_initialize): If the generic type definition
1637         doesn't belong to a dynamic image, skip initialization.
1638
1639         * reflection.c (resolve_object): Properly handle *OnTypeBuilderInst types where their
1640         base definition is not a dynamic type.
1641
1642 2009-12-11  Marek Habersack  <mhabersack@novell.com>
1643
1644         * object.c (mono_ldstr, mono_ldstr_metadata_sig): added calls to
1645         mono_profiler_string_allocation
1646
1647         * string-icalls.c (ves_icall_System_String_InternalAllocateStr):
1648         if string profiling is enabled, call
1649         mono_profiler_string_allocation
1650
1651         * profiler.h: added two MonoProfileFlags -
1652         MONO_PROFILE_IOMAP_EVENTS and MONO_PROFILE_STRING_ALLOC as well as
1653         installation functions for the hooks below.
1654
1655         * profiler-private.h, profiler.c: added two hooks:
1656         mono_profiler_string_allocation called whenever a string is
1657         allocated by InternalAllocateStr and mono_profiler_iomap called
1658         whenever IOMAP code performs an adjustement on a file path.
1659
1660 Fri Dec 11 18:24:04 CET 2009 Paolo Molaro <lupus@ximian.com>
1661
1662         * boehm-gc.c: fixed race condition while getting the target of a
1663         disappearing link (bug #522233).
1664
1665 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1666
1667         * class.c (mono_type_get_full): Produce warning instead of simply swallowing
1668         the error.
1669
1670 2009-12-10  Rodrigo Kumpera  <rkumpera@novell.com>
1671
1672         * reflection.c: Add mono_reflection_register_with_runtime icall to
1673         allow a MonoGenericClass to register itself as the managed mirror of
1674         a given generic instance.
1675         This is a temporary workaround until all MGC instantiation happens in
1676         managed code.
1677
1678         * object-internals.h: Ditto.
1679
1680         * icall-def.h: Ditto.
1681
1682 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1683
1684         * sgen-gc.c (find_in_remsets): Also search the generic store
1685         remsets.
1686
1687 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1688
1689         * sgen-gc.c: Don't access class names in debugging code when
1690         unloading a domain, because they might not be valid anymore.
1691
1692 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1693
1694         * domain.c, domain-internals.h: New function mono_domain_unset().
1695
1696         * appdomain.c (unload_thread_main): Detach the thread again at the
1697         end.
1698
1699         * threads.c: When a thread exists or is detached, unset its domain
1700         so that it's NULL when, for example, a pthread destructor runs.
1701
1702         * sgen-gc.c: Assert that there is no domain set after a thread is
1703         done.
1704
1705 2009-12-10  Mark Probst  <mark.probst@gmail.com>
1706
1707         * class.c (mono_generic_class_get_class),
1708         metadata.c (free_generic_class): Allocate generic MonoClass's from
1709         the image mempool, not via malloc.  The problem with malloc is
1710         that when unloading a domain those classes are freed before
1711         clearing the heap and SGen needs the classes.  Rewriting the
1712         unloading code to do the free later would be more work and there's
1713         no point in using malloc anyway.
1714
1715 2009-12-09  Sebastien Pouliot  <sebastien@ximian.com>
1716
1717         * loader.c (mono_method_signature): Always call mono_loader_unlock 
1718         before returning.
1719
1720 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1721
1722         * metadata-verify.c: Add mono_verifier_verify_string_signature to check
1723         user string blobs.
1724
1725         * verify-internals.h: Add new function to the internal API.
1726
1727         * verify.c (do_ldstr): Call into mono_verifier_verify_string_signature to
1728         check if it's a valid string.
1729
1730         * object.c (mono_ldstr): Ditto.
1731
1732         Fixes #561943.
1733
1734 2009-12-09  Rodrigo Kumpera  <rkumpera@novell.com>
1735
1736         * icall.c (ves_icall_GetCurrentMethod): Drop all generic arguments
1737         from a method before returning it. This is the expected behavior.
1738
1739 2009-12-08  Rodrigo Kumpera  <rkumpera@novell.com>
1740
1741         * reflection.c (inflate_method): Handle the case of a regular system type.
1742
1743 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1744
1745         * sgen-gc.c, sgen-pinning-stats.c, sgen-gray.c: More statistics
1746         gathering code.
1747
1748         * mempool.c, mempool-internals.h: New function
1749         mono_mempool_get_bytes_allocated().
1750
1751         * Makefile.am: sgen-pinning-stats.c added.
1752
1753 2009-12-08  Mark Probst  <mark.probst@gmail.com>
1754
1755         * sgen-gc.c (create_allocator): Only use the fast path if the
1756         object size is within the small object size limit.
1757
1758 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1759
1760         * sgen-gc.c: Make sure section->data is aligned to 8 bytes by
1761         possibly adding padding to sizeof (GCMemSection).
1762
1763 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1764
1765         * sgen-gc.c (mono_gc_wbarrier_nostore): Skip the remset if the
1766         reference is not in the nursery.
1767
1768 2009-12-07  Rodrigo Kumpera  <rkumpera@novell.com>
1769
1770         * class.c (mono_class_from_typeref): Bounds check idx against the 
1771         assemblyref table.
1772
1773 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1774
1775         * sgen-gc.c, sgen-pinning.c: When pinning, make only one pass
1776         through the potential roots, then sort the results and find the
1777         pinned objects from there.
1778
1779         * Makefile.am: sgen-pinning.c added.
1780
1781 2009-12-07  Mark Probst  <mark.probst@gmail.com>
1782
1783         * sgen-gc.c: Record generic stores in specialized remset buffers.
1784
1785 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1786
1787         * sgen-gc.c: Make pinned chunks the same size as major heap
1788         sections, and align them as well, so that we can check whether an
1789         object is in a pinned chunk or a major section in constant time.
1790
1791 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1792
1793         * sgen-gc.c (build_nursery_fragments): Don't leak fragments.
1794
1795 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1796
1797         * sgen-gc.c: Make all major heap sections the same size (currently
1798         128k) and allocate them on aligned addresses.  Small heap sections
1799         give us better granularity with pinned objects - we can free up
1800         much more memory.
1801
1802 2009-12-06  Mark Probst  <mark.probst@gmail.com>
1803
1804         * string-icalls.c (ves_icall_System_String_GetLOSLimit): Debug
1805         output removed.
1806
1807 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1808
1809         Applied patch from Laurent Etiemble (laurent.etiemble@gmail.com).
1810
1811         * mono/metadata/assembly.c: When opening an assembly image, pass the real
1812         names in addition to the runtime generated one.
1813
1814         * mono/metadata/image.h: Add a function to take the real name of the assembly
1815         image.
1816
1817         * mono/metadata/image.c: If a real name has been passed to load an assembly,
1818         use it instead of the runtime generated one.
1819
1820         Code is contributed under MIT/X11 license.
1821
1822 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1823
1824         * marshal.c (emit_marshal_vtype): Do the klass == date_time_class checks
1825         before the other checks to prevent problems if the DateTime class is blittable.
1826         Hopefully fixes #559600.
1827
1828 2009-12-05  Mark Probst  <mark.probst@gmail.com>
1829
1830         * string-icalls.c, string-icalls.h, icall-def.h: New icall that
1831         returns the largest string length that will not be put into the
1832         LOS.
1833
1834         * sgen-gc.c, gc-internal.h: New function that returns the largest
1835         object size that will not be put into the LOS.
1836
1837         * appdomain.c: Bump corlib version.
1838
1839 2009-12-05  Zoltan Varga  <vargaz@gmail.com>
1840
1841         * class-internals.h: Add MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1842
1843         * generic-sharing.c: Handle MONO_RGCTX_INFO_METHOD_DELEGATE_CODE.
1844
1845 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1846
1847         * reflection.c (inflate_method): Fix signature.
1848
1849         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Reflect change
1850         in managed code.
1851
1852 2009-12-04  Rodrigo Kumpera  <rkumpera@novell.com>
1853
1854         * reflection.c (inflate_method): Make this method work with TypeBuilder as well.
1855
1856 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1857
1858         * sgen-gc.c: Abstract to-space handling.
1859
1860 2009-12-03  Rodrigo Kumpera  <rkumpera@novell.com>
1861
1862         * loader.c (find_method_in_class): Ignore methods with broken signatures.
1863
1864         Fixes #559906.
1865
1866 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1867
1868         * sgen-gc.c: Only add references from outside the nursery to
1869         within the nursery to the global remset list.
1870
1871 2009-12-03  Mark Probst  <mark.probst@gmail.com>
1872
1873         * appdomain.c (create_exceptions): Set the domain temporarily if
1874         necessary to avoid cross-domain references.
1875
1876 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1877
1878         * verify.c (get_stack_type): Return that the type is invalid instead of
1879         asserting.
1880
1881         * verify.c (mono_method_verify): Verify that all locals and arguments
1882         have valid stack types.
1883
1884         Fixes #559913.
1885
1886 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1887
1888         * verify.c (mono_method_verify): Bounds check the filter offset. Make all
1889         bounds checking overflow aware.
1890
1891         Fixes #559910.
1892
1893 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1894
1895         * verify.c (do_invoke_method): Check for invalid method signatures.
1896
1897         Fixes #553450.
1898
1899 2009-12-02  Jb Evain  <jbevain@novell.com>
1900
1901         * appdomain.c (MONO_CORLIB_VERSION): bump.
1902         * icall-def.h (get_base_definition): renamed to get_base_method
1903         and add a boolean argument indicating we want the original
1904         method definition, or the immediate base method.
1905         * icall.c: apply the get_base_definition to get_base_method change.
1906
1907 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1908
1909         * class.c (mono_class_setup_fields): Fail an enum without an instance field.
1910
1911         Fixes #558042.
1912
1913 Wed Dec 2 16:35:49 CET 2009 Paolo Molaro <lupus@ximian.com>
1914
1915         * class.c: remove asserts for invalid type token in
1916         mono_class_name_from_token(), mono_assembly_name_from_token() and
1917         mono_class_create_from_typedef () (fixes bug #553318).
1918
1919 Wed Dec 2 15:48:19 CET 2009 Paolo Molaro <lupus@ximian.com>
1920
1921         * metadata.c, class.c, loader.c: remove assert after bsearch() for
1922         incorrect assemblies (bug #553322).
1923
1924 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1925
1926         * metadata.c (mono_metadata_inflate_generic_inst): Add MonoError parameter.
1927
1928         * metadata-internals.h: Change signature of mono_metadata_inflate_generic_inst. 
1929
1930         * class.c (inflate_generic_type): Use new version of mono_metadata_inflate_generic_inst.
1931
1932         * class.c (inflate_generic_context): Ditto.
1933
1934         * loader.c (method_from_methodspec): Ditto.
1935
1936         Fixes #558230.
1937
1938 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1939
1940         * class.c (mono_type_retrieve_from_typespec): Use MonoError machinery to report errors.
1941
1942         * class.c (mono_class_create_from_typespec): Ditto.
1943
1944         * class.c (mono_class_get_full): Fix for change on the above 2 functions.
1945
1946         * class.c (mono_type_get_full): Fix for change on the above 2 functions.
1947
1948         Fixes #558184.
1949
1950 2009-12-02  Rodrigo Kumpera  <rkumpera@novell.com>
1951
1952         * verify.c (mono_class_has_default_constructor): Check fror broken signatures.
1953
1954         * verify.c (verify_delegate_compatibility): Ditto.
1955
1956         * verify.c (do_newobj): Ditto.
1957
1958         Fixes #558046.
1959
1960 2009-12-02  Mark Probst  <mark.probst@gmail.com>
1961
1962         * sgen-gc.c: Use a gray queue instead of requiring that gray
1963         objects are in a contiguous region.
1964
1965         * sgen-gray.c: The gray queue implementation.
1966
1967         * Makefile.am: sgen-gray.c added.
1968
1969 2009-12-02  Mark Probst  <mark.probst@gmail.com>
1970
1971         * appdomain.c: When unloading a domain, zero its static data and
1972         perform a minor collection when using SGen.  That will get rid of
1973         all the remsets pointing into that domain's static data.
1974
1975         * sgen-gc.c: Allow remsets into static data.  By doing this we
1976         need less checks so we're more efficient.
1977
1978 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1979
1980         * verify.c (mono_method_verify): Check for catch clauses with broken
1981         types.
1982
1983         Fixes #558465.
1984
1985 2009-12-01  Jb Evain  <jbevain@novell.com>
1986
1987         * class.c (make_generic_param_class): set the namespace of
1988         the generic parameter class from its owner, if available.
1989
1990 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
1991
1992         * verify.c (code_bounds_check): Do proper overflow checking.
1993
1994         * verify.c (mono_method_verify): The number of switch entries is
1995         an unsigned int. Properly bounds check it.
1996
1997         Fixes #558594.
1998
1999 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2000
2001         * metadata.c: Kill mono_metadata_get_param_attrs_checked. Add
2002         mono_metadata_method_has_param_attrs which only checks if a given param
2003         list has a non zero flags entry.
2004
2005         * metadata.c (mono_metadata_get_param_attrs): Add param_count parameter
2006         to inform how many params should we expect to decode.
2007
2008         * loader.c (mono_method_signature): Use mono_metadata_method_has_param_attrs
2009         as it's faster than mono_metadata_get_param_attrs.
2010
2011         * metadata-internals.h: Fix mono_metadata_get_param_attrs signature and
2012         add mono_metadata_method_has_param_attrs.
2013
2014 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2015
2016         * class.c (mono_class_setup_vtable_general): Check for mono_method_get_vtable_slot
2017         failures.
2018
2019         * class.c (mono_method_get_vtable_slot): Don't assert if the computed method slot
2020         is -1 but its class is broken.
2021
2022         Fixes #558522.
2023
2024 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2025
2026         * metadata.c: Introduce mono_metadata_get_param_attrs_checked which checks
2027         for parameter overflow.
2028
2029         * metadata.c (mono_metadata_parse_method_signature_full): Use checked version
2030         of mono_metadata_get_param_attrs.
2031
2032         * metadata-internals.h: Add mono_metadata_get_param_attrs_checked to the internal
2033         API.
2034
2035         * loader.c (mono_method_signature): Use checked version of mono_metadata_get_param_attrs.
2036
2037 2009-12-01  Rodrigo Kumpera  <rkumpera@novell.com>
2038
2039         * class.c (mono_class_setup_fields): Check for fields with broken types.
2040
2041         Fixes #558741.
2042
2043 2009-11-28  Rodrigo Kumpera  <rkumpera@novell.com>
2044
2045         * reflection.c (ensure_generic_class_runtime_vtable): Split this function in 2
2046         so we can avoid calling ensure_runtime_vtable multiple times for the GTD during
2047         its TypeBuilder::CreateType ().
2048
2049         * reflection.c (ensure_generic_class_runtime_vtable): Avoid initializing interfaces
2050         if not needed.
2051
2052         * reflection.c: Every time we change the interface array, set interfaces_packed to NULL
2053         to make setup_interface_offsets happy.
2054
2055         * reflection.c (remove_instantiations_of_and_ensure_contents): Fix instances again as corlib
2056         compilation now works.
2057
2058 2009-11-28  Zoltan Varga  <vargaz@gmail.com>
2059
2060         * appdomain.c (create_exceptions): New helper function extracted from
2061         mono_runtime_init () to precreate objects used during exception handling.
2062         (mono_runtime_init): Call it.
2063         (mono_domain_create_appdomain_internal): Ditto. Fixes #555264.
2064
2065 2009-11-27  Rodrigo Kumpera  <rkumpera@novell.com>
2066
2067         * reflection.c (remove_instantiations_of_and_ensure_contents): Temp hack to fix corlib
2068         compilation until the proper one is found.
2069
2070 2009-11-27  Zoltan Varga  <vargaz@gmail.com>
2071
2072         * class.c (mono_class_setup_vtable_general): Cache the result of
2073         get_virtual_methods () since it can be slow because of the metadata
2074         optimization.
2075
2076         * metadata-internals.h (_MonoImage): Change 'method_cache' to a GHashTable
2077         from a MonoValueHashTable for now, since the later is based on an earlier
2078         version of hpj's internal probing code and seems to have serious collision
2079         issues.
2080
2081         * loader.c (mono_get_method_full): Update after the change above.
2082
2083 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
2084
2085         * class-internals.h (MonoCachedClassInfo): Add 'is_generic_container' field.
2086
2087 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
2088
2089         * reflection.c (get_field_on_inst_generic_type): Try to fallback using the field from
2090         the GTD instead of the DGC instead of crashing.
2091
2092         * reflection.c (ensure_generic_class_runtime_vtable): Only reinflate stuff that is
2093         required. Inflate fields if needed.
2094
2095         * reflection.c (remove_instantiations_of): Ensure generic instances are properly
2096         finished. Renamed.
2097
2098 2009-11-26  Rodrigo Kumpera  <rkumpera@novell.com>
2099
2100         * class.c (check_interface_method_override): Check for NULL signatures and fail
2101         the type.
2102
2103         * debug-helpers.c (mono_signature_get_desc): Return a fixed string for NULL signatures.
2104
2105         Fixes #553428.
2106
2107 2009-11-26  Zoltan Varga  <vargaz@gmail.com>
2108
2109         * class.c (mono_class_get_virtual_methods): Call decode_row_col to obtain
2110         the MONO_METHOD_FLAGS column instead of decoding the whole row.
2111
2112 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
2113
2114         * loader.c (field_from_memberref): Resolve the class first then the field
2115         signature. Remove a lot of duplicated code and make sure we don't pass valid
2116         values to mono_loader_set_error_field_load.
2117
2118         Fixes #553306.
2119
2120 2009-11-25  Rodrigo Kumpera  <rkumpera@novell.com>
2121
2122         * class.c (inflate_generic_type): Change code to use new signature of
2123         mono_error_set_bad_image.
2124
2125         Fixes #558124.
2126
2127 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com> 
2128
2129         * verify.c (mono_method_verify): Don't free ctx.params items if 
2130         we aborted while inflating the ctx.locals. Complete previous fix
2131
2132 2009-11-25  Sebastien Pouliot  <sebastien@ximian.com>
2133
2134         * verify.c (mono_method_verify): Use the uninflated type name, 
2135         when the inflated is null, to report errors. Also take care when
2136         freeing, not to free everything since, in case of an error, some
2137         stuff would be copies (i.e. not allocated by the function itself)
2138         Fix bug #558145
2139
2140 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
2141
2142         * verify.c (stack_push, stack_pop, stack_pop_safe): Assert if we underflow
2143         or overflow. The caller must have done this check explicitly. This guard us
2144         from accessing invalid memory.
2145
2146         * verify.c (do_push_static_field): Check for stack overflow.
2147
2148         Fixes #553333.
2149
2150 2009-11-24  Rodrigo Kumpera  <rkumpera@novell.com>
2151
2152         * loader.c (find_method_in_class): Don't crash if the signature cannot
2153         be resolved.
2154
2155         * metadata.c (mono_metadata_parse_generic_param): Return NULL instead
2156         of asserting for the case of invalid params.
2157
2158         Fixes #553304.
2159
2160 2009-11-24  Sebastien Pouliot  <sebastien@ximian.com>
2161
2162         * image.c (mono_image_load_module): Fix crash when a bad assembly
2163         has no module at all (fix bug #553412) and also replace the 
2164         g_assert with a return NULL (documented return value for failure)
2165
2166 2009-11-23  Zoltan Varga  <vargaz@gmail.com>
2167
2168         * debug-helpers.c (mono_type_get_desc): Handle typedbyref.
2169
2170 2009-11-23  Miguel de Icaza  <miguel@novell.com>
2171
2172         * file-io.c: Change FindFirst/FindNext/FindClose API to return the
2173         file attribute to managed code and avoid doing the mask/attribute
2174         checks here. 
2175
2176 2009-11-22  Miguel de Icaza  <miguel@novell.com>
2177
2178         * file-io.c: Surface a smart FindFirst/FindNext/FindClose API to
2179         the managed world.
2180
2181         * icall-def.h: New entry points.
2182         
2183 2009-11-19  Mark Probst  <mark.probst@gmail.com>
2184
2185         * process.c: Don't put references to managed objects into a
2186         g_ptr_array.
2187
2188 2009-11-18  Sebastien Pouliot  <sebastien@ximian.com>
2189
2190         * class.c (can_access_internals): Allow CoreCLR to participate in
2191         allowing (or not) [InternalsVisibleTo] between assemblies.
2192         * security-core-clr.c|h: Make sure that only trusted code (a 
2193         superset of platform code) can access the internals of platform
2194         code.
2195
2196 Mon Nov 16 16:28:11 CET 2009 Paolo Molaro <lupus@ximian.com>
2197
2198         * reflection.c: use the correct base class to get the virtual method
2199         "get_UnderlyingSystemType" and speed up the icall. Fixes bug #555013.
2200
2201 2009-11-16  Sebastien Pouliot  <sebastien@ximian.com>
2202
2203         * security-core-clr.c (get_caller_no_reflection_related): 
2204         [Mono]Type.InvokeMember is outside System.Reflection[.Emit] but
2205         it's still reflection and must be filtered correctly.
2206
2207 2009-11-16  Mark Probst  <mark.probst@gmail.com>
2208
2209         * object.c (compute_class_bitmap): Fix for large bitmaps.
2210
2211 2009-11-15  Zoltan Varga  <vargaz@gmail.com>
2212
2213         (mono_gc_get_suspend_signal): Fix the build with a system libgc.
2214
2215         * boehm-gc.c (mono_gc_base_init): Applied patch from DKoushik K. Dutta (
2216         koush@koushikdutta.com). Disable GC_no_dls on android.
2217
2218 2009-11-12  Mark Probst  <mark.probst@gmail.com>
2219
2220         * sgen-gc.c (find_tlab_next_from_address): Handle the case where
2221         tlab_next points outside the TLAB because the allocator was
2222         interrupted.
2223
2224 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2225
2226         * reflection.c (mono_image_module_basic_init): Handle exceptions correctly.
2227
2228 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2229
2230         * object-internals.h: Change signature for mono_string_to_utf8_image.
2231
2232         * object.c (mono_string_to_utf8_image): Change signature to take a MonoError
2233         argument.
2234
2235         * reflection.c: Take care of mono_string_to_utf8_image change and avoid raising
2236         exceptions due to mono_string_to_utf8.
2237
2238 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2239
2240         * object-internals.h: Change signature for mono_string_to_utf8_mp.
2241
2242         * object.c (mono_remote_class): Make sure all resources are released before
2243         raising an exception.
2244
2245         * object.c (mono_print_unhandled_exception): Avoid raising an exception.
2246
2247 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2248
2249         * mono-perfcounters.c (network_get_impl): Change variable initialization
2250         ordering to fix potential memory leak in case of exceptions.
2251
2252         * mono-perfcounters.c (mono_perfcounter_create): Properly handle badly
2253         encoded strings.
2254         
2255 2009-11-09  Rodrigo Kumpera  <rkumpera@novell.com>
2256
2257         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): Change
2258         variable initialization ordering to fix potential memory leak in case
2259         of exceptions.
2260
2261 2009-11-09  Zoltan Varga  <vargaz@gmail.com>
2262
2263         * icall.c (mono_ArgIterator_Setup): Remove the MONO_ARCH_REGPARMS stuff, its not
2264         needed.
2265
2266 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2267
2268         * appdomain.c: Fix shadow path code to better deal with exceptions.
2269
2270 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2271
2272         * appdomain.c: Use checked version of mono_string_to_utf8 to avoid raising an
2273         exception in the middle of the runtime code.
2274
2275 2009-11-07  Rodrigo Kumpera  <rkumpera@novell.com>
2276
2277         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): Don't
2278         leak memory with broken envvar value.
2279
2280 2009-11-06  Mark Probst  <mark.probst@gmail.com>
2281
2282         * reflection.c (mono_reflection_setup_internal_class): Because
2283         nested classes are not added to the name cache, we must put them
2284         in the reflection_info_unregister_classes list.
2285
2286 2009-11-05  Sebastien Pouliot  <sebastien@ximian.com>
2287
2288         * class.c: When CoreCLR is enabled don't call mono_init_com_types
2289         if MONO_CLASS_IS_IMPORT return true unless the type reside in 
2290         platform (trusted) code. Instead we return a TypeLoadException to
2291         be thrown later. This is the exception thrown by Silverlight 2 if
2292         a type, inside application (user) code is marked with [ComImport]
2293
2294 2009-11-05  Zoltan Varga  <vargaz@gmail.com>
2295
2296         * icall.c (ves_icall_System_Diagnostics_Debugger_IsAttached_internal): Call
2297         mono_is_debugger_attached () too.
2298
2299         * mono-debug.c (mono_is_debugger_attached): New helper function.
2300         (mono_set_is_debugger_attached): Ditto.
2301
2302 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2303
2304         * object-internals.h: Add mono_string_to_utf8_checked.
2305
2306         * object.c: Implement mono_string_to_utf8_checked.
2307
2308 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2309
2310         * class.c: Add missing check for load errors after every
2311         call to mono_class_setup_fields
2312
2313         Fixes #552282.
2314
2315 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2316
2317         metadata-verify.c (verify_tables_schema): Fix the error message.
2318
2319 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2320
2321         * metadata.c: Change event table schema to use TDOR for event type
2322         as this is what it's meant to be.
2323
2324         * metadata.c (mono_metadata_compute_size): Change MONO_TABLE_ASSEMBLYPROCESSOR
2325         to MONO_TABLE_ASSEMBLYREFPROCESSOR, which is table that has a MONO_MT_TABLE_IDX
2326         entry.
2327
2328         * metadata.c (mono_metadata_compute_size): Trim MT_TABLE_IDX of code that no
2329         longer makes sense: remove MONO_TABLE_EVENT and remove checks for non-existent
2330         rows in MONO_TABLE_GENERICPARAM.
2331
2332         Fixes #552289.
2333
2334 2009-11-05  Rodrigo Kumpera  <rkumpera@novell.com>
2335
2336         * class.c (mono_image_add_to_name_cache): Assert on duplicate
2337         insertion.
2338
2339         * reflection.c (mono_reflection_setup_internal_class): Avoid
2340         registering a gc root the same MonoClass multiple times.
2341         Don't register nested types on the global scope as they should
2342         not be available there.
2343
2344 2009-11-05  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2345
2346         * culture-info-tables.h: regenerated.
2347
2348 2009-11-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
2349
2350         * debug-helpers.c: avoid g_strdup() in mono_type_full_name().
2351
2352 2009-11-04  Sebastien Pouliot  <sebastien@ximian.com>
2353
2354         * string-icalls.c|h: Remove string internal calls that are not 
2355         used anymore by the class libraries.
2356         * icall.c: Remove System_Reflection_FieldInfo_internal_from_handle
2357         which is not used in the class librairies.
2358         * icall-def.h: Update tables.
2359
2360 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2361
2362         * class.h: Move mono_class_inflate_generic_type_checked...
2363
2364         * class-internals.h: to here and make it internal. We don't want to
2365         further expose MonoGenericContext. 
2366
2367 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2368
2369         * verify.c (mono_method_verify): Improve error message.
2370
2371 2009-11-04  Rodrigo Kumpera  <rkumpera@novell.com>
2372
2373         * reflection.c (fieldref_encode_signature): If field_image is NULL then
2374         the token is already properly encoded. Fixs 4.0 build.
2375
2376 2009-11-04  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2377
2378         * locales.c (construct_number_format): Check if the number index is
2379         valid before trying to use it, if not, just return.
2380         
2381 2009-11-04  Zoltan Varga  <vargaz@gmail.com>
2382
2383         * marshal.c (mono_marshal_get_runtime_invoke): Don't reset abort exceptions,
2384         since that loses the abort state. Fixes #539394.
2385
2386 2009-11-03  Zoltan Varga  <vargaz@gmail.com>
2387
2388         * marshal.c (mono_marshal_get_native_wrapper): For icall wrappers, add an
2389         explicit this argument to the call signature.
2390         (mono_marshal_get_icall_wrapper): Ditto.
2391
2392 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2393
2394         * reflection.c (fieldref_encode_signature): Add new field_image parameter
2395         to indicate which assembly to use when resolving a custom-mod.
2396
2397         Fixes handling of volatile fields used across assemblies as reported in #551513.
2398
2399 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2400
2401         * loader.c: Improve error messages.
2402
2403 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2404
2405         * class.c (mono_class_setup_methods): Only give a slot for virtual methods
2406         of interfaces. Fixes IKVM.
2407
2408         * class.c (mono_class_setup_vtable_general): Improve debug spew.
2409
2410 2009-11-03  Rodrigo Kumpera  <rkumpera@novell.com>
2411
2412         * verify.c (verifier_inflate_type): Return the inflated type on success.
2413
2414 2009-11-02  Zoltan Varga  <vargaz@gmail.com>
2415
2416         * debug-mono-symfile.c (check_line): Fix the handling of IL offset 0.
2417
2418         * threads.c (mono_thread_attach): Call the profiler thread start callback.
2419
2420         * object-internals.h (_MonoThreadInternal): Add a 'flags' field.
2421
2422         * threads.c (build_wait_tids): Ignore threads which have the DONT_MANAGE
2423         flag set.
2424
2425         * profiler.c: Add new profiler callbacks for runtime invoke.
2426
2427         * object.c (mono_runtime_invoke): Call the runtime invoke callbacks.
2428
2429 2009-11-01  Mark Probst  <mark.probst@gmail.com>
2430
2431         * sgen-gc.c: Keep track of the reason for a major collection and
2432         write it to the heap-dump file.
2433
2434 2009-10-31  Miguel de Icaza  <miguel@novell.com>
2435
2436         * threads.c: refactor the code that initializes the
2437         thread_start_args into a reusable function and use this in the two
2438         methods that start up threads.
2439
2440 2009-10-31  Zoltan Varga  <vargaz@gmail.com>
2441
2442         * appdomain.c (mono_domain_try_unload): Applied patch from Romain Tartière.
2443         Fix returning when WaitForSingleObjectEx returns WAIT_IO_COMPLETION.
2444
2445 2009-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
2446
2447         * mono-perfcounters.c: add the "_Total" instance for CPU counters.
2448         Until now, we only had the per-cpu(core) counters.
2449
2450 2009-10-28  Mark Probst  <mark.probst@gmail.com>
2451
2452         * gc-internal.h, boehm-gc, sgen-gc.c, null-gc: Add
2453         mono_gc_get_suspend_signal(), which returns the suspend signal
2454         number used by the GC.
2455
2456 2009-10-25  Zoltan Varga  <vargaz@gmail.com>
2457
2458         * threads.c (start_wrapper): Avoid an assert if thread_start_args () is NULL.
2459
2460         * threads.c (start_wrapper): Call mono_profiler_thread_start () later after
2461         signalling start_notify.
2462
2463 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2464
2465         * appdomain.c: do not test the st_mode field for shadow-copies.
2466         Fixes bug #545276.
2467
2468 2009-10-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
2469
2470         * threadpool.[ch]: added hooks for thread start/finish and item
2471         processing begin/end. For monotouch use only.
2472
2473 2009-10-24  Zoltan Varga  <vargaz@gmail.com>
2474
2475         * threads.c (mono_thread_get_name): New helper function.
2476
2477         * reflection.c (resolve_object): Set handle_class for strings too.
2478         (mono_reflection_create_custom_attr_data_args): New helper function to decode
2479         a cattr blob into a set of arrays and structures without creating the custom
2480         attributes themselves.
2481         (create_custom_attr_data): Simplify using create_custom_attr_data_args.
2482
2483         * mono-debug.c (mono_debug_il_offset_from_address): New helper function.
2484
2485         * debug-mono-symfile.c (mono_debug_symfile_get_line_numbers): New helper
2486         function.
2487
2488 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2489
2490         * verify.c: Replace calls to mono_class_inflate_generic_type with
2491         mono_class_inflate_generic_type_checked. Fixes #480005.
2492
2493 2009-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
2494
2495         * class.c (mono_class_inflate_generic_type_with_mempool): Clear the error
2496         object since not all paths lead to callees initing it.
2497
2498 2009-10-23  Alp Toker  <alp@nuanti.com>
2499
2500         Fix embedding API breakage from r144688. mono-compiler.h is an internal
2501         header and should not be shipped:
2502
2503         * class.h: Back out MONO_DEPRECATED change. Currently depends on config.h
2504         which is specific to the mono build. Not going to work.
2505
2506 2009-10-23  Sebastien Pouliot  <sebastien@ximian.com>
2507
2508         * security-manager.c: Report if core-clr is active from
2509         ves_icall_System_Security_SecurityManager_get_SecurityEnabled
2510         to allow Moonlight BCL to behave appropriately (both in browser
2511         and outside, e.g. smcs)
2512
2513 2009-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
2514
2515         * mono-config.c: ignore UTF-8 BOM and report parser errors.
2516         Fixes bug #549108.
2517
2518 2009-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2519
2520         * class.c: fix typo.
2521
2522 2009-10-22  Rodrigo Kumpera  <rkumpera@novell.com>
2523
2524         * class-internals.h: Change signature of mono_class_inflate_generic_type_with_mempool to take
2525         a MonoError parameter.
2526
2527         * class.h: Mark mono_class_inflate_generic_type deprecated, add new mono_class_inflate_generic_type_checked
2528         version that can does proper error handling.
2529
2530         * class.c (inflate_generic_type): Add a MonoError parameter. Don't assert on error, use new mono error machinery.
2531
2532         * class.c (mono_class_inflate_generic_type_with_mempool): Add new MonoError parameter.
2533
2534         * class.c, generics-sharing.c: Changes to handle mono_class_inflate_generic_type_with_mempool new signature.
2535
2536 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2537
2538         * debug-helpers.c (dis_one): Fix the disassembly of empty strings when
2539         NO_UNALIGNED_ACCESS is defined.
2540
2541 2009-10-22  Zoltan Varga  <vargaz@gmail.com>
2542
2543         * marshal.c (mono_string_builder_to_utf16): Applied patch from
2544         Hib Eris  <hib@hiberis.nl>. Return empty string for empty string builders.
2545         Fixes #549173.
2546
2547 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2548
2549         * sgen-gc.c: Shorten sections whenever possible.
2550
2551 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2552
2553         * sgen-gc.c: Use our portable semaphore #defines.
2554
2555 2009-10-22  Mark Probst  <mark.probst@gmail.com>
2556
2557         * sgen-gc.c: A debug option for dumping the heap layout to a file
2558         after each collection.
2559
2560 2009-10-21  Mark Probst  <mark.probst@gmail.com>
2561
2562         * sgen-gc.c: Make managed write barriers atomic via
2563         thread-restarts.
2564
2565 2009-10-21  Rodrigo Kumpera  <rkumpera@novell.com>
2566
2567         * verify.c (verify_delegate_compatibility): Properly verify delegate creation of static
2568         methods. Fixes #543021.
2569
2570 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2571
2572         * socket-io.[ch]: fix VS build.
2573
2574 2009-10-21 Gonzalo Paniagua Javier <gonzalo@novell.com>
2575
2576         * icall-def.h:
2577         * socket-io.[ch]: implemented SendFile.
2578
2579 2009-10-20  Zoltan Varga  <vargaz@gmail.com>
2580
2581         * class.c (mono_class_create_from_typedef): Initialize class->element_class
2582         before the interfaces to avoid crashes later if class initialization fails.
2583         Fixes #548417.
2584
2585         * marshal.c (emit_marshal_vtype): Implement byref marshalling of DateTime.
2586         Fixes #548276.
2587
2588 2009-10-20  Marek Safar  <marek.safar@gmail.com>
2589
2590         * domain.c: Bump 4.0 version.
2591
2592 2009-10-19  Sebastien Pouliot  <sebastien@ximian.com>
2593
2594         * assembly.c (mono_assembly_load_reference): Fix leak when 'status'
2595         code is known. (parse_public_key) Remove duplicate (unneeded) NULL
2596         check since 'pubkey' can't be NULL at this stage
2597         * icall.c (ves_icall_System_Array_FastCopy): Add comment about
2598         the check. (ves_icall_Type_GetInterfaceMapData) Remove duplicate
2599         initialization of 'iter'
2600
2601 2009-10-16  Bill Holmes  <billholmes54@gmail.com>
2602
2603         * cominterop.c : Search the interface parts of vtable to find 
2604           method matches.  Fixes 547030.
2605
2606         Code is contributed under MIT/X11 license.
2607
2608 2009-10-15 Gonzalo Paniagua Javier <gonzalo@novell.com>
2609
2610         * marshal.c: BeginInvoke cannot be called on multicast delegates with
2611         multiple targets. Fixes bug #574426.
2612
2613 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2614
2615         * profiler.h: Put here the definition of
2616         MONO_PROFILER_MAX_STAT_CALL_CHAIN_DEPTH
2617         (and fix the build...).
2618
2619 2009-10-14  Massimiliano Mantione  <massi@ximian.com>
2620
2621         * profiler.c, profiler.h, profiler-private.h:
2622         Added support for different ways of getting call chains in stat mode.
2623
2624 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2625
2626         * object.c, object-internals.h: New function for computing the
2627         size of an array, factored out of mono_array_new_full().  Use
2628         SGen's functions for allocating arrays and vectors.
2629
2630         * sgen-gc.c, gc-internal.h: Special functions for allocating
2631         arrays and vectors without race conditions.  A managed array
2632         allocator method.
2633
2634         * boehm-gc.c, null-gc.c: Don't provide a managed array allocator.
2635
2636 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2637
2638         * object.c, object.h, icall.c: Write barriers do the copying now,
2639         as well, so no need for an additional memcpy.
2640
2641         * sgen-gc.c: Lock when storing remsets.  Do the memory
2642         copying/moving in the write barriers.
2643
2644         * null-gc.c, boehm-gc.c: Write barriers must copy here, too.
2645
2646         * reflection.c: Added an assert.
2647
2648 2009-10-12  Mark Probst  <mark.probst@gmail.com>
2649
2650         * threads.c, process.c: A few missing write barriers.
2651
2652 2009-10-12  Joel W. Reed <joelwreed@gmail.com>
2653
2654         * mono-perfcounters.c, mono-perfcounters-def.h: Add
2655         network performance counters for bytes sent per second, bytes
2656         received per second, and bytes total per second.
2657
2658         Code is contributed under MIT/X11 license.
2659
2660 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2661
2662         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
2663         Fix warning.
2664
2665 2009-10-09  Mark Probst  <mark.probst@gmail.com>
2666
2667         * threads.c, object-internals.h, object.c: Move code for
2668         transferring an object to a different domain (via
2669         serialization/remoting) to object.c.
2670
2671         * object.c (call_unhandled_exception_delegate): If the exception
2672         is in a different domain than the delegate, transfer the exception
2673         to that domain.
2674
2675 2009-10-07  Zoltan Varga  <vargaz@gmail.com>
2676
2677         * marshal.c (emit_marshal_vtype): Emit marshalling of DateTime to OLE DATE.
2678         Fixes #322934.
2679
2680 2009-10-06  Zoltan Varga  <vargaz@gmail.com>
2681
2682         * domain.c (DEFAULT_RUNTIME_VERSION): Change this to v2.0.
2683
2684 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2685
2686         * object.c (mono_method_return_message_restore): Handle the case
2687         where the argument is an instance of a generic type.  Fixes
2688         #544446.
2689
2690 2009-10-06  Mark Probst  <mark.probst@gmail.com>
2691
2692         * object.c (set_value): Write barrier fix - we must pass the
2693         count, not the size.
2694
2695 2009-10-05  Zoltan Varga  <vargaz@gmail.com>
2696
2697         * domain.c (mono_init_internal): Print a useful error message when encountering
2698         an old mscorlib, instead of crashing. Fixes #544307.
2699
2700 2009-10-04  Zoltan Varga  <vargaz@gmail.com>
2701
2702         * appdomain.c (copy_app_domain_setup): Fix a warning.
2703
2704         * debug-helpers.c (dis_one): Ditto.
2705
2706 2009-10-04  Mark Probst  <mark.probst@gmail.com>
2707
2708         * domain-internals.h, appdomain.c: The AppDomainSetup is copied
2709         into the new domain, instead of referencing the original one.
2710
2711         * marshal.c, marshal.h: Make mono_marshal_xdomain_copy_value()
2712         non-static.
2713
2714         * appdomain.c: Corlib version bump.
2715
2716 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2717
2718         * threadpool.c: one more...
2719
2720 2009-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
2721
2722         * threadpool.c: forgot a LeaveCriticalSection when telling the idle
2723         threads to die because we're shutting down. delgate5.exe works again.
2724
2725 2009-10-01  Bill Holmes  <billholmes54@gmail.com>
2726
2727         * cominterop.c (mono_marshal_free_ccw_entry): Updating the
2728           ccw_interface_hash table when a ccw is finalized.
2729
2730         Code is contributed under MIT/X11 license.
2731
2732 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2733
2734         * assembly.c, domain.c, image.c, metadata-internals.h: Split
2735         domain and image unloading into two steps.  We must do this
2736         because clearing the domain in SGen requires the class metadata to
2737         be intact, but we need to free the mono_g_hash_tables in case a
2738         collection occurs during domain unloading and the roots would trip
2739         up the GC.
2740
2741 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2742
2743         * object-internals.h: Remove serialized culture fields from
2744         MonoInternalThread.
2745
2746         * icall-def.h, thread-types.h, threads.c: Remove serialized
2747         culture icalls.
2748
2749         * appdomain.c: Corlib version bump.
2750
2751 2009-09-30  Zoltan Varga  <vargaz@gmail.com>
2752
2753         * marshal.c (emit_marshal_object): Emit out marshalling of stringbuilders.
2754         Fixes #543133.
2755
2756 2009-09-30  Mark Probst  <mark.probst@gmail.com>
2757
2758         * sgen-gc.c: Try to shorten the new section after a major
2759         allocation to avoid ever-growing sections.
2760
2761 2009-10-13  Martin Baulig  <martin@ximian.com>
2762
2763         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
2764         `MONO_DEBUGGER_EVENT_TRAMPOLINE' into
2765         `MONO_DEBUGGER_EVENT_OLD_TRAMPOLINE' and added a new
2766         `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
2767
2768         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 4.
2769
2770 2009-09-29 Gonzalo Paniagua Javier <gonzalo@novell.com>
2771
2772         * threadpool.c: fixed the order in which 'completed' and the wait
2773         handle, if any, are set.  Fixes bug #542933 and delegate2.exe
2774         No need to use the wait_handle field of ASyncCall. Make sure the
2775         threadpool is active when adding a job or queueing an idle thread.
2776
2777 2009-09-29  Zoltan Varga  <vargaz@gmail.com>
2778
2779         * object.c (mono_unhandled_exception): Fix a crash if there is no main thread.
2780
2781         * threads.c (build_wait_tids): Fix a crash if there is no main thread, like
2782         when using --compile-all.
2783
2784 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2785
2786         * metadata.c (free_generic_class): Unregister the field_objects
2787         roots if we're using SGen.
2788
2789 2009-09-27  Mark Probst  <mark.probst@gmail.com>
2790
2791         * reflection.c (mono_dynamic_image_free): Deregister the GC root
2792         for GenericParamTableEntry.gparam.
2793
2794 2009-09-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
2795
2796         * marshal.c: don't create the handle when calling. It is created later
2797         if needed.
2798
2799 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2800
2801         * sgen-gc.c: Warning fixes.
2802
2803 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2804
2805         * sgen-gc.c: New debug option "xdomain-checks", which scans the
2806         whole heap for cross-domain references before each collection.
2807
2808         * sgen-scan-object.h: The scan action can now use SCAN to scan the
2809         object.
2810
2811         * threadpool-internals.h, threadpool.c: New function
2812         mono_thread_pool_is_queue_array() for checking whether a given
2813         array is used as a (cross-domain) queue by the thread pool code.
2814
2815 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2816
2817         * sgen-gc.c: New function mono_gc_scan_for_specific_ref() which
2818         searches the whole heap for objects containing a specific
2819         reference.  Only for debugging.
2820
2821 2009-09-26  Mark Probst  <mark.probst@gmail.com>
2822
2823         * appdomain.c (MONO_CORLIB_VERSION): Bumped.
2824
2825         * icall-def.h, threads.c, threads-types.h: New icalls for copying
2826         byte arrays between domains.
2827
2828 2009-09-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
2829
2830         * threadpool.c:
2831         * class-internals.h:
2832         * mono-perfcounters-def.h:
2833         * mono-perfcounters.c:
2834         -There is a list of idle threads
2835         -Each of those idle threads wait on their own WaitHandle instead
2836         of all of them using the same semaphore. When a new work item is
2837         added, the job is assigned directly to an idle thread or a newly
2838         created one if possible and then the handle for that thread is
2839         signaled. Compare that to the current approach where all the
2840         threads in the pool compete to dequeue a job from the same
2841         queue.
2842         -New struct ThreadPool that brings together the bunch of static
2843         variable for each threadpool (IO and regular).
2844         -New performance counters: # of items added and its rate per
2845         threadpool. The rate will be used later, perhaps together with
2846         other perf. counters, to decide when idle threads should exit.
2847
2848 2009-09-25  Jonathan Chambers  <joncham@gmail.com>
2849
2850         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal): 
2851         Fix typo on Windows build.      
2852         (ves_icall_System_Net_Sockets_Socket_Accept_internal): Fix typo on Windows build.
2853         
2854         Code is contributed under MIT/X11 license.
2855
2856 2009-09-25  Mark Probst  <mark.probst@gmail.com>
2857
2858         * object-internals.h: The Thread class is split up into Thread and
2859         InternalThread now.  We have exactly one InternalThread per
2860         thread, and at most one Thread per appdomain per thread.  Most
2861         data is stored in InternalThread.  All InternalThread objects live
2862         in the root domain.
2863
2864         * class-internals.h: Add internal_thread_class to MonoDefaults.
2865
2866         * appdomain.c (mono_domain_unload), attach.c (receiver_thread),
2867         domain.c, gc.c, icall-def.h, monitor.c, object.c, sgen-gc.c,
2868         socket-io.c, threadpool.c, thread-types.h, threads.c: Changes
2869         resulting from the split of the Thread class.
2870
2871         * gc-internal.h: Prototype for new function for checking whether a
2872         thread is the finalizer thread.
2873
2874         * appdomain.c: Corlib version bump.
2875
2876 2009-09-25  Rolf Bjarne Kvinge  <RKvinge@novell.com>
2877
2878         * appdomain.c|h: Add a mono_domain_try_unload method which is
2879         equivalent to mono_domain_unload, except that it returns an exception
2880         instead of throwing it. Make mono_domain_unload use the
2881         mono_domain_try_unload method to avoid code-duplication.
2882
2883 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
2884
2885         * debug-helpers.c (dis_one): Avoid unaligned accesses on platforms where that is
2886         a problem.
2887
2888 2009-09-24  Zoltan Varga  <vargaz@gmail.com>
2889
2890         * marshal.c (emit_ptr_to_object_conv): Generate an exception instead of
2891         aborting when a conversion is not implemented.
2892
2893 2009-09-23  Miguel de Icaza  <miguel@novell.com>
2894
2895         * verify.c: when comparing culture strings, use g_ascii_strcmp
2896
2897         * assembly.c (mono_public_tokens_are_equal): Change g_strcasecmp
2898         when comparing public key tokens to use memcmp on 16 bytes.   I do
2899         not believe this ever worked as advertised in the past.
2900
2901         The standard Public Key is 00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00
2902         which would have always failed earlier.
2903
2904 2009-06-25  Miguel de Icaza  <miguel@novell.com>
2905
2906         * gc.c: Raise a NullArgumentException if the object passed is
2907         null.
2908
2909 2009-09-22  Zoltan Varga  <vargaz@gmail.com>
2910
2911         * image.c (mono_image_close): Atomically decrement the reference count and
2912         remove the image from the hash tables, to prevent another thread from seeing a
2913         dying MonoImage. Fixes #541194.
2914
2915 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2916
2917         * threadpool.c: actually use the minimum number of 'completion ports'
2918         (for us is just a potential worker thread).
2919
2920 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2921
2922         * threadpool.c: remove ares_htable. It does not make sense any more
2923         since the same objects are now stored in GC-tracked arrays while they are
2924         in the queue.
2925
2926 2009-09-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
2927
2928         * threadpool.c: increase the minimum length of the queues to 128.
2929         Remove warning.
2930
2931 2009-09-21  Zoltan Varga  <vargaz@gmail.com>
2932
2933         * marshal.c (mono_marshal_get_string_ctor_signature): New internal function to
2934         return the modified signature used by string ctors.
2935
2936 2009-09-20  Zoltan Varga  <vargaz@gmail.com>
2937
2938         * marshal.c (mono_marshal_get_runtime_invoke_dynamic): New internal function
2939         to return a runtime-invoke wrapper which uses DYN_CALL to call the wrapped
2940         method, to be used by full-aot.
2941
2942 2009-09-18  Rodrigo Kumpera  <rkumpera@novell.com>
2943
2944         Since the runtime supports lazy initialization of a type's vtable and this can cause a type
2945         to fail, we need to ensure that the vtable is properly initialized at spots were the type must
2946         be known to be good.
2947
2948         * class.c (mono_class_init): Fail array types if their element type fails initialization
2949         as well.
2950
2951         * object.c (mono_class_create_runtime_vtable): Fail array types if their element type fails
2952         initialization, additionally we request the element_type vtable to be initialized as well.
2953
2954         This is fine and should not increase the working set in any meaningful way since it's reasonable
2955         to assume       that most code will create an array and eventually populate it, which will require the
2956         type's vtable to be initialized.
2957
2958         * loader.c (field_from_memberref): Add a comment for a possibly useless mono_class_init call.
2959
2960 2009-09-17  Atsushi Enomoto  <atsushi@ximian.com>
2961
2962         * normalization-tables.h : regenerated.
2963
2964 2009-09-16  Zoltan Varga  <vargaz@gmail.com>
2965
2966         * mono-debug.c (mono_debug_add_method): Increase the size of the buffer,
2967         a leb128 encoding can take up to 5 bytes.
2968
2969 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
2970
2971         * class.c (verify_class_overrides): Remove useless argument.
2972
2973         * class.c (mono_class_setup_vtable_general): Move the overrides check to happen
2974         before interface enumeration as this is no longer required.
2975
2976 2009-09-15  Rodrigo Kumpera  <rkumpera@novell.com>
2977
2978         * class.c: New function mono_class_is_assignable_from_slow that is safe to be
2979         used under mono_class_init context. This functions avoid any code path that
2980         calls mono_class_init, which leads it to be slow as some things like the interface
2981         bitmap are not available.
2982
2983         * class.c (verify_class_overrides): Use mono_class_is_assignable_from_slow instead
2984         of it's own broken version. Fixes the verifier part of #538588.
2985
2986         * class-internals.h: Export mono_class_is_assignable_from_slow as part of the internal
2987         API.
2988
2989 2009-09-15  Mark Probst  <mark.probst@gmail.com>
2990
2991         * class.c (mono_class_init): Always set an exception in a class if
2992         vtable setup fails.  Fixes #538577.
2993
2994         * generic-sharing.c: Raise an exception if mono_class_vtable()
2995         returns NULL.
2996
2997 2009-09-13  Zoltan Varga  <vargaz@gmail.com>
2998
2999         * marshal.c (mono_marshal_get_runtime_invoke): Don't share instance 
3000         methods of vtypes, as they could be incorrectly shared with static methods
3001         taking an IntPtr argument.
3002
3003 2009-09-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
3004
3005         * domain.c:
3006         * object.c:
3007         * class-internals.h: renamed waithandle_class to
3008         manualresetevent_class.
3009         * marshal.c: propagate the exception if a remoting BeginInvoke call
3010         fails.
3011
3012 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3013
3014         * object.c: Properly handle vtable failures.
3015
3016 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3017
3018         * socket-io.c: Assert on vtable failure.
3019
3020         * mono-mlist.c: Assert on vtable failure.
3021
3022 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3023
3024         * marshal.c: Assert on vtable failure.
3025
3026 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3027
3028         * icall.c: Properly handle vtable failures.
3029
3030 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3031
3032         * debug-helpers.c (mono_class_describe_statics): Properly handle vtable failures.
3033
3034 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3035
3036         * cominterop.c (ves_icall_System_ComObject_CreateRCW): Property handle vtable failures.
3037
3038         * console-unix.c (do_console_cancel_event): Same.
3039
3040 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3041
3042         * class-internals.h: Add mono_class_vtable_full function that allows control
3043         if an exception should be raised or not.
3044
3045         * object.c (mono_class_vtable): Call into mono_class_vtable_full. Fix this function
3046         to do what its documentation say, that is to return NULL and set exception_type on
3047         failure.
3048
3049         * object.c (mono_class_create_runtime_vtable): Add new raise_on_error parameter
3050         and change the code to honor it.
3051
3052 2009-09-11  Rodrigo Kumpera  <rkumpera@novell.com>
3053
3054         * verify.c: Fix typo in error message.
3055
3056 2009-09-10  Sebastien Pouliot  <sebastien@ximian.com>
3057
3058         * security-core-clr.c: Fix default_platform_check so it can run
3059         the runtime coreclr tests (without an infinite recursion when
3060         throwing an exception).
3061
3062 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3063
3064         object.c (mono_delegate_ctor_with_method): Guard against null method.
3065
3066 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3067
3068         * marshal.c (mono_marshal_get_xappdomain_dispatch): Add an assert
3069         that should be replaced with error handling later.
3070
3071 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3072
3073         * marshal.c (mono_delegate_end_invoke): Fix warning.
3074
3075 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3076
3077         * loader.c (mono_field_from_token): Properly handle invalid
3078         dynamic tokens.
3079
3080 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3081
3082         * pedump.c (verify_image_file): Skip types that can't be
3083         decoded.
3084
3085 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3086
3087         * verify.c: Look for recursive valuetypes only against the
3088         type been initialized as this is a lot simpler and works.
3089
3090 2009-09-10  Rodrigo Kumpera  <rkumpera@novell.com>
3091
3092         * verify.c: Ensure that fields are properly loaded before
3093         checking them.
3094
3095 2009-09-10  Bill Holmes  <billholmes54@gmail.com>
3096
3097         * object.c (mono_object_get_virtual_method) : Call 
3098           mono_cominterop_get_invoke if the object is a COM object.
3099
3100         Code is contributed under MIT/X11 license.
3101
3102 2009-09-09  Rodrigo Kumpera  <rkumpera@novell.com>
3103
3104         * verify.c: Check for recursive valuetype definitions.
3105
3106 2009-09-08  Rodrigo Kumpera  <rkumpera@novell.com>
3107
3108         Use inheritance-aware interface offsets. Inherited types use the same offsets
3109         of their parents. This reduce offset duplication in case more than one type in
3110         the inheritance tree explicitly implements the same interface.
3111
3112         This also removes a source of vtable bubbles found in #532409. An abstract type
3113         isn't required to provide abstract methods to all interfaces it implements, which
3114         resulted in a bubble with the previous scheme as the child would get a non-full
3115         vtable from its parent. We fail all concrete types with vtable bubbles, so this
3116         should be fixed.
3117
3118         This change causes an increase of 1.7% in vtable memory usage for IronPython pystone but
3119         it's expected to not cause any significant increase beyond that.
3120
3121         * class.c (setup_interface_offsets): Compute super class iface offsets
3122         first to force sharing.
3123
3124         * class.c: Add VTABLE_SELECTOR macro to the vtable debug macros to help
3125         dumping only the relevant ones.
3126
3127         * class.c (mono_class_setup_vtable_general): Give newslot, non final, virtual
3128         methods a new slot regardless if they belong to an interface or not. This allows
3129         an inherited type to override the iface method separately from the class one.
3130
3131 2009-09-04 Gonzalo Paniagua Javier <gonzalo@novell.com>
3132
3133         * threadpool.c: make the Sleep() alertable to prevent delays exiting
3134         applications that take less than 2s to execute.
3135         Bug #524984 fixed.
3136
3137 2009-09-04  Zoltan Varga  <vargaz@gmail.com>
3138
3139         * object-internals.h (MonoRuntimeCallbacks): Add a 'get_runtime_build_info' callback.
3140
3141         * object.c (mono_get_runtime_callbacks): New helper function to return
3142         the runtime callbacks.
3143
3144         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Use the result of
3145         mono_get_runtime_build_info () as the display name.
3146         
3147 2009-09-03  Zoltan Varga  <vargaz@gmail.com>
3148
3149         * marshal.c (emit_marshal_array): Call conv.ovf.i on the array parameter
3150         argument, since NEWARR expects a native int. Fixes #481559.
3151
3152 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3153
3154         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Guard
3155         against broken SRE methods.
3156
3157 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3158
3159         * class.c (mono_type_get_full): Don't call mono_metadata_free_type on
3160         a NULL variable. Abort early on failure.
3161
3162 2009-09-03  Rodrigo Kumpera  <rkumpera@novell.com>
3163
3164         * class.c (can_access_type): Fail visibility test for non nested
3165         types with nested visibility.
3166
3167 2009-09-02  Sebastien Pouliot  <sebastien@ximian.com>
3168
3169         * assembly.c (parse_public_key): Avoid allocating (and not 
3170         freeing) the public key array when it's not requested by the 
3171         caller.
3172         * threads.c (mono_thread_manage, mono_thread_create_internal, 
3173         ves_icall_System_Threading_Thread_Thread_internal): Free 
3174         allocated memory on error.
3175
3176 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3177
3178         * icall.c, icall-def.h: Remove some dead code from early SRE changes.
3179
3180 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3181
3182         * class.c (mono_class_setup_fields): Remove duplicated local variable
3183         named gklass.
3184         Rename gklass to gtd to reflect the fact that it points to the generic
3185         type definition.
3186         Remove the duplicated call to mono_class_setup_fields on gtd and move
3187         the error check to the beginning.
3188
3189 2009-09-02  Rodrigo Kumpera  <rkumpera@novell.com>
3190
3191         * marshal.c (mono_array_to_lparray): Do DISABLE_COM properly.
3192         Remove cruft of the previous patch.
3193
3194 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3195
3196         * metadata-verify.c (verify_method_table): Check for abstract + final.
3197         Fixes #534175.
3198
3199 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3200
3201         * verify.c (verify_class_fields): Check for duplicate fields.
3202
3203 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3204
3205         * metadata-verify.c: Verify the typeref table for duplicates.
3206
3207 2009-09-01  Rodrigo Kumpera  <rkumpera@novell.com>
3208
3209         This reverts r140936 and properly handles interfaces with static methods. The
3210         right fix is to ensure vtables without bubles which is an easier to verify
3211         constraint. We should avoid such special cases as of the reverted patch as those
3212         only make the runtime more brittle.
3213
3214         * class.c (mono_class_setup_vtable_general): Revert previous change that handle
3215         static methods on interfaces.
3216
3217         * class.c (setup_interface_offsets): Use the number of virtual methods when
3218         calculating interface offsets instead of the number of methods. This way we
3219         avoid bubles on the layout.
3220
3221 2009-08-31  Rodrigo Kumpera  <rkumpera@novell.com>
3222
3223         * metadata-verify.c (verify_metadata_header): Some very smart
3224         obfuscators like to add extra stream headers. Ignore them.
3225
3226 2009-08-30  Zoltan Varga  <vargaz@gmail.com>
3227
3228         * class.c (mono_class_setup_vtable_general): Verify interfaces with static
3229         methods correctly.
3230
3231 2009-08-29  Rodrigo Kumpera  <rkumpera@novell.com>
3232
3233         * metadata-verify.c: Verify for duplicated types.
3234
3235 2009-08-28  Rodrigo Kumpera  <rkumpera@novell.com>
3236
3237         * metadata-verify.c (verify_typedef_table): Verify for nested types
3238         without an entry on the nested class table.
3239
3240 2009-08-28  Zoltan Varga  <vargaz@gmail.com>
3241
3242         * cominterop.c (cominterop_get_ccw): Applied patch from tom hindle
3243         <tom_hindle@sil.org>. Add locking around hash table accesses.
3244
3245 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3246
3247         * verify.c (mono_verifier_verify_class): Verify all interface if
3248         really are interfaces. Fixes #534184.
3249
3250 2009-08-27  Rodrigo Kumpera  <rkumpera@novell.com>
3251
3252         * pedump.c: Initialize all types during metadata validation so we report
3253         errors only detected as part of class initialization.
3254
3255 2009-08-26  Rodrigo Kumpera  <rkumpera@novell.com>
3256
3257         * metadata-verify.c (verify_method_table): PInvoke requires method to
3258         be static. Fixes #534189
3259
3260 2009-08-26  Zoltan Varga  <vargaz@gmail.com>
3261
3262         * threads.c (mono_thread_suspend_all_other_threads): Handle 'threads_starting_ip'
3263         being NULL.
3264
3265 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3266
3267         * class.c (mono_class_setup_vtable_general): Verify the resulting vtable
3268         for holes or bad methods. Fixes #525314.
3269
3270 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3271
3272         * class.c (setup_interface_offsets): Don't allocate slot
3273         for the same interface multiple times. This creates bubbles
3274         that waster space and make vtable verification harder.
3275
3276         The same interface get a slot multiple times since we need
3277         to get the closure of all implemented interfaces, which means
3278         the same interface is reported multiple times.
3279
3280 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3281
3282         * verify.c (mono_verifier_verify_class): Don't check the fields
3283         of generic instances since the context on which they got expanded
3284         might lead to false positives.
3285
3286         Such thing happens when a generic type is inflated in the context
3287         of a generic method and the inflated type of a field turns into a
3288         generic method argument, which causes the checking code to think
3289         it's an invalid class when it's not.
3290
3291 2009-08-25  Rodrigo Kumpera  <rkumpera@novell.com>
3292
3293         * verify.c (mono_type_is_valid_in_context): Verify if type
3294         is NULL and remove duplicate test.
3295
3296 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3297
3298         * verify.c (mono_verifier_verify_class): Check fields for
3299         invalid generic arguments.
3300
3301 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3302
3303         * class.c (verify_class_overrides): Verify if for static
3304         and non virtual methods.
3305
3306 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3307
3308         * icaa.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor):
3309         Check for errors after retrieving the vtable.
3310
3311 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3312
3313         * class.c (mono_class_setup_vtable_general): Verify
3314         if method overrides are valid before processing them.
3315
3316 2009-08-24  Rodrigo Kumpera  <rkumpera@novell.com>
3317
3318         * marshal.c (mono_array_to_lparray): Fix minimal build with
3319         cominterop disabled.
3320
3321         * marshal.c (mono_free_lparray): Same.
3322
3323 2009-08-21  Mark Probst  <mark.probst@gmail.com>
3324
3325         * threadpool.c (mono_thread_pool_init): Use mono_object_hash() as
3326         the hash function for the ares_htable.
3327
3328 2009-08-20  Rodrigo Kumpera  <rkumpera@novell.com>
3329
3330         * metadata-verify.c (verify_assembly_table): Accept 0x10 as a valid
3331         bit for assembly flags. MS is ok with it but there is no spec anywhere
3332         on its mean
3333
3334 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3335
3336         * class.c (mono_class_create_from_typedef): Emit profiler events
3337         in all cases.
3338
3339 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3340
3341         * icall.c (ves_icall_Type_GetMethodsByName): Don't leak loader errors.
3342         Release memory on failure.
3343
3344 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3345
3346         * class-internals.h: Add mono_metadata_load_generic_param_constraints_full
3347         to the internal API.
3348
3349         * metadata.c (get_constraints): Use a single-linked table as we don't
3350         traverse it backward. Fail and return FALSE if only of the contraint types
3351         is not found.
3352
3353         * metadata.c (mono_metadata_load_generic_param_constraints_full): Identical
3354         to mono_metadata_load_generic_param_constraints except for having a return value.
3355         This has to be done since the later is part of the public API.
3356
3357         * class.c (mono_class_create_from_typedef): Properly check the loading of constrains
3358         and fail the type.
3359
3360         * loader.c (mono_get_method_from_token): Properly check the loading of constraints
3361         and fail the method.
3362
3363 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3364
3365         * metadata-verify.c (is_valid_method_header): Add work-around to deal
3366         with MS broken behavior of emmitting EH section sizes without the
3367         header size added.
3368
3369 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3370
3371         * metadata.c (mono_type_create_from_typespec): Don't allocate image
3372         memory until we're sure that we'll need it. This avoids leaking for
3373         broken types or duplicated instantiation.
3374
3375 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3376
3377         * metadata-verify.c (is_valid_method_header): Fix stupid formating
3378         mistake.
3379
3380 2009-08-19  Rodrigo Kumpera  <rkumpera@novell.com>
3381
3382         * metadata-verify.c (is_valid_method_header): Fix number of clauses
3383         and expected size calculation.
3384
3385 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3386
3387         * class.c (mono_class_get_field_idx): Add fixme for broken
3388         behavior for types with multiple fields with the same name.
3389         I would rather fix it, but have no idea on how to generate
3390         such artifact for testing.
3391
3392 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3393
3394         * verify.c (verifier_load_field): We should allow references to
3395         fields to be made using the generic type definition. It's up to
3396         the loader system to fail invalid ops.
3397
3398         * verify.c (get_boxable_mono_type): Only uninstantiated GTDs
3399         are invalid.
3400
3401 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3402
3403         * class.c: Fix usage of mono_metadata_interfaces_from_typedef_full.
3404
3405         * metadata-internals.h: Fix declaration of 
3406         mono_metadata_interfaces_from_typedef_full.
3407
3408         * metadata.c (mono_metadata_interfaces_from_typedef_full): Add extra
3409         heap_alloc_result parameter that controls if the result should be
3410         g_malloc'd.
3411
3412         * metadata.c (mono_metadata_interfaces_from_typedef): Let the resulting
3413         array be g_malloc'd and properly document this public API function.
3414
3415 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3416
3417         * cil-coff.h: Fix METHOD_HEADER_FORMAT_MASK to be 2 bits and
3418         remove METHOD_HEADER_TINY_FORMAT1.
3419
3420         * reflection.c: Remove reference to METHOD_HEADER_TINY_FORMAT1.
3421
3422         * metadata.c (mono_metadata_parse_mh_full): Kill tiny format1.
3423
3424         Both spec and MS uses only 2 bits to enumerate the kind of header.
3425         So given that 0x6 and 0x2 are equal under a 2 bits mask, tiny format1
3426         is superfluous, only used for tiny headers with odd code lengths.
3427
3428         This change also make sure that mono doesn't wronly interpret bit 2
3429         of fat header flags, which is currently reserved.
3430
3431 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3432
3433         * metadata.c (do_mono_metadata_parse_type): Do error
3434         checking for element types. Don't abort if presented
3435         with a broken type kind.
3436
3437 2009-08-18  Rodrigo Kumpera  <rkumpera@novell.com>
3438
3439         * metadata.c (mono_metadata_parse_method_signature_full):
3440         Gracefully fail bad vararg signatures.
3441
3442 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3443
3444         * profiler.c:
3445         * class.c: Fix warnings for uninitialized variables.
3446
3447 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3448
3449         * icall.c: Fix _NSGetEnviron method declaration warning.
3450
3451 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3452
3453         * icall.c:
3454         * reflection.c: Make bitwise checks explicit.
3455
3456 2009-08-18  Christian Hergert  <chris@dronelabs.com>
3457
3458         * debug-helpers.c:
3459         * marshal.c: Fix printf warnings.
3460
3461 2009-08-18  Zoltan Varga  <vargaz@gmail.com>
3462
3463         * reflection.c (encode_cattr_value): Fix a warning.
3464
3465 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3466
3467         * metadata.c (mono_metadata_parse_array_full): Fix memory leak
3468         of array bounds.
3469
3470 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3471
3472         * loader.c (mono_method_signature): Don't assert on broken
3473         signature. Print a more useful error message.
3474
3475 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3476
3477         * loader.c (mono_method_get_marshal_info): Assert if
3478         signature is invalid. Bounds check stores to the
3479         mspecs array;
3480
3481 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3482
3483         * loader.c (field_from_memberref): Fix warning.
3484
3485 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3486
3487         * loader.c (mono_method_get_param_names): Check if signature
3488         is null. Don't store beyond the size of the name array.
3489
3490 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3491
3492         * loader.c (mono_get_method_constrained): Check if signature
3493         is null.
3494
3495 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3496
3497         * loader.c (mono_loader_set_error_bad_image): Improve
3498         error messages.
3499
3500 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3501
3502         * loader.c (mono_get_method_full): Convert an assertion
3503         into a loader error.
3504
3505 2009-08-17  Rodrigo Kumpera  <rkumpera@novell.com>
3506
3507         * class-internals.h, class.c: Better naming and documentation.
3508
3509 2009-08-17  Zoltan Varga  <vargaz@gmail.com>
3510
3511         * boehm-gc.c (mono_gc_add_weak_track_handle): Don't do any work if
3512         obj is NULL.
3513
3514 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3515
3516         * loader.c (mono_method_get_signature_full): Fail gracefully if signature
3517         parsing fails.
3518
3519 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3520
3521         * loader.c (mono_loader_error_prepare_exception): Handle missing field
3522         errors with no class set.
3523
3524         * loader.c (field_from_memberref): If the field signature is of the wrong
3525         type fail with a MissingFieldException instead of a BadImageException as
3526         this is the behavior observed on MS. 
3527
3528 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3529
3530         * loader.c (field_from_memberref): Don't crash if either the field
3531         signature or the typespec class are invalid.
3532
3533 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3534
3535         * verify.c (verifier_load_field): Don't allow field related
3536         ops to reference fields on generic type definition.
3537
3538 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3539
3540         * metadata-verify.c: Add new warning level for errors specified
3541         by ECMA 335 but that MS ignores.
3542
3543         * metadata-verify.c (verify_method_table): Make compiler controled
3544         visibility + (rt)specialname error a warning as MS ignores this. Ignoring
3545         this check is safe because the end result will only be some visibility
3546         exceptions been thrown.
3547
3548 2009-08-14  Rodrigo Kumpera  <rkumpera@novell.com>
3549
3550         * verify.c (get_boxable_mono_type): Don't allow the
3551         use of the generic type definition on boxed type positions.
3552
3553         Fixes #531237.
3554
3555 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3556
3557         * threadpool.c: Make sure no cross-domain references remain in
3558         ares_htable or the arrays that are thrown away when resizing.
3559
3560 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3561
3562         * appdomain.c, metadata-internals.h, image.c: In MonoImage add a
3563         list of classes for which we have to unregister reflection_info
3564         with the GC and which are not in the namespace cache.
3565
3566         * reflection.c (mono_reflection_initialize_generic_parameter): Add
3567         the class to the list.
3568
3569 2009-08-14  Mark Probst  <mark.probst@gmail.com>
3570
3571         * domain.c (mono_domain_free): Unregister the GC roots in
3572         MonoDomain.
3573
3574 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3575
3576         * reflection.c (mono_reflection_type_get_handle): Fix typo.
3577
3578 2009-08-12  Rodrigo Kumpera  <rkumpera@novell.com>
3579
3580         * class.c: Add mono_class_get_field_from_name_full which does
3581         the same as mono_class_get_field_from_name but does check field
3582         signature as well.
3583
3584         * class-internals.h: Export mono_class_get_field_from_name_full as
3585         part of the internal API.
3586
3587         * loader.c (field_from_memberref): Search fields by name and signature
3588         as it's valid to have two fields with same name but different types.
3589
3590         Fixes #528055.
3591
3592 2009-08-10  Rodrigo Kumpera  <rkumpera@novell.com>
3593
3594         * icall-def.h: Add a bunch of temporary icalls to MonoGenericClass.
3595
3596         * reflection.c (mono_reflection_type_get_handle): Handle MonoGenericClass.
3597
3598         * reflection.c (encode_cattr_value): Use mono_reflection_type_get_handle to encode
3599         System.Type.
3600
3601 2009-08-13  Zoltan Varga  <vargaz@gmail.com>
3602
3603         * gc.c (GCHandle_CheckCurrentDomain): Moved this here from icall.c.
3604
3605         * boehm-gc.c (mono_gc_add_weak_track_handle): Handle nulls.
3606
3607 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3608
3609         * sgen-gc.c, sgen-scan-object.h: Object scanning code factored out
3610         to sgen-scan-object.h, which can be included and parameterized via
3611         macros.
3612
3613         * Makefile.am: sgen-scan-object.h added.
3614
3615 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3616
3617         * gc.c: #define GC_dont_gc if we're compiling with SGen.
3618
3619 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3620
3621         * domain.c (mono_domain_free): Free a domain's mono_g_hash_tables
3622         before clearing a domain in the GC.
3623
3624 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3625
3626         * exception.c (mono_exception_from_name_domain): Actually create
3627         the exception in the specified domain.
3628
3629         * appdomain.c (mono_domain_create_appdomain_internal): Create the
3630         OutOfMemoryException a bit later so that the domain is inialized
3631         "enough" that it works.
3632
3633 2009-08-12  Mark Probst  <mark.probst@gmail.com>
3634
3635         * threads.c (thread_cleanup): Clean up the cached_culture_info
3636         array to prevent cross-domain references.
3637
3638 Tue Aug 11 14:38:57 CEST 2009 Paolo Molaro <lupus@ximian.com>
3639
3640         * metadata.c: more documentation for MonoType accessors.
3641
3642 2009-08-11  Raja R Harinath  <harinath@hurrynot.org>
3643
3644         Fix incorrect size definitions where the tail array isn't a list
3645         of pointers
3646         * class-internals.h (MONO_SIZEOF_MARSHAL_TYPE): Use offsetof to
3647         define size.
3648         * domain-internals.h (MONO_SIZEOF_JIT_INFO): Likewise.
3649         * metadata.h (MONO_SIZEOF_TYPE): Likewise.
3650         * reflection.h (MONO_SIZEOF_CUSTOM_ATTR_INFO): Likewise.
3651
3652 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3653
3654         * reflection.h:
3655         * reflection.c: MONO_SIZEOF_CUSTOM_ATTR_INFO.
3656
3657 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3658
3659         * metadata.c:
3660         * loader.c:
3661         * metadata-internals.h:
3662         * method-builder.c:
3663         * reflection.c: use MONO_SIZEOF_METHOD_HEADER.
3664
3665 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3666
3667         * cominterop.c:
3668         * metadata.c:
3669         * metadata.h:
3670         * loader.c:
3671         * marshal.c:
3672         * reflection.c: #define for sizeof in MonoType and
3673         MonoMethodSignature.
3674
3675 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3676
3677         * domain.c:
3678         * domain-internals.h: add and use #define's instead of sizeof()
3679         for MonoJitInfo and MonoJitInfoTable.
3680
3681 2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
3682
3683         * object.c:
3684         * class.h: use #define instead of sizeof() for MonoRemoteClass.
3685
3686 2009-08-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
3687
3688         * metadata.c:
3689         * metadata.h:
3690         * object.c:
3691         * class-internals.h:
3692         * generic-sharing.c:
3693         * marshal.c: use a #define instead of sizeof() for a few
3694         structures that use a zero-length array.
3695
3696 2009-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
3697
3698         * object-internals.h (MonoReflectionMethodOnTypeBuilderInst): Add new fields
3699         to handle inflated generic methods.
3700
3701         * appdomain.c: Bump corlib version.
3702
3703         * reflection.c (mono_image_get_method_on_inst_token): Handle generic method
3704         instances.
3705
3706         * reflection.c (fixup_method): Same
3707
3708         * reflection.c (resolve_object): Same.
3709
3710         * reflection.c (inflate_method): Replace a g_assert_not_reached with a
3711         g_error and a decent message.
3712
3713 2009-08-06  Massimiliano Mantione  <massi@ximian.com>
3714
3715         * bohem-gc.c (mono_gc_add_weak_track_handle): Get the domain
3716         from the object because it could not yet be available globally
3717         (it happens if the profiler tries to create a gchandle on the
3718         MonoThread object of a thread that is still registering itself
3719         with the runtime).
3720
3721 2009-08-04  Rodrigo Kumpera  <rkumpera@novell.com>
3722
3723         * reflection.c (mono_generic_class_get_object): Initialized the
3724         managed type arguments array.
3725
3726         * object-internals.h (MonoReflectionGenericClass): Add type_arguments field.
3727
3728         * appdomain.c: Bump corlib version.
3729
3730 2009-08-04  Zoltan Varga  <vargaz@gmail.com>
3731
3732         * threads.c (thread_cleanup): Free serialized_ui_culture_info. Fixes
3733         #527902.
3734
3735 2009-08-03  Zoltan Varga  <vargaz@gmail.com>
3736
3737         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3738         Avoid a crash if synch_cs is not set.
3739         
3740         * threads.c (ves_icall_System_Threading_Thread_Thread_free_internal): 
3741         Handle the case when the handle is 0.
3742
3743         * appdomain.c: Bump corlib version.
3744
3745 2009-08-02  Zoltan Varga  <vargaz@gmail.com>
3746
3747         * reflection.c (mono_type_get_object): Fix a warning.
3748
3749 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3750
3751         * sgen-gc.c (mono_gc_wbarrier_value_copy): Don't compute the GC
3752         descriptor here.  We assume it's already been computed.
3753
3754         * generic-sharing.c (instantiate_other_info): Compute the GC
3755         descriptor for info type MONO_RGCTX_INFO_KLASS.
3756
3757 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3758
3759         * reflection.c (mono_type_get_object): MonoDomain is an unmanaged
3760         type, so don't use MONO_OBJECT_SETREF to set a field.
3761
3762 2009-08-01  Mark Probst  <mark.probst@gmail.com>
3763
3764         * gc.c: We were missing one case where invoking a finalizer would
3765         not reset the domain.  Also, in the finalizer thread loop, assert
3766         that we're in the root domain.
3767
3768 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3769
3770         * icall.c (ves_icall_MonoType_GetArrayRank): Throw ArgumentException
3771         if the type is not an array.
3772
3773 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3774
3775         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Return the
3776         method bound to the declaring type of the method. Raise an exception
3777         if the type is not a generic param.
3778
3779 2009-07-31  Rodrigo Kumpera  <rkumpera@novell.com>
3780
3781         * class.c (print_unimplemented_interface_method_info): Print the
3782         full type name.
3783
3784         * class.c (mono_class_setup_vtable_general): When dealing with a
3785         generic instance first check if the generic type definition is
3786         not broken.
3787
3788 2009-02-11 Tom Hindke <tom_hindle@sil.org>
3789
3790         * marshal.c (mono_array_to_lparray): Implemented so managed object types are converted to native types.
3791
3792         * marshal.c: Added new method mono_free_lparray to free memory allocated by mono_array_to_lparray
3793
3794         * marshal.c (emit_marshal_array): call emit mono_free_lparray where approprate.
3795
3796         * marshal.c (conv_to_icall): added MONO_MARSHAL_FREE_LPARRAY case
3797
3798         * metadata.h (MonoMarshalConv enum): added MONO_MARSHAL_FREE_LPARRAY
3799
3800         Code is contributed under MIT/X11 license
3801
3802 2009-08-30  Rodrigo Kumpera  <rkumpera@novell.com>
3803
3804         * verify.c: Fix naming of stelem and ldelem.
3805
3806 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3807
3808         * generic-sharing.c: Replace the templates lock with the loader
3809         lock because of very hard to resolve deadlock issues.
3810
3811 2009-07-30  Zoltan Varga  <vargaz@gmail.com>
3812
3813         * icall.c (ves_icall_Type_GetMethodsByName): Use 
3814         mono_class_get_vtable_size () instead of accessing klass->vtable_size
3815         directly. Fixes #525338.
3816
3817         * class.c (mono_class_get_vtable_size): New helper function.
3818
3819         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle_type): Fix the second argument, its a MonoType* not a MonoClass*. Check whenever
3820         the field belongs to the type. Fixes #525733.
3821
3822 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3823
3824         * sgen-gc.c: When we stop a thread and its stack top is not within
3825         its allocated stack (because it's in an altstack signal handler),
3826         restart it and stop it again, until it is.
3827
3828 2009-07-30  Mark Probst  <mark.probst@gmail.com>
3829
3830         * sgen-gc.c: Take a thread's stack top and registers from the
3831         sigcontext in the suspend signal handler.
3832
3833         * sgen-gc.h, sgen-archdep.h, Makefile.am: Move arch-dependent
3834         stuff to sgen-archdep.h.
3835
3836         * gc.c, gc-internal.h: Remove the get_ip_from_sigctx installer and
3837         caller, because have code in sgen-archdep.h to acquire that data.
3838
3839 2009-07-29  Massimiliano Mantione  <massi@ximian.com>
3840
3841         * profiler.c, profiler.h, profiler-private.h:
3842         Added support for keeping track of code chunks and buffers.
3843
3844 2009-07-29 Rodrigo Kumpera  <rkumpera@novell.com>
3845
3846         * metadata-verify.c: Fix endianness problems on decoding functions.
3847         Based on a patch by Ulrich Weigand <uweigand@de.ibm.com>
3848
3849 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3850
3851         * icall.c (ves_icall_Type_make_array_type): Handle the new encoding
3852         schema for vectors and one dimension SZARRAY.
3853
3854 2009-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
3855
3856         * reflection.c (mono_reflection_type_get_handle): Handle the new encoding
3857         schema for vectors and one dimension SZARRAY.
3858
3859 2009-07-27  Mark Probst  <mark.probst@gmail.com>
3860
3861         * icall-def.h, thread-types.h, threads.c: New separate icalls for
3862         Interlocked.(Compare)Exchange with object arguments, which invoke
3863         write barriers.
3864
3865 2009-07-26  Miguel de Icaza  <miguel@novell.com>
3866
3867         * icall.c (ves_icall_Type_GetNestedType): Throw an exception when
3868         passed invalid arguments.   Fixes another crasher in the
3869         Silverlight test suite.
3870
3871         * class.c (mono_class_array_element_size): Return 0 for the size
3872         of the class;  This fixes the crasher exposed by :
3873
3874         typeof (void).MakeArrayType ();
3875
3876         * icall.c (ves_icall_MonoType_GetEvent): Do not dereference method
3877         if there is no method to dereference.    Put all the code that
3878         depends on this inside the if (method) block.
3879
3880         This fixes the crasher exposed by Microsoft's Silvelright CLR test
3881         suite  ./Reflection/Emit/TypeBuilder/TypeBuilderGetEvent.exe
3882
3883         With this change, we pass the test.
3884         
3885         * reflection.c (mono_reflection_sighelper_get_signature_local):
3886         Only dereference the assembly if it has been set.    Fixes a
3887         crasher exposed by #525328
3888
3889 2009-07-25  Mark Probst  <mark.probst@gmail.com>
3890
3891         * sgen-gc.c, object.h, null-gc.c, boehm-gc.c, marshal.c: Really
3892         don't perform the store in mono_gc_wbarrier_generic_nostore().
3893         Remove the second argument (value), which is not needed.
3894
3895 2009-07-24  Zoltan Varga  <vargaz@gmail.com>
3896
3897         * null-gc.c (mono_gc_wbarrier_generic_nostore): Define this to fix
3898         the build.
3899
3900         * boehm-gc.c: Ditto.
3901         
3902 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3903
3904         * sgen-gc.c, marshal.c, object.h: Make the managed write barrier
3905         not perform the store itself.  Introduce
3906         mono_gc_wbarrier_generic_nostore(), which is the same as
3907         mono_gc_wbarrier_generic_store(), except it doesn't perform the
3908         store.
3909
3910 2009-07-24  Mark Probst  <mark.probst@gmail.com>
3911
3912         * icall.c (ves_icall_System_Array_SetGenericValueImpl):
3913         mono_gc_wbarrier_value_copy() doesn't perform the copy itself, so
3914         we still need the memcpy().
3915
3916 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3917
3918         * sgen-gc.c: Align array bounds calculation to mono_array_size_t
3919         so that big arrays are handled correctly.  Always use
3920         safe_object_get_size() to calculate array object sizes, which
3921         takes bounds into account.
3922
3923 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3924
3925         * sgen-gc.c (mono_gc_wbarrier_value_copy): Make sure the class's
3926         GC descriptor is computed before we use it.
3927
3928 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3929
3930         * icall.c (ves_icall_System_Array_SetGenericValueImpl): Use a
3931         write barrier if necessary.
3932
3933 2009-07-22  Mark Probst  <mark.probst@gmail.com>
3934
3935         * icall-def.h, icall.c, thread-types.h: New separate icall for
3936         VolatileWrite(object&,object) that uses a write barrier.
3937
3938         * console-unix.c, file-io.c, icall.c, threads.c: Use write
3939         barriers in icalls which write to "ref" or "out" arguments.
3940
3941 2009-07-21  Zoltan Varga  <vargaz@gmail.com>
3942
3943         * marshal.c (mono_marshal_get_runtime_invoke): Do the work done in the exception
3944         handler in a separate icall, to reduce the size of the wrappers.
3945
3946 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3947
3948         * metadata-verify.c (is_valid_typespec_blob): Fix error message.
3949
3950 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3951
3952         * metadata-verify.c (parse_field): Allow byref field.
3953
3954         * metadata-verify.c (parse_locals_signature): Allow byref locals.
3955
3956         * metadata-verify.c (is_valid_typespec_blob): Allow byref typespec.
3957
3958 2009-07-20 Rodrigo Kumpera  <rkumpera@novell.com>
3959
3960         * verify.c (do_cast): Fail for any non reference type that isn't boxed.
3961         Fixes #522784.
3962
3963 2009-07-20  Robert Jordan  <robertj@gmx.net>
3964
3965         * cominterop.c (cominterop_get_managed_wrapper_adjusted):
3966         Fix invalid IL in valuetype handling (STOBJ must push the
3967         corresponding class). Fixes bug #523149.
3968
3969         Code is contributed under MIT/X11 license.
3970
3971 2009-07-20  Geoff Norton  <gnorton@novell.com>
3972
3973         * gc.c: Use proper semaphores where available on posix and darwin.
3974
3975 2009-07-19  Geoff Norton  <gnorton@novell.com>
3976
3977         * gc.c: Unnamed posix semaphores are broken on darwin-arm too.
3978
3979 2009-07-19 Rodrigo Kumpera  <rkumpera@novell.com>
3980
3981         * refletion.c (is_sre_usertype): Change name to is_usertype and
3982         invert it's result so it returns true if the type is an user type
3983         and not the opposite.
3984
3985         * reflection.c (is_*_type): Change all of those to use new macro
3986         check_corlib_type_cached that cached the type lookup so we don't
3987         need to do string comparisons all the type. Changed the signature
3988         to take a MonoClass instead.
3989
3990         * reflection.c: Change mono_image_create_token and resolve_object
3991         to use is_sre_* functions.
3992
3993 2009-07-18  Mark Probst  <mark.probst@gmail.com>
3994
3995         * sgen-gc.c: Check for writes to the stack in the managed
3996         wbarrier as well.
3997
3998 2009-07-18  Mark Probst  <mark.probst@gmail.com>
3999
4000         * sgen-gc.c: When a thread is unregistered, don't free its remsets
4001         but put them on a list which is processed with the other thread's
4002         remsets.
4003
4004 2009-07-18  Mark Probst  <mark.probst@gmail.com>
4005
4006         * sgen-gc.c: Fix and enable the internal allocator instead of
4007         using malloc/free (which causes deadlocks).
4008
4009 2009-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
4010
4011         * refletion.c: Fix builds with SRE disabled by adding a minimal
4012         implementation of mono_reflection_type_get_handle.
4013
4014 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
4015
4016         * refletion.c: Make mono_reflection_type_get_handle non static.
4017
4018         * object-internals.h: Export mono_reflection_type_get_handle.
4019
4020         * icall.c (ves_icall_MonoGenericClass_InflateType): Resolve the
4021         unmanaged handle using mono_reflection_type_get_handle.
4022
4023 2009-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
4024
4025         * refletion.c: Replace all reads of MonoReflectionType::type with
4026         calls to mono_reflection_type_get_handle. Only the functions that
4027         deal with constructing TypeBuilder::type have not been changed
4028         because they have to deal with NULL values.
4029
4030         This is a first step into supporting reflection types that don't
4031         map directly into their unmanaged counterpart.
4032
4033 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
4034
4035         * metadata-verify.c (parse_locals_signature): Don't complain
4036         on signature with zero locals since MS generates it and doesn't
4037         bother with.
4038
4039 2009-07-14 Rodrigo Kumpera  <rkumpera@novell.com>
4040
4041         * reflection.c (mono_image_get_array_token): Resolve return
4042         type using mono_reflection_type_get_handle.
4043
4044         * reflection.c (mono_image_get_array_token): Resolve array method
4045         parent type using mono_reflection_type_get_handle.
4046
4047 2009-07-14  Zoltan Varga  <vargaz@gmail.com>
4048
4049         * reflection.c (mono_image_basic_init): Applied patch from
4050         <Dax@daxxfiles.net>. Set the public key token from the assembly
4051         builder. Fixes #518909.
4052
4053         * appdomain.c: Bump corlib version.
4054
4055 2009-07-13  Zoltan Varga  <vargaz@gmail.com>
4056
4057         * class.c (mono_class_needs_cctor_run): Make this return false if
4058         the class has no cctor.
4059
4060 2009-07-13  Mark Probst  <mark.probst@gmail.com>
4061
4062         * sgen-gc.c: When the minor GC needs to allocate a new section,
4063         invoke the major GC afterwards.
4064
4065 2009-07-14  Bill Holmes  <billholmes54@gmail.com>
4066
4067         * process.c  (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal) :
4068           Applying the window_style field to the SHELLEXECUTEINFO struct.
4069
4070         Code is contributed under MIT/X11 license.
4071
4072 2009-07-13  Mark Probst  <mark.probst@gmail.com>
4073
4074         * sgen-gc.c: Fix the race condition in the unmanaged allocator by
4075         locking earlier.  Fix it in the managed allocator by making sure
4076         that no thread is stopped there before the GC runs.  If we do stop
4077         a thread there, we restart it and let it run a but, until it stops
4078         somewhere else.
4079
4080         * gc-internal.h, gc.c: Function for getting the IP from a signal
4081         context via a function registered by mini.
4082
4083 2009-07-11  Zoltan Varga  <vargaz@gmail.com>
4084
4085         * object-internals.h (MonoIntPtr): New structure describing a boxed
4086         IntPtr.
4087
4088         * object.c (mono_runtime_invoke_array): Handle ptr arguments and
4089         returns. Fixes #519953.
4090
4091         * marshal.c (mono_marshal_get_runtime_invoke): Handle pointer returns.
4092
4093 2009-07-09  Mark Probst  <mark.probst@gmail.com>
4094
4095         * class-internals.h, generic-sharing.c: New RGCTX info type for
4096         getting a remoting invoke with check wrapper.
4097
4098 2009-07-07  Geoff Norton  <gnorton@novell.com>
4099
4100         * icall-def.h: Fix the enable-minimal build.
4101
4102 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4103
4104         * object-internals.h: Add MonoReflectionDerivedType.
4105
4106         * reflection.c: Implement support for PointerType.
4107         Fixed tons of warnings.
4108
4109 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4110
4111         * object-internals.h: Add MonoReflectionByRefType.
4112
4113         * reflection.c: Implement support for ByRefType.
4114
4115 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4116
4117         * icall-def.h: Add System.Reflection.Emit.DerivedType::create_unmanaged_type.
4118
4119         * object-internals.h: Add MonoReflectionArrayType and
4120         mono_reflection_create_unmanaged_type.
4121
4122         * reflection.c: Implement support for ArrayType.
4123
4124 2009-07-07 Rodrigo Kumpera  <rkumpera@novell.com>
4125
4126         * metadata-verify.c (is_valid_method_header): Parse EH block
4127         flags correctly.
4128
4129 2009-07-03  Mark Probst  <mark.probst@gmail.com>
4130
4131         * sgen-gc.c (finish_gray_stack): Set the to_space pointer after
4132         processing the disappearing links, and process disappearing links
4133         in a loop until no new objects are copied.
4134
4135 2009-07-03  Mark Probst  <mark.probst@gmail.com>
4136
4137         * object.c (handle_enum): Invoke the write barrier when copying
4138         value type instances.
4139
4140         * sgen-gc.c: Register remsets for unmanaged write barriers only
4141         when the address written to is actually on the heap.  This makes
4142         set_value() in object.c work without requiring that the result be
4143         on the heap.
4144
4145 2009-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
4146
4147         The runtime wrappers are all bound to a given type that must
4148         exist in the same image. For regular images we use the <Module>
4149         type, which is required to exist for all images.
4150
4151         The <Module> type can't be used for dynamic images because it
4152         might not exist at the time the wrapper is required, so we create
4153         a synthetic type to use instead.
4154
4155         The current code works because of the 2 stage setup of MonoClass,
4156         but once this is gone it will no longer work.
4157
4158         * icall-def.h: Add ModuleBuilder::set_wrappers_type.
4159
4160         * metadata-internals.h (MonoDynamicImage): Add wrappers_type.
4161
4162         * object-internals.h: Export mono_image_set_wrappers_type icall
4163         as part of the internal API.
4164
4165         * marshal.c (get_wrapper_target_class): If the image is dynamic,
4166         use MonoDynamicImage::wrappers_type instead of the <Module> type.
4167
4168         reflection.c: Add mono_image_set_wrappers_type qhixh sets the dynamic
4169         image wrappers_type to the provided value.
4170
4171 2009-07-01 Rodrigo Kumpera  <rkumpera@novell.com>
4172
4173         * appdomain.c (deregister_reflection_info_roots): No need
4174         to use the image lock here.
4175
4176 2009-07-02  Mark Probst  <mark.probst@gmail.com>
4177
4178         * sgen-gc.c (collect_nursery): Also scan from write-barrier roots.
4179
4180 2009-06-29  Zoltan Varga  <vargaz@gmail.com>
4181
4182         * threads.c: Store the thread start argument in a hash table instead of
4183         registering it as a root, as libgc doesn't support unregistering roots
4184         under windows, leading to 'too many root sets' errors when many threads
4185         are created.
4186
4187         * gc.c (mono_gc_run_finalize): Avoid finalizing dynamic methods during
4188         shutdown, they can still be referenced by the other dying objects.
4189         Fixes #514506.
4190
4191 2009-06-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
4192
4193         * socket-io.c: DontLinger does not allow LingerOptions.
4194
4195 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4196
4197         * metadata-verify.c: The spec doesn't mention that it's possible to add
4198         custom attribute to a generic parameter. Fixed.
4199
4200 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4201
4202         * class.c (inflate_generic_type): Don't crash while trying to output a message
4203         on why we're aborting.
4204
4205 2009-06-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
4206
4207         * socket-io.c: DontLinger can take an int or a boolean too.
4208
4209 Fri Jun 26 17:00:04 CEST 2009 Paolo Molaro <lupus@ximian.com>
4210
4211         * gc.c: check for a null argument to SuppressFinalize () and
4212         ReRegisterForFinalize ().
4213
4214 2009-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
4215
4216         * loader.c (method_from_methodspec): Call into the verifier to check
4217         the signature.
4218
4219         * metadata-verify.c: Addmono_verifier_verify_methodspec_signature.
4220
4221         * verify-internals.h: Export mono_verifier_verify_methodspec_signature as
4222         part of the internal API.
4223
4224 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4225
4226         * metadata.c (mono_type_create_from_typespec): Call into the verifier to check
4227         the signature.
4228
4229         * metadata-verify.c: Add mono_verifier_verify_typespec_signature.
4230
4231         * verify-internals.h: Export mono_verifier_verify_typespec_signature as
4232         part of the internal API.
4233
4234 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4235
4236         * metadata.c (mono_metadata_parse_mh_full): Call into the verifier to check
4237         the signature.
4238
4239         * metadata-verify.c: Add mono_verifier_verify_standalone_signature. Fix
4240         blob verification.
4241
4242         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4243         part of the internal API.
4244
4245 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4246
4247         * metadata-verify.c: Use is_valid_blob_object to verify blob validity
4248         when doing basic verification. 
4249
4250         This check must be done since the runtime peeks into signatures in much
4251         more places than it does decoding so it makes sense to ensure that all
4252         pointers to blob objects are well formed.
4253
4254 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4255
4256         * metadata-verify.c (is_valid_blob_object): Add extra minsize argument.
4257         Use proper overflow dectection. Fix usage of it.
4258
4259 2009-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
4260
4261         * loader.c (field_from_memberref): Call into the verifier to check
4262         the signature.
4263
4264         * loader.c (mono_method_get_signature_full): Same.
4265
4266         * loader.c (method_from_memberref): Same.
4267
4268         * metadata-verify.c: Add mono_verifier_verify_memberref_signature.
4269
4270         * verify-internals.h: Export mono_verifier_verify_memberref_signature as
4271         part of the internal API.
4272
4273 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4274
4275         * threadpool.c (mono_thread_pool_add): If the domain is unloading
4276         or unloaded, still return an AsyncResult, but don't add it to the
4277         threadpool.
4278
4279 2009-06-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
4280
4281         * threads.c: fix missing colon when DEBUG is defined.
4282
4283 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4284
4285         * threadpool.c: Don't add new calls to a threadpool if the domain
4286         of the call is unloading or unloaded.  When dequeuing a job, null
4287         the reference in the queue.
4288
4289 2009-06-25  Mark Probst  <mark.probst@gmail.com>
4290
4291         * sgen-gc.c (null_link_in_range): Add the dislink for the old
4292         generation if an object was moved.
4293
4294 2009-06-25  Sylvain Dupont <duposyl@gmail.com>
4295
4296         * cominterop.h cominterop.c marshal.c: Added support for marshalling out 
4297           parameters of type SAFEARRAY[VARIANT].
4298
4299         * reflection.c (encode_marshal_blob): Properly generate element type
4300           (SafeArraySubType marshal attribute option).
4301
4302         Code is contributed under MIT/X11 license.
4303
4304 Thu Jun 25 15:48:09 CEST 2009 Paolo Molaro <lupus@ximian.com>
4305
4306         * reflection.c: in mono_method_clear_object () really ensure all the
4307         objects are removed.
4308
4309 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4310
4311         * loader.c (mono_method_signature): Call into the verifier to check
4312         the method signature.
4313
4314         * metadata-verify.c (verify_method_table): Move signature verification
4315         to verify_method_table_full.
4316
4317         * metadata-verify.c: Add mono_verifier_verify_method_signature.
4318
4319         * verify-internals.h: Export mono_verifier_verify_method_signature as
4320         part of the internal API.
4321
4322 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4323
4324         * loader.c (mono_method_get_header): Call into the verifier to
4325         check the method header.
4326
4327         * metadata-verify.c: Add mono_verifier_verify_method_header.
4328
4329         * verify-internals.h: Export mono_verifier_verify_method_header as
4330         part of the internal API.
4331
4332 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4333
4334         * class.c (mono_class_find_enum_basetype): Call into the verifier to
4335         check the field signature. Replace an assert with an explicit check.
4336
4337         * class.c (mono_class_setup_fields): Call into the verifier to check
4338         the field signature.
4339
4340         * metadata-verify.c: Add mono_verifier_verify_field_signature.
4341
4342         * verify-internals.h: Export mono_verifier_verify_field_signature as
4343         part of the internal API.
4344
4345 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4346
4347         * class.c (mono_class_find_enum_basetype): Simplify this function
4348         by moving code outside of the loop and not decoding static fields.
4349
4350 2009-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
4351
4352         * metadata-verify.c (verify_typedef_table): Check the extends
4353         token here. Move to here a flags check from verify_typedef_table_full.
4354
4355 2009-06-24  Zoltan Varga  <vargaz@gmail.com>
4356
4357         * metadata-verify.c (is_valid_method_header): Fix a warning.
4358
4359         * metadata-internals.h (MonoImage): Remove the unused 
4360         static_rgctx_invoke_wrapper_cache.
4361
4362         * image.c marshal.c: Ditto.
4363
4364 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4365
4366         * image.c (do_mono_image_load): Enable table data verification.
4367
4368 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4369
4370         * metadata-verify.c (is_valid_constant): Fix nullref check.
4371
4372 2009-06-23 Rodrigo Kumpera  <rkumpera@novell.com>
4373
4374         * metadata-verify.c (is_valid_constant): Fix string bounds check.
4375
4376 2009-06-22  Mark Probst  <mark.probst@gmail.com>
4377
4378         * sgen-gc.c: Managed allocation with pthreads TLS.
4379
4380         * threads.c, threads-types.h: Functions for the JIT to tell the
4381         runtime whether it supports the MONO_TLS opcode.
4382
4383 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4384
4385         * metadata-verify.c (verify_param_table): Fix a crash for assemblies
4386         without methods.
4387
4388 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4389
4390         * metadata-verify.c (is_valid_constant): Fix the string length check.
4391         Use safe overflow checking. Add decent error messages.
4392
4393 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4394
4395         * metadata-verify.c: Move remaininh blob checks to the offline
4396         verification path.
4397
4398 2009-06-22 Rodrigo Kumpera  <rkumpera@novell.com>
4399
4400         * metadata-verify.c: Move more blob checks to the offline verification
4401         path.
4402
4403 2009-06-22  Bill Holmes  <billholmes54@gmail.com>
4404
4405         * object-internals.h : Adding interrupt_on_stop field.
4406
4407         * threads.c (mono_thread_request_interruption) : On Windows exit the
4408           thread if interrupt_on_stop is set.
4409
4410         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
4411          Removing old interrupt logic and setting the interrupt_on_stop for the
4412          thread when calling accept.
4413
4414         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal) :
4415          setting the interrupt_on_stop for the thread when calling accept.
4416
4417         Contributed under MIT/X11 license.
4418
4419 2009-06-20  Martin Baulig  <martin@ximian.com>
4420
4421         * mono-debug.h (MONO_DEBUGGER_MINOR_VERSION): Bump to 3.
4422
4423 2009-06-21  Zoltan Varga  <vargaz@gmail.com>
4424
4425         * appdomain.c (mono_try_assembly_resolve): Don't call managed code when
4426         running in no-exec mode.
4427
4428 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4429
4430         * metadata-verify.c (verify_method_table): Move header
4431         checking to verify_method_table_full.
4432
4433         * metata-verify.c (mono_verifier_verify_full_table_data):
4434         Call verify_method_table_full.
4435
4436 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4437
4438         * metadata-verify.c (verify_field_table): Move signature
4439         checking to verify_field_table_full.
4440
4441         * metata-verify.c (mono_verifier_verify_full_table_data):
4442         Call verify_field_table_full.
4443
4444 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4445
4446         * metadata-verify.c (verify_typedef_table): Move remaining
4447         stuff to verify_typedef_table_full.
4448
4449 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4450
4451         * metadata-verify.c: Kill is_corlib from VerifyContext.
4452         It is only used by the offline mode.
4453         So we better remove it from the runtime path.
4454
4455 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4456
4457         * metadata-verify.c: Add new mono_verifier_verify_full_table_data
4458         function that perform the offline metadata verification steps.
4459
4460         * metadata-verify.c (verify_typedef_table): Move some checks to
4461         verify_typedef_table_full and make it been called by new function
4462         mono_verifier_verify_full_table_data.
4463
4464         * pedump.c: Call mono_verifier_verify_full_table_data.
4465
4466         * verify-internals.h: Export mono_verifier_verify_full_table_data as
4467         part of the internal API.
4468
4469 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4470
4471         * metadata-verify.c (typedef_is_system_object): Fix System.Object
4472         check.
4473
4474         * metadata-verify.c (verify_implmap_table): Fix implmap invalid
4475         flags bits. SupportLastError was confused as bit 7 instead of 6.
4476
4477         * metadata-verify.c (verify_implmap_table): Fix import scope verification
4478         to check against the module ref table instead of module.
4479
4480         * metadata-verify.c (verify_implmap_table): Fix corlib check.
4481
4482         * pedump.c: Call mono_image_load_names.
4483
4484 2009-06-19 Rodrigo Kumpera  <rkumpera@novell.com>
4485
4486         * image.c: Extract mono_image_load_names from do_mono_image_load.
4487
4488         * metadata-internals.h: Export mono_image_load_names as part of
4489         the internal API.
4490         
4491 2009-06-19  Zoltan Varga  <vargaz@gmail.com>
4492
4493         * metadata.c (mono_metadata_cleanup): Free the generic method cache
4494         first, as it could reference data in the other caches.
4495
4496 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4497
4498         * metadata-verify.c: Finished with method header verification.
4499
4500 2009-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
4501
4502         * metadata-verify.c: Added more header verification code.
4503         Now only EH clauses are missing.
4504
4505 2009-06-17  Zoltan Varga  <vargaz@gmail.com>
4506
4507         * marshal.c (get_runtime_invoke_type): Don't share primitive types
4508         for return values.
4509
4510 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4511
4512         * metadata-verify.c: Initial method header verification.
4513
4514 2009-06-16 Rodrigo Kumpera  <rkumpera@novell.com>
4515
4516         * metadata-verify.c (verify_import_table): The IAT contents
4517         might end been patched by the windows DL when running with
4518         coree enabled.
4519
4520 2009-06-15 Rodrigo Kumpera  <rkumpera@novell.com>
4521
4522         * class.c (mono_class_from_typeref): If the enclosing type is not
4523         found return null instead of crashing. Fixes #508487.
4524
4525 2009-06-15  Atsushi Enomoto  <atsushi@ximian.com>
4526
4527         * normalization-tables.h : updated to the latest unicode charcter
4528           data.
4529         * appdomain.c : bump corlib version.
4530
4531 2009-06-14  Zoltan Varga  <vargaz@gmail.com>
4532
4533         * class.c (mono_class_from_name): Fix support for assembly references
4534         in the EXPORTEDTYPE table. Fixes #511704.
4535
4536 2009-06-13  Geoff Norton  <gnorton@novell.com>
4537
4538         * domain.c: Ensure that mono_domain_assembly_open actually opens the
4539         assembly in the target domain.
4540
4541 2009-06-12  Robert Jordan  <robertj@gmx.net>
4542
4543         * cominterop.c (cominterop_get_ccw): Increment mspec's SizeParamIndex
4544         because "this" of the managed signature has become an
4545         ordinary parameter in the unmanaged signature.
4546
4547 2009-06-12  Zoltan Varga  <vargaz@gmail.com>
4548
4549         * class-internals.h (struct _MonoGenericContainer): Add an 'image'
4550         field for owner-less generic containers.
4551
4552         * reflection.c (mono_reflection_initialize_generic_parameter): Set the
4553         image field of the owner-less generic containers created here.
4554
4555         * metadata.c (mono_metadata_load_generic_params): Ditto, the
4556         contain is ownerless until the caller sets its owner.
4557
4558         * metadata.c (type_in_image): Handle owner-less generic containers
4559         correctly.
4560         
4561 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4562
4563         * image.c (mono_image_close): Support debug_assembly_unload for
4564         dynamic images too.
4565
4566 2009-06-11 AndrĂ©s G. Aragoneses  <aaragoneses@novell.com>
4567
4568         * class.c: Fix some typos in comments.
4569
4570 2009-06-11  Zoltan Varga  <vargaz@gmail.com>
4571
4572         * reflection.c (add_custom_modifiers): Avoid reading invalid memory.
4573
4574         * threads.c (mono_thread_execute_interruption): Avoid creating the
4575         abort exception object while holding the synch_cs lock.
4576
4577 2009-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
4578
4579         * metadata-verify.c: Verify basic cattr content.
4580
4581 2009-06-10  Zoltan Varga  <vargaz@gmail.com>
4582
4583         * reflection.c (add_exported_type): Don't set the FORWARDER flag on
4584         nested types.
4585         
4586         * reflection.c (mono_image_fill_export_table_from_type_forwarders): Add
4587         support for nested types. Fixes #511704.
4588
4589 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4590
4591         * metadata-verify.c: Verify methodspec signatures.
4592
4593 2009-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
4594
4595         * metadata-verify.c: Verify typespec signatures.
4596
4597 2009-06-09  Zoltan Varga  <vargaz@gmail.com>
4598
4599         * metadata.c (free_inflated_method): Call 
4600         mono_marshal_free_inflated_wrappers (), which was missed earlier.
4601
4602 2009-06-08  Miguel de Icaza  <miguel@novell.com>
4603
4604         * mono-config.c: Small change to report the PPC64/ILP32 model.
4605
4606 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4607
4608         * metadata-verify.c (parse_type): Check szarray.
4609
4610 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4611
4612         * metadata-verify.c (parse_type): Check fnptr.
4613
4614 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4615
4616         * metadata-verify.c (parse_type): Check generic instances.
4617
4618 2009-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
4619
4620         * metadata-verify.c (parse_type): Check array shape.
4621
4622 2009-06-05  Robert Jordan  <robertj@gmx.net>
4623
4624         * class.c (mono_class_create_from_typedef): Check only for
4625         mscorlib's System.Array.
4626
4627 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4628
4629         * metadata-verify.c (parse_type): Check pointer, class/valuetype
4630         and generic params. 
4631
4632         * metadata-verify.c (parse_field): Check the signature.
4633
4634 2009-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
4635
4636         * metadata-verify.c: Implement locals signature check.
4637
4638 2009-06-04  Marek Safar  <marek.safar@gmail.com>
4639
4640         * domain.c: Add .NET 4.0 Beta 1 version.
4641
4642 2009-06-04  Bill Holmes  <billholmes54@gmail.com>
4643
4644         * cominterop.c (cominterop_ccw_queryinterface): Fix for bug 499566.
4645           For QueryInterface on CCWs consider the base class
4646           interfaces as well.
4647
4648         Code is contributed under MIT/X11 license.
4649
4650 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4651
4652         * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
4653
4654         * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
4655         used.
4656
4657         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
4658         adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
4659
4660         * generic-sharing.c (inflate_other_data): Ditto.
4661         
4662 2009-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
4663
4664         * metadata-verify.c: Implement property signature check.
4665
4666 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4667
4668         * sgen-gc.h: Register saving support for PPC.
4669
4670 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4671
4672         * sgen-gc.c: Fixed a pthread TLS screwup.
4673
4674 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4675
4676         * sgen-gc.c: Do TLS using pthread API if __thread keyword is not
4677         supported.
4678
4679 2009-06-04  Mark Probst  <mark.probst@gmail.com>
4680
4681         * sgen-gc.c: Disable TLA and managed allocation if the __thread
4682         keyword is not supported.
4683
4684 2009-06-04  Zoltan Varga  <vargaz@gmail.com>
4685
4686         * marshal.c metadata.c: Applied patch from Ulrich Weigand 
4687         <uweigand@de.ibm.com>: Free the wrappers of inflated generic methods when
4688         the inflated method is freed. Fixes #508389.
4689
4690         The code is contributed under the MIT/X11 license.
4691         
4692 2009-06-03  Zoltan Varga  <vargaz@gmail.com>
4693
4694         * marshal.c (get_wrapper_target_class): New helper function.
4695         (mono_marshal_get_runtime_invoke): Place runtime-invoke wrappers into
4696         the <Module> class of the image. Fixes #509049.
4697
4698 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4699
4700         * threads.c (ves_icall_System_Threading_Thread_Sleep_internal):
4701         Check if the thread was interrupted and proccess it straight away.
4702         Makes abortion much more responsive.
4703
4704 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4705
4706         * threads.c (mono_thread_execute_interruption): Use atomic cas with
4707         MonoThread::interruption_requested to match it's counterpart.
4708
4709         Fixes a hang in abort-stress-1 on a 2 core x86.
4710
4711         * threads.c (ves_icall_System_Threading_Thread_GetAbortExceptionState):
4712         Fix warning.
4713
4714 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4715
4716         Change MonoImage::name_cache to be protected by the image lock
4717         instead of the loader lock.
4718
4719         * appdomain.c (deregister_reflection_info_roots): Protect access
4720         to name_cache.
4721
4722         * class.c (mono_image_init_name_cache): Change from the loader lock
4723         to the image lock. Check if the cache wasn't already created.
4724
4725         * class.c: Change from the loader to the image lock.
4726
4727         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Fix
4728         the code to hold the image lock while iterating over name_cache and
4729         not go into mono_array_new holding it.
4730
4731         * metadata-internals.h: Add a comment about this change.
4732
4733 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4734
4735         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
4736         Under the 2.0 profile raise the loader error.
4737
4738         Fixes #508532.
4739
4740 2009-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
4741
4742         * marshal.c (mono_marshal_get_runtime_invoke): Emit the right kind
4743         of ldind opcode for generic instances so we don't fail for direct wrappers.
4744         This only affect direct calls.
4745
4746 2009-05-31  Zoltan Varga  <vargaz@gmail.com>
4747
4748         * reflection.c (create_dynamic_mono_image): Fix warnings.
4749
4750         * generic-sharing.c (other_info_equal): Ditto.
4751         
4752 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4753
4754         * metadata-verify.c: Implement field signature check.
4755
4756 2009-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
4757
4758         * metadata-verify.c: Implement standalone signature check.
4759
4760 2009-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
4761
4762         * metadata-verify.c: Implement methodref signature check.
4763
4764 2009-05-28  Zoltan Varga  <vargaz@gmail.com>
4765
4766         * object-internals.h (MonoRuntimeCallbacks): New structure containing
4767         callbacks supplied by the runtime.
4768
4769         * object.c (mono_install_callbacks): New internal function to install
4770         the callbacks.
4771
4772         * object.c (mono_create_ftnptr): Move the implementation of this to
4773         mini/.
4774
4775         * object.c (mono_get_addr_from_ftnptr): Ditto.  
4776
4777 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4778
4779         * metadata-verify.c (parse_return_type): Proper byref check.
4780         * metadata-verify.c (is_valid_method_signature): Check for zero arity
4781         generic signatures and method params.
4782
4783 2009-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
4784
4785         * metadata-verify.c (decode_signature_header): Fix bounds check.
4786
4787         * metadata-verify.c (parse_custom_mods): Check custom mods.
4788
4789         * metadata-verify.c (parse_type): Do initial basic verification
4790         of valid values.
4791         
4792         * metadata-verify.c (is_valid_method_signature): Parse the generic
4793         param count.
4794
4795 2009-05-26 Rodrigo Kumpera  <rkumpera@novell.com>
4796
4797         * icall.c (ves_icall_Type_GetMethodsByName): Virtual methods should be
4798         discarded based on their most specific definition so we set the method_slots
4799         array before checking if the method is acceptable or not.
4800
4801         Fixes #506757.
4802
4803 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4804
4805         * icall.c: Free the old array when resizing a mono_ptr_array.
4806
4807 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4808
4809         * reflection.c (create_dynamic_mono_image): Use mono_object_hash()
4810         for the hashes whose keys are managed objects.
4811
4812 2009-05-26  Mark Probst  <mark.probst@gmail.com>
4813
4814         * object-internals.h, threads.c: Set the execution context on
4815         thread start here, not in corlib.
4816
4817         * appdomain.c: Bump corlib version.
4818
4819 2009-05-27  Martin Baulig  <martin@ximian.com>
4820
4821         * mono-debug.c (mono_debug_init): Use `MONO_DEBUG_FORMAT_DEBUGGER'
4822         if `_mono_debug_using_mono_debugger' is set to make things work
4823         properly when embedding Mono.
4824
4825 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4826
4827         * class.c (mono_class_setup_fields): Don't mark simd types as having
4828         16 bytes alignment as the whole runtime doesn't support.
4829
4830 2009-05-25 Rodrigo Kumpera  <rkumpera@novell.com>
4831
4832         * metadata-verify.c (safe_read): Use endian safe read macros.
4833
4834 2009-05-25  Zoltan Varga  <vargaz@gmail.com>
4835
4836         * object.c (mono_create_ftnptr): Don't allocate from the code mempool since
4837         it is read-only when using full aot.
4838
4839 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4840
4841         * metadata-verify.c (is_valid_method_signature): Verify parts
4842         of the return type. Provide an error message in case of failure.
4843
4844 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4845
4846         * metadata-verify.c (is_valid_method_signature): Verify the call conv.
4847
4848 2009-05-22 Rodrigo Kumpera  <rkumpera@novell.com>
4849
4850         * metadata-verify.c: Include the size prefix in the bounds check.
4851
4852 2009-05-22  Miguel de Icaza  <miguel@novell.com>
4853
4854         * icall.c: Remove warnings.
4855
4856         * mono-config.c: Allow for CONFIG_CPU to be set in config.h and
4857         prevent auto-detection based on GCC defines.
4858
4859         Add PS3
4860
4861         * metadata-verify.c: Do not include signal.h
4862
4863         * generic-sharing.c, marshal.c: Add returns to avoid some warning
4864         messages.  Not sure why the g_assert_not_reached is not enough to
4865         quiet the compiler.
4866         
4867
4868         * appdomain.c: Remove code that is not used when
4869         DISABLE_SHADOW_COPY is set.
4870
4871         * image.c: use g_getenv
4872
4873 2009-05-21  Miguel de Icaza  <miguel@novell.com>
4874
4875         * reflection.c: Remove code that it not used with
4876         DISABLE_REFLECTION_EMIT is defined.
4877
4878 2009-05-21  Zoltan Varga  <vargaz@gmail.com>
4879
4880         * marshal.c (mono_marshal_get_runtime_invoke): Share more runtime
4881         invoke wrappers.
4882
4883 2009-05-20  Miguel de Icaza  <miguel@novell.com>
4884
4885         * socket-io.c
4886         (ves_icall_System_Net_Sockets_Socket_Available_internal): Remove
4887         the ifdef here and instead put that on io-layer
4888
4889 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4890
4891         * metadata-verify.c: Verify the generic param constraint table.
4892
4893 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4894
4895         * metadata-verify.c (verify_generic_param_table): Fix
4896         thinko on the valid flags bits for generic params.
4897
4898 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4899
4900         * metadata-verify.c: Verify the methodspec table.
4901
4902 2009-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
4903
4904         * metadata-verify.c: Verify the generic param table.
4905
4906 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4907
4908         * sgen-gc.c: Store and use the count with REMSET_VTYPE.
4909
4910 2009-05-19  Mark Probst  <mark.probst@gmail.com>
4911
4912         * sgen-gc.c: Use generation enum more consistently and use the
4913         correct generation in mono_gc_register_for_finalization().
4914
4915 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4916
4917         * metadata-verify.c: Verify the nested class table.
4918
4919 2009-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
4920
4921         * metadata-verify.c: Verify the manifest resource table.
4922
4923 2009-05-17  Zoltan Varga  <vargaz@gmail.com>
4924
4925         * debug-helpers.c (dis_one): Add little-endian support for ldstr.
4926
4927 2009-05-16  Zoltan Varga  <vargaz@gmail.com>
4928
4929         * class.c (mono_class_get_vtable_entry): Avoid adding static-rgctx
4930         wrappers, this is now done in the JIT.
4931         
4932         * class.c (mono_set_generic_sharing_supported): New internal function.
4933         (mono_class_generic_sharing_enabled): Move the #ifdef stuff to the JIT.
4934
4935 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4936
4937         * metadata-verify.c: Verify the exported type table.
4938
4939 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4940
4941         * pedump.c (main): Fake an assembly for netmodules to make the verifier happy.
4942
4943 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4944
4945         * metadata-verify.c: Verify the file table.
4946
4947 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4948
4949         * metadata-verify.c (verify_assembly_table): Fix an error message.
4950
4951         * metadata-verify.c: Verify the assemblyref table.
4952
4953 2009-05-15 Rodrigo Kumpera  <rkumpera@novell.com>
4954
4955         * metadata-verify.c (verify_assembly_table): Fix the valid
4956         bits mask for flags.
4957
4958 2009-05-15  Zoltan Varga  <vargaz@gmail.com>
4959
4960         * debug-helpers.c (mono_method_full_name): Print generic parameters of
4961         generic methods as well.
4962
4963 2009-05-15  Geoff Norton  <gnorton@novell.com>
4964
4965         * gc.c: MachO/Darwin supports and uses semaphores fine for this 
4966         use-case and is significantly more performant than the wapi layer.
4967
4968 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4969
4970         * metadata-verify.c: Verify the assembly table.
4971
4972 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4973
4974         * metadata-verify.c: Fix rows limit check.
4975
4976 2009-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
4977
4978         * metadata-verify.c: Verify the fieldrva table.
4979
4980 2009-05-13  Mark Probst  <mark.probst@gmail.com>
4981
4982         * sgen.c: Speed up weak links and finalizers by grouping them by
4983         generation.
4984
4985 2009-05-13  Mark Probst  <mark.probst@gmail.com>
4986
4987         * marshal.c (delegate_hash_table_add): When overwriting an entry,
4988         free the old GCHandle (only applies to SGen).
4989
4990 2009-05-13  Zoltan Varga  <vargaz@gmail.com>
4991
4992         * loader.c (mono_get_method_from_token): Avoid the expensive call to
4993         mono_metadata_load_generic_params () for non-generic methods.
4994
4995 2009-05-12  Mark Probst  <mark.probst@gmail.com>
4996
4997         * monitor.c, monitor.h (mono_monitor_get_object_monitor_weak_link):
4998         New function for returning a monitor's weak link if it has one.
4999
5000         * sgen-gc.c: Remove an object's monitor's weak link (if it has
5001         one) when clearing a domain.  These can still be around because
5002         the object might not have been collected.
5003
5004 2009-05-12  Zoltan Varga  <vargaz@gmail.com>
5005
5006         * gc.c: Fix a warning.
5007
5008 2009-05-12  KornĂ©l Pál  <kornelpal@gmail.com>
5009
5010         * gc.c (mono_gc_init): Set gc_thread on creation. This avoids the
5011         prevous wait that resulted in a deadlock on Windows when initializing
5012         the runtime form DllMain. Also results in improved startup time.
5013         (finalizer_thread): Get rid of thread_started_event.
5014         * threads.c, threads-types.h (mono_thread_create_internal): Return the
5015         resulting MonoThread.
5016
5017         Contributed under MIT/X11 license.
5018
5019 2009-05-11 Rodrigo Kumpera  <rkumpera@novell.com>
5020
5021         * metadata-verify.c: Verify the implmap table.
5022         Don't require that #US and #Strings be present.
5023
5024 2009-05-11  Sebastien Pouliot  <sebastien@ximian.com>
5025
5026         * security-core-clr.c: Delegate checks are done at creation time,
5027         not a invocation time. Fix exception for Telerik Silverlight demo
5028
5029 2009-05-11  Mark Probst  <mark.probst@gmail.com>
5030
5031         * sgen-gc.c (need_remove_object_for_domain): Remove the special
5032         case for the Thread class.
5033
5034         * threads.c: Do clean-up of abort exception/state in
5035         thread_cleanup() instead of Thread.free_internal().  Also clean up
5036         current_appcontext.  The reason we have to do that is because
5037         those references might point into another domain and if that
5038         domain is unloaded before the thread is finalized, they point to
5039         invalid data.
5040
5041 2009-05-10  Andreas Faerber  <andreas.faerber@web.de>
5042
5043         * null-gc.c (mono_gc_weak_link_add, mono_gc_clear_domain): Fix
5044         stub signatures.
5045         
5046         Contributed unter MIT/X11 license.
5047
5048 2009-05-09  Miguel de Icaza  <miguel@novell.com>
5049
5050         * verify.c, metadata-verifier.c: Add support for disabling the
5051         verifier in some builds.
5052
5053         [ Sorry, my previous commit accidentally commited some work in
5054         progress ]
5055
5056 2009-05-08  Zoltan Varga  <vargaz@gmail.com>
5057
5058         * class.c (mono_class_setup_fields): Set class->field.first for
5059         generic instances.
5060
5061 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
5062
5063         * metadata-verify.c: Verify the typespec table.
5064
5065 2009-05-07 Rodrigo Kumpera  <rkumpera@novell.com>
5066
5067         * metadata-verify.c: Verify the module table.
5068
5069 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5070
5071         * metadata-verify.c: Verify the methodimpl table.
5072
5073 2009-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
5074
5075         * metadata-verify.c: Verify the property table.
5076
5077 2009-05-06  Zoltan Varga  <vargaz@gmail.com>
5078
5079         * debug-helpers.c (mono_method_desc_match): Add support for generic
5080         glob patterns.
5081
5082 2009-05-05 Rodrigo Kumpera  <rkumpera@novell.com>
5083
5084         * metadata-verify.c: Verify the propertymap table.
5085
5086 2009-05-04 Rodrigo Kumpera  <rkumpera@novell.com>
5087
5088         * metadata-verify.c: Verify the event table.
5089
5090         * metadata-verify.c (search_sorted_table): Fix offset
5091         calculation.
5092
5093 2009-05-02  Zoltan Varga  <vargaz@gmail.com>
5094
5095         * domain-internals.h (struct _MonoJitInfo): Add a 'from_llvm' flag.
5096
5097 2009-05-01  Mark Probst  <mark.probst@gmail.com>
5098
5099         * gc.c (mono_gc_run_finalize): Don't set the domain too late,
5100         because mono_delegate_free_ftnptr() needs it.
5101
5102 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5103
5104         * metadata-verify.c: Verify the eventmap table.
5105
5106 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5107
5108         * metadata-verify.c: Verify the standalonesig table.
5109
5110 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5111
5112         * metadata-verify.c: Verify the field layout table.
5113
5114 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5115
5116         * class.c (mono_type_get_name_recurse): Don't crash
5117         for ownerless generic params.
5118
5119         * debug-helpers.c (mono_type_get_desc): Correct the format
5120         for ownerless generic params.
5121
5122 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5123
5124         * metadata-verify.c: Verify the class layout table.
5125
5126 2009-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
5127
5128         * metadata-verify.c: Verify the decl security table.
5129
5130 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5131
5132         * domain.c (mono_domain_set_internal_with_options): Don't do
5133         anything if the old domain is the same as the old one.  Fixes
5134         #499326.
5135
5136 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5137
5138         * appdomain.c: Deregister the reflection_info roots when unloading
5139         a domain.
5140
5141         * sgen-gc.c, domain.c, gc-internal.h: mono_gc_clear_domain() nulls
5142         memory allocated by a domain and frees its disappearing links.
5143
5144         * boehm-gc.c, null-gc.c: Empty implementation of
5145         mono_gc_clear_domain().
5146
5147 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5148
5149         * appdomain.c (clear_cached_vtable): Free the static fields memory
5150         block.
5151
5152 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5153
5154         * gc.c: Set the correct domain when invoking finalizers.
5155
5156         * appdomain.c: Set the correct domain when creating threads.
5157
5158 2009-04-30  Mark Probst  <mark.probst@gmail.com>
5159
5160         * sgen-gc.c: Fix skip size for vectors.
5161
5162 2009-05-03  Martin Baulig  <martin@ximian.com>
5163
5164         * mono-debug-debugger.c
5165         (mono_debugger_check_breakpoints): Check class init handlers even
5166         if we don't have any method load handers.
5167
5168 2009-04-30  Zoltan Varga  <vargaz@gmail.com>
5169
5170         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid 
5171         returning refonly assemblies if refonly is FALSE. Fixes #499013.
5172
5173 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
5174
5175         * metadata-verify.c: Verify the field marshal table.
5176
5177 2009-04-29 Rodrigo Kumpera  <rkumpera@novell.com>
5178
5179         * metadata-verify.c: Verify the custom attribute table.
5180
5181 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5182
5183         * metadata-verify.c: Verify the constant table.
5184
5185 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5186
5187         * metadata-verify.c: Verify the memberef table.
5188
5189 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5190
5191         * metadata-verify.c (get_coded_index_token): Remove
5192         dead argument.
5193
5194 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5195
5196         * metadata-verify.c: Verify the interfaceimpl table.
5197
5198 2009-04-28 Rodrigo Kumpera  <rkumpera@novell.com>
5199
5200         * verify.c: Improve error message.
5201
5202         * debug-helpers.c (mono_type_get_desc): Harden the code that
5203         deals with VAR and MVAR.
5204
5205 2009-04-28  Zoltan Varga  <vargaz@gmail.com>
5206
5207         * image.c (mono_image_fixup_vtable): Avoid casting an lvalue. Fixes 
5208         part of #498692.
5209
5210 2009-04-23 Tom Hindle <tom_hindle@sil.org>
5211
5212         * cominterop.c (ves_icall_System_Runtime_InteropServices_Marshal_ReleaseComObjectInternal):
5213         changed to match .Net behaviour of not aborting on additional calls to ReleaseComObject.
5214
5215 2009-04-28  Sebastien Pouliot  <sebastien@ximian.com>
5216
5217         * security-core-clr.c: Avoid redundant checks for platform code, 
5218         e.g. check for method and for class (very common) and check
5219         for class and outer class (less common)...
5220
5221 2009-04-27  Zoltan Varga  <vargaz@gmail.com>
5222
5223         * reflection.c: Avoid returning random cattrs for synthetic methods.
5224         Fixes #498545.
5225
5226 2009-04-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5227
5228         * assembly.c: assemblies in the GAC should never be shadow-copied.
5229
5230 2009-04-26  Mark Probst  <mark.probst@gmail.com>
5231
5232         * domain.c, domain-internals.h: Disable
5233         track_resurrection_{objects,handles}_hash in MonoDomain if using
5234         SGen.
5235
5236 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5237
5238         * metadata-verify.c: Verify the param table.
5239
5240 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5241
5242         * metadata-verify.c (verify_typedef_table): Range check FieldList and
5243         MethodList.
5244
5245         * metadata-verify.c (verify_method_table): Proper check the ParamList
5246         field.
5247
5248 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5249
5250         * metadata-verify.c (verify_method_table): Check for runtime
5251         implemented functions such as delegate .ctors. Remove spurious
5252         printf.
5253         
5254 2009-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
5255
5256         * pedump.c: Proper initialize the runtime forcing the 2.0 profile.
5257
5258 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5259
5260         Don't allocate MonoGenericInfo for ownerless generic params.
5261         * class-internals.h (MonoGenericParam::info): Move field to ...
5262         (MonoGenericParamFull): ... this.  New struct.
5263         (MonoGenericContainer::type_params): Change type to
5264         MonoGenericParamFull.
5265         (MonoGenericParam, MonoGenericContainer): Update accessors.
5266         * metadata.c (mono_metadata_parse_generic_param): Don't initialize
5267         'info' field for ownerless generic param.
5268         (mono_metadata_load_generic_params): Update to changes.
5269         * reflection.c (mono_reflection_create_generic_class): Likewise.
5270         (reflection_methodbuilder_to_mono_method): Likewise.
5271         (mono_reflection_initialize_generic_parameter): Likewise.
5272
5273 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5274
5275         Don't use MonoGenericParamInfo for ownerless generic params.
5276         * class.c (get_anon_gparam_class, set_anon_gparam_class): New.  Don't
5277         use ParamInfo class at all.
5278         (mono_class_from_generic_parameter): Use them.
5279         (make_generic_param_class): Fix a couple of instances where 'pinfo
5280         == NULL' wasn't handle.
5281
5282 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5283
5284         * class.c (make_generic_param_class): Carve out of ...
5285         (mono_class_from_generic_parameter): ... here.
5286
5287 2009-04-24  Raja R Harinath  <harinath@hurrynot.org>
5288
5289         Simplify mono_class_from_generic_parameter
5290         * class-internals.h (MonoGenericParamInfo::token): New field.
5291         * metadata.c (mono_metadata_load_generic_params): Initialize it
5292         from metadata.
5293         * class.c (mono_class_from_generic_parameter): Use it instead of
5294         searching through metadata.
5295
5296 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5297
5298         * metadata-verify.c: Add verification of the method table.
5299
5300 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5301
5302         * icall.c (ves_icall_Type_GetMethodsByName): Fix memleak for the
5303         Delegate::Invoke optimization.
5304
5305 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5306
5307         * appdomain.c (mono_domain_create_appdomain_internal): Free the
5308         string returned by get_shadow_assembly_location_base.
5309
5310         * appdomain.c (get_shadow_assembly_location_base): Add a comment
5311         about caller's ownership.
5312
5313 2009-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
5314
5315         * reflection.c: Add mono_reflection_cleanup_domain to cleanup
5316         reflection memory on domain unload.
5317
5318         * domain.c (mono_domain_free): Don't free refobject_hash, let the
5319         reflection cleanup code do it.
5320
5321         * domain-internals.h: Add mono_reflection_cleanup_domain.
5322
5323         This fixes a memory leak for managed mirrors of reflection objects
5324         on domain unload. 
5325
5326 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5327
5328         * metadata-verify.c: Implement more verification of the field table.
5329
5330 2009-04-22 Rodrigo Kumpera  <rkumpera@novell.com>
5331
5332         * pedump.c (main): Init mono with mscorlib so it defaults to 2.0 and
5333         doesn't try to parse the input assembly, which can be broken.
5334
5335 2009-04-23  Mark Probst  <mark.probst@gmail.com>
5336
5337         * boehm-gc.c, gc-internal.h, gc.c, monitor.c, null-gc.c,
5338         sgen-gc.c: Implement track resurrection in weak GC handles in SGen
5339         by using the lowest bit in the link to store whether the link is
5340         tracked.  Move the track_resurrection hashes into boehm-gc.c.
5341
5342 2009-04-22  Miguel de Icaza  <miguel@novell.com>
5343
5344         * Makefile.am: Split the console support in platform specific code
5345         and put together a framework for making this easy in the future so
5346         that we can start splitting code instead of having a mess of PLATFORM_WIN32
5347
5348 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5349
5350         * pedump.c: Fix a warning.
5351
5352 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5353
5354         * verify.c (mono_delegate_type_equal): Compare valuetypes using
5355         mono_class_from_mono_type to avoid bad interactions with the dual representation
5356         of the generic type definition.
5357
5358 2009-04-21 Rodrigo Kumpera  <rkumpera@novell.com>
5359
5360         * verify.c (do_invoke_method): Use mono_class_from_mono_type to
5361         get the MonoClass for the call context type as it might be a generic
5362         instance.
5363
5364         Fixes #491483.
5365
5366 2009-04-21  Mark Probst  <mark.probst@gmail.com>
5367
5368         * object-internals.h: The Thread object has no execution_context
5369         member anymore.
5370
5371         * threads.c, threadpool.c, threads-types.h: Accessor functions for
5372         the execution context.
5373
5374         * appdomain.c: Bump corlib version.
5375
5376 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5377
5378         * verify.c (do_newobj): Improve error message.
5379
5380 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5381
5382         * verify.c (verify_clause_relationship): Only mask as an error if the exception clause
5383         is nested in the filter block.
5384
5385         * verify.c (verify_clause_relationship): The disjoint check must verify if the exception
5386         block is not fully nested.
5387
5388         Fixes #495656.
5389
5390 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5391
5392         * verify.c (verify_type_compatibility_full): Compare MonoClass and
5393         not MonoType to check for equality of valuetypes as the generic type
5394         definition allows for two different encodings: the generic type definition
5395         class or a generic instance over the GTD arguments.
5396
5397         Fixes #496175.
5398
5399 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5400
5401         * verify.c (dump_stack_value): Fix compilation with extra debug turned on.
5402
5403         * verify.c (do_initobj): Improve error message.
5404
5405 2009-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
5406
5407         * metadata-verify.c: Enable pe verification as the issue with #496453
5408         is that the authenticode data directory have a different unspecified
5409         format. Ignore it for now.
5410
5411         * pedump.c: Run the metadata verifier together with the IL verifier.
5412
5413         Fixes ##496453.
5414
5415 2009-04-20  Rolf Bjarne Kvinge  <RKvinge@novell.com>
5416
5417         * metadata-verify.c: Temporarily disable pe verification due to #496453.
5418
5419 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5420
5421         * class.c (can_access_type): Check visibility against
5422         the element type for pointers and arrays.
5423
5424         Fixes #496150.
5425
5426 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5427
5428         * metadata-verify.c: Fix cli and table verification to use information
5429         from the MonoImage. A lot of duplicated code got killed.
5430
5431 2009-04-17 Rodrigo Kumpera  <rkumpera@novell.com>
5432
5433
5434         This patch starts to integrate the metadata verifier with the runtime code.
5435
5436         This patch causes major regression in functionality for the metadata verifier
5437         as cli and table verification are disabled since they require to be ported to
5438         use MonoImage information.
5439
5440         * image.c (do_mono_image_load): Split the code in this function
5441         into mono_image_load_pe_data and mono_image_load_cli_data.
5442         Add     care_about_pecoff parameter to not load pecoff data.
5443         Call into the metadata verifier for pecoff and cli verification.
5444
5445         * image.c (mono_image_open_raw): New function that doesn't perform
5446         any parsing of the image contents.
5447         
5448         The reason for the 3 new functions is to give pedump better control
5449         into the interaction with the verifier.
5450
5451         * metadata-internals.h: Add new functions from image.c as part of the
5452         internal mono API.
5453
5454         * metadata-verify.c: Split mono_image_verify into mono_verifier_verify_pe_data,
5455         mono_verifier_verify_cli_data and mono_verifier_verify_table_data. Prepare
5456         to make those functions work together with the runtime.
5457
5458         * verify.c: Add mono_verifier_is_enabled_for_image function that returns
5459         true if the image needs to be verified.
5460
5461         * verify-internals.h: Export new functions from metadata-verify.c and verify.c.
5462
5463         * pedump.c: Use new metadata verifier API.
5464
5465 2009-04-19  Zoltan Varga  <vargaz@gmail.com>
5466
5467         * object.c (mono_install_vtable_trampoline): Make this receive a
5468         trampoline creation function instead of trampoline, allowing the JIT
5469         to use a different trampoline for each vtable.
5470
5471 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5472
5473         * object.c (mono_raise_exception): Don't reset the thread abort
5474         exception state here.
5475
5476 2009-04-18  Mark Probst  <mark.probst@gmail.com>
5477
5478         * icall-def.h: New icall for getting the thread abort exception
5479         state for a thread.
5480
5481         * object.c, thread.c, object-internals.h: A thread's abort
5482         exception state is now a GC handle.  To get the object it stands
5483         for, we must move it into the current app domain, if it's
5484         different than the one where it originated from.
5485
5486         * appdomain.c: Bump corlib version.
5487
5488         * domain.c, domain-internals.h: New function for setting the
5489         domain and migrate the thread abort exception or not.
5490
5491 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5492
5493         * metadata-verify.c: Add initial verification of the
5494         field table.
5495
5496 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5497
5498         * metadata-verify.c: Add a macro to conditionally enable
5499         dumping of verification information. Add  make_coded_token
5500         and search_sorted_table to enable search sorted tables
5501         by a given coded token.
5502
5503 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5504
5505         * metadata-verify.c: Add array mapping from table index
5506         to description offset. Add get_col_offset and get_col_size
5507         functions.
5508
5509 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5510
5511         * metadata-verify.c: Add remaining table descriptions offsets.
5512         Add remaining coded index descriptions.
5513
5514 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5515
5516         * metadata-verify.c: Fixed constant table description.
5517         Fixed calculation of HasCustomAttribute coded index size.
5518         Fixed calculation of size for many table indexes. 
5519
5520 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5521
5522         * pedump.c (dump_metadata): Dump table offset instead
5523         of useless pointer in memory.
5524
5525 2009-04-16 Rodrigo Kumpera  <rkumpera@novell.com>
5526
5527         * metadata-verify.c (verify_typedef_table): Add tests for MethodList.
5528
5529 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5530
5531         * metadata-verify.c (verify_typedef_table): Add tests for FieldList and
5532         a missing of for interface types.
5533
5534 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5535
5536         * metadata-verify.c (verify_pe_optional_header): Add comment of why
5537         the code is commented.
5538
5539         * metadata-verify.c (verify_resources_table): Remove spurious printf
5540         and don't fail if there are unmanaged resources. Gmcs generates a useless
5541         one     for all assemblies - I bet it's some MS compatibility junk.
5542
5543 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5544
5545         * metadata-verify.c (verify_typedef_table): Verify the extends field.
5546
5547         * metadata-verify.c (mono_image_verify): Add a is_corlib.
5548
5549         * verify-internals.h: Same.
5550
5551         * pedump.c: Fix for mono_image_verify new signature.
5552
5553 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5554
5555         * metadata-verify.c (verify_typedef_table): Verify for some invalid
5556         flags combinations.
5557
5558 2009-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
5559
5560         * metadata-verify.c (verify_module_table): Ignore the generation field.
5561
5562 2009-04-15  Martin Baulig  <martin@ximian.com>
5563
5564         * debug-mono-symfile.c
5565         (mono_debug_symfile_lookup_location): Don't print a warning for
5566         unknown extended opcodes if they're within 0x40 and 0x7f.
5567
5568 2009-04-15  Zoltan Varga  <vargaz@gmail.com>
5569
5570         * marshal.c (mono_marshal_get_runtime_invoke_sig): Don't share runtime
5571         invoke signatures returning an enum. Fixes #494847.
5572
5573 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5574
5575         * metadata-verify.c: Initial code to verify the typedef table.
5576
5577 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5578
5579         * verify.c (mono_method_verify): Don't fail if an unconditional branch
5580         with non empty stack happens before the beginning of a try block.
5581
5582         Fixes #494812.
5583
5584 2009-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
5585
5586         * metadata-verify.c: Verify typename and typenamespace fields of
5587         the typeref table.
5588
5589 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5590
5591         * metadata-verify.c: Initial code to verify the typeref table.
5592
5593 2009-04-13 Rodrigo Kumpera  <rkumpera@novell.com>
5594
5595         * verify.c (verify_delegate_compatibility): Fix error message.
5596
5597 2009-04-14  Sebastien Pouliot  <sebastien@ximian.com>
5598
5599         * security-core-clr.c: Fix typo
5600
5601 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5602
5603         * marshal.c (delegate_hash_table_add): Make delegate_target_locations 
5604         a MonoGHashTable to keep its values alive.
5605         (emit_marshal_boolean): Fix a warning.
5606
5607 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5608
5609         * socket-io.c: don't return IPv4/IPv6 addresses if the machine does
5610         not have any interface configured for IPv4/IPv6.
5611
5612 2009-04-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
5613
5614         * assembly.c: fix typo in error message.
5615
5616 2009-04-14  Zoltan Varga  <vargaz@gmail.com>
5617
5618         * marshal.c (mono_delegate_to_ftnptr): Use mono_gc_alloc_fixed () for
5619         allocating the location holding the this argument to prevent
5620         'too many root sets' errors.
5621
5622         * object.c (mono_class_create_runtime_vtable): Set field->offset to -1
5623         to mark fields as special static.
5624         (mono_field_static_get_value): Handle special static fields.
5625         (mono_field_static_set_value): Ditto.
5626
5627         * class-internals.h (struct _MonoClassField): Document this.
5628
5629 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5630
5631         * cominterop.c (mono_cominterop_emit_marshal_com_interface): Assigning
5632           the argument a value of null for the MARSHAL_ACTION_MANAGED_CONV_OUT
5633           case.  This will handle when managed code returns null to native code.
5634
5635         Code is contributed under MIT/X11 license.
5636
5637 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5638
5639         * object.c (build_imt_slots): Changing a free to a g_free to match
5640           the g_malloc0 in add_imt_builder_entry that allocated this memory.
5641
5642         Code is contributed under MIT/X11 license.
5643
5644 2009-04-13  Bill Holmes  <billholmes54@gmail.com>
5645
5646         * marshal.c (emit_marshal_boolean): Adding code to ensure that
5647           the correct TRUE value is passed through the marshaling layer.
5648
5649         Code is contributed under MIT/X11 license.
5650
5651 2009-04-13  Zoltan Varga  <vargaz@gmail.com>
5652
5653         * marshal.c (mono_marshal_emit_managed_wrapper): Handle closed delegates
5654         correctly. Fixes #492330.
5655         
5656         * marshal.c: Fix the embedding of object pointers into JITted code in
5657         the native-to-managed wrappers by allocating some GC tracked memory, and
5658         embedding the address of that.
5659
5660 2009-04-11  Zoltan Varga  <vargaz@gmail.com>
5661
5662         * object.c (mono_class_create_runtime_vtable): Avoid putting MonoMethod
5663         pointers into the vtable.
5664
5665 2009-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
5666
5667         * verify.c (mono_delegate_type_equal): Proper check MONO_TYPE_CLASS.
5668
5669         * verify.c (verify_ldftn_delegate): Improve error message.
5670
5671 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5672
5673         * reflection.c (my_mono_class_from_mono_type): Remove.
5674
5675 2009-04-09  Raja R Harinath  <harinath@hurrynot.org>
5676
5677         Prepare to reduce memory usage of owner-less generic parameters (1/n)
5678         * class-internals.h (MonoGenericParam): Carve out pklass, name, flags
5679         and constraints fields into ...
5680         (MonoGenericParamInfo): ... this.
5681         (mono_generic_param_info, mono_generic_container_get_param_info):
5682         New accessors.
5683         * class.c, debug-helpers.c, icall.c: Update to changes.
5684         * metadata.c, reflection.c, verify.c: Likewise.
5685
5686 2009-04-09  Zoltan Varga  <vargaz@gmail.com>
5687
5688         * debug-helpers.c (dis_one): Fix decoding of strings in dynamic images.
5689
5690         * marshal.c (get_runtime_invoke_type): Share enums with their base types.
5691         
5692         * marshal.c (get_runtime_invoke_type): Share pointers with ints and
5693         booleans with sbytes.
5694
5695 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5696
5697         * class.c (can_access_instantiation): Verify accesibility of element types
5698         for arrays and pointers.
5699
5700         * class.c (can_access_type): Return true if the target class is VAR or MVAR.
5701
5702         * class.c (mono_method_can_access_method_full): Fix typos in the documentation.
5703
5704         Fixes #493068.
5705
5706 2009-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
5707
5708         * verify.c (do_invoke_method): Improve error messages.
5709
5710 2009-04-08  Bill Holmes  <billholmes54@gmail.com>
5711
5712         * verify.c:  Fixing the MSVC build.
5713
5714         Code is contributed under MIT/X11 license.
5715
5716 2009-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5717
5718         * security-core-clr.c: Simplify get_reflection_caller not to call
5719         mono_method_get_last_managed (another stack walk) and adjust the
5720         callers to handle a (should not happen) NULL return value.
5721
5722 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5723
5724         Add accessors to some MonoGenericParam fields
5725         * class-internals.h (mono_generic_param_owner): New accessor.
5726         (mono_generic_param_num): Likewise.
5727         (mono_type_get_generic_param_owner): New helper.
5728         (mono_type_get_generic_param_num): New helper.
5729         * class.c, icall.c, metadata.c, reflection.c, verify.c: Use them.
5730
5731 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5732
5733         * class-internals.h (mono_generic_container_get_param): New wrapper.
5734         * class.c, icall.c, metadata.c, verify.c: Use it.
5735
5736 2009-04-08  Raja R Harinath  <harinath@hurrynot.org>
5737
5738         Fix gtest-252.cs
5739         * verify.c (mono_type_is_valid_type_in_context): Rewrite to use
5740         the standard case/loop.  In particular, don't complain about
5741         references to generic type definitions.
5742
5743 2009-04-07  Zoltan Varga  <vargaz@gmail.com>
5744
5745         * debug-helpers.c (dis_one): Decode string arguments.
5746
5747 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5748
5749         * pedump.c (dump_verify_info): Dump type name correctly.
5750
5751 2009-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
5752
5753         * verify.c (mono_method_verify): Don't init code slots for exception boundaries if they
5754         are larger than code size.
5755
5756         This can happen in valid code if the try/catch block is not followed by any instruction
5757         and do a backward branch on the leave instruction.
5758
5759         Fixes #492494.
5760
5761 2009-04-06  Sebastien Pouliot  <sebastien@ximian.com>
5762
5763         * security-core-clr.c: Fix typo while comparing second method names
5764         in can_avoid_corlib_reflection_delegate_optimization
5765
5766 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5767
5768         * verify.c (do_throw): Don't allow an unboxed generic param ar argument.
5769
5770         Fixes #487738.
5771
5772 2009-04-06 Rodrigo Kumpera  <rkumpera@novell.com>
5773
5774         * metadata.c (do_mono_metadata_parse_type): Fail if we are decoding
5775         a MVAR using a class context.
5776
5777         Fixes #490335.
5778
5779 2009-04-06  Zoltan Varga  <vargaz@gmail.com>
5780
5781         * object.c (mono_class_compute_gc_descriptor): Make this non-static.
5782
5783         * domain-internals.h (struct _MonoJitInfo): Add a 'gc_info' field.
5784
5785         * gc-internal.h (MonoGCCallbacks): New stucture containing the callback
5786         functions supplied by the JIT for the SGEN GC.
5787
5788         * sgen-gc.c: Call the callbacks supplied by the JIT to do stack marking.
5789         
5790 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5791
5792         monitor.c (mono_monitor_try_enter_internal):
5793         Added calls to profile monitor contentions.
5794         Also duplicated a small piece of code (the "get the monitor" logic)
5795         from the fast path to the slow path, and changed the relevant goto
5796         statements, so that monitor acquisition events can be emitted from the
5797         slow path (this is by Paolo Molaro).
5798
5799 2009-04-06  Massimiliano Mantione  <massi@ximian.com>
5800
5801         * profiler.c, profiler.h, profiler-private.h:
5802         Added support for profiling monitor contentions.
5803
5804 2009-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
5805
5806         * metadata-verify.c: Verify the modules table.
5807
5808 2009-04-02 Rodrigo Kumpera  <rkumpera@novell.com>
5809
5810         * verify.c (mono_generic_param_is_constraint_compatible): Inflate the candidate
5811         using the context of the method been verifier and not of the method been called.
5812
5813         * verify.c: Add verifier_inflate_type and mono_type_is_valid_type_in_context to
5814         safely inflate generic types. 
5815
5816 2009-04-02  Sebastien Pouliot  <sebastien@ximian.com>
5817
5818         * security-core-clr.c: Change the strategy for checking the 
5819         "reflection using delegates optimization" to avoid unneeded 
5820         attributes in multiple class libraries.
5821
5822 2009-04-02  Mark Probst  <mark.probst@gmail.com>
5823
5824         * sgen-gc.c: Remove object element in the disappearing link struct
5825         by storing the object pointer in the link.
5826
5827 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5828
5829         * pedump.c (dump_verify_info): Don't crash if signature decoding fails.
5830
5831 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5832
5833         * verify.c (verifier_load_field): Fail if the field parent could not be loaded.
5834
5835         * verify.c (mono_method_verify): Do proper bounds checking of exception
5836         clause ranges.
5837
5838 2009-03-31 Rodrigo Kumpera  <rkumpera@novell.com>
5839
5840         * loader.c (mono_field_from_token): Don't crash if the field parent could
5841         not be decoded.
5842
5843 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5844
5845         * sgen-gc.c: Execute critical finalizers after ordinary
5846         finalizers.
5847
5848         * class-internals.h, domain.c: Add CriticalFinalizerObject to
5849         mono_defaults.
5850
5851 2009-03-31 Jb Evain <jbevain@novell.com>
5852
5853         * verify.c (do_ldstr): don't check if a string is in the user strings
5854         heap if the current image is dynamic.
5855
5856 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5857
5858         * sgen-gc.c: Wait until the last finalizer has executed when
5859         returning from WaitForPendingFinalizers.
5860
5861 2009-03-31  Martin Baulig  <martin@ximian.com>
5862
5863         * mono-debug-debugger.h (MonoDebuggerEvent): Add
5864         `MONO_DEBUGGER_EVENT_CREATE_APPDOMAIN' and
5865         `MONO_DEBUGGER_EVENT_UNLOAD_APPDOMAIN'.
5866         (mono_debugger_event_create_appdomain): New function.
5867         (mono_debugger_event_unload_appdomain): New function.
5868
5869         * appdomain.c (mono_domain_create_appdomain_internal): Call
5870         mono_debugger_event_create_appdomain().
5871
5872 2009-03-31  Martin Baulig  <martin@ximian.com>
5873
5874         * mono-debug-debugger.c
5875         (mono_debugger_register_class_init_callback): Also register the
5876         class init callback if the class is already initialized to make
5877         things work with shadow copied assemblies.
5878
5879 2009-03-31  Sebastien Pouliot  <sebastien@ximian.com>
5880
5881         * security-core-clr.c
5882         (mono_security_core_clr_ensure_reflection_access_field): Let 
5883         critical code access the field (just like we do for methods). Use
5884         check_field_access helper.
5885         (mono_security_core_clr_ensure_reflection_access_method): Use 
5886         check_field_access helper.
5887
5888 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5889
5890         * sgen-gc.c: Remove data (callback) element from FinalizeEntry and
5891         call the run-finalize function directly.
5892
5893         * gc.c, gc-internal.h: Make run_finalize() non-static.
5894
5895 2009-03-31  Mark Probst  <mark.probst@gmail.com>
5896
5897         * sgen-gc.c: Use a separate struct for disappearing links.
5898
5899 2009-03-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
5900
5901         * socket-io.c: don't fail if the SocketOptionsFlag has Partial or
5902         * MaxIOVectorLength enabled, just ignore them.
5903         Fixes bug #349688.
5904
5905 2009-03-30 Rodrigo Kumpera  <rkumpera@novell.com>
5906
5907         * metadata-verify.c: Fix eglib build.
5908
5909 2009-03-30  Zoltan Varga  <vargaz@gmail.com>
5910
5911         * threads-types.h: Fix the win32 build.
5912
5913 2009-03-28  Sebastien Pouliot  <sebastien@ximian.com>
5914
5915         * class.c: move coreclr inheritance/override checks to 
5916         security-core.clr.c
5917         * security-core.clr.c|h: add code from class.c with additional
5918         documentation. Fix override check when the method is not critical.
5919
5920 2009-03-28  Zoltan Varga  <vargaz@gmail.com>
5921
5922         * debug-helpers.c (mono_method_desc_match): Make '*' match anything.
5923         (match_class): Ditto.
5924
5925 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5926
5927         * metadata-verify.c: Rename bounds_check_offset to bounds_check_datadir.
5928
5929         * metadata-verify.c: Implement table layout row size calculation. Verify
5930         the total size of the tables.
5931
5932 2009-03-27 Rodrigo Kumpera  <rkumpera@novell.com>
5933
5934         * metadata-verify.c: Verify heap sizes and size to decode row counts. 
5935
5936 2009-03-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
5937
5938         * appdomain.c:
5939         * console-io.[ch]: added new mono_console_init() to make sure that
5940         file descriptors 0, 1 and 2 are opened.
5941         Bug #489019 fixed.
5942
5943 2009-03-27  Sebastien Pouliot  <sebastien@ximian.com> 
5944
5945         * appdomain.h: Export a new callback type and a new function to
5946         set this callback. This allow a mono host to provide it's own
5947         definition for "platform code".
5948         * metadata-internals.h: Add a core_clr_platform_code flag on 
5949         _MonoImage to (cache and) know if it is representing platform 
5950         code.
5951         * image.c (do_mono_image_open): Set core_clr_platform_code flag 
5952         on platform code images.
5953         * security-core-clr.c|h 
5954         (mono_security_set_core_clr_platform_callback): Allow the host
5955         to provide it's own platform check definition.
5956         (mono_security_core_clr_determine_platform_image): Detect if an 
5957         image is platform code (using the specified callback).
5958         (mono_security_core_clr_is_platform_image): Return cached value 
5959         for platform code.
5960
5961 2009-03-27  Zoltan Varga  <vargaz@gmail.com>
5962
5963         * threads.c (mono_create_thread): New helper function to wrap CreateThread
5964         which has different parameter types for the 'tid' argument in windows and
5965         the io-layer.
5966
5967         * appdomain.c attach.c threads.c: Use the new helper.
5968
5969 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
5970
5971         * metadata-verify.c: Verify valid table bits.
5972
5973 2009-03-26 Rodrigo Kumpera  <rkumpera@novell.com>
5974
5975         * metadata-verify.c (verify_metadata_header): Store size in the size field.
5976
5977         * metadata-verify.c: Add initial table schema verification.
5978
5979 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
5980
5981         * icall.c (ves_icall_get_parameter_info): Add a 'member' argument, used to
5982         obtain the refclass argument needed by mono_param_get_objects (). Fixes
5983         #488383.
5984
5985         * reflection.c (mono_param_get_objects_internal): Add a 'refclass' argument.
5986
5987         * appdomain.c (MONO_CORLIB_VERSION): Bump this.
5988
5989 2009-03-26  Sebastien Pouliot  <sebastien@ximian.com>
5990
5991         * security-core-clr.c: Add/update documentation
5992
5993 2009-03-26  Zoltan Varga  <vargaz@gmail.com>
5994
5995         * marshal.c (emit_marshal_object): Generate code to throw an exception
5996         instead of throwing it. Fixes #488670.
5997
5998 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5999
6000         * appdomain.c: Bump MONO_CORLIB_VERSION to 73.
6001         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Add
6002         an extra 'throwOnBindFailure' parameter to the icall. Remove FIXME
6003         and add a call to mono_security_core_clr_ensure_delegate_creation
6004         to do the extra checks required by CoreCLR.
6005         * security-core-clr.c|h: Add function to check delegate creation,
6006         both in the binding and accessibility, under CoreCLR.
6007
6008 2009-03-25  Sebastien Pouliot  <sebastien@ximian.com> 
6009
6010         * reflection.c (mono_reflection_create_dynamic_method): when 
6011         coreclr is enabled make sure that every resolved object are
6012         checked (e.g. field and method access).
6013         * security-core-clr.c|h: Add function to check objects resolved
6014         when a dynamic method is created.
6015
6016 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
6017
6018         * metadata-verify.c: Cache directory rva translations.
6019
6020         * metadata-verify.c: Add cli-header and streams verification.
6021
6022 2009-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
6023
6024         * image.c (load_metadata_ptrs): We decode MonoImage::md_version_minor at
6025         the wrong offset (8 instead of 6).
6026
6027 2009-03-23  Zoltan Varga  <vargaz@gmail.com>
6028
6029         * marshal.c (mono_delegate_to_ftnptr): For delegates wrapping pinvoke
6030         methods, return the native function address itself. Fixes
6031         #487758.
6032
6033 2009-03-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
6034
6035         * console-io.c: some of the values for control characters might not be
6036         present.
6037
6038 2009-03-21  Sebastien Pouliot  <sebastien@ximian.com>
6039
6040         * exception.c|h: Add helpers to create [Field|Method]AccessException
6041         * icall.c: Add required coreclr check calls for field reflection.
6042         Move the existing (method) check logic into security-core-clr.c
6043         * security-core-clr.c: Add functions to check if the access of a
6044         field or method is allowed when reflecting under coreclr. This is
6045         mostly done using a stack walk to find the "real" caller: i.e. the
6046         code that is calling the reflection
6047
6048 2009-03-20  Zoltan Varga  <vargaz@gmail.com>
6049
6050         * gc-internal.h: Change location of gc_wrapper.h
6051
6052 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com> 
6053
6054         * class.c: Simplification to coreclr checks for overrides that
6055         makes it easier to set breakpoints.
6056
6057 2009-03-20  Sebastien Pouliot  <sebastien@ximian.com>
6058
6059         * security-core-clr.c|h: (mono_security_core_clr_class_level, 
6060         mono_security_core_clr_method_level): Avoid potential 
6061         MonoCustomAttrInfo allocation for transparent assemblies (e.g. 
6062         user/application code) and make it easier to set breakpoints
6063
6064 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6065
6066         * metadata-verify.c: Reject cli header tables that mono don't handle.
6067
6068 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6069
6070         * pedump.c: Fix CLI header dumping.
6071
6072 2009-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
6073
6074         * metadata-verify.c: More CLI header verification.
6075
6076 2009-03-19  Zoltan Varga  <vargaz@gmail.com>
6077
6078         * locales.c (get_current_locale_name): Use g_malloc instead of malloc.
6079
6080 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
6081
6082         * metadata-verify.c: Initial verification of the CLI header.
6083
6084 2009-03-18 Rodrigo Kumpera  <rkumpera@novell.com>
6085
6086         * metadata-verify.c (verify_resources_table): Fix verification of zero
6087         sized resource section and id entries count.
6088
6089 2009-03-18  Zoltan Varga  <vargaz@gmail.com>
6090
6091         * icall.c: Handle user types in many Type icalls. Fixes #486303.
6092
6093 2009-03-17  Jb Evain  <jbevain@novell.com>
6094
6095         * profiler.c: call mono_gc_base_init from mono_profiler_load.
6096
6097 2009-03-17  Zoltan Varga  <vargaz@gmail.com>
6098
6099         * sgen-gc.c (mono_gc_make_descr_for_object): Fix 64 bit support.
6100         (mono_gc_make_descr_for_array): Ditto.
6101
6102 2009-03-17  Sebastien Pouliot  <sebastien@ximian.com>
6103
6104         * verify.c (mono_verifier_is_class_full_trust): Add support for
6105         CoreCLR security mode where trusted assemblies are defined as
6106         "platform code".
6107
6108 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6109
6110         * metadata-verify.c: Add minimal PECOFF resource verification.
6111
6112 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6113
6114         * metadata-verify.c: Be less restrictive with some coff fields.
6115
6116 2009-03-16 Rodrigo Kumpera  <rkumpera@novell.com>
6117
6118         * verify.c (init_stack_with_value_at_exception_boundary): Init generic
6119         params as boxed values on stack. Fixes #485706.
6120
6121 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
6122
6123         * console-io.c: the termios values may vary in different flavors of unix.
6124
6125 2009-03-16 Gonzalo Paniagua Javier <gonzalo@novell.com>
6126
6127         * console-io.[ch]: return the entire set of control characters when
6128         initializing the terminal.
6129         * appdomain.c: bump corlib version.
6130
6131 Mon Mar 16 11:11:26 CET 2009 Paolo Molaro <lupus@ximian.com>
6132
6133         * mono-perfcounters.c: added support for in-process custom
6134         performance counters.
6135
6136 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6137
6138         * metadata-verify.c: Small cleanup and add comment for IAT directory entry. 
6139
6140 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6141
6142         * metadata-verify.c: Verify the data pointed by the import table. 
6143
6144 2009-03-13 Rodrigo Kumpera  <rkumpera@novell.com>
6145
6146         * metadata-verify.c (load_data_directories): Store data
6147         directory contents.
6148
6149         * metadata-verify.c: Verify the import table. 
6150
6151 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6152
6153         * metadata-verify.c: Verify data directories.
6154
6155 2009-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
6156
6157         * metadata-verify.c: Check section header flags.
6158
6159 2009-03-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
6160
6161         * appdomain.c: if the assembly name is a shadow-copied file, return
6162         TRUE from mono_is_shadow_copy_enabled but don't actually do anything
6163         in mono_make_shadow_copy.
6164         * icall.c: if the assembly name is a shadow-copied file, replace it
6165         with the original assembly path.
6166
6167         Bug #484244 fixed. NUnit tests for corlib can be run without
6168         --noshadow now.
6169
6170 2009-03-12  Zoltan Varga  <vargaz@gmail.com>
6171
6172         * sgen-gc.c (add_to_global_remset): Fix the handling of root global remset
6173         entries when the table is reallocated.
6174
6175         * icall.c: Allocate the memory used by the mono_ptr_array macros using
6176         mono_gc_alloc_fixed () since it contains GC refs.
6177
6178 2009-03-10  Zoltan Varga  <vargaz@gmail.com>
6179
6180         * reflection.c (ensure_complete_type): New helper function to call
6181         type resolve handlers for unfinished dynamic types.
6182         (resolve_object): Call it for MonoClassFields. Fixes #483852.
6183
6184 2009-03-09  Zoltan Varga  <vargaz@gmail.com>
6185
6186         * reflection.c (mono_custom_attrs_has_attr): Handle interfaces. Fixes
6187         #483247.
6188
6189 2009-03-08 Rodrigo Kumpera  <rkumpera@novell.com>
6190
6191         * appdomain.c (get_shadow_assembly_location): Fix memleak.
6192
6193 2009-03-08  Zoltan Varga  <vargaz@gmail.com>
6194
6195         * domain-internals.h (struct _MonoDomain): Add new hash tables mapping
6196         between GCHandles of type WeakTrackResurrection and the objects they
6197         point to.
6198
6199         * gc.c: Partly implement the sematics of GCHandles of type 
6200         WeakTrackResurrection: these handles should only be cleared after the
6201         finalizer of the object they are pointing to has ran.
6202
6203 2009-03-06  Mark Probst  <mark.probst@gmail.com>
6204
6205         * icall.c: Partially revert r126631 because using the jump
6206         trampolines for generic shared methods makes it superfluous.
6207
6208 2009-03-06  Zoltan Varga  <vargaz@gmail.com>
6209
6210         * threads.c (handle_store): Create the 'threads' hash table with the proper
6211         MONO_HASH_VALUE_GC type.
6212
6213 2009-03-05  Zoltan Varga  <vargaz@gmail.com>
6214
6215         * domain-internals.h (struct _MonoDomain): Move 'typeof_void' before
6216         FIRST_GC_TRACKED.
6217
6218         * domain.c (mono_domain_create): Register the fields between FIRST_GC_TRACKED
6219         and LAST_GC_TRACKED as a GC root.
6220
6221         * gc-internal.h: Fix the comment of mono_gc_alloc_fixed.
6222
6223         * object.c (mono_class_create_runtime_vtable): Create a GC descriptor for
6224         the static data even if it consists of 1 reference.
6225
6226         * boehm-gc.c (mono_gc_alloc_fixed): Allocate using GC_MALLOC_EXPLICITLY_TYPED
6227         if there is a GC descriptor.
6228
6229         * reflection.c (ALLOC_REFENTRY): Allocate ReflectedEntry-es using malloc
6230         instead of through the GC since they contain no object references.
6231
6232 2009-03-05  Mark Probst  <mark.probst@gmail.com>
6233
6234         * generic-sharing.c (instantiate_other_info): Always return a jump
6235         trampoline for method code.
6236
6237 2009-03-05  Marek Habersack  <mhabersack@novell.com>
6238
6239         * culture-info-tables.h: generated to include the en-tt culture.
6240
6241 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
6242
6243         * domain-internals.h (MonoDomain): Add two fields to cache invoke wrappers to
6244         capture the thread context.
6245
6246         * object.c (mono_async_result_new): Cache the invoke wrappers to
6247         ExecutionContext::Capture.
6248
6249 2009-03-04 Rodrigo Kumpera  <rkumpera@novell.com>
6250
6251         * marshal.h: Add a prototype for what mono_compile_method returns
6252         for invoke wrappers.
6253
6254         * gc.c: Use the new prototype declaration.
6255
6256 2009-03-04  Geoff Norton  <gnorton@novell.com>
6257
6258         * boehm-gc.c: Add some MONO_LOG tracing for the GC
6259         * gc-internal.h:
6260         * mono-gc.h: Expose mono_gc_invoke_finalizers in the embedding api.
6261
6262 2009-03-04  Martin Baulig  <martin@ximian.com>
6263
6264         * mono-debug.h
6265         (mono_debugger_runtime_invoke): Removed.
6266
6267         * mono-debug-debugger.c
6268         (mono_runtime_invoke): Moved into ../mini/debug-mini.c.
6269
6270 2009-03-02  Martin Baulig  <martin@ximian.com>
6271
6272         * mono-debug.h
6273         (mono_debugger_unhandled_exception): Removed.
6274         (mono_debugger_handle_exception): Removed.
6275         (mono_debugger_throw_exception): Removed.
6276
6277         * mono-debug.c
6278         (mono_debug_debugger_version): Bump to 5.
6279
6280         * mono-debug-debugger.c: Moved the exception handling code to
6281         ../mini/debug-mini.c
6282
6283 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6284
6285         * domain-internals.h (struct _MonoDomain): Add a separate lock for the
6286         finalize_objects_hash.
6287
6288         * gc.c: Use the separate lock to access the finalize_objects_hash field.
6289         
6290         * domain-internals.h (struct _MonoDomain): Add finalize_runtime_invoke
6291         field.
6292
6293         * metadata-internals.h (struct _MonoImage): Add runtime_invoke_vcall_cache
6294         cache.
6295
6296         * image.c (mono_image_close): Free it.
6297         
6298         * marshal.c (mono_marshal_get_runtime_invoke): Add a 'virtual' argument
6299         allowing a creation of a wrapper which invokes its method using a CALLVIRT
6300         on the this argument.
6301
6302         * gc.c (run_finalize): Optimize the calling of the finalizers.
6303
6304 2009-03-03  Martin Baulig  <martin@ximian.com>
6305
6306         * mono-debug.h (MONO_DEBUGGER_MAJOR_VERSION): Bump to 81 because
6307         of the `MonoGenericInst' changes.
6308
6309 2009-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
6310
6311         * icall.c (ves_icall_MonoType_GetGenericArguments): Use
6312         mono_array_class_get_cached to reduce locking contention. Extract
6313         a domain var.
6314
6315         * icall.c (ves_icall_Type_GetFields_internal): Avoid allocating
6316         intermediary managed arrays. Use caching version of mono_array_new
6317         to allocate the result array.
6318
6319         * icall.c (ves_icall_Type_GetEvents_internal): Same.    
6320
6321         * icall.c (ves_icall_Type_GetNestedTypes): Same.        
6322
6323         * locales.c (create_names_array_idx):  Use mono_array_new_cached
6324         to reduce locking contention.
6325
6326 2009-03-03  Zoltan Varga  <vargaz@gmail.com>
6327                 
6328         * object.c (mono_method_add_generic_virtual_invocation): Put back the
6329         thunk builder code for the non-interface case.
6330
6331 2009-03-02  Zoltan Varga  <vargaz@gmail.com>
6332
6333         * object.c (get_generic_virtual_entries): New helper function to collect
6334         the virtual generic method instances which need to be added to an IMT
6335         thunk.
6336         (mono_method_add_generic_virtual_invocation): Add a 'vtable' argument.
6337         Instead of creating a new IMT thunk, reset the vtable slot to the
6338         trampoline, the thunk will be created the next time the trampoline is called.
6339         (build_imt_slots): Add support for virtual generic methods in interfaces by
6340         adding to the IMT thunk all the methods registered using 
6341         mono_method_add_generic_virtual_invocation ().
6342
6343         * object-internals.h (_MonoImtBuilderEntry): Add a 'has_target_code' field.
6344         (struct _MonoIMTCheckItem): Ditto.
6345
6346         * object.c (mono_method_add_generic_virtual_invocation): Take a
6347         MonoMethod argument instead of a MonoGenericInst. Fix the construction of
6348         the IMT thunk to include all items.
6349         
6350         * object.c (mono_class_create_runtime_vtable): Add a missing
6351         mono_loader_unlock ().
6352
6353 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6354
6355         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6356
6357         * object-internals.h (MonoReflectionEvent): Add cached_add_event.
6358
6359 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6360
6361         * object-internals.h: Rename _MonoReflectionEvent to
6362         MonoReflectionMonoEvent so it reflects the right managed type.
6363         Add a MonoReflectionEvent that correctly represents System.EventInfo.
6364
6365         * icall.c:
6366         * reflection.c: Adjust code to use the new MonoReflectionMonoEvent
6367         type.
6368
6369 2009-03-02 Rodrigo Kumpera  <rkumpera@novell.com>
6370
6371         * icall.c (ves_icall_Type_GetMethodsByName): Avoid allocating
6372         intermediary managed arrays. Use caching version of mono_array_new
6373         to allocate the result array.
6374
6375 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6376
6377         * reflection.c: Use cached version of mono_array_new alongside
6378         the mono_reflection_get_custom_attrs_by_type call path.
6379
6380 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6381
6382         * icall.c (ves_icall_Type_GetInterfaces): Avoid allocating
6383         intermediary managed arrays. Use caching version of mono_array_new
6384         to allocate the result array.
6385
6386         * icall.c (ves_icall_Type_GetConstructors_internal): Same.
6387
6388 2009-03-01 Rodrigo Kumpera  <rkumpera@novell.com>
6389
6390         * icall.c: Add small implementation of a growable stack bound array.
6391
6392         * icall.c (ves_icall_System_Enum_get_hashcode): Fix warning.
6393
6394         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid allocating
6395         intermediary managed arrays. Use caching version of mono_array_new
6396         to allocate the result array.
6397
6398 2009-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
6399
6400         * icall.c: New icall ves_icall_System_Enum_compare_value_to that
6401         helps Enum::CompareTo to be implemented without reboxing all enums
6402         to their underlying type.
6403 2009-02-27  Zoltan Varga  <vargaz@gmail.com>
6404
6405         * domain.c (SET_APPDOMAIN): Avoid calling TlsSetValue () on some platforms,
6406         since it acquires a global lock leading to scalability problems.
6407
6408         * profiler.c: Make the stat profiler work with multiple appdomains, this
6409         currently only works when no appdomains are unloaded.
6410
6411 2009-02-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
6412
6413         * appdomain.c: make the check to avoid copying when the assembly is
6414         already shadow copied actually work.
6415
6416 2009-02-26  Zoltan Varga  <vargaz@gmail.com>
6417
6418         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
6419
6420         * object-internals.h (struct _MonoReflectionGenericClass): Sync with
6421         changes to the managed side.
6422
6423 2009-02-25  Zoltan Varga  <vargaz@gmail.com>
6424
6425         * metadata-internals.h (struct _MonoImage): Add a new cache for szarray
6426         classes + a separate lock for it, as it is used frequently at runtime, not
6427         just during metadata loading/JIT compilation.
6428
6429         * class.c (mono_bounded_array_class_get): Use the separate cache + lock
6430         for szarrays.
6431         
6432         * object-internals.h (mono_class_from_name_cached): New macro to cache
6433         the results of the lookup locally without having to declare a static
6434         variable to hold it.
6435         (mono_class_get_field_from_name_cached): Ditto.
6436         (mono_array_class_get_cached): Ditto.
6437
6438         * threadpool.c threads.c locales.c icall.c reflection.c socket-io.c: Use
6439         the new macros.
6440         
6441         * object.c (mono_get_delegate_invoke): Call setup_methods () to avoid the
6442         slower search in metadata.
6443
6444         * pedump.c: Fix a warning.
6445
6446 2009-02-23  Zoltan Varga  <vargaz@gmail.com>
6447
6448         * reflection.c (encode_locals): Add checks for user types.
6449         (method_encode_clauses): Ditto.
6450         (method_encode_code): Ditto.
6451         (mono_image_create_token): Ditto.
6452
6453         * object-internals.h: Change the type of more fields from MonoReflectionType*
6454         to MonoObject*.
6455
6456 2009-02-22  Zoltan Varga  <vargaz@gmail.com>
6457
6458         * threads.c (mono_thread_suspend_all_other_threads): Handle the case when
6459         the a thread does not suspend within 100ms.
6460
6461         * monitor.c (mono_monitor_try_enter_internal): Handle SuspendRequested
6462         in addition to StopRequested as well.
6463
6464         * mono-debug.c: Call _mono_debug_get_image () while holding the debug lock.
6465
6466         * debug-mono-symfile.c (mono_debug_symfile_lookup_method): Actually
6467         search the method_hash before inserting a new entry, to avoid crashes when
6468         the same method is inserted multiple times, causing the old 
6469         MonoDebugMethodInfo structure to be freed by the value dtor function.
6470
6471 2009-02-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
6472
6473         * socket-io.c: support SO_MAXCONN, SO_USELOOPBACK and
6474         SO_EXLUSIVEADDRUSE where available.
6475
6476 2009-02-21  Zoltan Varga  <vargaz@gmail.com>
6477
6478         * marshal.c (mono_marshal_get_runtime_invoke): Fix _another_ bug sharing
6479         runtime invoke wrappers, this time it is string ctor wrappers, which
6480         pass a dummy string as 'this' instead of their obj argument. Fixes
6481         #478473.
6482
6483 2009-02-21  Jb Evain  <jbevain@novell.com>
6484
6485         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
6486         only get create_culture once.
6487
6488 2009-02-20  Zoltan Varga  <vargaz@gmail.com>
6489
6490         * reflection.c (mono_reflection_setup_internal_class): Move the user type
6491         check before the locking.
6492         
6493         * reflection.c (mono_reflection_setup_internal_class): Check for user types.
6494         (mono_reflection_create_runtime_class): Ditto.
6495         (mono_reflection_sighelper_get_signature_local): Ditto.
6496         (mono_reflection_sighelper_get_signature_field): Ditto.
6497
6498         * object-internals.h (CHECK_MONOTYPE): New macro to check that a Type object
6499         is a System.MonoType object or similar.
6500         (monotype_cast): New helper function to cast a MonoObject to a 
6501         MonoReflectionType object.
6502
6503         * object-internals.h: Change MonoReflectionType* members in structures to
6504         MonoObject* members to force the usage of the monotype_cast () function.
6505
6506         * reflection.c icall.c: Use monotype_cast () for accessing Type members of
6507         structures/arrays. This causes us to assert instead of crashing when 
6508         instances of user defined subclasses of System.Type are encountered.
6509
6510 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6511
6512         * cil-coff.h:
6513         * icall-def.h:
6514         * icall.c: add new GetUnmanagedResourcePtr that returns a pointer to a
6515         win32 resource loaded from a PE file.
6516
6517         * image.c: fix mono_image_lookup_resource.
6518
6519 2009-02-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
6520
6521         * icall-def.h:
6522         * threads-types.h:
6523         * threads.c: added internal call for WaitHandle.SignalAndWait.
6524
6525 2009-02-19  Bill Holmes  <billholmes54@gmail.com>
6526
6527         * cominterop.c : Adding cominterop_type_from_handle and 
6528           registering it as an icall.  Replacing all references
6529           to type_from_handle.
6530
6531         Code is contributed under MIT/X11 license.
6532
6533 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6534
6535         * Makefile.am: Add lock-tracer.h and lock-trace.c.
6536
6537         * appdomain.c: Call the tracer init function.
6538
6539         * domain-internals.h: Enable the tracer for the domain locks.
6540
6541         * image.c: Enable the tracer for image locks.
6542
6543         * loader.c: Enable the trace for the loader lock.
6544
6545         * lock-tracer.h:
6546         * lock-tracer.c: Initial implementation of the lock trace utility.
6547         The tracer requires a compile time define to be enabled and a env var
6548         to be enabled at runtime.
6549
6550 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6551
6552         * domain.c (mono_domain_code_foreach): Improve documentation.
6553
6554 2009-02-19 Rodrigo Kumpera  <rkumpera@novell.com>
6555
6556         * appdomain.c:
6557         * generic-sharing.c:
6558         * object.c:
6559         * reflection.c:  Adjust locking order to the new semantics where the loader lock
6560         comes first.
6561
6562 2009-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
6563
6564         * domain.c: Add mono_domain_code_* functions that perform locking
6565         around the domain codeman.
6566
6567         * domain-internals.h: Export those functions.
6568
6569         * object.c: Use new functions instead of acquiring the domain lock.
6570
6571 2009-02-19  Zoltan Varga  <vargaz@gmail.com>
6572
6573         * marshal.c (mono_ftnptr_to_delegate): Convert a NULL ftnptr to a null
6574         delegate. Fixes #477396.
6575
6576 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6577
6578         * reflection.c (create_custom_attr): Get rid of alloca.
6579
6580 2009-02-18  Bill Holmes  <billholmes54@gmail.com>
6581
6582         * cominterop.c (cominterop_get_managed_wrapper_adjusted) :
6583           Adding exception handling for all CCW calls.
6584
6585         Code is contributed under MIT/X11 license.
6586
6587 2009-02-18  Zoltan Varga  <vargaz@gmail.com>
6588
6589         * reflection.c (mono_reflection_init): Remove the unused reflection mutex.
6590
6591         * marshal.c (emit_marshal_boolean): Add null checks to the new 
6592         native->managed marshalling code. Fixes #476247.
6593
6594 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6595
6596         * class.c (mono_class_get_vtable_entry): Move the addition of
6597         static rgctx invoke wrappers for vtable methods here, this simplifies
6598         a lot of code and causes fewer rgctx wrappers to be created.
6599
6600         * marshal.c (mono_marshal_get_static_rgctx_invoke): Change the
6601         name of the statistics to begin with an uppercase.
6602
6603 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6604
6605         * reflection.c: Revert previous change as it breaks the build.
6606         
6607 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6608
6609         * verify.c: Properly handle SZARRAY element type.
6610
6611         Fixes #474271.
6612
6613 2009-02-17 Rodrigo Kumpera  <rkumpera@novell.com>
6614
6615         * reflection.c (mono_image_create_method_token): Correctly encode
6616         MethodDef MemberRefParent token.
6617
6618         Fixes #472845.
6619
6620 2009-02-17  Zoltan Varga  <vargaz@gmail.com>
6621
6622         * image.c (mono_image_close): Delete the critical section before
6623         freeing the memory holding it.
6624
6625 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6626
6627         * verify.c (mono_method_verify): rethrow opcode doesn not fall through.
6628         Fixes #476257.
6629
6630 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6631
6632         * pedump.c (main): Call mono_marshal_init so pedump
6633         doesn't crash.
6634
6635 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6636
6637         * loader.c (method_from_memberref): Properly fix #474271 and
6638         don't break the runtime bad.
6639
6640 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6641
6642         * domain.c (mono_domain_alloc): Add locking so the caller doesn't have to.
6643         (mono_domain_alloc0): Ditto.
6644
6645 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6646
6647         * loader.c (method_from_memberref): Don't abort if the array
6648         method is not found. A regular loader failure is more informative
6649         and correct.
6650
6651         Fixes #474271.
6652
6653 2009-02-16 Rodrigo Kumpera  <rkumpera@novell.com>
6654
6655         *loader.c: Guard MonoImage::method_cache/methodref_cache
6656         using the image lock instead of the loader lock.
6657
6658         * metadata.h: Add comments about which fields are protected by
6659         the image lock.
6660
6661 2009-02-16  Zoltan Varga  <vargaz@gmail.com>
6662
6663         * appdomain.c (mono_set_private_bin_path_from_config): Fix a warning.
6664
6665         * generic-sharing.c (mono_method_construct_object_context): Remove the
6666         wrapper_type == NONE assert, it is not needed.
6667
6668 2009-02-15  Zoltan Varga  <vargaz@gmail.com>
6669
6670         * reflection.c (clear_cached_object): New helper function.
6671         (mono_method_clear_object): New function to clear the cached reflection
6672         objects for a dynamic method.
6673
6674         * object.c (mono_runtime_free_method): Call mono_method_clear_object ().
6675         Partly fixes # 463323.
6676         
6677 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6678
6679         * class.c:
6680         * loader.c:
6681         * reflection.c: Remove all explicit uses of MonoImage::property_hash.
6682
6683 2009-02-14 Rodrigo Kumpera  <rkumpera@novell.com>
6684
6685         * image.c: Add mono_image_property_(lookup,insert,remove) functions that
6686         take the image lock instead of the loader lock.
6687
6688         * metadata-internals.h: Export new functions.
6689
6690 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6691
6692         * domain.c (app_config_parse): Remove another use of stat that is
6693         not necessary as g_file_get_contents already does the presence
6694         check. 
6695
6696 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6697
6698         * cominterop.c icall-def.h: Fix the DISABLE_COM build.
6699
6700         * marshal.c: Move the bstr handling code to cominterop.c.
6701
6702         * marshal.c: Remove some COM interop code missed previously.
6703
6704 2009-02-12  Miguel de Icaza  <miguel@novell.com>
6705
6706         More Paolo patches from the Wii port:
6707         
6708         * security.c: Remove ves_icall_System_Environment_get_UserName
6709         from here.
6710
6711         * icall.c: And put ves_icall_System_Environment_get_UserName
6712         here. 
6713
6714         * appdomain.c (mono_set_private_bin_path_from_config): Remove
6715         redundant call to stat that was only used to test for the file
6716         existence.   Patch from Paolo.
6717
6718         * gc.c (run_finalize): If COM is disabled, do not link in
6719         mono_marshal_free_ccw.
6720
6721         * generic-sharing.c: Use alloca.h here as well.
6722
6723 2009-02-13 Rodrigo Kumpera  <rkumpera@novell.com>
6724
6725         * reflection.c (mono_reflection_lookup_dynamic_token): Do the locking properly.
6726
6727 2009-02-13  Zoltan Varga  <vargaz@gmail.com>
6728
6729         * cominterop.c cominterop.h: New files.
6730
6731         * marshal.c: Move the COM interop related code to cominterop.c. Make a few
6732         function/typedefs which are needed by cominterop.c global.
6733
6734 2009-02-12  Mark Probst  <mark.probst@gmail.com>
6735
6736         * generic-sharing.c: Don't take the loader lock to guard image
6737         mempool allocs.
6738
6739 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6740
6741         * reflection.c (mono_reflection_lookup_dynamic_token): This function might be
6742         called without the loader lock which is required to guard MonoImage:tokens.
6743
6744 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6745
6746         * class.c:
6747         * metadata.c:
6748         * method-builder.c:
6749         * marshal.c:
6750         * reflection.c: Don't take the loader lock to alloc memory from the image mempool.
6751
6752 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6753
6754         * metadata.c: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6755         Rework the code to use regular mono_image_alloc/0.
6756
6757         * loader.c: Rework the code to use regular mono_image_alloc/0.
6758
6759         * metadata-internals.h: Remove mono_image_alloc_lock and mono_image_alloc0_lock.
6760
6761 2009-02-12  Bill Holmes  <billholmes54@gmail.com>
6762
6763         * object-internals.h : Fixing a typo in the 
6764           MonoReflectionComVisibleAttribute struct.
6765
6766         * marshal.c (cominterop_com_visible): Check the implemented 
6767           interfaces for ComImport.
6768
6769         * marshal.c (cominterop_get_native_wrapper_adjusted): For COM calls 
6770           assume that bools should be treated as VARIANTBOOLs.
6771
6772         * marshal.c (emit_marshal_boolean): Adding cases for 
6773           MARSHAL_ACTION_MANAGED_CONV_IN and MARSHAL_ACTION_MANAGED_CONV_OUT.
6774
6775         * marshal.c (mono_marshal_emit_managed_wrapper): Adding calls to 
6776           emit_marshal MARSHAL_ACTION_MANAGED_CONV_IN and OUT for bools.
6777
6778         * marshal.c (cominterop_get_ccw): For COM calls assume that bools
6779           should be treated as VARIANTBOOLs.    
6780
6781         Code is contributed under MIT/X11 license.
6782
6783 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6784
6785         * image.c (mono_image_alloc, mono_image_alloc0, mono_image_strdup): Guard mempool
6786         allocation with the image lock.
6787
6788 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6789
6790         This patch is the last of a series to remove explicit reference of MonoImage::mempool
6791         and use mono_image_alloc set of functions instead. This time we finish with reflection.c
6792
6793         * object.c: Add mono_string_to_utf8_image.
6794
6795         * object-internals.h: Export mono_string_to_utf8_image.
6796
6797         * reflection.c: Rework all explicit references to the the image mempool to go thought
6798         the mono_image_alloc set of functions.
6799
6800 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6801
6802         This patch is the third of a series to remove explicit reference of MonoImage::mempool
6803         and use mono_image_alloc set of functions instead. This time we finish with marshal.c
6804         and generics-sharing.c.
6805
6806         * generics-sharing.c (set_other_info_templates): Take a MonoImage instead of a MonoMemPool
6807         as first argument. Note that this function remains broken as it doesn't perform locking around the
6808         mempool allocation.
6809
6810         * generics-sharing.c (rgctx_template_set_other_slot): Pass the image and not the mempool.
6811
6812         * image.c: Add g_slist_append_image.
6813
6814         * metadata.c (mono_metadata_field_info_with_mempool): Remove the mempool argument and use
6815         the supplied image for allocation. Move code into mono_metadata_field_info_full.
6816
6817         * metadata.c (mono_metadata_parse_marshal_spec_full): Take a MonoImage instead of a MonoMemPool.
6818         Fix all related code to do the same.
6819
6820         * marshal.c (mono_marshal_load_type_info): Pass the image instead of the mempool.
6821
6822         * metadata-internals.h: Fix the signatures.
6823
6824 2009-02-12 Rodrigo Kumpera  <rkumpera@novell.com>
6825
6826         This patch is the second of a series to remove explicit reference of MonoImage::mempool
6827         and use mono_image_alloc set of functions instead. This time we rework mono_metadata_type_dup
6828         and similar to work using MonoImage.
6829
6830         * class.c (mono_mempool_dup): Rename to mono_image_memdup and take a MonoImage instead of a
6831         MonoMemPool.
6832
6833         * class.c (mono_dup_array_type): Take a MonoImage instead of a MonoMemPool as first argument.
6834
6835         * class.c (mono_metadata_signature_deep_dup): Same.
6836
6837         * class.c (inflate_generic_type): Same.
6838
6839         * class.c (mono_class_inflate_generic_type_with_mempool): Same.
6840
6841         * metadata.c (mono_metadata_signature_dup_full): Same.
6842
6843         * metadata.c: Add mono_metadata_signature_dup_mempool and extract common functionality from 
6844         mono_metadata_signature_dup_full.
6845
6846         * metadata.c (mono_metadata_type_dup): Same.
6847
6848         * marshal.c: Pass the image to calls to mono_metadata_type_dup.
6849
6850         * reflection.c: Same.
6851
6852         * generic-sharing.c: Pass the image to calls to mono_class_inflate_generic_type_with_mempool.
6853
6854         * metadata-internals.h: Fix the signatures.
6855
6856         * class-internals.h: Same.
6857
6858 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6859
6860         This patch is the first of a series to remove explicit reference of MonoImage::mempool
6861         and use mono_image_alloc set of functions instead. 
6862
6863         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy):
6864         Rename to mono_class_inflate_generic_type_no_copy and take a MonoImage instead
6865         of a MonoMemPool.
6866
6867         * class.c (mono_class_setup_fields): Adapt to mono_class_inflate_generic_type_no_copy.
6868
6869         * class.c (g_list_prepend_mempool): Removed.
6870
6871         * class.c (mono_class_get_nested_types): Use g_list_prepend_image instead of g_list_prepend_mempool.
6872
6873         * image.c: Add g_list_prepend_image.
6874
6875         * metadata-internals.h (struct MonoImage): Fix comment. Export g_list_prepend_image as internal.
6876
6877         * reflection.c (mono_reflection_create_runtime_class): Use g_list_prepend_image instead of g_list_prepend_mempool.
6878
6879
6880 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6881
6882         * metadata-internals.h (struct MonoImage): Add lock field. Export mono_image_lock and
6883         mono_image_unlock.
6884
6885         * image.c (mono_image_init): Init the lock field.
6886  
6887         * image.c (mono_image_init): Cleanup the lock field.
6888
6889         * image.c: Add mono_image_(un)lock functions.
6890
6891 2009-02-11  Mark Probst  <mark.probst@gmail.com>
6892
6893         * class.c, class-internals.h: mono_method_get_context_general()
6894         combines the functionality of mono_method_get_context() and
6895         mini_method_get_context().
6896
6897         * generic-sharing.c, domain-internals.h:
6898         mono_method_construct_object_context() and
6899         mono_domain_lookup_shared_generic() moved from mini.
6900
6901         * icall.c (ves_icall_InternalInvoke): Handle the case where the
6902         method doesn't have the correct instantiation because it's shared
6903         generic code.  Fixes #473999.
6904
6905 2009-02-11  Zoltan Varga  <vargaz@gmail.com>
6906
6907         * loader.c (mono_method_get_wrapper_data): Handle inflated methods as well.
6908
6909         * loader.c (mono_loader_lock): Add a comment pointing to the locking document.
6910         
6911 2009-02-11 Rodrigo Kumpera  <rkumpera@novell.com>
6912
6913         * metadata.c: Make mono_image_alloc_lock and mono_image_alloc0_lock non static.
6914
6915         * metadata-internals.h: Export mono_image_alloc_lock and mono_image_alloc0_lock.
6916
6917         * loader.c (mono_get_method_full): Drop the loader lock while constructing the method
6918         and recheck the cache for dups after it.
6919
6920         * loader.c (mono_get_method_from_token): Use _lock version of mono_image_alloc0.
6921
6922         Fixes one of the deadlocks found in #473150.
6923
6924 2009-02-11  Bill Holmes  <billholmes54@gmail.com>
6925
6926         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal):
6927           For Win32, add additional break conditions for accept.
6928
6929         Code is contributed under MIT/X11 license.
6930
6931 2009-02-10  Zoltan Varga  <vargaz@gmail.com>
6932
6933         * marshal.c (mono_marshal_get_native_func_wrapper): Use get_cache to
6934         lazily initialize the native wrapper cache.
6935         (mono_marshal_get_native_wrapper): Put aot-ed native wrappers into a separate
6936         cache, since they are different from the normal wrappers.
6937
6938         * image.c (mono_image_init): Initialize native_wrapper_cache lazily as well.
6939
6940         * metadata-internals.h (struct _MonoImage): Add a new wrapper for
6941         AOT compiled native wrappers.
6942
6943 2009-02-09  Geoff Norton  <gnorton@novell.com>
6944
6945         * appdomain.h:
6946         * security-core-clr.c: Allow enabling core-clr from the embedding
6947         API.
6948
6949 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6950
6951         * socket-io.c: when requesting all the local ips, if there are no
6952         interfaces up and running, MS returns 127.0.0.1.
6953
6954 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6955
6956         * mono-perfcounters-def.h: processor time is an inverse time.
6957         Fixes bug #468625.
6958
6959 2009-02-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
6960
6961         * socket-io.c: an empty host name returns the list of local IPs.
6962         Fixes bug #386637 part 1/2.
6963
6964 2009-02-07  Zoltan Varga  <vargaz@gmail.com>
6965
6966         * verify.c (mono_class_interface_implements_interface): Call
6967         mono_class_setup_interfaces ().
6968         (merge_stacks): Ditto.
6969
6970 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
6971
6972         * class.c (mono_class_setup_interfaces): New function to lazily initalize
6973         klass->interfaces.
6974         (mono_generic_class_get_class): Don't initalize klass->interfaces.
6975         (mono_generic_class_get_class): Ditto.
6976
6977 2009-02-06  U-QUACK\miguel  <miguel@quack>
6978
6979         * icall-defs.h: Include also the Encrypt/Decrypt string methods as
6980         they live in security.c
6981
6982         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Integrated
6983         another bit from Paolo's code.
6984
6985 2009-02-06  Zoltan Varga  <vargaz@gmail.com>
6986
6987         * object.c (build_imt_slots): Add a small optimization to avoid inflating
6988         methods which will be discarded by add_imt_builder_entry ().
6989
6990         * marshal.c (get_runtime_invoke_type): Avoid sharing enum types since they
6991         need to be boxed.
6992
6993         * loader.c: Add a statistics for the size of the memberref signature cache.
6994         
6995         * loader.c (find_cached_memberref_sig): New helper function.
6996         (cache_memberref_sig): Ditto.
6997
6998         * loader.c: Cache the result of parsing memberref signatures, since otherwise
6999         they will be parsed again for every generic instantiation, leading to unbounded
7000         memory growth.
7001
7002 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7003
7004         * loader.c (mono_get_method_from_token): Avoid creating class for the generic
7005         parameters of generic methods.
7006
7007         * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
7008         after the original method is copied to the inflated method.
7009         (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
7010
7011         * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
7012         field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
7013
7014         * class.c metadata.c: Update after the changes above.
7015
7016 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
7017
7018         * metadata-verify.c: Simplified error handling and added
7019         section table validation.
7020
7021 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7022
7023         * class-internals.h (MonoClassExt): New structure containing rarely used
7024         fields of MonoClass.
7025         (struct _MonoClass): Move rarely used fields to MonoClassExt, accessed
7026         through a new 'ext' field.
7027
7028         * class.c (mono_class_alloc_ext): New helper function to allocate 
7029         class->ext.
7030
7031         * class.c metadata.c reflection.c: Update after MonoClass structure changes.
7032
7033 2009-02-05  Mark Probst  <mark.probst@gmail.com>
7034
7035         * object.c (mono_object_get_virtual_method): Properly inflate
7036         generic methods.  Fixes #472692.
7037
7038 2009-02-05 Rodrigo Kumpera  <rkumpera@novell.com>
7039
7040         * class.c (mono_class_create_from_typedef): The CLR supports SystemF
7041         recursive types such as List<T>:Cons<T,List<T>> so when doing the lookup
7042         for the parent type, the created type must be ready to be used on a generic
7043         instantiation.
7044         We fill this_arg/byval_arg if the parent is a generic instance to make sure
7045         we won't have duplicated entries in generic_inst_cache.
7046
7047         Fixes #469553.
7048
7049 2009-02-05  Miguel De Icaza  <miguel@novell.com>
7050
7051         * threadpool.c (socket_io_add_poll): Remove the BSD6 define and
7052         replace with plain BSD per the comments on the bug MONO77637.
7053
7054 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
7055
7056         * class.c (mono_class_get_generic_class): New accessor function.
7057         (mono_class_get_generic_container): Ditto.
7058
7059         * class-internals.h (struct _MonoClass): Add 'is_generic' and 'is_inflated'
7060         fields, similar to the ones in MonoMethod.
7061
7062         * class.c (mono_generic_class_get_class): Set klass->is_inflated.
7063         (mono_class_create_from_typedef): Set klass->is_generic if needed.
7064
7065         * reflection.c (mono_reflection_create_generic_class): Set klass->is_generic.
7066         
7067         * class-internals.h (struct _MonoClass): Remove enum_basetype, it contains
7068         the same information as element_class->byval_arg.
7069
7070         * class.c reflection.c: Remove references to class->byval_arg.
7071
7072         * class.c marshal.c: Use mono_class_enum_basetype () instead of accessing 
7073         klass->enum_basetype directly.
7074
7075         * verify.c metadata.c object.c icall.c reflection.c: Use 
7076         mono_class_enum_basetype () instead of accessing klass->enum_basetype 
7077         directly.
7078
7079 2009-02-04  Miguel de Icaza  <miguel@novell.com>
7080
7081         * icall-def.h: Remove internal calls for sockets when
7082         DISABLE_SOCKET is defined, file system writing features when the
7083         OS only support reading and not writing data and Policy support if
7084         the Policy is disabled.
7085         
7086         * image.c (do_mono_image_open): Apply Paolo's patches for using
7087         mono_file_map_ APIs here.
7088
7089         * assembly.c: Add support for platforms to avoid prefix
7090         auto-detection. 
7091
7092 2009-02-04  Zoltan Varga  <vargaz@gmail.com>
7093
7094         * generic-sharing.c (mono_method_fill_runtime_generic_context): Fix a
7095         warning.
7096
7097         * class.c (mono_class_inflate_generic_class): New helper function.
7098
7099         * class.c: Use mono_class_inflate_generic_class in a few places. Add
7100         statistics for inflated methods/classes.
7101
7102         * loader.c (inflate_generic_header): Use mono_class_inflate_generic_class.
7103
7104         * icall.c (ves_icall_Type_GetMethodsByName): Optimize the case when
7105         the call is made from Delegate.CreateDelegate () for the invoke method of
7106         a delegate.
7107
7108         * loader.c: Add a statistics for the memory occupied by inflated signatures.
7109
7110         * metadata.c (mono_metadata_signature_size): New helper function.
7111
7112         * class.c (mono_class_get_method_from_name_flags): Add an optimization for
7113         generic instances.
7114
7115         * metadata.c (inflated_method_in_image): Avoid calling 
7116         mono_method_signature () if the method does not already have a signature.
7117
7118 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7119
7120         * verify.c (is_compatible_boxed_valuetype): When checking if the boxed 
7121         valuetype is compatible with target type, check by inheritance as a
7122         VT is not really compatible with System.ValueType, for example.
7123
7124         * verify.c (do_invoke_method): Improve error message.
7125
7126         * verify.c (do_box_value): If boxing a nullable, use the type argument
7127         on stack instead.
7128
7129         * verify.c (do_newobj): Improve error message.  
7130
7131         Fixes #469549.
7132
7133 2009-02-03  Miguel de Icaza  <miguel@novell.com>
7134
7135         * appdomain.c: Add support for DISABLE_SOCKETS and DISABLE_SHADOW_COPY
7136
7137 2009-02-03  Mark Probst  <mark.probst@gmail.com>
7138
7139         * generic-sharing.c: Don't hold domain lock when calling
7140         instantiate_other_info().  Fixes #471958.
7141
7142         * domain-internals.h, loader.c: Describe locking policy of domain
7143         lock vs loader lock.
7144
7145 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7146
7147         * verify.c (mono_delegate_signature_equal): Make it possible to check
7148         first-arg-bound delegates to static method.
7149
7150         * verify.c (verify_delegate_compatibility): Correctly verify delegates to
7151         static methods with the first arg bound.
7152
7153         Fixes #469529.
7154
7155 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7156
7157         * verify.c: Added stack_slot_full_name to provide decent and more meanfull
7158         errors.
7159
7160         * verify.c (is_compatible_boxed_valuetype): Be less restrictive when not
7161         under strict mode. Any type, when boxed can be seen as a reference type.
7162
7163         Fixes #469528.
7164
7165 2009-02-03 Rodrigo Kumpera  <rkumpera@novell.com>
7166
7167         * object.h: The lower bound of an array is a signed integer value.
7168         Introduce mono_array_lower_bound_t typedef. It should be used instead of
7169         gint32 as under MONO_BIG_ARRAYS it will be a gint64.
7170
7171         * icall.c: Cast MonoArrayBounds::length to a signed value so correctly
7172         calculate the upper bound.
7173         
7174         Fixes #471252.
7175
7176 2009-02-02  Miguel de Icaza  <miguel@novell.com>
7177
7178         From Paolo's work, refactored, cleared up:
7179         
7180         * threadpool.c, icall.c: ifdef code that requires a working socket
7181         stack.
7182
7183         * metadata.c (mono_metadata_field_info): Do not attempt to return
7184         a value from a function declared as void.
7185
7186         * console-io.c: Use MONO_NULL_TTYDRIVER to remove the tty driver
7187         from the console stack.
7188
7189         * assembly.c: use strrchr instead of rindex.
7190
7191         * class.c, object.c, marshal.c, icall.c, reflection.c: include
7192         alloca.h on systems that have it.
7193
7194         * environment.c: Avoid code that uses stuff from
7195         HAVE_SYS_UTSNAME_H
7196         
7197         * appdomain.c: Include sys/time.h.
7198
7199         * console-io.c: include sys/ioctl.h if it is available.
7200
7201 2009-02-03  Zoltan Varga  <vargaz@gmail.com>
7202
7203         * method-builder.h (_MonoMethodBuilder): Add a 'skip_visibility' flag.
7204
7205         * method-builder.c (mono_mb_create_method): Set method->skip_visibility from
7206         the method builder.
7207
7208         * marshal.c: Set mb->skip_visibility instead of setting it on the method
7209         after it was created and cached, as the later is not thread safe.
7210         
7211 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
7212
7213         * mono-debug.c (mono_debug_print_stack_frame): Avoid crashes when this is
7214         called while the debugging module is not initialized. Fixes #471669.
7215
7216 2009-02-02 Rodrigo Kumpera  <rkumpera@novell.com>
7217
7218         * icall.c (type_from_name): Ignore reflection frames to find out the real caller.
7219
7220         Fixes #471255.
7221
7222 2009-02-02  Mark Probst  <mark.probst@gmail.com>
7223
7224         * generic-sharing.c (lookup_or_register_other_info): Make sure the
7225         loader lock is not taken while the templates lock is held.  Fixes
7226         #471089.
7227
7228 2009-02-02  Mark Probst  <mark.probst@gmail.com>
7229
7230         * metadata.c (type_in_image): Added a check to fix a monodis
7231         crash.
7232
7233 2009-02-02  Zoltan Varga  <vargaz@gmail.com>
7234
7235         * marshal.c (mono_marshal_get_runtime_invoke): Add support for byref
7236         nullable arguments.
7237
7238         * object.c (mono_runtime_invoke_array): Ditto.
7239         
7240         * marshal.c (mono_marshal_free_dynamic_wrappers): New function for
7241         freeing wrappers of dynamic methods.
7242
7243         * loader.c (mono_free_method): Call it. Fixes #463323.
7244         
7245         * marshal.c (mono_marshal_get_runtime_invoke): Disable sharing for
7246         methods taking vtype/byref arguments, to fix yet another bug caused by
7247         the sharing of runtime invoke wrappers. Partly fixes #471259.
7248
7249 2009-02-01  Zoltan Varga  <vargaz@gmail.com>
7250
7251         * debug-mono-symfile.c (check_line): Return NULL instead of returning
7252         <first file in file table>:1 when the IL offset does not have an associated
7253         line number.
7254
7255 2009-01-31  Zoltan Varga  <vargaz@gmail.com>
7256
7257         * mono-debug.c (mono_debug_lookup_locals): New function to return local
7258         variable info for a method.
7259
7260         * debug-mono-symfile.c (mono_debug_symfile_lookup_locals): Ditto.
7261         
7262 2009-01-30  Jb Evain  <jbevain@novell.com>
7263
7264         * pedump.c: reuse code from monodis to make sure pedump honors
7265         MONO_PATH, which is needed to verify net_2_1 assemblies.
7266
7267 2009-01-29  Zoltan Varga  <vargaz@gmail.com>
7268
7269         * mono-debug.c (mono_debug_print_stack_frame): Print the IL offset even when
7270         there is no line number info.
7271
7272 2009-01-29  Raja R Harinath  <harinath@hurrynot.org>
7273
7274         Avoid some MonoType allocations
7275         * reflection.c (mono_reflection_initialize_generic_parameter):
7276         Reuse MonoType from param->pklass rather than allocating one.
7277         (mono_dynamic_image_free): Update to changes.
7278
7279 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7280
7281         Rearrange some code to improve consistency
7282         * reflection.c (mono_reflection_setup_generic_class): Move body ...
7283         (mono_reflection_initialize_generic_parameter): ... here.
7284
7285 2009-01-28  Zoltan Varga  <vargaz@gmail.com>
7286
7287         * generic-sharing.c (has_constraints): Enable gshared for methods/classes
7288         with type constraints as an experiment.
7289
7290         * boehm-gc.c (on_gc_notification): Update mono_stats.
7291
7292 2009-01-28  Raja R Harinath  <harinath@hurrynot.org>
7293
7294         Avoid some allocations
7295         * class-internals.h (_MonoGenericInst::type_argv): Convert from
7296         pointer to tail array to avoid extra allocation.
7297         * metadata.c (free_generic_inst): Update to changes.
7298         (mono_metadata_get_generic_inst): Likewise.  Use alloca instead of
7299         on-stack struct.
7300
7301 2009-01-27  Zoltan Varga  <vargaz@gmail.com>
7302
7303         * icall.c (ves_icall_System_Type_EqualsInternal): For user-defined types,
7304         return TRUE if the two type objects are the same.
7305
7306 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7307
7308         * marshal.c (mono_marshal_load_type_info): Fill out info->min_align.
7309         (mono_class_native_size): Use klass->marshal_info->min_align instead of
7310         klass->min_align, since klass->min_align contains the managed alignment,
7311         while the native alignment can be different, like for longs on x86.
7312         Fixes #469135.
7313
7314         * class-internals.h (MonoMarshalType): Add a min_align field.
7315
7316 2009-01-26 Rodrigo Kumpera  <rkumpera@novell.com>
7317
7318         * assembly.c (mono_assembly_try_decode_skip_verification): Add a hack to check
7319         the 1.0 format.
7320
7321 2009-01-26  Zoltan Varga  <vargaz@gmail.com>
7322
7323         * domain-internals.h (struct _MonoJitInfo): Add a 'from_aot' field plus
7324         some comments about the usage of the used_regs field.
7325
7326         * marshal.c (emit_marshal_ptr): Allow pointers to blittable structures.
7327         Fixes #469217.
7328
7329 2009-01-24 Gonzalo Paniagua Javier <gonzalo@novell.com>
7330
7331         * appdomain.c: return NULL instead of throwing FileNotFoundException
7332         when LoadAssembly() fails.
7333
7334 2009-01-23  Mark Probst  <mark.probst@gmail.com>
7335
7336         * metadata.c (mono_metadata_generic_param_equal): Only compare the
7337         image if the owner is NULL.  Fixes the AOT failures.
7338
7339 2009-01-23  Zoltan Varga  <vargaz@gmail.com>
7340
7341         * metadata.c (mono_metadata_load_generic_params): Initialize the 
7342         MonoGenericParam structure using memset so the image field is initialized
7343         as well.
7344
7345 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7346
7347         * appdomain.c (mono_domain_unload): Change the InterlockedIncrement to
7348         a plain store.
7349
7350 2009-01-21  Zoltan Varga  <vargaz@gmail.com>
7351
7352         * class.c (mono_class_setup_vtable_general): In the generic instance
7353         optimization, set method->slot for abstract virtual methods. Fixes part of
7354         #467834.
7355
7356 2009-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
7357
7358         * domain-internals.h: Add new appdomain state MONO_APPDOMAIN_UNLOADING_START
7359         which signals that the unloading has started but all appdomain services must
7360         remain operational.
7361
7362         * appdomain.c (mono_domain_unload): The initial state for unloading now
7363         is unloading_start and we switch to unloading after the managed call to
7364         AppDomain::DomainUnload has finished.
7365
7366         The new unloading state has to be created because managed code in the
7367         DomainUnload event can depend on things like the threadpool still working.
7368         The domain must remain fully functional while the event executes.
7369
7370         This shown as an issue due to Process::WaitForExit, which waits for
7371         async reads of stdout and stderr to complete. Since those are processed
7372         in the threadpool the code deadlocks because the DomainUnload callback 
7373         waits for the async read finished event, which should have been set by a
7374         threadpool job but has been discarded due to the domain been in unload
7375         state.
7376
7377 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7378
7379         * metadata.c (mono_metadata_generic_param_equal): Owner as well as
7380         image must match.
7381
7382 2009-01-21  Mark Probst  <mark.probst@gmail.com>
7383
7384         * reflection.c (resolve_object): For fields, inflate the class and
7385         then get the field in the inflated class.
7386
7387 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7388
7389         * object-internals.h (struct _MonoException): Added a comment
7390         explaining the new use of trace_ips.
7391
7392 2009-01-20  Mark Probst  <mark.probst@gmail.com>
7393
7394         * generic-sharing.c (inflate_other_data): Inflate array methods
7395         correctly.
7396
7397         * loader.c, class-internals.h: Rename search_in_array_class() to
7398         mono_method_search_in_array_class() and make it non-static.
7399
7400 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7401
7402         * metadata.c (inflated_signature_in_image): Call signature_in_image as well.
7403         Hopefully fixes #458168.
7404
7405 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7406
7407         * object.c (mono_raise_exception): Remove call to InterlockedIncrement
7408         as it is performed elsewhere.
7409
7410         Code is contributed under MIT/X11 license
7411
7412 2009-01-19  Christian Hergert  <christian.hergert@gmail.com>
7413
7414         * mono-perfcounters-def.h: Add counters for asp.net requests total and
7415         requests queued.
7416         * object.c (mono_raise_exception): Increment the exceptions total
7417         counter when an exception is thrown.
7418         * class-internals.h: Add a location for storing the total number of
7419         asp.net requests served.
7420         * mono-perfcounters.c: Implement update support for asp.net counters
7421         from the class libraries. Implement read support for asp.net counters
7422         and exceptions total counter.
7423
7424 2009-01-19  Zoltan Varga  <vargaz@gmail.com>
7425
7426         * loader.c (search_in_array_class): Call mono_class_setup_methods () before
7427         accessing klass->methods. Fixes #467385.
7428
7429 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7430
7431         * marshal.c (emit_marshal_custom): Avoid calling MarshalNativeToManaged
7432         for byval arguments without an [Out] attribute. Fixes #467212.
7433
7434         * attach.c: Applied patch from Koushik Dutta (koush@koushikdutta.com). 
7435         Fix compilation under android.
7436         
7437         * sgen-gc.c: Instead of scanning gray objects after all roots have been 
7438         processed, scan them directly after they are copied, to achieve better locality
7439         and cache usage.
7440
7441         * socket-io.c: Applied patch from Koushik Dutta
7442         (koush@koushikdutta.com). Disable IPV6 when running under android.
7443
7444 2009-01-18  Zoltan Varga  <vargaz@gmail.com>
7445
7446         * icall.c (ves_icall_InternalExecute): Add write barriers.
7447
7448         * marshal.c (mono_marshal_get_write_barrier): Remove, this is now done in
7449         the GC code.
7450
7451         * sgen-gc.c: Implement write barriers in IL code.
7452
7453 2009-01-17  Geoff Norton  <gnorton@novell.com>
7454
7455         * image.c: Avoid trying to walk the reference table of dynamic assemblies.
7456
7457 2009-01-17  Geoff Norton  <gnorton@novell.com>
7458
7459         * image.c: When unloading the image->references table, there can be gaps
7460         in it.  Ensure that we iterate every entry to avoid leaking assembly references
7461         when unloading an appdomain.
7462
7463 2009-01-16  Zoltan Varga  <vargaz@gmail.com>
7464
7465         * sgen-gc.c: Add support for allocating a nursery at an aligned address, to
7466         speed up ptr-in-nursery checks.
7467
7468         * threads.c (mono_threads_abort_appdomain_threads): Abort threads outside the
7469         threads_lock () to prevent deadlocks.
7470
7471         * sgen-gc.c gc-internal.h: Add a new root type root-with-wbarrier, which
7472         does not need to be scanned during minor collections, since writes to it
7473         must use write barriers.
7474
7475 2009-01-15 Rodrigo Kumpera  <rkumpera@novell.com>
7476
7477         * metadata-verify.c: Add pe nt header verification.
7478         
7479 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7480
7481         * gc.c: Fix a few warnings when using SGEN.
7482
7483 2009-01-14 Rodrigo Kumpera  <rkumpera@novell.com>
7484
7485         * metadata-verify.c: Add pe optional header verification.
7486
7487 2009-01-15  Zoltan Varga  <vargaz@gmail.com>
7488
7489         * sgen-gc.c: Add support for user defined marker functions, used by
7490         MonoGHashTable to avoid registering a GC root for every hash node.
7491
7492 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7493
7494         * sgen-gc.c: Fix warnings. Optimize copy_object () a bit. Split pinned/
7495         non-pinned roots into separate hashes to avoid having to traverse them
7496         in functions which are only interested in one kind.
7497
7498 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7499
7500         * metadata-verify.c: Add pe header machine field verification.
7501         
7502 2009-01-13 Rodrigo Kumpera  <rkumpera@novell.com>
7503
7504         * metadata-verify.c: Add pe header size verification.
7505
7506 2009-01-14  Zoltan Varga  <vargaz@gmail.com>
7507
7508         * reflection.c (ALLOC_REFENTRY): Don't allocate the ReflectionEntry structures
7509         using the GC, they don't contain references.
7510
7511         * domain.c (mono_domain_create): Create ldstr_table using MONO_HASH_KEY_VALUE_GC.
7512
7513 2009-01-13  Geoff Norton  <gnorton@novell.com>
7514
7515         * appdomain.c|h: Expose mono_domain_unload to the embedding api so that 
7516         AppDomains created on the native side can be cleaned up on the native side.
7517
7518 2009-01-13  Geoff Norton  <gnorton@novell.com>
7519
7520         * appdomain.c: Ensure that we call mono_context_init for the embedding api
7521         as well as the managed api.
7522
7523 2009-01-13  Geoff Norton  <gnorton@novell.com>
7524
7525         * appdomain.h|c: New API for creating a MonoDomain in the embedding api
7526         with a MonoAppDomain initialized against it.
7527
7528 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7529
7530         * reflection.c (MOVING_GC_REGISTER): Fix a warning.
7531         
7532         * reflection.c (mono_image_get_generic_param_info): Use MOVING_GC_REGISTER.
7533
7534         * marshal.c: Avoid setting the exception clauses after a method has been entered 
7535         into the wrapper caches. Fixes #465700.
7536
7537         * method-builder.c (mono_mb_set_clauses): New function to set the clauses of the
7538         method builder.
7539         (mono_mb_create_method): Set the clauses from the method builder.
7540
7541 2009-01-13 Gonzalo Paniagua Javier <gonzalo@novell.com>
7542
7543         * threadpool.c: include sys/socket.h. Fixes compilation on FreeBSD.
7544         Patch from Makoto Kishimoto.
7545
7546 2009-01-13  Zoltan Varga  <vargaz@gmail.com>
7547
7548         * sgen-gc.c (mono_gc_make_descr_from_bitmap): Handle large bitmaps by 
7549         encoding them as ROOT_DESC_COMPLEX.
7550         (precisely_scan_objects_from): Implement support for ROOT_DESC_COMPLEX.
7551
7552 2009-01-12  Zoltan Varga  <vargaz@gmail.com>
7553
7554         * sgen-gc.c (scan_from_remsets): Clear the global remset of pointers which
7555         no longer point to the nursery.
7556
7557         * sgen-gc.c: Add a few comments/FIXMEs.
7558         
7559         * sgen-gc.c: Implement scanning of the alloc_pinned objects.
7560
7561         * marshal.c (mono_marshal_get_synchronized_wrapper): Make the 
7562         initialization of the various _method variables thread safe. Fixes
7563         #465377.
7564
7565 2009-01-12  Mark Probst  <mark.probst@gmail.com>
7566
7567         * domain.c, domain-internals.h: Remove the shared_generics_hash
7568         and its lookup functions.
7569
7570 2009-01-12  Bill Holmes  <billholmes54@gmail.com>
7571
7572         * socket-io.c:  Fixing the MSVC build. 
7573
7574         Code is contributed under MIT/X11 license.
7575
7576 2009-01-12 Rodrigo Kumpera  <rkumpera@novell.com>
7577
7578         * metadata-verify.c: Add pe header watermark verification.
7579
7580 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7581
7582         * metadata-verify.c: Add lfanew verification.
7583
7584 2009-01-12  Jb Evain  <jbevain@novell.com>
7585
7586         * tabldefs.h: rename METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE to
7587         METHOD_ATTRIBUTE_STRICT to match the ECMA terminology.
7588
7589 2009-01-10  Zoltan Varga  <vargaz@gmail.com>
7590
7591         * socket-io.c: Fix the build.
7592
7593         * environment.c: Fix an #ifdef.
7594
7595 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7596
7597         * threadpool.c (async_invoke_thread): Handle the wait function returning
7598         WAIT_IO_COMPLETION as well.
7599         (async_invoke_io_thread): Ditto.
7600
7601 2009-01-09  Bill Holmes  <billholmes54@gmail.com>
7602
7603         * threads.c: Fixing the Windows build.
7604
7605         Code is contributed under MIT/X11 license.
7606
7607 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7608  
7609         * threads.c (signal_thread_state_change): Call wapi_interrupt_thread () to
7610         interrupt a wait.
7611         (mono_thread_execute_interruption): Call wapi_clear_interruption () to enable
7612         the thread to wait again.
7613
7614 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7615
7616         * metadata-verify.c: Initial skeleton of the metadata verifier.
7617
7618         * pedump.c: Add support for the metadata verifier.
7619
7620         * verify-internal.h: Export the whole assembly metadata verifier function.
7621
7622 2009-01-09 Rodrigo Kumpera  <rkumpera@novell.com>
7623
7624         * gc.c (mono_gc_init): Fix the comments about deadlock on windows.
7625
7626 2009-01-09  Zoltan Varga  <vargaz@gmail.com>
7627
7628         * Makefile.am: Upgrade dtrace-prelink.sh location.
7629
7630 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7631
7632         * gc.c (mono_gc_init): Wait for finalizer thread to init on windows as
7633         well. Otherwise the shutdown deadlock that happens on unix will can happen
7634         as well.
7635         If the main thread code finishes too fast it's possible that the finalizer
7636         thread won't have executed yet, won't record itself as the finalizer thread
7637         and the shutdown sequence will wait on it forever.
7638
7639 2009-01-08 Rodrigo Kumpera  <rkumpera@novell.com>
7640
7641         * threads.c (mono_thread_current): Make THREAD_DEBUG work on windows
7642         with MSVC.
7643
7644 2009-01-08  Miguel de Icaza  <miguel@novell.com>
7645
7646         * appdomain.c: Initialize the mono_strtod_mutex here, thanks to
7647         Robert Jordan for pointing this out.
7648
7649 2009-01-08  Christian Prochnow  <cproch@seculogix.de>
7650
7651         * icall.c
7652         * icall-def.h: added internal calls ves_icall_System_IO_DriveInfo_GetDiskFreeSpace,
7653         ves_icall_System_IO_DriveInfo_GetDriveType.
7654
7655 2009-01-07  Miguel de Icaza  <miguel@novell.com>
7656
7657         * icall.c: Wrap calls to mono_strtod in CriticalSection
7658         invocations when using eglib, to work around #464316.
7659
7660 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7661
7662         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Double check the
7663         return value of GetCurrentDirectory to never access unitialized memory.
7664
7665 2009-01-07 Rodrigo Kumpera  <rkumpera@novell.com>
7666
7667         * file-io.c (ves_icall_System_IO_MonoIO_GetCurrentDirectory): Properly check the
7668         return value of GetCurrentDirectory and expand the buffer if needed.
7669
7670         Fixes #459094.
7671
7672 2009-10-07 Tom Hindle  <tom_hindle@sil.org>
7673
7674         * marshal.c (GetIUnknownForObjectInternal, GetIUnknownForObjectInternal) : 
7675           Adding a call to mono_init_com_types.
7676
7677         Code is contributed under MIT/X11 license.
7678
7679 2009-01-07  Geoff Norton  <gnorton@novell.com>
7680
7681         * socket-io.c: ioctlsocket(FIONREAD) returns the size of the UDP header as well on 
7682         darwin.  Use getsockopt SO_NREAD instead to get the right values for TCP and UDP.
7683         ai_canonname can be null in some cases on darwin, where the runtime assumes it will 
7684         be the value of the ip buffer.
7685
7686 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7687
7688         * verify.c (mono_class_interface_implements_interface): Verify parents as we can't rely on
7689         interfaces_packed here.
7690
7691         Fixes part of #463294.
7692
7693 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7694
7695         * verify.c (is_array_type_compatible): Ignore bounds and sizes when checking array compatibility.
7696
7697         Fixes part of #463294.
7698
7699 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7700
7701         * verify.c (stack_slot_is_complex_type_not_reference_type): Check if the type
7702         is a boxed complex as well.
7703
7704         Fixes part of #463294.
7705
7706 2009-01-06 Rodrigo Kumpera  <rkumpera@novell.com>
7707
7708         * reflection.c (mono_image_get_methodref_token): Add an extra create_typespec parameter to
7709         control if a methodspec should be created for the generic method definition from external assemblies.
7710         Caching of methodspec is done using the handleref hash table.
7711
7712         Fixes #462592.
7713
7714 2009-01-05 Rodrigo Kumpera  <rkumpera@novell.com>
7715
7716         * loader.c (find_method): When searching the interfaces of a class
7717         check the transitive closure of implemented interfaces.
7718
7719         Fixes #463303.
7720
7721 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7722
7723         * class.c (get_implicit_generic_array_interfaces): Improve debugging code.
7724         
7725 2009-01-03 Rodrigo Kumpera  <rkumpera@novell.com>
7726
7727         * class.c (get_implicit_generic_array_interfaces): Extract valuetype
7728         interfaces calculation to fill_valuetype_array_derived_types.
7729
7730         * class.c (get_implicit_generic_array_interfaces): Valuetypes need IList /
7731         ICollection / IEnumerator interfaces for their extra twin type - sbyte for byte
7732         for example.
7733
7734         * class.c (get_implicit_generic_array_interfaces): InternalEnumerator gets
7735         interfaces for valuetypes if needed.    
7736
7737         * class.c (fill_valuetype_array_derived_types): Enums should have interfaces
7738         for their basetype as well. Types are array expanded if rank is > 0.
7739
7740         Fixes #400716.
7741
7742 2008-12-30  Bill Holmes  <billholmes54@gmail.com>
7743
7744         * socket-io.h : Changing the signature of
7745           ves_icall_System_Net_Sockets_Socket_Accept_internal to pass
7746           the blocking state.
7747
7748         * icall-def.h :  Changing the signature of
7749           System.Net.Sockets.Socket.Accept_internal to pass the blocking state.
7750
7751         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal) :
7752           For Windows only.  Avoid blocking when calling accept by
7753           querying for a connection via select.  The loop also queries
7754           the thread state every 1000 micro seconds for the thread
7755           stop state.  This will avoid the process hanging on shutdown
7756           when using a TcpChannel that is never connected to.
7757
7758         Code is contributed under MIT/X11 license.
7759
7760 2008-12-30  Marek Safar  <marek.safar@gmail.com>
7761
7762         * tabledefs.h: Add METHOD_ATTRIBUTE_CHECK_ACCESS_ON_OVERRIDE.
7763
7764 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7765
7766         * class.c (get_implicit_generic_array_interfaces): Extract common
7767         code to a helper function making it a lot easier on the eyes.
7768
7769 2008-12-26 Rodrigo Kumpera  <rkumpera@novell.com>
7770
7771         * class.c (get_implicit_generic_array_interfaces): If the internal
7772         enumerator is an interface inflate System.Object instead of itself.
7773
7774         Fixes #461261.
7775
7776 2008-12-24 Rodrigo Kumpera  <rkumpera@novell.com>
7777
7778         * object.c (mono_runtime_invoke_array): Don't assert with
7779         byref nullable types.
7780
7781         * marshal.c (mono_marshal_get_runtime_invoke): To handle
7782         byref nullables we unbox the object and store it on the
7783         stack. 
7784         We can't use the boxed object since it is the T of Nullable<T>
7785         and the boxed representation of a nullable it's underlying type
7786         or null.
7787         We could cheat and create a boxed nullable and use the same
7788         machinery of other byref VTs but this feels like a hack and
7789         using the stack has the bonus of reducing heap pressure.
7790
7791         Fixes #461941.
7792
7793 2008-12-23 Rodrigo Kumpera  <rkumpera@novell.com>
7794
7795         * marshal.c (mono_marshal_emit_managed_wrapper): Handle char
7796         return value.
7797
7798         Fixes #461867.
7799
7800 2008-12-19  Bill Holmes  <billholmes54@gmail.com>
7801
7802         * icall-def.h : Adding an internal call definition for 
7803           System.Environment.internalBroadcastSettingChange.
7804
7805         * icall.c : Adding a Windows only implementation to broadcast a 
7806           WM_SETTINGCHANGE when an environment variable has changed.
7807
7808         Code is contributed under MIT/X11 license.
7809
7810 2008-12-19  Mark Probst  <mark.probst@gmail.com>
7811
7812         * class.c, class-internals.h: Made
7813         mono_class_has_parent_and_ignore_generics() non-static.
7814
7815 Thu Dec 18 16:35:22 CET 2008 Paolo Molaro <lupus@ximian.com>
7816
7817         * image.c: deal with the mmap failing when loading an image.
7818
7819 2008-12-17  Geoff Norton  <gnorton@novell.com>
7820
7821         * threadpool.c: Ensure that the io_queue_lock is initialized
7822         in all circumstances, as we always attempt to cleanup against it.
7823
7824 2008-12-17  Miguel de Icaza  <miguel@novell.com>
7825
7826         * icall.c (ves_icall_System_Environment_get_Platform): For
7827         compatibility reasons for existing client code we will keep
7828         returning 4 for a while.   
7829
7830         For how long will depend on the documentation being updated, and
7831         for us to give client code a chance to be updated.
7832
7833         This reverts the original decison on #433108 since we did not
7834         catch roughly 33 instances of the broken code in our own source
7835         code base, we did not catch failures on the buildbots, and QA did
7836         not bring this as a problem.
7837
7838         Only today I found some customer's code breaking due to our own
7839         class libraries not being fully updated and tracked it down to
7840         this change.  I am reverting it because if we could not even get
7841         our story straight in our own code base, how can we hope that our
7842         end user code be fixed?
7843
7844         As of this morning, our Wiki page that documents how to detect
7845         Unix had not been fixed.    
7846
7847 2008-12-16  Zoltan Varga  <vargaz@gmail.com>
7848
7849         * metadata.c (inflated_method_in_image): Add a workaround for #458168.
7850
7851         * class.c (mono_class_get_fields): Handle loading errors.
7852
7853 2008-12-12 Mark Mason <mmason@upwardaccess.com>
7854
7855         * 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.
7856         
7857 2008-12-12 Gonzalo Paniagua Javier <gonzalo@novell.com>
7858
7859         * mono-perfcounters.c: avoid warning.
7860
7861 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7862
7863         * reflection.c (ensure_runtime_vtable): Work on generic instances and
7864         make sure all interfaces have MonoClass::interface_id set.
7865
7866         * reflection.c (ensure_generic_class_runtime_vtable): Ensure the
7867         method table is property set.
7868
7869 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7870
7871         * class.c: New function mono_class_setup_interface_id that setup
7872         MonoClass::interface_id if needed.
7873
7874         * class-internals.h: Export new function.
7875
7876 2008-12-12 Rodrigo Kumpera  <rkumpera@novell.com>
7877
7878         * class.c: Add code to sanity check the vtable after setup_vtable_general
7879         has done it's work.
7880
7881 2008-12-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
7882
7883         * icall.c: make Assembly.GetExecutingAssembly work properly when
7884         reflection is used to invoke the method.
7885         Bug #321781 fixed.
7886
7887 2008-12-11  Mark Probst  <mark.probst@gmail.com>
7888
7889         * metadata/generic-sharing.c: Look for constraints in all type
7890         arguments, not just the first one.
7891
7892 2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
7893
7894         * appdomain.c: return the correct CodeBase for an Assembly instance
7895         that was loaded from the shadow-copy directories.
7896         Bug #458190 fixed.
7897
7898 2008-12-10  Zoltan Varga  <vargaz@gmail.com>
7899
7900         * sgen-gc.c (build_nursery_fragments): Clear nursery_next/nursery_frag_real_end.
7901
7902         * sgen-gc.c (check_object): New debugging helper function.
7903
7904         * object.c: Fix calls to mono_value_copy_array ().
7905
7906 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7907
7908         * class.c (mono_class_setup_fields): If working on an inflated class
7909         first check if the generic definition did init with success.
7910
7911         Fixes #445361.
7912
7913 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7914
7915         pedump.c (main): Fix a warning.
7916
7917 2008-12-10  Bill Holmes  <billholmes54@gmail.com>
7918
7919         * object-internals.h : Adding a definition for 
7920           MonoReflectionComVisibleAttribute.
7921
7922         * marshal.c (cominterop_com_visible) :  Method added to check the 
7923           ComVisible attribute of a class.
7924
7925         * marshal.c (cominterop_raise_hr_exception, cominterop_get_interface) :  
7926           cominterop_raise_hr_exception added to consolidate common code 
7927           to raise hr exceptions.
7928
7929         * marshal.c (cominterop_can_support_dispatch) :  Method added to determine 
7930           if a managed class should support IDispatch.
7931
7932         * marshal.c 
7933           (cominterop_get_idispatch_for_objec, cominterop_ccw_queryinterfacet) :  
7934           Added additional checks for managed object when getting 
7935           an IDispatch interface.
7936
7937         Code is contributed under MIT/X11 license.
7938
7939 2008-12-10 Rodrigo Kumpera  <rkumpera@novell.com>
7940
7941         pedump.c (main): Handle mono_get_method () returning NULL. 
7942
7943 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7944
7945         * marshal.h: Fix a warning.
7946
7947 2008-12-09  Bill Holmes  <billholmes54@gmail.com>
7948
7949         * marshal.c : Adding cominterop_release_all_rcws to release all
7950           runtime callable wrappers held by the runtime.
7951
7952         * marshal.h : Adding declaration for cominterop_release_all_rcws.
7953           
7954         Code is contributed under MIT/X11 license.
7955
7956 2008-12-09  Zoltan Varga  <vargaz@gmail.com>
7957
7958         * metadata.c (mono_image_alloc_lock): New helper function.
7959         (mono_image_alloc0_lock): Ditto.
7960
7961         * metadata.c: Use the alloc_lock () helper functions for allocating
7962         memory from the image mempool.
7963
7964 2008-12-08 Rodrigo Kumpera  <rkumpera@novell.com>
7965
7966         * class.c (mono_class_from_generic_parameter): Document it's
7967         locking behavior. Fix double checked locking here, we stored in
7968         param->pklass a partially initialized MonoClass and no membar was used.
7969
7970 2008-12-05  Marek Habersack  <mhabersack@novell.com>
7971
7972         * sysmath.c (ves_icall_System_Math_Round2): if round (3) and rint
7973         (3) functions are present in the C library use them to do the
7974         job. If they are absent, make sure that the sum of int_part and
7975         dec_part is rounded before returning. This is necessary due to the
7976         division of dec_part by the power of 10 before the final addition
7977         is performed - if the result is not rounded in some cases it will
7978         yield invalid results.
7979
7980 2008-12-04  Zoltan Varga  <vargaz@gmail.com>
7981
7982         * marshal.c (mono_marshal_emit_native_wrapper): Add AOT support for pinvoke
7983         wrappers by emitting the function address using a CEE_MONO_ICALL_ADDR 
7984         instruction instead of a pointer constant.
7985
7986 2008-12-03  Zoltan Varga  <vargaz@gmail.com>
7987
7988         * loader.c (mono_method_get_header): Do most of the work outside the
7989         loader lock, to avoid assembly load hook deadlocks.
7990
7991         * metadata.c (mono_metadata_parse_mh_full): Use finer-grained locking.
7992         (mono_metadata_parse_type_full): Ditto.
7993
7994 2008-12-02 Rodrigo Kumpera  <rkumpera@novell.com>
7995
7996         * mempool.c (mono_backtrace): Take the number of allocated bytes as argument.
7997         Make the stack depth fixed. Ensure proper argument passing to the backtrace
7998         funtions. Finally, use a lock to produce well ordered output.
7999
8000         The lock looks silly, as all calls to the corlib mempool should be guarded
8001         with the loader lock, but for some reason this fact doesn't help. 
8002
8003         * mempool.c (mono_mempool_alloc0): Add support for TRACE_ALLOCATIONS.
8004
8005 2008-12-02  Mark Probst  <mark.probst@gmail.com>
8006
8007         * socket-io.c: 64 bit big-endian fixes.
8008
8009 2008-12-01 Rodrigo Kumpera  <rkumpera@novell.com>
8010
8011         * verify.c (is_compatible_boxed_valuetype): Rewrite function to work properly with
8012         targets that require strict compatibility between the types.
8013
8014         * verify.c (verify_stack_type_compatibility_full): Boxed values are not compatible
8015         to unboxed types. All cases that this is true are checked by is_compatible_boxed_valuetype.
8016         Kill the strict argument and create a new one valuetype_must_be_boxed.
8017
8018         * verify.c (verify_delegate_compatibility): Use verify_stack_type_compatibility_full to
8019         state that all valuetypes must be boxed.
8020
8021         Fixes #448560.
8022
8023 2008-11-29  KornĂ©l Pál  <kornelpal@gmail.com>
8024
8025         * coree.c (MonoFixupExe): Use sizeof(IMAGE_BASE_RELOCATION) instead of
8026         IMAGE_SIZEOF_BASE_RELOCATION as newer Vista SDKs no longer define the latter.
8027
8028         Contributed under MIT/X11 license.
8029
8030 2008-11-28 Rodrigo Kumpera  <rkumpera@novell.com>
8031
8032         * class.c (mono_class_setup_fields): Don't copy MonoType::attrs as
8033         the inflate_generic_type machinery should handle it.
8034
8035         This avoids a crash when the field's flags is zero and it's type is
8036         a primitive.
8037         What happens is that mono_metadata_parse_type_full will see that opt_attrs
8038         is zero and will return one of the cached built-in primitive types. Since
8039         those types live in read-only memory, the code that copies it crashes.  
8040
8041 2008-11-28  Mark Probst  <mark.probst@gmail.com>
8042
8043         * object.c: Don't put function descriptors into generalized IMT
8044         thunks.
8045
8046 2008-11-28  Mark Probst  <mark.probst@gmail.com>
8047
8048         * class.c: Enable generic code sharing on PPC64.
8049
8050 2008-11-27  Mark Probst  <mark.probst@gmail.com>
8051
8052         * mempool.c, mempool-internals.h: Added g_slist_append_mempool()
8053         from mini/mini.c.
8054
8055         * generic-sharing.c: Allocate the method template slists from the
8056         image mempool so it doesn't leak.
8057
8058 2008-11-27 Rodrigo Kumpera  <rkumpera@novell.com>
8059
8060         * class.c (generic_array_methods): Release the linked list.
8061
8062 2008-11-27  Mark Probst  <mark.probst@gmail.com>
8063
8064         * marshal.c (mono_string_builder_to_utf8): Fixed a wrong
8065         invocation to g_utf16_to_utf8().
8066
8067 2008-11-26  Mark Probst  <mark.probst@gmail.com>
8068
8069         * icall.c (mono_ArgIterator_IntGetNextArg): Handle sub-word sized
8070         arguments on big endian archs.
8071
8072 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
8073
8074         * reflection.c: (_mono_reflection_parse_type) skip leading spaces in
8075         the type name (test added in corlib).
8076
8077 2008-11-25 Gonzalo Paniagua Javier <gonzalo@novell.com>
8078
8079         * pedump.c: initialize perf. counters. Fixes a segv.
8080
8081 2008-11-25  Martin Baulig  <martin@ximian.com>
8082
8083         * mono-debug-debugger.c
8084         (mono_debugger_runtime_invoke): Return the exception object if an
8085         exception was thrown.  Visual Studio displays the exception object
8086         in the locals window.
8087
8088 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8089
8090         * mini-trampolines.c (mono_delegate_trampoline): Don't return a
8091         ftnptr.
8092
8093 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8094
8095         * marshal.c (mono_type_native_stack_size): MONO_TYPE_I and
8096         MONO_TYPE_U are sizeof (gpointer), too.
8097
8098 2008-11-24  Mark Probst  <mark.probst@gmail.com>
8099
8100         * marshal.c (mono_type_native_stack_size): Fixed size and
8101         alignment for reference types.
8102
8103 2008-11-23  Mark Probst  <mark.probst@gmail.com>
8104
8105         * class.c (mono_class_generic_sharing_enabled): Disable generic
8106         code sharing for PPC64.
8107
8108 2008-11-21 Rodrigo Kumpera  <rkumpera@novell.com>
8109
8110         * icall.c (mono_method_get_equivalent_method): Make sure
8111         method->klass->methods is inited before looping over it.
8112
8113 2008-11-20 Gonzalo Paniagua Javier <gonzalo@novell.com>
8114
8115         * object.c: when calling ExecuteAssembly in a newly created domain,
8116         the configuration file and application base are already set up.
8117         Bug #446353 take 2 fixed.
8118
8119 2008-11-20  Zoltan Varga  <vargaz@gmail.com>
8120
8121         * marshal.c: Add support for MONO_TYPE_GENERICINST to some functions.
8122         Fixes #444715. Fix a warning.
8123
8124 2008-11-18 Gonzalo Paniagua Javier <gonzalo@novell.com>
8125
8126         * appdomain.c: write the full path of the assembly to the .ini file
8127         created when "shadow-copying"
8128         Bug #446353 fixed.
8129
8130 2008-11-18  Zoltan Varga  <vargaz@gmail.com>
8131
8132         * debug-helpers.c (mono_method_full_name): Stringify wrapper types even
8133         if signature==FALSE.
8134
8135 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
8136
8137         * marshal.h : Fix the cygwin build.
8138            marshal.c:12442: undefined reference to `_IID_IMarshal'
8139           
8140         Code is contributed under MIT/X11 license.
8141
8142 2008-11-17  Bill Holmes  <billholmes54@gmail.com>
8143
8144         * marshal.h : cominterop_ccw_getfreethreadedmarshaler added to return the
8145           free threaded marshaler when QueryInterface is called on a COM callable
8146           wrapper requesting the IMarshal interface.
8147           
8148         Code is contributed under MIT/X11 license.
8149
8150 2008-11-14  Zoltan Varga  <vargaz@gmail.com>
8151
8152         * domain-internals.h (MonoDomain): Update MONO_DOMAIN_LAST_GC_TRACKED.
8153
8154         * reflection.c (mono_type_get_object): Special case the very common
8155         void type.
8156
8157         * domain-internals.h (struct _MonoDomain): Add 'typeof_void' field to
8158         hold typeof(void).
8159
8160 2008-11-13  Bill Holmes  <billholmes54@gmail.com>
8161
8162         * process.h : Adding method declaration for
8163           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8164           
8165         * process.c : Adding implementation for
8166           ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8167           
8168         * icall-def.h : Registering ICALL Processs.WaitForInputIdle_internal
8169           to ves_icall_System_Diagnostics_Process_WaitForInputIdle_internal.
8170
8171         Code is contributed under MIT/X11 license.
8172
8173 2008-11-10  Rodrigo Kumpera  <rkumpera@novell.com>
8174
8175         * appdomain.c (unload_thread_main): Clean up threadpool by
8176         calling mono_thread_pool_remove_domain_jobs.
8177
8178         * domain-internals.h (struct _MonoDomain): Add new fields to
8179         help coordinate the cleanup of the threadpool.
8180
8181         * threadpool.c (mono_thread_pool_remove_domain_jobs): New fuction
8182         that cleans up the threadpool of all jobs associated with an appdomain.
8183         It does that by cleaning up the queues and making sure all active
8184         threads are accounted.
8185
8186         * threadpool.c (async_invoke_io_thread): Ignore job if its domain is
8187         unloaded or in the process of. Take this is such way that there is
8188         no race condition between another thread starting the unload and the
8189         current thread acknowledging it.
8190
8191         * threadpool.c (async_invoke_thread): Same.
8192
8193         * threadpool.c (start_io_thread_or_queue): Increment threadpool_jobs before
8194         firing the new thread.
8195
8196         * threadpool.c (start_tpthread): Same.
8197
8198         * theadpool.c (append_job): Increment threadpool_jobs before queueing.
8199
8200         * threadpool.h: Add mono_thread_pool_remove_domain_jobs.
8201
8202 2008-11-06  Jonathan Chambers  <joncham@gmail.com>
8203
8204         * file-io.c (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8205         Add support for DuplicateHandle.
8206         
8207         * file-io.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8208         Add support for DuplicateHandle.
8209         
8210         * icall-def.h (ves_icall_System_IO_MonoIO_DuplicateHandle): 
8211         Add support for DuplicateHandle.
8212
8213         Code is contributed under MIT/X11 license.
8214
8215 2008-11-06  Mark Probst  <mark.probst@gmail.com>
8216
8217         * class-internals.h: Make min_align into a whole byte.
8218
8219         * class.c: Set min_align for SIMD types to 16.
8220
8221 2008-11-05  Geoff Norton  <gnorton@novell.com>
8222
8223         * attach.c: Default the attacher to enabled for all cases including
8224         embedded.
8225
8226 Wed Nov 5 16:33:41 CET 2008 Paolo Molaro <lupus@ximian.com>
8227
8228         * monitor.c, class-internals.h, wrapper-types.h: revert incorrect
8229         change r117650.
8230
8231 2008-11-04  Mark Probst  <mark.probst@gmail.com>
8232
8233         * monitor.c, monitor.h: New function for querying offsets of
8234         members of MonoThreadsSync.
8235
8236 2008-11-04  Zoltan Varga  <vargaz@gmail.com>
8237
8238         * marshal.c (mono_marshal_get_runtime_invoke): Use runtime_invoke_direct_cache
8239         to speed up this function and to avoid the boundless memory growth caused by
8240         the signature_dup () calls.
8241
8242 2008-11-02  Zoltan Varga  <vargaz@gmail.com>
8243
8244         * monitor.c (mono_monitor_get_fast_enter_method): Add a proper type for the
8245         wrapper.
8246
8247         * class-internals.h (struct _MonoMethod): Increase the size of 'wrapper_type'
8248         by 1 bit.
8249
8250         * wrapper-types.h: Add MONO_WRAPPER_MONITOR_FAST_ENTER/EXIT.
8251
8252 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8253
8254         * appdomain.c:
8255         * domain-internals.h: made mono_set_private_bin_path_from_config()
8256         "internal".
8257         * object.c: call the above function after setting the configuration
8258         file path for the root domain.
8259         Fixes bug #314478.
8260
8261 2008-10-31 Gonzalo Paniagua Javier <gonzalo@novell.com>
8262
8263         * assembly.c: when the assembly is loaded from an absolute path, end
8264         basedir with a directory separator.
8265         Bug #440781 fixed.
8266
8267 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8268
8269         * monitor.c (mono_monitor_get_fast_enter_method): If
8270         CompareExchange is not available, don't create the fastpath
8271         instead of asserting.  (The method is missing in the 1.1 profile.)
8272
8273 2008-10-30  Mark Probst  <mark.probst@gmail.com>
8274
8275         * marshal.c, marshal.h: Rename signature_no_pinvoke() and make it non-static.
8276
8277         * monitor.c, monitor.h: Code for generating Monitor.Enter and
8278         Monitor.Exit IL fastpaths.
8279
8280 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8281
8282         * class.c (mono_class_create_from_typedef): Added Vector2ul.
8283
8284 2008-10-28  Rodrigo Kumpera  <rkumpera@novell.com>
8285
8286         * class.c (mono_class_create_from_typedef): Added Vector2l.
8287
8288 2008-10-27  Rodrigo Kumpera  <rkumpera@novell.com>
8289
8290         * class.c (mono_class_create_from_typedef): Added Vector2d.
8291
8292 2008-10-27 Gonzalo Paniagua Javier <gonzalo@novell.com>
8293
8294         * appdomain.c: translate \ into / for cache_path.
8295         * domain-internals.h: new mono_is_shadow_copy_enabled().
8296         * icall.c: (fill_reflection_assembly_name) do the same path
8297         manipulations that get_code_base does.
8298         (get_code_base) use mono_is_shadow_copy_enabled.
8299
8300 2008-10-26 Gonzalo Paniagua Javier <gonzalo@novell.com>
8301
8302         * appdomain.c: shadow-copied assemblies go to CachePath +
8303         ApplicationName when both are set. DynamicBase has nothing to do with
8304         shadow copies.
8305         Bug #406877 fixed.
8306
8307 2008-10-26  Zoltan Varga  <vargaz@gmail.com>
8308
8309         * reflection.c (encode_locals): Use a cache to avoid duplicate entries in the
8310         STANDALONESIG table.
8311
8312         * metadata-internals.h (struct _MonoDynamicImage): Add cache for
8313         standalone signatures.
8314
8315         * marshal.c (mono_marshal_get_runtime_invoke): Rewrite the signature 
8316         comparison code: instead of comparing the signatures using a custom
8317         equals function, transform them to a common signature and compare that. This
8318         works better with AOT.
8319
8320 2008-10-25  Zoltan Varga  <vargaz@gmail.com>
8321
8322         * Reapply r116521 with (!mono_debug_using_mono_debugger ()) checks.
8323
8324         * class.c (mono_class_init): Remove unneccesary mono_class_setup_properties ()
8325         call for generic instances.
8326         (mono_class_setup_properties): Call setup_properties () before accessing
8327         gklass->properties.
8328
8329         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8330         over the virtual methods of a class using metadata if possible, avoiding the
8331         creation of MonoMethod's for non-virtual methods.
8332         
8333         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8334         get_virtual_methods () to iterate over the virtual methods of classes.
8335
8336 2008-10-25  Martin Baulig  <martin@ximian.com>
8337
8338         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_DEAD): New #define.
8339
8340 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8341
8342         * class.c (mono_class_create_from_typedef): Added Vector4i.
8343
8344 2008-10-24  Mark Probst  <mark.probst@gmail.com>
8345
8346         * marshal.c (mono_marshal_get_synchronized_wrapper): Emit
8347         ldtoken+GetTypeFromHandle instead of i4+icall so that the JIT
8348         special-casing applies to eliminate the call completely.
8349
8350 2008-10-24  Rodrigo Kumpera  <rkumpera@novell.com>
8351
8352         * class.c (mono_class_create_from_typedef): Added Vector8s.
8353
8354 2008-10-23  Rodrigo Kumpera  <rkumpera@novell.com>
8355
8356         * class.c (mono_class_create_from_typedef): Added Vector16sb.
8357
8358 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8359
8360         * icall.c: get rid of annoying warning.
8361
8362 2008-10-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
8363
8364         * threadpool.c: in 1.x, if you change the background status of the
8365         threadpool thread, it's not reset.
8366         Remove unnecessary calls to SetState.
8367
8368 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8369
8370         * threadpool.c: asynchronously create a set of idle threads upon first
8371         use of the threadpool. SetMinThreads will now start the appropriate
8372         number of idle threads if they are not already running. The default is
8373         1 threadpool thread per CPU. Increased the maximum number of threads
8374         per CPU to 10.
8375
8376 2008-10-22  Martin Baulig  <martin@ximian.com>
8377
8378         Revert r116521 from Zoltan, it breaks the debugger:
8379
8380         * class.c (mono_class_get_virtual_methods): New helper function to iterate
8381         over the virtual methods of a class using metadata if possible, avoiding the
8382         creation of MonoMethod's for non-virtual methods.
8383         
8384         * class.c (mono_class_setup_vtable_general): Rewrite this to use 
8385         get_virtual_methods () to iterate over the virtual methods of classes.
8386
8387 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8388
8389         * threads.c: when creating a threadpool thread, set its state to
8390         'background'.
8391         * threadpool.c: reset the background state of a threadpool thread
8392         after finishing each work item
8393         Bug #437888 fixed.
8394
8395 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8396
8397         * class.c (mono_class_get_vtable_entry): Add an optimization for szarrays.
8398         
8399         * class.c (mono_class_setup_vtable_general): Add an optimized version for
8400         generic instances which works by inflating the methods in the container
8401         class's vtable.
8402
8403         * class.c (mono_class_inflate_generic_type_with_mempool_no_copy): New
8404         variant which doesn't make a copy if no inflation was done.
8405         (mono_class_setup_fields): Use it.
8406
8407         * metadata.c (mono_metadata_get_shared_type): New helper function to
8408         return a shared instance of a given MonoType.
8409
8410         * class.c (mono_class_inflate_generic_type_with_mempool): Avoid making
8411         a copy of most non-generic types.
8412
8413 Wed Oct 22 18:00:46 CEST 2008 Paolo Molaro <lupus@ximian.com>
8414
8415         * threadpool.c: remove one more GetSystemInfo () call.
8416
8417 Wed Oct 22 17:45:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
8418
8419         * mono-perfcounters.c, icall-def.h, environment.c, environment.h:
8420         use the code in mono-proclib.h to get processor information.
8421
8422 2008-10-22 Gonzalo Paniagua Javier <gonzalo@novell.com>
8423
8424         * appdomain.c: fixed the logic that determines whether assemblies in a
8425         directory are "shadow-copied" or not. Bug #433483 fixed.
8426
8427 2008-10-22  Zoltan Varga  <vargaz@gmail.com>
8428
8429         * process.c (ves_icall_System_Diagnostics_Process_GetProcessData): Fix a
8430         warning.
8431
8432 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8433
8434         * marshal.c (runtime_invoke_signature_equal): Don't shared wrappers
8435         returning a vtype.
8436
8437         * class.c debug-helpers.c object.c class-internals.h marshal.c icall.c
8438         reflection.c: Use mono_field_get_name () for accessing a field's name.
8439
8440         * class-internals.h (MONO_CLASS_HAS_STATIC_METADATA): Move this here from
8441         class.c
8442
8443         * class.c (mono_field_get_rva): Fix crash if this is called on a dynamic
8444         field.
8445
8446         * loader.c (find_method_in_class): Reenable the metadata optimization by
8447         not using it for generic instances.
8448
8449         * class-internals.h (MonoFieldDefaultValue): Extract the rarely used 
8450         data/def_type fields from MonoClassField into a separate structure.
8451         (struct MonoClassField): Remove data/def_type fields.
8452         (struct _MonoClass): Add a 'field_def_values' array to store the default
8453         values/RVA for fields.
8454
8455         * class.c reflection.c: Update after the changes.
8456         
8457         * object.c (mono_class_create_runtime_vtable): Use mono_field_get_data ()
8458         for accessing field->data.
8459
8460         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_InitializeArray): Ditto.
8461
8462         * loader.c (find_method_in_class): Revert the last change for now as
8463         it breaks Mono.C5 unit tests.
8464
8465         * class-internals.h (struct _MonoDynamicGenericClass): Add fields
8466         'field_generic_types' and 'field_objects' which contain the information
8467         previously stored in MonoInflatedField.
8468         (MonoInflatedField): Delete.
8469         (struct _MonoClassField): Delete 'generic_info' field.
8470
8471         * reflection.c: Store the information which was previously in 
8472         field->generic_info in MonoDynamicGenericClass instead.
8473
8474         * metadata.c (free_generic_class): Update after MonoDynamicGenericClass/
8475         MonoClassField changes.
8476
8477 Tue Oct 21 17:07:55 CEST 2008 Paolo Molaro <lupus@ximian.com>
8478
8479         * marshal.c, method-builder.c: get rid of wrapper_hash and instead
8480         store the value inside the data array of the MonoMethodWrapper.
8481         This saves memory, is faster and fixes the lifetime issues (methods
8482         were never removed from the hash previously). May also fix bug#436996.
8483
8484 2008-10-21  Zoltan Varga  <vargaz@gmail.com>
8485
8486         * reflection.c (mono_image_get_fieldref_token): For fields of non-dynamic 
8487         generic instances, compute the type from the generic definition instead of
8488         looking in field->generic_info.
8489
8490         * class.c (mono_class_setup_fields): Don't create a MonoInflatedField
8491         for inflated fields, the only user was get_fieldref_token () which no
8492         longer needs it.
8493
8494         * class.c (mono_class_init): Revert the last change as it seems to cause
8495         crashes.
8496
8497         * class-internals.h (struct _MonoClassField): Reorder fields to save 4
8498         bytes on 64 bit platforms.
8499
8500         * object.c (mono_class_create_runtime_vtable): Fix a warning.
8501         
8502         * object.c (mono_class_create_runtime_vtable): Don't initalize
8503         field->data/field->def_type here, it is done lazily by 
8504         mono_class_get_field_default_value ().
8505
8506         * icall.c (ves_icall_get_enum_info): Call 
8507         mono_class_get_field_default_value () instead of directly accessing
8508         field->data and field->def_type.
8509
8510         * object.c (get_default_field_value): Ditto.
8511
8512         * class.c (mono_field_get_data): Ditto.
8513         
8514         * class.c (mono_class_init): Remove unneccesary mono_class_setup_methods ()
8515         call for generic instances.
8516
8517         * loader.c (find_method_in_class): If klass != from_class, then inflate
8518         the method with the context of from_class, since the caller assumes this.
8519
8520 2008-10-20  Zoltan Varga  <vargaz@gmail.com>
8521
8522         * class.c (mono_method_get_vtable_index): Use mono_method_get_vtable_slot ()
8523         for accessing method->slot.
8524
8525 2008-10-20  Cedric Vivier  <cedricv@neonux.com>
8526
8527         * icall-def.h, icall.c: Add icall for Debugger.IsAttached.
8528
8529 2008-10-19  Zoltan Varga  <vargaz@gmail.com>
8530
8531         * class.c (mono_method_get_vtable_index): Use
8532         mono_method_get_vtable_slot () for accessing method->slot.
8533
8534         * object.c (build_imt_slots): Use mono_class_get_method_by_index () for
8535         accessing klass->methods.
8536
8537         * class.c (mono_method_get_vtable_slot): New helper function.
8538         (mono_class_get_vtable_entry): Ditto.
8539         (mono_class_setup_vtable_general): Use mono_method_get_vtable_slot () for
8540         accessing method->slot.
8541
8542         * generic-sharing.c (mono_class_get_method_generic): Pass the declaring
8543         method to get_inflated_method ().
8544
8545         * class.c (mono_class_get_inflated_method): New helper method to obtain
8546         a method of an inflated class without calling setup_methods ().
8547         (mono_class_get_cctor): Use get_inflated_method.
8548
8549         * generic-sharing.c (mono_class_get_method_generic): Ditto.
8550         
8551         * marshal.c image.c: Lazily create all the marshal caches.
8552
8553         * image.c (mono_image_init): Move initialization of runtime_invoke
8554         caches to marshal.c.
8555
8556         * marshal.c (get_cache): New helper function to lazily initialize a 
8557         wrapper cache.
8558         (mono_marshal_get_runtime_invoke): Share more runtime invoke wrappers.
8559
8560         * debug-helpers.c (mono_method_full_name): Include generic arguments.
8561
8562 Fri Oct 17 10:51:32 CEST 2008 Paolo Molaro <lupus@ximian.com>
8563
8564         * loader.c: fixed check for interface type.
8565
8566 Thu Oct 16 20:59:11 CEST 2008 Paolo Molaro <lupus@ximian.com>
8567
8568         * appdomain.c: check for NULL setup before it's referenced.
8569
8570 p
8571 Thu Oct 16 16:12:23 CEST 2008 Paolo Molaro <lupus@ximian.com>
8572
8573         * class.c: remove the unused old vtable setup code.
8574
8575 Thu Oct 16 12:53:29 CEST 2008 Paolo Molaro <lupus@ximian.com>
8576
8577         * class.c: don't depend on interface order in
8578         setup_interface_offsets (bug #435777).
8579         * reflection.c: sort the InterfaceImpl table (patch from
8580         Jb Evain  <jbevain@novell.com>).
8581
8582 2008-10-13  Zoltan Varga  <vargaz@gmail.com>
8583
8584         * assembly.c (mono_assembly_open_full): Avoid loading images while holding
8585         the low level assemblies lock.
8586
8587 Mon Oct 13 16:35:26 CEST 2008 Paolo Molaro <lupus@ximian.com>
8588
8589         * domain-internals.h, domain.c, icall.c, image.c, marshal.c,
8590         object.c, reflection.c, socket-io.c, threads.c: introduced
8591         mono_framework_version () to return the major framewrok version,
8592         changed the code that was using more complex patterns to use it.
8593         Return the correct value for PlatformID for OSX.
8594
8595 Mon Oct 13 14:38:01 CEST 2008 Paolo Molaro <lupus@ximian.com>
8596
8597         * icall-def.h, process.h, process.c: added an icall to get info about
8598         processes using mono-proclib.
8599
8600 Mon Oct 13 11:14:44 CEST 2008 Paolo Molaro <lupus@ximian.com>
8601
8602         * mono-perfcounters.c: use the mono-proclib functions to
8603         access process information.
8604
8605 Mon Oct 13 11:00:49 CEST 2008 Paolo Molaro <lupus@ximian.com>
8606
8607         * domain.c, assembly.c, debug-mono-symfile.c, debug-mono-symfile.h,
8608         monosn.c, Makefile.am, pedump.c, image.c, metadata-internals.h,
8609         reflection.c: remove rawbuffer usage: mmap support is more sanely
8610         provided by utils/mono-mmap.
8611
8612 Sat Oct 11 19:46:19 CEST 2008 Paolo Molaro <lupus@ximian.com>
8613
8614         * gc.c: use posix semaphores when possible so that
8615         mono_gc_finalize_notify() is signal safe.
8616
8617 2008-10-11  Zoltan Varga  <vargaz@gmail.com>
8618
8619         * reflection.c: Implement DISABLE_REFLECTION_EMIT, remove some
8620         #ifdef DISABLE_REFLECTION_SAVE stuff, only the exported functions need to
8621         be #ifdef-ed out, the linker will remove the rest.
8622
8623         * marshal.c: Implement DISABLE_COM.
8624
8625         * reflection.c: Implement DISABLE_REFLECTION_EMIT_SAVE.
8626
8627 2008-10-11  Miguel de Icaza  <miguel@novell.com>
8628
8629         * locales.c (string_invariant_compare_char): Optimization: do not
8630         call g_unichar_type unless we actually need the information.
8631
8632 2008-10-10  Mark Probst  <mark.probst@gmail.com>
8633
8634         * object.c, class-internals.h: Also create remoting trampolines
8635         for generic methods.  Pass the domain to the remoting trampoline
8636         creation function, too.
8637
8638 2008-10-10  Zoltan Varga  <vargaz@gmail.com>
8639
8640         * class.c (mono_class_init): Fix+re-enable the finalize optimization.
8641
8642 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8643
8644         * class.c (mono_class_create_from_typedef): Vector4u was renamed to
8645         Vector4ui.
8646
8647 2008-10-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
8648
8649         * assembly.c:
8650         * locales.c: remove the use of g_strdown. Fixes bug #322313.
8651
8652 Fri Oct 10 17:01:42 CEST 2008 Paolo Molaro <lupus@ximian.com>
8653
8654         * assembly.c: in mono_assembly_load_friends() take the assemblies lock
8655         for the least possible amount of time (extending the fix in r113458).
8656
8657 2008-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
8658
8659         * class.c (mono_class_create_from_typedef): Retrofit to new type names.
8660
8661 2008-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
8662
8663         * class.c (mono_class_create_from_typedef): Added Vector8u and Vector16u
8664         as possible simd intrinsic types.
8665         Optimized the test to check for the common prefix first.
8666
8667 Thu Oct 9 17:38:24 CEST 2008 Paolo Molaro <lupus@ximian.com>
8668
8669         * class.c: back out part of a broken optimization committed on
8670         May 23th (bug #433908).
8671
8672 2008-10-09  Mark Probst  <mark.probst@gmail.com>
8673
8674         * profiler.c (simple_shutdown): Don't call mono_thread_attach() on
8675         Win32.  Should fix #432388 for most cases until we have the new
8676         profiler on Win32.
8677
8678 2008-10-08  Zoltan Varga  <vargaz@gmail.com>
8679
8680         * metadata.c (mono_metadata_generic_context_hash): Call generic_inst_hash
8681         instead of using inst->id so the hash is stable for AOT.
8682
8683 2008-10-07 Gonzalo Paniagua Javier <gonzalo@novell.com>
8684
8685         * appdomain.c:
8686         * icall.c: create a .ini file for shadow-copied assemblies that
8687         contains the location of the original assembly. Use this to return the
8688         proper CodeBase for shadow-copied assemblies. Fixes bug #323606.
8689         Also fix the number of '/' for windows when returning the CodeBase.
8690         Fixes bug #430920.
8691
8692 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8693
8694         * marshal.c (cominterop_get_ccw) : Fixing a copy paste error from r115126.
8695
8696         Code is contributed under MIT/X11 license.
8697
8698 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8699
8700         * marshal.c (cominterop_get_native_wrapper) : Adding a call to mono_class_setup_vtable
8701           if if the class vtable needs initialized.
8702
8703         Code is contributed under MIT/X11 license.
8704
8705 2008-10-07  Bill Holmes  <billholmes54@gmail.com>
8706
8707         * marshal.c (cominterop_get_native_wrapper_adjusted, cominterop_get_ccw) : 
8708           Adding default MonoMarshalSpecs for COM methods.  OBJECT->STRUCT,
8709           STRING->BSTR, and CLASS->INTERFACE.
8710
8711         Code is contributed under MIT/X11 license.
8712
8713 2008-10-07  Marek Habersack  <mhabersack@novell.com>
8714
8715         * sysmath.h: changed the declaration of the
8716         ves_icall_System_Math_Round2 icall by adding an extra
8717         away_from_zero parameter.
8718
8719         * sysmath.c (ves_icall_System_Math_Round2): added support for
8720         away from zero rounding. The icall now takes an extra boolean
8721         parameter to signal that away from zero operation is requested.
8722
8723 2008-10-06  Zoltan Varga  <vargaz@gmail.com>
8724
8725         * marshal.c (mono_marshal_get_delegate_begin_invoke): Put the wrapper in
8726         the delegate klass so it can work with full-aot.
8727         (mono_marshal_get_delegate_end_invoke): Ditto.
8728         (mono_marshal_get_delegate_invoke): Ditto.
8729
8730 Mon Oct 6 16:10:02 CEST 2008 Paolo Molaro <lupus@ximian.com>
8731
8732         * gc.c, attach.h, attach.c: remove a bad pattern:
8733         add_finalizer_callback () is not implemented correctly, it can't
8734         without adding more overhead to the finalizer loop and it's not
8735         even needed, since we know exactly what we need to call, so there is
8736         no need to do so through an expensive function pointer.
8737
8738 2008-10-04  Zoltan Varga  <vargaz@gmail.com>
8739
8740         * gc.c: Define a dummy version of mono_gc_add_finalizer_thread_callback ()
8741         for the no-gc case.
8742         * attach.c (mono_attach_init): Remove the #ifdef.
8743
8744 2008-10-04  Andreas Färber  <andreas.faerber@web.de>
8745
8746         * attach.c (mono_attach_init): Don't use
8747         mono_gc_add_finalizer_thread_callback when compiling without GC.
8748         Fixes #432306.
8749         
8750         Code is contributed under MIT/X11 license.
8751
8752 2008-10-03  Zoltan Varga  <vargaz@gmail.com>
8753
8754         * class.c (mono_class_create_from_typedef): Remove the 
8755         #ifndef DISABLE_SIMD stuff.
8756
8757 2008-10-03  Rodrigo Kumpera  <rkumpera@novell.com>
8758
8759         * class-internals.h (MonoClass): Added simd_type bit field.
8760
8761         * class.c (mono_class_create_from_typedef): Check if type is a simd
8762         intrinsic.
8763
8764 2008-10-03  Mark Probst  <mark.probst@gmail.com>
8765
8766         * object.c (mono_method_add_generic_virtual_invocation): Only add
8767         instantiations to the thunk whose count is at least as large as
8768         the threshold.
8769
8770 2008-10-02 Gonzalo Paniagua Javier <gonzalo@novell.com>
8771
8772         * icall.c: changed the Type of the exception thrown when trying to
8773         invoke a constructor on an abstract class. Part of the fix for bug
8774         #324185.
8775
8776 2008-10-02  Mark Probst  <mark.probst@gmail.com>
8777
8778         * class.c, class-internals.h (mono_method_get_vtable_index): New
8779         function which returns the index into the vtable and properly
8780         handles inflated virtual generic methods.
8781
8782 2008-10-01  Mark Probst  <mark.probst@gmail.com>
8783
8784         * object.c, domain.c, object-internals.h, domain-internals.h:
8785         Generalize IMT thunk machinery to also handle thunks for virtual
8786         generic method invokes.  When a virtual generic method is invoked
8787         more than a number of times we insert it into the thunk so that it
8788         can be called without lookup in unmanaged code.
8789
8790         * generic-sharing.c, class-internals.h: Fetching a
8791         MonoGenericInst* for a method from an (M)RGCTX.
8792
8793 2008-10-01  Zoltan Varga  <vargaz@gmail.com>
8794
8795         * marshal.c (emit_marshal_string): Applied a variant of a patch by
8796         tom hindle <tom_hindle@sil.org>. Fix byref native-to-managed string
8797         marshalling. Fixes #431304.
8798
8799 2008-10-01  Bill Holmes  <billholmes54@gmail.com>
8800
8801         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8802           handle when ref is specified without In or Out.
8803
8804         Code is contributed under MIT/X11 license.
8805
8806 2008-09-30  Mark Probst  <mark.probst@gmail.com>
8807
8808         * loader.c (mono_get_method_constrained): Don't expand method with
8809         the class's context, because it's already a method of that class.
8810
8811 2008-09-30  Atsushi Enomoto  <atsushi@ximian.com>
8812
8813         * attach.c : should be correct build fix.
8814
8815 2008-09-29  Zoltan Varga  <vargaz@gmail.com>
8816
8817         * attach.c: Fix the previous change.
8818
8819 2008-09-29  Atsushi Enomoto  <atsushi@ximian.com>
8820
8821         * attach.c : quick w32 build fix.
8822
8823 2008-09-27  Miguel de Icaza  <miguel@novell.com>
8824
8825         * Turn off MONO_GENERIC_SHARING=all and go back to corlib as it
8826         crashes MonoDevelop: #430455.
8827
8828 2008-09-27  Zoltan Varga  <vargaz@gmail.com>
8829
8830         * domain-internals.h (struct _MonoDomain): Move most fields used only by
8831         the JIT do MonoJitDomainInfo in ../mini/mini.h.
8832
8833         * domain.c: Remove initialization/cleanup of the removed fields.
8834
8835 2008-09-27  Mark Probst  <mark.probst@gmail.com>
8836
8837         * class.c (mono_class_generic_sharing_enabled): Enable generic
8838         code sharing for PPC.
8839
8840 2008-09-26  Bill Holmes  <billholmes54@gmail.com>
8841
8842         * attach.c : Fixing the Windows builds.
8843
8844         Code is contributed under MIT/X11 license.
8845
8846 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8847
8848         * class.c (mono_class_generic_sharing_enabled): Experimentally change 
8849         the default generic sharing mode to 'all'.
8850
8851 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8852
8853         * generic-sharing.c, class-internals.h: New function for checking
8854         whether a method needs a static RGCTX invoke wrapper.  A few
8855         funtions moved from mini/generic-sharing.c.
8856
8857         * icall.c: New function used.
8858
8859 2008-09-25  Mark Probst  <mark.probst@gmail.com>
8860
8861         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
8862         Static RGCTX invoke wrapping applies to value type methods, too.
8863
8864         * class.c (mono_class_setup_vtable_general): In generic-shared
8865         value types, wrap methods with a static RGCTX invoke wrapper.
8866
8867 2008-09-25  Zoltan Varga  <vargaz@gmail.com>
8868
8869         * attach.c (ipc_connect): Use AF_UNIX instead of AF_FILE to fix the
8870         osx build.
8871
8872 2008-09-24  Zoltan Varga  <vargaz@gmail.com>
8873
8874         * gc.c (mono_gc_add_finalizer_thread_callback): New function to
8875         register a callback which is called when the finalizer thread is woken
8876         up.
8877         (finalizer_thread): Call the callback if it exists.
8878
8879         * attach.h attach.c: New files, implementing the attach mechanism.
8880
8881         * appdomain.c: Init/cleanup the attach mechanism on startup/shutdown.
8882         
8883         * object.c (mono_object_get_virtual_method): Fix an assertion introduced
8884         by the previous change.
8885
8886 Tue Sep 23 15:24:03 CEST 2008 Paolo Molaro <lupus@ximian.com>
8887
8888         * class.c, domain-internals.h, domain.c, generic-sharing.c, image.c,
8889         loader.c, marshal.c, metadata-internals.h, metadata.c,
8890         method-builder.c, object.c, reflection.c: introduced specific functions
8891         to allocate from the domain and image mempools and cleaned up most of
8892         the code to use them (still missing a few in reflection.c).
8893         Keep the loader bytes counter updated.
8894
8895 Mon Sep 22 17:33:12 CEST 2008 Paolo Molaro <lupus@ximian.com>
8896
8897         * domain.c, monitor.c, boehm-gc.c, gc.c: update some of the GC and
8898         loader-related counters.
8899
8900 Mon Sep 22 17:29:54 CEST 2008 Paolo Molaro <lupus@ximian.com>
8901
8902         * mono-perfcounters-def.h, mono-perfcounters.c, class-internals.h:
8903         added more MS-compatible counters.
8904
8905 2008-09-22  Zoltan Varga  <vargaz@gmail.com>
8906
8907         * class.c (mono_class_setup_fields): Call setup_fields before accessing
8908         class->blittable. Fixes #428217.
8909
8910 2008-09-21  Zoltan Varga  <vargaz@gmail.com>
8911
8912         * reflection.c (mono_image_get_field_on_inst_token): Call 
8913         field_encode_signature () since that handles custom modifiers too.
8914         Fixes #424663.
8915
8916 2008-09-20  Zoltan Varga  <vargaz@gmail.com>
8917
8918         * reflection.c (add_custom_modifiers): New helper function to merge custom
8919         modifiers stored in objects to a MonoType.
8920         (fieldref_encode_signature): Encode custom modifiers.
8921         (mono_image_get_generic_field_token): Call add_custom_modifiers ().
8922         (fieldbuilder_to_mono_class_field): Ditto. Fixes #424663.
8923
8924 2008-09-19  KornĂ©l Pál  <kornelpal@gmail.com>
8925
8926         * coree.c (_CorValidateImage): Some 64-bit IL only images have entry point
8927         calling _CorDllMain imported from mscoree.dll. Set entry point RVA to 0 for
8928         64-bit IL only images because imports are not resolved for IL only images.
8929         Special thanks to Bill Holmes for finding this bug and testing the patch.
8930         Also fail for 64-bit images marked as CLI_FLAGS_32BITREQUIRED.
8931
8932         Contributed under MIT/X11 license.
8933
8934 2008-09-19  Miguel de Icaza  <miguel@novell.com>
8935
8936         * mono-config.c (dllmap_start): Add support for the bits keyword
8937         on dllentry and dllmap to easily detect 32 vs 64 bit systems.
8938
8939 2008-09-19  Mark Probst  <mark.probst@gmail.com>
8940
8941         * reflection.c (inflate_mono_method): When the class the method is
8942         to be inflated for is itself not inflated, just return the method.
8943
8944 Fri Sep 19 11:51:36 CEST 2008 Paolo Molaro <lupus@ximian.com>
8945
8946         * mono-perfcounters.c: use more user friendly process instance names.
8947
8948 2008-09-18  Bill Holmes  <billholmes54@gmail.com>
8949
8950         * marshal.c (emit_marshal_variant) : Change the attribute checks to 
8951           handle "[in] ref" and "[in][out] ref" cases.
8952
8953         * marshal.c (cominterop_get_ccw) : The wrong signature was being passed
8954           to mono_mb_create_method.  This was causing problems calling native to
8955           managed passing Variants by value.
8956
8957         Code is contributed under MIT/X11 license.
8958
8959 2008-09-18  Zoltan Varga  <vargaz@gmail.com>
8960
8961         * class.c (can_access_internals): Call mono_assembly_load_friends ()
8962         before accessing the friend_assembly_names field.
8963
8964         * assembly.c (mono_assembly_load_friends): Make this callable multiple
8965         times.
8966         (mono_assembly_load_from_full): Avoid calling load_friends (), it is
8967         called lazily when it is needed.
8968
8969         * metadata-internals.h (struct _MonoAssembly): Add 
8970         'friend_assembly_names_inited' flag.
8971
8972 Thu Sep 18 18:18:47 CEST 2008 Paolo Molaro <lupus@ximian.com>
8973
8974         * mono-perfcounters-def.h: fix the types of a few counters.
8975         * mono-perfcounters.c: implemented the instance names getter
8976         and a few bugfixes.
8977
8978 2008-09-18  Atsushi Enomoot  <atsushi@ximian.com>
8979
8980         * culture-info-table.h : regenerated.
8981
8982 2008-09-17  Robert Jordan  <robertj@gmx.net>
8983
8984         * marshal.c (mono_marshal_get_ldflda_wrapper): Add support for
8985         context bound objects. Fixes #415577.
8986
8987         Code is contributed under MIT/X11 license.
8988
8989 Tue Sep 16 21:03:58 CEST 2008 Paolo Molaro <lupus@ximian.com>
8990
8991         * icall-def.h, threads-types.h, threads.c: fixed SpinWait()
8992         implementation (bug #423582).
8993
8994 2008-09-16  Zoltan Varga  <vargaz@gmail.com>
8995
8996         * object.c (mono_object_get_virtual_method): Handle the case method->slot
8997         is not set. Fixes #426309.
8998
8999 2008-09-16  Jb Evain  <jbevain@novell.com>
9000
9001         * class.c (mono_class_from_name): fix the exported type look up
9002         when the type is defined in a referenced assembly.
9003
9004 2008-09-16  Jb Evain  <jbevain@novell.com>
9005
9006         * reflection.c (mono_image_fill_export_table_from_type_forwarders):
9007         increment the next index counter on each iteration to make that work
9008         for more than one type forwarder. Unmanaged part to fix #422929.
9009
9010 2008-09-15  Mark Probst  <mark.probst@gmail.com>
9011
9012         * object-internals.h: enum ComInterfaceType in
9013         MonoInterfaceTypeAttribute is guint32, not guint16.
9014
9015 2008-09-12  Mark Probst  <mark.probst@gmail.com>
9016
9017         * cil-coff.h, image.c, reflection.c: Endianness fixes in image
9018         writing code.
9019
9020 2008-09-11  Mark Probst  <mark.probst@gmail.com>
9021
9022         * icall.c: Boolean arguments to a runtime invoke are MonoBoolean,
9023         not gboolean.
9024
9025 2008-09-11  Mark Probst  <mark.probst@gmail.com>
9026
9027         * debug-mono-symfile.c (mono_debug_symfile_lookup_location):
9028         Endianness fixes for MonoSymbolFileOffsetTable.
9029
9030 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
9031
9032         * process.c (complete_path) : Removing quotes from the 
9033           input path.  The glib file routines do not handle file paths
9034           that have quotes around them.
9035
9036         Code is contributed under MIT/X11 license.
9037
9038 2008-09-10  Bill Holmes  <billholmes54@gmail.com>
9039
9040         * socket-io.h : Adding a comment to provide locations where 
9041           changes to MonoSocketAsyncResult need to be synced.
9042
9043         Code is contributed under MIT/X11 license.
9044
9045 2008-09-10  Zoltan Varga  <vargaz@gmail.com>
9046
9047         * marshal.c (emit_marshal_custom): Call NativeToManaged for non-out 
9048         parameters as well. Fixes #425001.
9049
9050 2008-09-08  Miguel de Icaza  <miguel@novell.com>
9051
9052         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Fix
9053         windows build.
9054
9055 2008-09-07  Miguel de Icaza  <miguel@novell.com>
9056
9057         * console-io.c: Add support for tracking the window size if it
9058         changes.
9059
9060         The setup is very simple: the TtySetup function will now return a
9061         pointer to a location in memory that tracks the current console
9062         size.  The managed code checks its current value every time its
9063         queried against the last value set, and updates accordingly.
9064
9065         With this setup we can work with multiple consoles, and we do not
9066         require to poke into managed code from a signal handler.
9067
9068         Additionally, the environment for COLUMNS and LINES is now handled
9069         in unmanaged code.
9070
9071         (ves_icall_System_ConsoleDriver_GetTtySize): This is now gone.
9072
9073 2008-09-07  Mark Probst  <mark.probst@gmail.com>
9074
9075         * marshal.c (mono_type_native_stack_size): Treat
9076         MONO_TYPE_TYPEDBYREF like MONO_TYPE_VALUETYPE.
9077
9078 2008-09-04  Jb Evain  <jbevain@novell.com>
9079
9080         * class.c (mono_class_is_assignable_from): fix assignability of nullables
9081         to nullables.
9082
9083 2008-09-03 Rodrigo Kumpera  <rkumpera@novell.com>
9084
9085         * verify.c (verify_type_compatibility_full): Revert change
9086         to allow converting a native int to unmanaged pointer be verifiable
9087         under non-strict mode.
9088         It turns out that "(IntPtr)null" is indeed unverifiable, go figure.
9089
9090         * verify.c: Added some TODOs.
9091
9092 2008-09-02  Bill Holmes  <billholmes54@gmail.com>
9093
9094         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi,
9095           ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni) :
9096           Changed to use GlobalAlloc for the memory returned on Windows platforms.
9097
9098         Code is contributed under MIT/X11 license.
9099
9100 2008-09-02  Jb Evain  <jbevain@novell.com>
9101
9102         * object.c (mono_ldstr_metdata_sig): renamed to mono_ldstr_metadata_sig.
9103
9104 2008-09-02 Rodrigo Kumpera  <rkumpera@novell.com>
9105
9106         reflection.c (typebuilder_setup_fields): Handle classes with
9107         explicit size.
9108
9109 2008-09-01 Rodrigo Kumpera  <rkumpera@novell.com>
9110
9111         class.c (mono_class_setup_events): Add memory barrier due to
9112         double checked locking.
9113         
9114         class.c (mono_class_setup_properties): Same.
9115
9116 2008-08-31  Zoltan Varga  <vargaz@gmail.com>
9117
9118         * class.c (mono_class_is_assignable_from): Fix the build.
9119         
9120         * class.c (mono_class_is_assignable_from): Call mono_class_setup_vtable ()
9121         before accessing klass->interface_bitmap. Fixes #421744.
9122
9123 2008-08-28  Zoltan Varga  <vargaz@gmail.com>
9124
9125         * appdomain.c (mono_runtime_set_no_exec): New internal function setting
9126         the runtime into no-exec mode, useful when running the AOT compiler.
9127
9128         * appdomain.c gc.c object.c: Avoid executing managed code when running
9129         in no-exec mode.
9130         
9131         * rawbuffer.c (mono_raw_buffer_load_mmap): Disable this on the iphone.
9132
9133         * reflection.c (_mono_reflection_get_type_from_info): Handle the 
9134         special case when the mono_assembly_loaded () returns NULL because the 
9135         search hook is not installed.
9136
9137 2008-08-25  Zoltan Varga  <vargaz@gmail.com>
9138
9139         * marshal.c: Applied patch from tom hindle (tom_hindle@sil.org) to fix
9140         crashes in bstr marshalling on linux.
9141
9142 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
9143
9144         * debug-helpers.c (mono_type_get_desc): Fix printing of generic instances
9145         with more than one parameter.
9146
9147 2008-08-24  Miguel de Icaza  <miguel@novell.com>
9148
9149         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup): Disable
9150         start/stop flow control as well when turning off ICANON (allows
9151         C-s and C-q to be read by Console.ReadKey).
9152
9153 2008-08-24  Zoltan Varga  <vargaz@gmail.com>
9154
9155         * class.c (mono_class_init): Move the initialization of nested classes
9156         into mono_class_get_nested_types (). Fixes #418433.
9157
9158         * class-internals.h (struct _MonoClass): Add a new 'nested_classes_inited'
9159         flag.
9160
9161         * class.c reflection.c icall.c: Use mono_class_get_nested_types () for 
9162         iterating tough the nested classes of a class.
9163
9164 2008-08-23  Zoltan Varga  <vargaz@gmail.com>
9165
9166         * class.c (mono_class_generic_sharing_enabled): Enable generic sharing
9167         on arm.
9168
9169 2008-08-22  Miguel de Icaza  <miguel@novell.com>
9170
9171         * console-io.c (sigcont_handler): Support signal chaining for
9172         SIGCONT.
9173
9174         (console_set_signal_handlers): Use best practices with sigaction,
9175         clear the structure before using it. 
9176
9177 2008-08-22  Robert Jordan  <robertj@gmx.net>
9178
9179         * console-io.c (ves_icall_System_ConsoleDriver_TtySetup):
9180         Fix the Windows build.
9181
9182 2008-08-22  Zoltan Varga  <vargaz@gmail.com>
9183
9184         * class.c (mono_class_generic_sharing_enabled): Make the default
9185         sharing mode 'corlib'.
9186
9187 2008-08-21  Zoltan Varga  <vargaz@gmail.com>
9188
9189         * console-io.c (console_set_signal_handlers): Fix a warning.
9190
9191         * marshal.c (mono_marshal_get_synchronized_wrapper): Call the wrapper
9192         method normally, the JIT will take care of avoiding recursion.
9193
9194 2008-08-20  Bill Holmes  <billholmes54@gmail.com>
9195
9196         * console-io.c : Fixing builds for platforms that do not have <termios.h>.
9197
9198         Code is contributed under MIT/X11 license.
9199
9200 2008-08-20  Miguel de Icaza  <miguel@novell.com>
9201
9202         * console-io.c (sigcont_handler): We need to restore the entire
9203         termios state, not only the original settings, as things like echo
9204         can be controlled after this (Booish exposes this issue with its
9205         own ReadLine implementation).
9206
9207         Additionally, we need to set the terminal back into keypad_xmit
9208         mode.
9209         
9210         (ves_icall_System_ConsoleDriver_TtySetup): Take the keypad xmit
9211         string as a paramter as well.   Otherwise we get different
9212         keyboard sequences.
9213
9214 2008-08-20  Zoltan Varga  <vargaz@gmail.com>
9215
9216         * marshal.c (emit_marshal_object): Avoid managed-to-native marshalling of
9217         delegates with byref out parameter passing. Fixes #351520.
9218
9219         * debug-helpers.c (mono_context_get_desc): New helper function to stringify
9220         a generic context.
9221         (mono_type_get_desc): Add the type arguments for GENERICINST.
9222         (mono_method_full_name): Stringify the class name using mono_type_full_name
9223         so it picks up generic arguments.
9224
9225 2008-08-19  Gert Driesen  <drieseng@users.sourceforge.net>
9226
9227         * console-io.c: Removed debug output.
9228
9229 2008-08-19 Rodrigo Kumpera  <rkumpera@novell.com>
9230
9231         reflection.c (mono_reflection_create_runtime_class): Alloc
9232         the nested classes linked list using the dynamic image mempool.
9233         Fixes leak in corlib compilation.
9234
9235 2008-08-19  Miguel de Icaza  <miguel@novell.com>
9236
9237         * console-io.c: Fix incredibly annoying behavior on the console
9238         after resuming execution after control-z.   This affected every
9239         console application.
9240
9241 2008-08-18 Rodrigo Kumpera  <rkumpera@novell.com>
9242
9243         * mempool-internals.h: Header for mono private mempool functions. The first
9244         two function are for allocating glib linked lists using pools.
9245
9246         * mempool.c: Added g_list_prepend_mempool and g_slist_prepend_mempool.
9247
9248         * Makefile.am: Added mempool-internals.h.
9249
9250 2008-08-16  Zoltan Varga  <vargaz@gmail.com>
9251
9252         * domain.c (mono_domain_create): Call the JIT domain hook if installed.
9253         (mono_domain_free): Ditto.
9254
9255         * domain-internals.h (struct _MonoDomain): Add 'runtime_info' field, this could
9256         be used by the JIT to store its domain-specific information, instead of putting
9257         it directly into MonoDomain.
9258
9259         * domain.c (mono_install_create_domain_hook): New helper function to install
9260         a hook which initializes domain->runtime_info.
9261
9262         * domain.c (mono_install_free_domain_hook): Ditto.
9263         
9264 2008-08-15  Zoltan Varga  <vargaz@gmail.com>
9265
9266         * marshal.c (mono_delegate_end_invoke): Raise an exception instead of
9267         asserting if the ares parameter is null.
9268
9269         * mono-perfcounters.c: Fix warnings.
9270
9271         * marshal.c (mono_marshal_get_delegate_begin_invoke): Don't set save_lmf, it
9272         is not needed, don't check for interruptions either.
9273         (mono_marshal_get_delegate_end_invoke): Ditto.
9274
9275 2008-08-15  Marek Habersack  <mhabersack@novell.com>
9276
9277         * mono-perfcounters.c (predef_readonly_counter): added support for
9278         reading the ASP.NET Requests Queued counter from another process.
9279
9280 2008-08-12  Zoltan Varga  <vargaz@gmail.com>
9281
9282         * metadata-internals.h: Move the 'aot_module' field from MonoAssembly to
9283         MonoImage to simplify the AOT code.
9284
9285 2008-08-10  Zoltan Varga  <vargaz@gmail.com>
9286
9287         * marshal.c (emit_marshal_object): Implement native-to-managed StringBuilder
9288         marshalling. Fixes #416078.
9289
9290 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9291         
9292         * marshal.c (mono_marshal_get_native_wrapper): Add an 'aot' argument, when
9293         it is set, looking up the icall address is deferred to the JIT, since 
9294         in embedded scenarios, the icall might not be registered in the runtime
9295         doing the AOT compilation. Backported from the 2.0 branch.
9296
9297 2008-08-08  Zoltan Varga  <vargaz@gmail.com>
9298
9299         * marshal.c (mono_remoting_wrapper): Handle nullable types correctly.
9300         Fixes #415621.
9301
9302 2008-08-05  Marek Habersack  <mhabersack@novell.com>
9303
9304         * Makefile.am: added support for cross-compilation.
9305
9306 2008-08-04  Zoltan Varga  <vargaz@gmail.com>
9307
9308         * socket-io.c (get_socket_assembly): Make 'moonlight' variable static.
9309
9310 Fri Aug 1 18:47:48 CEST 2008 Paolo Molaro <lupus@ximian.com>
9311
9312         * mono-perfcounters.c: jitted methods and jitted bytes counters.
9313
9314 Fri Aug 1 16:07:09 CEST 2008 Paolo Molaro <lupus@ximian.com>
9315
9316         * class-internals.h, icall-def.h, mono-perfcounters-def.h,
9317         mono-perfcounters.c: performance counters implementation.
9318
9319 2008-07-31  Zoltan Varga  <vargaz@gmail.com>
9320
9321         * metadata-internals.h (struct _MonoAssembly): Change the type of 'aot_module'
9322         to gpointer, letting the AOT code decide what to store in it.
9323
9324 2008-07-31  Bill Holmes  <billholmes54@gmail.com>
9325
9326         * marshal.c (cominterop_get_native_wrapper) : Adding a call to 
9327           mono_class_setup_methods if the methods are not initialized.
9328
9329         Code is contributed under MIT/X11 license.
9330
9331 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9332
9333         * verify.c: Remove some debug code I commited by accident.
9334
9335         * verify.c (mono_method_is_valid_in_context): Change the return value
9336         to make possible to distinguish between invalid and unverifiable.
9337
9338         * verify.c (verifier_load_method): Don't return NULL for unverifiable
9339         methods.
9340
9341 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9342
9343         * verify.c (mono_generic_param_is_constraint_compatible): Inflate type
9344         constraints. Fixes regression in gtest-253.
9345
9346 2008-07-30 Rodrigo Kumpera  <rkumpera@novell.com>
9347
9348         * verify.c (mono_verifier_verify_class): Don't allow generic types
9349         with explicit layout.
9350
9351         * verify.c (mono_method_verify): Check locals and argument types.
9352
9353 2008-07-29  Zoltan Varga  <vargaz@gmail.com>
9354
9355         * monitor.c (mono_monitor_try_enter_internal): Allow nterruption of the
9356         wait if the thread is in StopRequested state.
9357
9358         * class.c (mono_class_from_name): Refactor the module searching code into
9359         a separate function so it can be reused in the AOT case too.
9360
9361 2008-07-28 Rodrigo Kumpera  <rkumpera@novell.com>
9362
9363         * verify.c (mono_type_is_valid_in_context): Improve the error message.
9364         Check both the type and it's generic type definition for loader errors.
9365         
9366         * verify.c (mono_method_is_valid_in_context): Don't generate another
9367         error when a type errors occur, this leads to the wrong exception been
9368         thrown.
9369
9370 2008-07-28  Dick Porter  <dick@ximian.com>
9371
9372         * icall-def.h
9373         * process.c
9374         (ves_icall_System_Diagnostics_Process_ProcessHandle_duplicate):
9375         New internal calls to duplicate and close a process handle.
9376
9377 2008-07-27  Andreas Färber  <andreas.faerber@web.de>
9378
9379         * object.c (CHECK_ADD_OVERFLOW_UN): Add missing bracket. Fixes #412499.
9380
9381 2008-07-27  Zoltan Varga  <vargaz@gmail.com>
9382
9383         * appdomain.c (unload_thread_main): Attach the unload thread to the runtime.
9384
9385 2008-07-27  Robert Jordan  <robertj@gmx.net>
9386
9387         * class.c (mono_class_init): Don't compute class.has_finalize for
9388         valuetypes. Fixes #412477.
9389
9390 2008-07-25 Rodrigo Kumpera  <rkumpera@novell.com>
9391
9392         * verify.c: Implement constraint equivalence checking.
9393         This is required when a generic parameter is used as
9394         argument to a constrained one.
9395
9396         Fixes #410637.
9397
9398 2008-07-24  Zoltan Varga  <vargaz@gmail.com>
9399
9400         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
9401
9402         * domain-internals.h (struct _MonoDomain): Add 'method_code_hash' field.
9403
9404         * object-internals.h (struct _MonoDelegate): Add 'method_code' field,
9405         synch with managed object layout.
9406
9407 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9408
9409         * verify.c (do_branch_op): Handle valuetypes and generic
9410         arguments properly.
9411
9412         * verify.c (do_cmp_op): Same.
9413
9414         Fixes #410383.
9415
9416 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9417
9418         * generic-sharing.c: Fix memory leaks.
9419
9420         * class.c, class-internals.h: Make
9421         mono_class_inflate_generic_type_with_mempool() non-static.
9422
9423 2008-07-24 Rodrigo Kumpera  <rkumpera@novell.com>
9424
9425         * pedump.c (dump_verify_info): Dump full class name.
9426
9427 2008-07-24  Mark Probst  <mark.probst@gmail.com>
9428
9429         * generic-sharing.c: Removed some old code that didn't do anything.
9430
9431 2008-07-24  Massimiliano Mantione  <massi@ximian.com>
9432         * profiler.c: Added runtime_initialized_event,
9433         mono_profiler_install_runtime_initialized and
9434         mono_profiler_runtime_initialized. This new hook tells the profiler
9435         when the runtime is sufficiently initialized to be able to call
9436         mono_thread_attach on the root appdomain.
9437         * profiler.h, profiler-private.h: Likewise.
9438
9439 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9440
9441         * verify.c (do_cast): Do boxing for generic arguments as well.
9442
9443         * class.c (is_nesting_type): Drop generic instantiations before
9444         checking for nesting.
9445
9446         * class.c (can_access_instantiation): Allow access to generic
9447         arguments.
9448
9449 2008-07-23 Rodrigo Kumpera  <rkumpera@novell.com>
9450
9451         * verify.c (verify_class_for_overlapping_reference_fields):
9452         On some cases, the field size might be zero, guard against that.
9453         Fix the explicit layout check to work as expected.
9454
9455 2008-07-23  Zoltan Varga  <vargaz@gmail.com>
9456
9457         * threads.c (ves_icall_System_Threading_Thread_Abort): Avoid calling 
9458         mono_thread_resume () during shutdown, since the thread we want to abort
9459         might be suspended.
9460
9461 2008-07-22  Zoltan Varga  <vargaz@gmail.com>
9462
9463         * mono-debug-debugger.c (mono_debugger_check_breakpoints): Fix a 
9464         warning.
9465
9466         * debug-mono-symfile.c: Fix a warning.
9467
9468         * mono-perfcounters.c (get_cpu_times): Fix a warning.
9469
9470         * object.c (mono_class_vtable): Check if exception_type is set, and return
9471         NULL as defined by the function comments.
9472
9473 2008-07-22  Mark Probst  <mark.probst@gmail.com>
9474
9475         * mempool.c: Use malloc for every single mempool allocation if the
9476         configure option is set.  This makes it easier to track mempool
9477         allocations with tools like Valgrind.
9478
9479 2008-07-22  Jb Evain  <jbevain@novell.com>
9480
9481         * reflection.c (create_dynamic_mono_image): emit the same
9482         metadata version that SL2 does when creating a SL2 image.
9483
9484 2008-07-21 Rodrigo Kumpera  <rkumpera@novell.com>
9485
9486         * icall-def.h:
9487         * icall.c: New icall System.Enum:get_hashcode. This function
9488         avoids the overhead of boxing the enum to the underlying type.
9489
9490 2008-07-21  Mark Probst  <mark.probst@gmail.com>
9491
9492         * reflection.c (mono_method_get_object): Don't let static RGCTX
9493         invoke wrappers get into MonoReflectionMethods.
9494
9495 2008-07-17 Rodrigo Kumpera  <rkumpera@novell.com>
9496
9497         * object-internals.h:
9498         * object.c: New mono_runtime_class_init_full function
9499         that makes throwing the exception optinal.
9500
9501         * class-internals.h: New exception type MONO_EXCEPTION_OBJECT_SUPPLIED
9502         for the case where the exception object is supplied.
9503
9504 2008-07-16  KornĂ©l Pál  <kornelpal@gmail.com>
9505
9506         * coree.h: Define __ImageBase as _image_base__ on cygwin that fixes build with
9507         old ld versions.
9508
9509         Contributed under MIT/X11 license.
9510
9511 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9512
9513         * string-icalls.c (ves_icall_System_String_InternalSplit):
9514         Optimize array allocation by caching the MonoClass of the
9515         array type.
9516
9517         * icall.c (ves_icall_Type_GetMethodsByName): Same.
9518
9519         * reflection.c (mono_param_get_objects): Same.
9520
9521 2008-07-16 Rodrigo Kumpera  <rkumpera@novell.com>
9522
9523         * icall-def.h:
9524         * icall.c: New ves_icall_MonoGenericClass_InflateType icall.
9525         It inflates the given type using the class context.
9526
9527 2008-07-15 Rodrigo Kumpera  <rkumpera@novell.com>
9528
9529         * object.c (mono_class_try_get_vtable): New function. Tries to fetch
9530         the vtable if it already exists.
9531
9532         * object-internals.h: Add mono_class_try_get_vtable as part of the
9533         internal API.
9534
9535         * reflection.c (mono_type_get_object): Use the MonoObject from the
9536         vtable when possible. Reduces locking contention on reflection heavy
9537         code.
9538
9539 2008-07-15  Zoltan Varga  <vargaz@gmail.com>
9540
9541         * decimal.c (my_g_bit_nth_msf): Implement this directly without calling
9542         g_bit_nth_msf () since that macro is not implemented in eglib.
9543
9544 2008-07-13  Zoltan Varga  <vargaz@gmail.com>
9545
9546         * class.c (mono_class_generic_sharing_enabled): Always disable generic sharing
9547         on platforms which do not support it.
9548
9549 2008-07-12  Zoltan Varga  <vargaz@gmail.com>
9550
9551         * marshal.c (mono_signature_to_name): Encode sig->hasthis as well.
9552
9553 2008-07-11  Martin Baulig  <martin@ximian.com>
9554
9555         * mono-debug-debugger.h
9556         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_INTERRUPTION_REQUEST'.
9557
9558         * mono-debug-debugger.c
9559         (_mono_debugger_interruption_request): New global volatile variable.
9560         (mono_debugger_check_interruption): New public function.
9561
9562         * threads.c
9563         (mono_thread_current_check_pending_interrupt): Call
9564         mono_debugger_check_interruption().
9565         (mono_thread_interruption_checkpoint_request): Likewise.
9566
9567 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9568
9569         * verify.c: Add more type checks for loaded types. Verify the result
9570         handle from ldtoken.
9571
9572 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9573
9574         * loader.c (field_from_memberref): Don't crash if the field
9575         wasn't found.
9576
9577 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9578
9579         * verify.c: Verify if type and method instantiations
9580         don't have invalid VAR or MVAR arguments.
9581
9582 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9583
9584         * verify.c: Fix double free of function pointer list.
9585
9586 2008-07-11 Rodrigo Kumpera  <rkumpera@novell.com>
9587
9588         * object.c (mono_string_to_utf8): Comment the new code as it
9589         breaks under eglib.
9590
9591 2008-07-08 Rodrigo Kumpera  <rkumpera@novell.com>
9592
9593         * object.c (mono_string_to_utf8): Avoid allocating a temp array.
9594
9595 2008-07-07  Bill Holmes  <billholmes54@gmail.com>
9596
9597         * threads.c : Thread.Interrupt changes to ensure that ThreadInterruptedException
9598           is not throw too many times.
9599
9600         Code is contributed under MIT/X11 license.
9601
9602 2008-07-07  Zoltan Varga  <vargaz@gmail.com>
9603
9604         * mono-debug.c (mono_debug_find_method): Allow this to be called even when
9605         debugging is turned off.
9606
9607 2008-07-06  Zoltan Varga  <vargaz@gmail.com>
9608
9609         * generic-sharing.c (mono_method_lookup_rgctx): Fix a warning.
9610
9611 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9612
9613         * class-internals.h, class.c: Added new generic sharing option:
9614         Share only stuff in System.Collections.Generic, which is now the
9615         default.
9616
9617 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9618
9619         * generic-sharing.c, class-internals.h: New function for getting a
9620         generic method in a generic class given the corresponding method
9621         for a different instantiation of the class.  Partly refactored
9622         from mini-trampolines.c.
9623
9624         * class.c: Make sure generic methods have a class_inst if they are
9625         part of a generic class.
9626
9627         * metadata.c (mono_type_stack_size_internal): Handle type
9628         variables.
9629
9630 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9631
9632         * domain-internals.h: New field (has_this) in MonoGenericJitInfo.
9633         Signifies whether information on the this/vtable/mrgctx variable
9634         is available.
9635
9636 2008-07-04  Mark Probst  <mark.probst@gmail.com>
9637
9638         * object.c, object-internals.h, icall.c: New function
9639         mono_delegate_ctor_with_method(), which does the same as
9640         mono_delegate_ctor(), but takes an explicit method argument
9641         instead of taking the method from the jit info.
9642
9643         * marshal.c: When creating a delegate with an inflated method take
9644         the "this" argument as the target class for the castclass.
9645
9646 2008-07-03  Mark Probst  <mark.probst@gmail.com>
9647
9648         * domain.c (mono_jit_info_table_find): Fixed a bug that caused
9649         mono_jit_info_table_find() to perform very badly in some cases.
9650
9651 2008-07-02  Zoltan Varga  <vargaz@gmail.com>
9652
9653         * icall.c (type_from_typename): Handle 'string'.
9654
9655         * marshal.c (mono_marshal_get_runtime_invoke): Don't insert runtime invoke
9656         wrappers into the wrapper_hash, since the key is not a MonoMethod.
9657
9658 2008-07-01  Zoltan Varga  <vargaz@gmail.com>
9659
9660         * icall.c (mono_get_jit_icall_info): New function to return the jit icall hash table.
9661
9662         * *-gc.c (mono_gc_get_managed_allocator_types): New function to return the
9663         number of available managed allocator types.
9664
9665         * marshal.c (mono_marshal_init): Register Thread:ResetAbort as an icall ().
9666         (mono_marshal_get_runtime_invoke): Call ResetAbort as an icall.
9667
9668 2008-06-30  Zoltan Varga  <vargaz@gmail.com>
9669
9670         * domain-internals.h (struct _MonoDomain): Add 'jit_code_hash_lock' field,
9671         which is a low level lock protecting just the 'jit_code_hash' hash table.
9672
9673         * domain.c: Initialize+cleanup jit_code_hash_lock.
9674         
9675 2008-06-30  KornĂ©l Pál  <kornelpal@gmail.com>
9676
9677         * coree.c (mono_load_coree): Set coree_module_handle global variable only
9678         after initialization.
9679
9680         * coree.h: Make MonoFixupExe internal.
9681
9682         Contributed under MIT/X11 license.
9683
9684 2008-06-30  KornĂ©l Pál  <kornelpal@gmail.com>
9685
9686         * coree.c (_CorValidateImage): Retain IMAGE_DIRECTORY_ENTRY_SECURITY
9687         because that is platform independent. Check NumberOfRvaAndSizes in PE32
9688         as well.
9689         (MonoLoadImage): New wrapper function around LoadLibrary to ensure that the
9690         image being loaded is a CLI image and _CorValidateImage gets called.
9691
9692         * coree.h: Add MonoLoadImage.
9693
9694         * image.c (mono_image_open_full): Load CLI images using MonoLoadImage
9695         instead of LoadLibrary.
9696
9697         Contributed under MIT/X11 license.
9698
9699 2008-06-29 Rodrigo Kumpera  <rkumpera@novell.com>
9700
9701         * icall.c (ves_icall_System_ValueType_Equals): Avoid allocating objects
9702         for any primitive type.
9703
9704 2008-06-29  Zoltan Varga  <vargaz@gmail.com>
9705
9706         * object.c (mono_array_new_specific): Optimize this and the other allocation
9707         functions a bit.
9708         
9709         * object.c (mono_class_create_runtime_vtable): Use typed allocation in other
9710         domains too if mono_dont_free_domains is set.
9711
9712         * domain-internals.h (mono_dont_free_domains): New internal option controlling
9713         whenever to free appdomain data after it has been unloaded.
9714
9715         * domain.c (mono_domain_free): Don't free appdomain data if the option is set.
9716         
9717 2008-06-28  Zoltan Varga  <vargaz@gmail.com>
9718
9719         * icall.c (ves_icall_System_Enum_get_underlying_type): New icall.
9720         (mono_method_get_equivalent_method): Fix a warning.
9721
9722         * object.c (mono_message_init): Avoid looking up array types for each call.
9723
9724 2008-06-27  Zoltan Varga  <vargaz@gmail.com>
9725
9726         * object.c (mono_message_invoke): Avoid looking up the object[] type for each
9727         call.
9728
9729         * icall.c (ves_icall_System_ValueType_Equals): Optimize the comparison of enums
9730         even more.
9731
9732         * class.c (mono_class_get_fields): Avoid calling setup_fields_locking () for
9733         each iteration.
9734
9735         * icall.c (ves_icall_System_ValueType_Equals): Avoid traversing all the static
9736         fields of an enum.
9737
9738 2008-06-26 Rodrigo Kumpera  <rkumpera@novell.com>
9739
9740         * object.c (mono_value_box): Fix boxing of nullables.
9741
9742 2008-06-26  KornĂ©l Pál  <kornelpal@gmail.com>
9743
9744         * assembly.c (mono_set_rootdir): Use __ImageBase instead of
9745         mono_module_handle that is defined by the linker; no initialization required.
9746         * coree.h: Remove mono_module_handle, add __ImageBase, update
9747         mono_image_open_from_module_handle.
9748         * coree.c (_CorValidateImage): Convert platform independent PE32 images to
9749         PE32+ on 64-bit Windows that makes the OS able to load CIL images as modules.
9750         (MonoFixupCorEE): Export Address Table RVAs are 32-bit unsigned integers so
9751         memory has to be allocated for trampolines (x64) or procedure labels (IA64) up
9752         to 4 GB away from image base address. IA64 version is not tested but was very
9753         easy to implement and should work if we ever need it.
9754         * domain.c (mono_init_internal): Avoid system error message boxes.
9755         * image.c (mono_image_open_from_module_handle): Replace ref_count argument
9756         with has_entry_point. Handle do_mono_image_load fauilre correctly.
9757         (mono_image_open_full, mono_image_close): Use has_entry_point instead of
9758         coff_attributes that is a more reliable way to detect if _CorDllMain was called.
9759         * metadata-internals.h: Add has_entry_point to _MonoImage on Windows.
9760
9761         Contributed under MIT/X11 license.
9762
9763 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9764
9765         * class.c, class-internals.h: Export mono_class_get_generic_type_definition
9766         as part of the private mono API.
9767         
9768         * loader.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandleInternalType):
9769         Do proper argument checking for methods that belong to generic classes.
9770         Do proper type resolution for GMFH/2.
9771         Fixes #377324.
9772         
9773 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9774
9775         * verify.c (do_switch): Fix a memory corruption bug with
9776         the jump index is out of bound.
9777
9778 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9779
9780         * verify.c: Disable debug code.
9781
9782 2008-06-25 Rodrigo Kumpera  <rkumpera@novell.com>
9783
9784         * reflection.c (mono_image_get_methodbuilder_token): Use
9785         mono_image_get_methodspec_token_for_generic_method_definition
9786         instead of mono_image_get_memberref_token. We cache more memberef
9787         entries now.
9788
9789 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9790
9791         * verify.c: Inflate exception clause types.
9792         Fixes #402606.
9793         
9794 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9795
9796         * reflection.c (mono_image_get_methodbuilder_token): Don't leak
9797         name.
9798
9799         * reflection.c (mono_image_get_ctorbuilder_token): Same.
9800
9801         * reflection.c (mono_image_create_method_token): Same.
9802
9803 2008-06-24 Rodrigo Kumpera  <rkumpera@novell.com>
9804
9805         * reflection.c: Added mono_image_get_methodref_token_for_methodbuilder.
9806         It does the same as mono_image_get_methodref_token but works on
9807         MethodBuilder.
9808
9809         * reflection.c: Use mono_image_get_methodspec_token_for_generic_method_definition
9810         and always generate a methodspec. This follows the old behavior and fixes
9811         the regressions in System.Core. 
9812
9813 2008-06-24  Zoltan Varga  <vargaz@gmail.com>
9814
9815         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Collect exceptions for classes where 
9816         don't event mono_class_get () succeeds. Fixes #402182.
9817
9818 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9819
9820         * metadata-internals.h: Added MonoDynamicImage::methodspec
9821         hashtable to store methodspec tokens created for MethodBuilders.
9822
9823         * reflection.c (mono_image_get_methodbuilder_token): Encode generic
9824         MethodBuilders as open instantiations if a methodspec was requested.
9825
9826         * reflection.c (fixup_method): Skip MethodBuilder with methodspec tokens.
9827
9828         * reflection.c (create_dynamic_mono_image): Create the methodspec hashtable.
9829
9830         * reflection.c (mono_dynamic_image_free): Release the methodspec hashtable.
9831
9832         Fixes bug #349190.
9833
9834 2008-06-20 Rodrigo Kumpera  <rkumpera@novell.com>
9835
9836         * loader.c (method_from_methodspec): Avoid crashing if the
9837         method lookup fails.
9838
9839 2008-06-20  Dick Porter  <dick@ximian.com>
9840
9841         * socket-io.c (get_socket_assembly): Cope with Moonlight network
9842         classes being in a different assembly.  Fixes bug 399184.
9843
9844 2008-06-20  Zoltan Varga  <vargaz@gmail.com>
9845
9846         * loader.c (mono_loader_init): Make this callable multiple times.
9847         (mono_dllmap_insert): Call mono_loader_init () so this works even before
9848         the runtime is initialized. Fixes #401755.
9849
9850 2008-06-19  Dick Porter  <dick@ximian.com>
9851
9852         * socket-io.c (convert_socketflags): Ignore SocketFlags.Partial.
9853         Fixes bug 349688.
9854
9855 2008-06-19  Dick Porter  <dick@ximian.com>
9856
9857         * socket-io.c:
9858         * icall-def.h: Implement Socket generic Send() and Receive()
9859         methods.  Fixes bug 395168.
9860
9861 2008-06-19  KornĂ©l Pál  <kornelpal@gmail.com>
9862
9863         * icall-def.h, icall.c: Add ves_icall_System_Reflection_Module_GetHINSTANCE.
9864
9865         Contributed under MIT/X11 license.
9866
9867 2008-06-18  Martin Baulig  <martin@ximian.com>
9868
9869         * mono-debug.h (MONO_DEBUGGER_VERSION): Split into
9870         `MONO_DEBUGGER_MAJOR_VERSION' and `MONO_DEBUGGER_MINOR_VERSION';
9871         set to 80.0.  The debugger <-> runtime interface is now frozen as
9872         well.   
9873
9874         * mono-debug.c
9875         (mono_debug_debugger_version): Bump to 4.
9876
9877 2008-06-18  Martin Baulig  <martin@ximian.com>
9878
9879         * debug-mono-symfile.c
9880         (load_symfile): Don't check the minor version.
9881
9882         * debug-mono-symfile.h: Bump the version number to 50.0.
9883
9884 2008-06-18  Martin Baulig  <martin@ximian.com>
9885
9886         * debug-mono-symfile.c
9887         (load_symfile): Treat `MONO_SYMBOL_FILE_MINOR_VERSION' as a
9888         minimum required version.
9889
9890 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9891
9892         * reflection.c (mono_custom_attrs_from_property): Fix support for
9893         retriveving cattrs of dynamic inflated generic types.
9894
9895         * reflection.c (mono_custom_attrs_from_event): Same.
9896
9897         * reflection.c (mono_custom_attrs_from_field): Same;
9898
9899         * reflection.c (typebuilder_setup_events): Same cattrs of events.
9900
9901         * loader.c (-mono_metadata_get_corresponding_field_from_generic_type_definition):
9902         Moved to metadata.c.
9903
9904         * metadata.c: New functions to retrive the equivalent field, event
9905         of property from the generic type definition.
9906
9907         * metadata-internals.h: Added new functions from metadata.c.
9908
9909 2008-06-17 Rodrigo Kumpera  <rkumpera@novell.com>
9910
9911         * reflection.c (mono_custom_attrs_from_builders): Mark MonoCustomAttrInfo
9912         to cached in a mempool is used.
9913
9914         * metadata.c (free_generic_class): In some situations field generic_info type
9915         is not properly dup'ed and leads to double free'ing.
9916
9917         Fixes #400643.
9918
9919 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9920
9921         * marshal.c (mono_marshal_get_static_rgctx_invoke): Also handle
9922         this arguments (will be needed later for generic methods).
9923         Collect stats.
9924
9925 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9926
9927         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal):
9928         Create a static RGCTX invoke wrapper for methods which require it.
9929
9930 2008-06-17  Mark Probst  <mark.probst@gmail.com>
9931
9932         * object.c, class-internals.h: New function for checking whether
9933         an individual field is special static.
9934
9935 2008-06-15  Zoltan Varga  <vargaz@gmail.com>
9936
9937         * metadata.c (mono_metadata_get_generic_param_row): Use bsearch instead of
9938         linear search since the table is sorted.
9939
9940         * gc.c (mono_gc_cleanup): Abort the finalizer thread more gracefully.
9941         Fixes #324180.
9942
9943 2008-06-14  Zoltan Varga  <vargaz@gmail.com>
9944
9945         * appdomain.c (unload_thread_main): Applied patch from Tim Howard 
9946         (timh@ict.om.org). Remove the timeouts when waiting for appdomains to unload.
9947
9948         * gc.c (mono_domain_finalize): Allow an infinite timeout.
9949
9950         * threads.c (mono_threads_abort_appdomain_threads): Ditto.
9951         
9952         * threads.c (mono_thread_request_interruption): Get rid of locking, use
9953         InterlockedCompareExchange to query and modify 
9954         thread->interruption_requested.
9955
9956         * object-internals.h (struct _MonoThread): Change interruption_requested
9957         to a gint32 so it can be modified by atomic operations. Add 
9958         'critical_region_level' from the managed side, change small_id to a guint32,
9959         add new set of 'unused' fields.
9960
9961         * appdomain.c: Bump corlib version.
9962
9963 2008-06-13  Zoltan Varga  <vargaz@gmail.com>
9964
9965         * class.c (mono_class_from_name): Search modules as well. Fixes
9966         #322332.
9967
9968 2008-06-13  Mark Probst  <mark.probst@gmail.com>
9969
9970         * generic-sharing.c: Code for maintaining the MRGCTX and MRGCTX
9971         templates.  Templates are generalized with an additional type_argc
9972         argument.  RGCTX templates have type_argc==0, MRGCTX templates
9973         have type_argc>0.
9974
9975         * domain-internals.h, domain.c: New hash table for looking up
9976         MRGCTXs.
9977
9978         * metadata.c, metadata-internals.h: Rename hash and equal
9979         functions for MonoGenericInst's and make them public.
9980
9981         * class-internals.h: New data structures for the MRGCTX.  Macros
9982         for distinguishing slots in the RGCTX and the MRGCTX.
9983
9984 2008-06-13  Mark Probst  <mark.probst@gmail.com>
9985
9986         * object.c (mono_method_get_imt_slot): Put the same methods of
9987         different instantiations of the same generic interface in the same
9988         IMT slots, to make generic sharing simpler.
9989
9990 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
9991
9992         * metadata-internals.h: Added mono_metadata_field_info_with_mempool.
9993
9994         * metadata.c (mono_metadata_field_info_with_mempool): Added.
9995         This function works just like mono_metadata_field_info, but
9996         accept a mempool as argument to be used allocating memory.
9997
9998         * marshal.c (mono_marshal_load_type_info): Use new function
9999         to load marshal data into image mempool.
10000
10001 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
10002
10003         * class.c (mono_class_inflate_generic_type_with_mempool):
10004         This function allows to inflate a generic type using
10005         a mempool.
10006
10007         * class.c (inflate_generic_type): Take a mempool as argument
10008         and use it to do type dup'ing.
10009
10010         * class.c (mono_class_setup_fields): Field type for generic
10011         generic classes are allocated from the image mempool.
10012
10013         * metadata.c (free_generic_class): Inflated field type is
10014         now allocated in the image mempool.
10015
10016 2008-06-12 Rodrigo Kumpera  <rkumpera@novell.com>
10017
10018         * threads.c (thread_cleanup): Free MonoThread::name.
10019
10020 2008-06-12  Marek Habersack  <mhabersack@novell.com>
10021
10022         * appdomain.c (ensure_directory_exists): avoid unnecessary
10023         mkdir(2) calls when the shadow directory already exists.
10024         (mono_make_shadow_copy): copy also satellite assemblies from the
10025         private bin directories.
10026
10027 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
10028
10029         * threads.c (mono_thread_get_stack_bounds): Align the stack in all cases.
10030         
10031         * threads.c (mono_thread_get_stack_bounds): Align the stack address to
10032         a page boundary. Fixes #396219.
10033
10034 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10035
10036         * marshal.c (mono_marshal_load_type_info): Add a memory barrier
10037         due to double-checked locking.
10038
10039 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10040
10041         * assembly.c (build_assembly_name): Release memory on failure.
10042
10043         * assembly.c (mono_assembly_name_parse_full): Release memory on failure.
10044
10045 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10046
10047         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Release
10048         memory on failure.
10049
10050 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10051
10052         * icall.c (ves_icall_System_Reflection_AssemblyName_ParseName): Release
10053         memory on failure.
10054
10055 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10056
10057         * loader.c (field_from_memberref): Check if field signature type is equal
10058         to the non-inflated type of the field. Fixes #398980.
10059
10060 2008-06-11  Zoltan Varga  <vargaz@gmail.com>
10061
10062         * assembly.c (mono_assembly_load_from_full): Call 
10063         mono_assembly_load_friends () outside the assemblies lock, since it can
10064         acquire the loader lock. Fixes #323696.
10065
10066         * reflection.c (resolve_object): Inflate the inst with the context for
10067         FieldOnTypeBuilderInst. Fixes #399010.
10068
10069 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10070
10071         * reflection.c (mono_image_get_field_on_inst_token): Don't
10072         inflate the field to encode it's signature. If it's a
10073         VAR or MVAR it should stay that way in the signature.
10074         Fixes #399047.
10075
10076 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10077
10078         * reflection.c (resolve_object): Release memory of inflated types.
10079
10080 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10081
10082         * loader.c (mono_method_get_signature_full): Remove assert about
10083         loading a methodspec to a generic method. We have such methods, such as
10084         System.Threading.Interlocked::CompareExchange<T>.
10085         This assert was removed since it crashes the verifier when it checks
10086         methods calling CompareExchange<T>.
10087
10088 2008-06-10  Marek Safar  <marek.safar@gmail.com>
10089
10090         * icall.c (ves_icall_MonoMethod_GetGenericArguments): Creates an instance
10091         of Type array and not MonoType.
10092
10093 2008-06-10  Marek Habersack  <mhabersack@novell.com>
10094
10095         * profiler.c: fix a segfault on shutdown. Patch from Paolo Molaro
10096         <lupus@ximian.com>
10097
10098 2008-06-10  Martin Baulig  <martin@ximian.com>
10099
10100         * debug-mono-symfile.h
10101         (MONO_SYMBOL_FILE_MINOR_VERSION): Bump to 6.  There were no
10102         changes to the file format, but we were generating incorrect
10103         source file indices in the line number table due to a bug, which
10104         made backtraces report an incorrect source file.
10105
10106 2008-06-10 Rodrigo Kumpera  <rkumpera@novell.com>
10107
10108         * mono-debug.c: Moved mono_debug_free_method_jit_info from
10109         mini/debug-mini.c to here.
10110
10111         * mono-debug.c (il_offset_from_address): Free memory from find_method.
10112
10113         * mono-debug.h: Export mono_debug_free_method_jit_info, users should
10114         use it to release structs returned by mono_debug_find_method.
10115
10116 2008-06-10  Zoltan Varga  <vargaz@gmail.com>
10117
10118         * class.c (mono_class_setup_vtable): Call setup_methods even for interfaces
10119         since it needs to set method->slot for all interface methods.
10120
10121 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10122
10123         * class-internals.h: Forgot to add.
10124
10125 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10126
10127         * class-internals.h: Added MONO_PROP_DYNAMIC_CATTR.
10128
10129         * reflection.c (lookup_custom_attr): Added a MonoImage argument.
10130         Lookup the custom attributes from property_hash.
10131
10132         * reflection.c (mono_save_custom_attrs): Save the custom attributes
10133         in property_hash. Allocate all data using the image mempool.
10134
10135         * reflection.c: Removed dynamic_custom_attrs. Changed all checks
10136         for dynamic_custom_attrs to checks if the image is dynamic.
10137
10138 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
10139
10140         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Free the
10141         assemblies array.
10142         
10143         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Avoid calling
10144         runtime functions while holding the domain assemblies lock.
10145
10146 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10147
10148         * verify.c: Reapplied the last bit of the reverted changes.
10149
10150 2008-06-09 Rodrigo Kumpera  <rkumpera@novell.com>
10151
10152         * verify.c: Reapplied more of the reverted changes.
10153
10154 2008-06-09  Martin Baulig  <martin@ximian.com>
10155
10156         * debug-mono-symfile.c (load_symfile): Check the major version
10157         first; if it's wrong, don't print the minor version in the error message.
10158
10159 2008-06-09  Zoltan Varga  <vargaz@gmail.com>
10160
10161         * appdomain.c (set_domain_search_path): Make this use the domain assemblies
10162         lock instead of the domain lock to avoid deadlocks, since the thread might
10163         already hold the loader lock.
10164
10165         * threads.c (start_wrapper): Call mono_monitor_init_tls ().
10166         (mono_thread_attach): Ditto.
10167
10168         * monitor.c: Use a TLS variable for holding the current thread id instead
10169         of calling pthread_self ().
10170         (mono_monitor_init_tls): New internal function to initialize the TLS
10171         variable.
10172         (mono_monitor_try_enter_internal): Put the owner == id check after the
10173         owner == 0 check.
10174
10175         * object-internals.h (_G_BOOLEAN_EXPR): Redefine this glib macro to avoid
10176         missed optimizations when using gcc-4.3.
10177
10178 2008-06-08 Rodrigo Kumpera  <rkumpera@novell.com>
10179
10180         * reflection.c (mono_dynamic_image_free): Free the memory
10181         used by MonoGenericParam in MonoDynamicImage::gen_param.
10182
10183         * reflection.c (mono_reflection_setup_generic_class): Allocate
10184         container from mempool.
10185
10186         * reflection.c (mono_reflection_initialize_generic_parameter): Allocate
10187         container from mempool.
10188
10189 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
10190
10191         * threads.c (mono_set_pending_exception): New internal function to set the
10192         pending exception of the current thread.
10193         (mono_thread_get_and_clear_pending_exception): Check for 
10194         thread->pending_exception as well.
10195
10196         * object-internals.h (struct _MonoThread): Add 'pending_exception' field.
10197
10198         * boehm-gc.c (mono_gc_base_init): Set GC_no_dls before calling GC_init () since
10199         it can trigger a collection.
10200
10201 2008-06-06  Martin Baulig  <martin@ximian.com>
10202
10203         Merged the `debugger-kahalo' branch.
10204
10205         * mono-debug.h
10206         (MONO_DEBUGGER_VERSION): Bumped to 72.
10207
10208         * debug-mono-symfile.h
10209         (MonoSymbolFileMethodIndexEntry): Removed.
10210         (MonoSymbolFileMethodEntry): New public typedef.
10211         (MonoSymbolFileOffsetTable): Added `_is_aspx_source'.
10212         (MonoSymbolFileSourceEntry): Remove everything except `index' and
10213         `data_offset'.
10214         (MonoSymbolFileMethodEntry): Removed.
10215         (MonoSymbolFileLexicalBlockEntry): Removed.
10216         (MonoSymbolFileLineNumberEntry): Removed.
10217         (MonoDebugLexicalBlockEntry): Removed.
10218         (MonoDebugMethodInfo): Replaced `entry' by `guint32 entry_offset';
10219         removed `num_il_offsets' and `il_offsets'.
10220         (MonoSymbolFile): Replace `version' with `major_version' and
10221         `minor_version'.
10222         (MONO_SYMBOL_FILE_VERSION): Replace with
10223         `MONO_SYMBOL_FILE_MAJOR_VERSION' and
10224         `MONO_SYMBOL_FILE_MINOR_VERSION'.
10225
10226         * debug-mono-symfile.c
10227         (mono_debug_symfile_lookup_location): Add support for the new line
10228         number table format.
10229
10230 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10231
10232         * metadata.c (free_generic_class): Release the inflated
10233         MonoClass of dynamic generic classes if it's not a generic
10234         type definition.
10235
10236 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10237
10238         * verify.c: Reapplied more of the reverted changes.
10239
10240 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10241
10242         * reflection.c (lookup_custom_attr): Clean the cached flag or
10243         nobody will free it. Fixes a memleak in MonoCustomAttrs::IsDefinedInternal
10244         for SRE types.
10245
10246 2008-06-07 Rodrigo Kumpera  <rkumpera@novell.com>
10247
10248         * verify.c: Reapplied a small part of the reverted changes.
10249
10250 2008-06-07  Zoltan Varga  <vargaz@gmail.com>
10251
10252         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
10253
10254         * monitor.c (mono_monitor_try_enter_internal): Add NULL check which was 
10255         previously in managed code.
10256         (mono_monitor_exit): Ditto.
10257         (ves_icall_System_Threading_Monitor_Monitor_exit): Removed, not needed anymore.
10258
10259         * icall-def.h: Rename the Enter/Exit icalls to simply Enter/Exit to match
10260         the managed definition.
10261
10262 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10263
10264         * verify.c: Revert changes to see if it helps with weird buildbot crashes.
10265
10266 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10267
10268         * monitor.c: Redefine GetCurrentThreadId () with a macro on !win32.
10269         
10270         * monitor.c: Add some micro optimizations.
10271
10272         * icall.c (type_from_typename): Handle 'bool'.
10273
10274 2008-06-06 Rodrigo Kumpera  <rkumpera@novell.com>
10275
10276         * verify.c: Implement constructor verification per P III 1.8.1.4.
10277         Fixes #396716.
10278
10279 2008-06-06  Zoltan Varga  <vargaz@gmail.com>
10280
10281         * assembly.c (mono_assembly_loaded_full): Avoid calling the search hooks while
10282         holding the assemblies lock here too.
10283
10284 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10285
10286         * verify.c: Kill stack_top function.
10287
10288 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10289
10290         * verify.c: Kill stack_get function.
10291
10292 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10293
10294         * verify.c (mono_method_verify): Last change broke the build. Fixed.
10295
10296 2008-06-05 Rodrigo Kumpera  <rkumpera@novell.com>
10297
10298         * verify.c (verify_type_compatibility_full): Make SZARRAY checks
10299         more reliable.
10300
10301         * verify.c (mono_method_verify): Inflate params and locals to avoid
10302         mismatch when checking for compatibility.
10303
10304 2008-06-05  Jonathan Chambers  <joncham@gmail.com>
10305
10306         * metadata.c (mono_string_from_bstr): Fix BSTR marshalling.
10307         Length prefix should be size in bytes. Fix bug #339530.
10308         
10309         * metadata.c (mono_string_to_bstr): Fix BSTR marshalling.
10310         Length prefix should be size in bytes. Fix bug #339530.
10311
10312         Code is contributed under MIT/X11 license.
10313
10314 2008-06-05  Bill Holmes <billholmes54@gmail.com>
10315
10316         * decimal.c:  Adding MSVC implementation to my_g_bit_nth_msf.
10317
10318         Contributed under MIT/X11 license.
10319
10320 2008-06-05  Martin Baulig  <martin@ximian.com>
10321
10322         * mono-debug-debugger.c
10323         (mono_debugger_check_breakpoints): Reflect latest runtime changes.
10324
10325 2008-06-05  Zoltan Varga  <vargaz@gmail.com>
10326
10327         * assembly.c (mono_assembly_load_from_full): Avoid calling the search hooks
10328         while holding the assemblies lock to prevent deadlocks. Handle the case
10329         where the search hook returns NULL but the assembly was still loaded.
10330         Fixes #323696.
10331
10332         * appdomain.c (set_domain_search_path): Acquire the domain lock since we
10333         modify domain state.
10334
10335 2008-06-05  Andreas Färber  <andreas.faerber@web.de>
10336
10337         * boehm-gc.c: Add DTrace probes gc-{begin,end}.
10338         * Makefile.am (pedump_LDADD): Post-process object files and
10339         add dtrace-generated object file, if necessary.
10340
10341         Code is contributed under MIT/X11 license.
10342
10343 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10344
10345         * reflection.c (mono_dynamic_image_free): Free MonoDynamicImage::public_key.
10346
10347 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10348
10349         * class.c (mono_type_get_full): Add a work-around for generic type definitions.
10350
10351 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10352
10353         * threads.c: Try to free everything from the delayed free table
10354         when shutting down threads, and set the variable to NULL after the
10355         table is freed so that calling
10356         mono_thread_hazardous_try_free_all() when shutting down the root
10357         domain doesn't crash.
10358
10359 2008-06-04 Rodrigo Kumpera  <rkumpera@novell.com>
10360
10361         * class.c (mono_type_retrieve_from_typespec): Add an argument to inform
10362         the caller if resulting type was inflated.
10363
10364         * class.c (mono_class_create_from_typespec): Free the MonoType if it
10365         was inflated.
10366
10367         * class.c (mono_type_get_full): Free the MonoType if it was inflated.
10368
10369
10370 2008-06-04  Zoltan Varga  <vargaz@gmail.com>
10371
10372         * decimal.c (rescale128): Rework the code a bit so it no longer crashes the
10373         class library tests.
10374
10375         * icall.c (ves_icall_InternalInvoke): Applied patch from Andy Hume 
10376         (andyhume32@yahoo.co.uk). Add more useful exception messages. Fixes
10377         #396989.
10378
10379 2008-06-04  Mark Probst  <mark.probst@gmail.com>
10380
10381         * domain.c, domain-internals.h: The JIT infos are now freed by the
10382         JIT info table code.  They are freed immediately if there only a
10383         single JIT info table in circulation.  If there is more, the free
10384         is delayed via a queue.
10385
10386         * threads.c, threads-types.h: New hazard pointer function for
10387         freeing all freeable delayed items in one sitting.
10388
10389 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10390
10391         * reflection.c (typebuilder_setup_fields): Use mempool for allocations.
10392
10393         * reflection.c (typebuilder_setup_properties): Same.
10394
10395         * reflection.c (typebuilder_setup_events): Same.
10396
10397 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10398
10399         * reflection.c (mono_custom_attrs_from_builders): Receive a MonoMemPool
10400         and use it for allocating memory.
10401
10402         * reflection.c (mono_marshal_spec_from_builder): Same.
10403
10404         * reflection.c: Change code to use new signatures.
10405
10406         * metadata.c (mono_metadata_type_dup): Add a FIXME note.
10407
10408 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10409
10410         * decimal.c (rescale128): Put back one line which was accidently commented
10411         out.
10412         
10413         * decimal.c (rescale128): Disable the code added by the last patch, as it seems
10414         to cause crashes.
10415
10416 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10417
10418         * reflection.c (mono_reflection_generic_class_initialize): Name must
10419         be always malloc'ed so we can free it later on. Do this for field, property
10420         and event.
10421
10422         * metadata.c (free_generic_class): Free field, property and event names.
10423
10424 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10425
10426         * reflection.c (fieldbuilder_to_mono_class_field): Use mono_metadata_type_dup
10427         instead of g_memdup.
10428
10429         * reflection.c (typebuilder_setup_fields): Same.
10430
10431 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10432
10433         * decimal.c (rescale128): Optimize this function a bit more.
10434
10435 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10436
10437         * metadata.c (free_generic_class): Release some memory from
10438         SRE generic classes.
10439
10440 2008-06-03 Rodrigo Kumpera  <rkumpera@novell.com>
10441
10442         * reflection.c (mono_image_get_generic_field_token): No reference
10443         to name is kept, free it.
10444
10445         * reflection.c (mono_reflection_generic_class_initialize): Free
10446         more memory of the inflated field.
10447
10448 2008-06-03  Zoltan Varga  <vargaz@gmail.com>
10449
10450         * decimal.c (mono_decimalDiv): Moved equality checks here from managed
10451         code.
10452
10453 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10454
10455         * reflection.c (mono_dynamic_image_free): Release memory used by
10456         MonoDynamicImage::array_methods elements.
10457
10458         * reflection.c (assembly_add_win32_resources): Release memory after
10459         encoding.
10460
10461 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10462
10463         * decimal.c (log2_32): Use an optimized version for this function too.
10464         
10465         * decimal.c (log2_64): Fix this on 32 bit machines.
10466
10467 2008-06-02 Rodrigo Kumpera  <rkumpera@novell.com>
10468
10469         * class.c (mono_dup_array_type): Implement allocation using a mempool.
10470
10471         * class.c (mono_metadata_signature_deep_dup): Same.
10472
10473         * metadata.c (mono_metadata_signature_dup_full): Added, allow dup'ng with
10474         a mempool.
10475
10476         * metadata.c (mono_metadata_signature_dup): Delegate to the _full version.
10477
10478         * metadata.c (mono_metadata_type_dup): Remove asserts and FIXME.
10479
10480         * metadata-internals.h: Added mono_metadata_signature_dup_full.
10481
10482         * class-internals.h: Update signatures to take a MonoMemPool.
10483
10484 2008-06-02  Dick Porter  <dick@ximian.com>
10485
10486         * icall.c (ves_icall_System_ComponentModel_Win32Exception_W32ErrorMessage): 
10487         * icall-def.h: Add
10488         System.ComponentModel.Win32Exception.W32ErrorMessage, using the
10489         FormatMessage API to get the error text.  Fixes bug 321827.
10490
10491 2008-06-02  Zoltan Varga  <vargaz@gmail.com>
10492
10493         * decimal.c: Add some micro optimizations to make decimal operations faster.
10494
10495 2008-06-01 Rodrigo Kumpera  <rkumpera@novell.com>
10496
10497         * reflection.c (method_encode_clauses): Take a mempool
10498         as parameter and use it to allocate the clause array.
10499
10500         * reflection.c (mono_image_get_field_on_inst_token): Free
10501         the inflated type after encoding it.
10502
10503         * reflection.c (mono_dynamic_image_free): Free each element
10504         of MonoDynamicImage::gen_params.
10505
10506         * reflection.c (reflection_methodbuilder_to_mono_method):
10507         Allocate the generic param array from the mempool.
10508         Allocate signature params from the mempool.
10509
10510         * reflection.c (mono_reflection_generic_class_initialize):
10511         Free inflated fields after been used.
10512
10513 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10514
10515         * icall.c: Reapply the memory leak fixes as they no
10516         longer make mono crash.
10517
10518 2008-05-30 Rodrigo Kumpera  <rkumpera@novell.com>
10519
10520         * reflection.c (mono_type_get_object): Don't store the suplied
10521         MonoType with type_hash. A caller which pass a type that
10522         was mono_metadata_type_dup'ed cannot free it reliably, as type_hash
10523         might end with a pointer to freed memory.
10524         The solution is to use byval_arg or this_arg from the associated
10525         MonoClass of the supplied type.
10526
10527 2008-05-29  Zoltan Varga  <vargaz@gmail.com>
10528
10529         * icall.c: Revert the rest of the last change as it breaks the build too.
10530
10531 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10532
10533         * icall.c: Revert a leak fix as it's breaking the build.
10534
10535 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10536
10537         * appdomain.c (mono_make_shadow_copy): Fix another leak of dir_name.
10538
10539 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10540
10541         * appdomain.c (mono_make_shadow_copy): We leaked dir_name.
10542
10543 2008-05-29 Rodrigo Kumpera  <rkumpera@novell.com>
10544
10545         * icall.c: Fix some memory leaks.
10546
10547 2008-05-29  Dick Porter  <dick@ximian.com>
10548
10549         * threadpool.c (mono_thread_pool_remove_socket): Always remove the
10550         async socket operations from the pending list when a socket
10551         closes.  Leaving it until the threadpool services the event
10552         exposes a race condition when a socket descriptor is reused.
10553         Fixes bug 377589.
10554
10555 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10556
10557         * object.c: Fix negative index check for array alocation.
10558
10559 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10560
10561         * icall.c, marshal.c: Delegate wrappers should skip visibility.
10562         This check is performed by the verifier for IL created delegates
10563         and by Delegate::CreateDelegate for programatically created ones.
10564         Fixes #372406.
10565
10566 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10567
10568         * sockey-io.c (ves_icall_System_Net_Sockets_Socket_Select_internal):
10569         Fix code to use mono_array_size_t instead of int.
10570
10571         Based on patch by Luis F. Ortiz.
10572         Contributed under X11 license.
10573         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10574
10575 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10576
10577         * icall.c: Added ves_icall_System_Array_GetLongLength and
10578         ves_icall_System_Array_CreateInstanceImpl64. Both allow handling big
10579         arrays.
10580
10581         * icall.h: Export both new functions.
10582
10583         Based on patch by Luis F. Ortiz.
10584         Contributed under X11 license.
10585         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10586
10587 2008-05-28  Martin Baulig  <martin@ximian.com>
10588
10589         The debugger now requires exactly r103463.
10590
10591         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 71.
10592         This version is not supported by the debugger, wait for 72.
10593
10594 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10595
10596         * object.h: Changed array related functions to use
10597         mono_array_size_t instead of guint32. Forgot to commit this file.
10598
10599         Patch by Luis F. Ortiz.
10600         Contributed under X11 license.
10601         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10602
10603
10604 2008-05-28 Rodrigo Kumpera  <rkumpera@novell.com>
10605
10606         * object.h: Don't use G_MAXINT32 or G_MAXUINT32 as old glibs
10607         don't define it. Use the number literal instead.
10608
10609 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10610
10611         * icall.c: Changed array related functions to use
10612         mono_array_size_t instead of guint32.
10613
10614         * icall.c (ves_icall_System_Array_GetLength): Check for length
10615         overflow under MONO_BIG_ARRAYS.
10616
10617         Based on patch by Luis F. Ortiz.
10618         Contributed under X11 license.
10619         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10620
10621 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10622
10623         * object.c: Add 64bits bounds check for arrays under MONO_BIG_ARRAYS.
10624
10625         Based on patch by Luis F. Ortiz.
10626         Contributed under X11 license.
10627         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10628
10629 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10630
10631         * object.c, object.h: Changed array related functions to use
10632         mono_array_size_t instead of guint32.
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 2008-05-27 Rodrigo Kumpera  <rkumpera@novell.com>
10639
10640         * object.h: Introduced mono_array_size_t typedef. This must be used
10641         in all places an array length is expected. This is 64bits wide if
10642         MONO_BIG_ARRAYS is enabled.
10643
10644         Patch by Luis F. Ortiz.
10645         Contributed under X11 license.
10646         http://lists.ximian.com/pipermail/mono-devel-list/2008-May/027995.html
10647
10648 2008-05-27  Zoltan Varga  <vargaz@gmail.com>
10649
10650         * security-manager.c class.c: Set the class exception info by calling
10651         mono_class_set_failure ().
10652
10653         * class.c (mono_class_get_exception_data): New accessor function.
10654         (mono_class_set_failure): Store exception_data in the property hash.
10655
10656         * class-internals.h (struct _MonoClass): Store 'exception_data' outside
10657         the struct as a property.
10658
10659         * loader.c (mono_get_method_full): Store the lookup result for method
10660         tokens in method_cache, the others in methodref_cache to decrease the memory
10661         usage of hash tables.
10662
10663         * image.c (mono_image_close): Destroy method_cache and methodref_cache.
10664         (mono_image_init): method_cache is lazy inited now.
10665
10666         * metadata-internals.h (struct _MonoImage): Change method_cache to
10667         a MonoValueHashTable, add a separate methodref_cache.
10668
10669 2008-05-27  Eyal Alaluf <eyala@mainsoft.com>
10670
10671         * number-formatter.h: Fix tables to avoid arithemtic overflow in
10672           Double.ToString as exposed by Bug #383531.
10673
10674 2008-05-26  Zoltan Varga  <vargaz@gmail.com>
10675
10676         * number-formatter.h: Make some tables static.
10677
10678         * class.c (mono_method_set_generic_container): New accessor function.
10679         (mono_method_get_generic_container): Ditto.
10680
10681         * class-internals.h (struct _MonoMethod): Remove rarely used 
10682         'generic_container' field, store it in the property hash instead. Add 
10683         'is_generic' boolean field instead.
10684
10685         * image.c (mono_image_init): Initialize property_hash.
10686         (mono_image_close): Destroy property_hash.
10687
10688         * metadata-internals.h (struct _MonoImage): Add 'property_hash' hash table to
10689         hold rarely used fields of runtime structures belonging to this image.
10690
10691         * class.c loader.c verify.c icall.c reflection.c: Use the new accessor functions
10692         to get/set method->generic_container.
10693
10694         * loader.c (mono_get_method_from_token): Avoid loading the method header for
10695         generic methods.
10696
10697 2008-05-25  Zoltan Varga  <vargaz@gmail.com>
10698
10699         * class.c (mono_class_inflate_generic_method_full): Don't increase
10700         mono_stats.inflated_method_count for methods found in the cache.
10701
10702         * threads.c (mono_thread_request_interruption): Add a comment about 
10703         QueueUserAPC ().
10704
10705 2008-05-24  Zoltan Varga  <vargaz@gmail.com>
10706
10707         * class.c (setup_interface_offsets): Use sizeof (guint16) when allocating the
10708         interface_offsets_packed table.
10709         
10710         * class.c (mono_class_init): Remove some dead code.
10711
10712         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Call
10713         mono_class_setup_vtable () when CAS is active to detect security problems.
10714
10715 2008-05-23 Rodrigo Kumpera  <rkumpera@novell.com>
10716
10717         * verify.c (mono_delegate_type_equal): Handle VAR, MVAR and GENERICINST.
10718
10719         * verify.c (mono_delegate_signature_equal): Don't compar number of generic
10720         parameters as it's irrelevant for delegate checking.
10721
10722 2008-05-23  Zoltan Varga  <vargaz@gmail.com>
10723
10724         * class-internals.h class.c: Correct the name of the 'mono_no_setup_vtable_in_class_init' variable.
10725
10726         * class.c (mono_class_init): Control the creation of a generic vtable using
10727         a global which is true by default, but set to false by the runtime startup code.
10728         
10729         * class.c (mono_class_init): Avoid constructing a generic vtable in most cases.
10730         Disabled for now since it breaks the embedding API.
10731         Move the setup of class->methods for arrays to mono_class_setup_methods ().
10732         (mono_class_setup_methods): Add a memory barrier.
10733
10734         * object.c (mono_class_create_runtime_vtable): Add code to handle the case
10735         when mono_class_init () doesn't compute the generic vtable.
10736         
10737 2008-05-23  Massimiliano Mantione  <massi@ximian.com>
10738         * profiler.c: Added mono_profiler_install_statistical_call_chain,
10739         mono_profiler_stat_get_call_chain_depth and mono_profiler_stat_call_chain
10740         to support call chains (backtrace) in the stat profiler.
10741         * profiler.c, profiler-private.h: Likewise.
10742
10743 2008-05-22  Mark Probst  <mark.probst@gmail.com>
10744
10745         * generic-sharing.c: Init generic class when a method of it is
10746         requested via a runtime generic context.
10747
10748 2008-05-22  Zoltan Varga  <vargaz@gmail.com>
10749
10750         * class.c (mono_class_init): Add a comment about trying to avoid calling this.
10751
10752         * reflection.c (mono_type_get_object): Add a FIXME.
10753
10754         * loader.c (find_method_in_class): Use mono_class_get_method_by_index ().
10755
10756         * class.c (mono_class_get_method_by_index): New helper function, returning an
10757         entry in the class->methods array.
10758
10759 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10760
10761         * class.c (mono_class_init): Only do the array optimization for szarrays. 
10762         Avoid creating a generic vtable for generic instances as well.
10763         (mono_class_get_method_from_name_flags): Don't search in the metadata for
10764         generic instances.
10765
10766 2008-05-21 Rodrigo Kumpera  <rkumpera@novell.com>
10767
10768         * loader.c (mono_get_method_constrained): Inflate the signature
10769         with class context. Fix #325283.
10770
10771 2008-05-21  Zoltan Varga  <vargaz@gmail.com>
10772
10773         * object.c (mono_class_create_runtime_vtable): Add a comment.
10774
10775         * class.c (get_implicit_generic_array_interfaces): Call mono_class_init ()
10776         where needed.
10777         (setup_interface_offsets): Handle the case when this is called twice for arrays.
10778         (mono_class_setup_vtable_general): Add an assert.
10779         (mono_class_init): Avoid creating a generic vtable for arrays.
10780
10781         * class.c (mono_generic_class_get_class): Don't call setup_interface_offsets ()
10782         here, let mono_class_init () do that.
10783
10784         * class.c (mono_class_init): Avoid calling mono_class_setup_methods () for
10785         interfaces in mscorlib.
10786
10787         * class.c (mono_class_setup_vtable): Avoid calling setup_methods () for
10788         interfaces. Add some comments.
10789         (mono_class_init): Call mono_class_setup_methods () here since it is no
10790         longer called by mono_class_setup_vtable ().
10791
10792         * object.c (mono_class_proxy_vtable): Null out entries in pvt->vtable which are
10793         not set in class->vtable.
10794         (mono_class_create_runtime_vtable): Reenable the disabled code.
10795
10796         * object.c (mono_class_create_runtime_vtable): Disable the last change for
10797         now as it causes some test failures.
10798
10799         * object.c (mono_class_create_runtime_vtable): Avoid creating a generic vtable
10800         if using the vtable trampoline. Also remove some strange code which put the
10801         generic methods themselves into the vtable slots. Remove the AOT init_vtable
10802         stuff as it is no longer needed.
10803
10804 2008-05-19 Rodrigo Kumpera  <rkumpera@novell.com>
10805
10806         * pedump.c: Give make --verify all option check code as well.
10807         Using --verify code won't check for metadata now.
10808
10809 2008-05-19  Martin Baulig  <martin@ximian.com>
10810
10811         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 70.
10812
10813         * mono-debug.c
10814         (_mono_debug_using_mono_debugger): New global variable; it's set
10815         directly by the debugger, so mono_debug_using_mono_debugger() also
10816         works after attaching.
10817
10818 2008-05-18 Rodrigo Kumpera  <rkumpera@novell.com>
10819
10820         * object.c (mono_class_create_runtime_vtable): Use memory barriers
10821         as we do double checked locking on MonoClass::runtime_info and
10822         MonoClassRuntimeInfo::domain_vtables.
10823
10824 2008-05-18  Zoltan Varga  <vargaz@gmail.com>
10825
10826         * debug-helpers.c (print_field_value): Fix a warning.
10827
10828 2008-05-16  Zoltan Varga  <vargaz@gmail.com>
10829
10830         * object.c (mono_object_get_virtual_method): Fix a crash if method->slot is not
10831         set in the AOT case.
10832
10833 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10834
10835         * class.c (mono_class_setup_vtable_general): Use memory barriers
10836         as we do double checked locking on MonoClass::vtable.
10837
10838 2008-05-16 Rodrigo Kumpera  <rkumpera@novell.com>
10839
10840         * reflection.c (resolve_object): Inflate only if the generic context
10841         is not null. Fixes #389886.
10842
10843 2008-05-15  Jonathan Chambers  <joncham@gmail.com>
10844
10845         * metadata.c (emit_marshal_string): Free return strings using mono_marshal_free
10846         instead of g_free.
10847
10848         Code is contributed under MIT/X11 license.
10849
10850 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10851
10852         * class.c: Revert unrelated change.
10853
10854 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10855
10856         * verify.c (check_is_valid_type_for_field_ops): Type on stack can be
10857         a generic instantiation, use mono_class_from_mono_type instead of playing
10858         with MonoType directly.
10859
10860 2008-05-14 Rodrigo Kumpera  <rkumpera@novell.com>
10861
10862         * class.c: Added mono_class_has_parent_and_ignore_generics. Visibility
10863         checks must ignore generic instantiations, so mono_class_has_parent is not
10864         suitable. Fixes #390128.
10865
10866 2008-05-14  Zoltan Varga  <vargaz@gmail.com>
10867
10868         * reflection.c (mono_image_create_token): Add a 'register_token' argument, and use
10869         it to avoid registering tokens during metadata generation. Fixes #390023.
10870
10871 2008-05-14  KornĂ©l Pál  <kornelpal@gmail.com>
10872
10873         * coree.c: Rename dwOldProtect to OldProtect that makes naming convention
10874         consistent.
10875
10876         Contributed under MIT/X11 license.
10877
10878 2008-05-14  KornĂ©l Pál  <kornelpal@gmail.com>
10879
10880         * domain.c (mono_init_internal): Enable LoadLibrary support. Load EXE image
10881         even when get_runtimes_from_exe didn't load it that allows mono_fixup_exe_image
10882         to fixup the EXE image.
10883         (mono_cleanup): Use mono_close_exe_image.
10884         (mono_close_exe_image): New function.
10885         * image.c: Include "marshal.h".
10886         (mono_image_open_from_module_handle): Add ref_count argument. Return the image.
10887         (mono_image_open_full, mono_image_close): Fix LoadLibrary/FreeLibrary reference
10888         counting when the image is loaded outside of mono_image_open_full. Set status
10889         based on GetLastError.
10890         * coree.c: Include required headers. Add init_from_coree.
10891         (_CorDllMain): Support fix in mono_image_open_full, mono_image_close. Call
10892         mono_assembly_open only when the image has vtfixups. Set init_from_coree.
10893         (_CorExeMain): Set init_from_coree.
10894         (CorExitProcess): Only call ExitProcess for now.
10895         (CorBindToRuntimeEx): New stub implementation.
10896         (CorBindToRuntime): New function.
10897         (MonoFixupCorEE): Fixup CorBindToRuntime and CorBindToRuntimeEx.
10898         (MonoFixupExe): ILONLY executables require no fixups.
10899         (mono_set_act_ctx): New function to set activation context.
10900         (mono_load_coree): Use init_from_coree. Call mono_set_act_ctx.  
10901         * coree.h: Move STATUS_SUCCESS and STATUS_INVALID_IMAGE_FORMAT to header.
10902         Declare mono_module_handle, coree_module_handle, mono_get_module_file_name,
10903         mono_load_coree, mono_fixup_exe_image and mono_image_open_from_module_handle
10904         as MONO_INTERNAL.
10905         * domain-internals.h: Add mono_close_exe_image.
10906
10907         Contributed under MIT/X11 license.
10908
10909 2008-05-13 Rodrigo Kumpera  <rkumpera@novell.com>
10910
10911         * metadata.c (mono_metadata_compute_size): Correctly calculate field
10912         size for generic param and event tables. Fixes #388977.
10913
10914 2008-05-13  Zoltan Varga  <vargaz@gmail.com>
10915
10916         * loader.c (mono_method_signature): Use memory barriers because of the double
10917         checked locking pattern.
10918
10919         * threads.c (remove_and_abort_threads): Stop and wait for threads which are
10920         aborting or aborted as well. Fixes #376391.
10921         
10922         * threads.c (mono_thread_execute_interruption): Avoid depending on no longer
10923         existing runtime state in the Suspend handler during shutdown.
10924
10925 2008-05-12  Zoltan Varga  <vargaz@gmail.com>
10926
10927         * threads.c (mono_thread_request_interruption): Add some FIXMEs.
10928
10929         * threads.c (mono_thread_suspend_all_other_threads): Add support for threads 
10930         which are starting up or shutting down.
10931
10932         * threads.c (mono_threads_set_shutting_down): Don't return a value since
10933         this function never returns if the runtime is already shutting down.
10934
10935         * icall.c (ves_icall_System_Environment_Exit): Update after 
10936         mono_threads_set_shutting_down () signature change.
10937         
10938 2008-05-09 Rodrigo Kumpera  <rkumpera@novell.com>
10939
10940         * class.c: Added can_access_instantiation to verify if the instantiation
10941         is visible. Fix access check for nested types as they returned TRUE
10942         before doing type and generic instantiation visibility checks.
10943
10944 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10945
10946         * reflection.c (mono_reflection_create_generic_class): The created type
10947         must have a different container from its TypeBuilder. Otherwise they
10948         will end sharing generic arguments, which is wrong.
10949
10950         Due to the sharing, making a generic instance of the created type using
10951         the TypeBuider generic arguments resulted in the generic type definition
10952         been returned, which is wrong as well.
10953
10954         As a bonus the code was leaking the type_params array. This memory should
10955         be allocated from the image mempool.
10956
10957         This fixes bug #354047.
10958
10959 2008-05-08 Rodrigo Kumpera  <rkumpera@novell.com>
10960
10961         * metadata-internals.h: Move MONO_SECMAN_FLAG macros from mini/declsec.h
10962         to here         as they are now used in assembly.c new code.
10963         Added a skipverification flag to MonoAssembly.
10964         New internal function mono_assembly_has_skip_verification.
10965
10966         * assembly.c: New function mono_assembly_has_skip_verification. It checks
10967         if an assembly has a version 2.0 SkipVerification security attribute. Fixes
10968         part of #387274.
10969
10970 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
10971
10972         * object.c (mono_object_get_virtual_method): Inflate the resulting method if
10973         needed. Fixes #387034.
10974
10975         * class.c (mono_class_inflate_generic_type): Avoid a crash if context is NULL.
10976
10977 2008-05-06  Miguel de Icaza  <miguel@novell.com>
10978
10979         * assembly.c (mono_assembly_load_reference): Prevent crash while
10980         disassembling Silverlight 2.0 executables while we still do not
10981         have GACed libraries.
10982
10983 2008-05-07  Zoltan Varga  <vargaz@gmail.com>
10984
10985         * reflection.c: Special case generic type definitions as well. Fixes #383444.
10986
10987 2008-05-06  Zoltan Varga  <vargaz@gmail.com>
10988
10989         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Fix handling
10990         of the dynamic case. Fixes #387404.
10991
10992 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
10993
10994         *verify.c (mono_verifier_is_class_full_trust): If under
10995         verify_all and the verifier mode was not set, only
10996         gac and corlib types are fulltrust. This makes --verify-all
10997         usable to detect unverifiable code, which is the expected
10998         use case.
10999
11000 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
11001
11002         * verify.h: Ops, commited the header with debug
11003         enabled.
11004
11005 2008-05-06 Rodrigo Kumpera  <rkumpera@novell.com>
11006
11007         * verify.c (merge_stack): Use the new value on unverifiable
11008         stack merges.
11009
11010         * verify.c (verify_type_compatibility_full): Comparison
11011         of nullable types can't use mono_class_is_assignable_from.
11012
11013         * verify.c, verify.h: Added MONO_VERIFY_REPORT_ALL_ERRORS
11014         that makes all verification errors be reported.
11015
11016         * pedump.c: Pass MONO_VERIFY_REPORT_ALL_ERRORS to
11017         mono_method_verify.
11018
11019 2008-05-05  Robert Jordan  <robertj@gmx.net>
11020
11021         * marshal.c (mono_marshal_get_thunk_invoke_wrapper):
11022         support for value types. See #386415.
11023
11024         * object.c: comments.
11025
11026         Code is contributed under MIT/X11 license.
11027
11028 2008-05-05  Martin Baulig  <martin@ximian.com>
11029
11030         * debug-mono-symfile.h
11031         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): Removed; dropped support
11032         for old pre-terrania symbol files.
11033
11034 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
11035
11036         * mono-config.c: Add ppc64 architecture.
11037
11038         Code is contributed under MIT/X11 license.
11039
11040 2008-05-05  Andreas Färber  <andreas.faerber@web.de>
11041
11042         * object.c (mono_create_ftnptr, mono_get_addr_from_ftnptr):
11043           PPC64 uses function descriptors as well.
11044
11045         Code is contributed under MIT/X11 license.
11046
11047 2008-05-04  Zoltan Varga  <vargaz@gmail.com>
11048
11049         * object.c (compute_class_bitmap): Ignore literal static fields.
11050
11051         * sgen-gc.c (mono_gc_base_init): Print some help when the MONO_GC_DEBUG env
11052         var has an invalid format.
11053         (describe_ptr): Add some sanity checks for the vtable.
11054         (add_nursery_frag): Clear unused nursery fragments.
11055         (major_collection): Clear all remaining nursery fragments.
11056
11057 2008-05-03  Robert Jordan  <robertj@gmx.net>
11058
11059         * image.c, metadata-internals.h: add thunk_invoke_cache.
11060
11061         * marshal.c, marshal.h: implement
11062         mono_marshal_get_thunk_invoke_wrapper ().
11063
11064         * object.c, object.h: implement mono_method_get_unmanaged_thunk ().
11065
11066         Code is contributed under MIT/X11 license.
11067
11068 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
11069
11070         * verify.c (do_leave): Empty the stack.
11071
11072 2008-05-02 Rodrigo Kumpera  <rkumpera@novell.com>
11073
11074         * class.c (mono_class_is_assignable_from): Variance
11075         doesn't work between reference and value types. For example,
11076         given type C<T+>, C<int32> is not assignable to C<object>.
11077         Break the argument checking loop on first error. 
11078
11079 2008-05-02  Atsushi Enomoto  <atsushi@ximian.com>
11080
11081         * icall.c : base64_to_byte_array() needs some more strict
11082           check for sequence of '=' characters. Patch by Santa
11083           Marta (http://deee.g.hatena.ne.jp/santamarta).
11084
11085           Contributed under MIT/X11 license.
11086           (see http://www.lingr.com/room/mono-jp/archives/2008/04/20)
11087
11088 2008-05-02  Jonathan Chambers  <joncham@gmail.com>
11089
11090         * domain.c: Disable LoadLibrary support to fix Win32 build.
11091
11092         Code is contributed under MIT/X11 license.
11093
11094 2008-05-02  Zoltan Varga  <vargaz@gmail.com>
11095
11096         * sgen-gc.c: Add support for clearing nursery memory when a tlab is allocated,
11097         to help with cache behaviour.
11098
11099 2008-05-01  Miguel de Icaza  <miguel@novell.com>
11100
11101         * appdomain.c (mono_domain_from_appdomain): Add new accessor
11102         method. 
11103
11104 2008-05-01  Zoltan Varga  <vargaz@gmail.com>
11105
11106         * sgen-gc.c: Implement thread-local allocation and a managed allocation routine.
11107
11108 2008-05-01  Dick Porter  <dick@ximian.com>
11109
11110         * process.c (process_get_fileversion): Only pass 16 bits of
11111         language ID to VerLanguageName.  Fixes bug 381204.
11112
11113 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
11114
11115         * verify.c (mono_method_verify): Fix the comparison
11116         operator for code bounds check.
11117
11118 2008-04-30 Rodrigo Kumpera  <rkumpera@novell.com>
11119
11120         * verify.c (mono_method_verify): Check the bounds of
11121         all access of the code array.
11122
11123 2008-04-29  KornĂ©l Pál  <kornelpal@gmail.com>
11124
11125         * appdomain.c: Use HAVE_SYS_UTIME_H that fixes MSVC build.
11126
11127 2008-04-28  Zoltan Varga  <vargaz@gmail.com>
11128
11129         * image.c (mono_image_strong_name_position): Fix return value when the rva is
11130         not valid.
11131
11132 2008-04-28  KornĂ©l Pál  <kornelpal@gmail.com>
11133
11134         * loader.c (mono_get_method_from_token, mono_method_signature): Add
11135         support for METHOD_IMPL_ATTRIBUTE_NATIVE.
11136         * domain.c (mono_init_internal): Load and fixup mscoree.dll on startup and
11137         fixup main EXE images when using mono.exe for mixed-mode assembly support.
11138         * domain-internals.h: Add MonoLoadFunc, mono_install_runtime_load and
11139         mono_runtime_load.
11140         * appdomain.c: Add mono_install_runtime_load, mono_runtime_load to support
11141         runtime initialization from metadata.
11142         * assembly.c: Remove obsolete ceGetModuleFileNameA.
11143         (mono_set_rootdir): Use mono_get_module_file_name.
11144         (mono_assembly_load_from_full): Call mono_image_fixup_vtable for module
11145         handles.
11146         * cil-coff.h: Add MonoVTableFixup. Update mono_cli_rva_image_map signature.
11147         * metadata-internals.h: Add is_module_handle to _MonoImage on Windows.
11148         * image.c (mono_cli_rva_image_map): Use MonoImage instead of
11149         MonoCLIImageInfo. Add support for module handles.
11150         (load_cli_header): Update mono_cli_rva_image_map signature.
11151         (load_metadata_ptrs): Update mono_cli_rva_image_map signature.
11152         (mono_image_strong_name_position): Use mono_cli_rva_image_map.
11153         (mono_image_rva_map): Add support for module handles.
11154         (mono_image_ensure_section_idx): Add support for module handles.
11155         (mono_image_close): Add support for module handles.
11156         (do_load_header): Add support for module handles.
11157         (mono_image_open_from_module_handle): New function for internal use.
11158         (mono_image_open_full): Load normal images using LoadLibrary on Windows.
11159         (mono_image_load_module): Call mono_image_fixup_vtable for module handles.
11160         (mono_image_load_file_for_image): Call mono_image_fixup_vtable for module
11161         handles.
11162         (mono_image_fixup_vtable): New function for mixed-mode assembly support.
11163         * image.h: Add mono_image_fixup_vtable.
11164         * coree.c: New file for mscoree.dll functions and mixed-mode assembly
11165         support.
11166         * coree.h: New file.
11167         * marshal.c (mono_marshal_get_native_wrapper): Throw exception for
11168         unsupported native code.
11169         (mono_marshal_set_callconv_from_modopt): New function splitted from
11170         mono_marshal_get_managed_wrapper.
11171         (mono_marshal_get_managed_wrapper): Use
11172         mono_marshal_set_callconv_from_modopt.
11173         (mono_marshal_get_vtfixup_ftnptr): New function for mixed-mode assembly support.
11174         * marshal.h: Add mono_marshal_get_vtfixup_ftnptr.
11175         * gc.c (mono_gc_init): Don't wait for the finalizer thread on Windows because
11176         that results in a deadlock when the runtime is loaded in _CorDllMain.
11177         * Makefile.am: Add coree.c and coree.h.
11178
11179         Contributed under MIT/X11 license.
11180
11181 2008-04-28  Mark Probst  <mark.probst@gmail.com>
11182
11183         * generic-sharing.c: Search for type arguments in array element
11184         types as well.
11185
11186 2008-04-28  Mark Probst  <mark.probst@gmail.com>
11187
11188         * class-internals.h, generic-sharing.c: New, small runtime generic context.
11189
11190         * metadata-internals.h, domain.c, image.c: Less bookkeeping is required for the new RGCTX.
11191
11192         * object.c: Don't setup the RGCTX when the vtable is created,
11193         because we're setting it up lazily now.
11194
11195 2008-04-26  Zoltan Varga  <vargaz@gmail.com>
11196
11197         * sgen-gc.c: Make the 'desc' variables an mword instead of a guint32 to fix 
11198         64 bit support.
11199
11200 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
11201
11202         * verify.c (verify_class_for_overlapping_reference_fields): 
11203         If class is under fulltrust allow reference types to overllap
11204         if they have the same RVA.
11205
11206 2008-04-24 Rodrigo Kumpera  <rkumpera@novell.com>
11207
11208         * pedump.c: Added new flag valid-only, that makes the verifier
11209         behaves just like --security=validil. It won't fail type load
11210         due to unverifiable restrictions.
11211
11212 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
11213
11214         * class-internals.h (struct MonoMethod): Added a verification_success
11215         field to cache verifier executions. Reduced MonoMethod:slot size by
11216         one bit.
11217
11218 2008-04-23  Zoltan Varga  <vargaz@gmail.com>
11219
11220         * sgen-gc.c (OBJ_RUN_LEN_SIZE): Make this and other macros take a 'desc' argument
11221         instead of a 'vt' argument to save an indirection and to allow these to be used
11222         for valuetypes.
11223         (scan_vtype): New helper function to scan an area using a gc descriptor.
11224         (mono_gc_wbarrier_value_copy): Implement this.
11225         (handle_remset): Add support for REMSET_VTYPE.
11226         (find_in_remset_loc): Ditto.
11227         (mono_gc_base_init): Allow some debugging options to be controlled through the
11228         use of the MONO_GC_DEBUG env variable.
11229         (mono_gc_alloc_obj): Add support the 'collect-before-allocs' debug option.
11230         (collect_nursery): Add support for the 'check-at-minor-collection' debug option.
11231
11232 2008-04-23  Martin Baulig  <martin@ximian.com>
11233
11234         * domain.c (mono_domain_create): Move the call to
11235         mono_debug_domain_create() down, after allocating the domain id.
11236
11237 2008-04-23 Rodrigo Kumpera  <rkumpera@novell.com>
11238
11239         verify.c (verify_class_for_overlapping_reference_fields): Skip
11240         static fields while verifying for overlapping fields as they
11241         don't matter at all.
11242
11243 2008-04-23  Marek Habersack  <mhabersack@novell.com>
11244
11245         * domain-internals.h: added a declaration of
11246         mono_make_shadow_copy.
11247
11248         * assembly.c (mono_assembly_open_full): shadow copying of
11249         assemblies moved to here, so that all the assemblies within the
11250         application domain's private binary directories can be
11251         processed. Fixes bug #380546
11252
11253         * appdomain.c (mono_make_shadow_copy): make_shadow_copy renamed to
11254         mono_make_shadow_copy and made non-static. The decision whether
11255         to shadow-copy an assembly is made based on its location - it's
11256         copied if it's in one of the private application domain binary
11257         directories and its different to the target file in the shadow
11258         directory. Fixes bug #380546
11259
11260 2008-04-22  Zoltan Varga  <vargaz@gmail.com>
11261
11262         * reflection.c (fixup_method): Handle {Method|Constructor}OnTypeBuilderInst.
11263
11264         * object-internals.h: Add MonoReflection{Method|Constructor}OnTypeBuilderInst
11265         types.
11266
11267         * reflection.c (mono_image_create_token): Handle 
11268         Method/ConstructorOnTypeBuilderInst.
11269         (resolve_object): Ditto.
11270         (inflate_mono_method): Receive the inflated class instead of a MonoGenericClass
11271         so it can be called from resolve_object. Also handle the case when the inflated
11272         class already has its methods setup.
11273
11274 2008-04-21  Martin Baulig  <martin@ximian.com>
11275
11276         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 69.
11277
11278 2008-04-20  Geoff Norton  <gnorton@novell.com>
11279
11280         * icall.c: Fix the _NSGetEnviron define to prevent an impropoer
11281         pointer dereference.
11282
11283 2008-04-15  Marek Habersack  <mhabersack@novell.com>
11284
11285         * appdomain.c (try_load_from): if IOMAP is in effect, call the
11286         portability API to look up the assembly file. Fixes behavior in
11287         situations when the application has a bin/ directory, but the
11288         assembly search patch refers to Bin/ (and thus the requested file
11289         name is Bin/SomeLibrary.dll). Fixes bug #379888
11290
11291 2008-04-15 Rodrigo Kumpera  <rkumpera@novell.com>
11292
11293         verify.c (mono_type_is_generic_argument): Extracted this check
11294         from a dozen places to here.
11295
11296         verify.c: Fixed all issues related to boxing generic arguments
11297         and their constraints.
11298
11299 2008-04-14 Rodrigo Kumpera  <rkumpera@novell.com>
11300
11301         verify.c (mono_class_interface_implements_interface): Fix win32 build.
11302
11303 2008-04-14  Zoltan Varga  <vargaz@gmail.com>
11304
11305         * reflection.c (mono_custom_attrs_construct): Fix crash when the cattr type
11306         isn't finished yet. Fixes #363447.
11307
11308 2008-04-13  Zoltan Varga  <vargaz@gmail.com>
11309
11310         * class.c (mono_bounded_array_class_get): Fix the name of bounded array types.
11311         Fixes #346419.
11312
11313 2008-04-13  Jb Evain  <jbevain@novell.com>
11314
11315         * domain.c: update the 2.1 profile versions.
11316         Merged from the Moonlight 2 branch.
11317
11318 2008-04-12  Zoltan Varga  <vargaz@gmail.com>
11319
11320         * assembly.c (mono_assembly_load_from_full): Do the check for loading other
11321         mscorlibs for the non-refonly case as well.
11322
11323         * image.c (do_mono_image_load): Remove the mscorlib check, it is already done
11324         in mono_assembly_load_from_full (). Fixes #378924.
11325
11326 2008-04-11  Geoff Norton  <gnorton@novell.com>
11327
11328         * icall.c: The global extern environ doesn't exist on Mac.  We
11329         need to call NSGetEnviron instead.
11330
11331 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11332
11333         verify.c: Add generic method constraint verification.
11334
11335 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11336
11337         class.c (mono_class_inflate_generic_method_full): Add a long
11338         explanation to the is_mb_open hack. Remove the FIXME.
11339
11340 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11341
11342         * verify.c (mono_method_verify): Mark all unknown opcodes
11343         as invalid. Mark jmp as unverifiable.
11344
11345 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11346
11347         * verify.c: Add code to do type constraint verification on class instances.
11348
11349         * verify.c (mono_verifier_verify_class): Use the type constraint 
11350         verification code.
11351
11352 2008-04-10 Rodrigo Kumpera  <rkumpera@novell.com>
11353
11354         * class.c (mono_class_get_field_default_value): Don't pass cindex
11355         as hint to mono_metadata_get_constant_index. The local is not initialized
11356         and should contain garbage most of the time. This could only work
11357         with a lot of luck.
11358
11359 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11360
11361         * tokentype.h: Add MONO_TOKEN_GENERIC_PARAM.
11362
11363 2008-04-09 Rodrigo Kumpera  <rkumpera@novell.com>
11364
11365         * class-internals.h: Add generic_param_token to MonoClass::sizes union.
11366
11367         * class.c (mono_class_from_generic_parameter): Save the token of the
11368         generic param in MonoClass::sizes.generic_param_token.
11369
11370         * reflection.c (mono_custom_attrs_from_class): If the class type is
11371         VAR or MVAR retrieve the attributes of the generic param.
11372
11373 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11374
11375         * class.c (mono_class_init): Do class verification if the verifier
11376         is enabled.
11377
11378 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11379
11380         * verify-internal.h: Added mono_verifier_verify_class.
11381
11382         * verify.c: Added mono_verifier_verify_class. It checks for
11383         classes with explicit layout that have overlapping reference fields.
11384
11385         * pedump.c: Init the verifier state prior to verification. Fixed
11386         command line arguments.
11387
11388 2008-04-08 Rodrigo Kumpera  <rkumpera@novell.com>
11389
11390         * Makefile.am: Added verify-internals.h, hopefully fix the build.
11391
11392 2008-04-08  Zoltan Varga  <vargaz@gmail.com>
11393
11394         * verify-internals.h: Fix a warning.
11395
11396 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11397
11398         * verify-internals.h: New header with the verifier configuration
11399         extracted from mini.c.
11400
11401         * verify.c: Implemented the new functions exported by verify-internals.h.
11402
11403 2008-04-07 Rodrigo Kumpera  <rkumpera@novell.com>
11404
11405         * verify.c: Add proper verification of ckfinite.
11406
11407 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11408
11409         * verify.c (do_conversion): Improved error message to something
11410         more meanfull.
11411
11412         * verify.c (check_is_valid_type_for_field_ops): Fix to work
11413         with primitive types.
11414
11415 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11416
11417         * verify.c: Added tail prefix checking. Marked icall
11418         as unverifible.
11419
11420 2008-04-04 Rodrigo Kumpera  <rkumpera@novell.com>
11421
11422         * verify.c: Fix the detection of branches to the middle
11423         of an instruction.
11424
11425 2008-04-03 Rodrigo Kumpera  <rkumpera@novell.com>
11426
11427         * verify.c: Implemented verification of volatile. and
11428         unaligned. prefix. Check if a type is valid after retrieving it.
11429
11430 2008-04-01  Dick Porter  <dick@ximian.com>
11431
11432         * process.c (process_get_fileversion): If there's no string block,
11433         set the file language to en_US.  Fixes the other new part of bug
11434         374600.
11435
11436 2008-03-29 Rodrigo Kumpera  <rkumpera@novell.com>
11437
11438         * class.c: New functions mono_method_can_access_field_full and
11439         mono_method_can_access_method_full. They perform type visibility
11440         and type site check.
11441
11442         * class-internal.h: Added exported functions.
11443
11444         * verify.c: Use new functions to implement proper visibility checks.
11445
11446 2008-03-29  Zoltan Varga  <vargaz@gmail.com>
11447
11448         * mono-config.h: Add missing G_BEGIN_DECLS/G_END_DECLS. Fixes #375188.
11449
11450 2008-03-28  Dick Porter  <dick@ximian.com>
11451
11452         * process.c (process_get_fileversion): Use the first language ID
11453         we see, rather than insisting on an invariant language.  Fixes bug
11454         374600.
11455
11456 2008-03-28  Zoltan Varga  <vargaz@gmail.com>
11457
11458         * reflection.c (calc_section_size): Use add_stream_zero to align the size of
11459         the streams to fix reading of invalid memory later.
11460
11461         * metadata.h (MonoType): Use 'MonoTypeEnum' instead of int for the 'type' field
11462         to ease debugging.
11463
11464 2008-03-26  Zoltan Varga  <vargaz@gmail.com>
11465
11466         * marshal.c (signature_dup): Use mono_metadata_signature_alloc ().
11467         (cominterop_method_signature): Ditto. Fix the size passed to memcpy.
11468
11469 2008-03-26  Massimiliano Mantione  <massi@ximian.com>
11470         * threads.h: Added MonoThreadManageCallback type and
11471         mono_thread_set_manage_callback prototype
11472         * object-internals.h: In _MonoThread, renamed unused6 to manage_callback
11473         (used to store the mono_thread_manage callback).
11474         * threads.c: Added mono_thread_set_manage_callback, and handle
11475         "MonoThread->manage_callback" in build_wait_tids.
11476
11477 2008-03-26  Dick Porter  <dick@ximian.com>
11478
11479         * process.c (process_get_fileversion): Set FileVersionInfo strings
11480         to Empty when the resource doesn't have the particular info.
11481         Fixes bug 355717.
11482
11483 2008-03-25 Rodrigo Kumpera  <rkumpera@novell.com>
11484
11485         * verify.c (mono_method_verify): Proper prefix validation.
11486
11487 2008-03-25  Zoltan Varga  <vargaz@gmail.com>
11488
11489         * icall.c (ves_icall_InternalInvoke): Return exceptions thrown by the icall
11490         itself in a separate argument instead of throwing them. Fixes #373448.
11491
11492         * appdomain.c: Bump corlib version.
11493
11494 2008-03-24 Rodrigo Kumpera  <rkumpera@novell.com>
11495
11496         * verify.c: Implemented readonly prefix and verify controled mutability pointers.
11497
11498 2008-03-20  KornĂ©l Pál  <kornelpal@gmail.com>
11499
11500         * file-io.c, filewatcher.c, threadpool.c, threads.c: Removed Windows
11501         version macros.
11502
11503 2008-03-20  Mark Probst  <mark.probst@gmail.com>
11504
11505         * generic-sharing.c, class-internals.h: Code for putting
11506         reflection types into the runtime generic context.
11507
11508 2008-03-19 Rodrigo Kumpera  <rkumpera@novell.com>
11509
11510         * icall.c (ves_icall_get_method_info): Return correct values for the call convention.
11511         Fixes #340662. 
11512
11513
11514 2008-03-17 Rodrigo Kumpera  <rkumpera@novell.com>
11515
11516         * verify.c (VerifyContext): Added instruction prefix data to the struct.
11517
11518         * verify.c (is_compatible_boxed_valuetype): Don't check if the type is a valuetype, been boxed is enough.
11519
11520         * verify.c (do_invoke): Support constrained callvirt form. Grouped similar checks together.
11521
11522         * verify.c (do_cast): Let the result value keep the boxed status.
11523
11524         * verify.c (mono_method_verify): Add proper support for prefixed and implement contrained.
11525
11526 2008-03-17  Jb Evain  <jbevain@novell.com>
11527
11528         * reflection.c: when running on a 2.0 runtime, emit
11529         unconditionally the #~ header version as 2.0, and the
11530         CLI header version as 2.5, for symmetry's sake with csc.
11531
11532 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11533
11534         * class.c: Remove the unused cache_interface_offsets stuff.
11535
11536         * class.c loader.c domain.c verify.c metadata.c debug-helpers.c threadpool.c
11537         profiler.c: Fix warnings.
11538
11539 2008-03-16  Mark Probst  <mark.probst@gmail.com>
11540
11541         * generic-sharing.c, class-internals.h: Support for putting
11542         methods into the runtime generic context.
11543
11544 2008-03-16  Zoltan Varga  <vargaz@gmail.com>
11545
11546         * class.c (mono_class_setup_fields): Ignore calls made to this function for
11547         classes which are generic instances of not-yet finished typebuilders. Fixes
11548         #351172.
11549
11550         * reflection.c (fixup_method): Add support for FieldOnTypeBuilderInst.
11551
11552 2008-03-15  Zoltan Varga  <vargaz@gmail.com>
11553
11554         * metadata-internals.h (MonoDynamicImage): Add 'generic_def_objects' hash table.
11555
11556         * class-internals.h (MonoMethodInflated): Remove the rarely used reflection_info
11557         field, replace it with a hash table in MonoDynamicImage.
11558
11559         * reflection.c (inflate_mono_method): Access the generic definition object from
11560         image->generic_def_objects instead of imethod->reflection_info.
11561
11562         * reflection.c (mono_reflection_bind_generic_method_parameters): Ditto. 
11563
11564         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition): Ditto.
11565         
11566         * image.c (mono_image_close): Move the dynamic image freeing code to a separate
11567         function in reflection.c so it is easier to keep in sync with the dynamic image
11568         creation code.
11569
11570         * reflection.c (mono_dynamic_image_free): New internal function, extracted from
11571         mono_image_close ().
11572
11573 2008-03-15  Mark Probst  <mark.probst@gmail.com>
11574
11575         * class.c (mono_class_generic_sharing_enabled): Disable generic
11576         sharing for all architectures except AMD64 and x86 to fix build.
11577
11578 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11579
11580         * verify.c: Use the generic definition MonoGenericContext when available.
11581         Remove code for checking generics instance compatibility in favor of
11582         mono_class_is_assignable_from.
11583
11584 2008-03-14  Mark Probst  <mark.probst@gmail.com>
11585
11586         * marshal.c, marshal.h, metadata-internals.h, image.c,
11587         wrapper-types.h: New wrapper for invoking a shared static method
11588         without having to pass the runtime generic context argument.
11589
11590 2008-03-14 Rodrigo Kumpera  <rkumpera@novell.com>
11591
11592         * icall-def.h: Add missing function PerformanceCounterCategory::GetInstanceNames.
11593
11594 2008-03-14  Zoltan Varga  <vargaz@gmail.com>
11595
11596         * reflection.c (mono_image_get_field_on_inst_token): Add caching.
11597         
11598         * reflection.c (mono_image_get_field_on_inst_token): New helper function to
11599         create a token from a FieldOnTypeBuilderInst.
11600         (mono_image_create_token): Handle FieldOnTypeBuilderInst.
11601         (resolve_object): Ditto.
11602
11603         * object-internals.h (MonoReflectionFieldOnTypeBuilderInst): New structure
11604         mirroring System.Reflection.Emit.FieldOnTypeBuilderInst.
11605
11606 2008-03-14  Martin Baulig  <martin@ximian.com>
11607
11608         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 68.
11609
11610         * debug-mono-symfile.h
11611         (MONO_SYMBOL_FILE_VERSION): Bump to 41.
11612         (MONO_SYMBOL_FILE_COMPATIBILITY_VERSION): New #define.
11613
11614 2008-03-10  Martin Baulig  <martin@ximian.com>
11615
11616         * debug-mono-symfile.h
11617         (MonoSymbolFileMethodAddress): Removed `num_lexical_blocks' and
11618         `lexical_block_table_offset'.
11619         (MonoDebugMethodInfo): Removed `num_lexical_blocks' and
11620         `lexical_blocks'.
11621         (MonoSymbolFile): Added `version'.
11622
11623         * mono-debug.h
11624         (MonoDebugLexicalBlockEntry): Removed.
11625         (MonoDebugMethodJitInfo): Removed `num_lexical_blocks' and
11626         `lexical_blocks'.
11627
11628         * mono-debug.c (mono_debug_add_method): Don't compute lexical
11629         blocks here; the debugger now does this internally.
11630
11631 2008-02-27  Martin Baulig  <martin@ximian.com>
11632
11633         * object.c (mono_runtime_exec_main): Call
11634         `mono_debugger_event (MONO_DEBUGGER_EVENT_REACHED_MAIN)' and
11635         `mono_debugger_event (MONO_DEBUGGER_EVENT_MAIN_EXITED)' here.
11636
11637 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11638
11639         * verify.c (verify_type_compatibility_full): Allow native int to be converted
11640         to native pointer in non-strict mode. Required to "(IntPtr)null" work.
11641
11642 2008-03-12 Rodrigo Kumpera  <rkumpera@novell.com>
11643
11644         * verify.c (verify_ldftn_delegate): Accept a sealed type when using
11645         ldftn with a virtual method.
11646
11647 2008-03-13  Geoff Norton  <gnorton@novell.com>
11648
11649         * decimal.c:  Only include memory.h if the platform has it.
11650
11651 Wed Mar 12 12:11:06 CET 2008 Paolo Molaro <lupus@ximian.com>
11652
11653         * assembly.c, class.c, metadata-internals.h: make sure public key
11654         tokesns are compared in a case-insensitive way. Also, all
11655         the lookups in the GAC use a lowercase public key token
11656         (gaacutil already does the lowercasing on install). Fixes
11657         bug #369541.
11658
11659 2008-03-11 Rodrigo Kumpera  <rkumpera@novell.com>
11660
11661         * verify.c (mono_delegate_signature_equal): Do proper variance check on arguments
11662         and return value.
11663
11664 Tue Mar 11 17:41:38 CET 2008 Paolo Molaro <lupus@ximian.com>
11665
11666         * image.c: when someone loads a mscorlib from a file, return the
11667         currently loaded mscorlib (fixes bug #369253).
11668
11669 Tue Mar 11 16:47:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11670
11671         * class.c: handle types with no parents by forcing them to have
11672         System.Object as a parent and marking them as broken (this currently
11673         allows the first part of bug #369173 to work as well, likely because
11674         we don't check for typeload exceptions everywhere yet).
11675
11676 Tue Mar 11 15:23:54 CET 2008 Paolo Molaro <lupus@ximian.com>
11677
11678         * class.c: more complete check that types belong to corlib
11679         (fixes second part of bug #369173).
11680
11681 2007-03-10  Bill Holmes  <billholmes54@gmail.com>
11682
11683         * generic-sharing.c:  Including glib.h for the MSVC builds to define
11684           "inline" to "__inline" before including mono-membar.h.
11685           
11686         * mono-perfcounters.c:  Adding HAVE_SYS_TIME_H check for MSVC builds.
11687           Rename "Unknown" to "CatTypeUnknown" to avoid name collisions for 
11688           MSVC builds.
11689
11690         Contributed under MIT/X11 license.
11691
11692 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11693
11694         * verify.c (do_invoke_method): Remove return type validation.
11695
11696         * verify.c (do_ret): Do return type validation at return site instead of
11697         call site.
11698
11699 2008-03-10 Rodrigo Kumpera  <rkumpera@novell.com>
11700
11701         * verify.c (do_invoke_method): Mark callvirt to static methods unverifiable.
11702
11703         * verify.c: Some todos cleaned and improved a few error messages.
11704
11705 2008-03-08  Zoltan Varga  <vargaz@gmail.com>
11706
11707         * class.c (mono_class_setup_mono_type): Improve the test for corlib.
11708
11709 2008-03-07  Zoltan Varga  <vargaz@gmail.com>
11710
11711         * class.c (mono_class_setup_mono_type): Handle types whose name clashes with
11712         system types correctly.
11713
11714         * exception.h exception.c (mono_exception_from_token_two_strings): New helper
11715         function.
11716
11717 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11718
11719         * assembly.c (build_assembly_name): Fix a warning.
11720
11721 Thu Mar 6 19:43:41 CET 2008 Paolo Molaro <lupus@ximian.com>
11722
11723         * marshal.c: ldfld_remote and stfld_remote needs just one wrapper as
11724         the called function takes an object type argument. Fixes storing or
11725         valuetypes across remoting as well as reducing memory usage.
11726         * image.c, metadata-internals.h: remove now unused ldfld_remote and
11727         stfld_remote wrapper caches.
11728
11729 2008-03-06  Zoltan Varga  <vargaz@gmail.com>
11730
11731         * icall.c (mono_lookup_internal_call): Update the exception message when an icall
11732         is not found.
11733
11734         * reflection.c (mono_image_register_token): New helper function to save
11735         a token->object mapping.        
11736
11737         * icall.c (ves_icall_ModuleBuilder_RegisterToken): New icall to access it from
11738         managed code.
11739
11740         * reflection.c (_mono_reflection_parse_type): Distinguish between vectors and
11741         one dimension arrays. Fixes #367670.
11742         (mono_reflection_get_type_internal): Ditto.
11743
11744 Tue Mar 4 19:04:02 CET 2008 Paolo Molaro <lupus@ximian.com>
11745
11746         * marshal.c: mono_load_remote_field_new() always returns object.
11747         so use the proper signature (fixes bug #366445).
11748
11749 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11750         
11751         * class-internals.h (MonoMethod): Remove unused uses_this flag, 
11752         add an 'inline_failure' flag instead.
11753
11754 2008-03-04  Mark Probst  <mark.probst@gmail.com>
11755
11756         * domain-internals.h, domain.c: Replaced MonoGenericSharingContext
11757         with a new structure, MonoGenericJitInfo, in the MonoJitInfo.  It
11758         contains the location of "this", used for exception handling.
11759
11760 2008-03-04  Zoltan Varga  <vargaz@gmail.com>
11761
11762         * class.c (mono_class_layout_fields): Set the min alignment of small structs to
11763         their size on all platforms for perf reasons.
11764
11765 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11766
11767         * reflection.h: Move mono_reflection_is_valid_dynamic_token to
11768         object-internal.h
11769
11770         * object-internal.h: Same.
11771
11772 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11773
11774         * reflection.h: Fix the build I just broke.
11775
11776 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11777
11778         * reflection.c (mono_reflection_is_valid_dynamic_token): New function,
11779         Test if a token is valid, this remove explicit usage of 
11780         MonoDynamicImage::tokens from the verifier code.
11781
11782         * reflection.h: Added mono_reflection_is_valid_dynamic_token.
11783
11784         * verify.c (token_bounds_check): Use mono_reflection_is_valid_dynamic_token
11785         instead of direct access to MonoDynamicImage::tokens.
11786
11787 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11788
11789         * verify.c (token_bounds_check): Fix the build I just broke.
11790
11791 2008-03-03 Rodrigo Kumpera  <rkumpera@novell.com>
11792
11793         * verify.c (token_bounds_check): Fix bounds check for dynamic images.
11794
11795         * verify.c (verifier_load_method): Fixed the errors message.
11796
11797         * verify.c (mono_method_verify): Fixed a debug message.
11798
11799 Thu Feb 28 19:49:45 CET 2008 Paolo Molaro <lupus@ximian.com>
11800
11801         * icall-def.h, domain.c, mono-perfcounters-def.h, mono-perfcounters.c,
11802         mono-perfcounters.h, class-internals.h: support for predefined
11803         writable counters, query of categories and counters, bugfixes.
11804
11805 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11806
11807         * verify.c (do_refanytype): Verify the refanytype opcode.
11808
11809         * verify.c (mono_method_verify): Use do_refanytype.
11810
11811 2008-02-28 Rodrigo Kumpera  <rkumpera@novell.com>
11812
11813         * verify.c (do_mkrefany): Verify the mkrefany opcode.
11814
11815         * verify.c (mono_method_verify): Use do_mkrefany.
11816
11817 Wed Feb 27 19:49:16 CET 2008 Paolo Molaro <lupus@ximian.com>
11818
11819         * Makefile.am, icall-def.h, icall.c, mono-perfcounters-def.h,
11820         mono-perfcounters.c, mono-perfcounters.h: basic performance counter
11821         implementation.
11822
11823 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11824
11825         * marshal.c (mono_marshal_get_synchronized_wrapper): Fix the code which throws
11826         the type load exception.
11827
11828 2008-02-27 Rodrigo Kumpera  <rkumpera@novell.com>
11829
11830         * verify.c: Added a few FIXME for method signatures
11831
11832         * verify.c (do_invoke_method): Use mono_method_get_signature_full instead
11833         of mono_method_get_signature and get vararg call working. Removed unused
11834         checks for return value.
11835
11836         * verify.c (do_refanyval): Verify the refanyval opcode.
11837
11838         * verify.c (mono_method_verify): Implemented verification of arglist and
11839         use do_refanyval.
11840
11841 2008-02-27  Zoltan Varga  <vargaz@gmail.com>
11842
11843         * class.c (mono_class_setup_methods): Move the check for synchronized methods on
11844         vtypes to marshal.c.
11845
11846         * marshal.c (mono_marshal_get_synchronized_wrapper): Do the vtype check here so
11847         it works for AOT as well.
11848
11849 Tue Feb 26 17:46:32 CET 2008 Paolo Molaro <lupus@ximian.com>
11850
11851         * monitor.c, threads.c, threadpool.c: replace the use of GetTickCount ()
11852         with mono_msec_ticks () which is monotonic and doesn't cause bugs when
11853         the system time is adjusted.
11854
11855 Tue Feb 26 17:40:10 CET 2008 Paolo Molaro <lupus@ximian.com>
11856
11857         * icall.c, icall-def.h: use the new time functions (fixes the
11858         non-monotonic behaviour of TickCount).
11859
11860 2008-02-26  Zoltan Varga  <vargaz@gmail.com>
11861
11862         * reflection.c (mono_custom_attrs_from_builders): Revert the last change as
11863         it breaks the build.
11864         
11865         * reflection.c (mono_custom_attrs_from_builders): Assert instead of a crash if the
11866         cattr is not finished yet.
11867
11868 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11869
11870         * verify.c: Proper token validation for field, method and type.
11871
11872 2008-02-25 Rodrigo Kumpera  <rkumpera@novell.com>
11873
11874         * loader.c (field_from_memberref): Generate a loader error if the type is not found.
11875
11876         * loader.c (method_from_memberref): Generate type load error instead of method missing
11877         if the type is not found.
11878
11879 2008-02-23  Zoltan Varga  <vargaz@gmail.com>
11880
11881         * marshal.c (mono_marshal_emit_managed_wrapper): Avoid generating invalid IL if
11882         some of the conversions caused the generation of a marshal directive exception.
11883
11884 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11885
11886         verify.c: Report which exception should be thrown by the JIT.
11887         Added a lot of FIXME notes.
11888
11889 2008-02-22  Mark Probst  <mark.probst@gmail.com>
11890
11891         * generic-sharing.c: Runtime generic context slots are not
11892         instantiated on init anymore.  Instead, provide function to do the
11893         instantiating on demand.
11894
11895         * class-internals.h: Added vtable to runtime generic context.
11896         Macros for encoding direct and indirect slot offsets in one
11897         guint32.
11898
11899 2008-02-21  Mark Probst  <mark.probst@gmail.com>
11900
11901         * object.c, generic-sharing.c: Moved some generic sharing code
11902         from object.c to generic-sharing.c.
11903
11904         * generic-sharing.c: Added support for extensible runtime generic
11905         context.
11906
11907         * metadata-internals.h: Two new hash tables in MonoImage for
11908         extensible runtime generic context support.
11909
11910         * domain.c: Unregister generic vtables upon domain unloading.
11911
11912         * image.c: Destroy new hash tables upon image unloading.
11913
11914         * metadata.c: Unregister generic subclasses upon image unloading.
11915
11916         * class-internals.h: New data structure for runtime generic
11917         context template.  New fields in the runtime generic context for
11918         extensible part.
11919
11920         * Makefile.am: Added generic-sharing.c.
11921
11922 2008-02-21 Rodrigo Kumpera  <rkumpera@novell.com>
11923
11924         icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): If
11925         there is a pending loader exception, raise it.
11926
11927         icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
11928         same.
11929
11930         icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): 
11931         same.
11932
11933         Fixes #363450.
11934
11935 2008-02-20  Zoltan Varga  <vargaz@gmail.com>
11936
11937         * icall.c (ves_icall_Type_GetPacking): Handle dynamic types.
11938
11939         * assembly.c (mono_assembly_load_from_full): Fix a leak in the previous patch.
11940         
11941         * assembly.c (mono_assembly_load_from_full): Return the non-refonly corlib for
11942         ref-only requests for compatibility with MS.
11943
11944 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11945
11946         * reflection.c (mono_custom_attrs_from_method): Don't silently
11947         return an empty list for generic method instances.
11948         (mono_custom_attrs_from_param): Likewise.
11949
11950 2008-02-20  Rodrigo Kumpera  <rkumpera@novell.com>
11951             Raja R Harinath  <harinath@hurrynot.org>
11952
11953         Fix #354757
11954         * class-internals.h (struct _MonoMethodInflated.is_mb_open): Add.
11955         * class.c (mono_class_inflate_generic_method_full): Initialize it
11956         when a fully-open method is instantiated.
11957         * metadata.c (inflated_method_equal, inflated_method_hash): Update
11958         to new field.
11959         * reflection.c (inflate_mono_method): Don't create a temporary context.
11960
11961 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
11962
11963         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
11964         Compute correct value, to prepare for imethod->reflection_info going away.
11965
11966 2008-02-19  Zoltan Varga  <vargaz@gmail.com>
11967
11968         * class.c (mono_class_setup_vtable_general): Ignore static methods in interfaces.
11969
11970 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
11971
11972         * verify.c: Implement skip visibility flag.
11973
11974 2008-02-18 Rodrigo Kumpera  <rkumpera@novell.com>
11975
11976         * verify.h: Added MONO_VERIFY_SKIP_VISIBILITY and struct MonoVerifyInfoExtended
11977         which contains an extra field to tell the kind of exception that should be thrown.
11978
11979         * verify.c: Use MonoVerifyInfoExtended instead of MonoVerifyInfo.
11980
11981 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
11982
11983         * loader.c (mono_method_get_param_names): Initialize 'klass' after
11984         'method' is updated.
11985
11986 2008-02-11  Zoltan Varga  <vargaz@gmail.com>
11987
11988         * class.c (mono_class_layout_fields): Set class->min_align for classes using
11989         explicit layout as well. Fixes #360375.
11990
11991 2008-02-11  Geoff Norton  <gnorton@novell.com>
11992
11993         * loader.c: Guard and dereference against inflated generic methods
11994
11995 2008-02-10  Gert Driesen  <drieseng@users.sourceforge.net>
11996
11997         * class.c: Include Retargetable spec in assembly name.
11998         * assembly.c: Always include PublicKeyToken spec in assembly name
11999         (with value "null" if assembly is not signed), and include
12000         Retargetable spec.
12001         * icall-def.h: Added icall for Assembly.get_fullname.
12002         * icall.c: Added icall returning the fullname of an assembly.
12003
12004 2008-02-09  Zoltan Varga  <vargaz@gmail.com>
12005
12006         * class.c (mono_class_setup_vtable_general): Add a missing call to
12007         mono_class_setup_methods () which is needed in the AOT case.
12008
12009 2008-02-08 Rodrigo Kumpera  <rkumpera@novell.com>
12010
12011         * verify.c (mono_type_get_stack_name): Added. Return the name for the
12012         stack type of the given MonoType.
12013
12014         * verify.c (verify_type_compatibility_full): Handle the void type.
12015
12016         * verify.c (is_compatible_boxed_valuetype): Changed to fit the
12017         way stack merging works.
12018
12019         * verify.c (store_local): Improved verification message.
12020
12021         * verify.c (do_branch_op): If the merging is invalid, the method
12022         is unverifiable and not invalid. Improved error message.
12023
12024         * verify.c (merge_stacks): Properly merge a boxed valuetype and
12025         a reference type diferent than System.Object. Improved error
12026         message.
12027
12028 2008-02-07 Rodrigo Kumpera  <rkumpera@novell.com>
12029
12030         * verify.c (mono_type_is_enum_type): Added. Test if a type is an enum.
12031
12032         * verify.c (mono_type_get_underlying_type_any): Added. Return the underlying
12033         type of an enum even if the argument is byref.
12034
12035         * verify.c: Replace all explicit uses of enumtype and enum_basetype
12036         to calls to mono_type_is_enum_type and mono_type_get_underlying_type_any.
12037
12038         * verify.c: Check for an enum in all cases of MONO_TYPE_GENERICINST.
12039
12040         *verify.c (verify_type_compatibility_full): Make enum types
12041         compatible with their base types.
12042
12043         * verify.c (is_compatible_boxed_valuetype): Added. Check if both
12044         types are compatible for the special case of a boxed valuetype and
12045         System.Object.
12046
12047         * verify.c (verify_stack_type_compatibility): The function
12048         is_compatible_boxed_valuetype was extracted from here.
12049
12050         * verify.c (push_arg): Only set ctx->has_this_store if the method
12051         is not static.
12052
12053         * verify.c (do_ldelem): Fixed a typo in an error message and added
12054         strict check for mixing int32 and native int as the array type
12055         and ldelem type.
12056
12057         * verify.c (merge_stacks): Consider boxed valuetypes in the
12058         compatibility checks.
12059
12060 2008-02-07  Massimiliano Mantione  <massi@ximian.com>
12061         * profiler.h: (MonoGCEvent): Added start-stop the world events.
12062
12063 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
12064         *class.c: use_new_interface_vtable_code: renamed the env var to have
12065         a "MONO_" prefix, and fix the logic to enable it by default.
12066
12067 2008-02-06  Massimiliano Mantione  <massi@ximian.com>
12068         *class.c:
12069         mono_class_setup_vtable_general: rewrote the way in which interface
12070         methods are added to vtables. Makes bug-77127.exe pass, and hopefully
12071         makes the code more maintainable.
12072         For now the old code is still there, and can be activated setting
12073         the env var "USE_NEW_INTERFACE_VTABLE_CODE".
12074
12075 2008-02-06 Rodrigo Kumpera  <rkumpera@novell.com>
12076
12077         * verify.c: guarded some debug functions around and #ifdef.
12078
12079         * verify.c (merge_stacks): implement proper PIII 1.8.1.3 stack state merging.
12080
12081 2008-02-06  Zoltan Varga  <vargaz@gmail.com>
12082
12083         * marshal.c (mono_marshal_get_runtime_invoke): Revert the direct_wrapper
12084         changes for now since they seem to break too many things.
12085
12086 2008-02-05  Mark Probst  <mark.probst@gmail.com>
12087
12088         * marshal.c, marshal.h (mono_marshal_find_bitfield_offset,
12089         mono_marshal_find_nonzero_bit_offset): Added macro and function
12090         for finding the byte- and bit-offset of a bitfield within a
12091         struct.
12092
12093 2008-02-05  Zoltan Varga  <vargaz@gmail.com>
12094
12095         * marshal.c (mono_marshal_get_ptr_to_struct): Make the signature non-pinvoke.
12096         (mono_marshal_get_struct_to_ptr): Ditto.
12097
12098         * marshal.c (mono_marshal_get_runtime_invoke): Fix the signature of 
12099         cctor_signature.
12100
12101 2008-02-03  Zoltan Varga  <vargaz@gmail.com>
12102
12103         * marshal.c (mono_marshal_get_runtime_invoke): Fix sharing of runtime wrappers
12104         between methods for non-corlib types.
12105
12106 2008-02-02  Geoff Norton  <gnorton@novell.com>
12107
12108         * loader.c (mono_method_get_param_names): Populate the parameter name for 
12109         generic parameters as well. (Fixes #342536)
12110
12111 2008-01-31 Rodrigo Kumpera  <rkumpera@novell.com>
12112
12113         * verify.c (is_valid_bool_arg): Allow boxed values and null literals as well.
12114
12115         * verify.c (do_invoke_method): Fix for calling with byref structs.
12116
12117         * verify.c (do_cast): push a boxed value type based on the type token and not
12118         the type of stack.
12119
12120 2008-01-31  William Holmes  <billholmes54@gmail.com>
12121
12122         * process.c (process_module_string_read): Check the size returned form 
12123           VerQueryValue to avoid out of memory exception. 
12124
12125 2008-01-30  Zoltan Varga  <vargaz@gmail.com>
12126
12127         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
12128         Handle properly modules which are not in the moduleref table. Fixes
12129         #356938.
12130
12131 2008-01-29  Zoltan Varga  <vargaz@gmail.com>
12132
12133         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Remove
12134         the dynamic case which is now in managed code.
12135         (ves_icall_System_Reflection_Assembly_GetTypes): Ditto.
12136
12137         * marshal.c (mono_string_to_bstr): Fix a warning.
12138         (init_com_provider_ms): Ditto.
12139
12140         * appdomain.c (ves_icall_System_AppDomain_createDomain): Add some FIXMEs.
12141
12142         * exception.c (mono_get_exception_out_of_memory): New helper function.
12143
12144 2008-01-28  Jonathan Chambers  <joncham@gmail.com>
12145
12146         * marshal.c: Add support for BSTR marshalling
12147         using other COM systems.
12148
12149         Code is contributed under MIT/X11 license.
12150
12151 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12152
12153         * object.c (mono_runtime_invoke_array): reverted previous
12154         commit as it breaks the build.
12155
12156 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12157
12158         * object.c (mono_runtime_invoke_array): Verify arguments for
12159         invalid types. Fixes #348522.
12160
12161 2008-01-28 Rodrigo Kumpera  <rkumpera@novell.com>
12162
12163         * verify.c: added IL_CODE_CALL_NONFINAL_VIRTUAL to track calls to
12164         non-final virtual calls using call. 
12165
12166         * verify.c (do_invoke): fixed some TODOs.
12167
12168         * verify.c (push_arg): set has_this_store for "ldarga 0".
12169
12170 2008-01-27  Zoltan Varga  <vargaz@gmail.com>
12171
12172         * reflection.c (reflection_methodbuilder_to_mono_method): Allow DynamicMethods
12173         which belong to an inflated class. Fixes #356531.
12174
12175 2008-01-26  Robert Jordan  <robertj@gmx.net>
12176
12177         * file-io.c: Implement and use wrappers for GetFileAttribute|Ex ()
12178         which resort to FindFirstFile when a certain error condition
12179         (ERROR_SHARING_VIOLATION) occured. Fixes bug #325212.
12180         Code is contributed under MIT/X11 license.
12181
12182 2008-01-24  Jonathan Chambers  <joncham@gmail.com>
12183
12184         * marshal.c (emit_marshal_string): Fix out string marshalling
12185         to use specified encoding. Fixes #323900.
12186
12187         Code is contributed under MIT/X11 license.
12188
12189 2008-01-24  Raja R Harinath  <harinath@hurrynot.org>
12190
12191         * class.c (mono_class_inflate_generic_method_full): Don't modify
12192         iresult->context after cache check.
12193
12194 2008-01-23  Zoltan Varga  <vargaz@gmail.com>
12195
12196         * class.c (mono_class_inflate_generic_method_full): Change the
12197         struct assignments to memcpy for better visibility and add some comments.
12198
12199 2008-01-23  Dick Porter  <dick@ximian.com>
12200
12201         * threads.c (mono_threads_set_shutting_down): Simplify shutdown
12202         procedure, and make it work on windows.
12203
12204 2008-01-22  Zoltan Varga  <vargaz@gmail.com>
12205
12206         * object-internals.h (MonoReflectionGenericClass): Make the 'generic_type' field
12207         a MonoReflectionTypeBuilder since it is always of that type.
12208
12209         * reflection.c (mono_type_get_object): Remove an unneccesary check.     
12210
12211         * reflection.c (mono_generic_class_get_object): Simplify this a bit.
12212
12213         * reflection.c (mono_reflection_bind_generic_parameters): Ditto.
12214         
12215         * icall.c (ves_icall_MonoGenericClass_GetParentType): Ditto.
12216
12217         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Ditto.
12218
12219         * reflection.c (mono_reflection_create_runtime_class): Remove already created
12220         instantiations from the type cache.
12221
12222 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12223
12224         * verify.c (do_ldstr): fixed token verification. previous code was 100% broken.
12225
12226         * verify.c (do_unbox_value): push a controled mutability managed pointer.
12227
12228 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12229
12230         * verify.c (do_ldstr): added, verifies if the #US token is valid.
12231
12232         * verify.c (mono_method_verify): removed old TODO
12233
12234 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12235
12236         * verify.c (do_newobj): add visibility check.
12237
12238 2008-01-21 Rodrigo Kumpera  <rkumpera@novell.com>
12239
12240         * verify.c (do_load_function_ptr): add visibility check.
12241
12242 2008-01-21  Massimiliano Mantione  <massi@ximian.com>
12243         *class.c:
12244         mono_generic_class_get_class: hook profiler events.
12245         mono_field_get_offset: added to support heap-shot in the new profiler.
12246         *class.h: exported mono_field_get_offset.
12247         * reflection.c:
12248         mono_reflection_setup_internal_class: hook profiler events.
12249
12250 2008-01-20  Zoltan Varga  <vargaz@gmail.com>
12251
12252         * marshal.c (mono_marshal_emit_native_wrapper): Add a 'check_exceptions' 
12253         argument here too and use it to avoid checking for pending exceptions if 
12254         possible.
12255
12256 2008-01-20  Gert Driesen  <drieseng@users.sourceforge.net>
12257
12258         * assembly.c (build_assembly_name): add arg for passing the assembly
12259         flags. Do not consider a PublicKey with value "null" valid.
12260         (mono_assembly_name_parse_full): added boolean argument that will be
12261         set if the assembly name contains a PublicKeyToken spec. Added support
12262         for the Retargetable spec for which only Yes or No are allowed as valid
12263         value. Consider assembly name invalid if Retargetable spec is set, but
12264         either version, culture or public key (token) are not specified.
12265         * metadata-internals.h: sync signature of mono_assembly_name_parse_full
12266         with implementation in assembly.c.
12267         * icall.c (fill_reflection_assembly_name): also copy assembly flags
12268         from MonoAssemblyName.
12269         (ves_icall_System_Reflection_AssemblyName_ParseName): use newly
12270         introduced argument for mono_assembly_name_parse_full to know if the
12271         assembly name has a PublicKeyToken spec, and if it has instruct
12272         fill_reflection_assembly_name to use default value for keyToken (if
12273         PublicKeyToken is null).
12274
12275 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12276
12277         * verify.c (mono_method_verify): fixed ovf ops with
12278         float values. They are unverifiable now.
12279
12280 2008-01-18  Rodrigo Kumpera  <rkumpera@novell.com>
12281
12282         * class.c (set_failure_from_loader_error): add BadImageException to the
12283         list of exceptions that can cause a type to fail to load.
12284
12285         * class.c (mono_class_get_exception_for_failure): same.
12286
12287 2008-01-17  Rodrigo Kumpera  <rkumpera@novell.com>
12288
12289         * verify.c (in_any_exception_block): added, check if offset
12290         is part of any exception handling clause.
12291
12292         * verify.c (get_stack_type): added VAR and MVAR types.
12293
12294         * verify.c (do_stobj): better error messages.
12295
12296         * verify.c (do_cpobj): added, check cpobj.
12297
12298         * verify.c (do_initobj): added, check initobj.
12299
12300         * verify.c (do_sizeof): added, check sizeof.
12301
12302         * verify.c (do_localloc): added, check localloc.
12303
12304         * verify.c: adde proper verification for cpobj, initobj, sizeof and localloc.
12305
12306 2008-01-17  Zoltan Varga  <vargaz@gmail.com>
12307
12308         * method-builder.c (mono_mb_emit_native_call): Get rid of the unused
12309         save_lmf/restore_lmf opcodes.
12310
12311         * threads.c (mono_threads_install_notify_pending_exc): New function to
12312         install a callback notifying the JIT there is a pending exception on a thread.
12313         (mono_thread_request_interruption): Call the new callback.
12314         (mono_thread_get_and_clear_pending_exception): New function to return the
12315         exception pending on a thread.
12316
12317         * marshal.c (mono_marshal_get_icall_wrapper): Add a check_exceptions argument
12318         to turn off checking for pending exceptions.
12319         (mono_marshal_get_native_wrapper): Ditto.
12320
12321 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12322
12323         * threads-types.h: Get rid of the unnecessary extern declarations.
12324
12325 2008-01-16  Gert Driesen  <drieseng@users.sourceforge.net>
12326
12327         * icall.c (ves_icall_Type_GetField): if NonPublic flag is set, only
12328         return field from parent class if not private.
12329         (ves_icall_Type_GetFields_internal): if NonPublic flag is set, only
12330         returns fields from parent class if they are not private.
12331         (method_nonpublic): added function to determine if a given method
12332         should be considered non-public. Returns false for private methods
12333         on parent class, and internal methods from parent on the 1.0 profile.
12334         (ves_icall_Type_GetMethodsByName): if NonPublic flag is set, then
12335         use method_nonpublic function to determine whether method should be
12336         returned.
12337         (property_accessor_public): use newly introduced method_nonpublic
12338         function to determine whether accessor is non-public. 
12339         (ves_icall_MonoType_GetEvent): If NonPublic flag is set, only return
12340         event from parent class if not private. Only return static event if
12341         Static flag is set, and only return static event from parent class if
12342         FlattenHierarchy flag is set.
12343         (ves_icall_Type_GetEvents_internal): If NonPublic flag is set, only
12344         include non-private events from parent class.
12345
12346 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
12347
12348         * icall.c (ves_icall_System_NumberFormatter_GetFormatterTables): Fix a
12349         warning.
12350
12351 2008-01-16  Wade Berrier <wberrier@novell.com>
12352
12353         * security.c: Add assembly.h header to appease some warnings
12354
12355 2008-01-16  Dick Porter  <dick@ximian.com>
12356
12357         * process.c (process_module_string_read): Remove trailing null
12358         when saving string.
12359
12360 2008-01-16  Mark Probst  <mark.probst@gmail.com>
12361
12362         * class-internals.h: A new data structure describing the layout of
12363         a runtime generic context (MonoRuntimeGenericContextTemplate).
12364
12365         * metadata-internals.h: Added a hash table to MonoDomain that maps
12366         from open generic classes to their runtime generic context
12367         templates.
12368
12369         * object.c: Building of the runtime generic context, including
12370         proper handling of generic type arguments of superclasses.
12371         Building of the runtime generic context according to the template.
12372
12373 2008-01-15  Zoltan Varga  <vargaz@gmail.com>
12374
12375         * class.c (mono_class_setup_fields): Set field.count for generic instances.
12376         Fixes #350856.
12377
12378         * image.c (do_mono_image_open): Pass TRUE as last_exists to 
12379         mono_portability_find_file (). Fixes #325466.
12380         (mono_image_get_public_key): Fix a warning.
12381
12382 2008-01-14  Zoltan Varga  <vargaz@gmail.com>
12383
12384         * class.c (mono_class_from_name): Fix comments for NULL-ness of image parameter.
12385         Fixes #353550.
12386         (mono_class_from_name_case): Ditto.
12387
12388 2008-01-13  Eyal Alaluf <eyala@mainsoft.com>
12389
12390         * icall-def.h number-formatter.h icall.c: Implemented a cross app-domain
12391           common storage for the tables used in the System/NumberFormatter class.
12392
12393 2008-01-13  Zoltan Varga  <vargaz@gmail.com>
12394
12395         * marshal.c (mono_marshal_get_runtime_invoke): Fix a typo.
12396
12397 2008-01-11  Rodrigo Kumpera  <rkumpera@novell.com>
12398
12399         * verify.c (get_boxable_mono_type): check if the token is valid.
12400
12401         * verify.c (set_stack_value): changed to add an error if an
12402         invalid type is set on stack. Changed all callers due to signature change.
12403
12404         * verify.c (do_stobj): implement stobj validation.
12405
12406 2008-01-11  Zoltan Varga  <vargaz@gmail.com>
12407
12408         * reflection.c (reflection_methodbuilder_to_mono_method): No need to
12409         set container->is_method, it was set earlier.
12410
12411         * metadata.c (type_in_image): Handle MVARs which belong to not finished
12412         generic methods.
12413
12414         * reflection.c (mono_reflection_initialize_generic_parameter): Set
12415         is_method of the generic container to TRUE for methods.
12416
12417 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12418
12419         * metadata.c (type_in_image): Handle type parameters properly.
12420
12421         * class-internals.h (MonoGenericParam): Add an 'image' argument to track
12422         memory ownership of this structure.
12423
12424 2008-01-10  Rodrigo Kumpera  <rkumpera@novell.com>
12425
12426         * verify.c (get_boxable_mono_type): make typedref types been just
12427         unverifiable. check for void type.
12428
12429         * verify.c (do_unbox_any): added, verify opcode unbox.any.
12430
12431         * verify.c (do_load_function_ptr): accept method spec tokens.
12432
12433 2008-01-10  Zoltan Varga  <vargaz@gmail.com>
12434
12435         * marshal.c (mono_class_native_size): Always set *align even if this is called
12436         recursively.
12437
12438 2008-01-09  Zoltan Varga  <vargaz@gmail.com>
12439
12440         * verify.c (mono_verify_corlib): Remove this as it was not used and was 
12441         out-of-date.
12442
12443 2008-01-09  Rodrigo Kumpera  <rkumpera@novell.com>
12444
12445         * verify.c: removed some old unused tables. A huge bunch of small fixes
12446         to things found while testing the verifier with mono basic.
12447
12448         * verify.c (dump_stack_value): dump null literal flag to.
12449
12450         * verify.c (verify_type_compatibility_full): fix comparison
12451         for types that have a generic super type.
12452
12453         * verify.c (verify_stack_type_compatibility): fix compatibility
12454         between null literals and reference types. fix compatibility between
12455         boxed valuetypes and object. fix corner case test for enums.
12456
12457         * verify.c (do_cmp_op): proper verification of cgt.un in case
12458         of reference types.
12459
12460         * verify.c (do_invoke_method): fix error message.
12461
12462         * verify.c (do_store_indirect
12463
12464         * verify.c (check_is_valid_type_for_field_ops): proper verification
12465         of managed pointers to valuetypes and boxed valuetypes. proper verification
12466         of null literals.
12467
12468         * verify.c (do_unbox_value): expect valuetypes to be always boxed. don't
12469         allow token to be a reference type.
12470
12471         * verify.c (do_cast): proper handling of boxes valuetypes.
12472
12473         * verify.c (do_stelem): proper handling of storing a boxed valuetype
12474         in object[].
12475
12476         * verify.c (mono_method_verify): pass the opcode to do_cmp_op
12477         to handle cgt.un properly. Implement add/mul/sub ovf opcodes.
12478         fixed the decoding of unbox_any
12479
12480 2008-01-08  Zoltan Varga  <vargaz@gmail.com>
12481
12482         * boehm-gc.c (mono_gc_deregister_root): Fix the size passed to libgc.
12483
12484 2008-01-08  Rodrigo Kumpera  <rkumpera@novell.com>
12485
12486         * verify.c (do_newobj): do delegate verification.
12487
12488         * verify.c (verify_delegate_compatibility): perform delegate
12489         verification.
12490
12491         * verify.c (verify_ldftn_delegate): perform tests related to
12492         ldftn delegates.
12493
12494         * verify.c (mono_delegate_signature_equal): perform the
12495         slightly diferent signature comparison required by delegates.
12496
12497         * metadata.c (mono_metadata_type_equal_full): added and exported
12498         as MONO_INTERNAL. This is a version of mono_metadata_type_equal that
12499         allows signature only comparison.
12500
12501         * metadata-internal.h (mono_metadata_type_equal_full): added and exported
12502         as MONO_INTERNAL.
12503
12504 2008-01-07  Rodrigo Kumpera  <rkumpera@novell.com>
12505
12506         * verify.c: added a bunch of stack_slot_* functions to
12507         make access to stack slot type easier. This is required to
12508         allow optional flags, like null literal, boxed value and
12509         this pointer.
12510         All access paths to IlStackDesc::stype have been changed 
12511         to use these new funcions.
12512         Removed a bunch of unused functions and cleared all warnings.
12513         This patch introduces the usage of the this pointer and 
12514         boxed value flags.
12515
12516 2008-01-07  Zoltan Varga  <vargaz@gmail.com>
12517
12518         * boehm-gc.c (mono_gc_deregister_root): Fix win32 build.
12519
12520 2008-01-06  Zoltan Varga  <vargaz@gmail.com>
12521
12522         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Change signature to
12523         match managed version.
12524
12525         * appdomain.c: Bump corlib version.
12526         
12527         * appdomain.c (ves_icall_System_AppDomain_ExecuteAssembly): Check for a null
12528         argument.
12529
12530 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
12531
12532         * icall.c (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies)
12533         Set public key token to zero-length byte array if assembly is not
12534         strongnamed.
12535
12536 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12537
12538         * icall.c (ves_icall_System_Array_SetValueImpl): Use a write barrier when
12539         writing a vtype array elem.
12540
12541 2007-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
12542
12543         * assembly.c (build_assembly_name): return FALSE if length of token is
12544         not 16 (if not "null").
12545         (mono_assembly_name_parse_full): return FALSE if value of version,
12546         culture, token or key is 0.
12547         * icall.c (fill_reflection_assembly_name): add boolean arguments to
12548         specify whether public key and public key token must be set to default
12549         value (zero-length byte array) if not available. Set versioncompat to
12550         SameMachine. If public key is available or the default is set, then
12551         set PublicKey flag.
12552         (ves_icall_System_Reflection_Assembly_FillName): if no public key
12553         is available, use empty byte array as default value. On the 2.0
12554         profile, use default value for public key token if not set.
12555         (ves_icall_System_Reflection_InternalGetAssemblyName): on the 1.0
12556         profile, use default value for public key if not set. On the 2.0
12557         profile, use default value for public key token if not set.
12558         (ves_icall_System_Reflection_AssemblyName_ParseName): do not set
12559         default values for public key and public key token.
12560
12561 2008-01-05  Zoltan Varga  <vargaz@gmail.com>
12562
12563         * object-internals.h (MonoReflectionAssemblyName): Add 'processor_architecture'
12564         field to keep it in synch with the managed object.
12565
12566         * marshal.c (emit_marshal_object): Add support for byref marshalling of
12567         delegates. Fixes #351520.
12568
12569         * sgen-gc.c (conservatively_pin_objects_from): Tell valgrind that the pin queue
12570         contains defined memory.
12571         
12572         * sgen-gc.c: Fix 64 bit warnings. Fix some typos. Update GC stats in mono_stats.
12573
12574         * sgen-gc.c (build_nursery_fragments): Handle half-constructed objects correctly.
12575         
12576         * sgen-gc.c (check_consistency): New helper function to do a consistency check
12577         of the GC data structures.
12578
12579         * gc-internal.h: Moved the REGISTER/UNREGISTER macros here from os/gc_wrapper.h.
12580
12581         * *.c: Include metadata/gc-internal.h instead of os/gc_wrapper.h.
12582         
12583         * object.c (mono_array_full_copy): Fix detection of whenever to use a write
12584         barrier.
12585         (mono_array_clone_in_domain): Ditto.
12586         (mono_array_clone_in_domain): Ditto.
12587
12588         * threads.c (start_wrapper): Register the thread start argument as a GC root.
12589         (cache_culture): Use a write barrier.
12590
12591         * icall.c (ves_icall_System_Array_SetValueImpl): Call a write barrier.
12592         (ves_icall_get_property_info): Ditto.
12593
12594         * object.h (MONO_STRUCT_SETREF): New macro.
12595
12596         * class-internals.h (MonoStats): Add some GC statistics.
12597
12598         * boehm-gc.c null-gc.c: Define mono_gc_deregister_root ().
12599
12600 2008-01-04  Andreas Faerber  <andreas.faerber@web.de>
12601
12602         * exception.c (mono_exception_from_name_two_strings):
12603         Break from loop after method is found.
12604
12605 2008-01-04  Dick Porter  <dick@ximian.com>
12606
12607         * process.c (process_module_string_read): Rename variable to
12608         reflect correct usage, after fixing bug 345972.
12609
12610 2008-01-03  Rodrigo Kumpera  <rkumpera@novell.com>
12611
12612         * verify.c (mono_type_create_fnptr_from_mono_method): 
12613         created a MonoType function pointer instance to be used during
12614         verification. The verifier releases this memory at end.
12615
12616         * verify.c (mono_method_is_constructor): extracted repeated
12617         checks for constructor into a single class.
12618
12619         * verify.c (do_push_field): use new extracted method
12620         for constructor check.
12621
12622         * verify.c (do_newobj): same.
12623
12624         * verify.c (do_ldftn): renamed to do_load_function_ptr
12625         and make it verify ldvirtftn too.
12626
12627         * verify.c (mono_method_verify: proper verification
12628         of ldvirtftn. release created MonoMethod instances.
12629
12630 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12631
12632         * verify.c (token_bounds_check): added.
12633
12634         * verify.c (do_ldftn): added.
12635
12636         * verify.c (mono_method_verify): proper verificartion of ldftn.
12637
12638 2007-12-31  Rodrigo Kumpera  <rkumpera@novell.com>
12639
12640         * metadata.c (mono_metadata_decode_row): Assert if index is bigger
12641         than the table row count. It's the resposibility of the caller to
12642         make the bounds check and raise the correct error.
12643
12644         * metadata.c (mono_metadata_decode_row_col): Same.
12645
12646         * loader.c (mono_get_method_from_token): perform bounds check
12647         on token for methoddef table.
12648
12649 2007-12-29  Miguel de Icaza  <miguel@novell.com>
12650
12651         * icall.c
12652         (ves_icall_System_CurrentSystemTimeZone_GetTimeZoneData): Turn the
12653         assert into a negative result, the managed code already coped with
12654         that.
12655
12656         Some folks on Windows reported this error. 
12657
12658 2007-12-28  Gert Driesen  <drieseng@users.sourceforge.net>
12659
12660         * appdomain.c: Bump corlib version.
12661         * icall.c:
12662         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies): Use
12663         CultureInfo.CreateCulture to create CultureInfo for name.
12664         (fill_reflection_assembly_name): Use CultureInfo.CreateCulture to
12665         create CultureInfo for name. Fixes bug #347174.
12666
12667 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12668
12669         * verify.c: added IL_CODE_FLAG_STACK_INITED and IL_CODE_STACK_MERGED
12670         flags.
12671
12672         * verify.c (is_valid_branch_instruction): allow branching to the
12673         first instruction of the protected block.
12674
12675         * verify.c (is_valid_cmp_branch_instruction): same.
12676
12677         * verify.c (stack_init): use IL_CODE_FLAG_STACK_INITED flag to
12678         avoid double initialization.
12679
12680         * verify.c (merge_stacks): use IL_CODE_STACK_MERGED to
12681         detect which cases the eval stack should just be copied.
12682
12683         * verify.c (mono_method_verify): check if the eval stack
12684         is empty when entering a protected block.
12685
12686 2007-12-27  Rodrigo Kumpera  <rkumpera@novell.com>
12687
12688         * verify.c: added is_clause_in_range, is_clause_inside_range,
12689         is_clause_nested and verify_clause_relationship. They perform
12690         the verifications stated in P1 12.4.2.7.
12691
12692         * verify.c (mono_method_verify): remove some unused variables,
12693         add the new exception clause checks, add instruction border
12694         checks for protected block start/end, improved some error 
12695         messages and fixed a bug in the way invalid instruction access
12696         is detected.
12697
12698 2007-12-26  Zoltan Varga  <vargaz@gmail.com>
12699
12700         * boehm-gc.c (mono_gc_register_thread): Use the new GC_register_my_thread () routine
12701         from GC 7.0 if available.
12702
12703         * object.c: Remove an unused define.
12704         
12705         * object.c (mono_class_compute_gc_descriptor): Fix a warning.
12706
12707         * boehm-gc.c (mono_gc_make_descr_for_array): Implement.
12708
12709         * null-gc.c (mono_gc_make_descr_for_array): Implement.
12710
12711         * object.c (mono_class_compute_gc_descriptor): Remove an #ifdef SGEN_GC.
12712
12713         * gc-internal.h: Change the signature of mono_gc_make_descr_for_string ()
12714         to take the same arguments as the other make_descr functions.
12715
12716         * boehm-gc.c null-gc.c: Add implementation for make_descr functions.
12717
12718         * objects.c: Get rid of the MAKE_DESCRIPTOR macros, call make_descr functions
12719         directly.
12720
12721         * boehm-gc.c (mono_gc_base_init): Moved the setting of GC_stackbottom here from
12722         mini.c.
12723
12724         * object.c (mono_class_compute_gc_descriptor): Move the GC_init_gcj_malloc () 
12725         call to boehm-gc.c.
12726
12727         * boehm-gc.c (mono_gc_register_root): Fix a warning.
12728
12729         * null-gc.c (mono_gc_register_root): Fix a warning.
12730
12731         * reflection.c (ALLOC_REFENTRY): Use mono_gc_alloc_fixed for boehm as well.
12732
12733         * boehm-gc.c (mono_gc_register_root): Moved definition here from gc_wrapper.h.
12734         (mono_gc_base_init): Call GC_init ().
12735
12736         * null-gc.c: Define mono_gc_register_root () as a no-op.
12737
12738         * domain.c appdomain.c: Call mono_gc_base_init () instead of MONO_GC_PRE_INIT ().
12739
12740 2007-12-24  Rodrigo Kumpera  <rkumpera@novell.com>
12741
12742         * verify.c: add prototype for merge_stacks at top
12743
12744         * verify.c (do_switch): added.
12745
12746         * verify.c (merge_stacks): on some cases the stack merging
12747         was not happening properly. Unequal stack sizes at merge
12748         points should be invalid.
12749
12750         * verify.c (mono_method_verify): added more debug info on stack state.
12751         verify switch properly.
12752
12753 2007-12-24  Zoltan Varga  <vargaz@gmail.com>
12754
12755         * method-builder.h: New file, moved the mono_mb_ declarations here from 
12756         marshal.h.
12757
12758         * boehm-gc.c marshal.c: Include method-builder.h.
12759
12760         * marshal.c: Use mono_mb_emit_branch_label () in a few places.
12761
12762         * marshal.c: Remove some code which is now in method-builder.c.
12763
12764 2007-12-23  Zoltan Varga  <vargaz@gmail.com>
12765
12766         * method-builder.c: New file, extraction of the method builder functionality 
12767         from marshal.c.
12768
12769         * marshal.c: Move the mb functions into method-builder.c.
12770
12771         * marshal.h marshal.c: Export some mono_mb_... functions.
12772
12773         * marshal.c: Use mono_mb_get_label () and mono_mb_patch_branch () in all places.
12774
12775         * loader.c (field_from_memberref): Remove the dynamic case, it is handled in
12776         the caller.
12777
12778         * class.c (mono_class_get_full): Check the token type in the dynamic case.
12779
12780         * loader.c (mono_field_from_token): Ditto.      
12781
12782         * loader.c (mono_get_method_from_token): Change the check so it checks memberref
12783         type as well.
12784         
12785         * loader.c (mono_get_method_from_token): Check the token type in the dynamic case.
12786         Fixes #342565.
12787
12788         * class-internals.h: Add new loader error type MONO_EXCEPTION_BAD_IMAGE plus
12789         a helper function for setting it.
12790
12791         * loader.c (mono_loader_error_prepare_exception): Handle MONO_EXCEPTION_BAD_IMAGE.
12792
12793         
12794         * assembly.c: Significally simplify code now that referenced assemblies are 
12795         loaded lazily. Get rid of the 'loading' hashtables. Hopefully fixes #347629.
12796
12797         * threads.h: Don't include  the internal threads-types.h header file. Fixes
12798         #349952.
12799
12800 2007-12-21  Rodrigo Kumpera  <rkumpera@novell.com>
12801
12802         * verify.c: added enum value IL_CODE_FLAG_WAS_TARGET, to represent
12803         instructions that were target of branches or are at protected block boundaries.
12804
12805         * verify.c (in_same_block): handle filter clauses.
12806
12807         * verify.c (is_valid_branch_instruction): added. checks the target of
12808         instructions br or brtrue/false.
12809
12810         * verify.c (is_valid_cmp_branch_instruction): added. checks the target of
12811         binary branch instructions such as beq and bge.
12812
12813         * verify.c (init_stack_with_value): renamed to init_stack_with_value_at_exception_boundary
12814         and made it pin the instruction as been part of the exception block.
12815
12816         * verify.c (do_boolean_branch_op): use is_valid_branch_instruction instead
12817         of in_same_block.
12818
12819         * verify.c (do_branch_op): use is_valid_cmp_branch_instruction instead
12820         of in_same_block.
12821
12822         * verify.c (do_ret): ret from a protected block is unverifiable and
12823         not invalid.
12824
12825         * verify.c (do_static_branch): verify br and br.s instructions.
12826
12827         * verify.c (merge_stacks): add extra param to support detection
12828         of branches in the middle of instructions.
12829         
12830         * verify.c (mono_method_verify): verify branches and exception blocks
12831         that target the middle of instructions. Proper verification of br and br.s.
12832
12833 2007-12-21  Zoltan Varga  <vargaz@gmail.com>
12834
12835         * reflection.c (reflection_methodbuilder_from_ctor_builder): Initialize
12836         skip_visibility field.
12837         (reflection_methodbuilder_from_dynamic_method): Ditto.
12838
12839         * object.c (mono_class_compute_gc_descriptor): Remove more unused icall
12840         registrations. Fixes #348193.
12841
12842         * threads.h: Move the internal mono_thread_get_pending_exception () to
12843         threads-types.h and rename it to mono_thread_get_undeniable_exception ().
12844
12845 2007-12-20  Zoltan Varga  <vargaz@gmail.com>
12846
12847         * object.c (mono_class_compute_gc_descriptor): Remove unused GC_gcj_fast_malloc
12848         icall registration. Fixes #348193.
12849
12850         * marshal.c (mono_marshal_get_runtime_invoke): Put all runtime invoke wrappers
12851         for corlib classes into object. Fixes #349621.
12852
12853 2007-12-20  Gert Driesen  <drieseng@users.sourceforge.net>
12854
12855         * icall.c (property_accessor_nonpublic): new function to determine
12856         whether an accessor allows a property to be considered non-public.
12857         Returns false for private accessor(s) from parent class, and internal
12858         accessor(s) from parent on 2.0 profile (and higher).
12859         (ves_icall_Type_GetPropertiesByName): Use newly introduced function
12860         to determine whether property should be included if NonPublic flag
12861         is set. Fixes bug #349078.
12862
12863 2007-12-20  Rodrigo Kumpera  <rkumpera@novell.com>
12864
12865         * verify.c (init_stack_with_value): added.
12866
12867         * verify.c (mono_method_verify): extracted common
12868         code for exception initialization into init_stack_with_value.
12869
12870         * verify.c (mono_method_verify): initialize the exception
12871         for handler clauses as well.
12872
12873         * verify.c (mono_method_verify): fix the exception clause
12874         ordering rules, it should use handler end offset and not
12875         start offset.
12876
12877 Thu Dec 20 12:27:24 CET 2007 Paolo Molaro <lupus@ximian.com>
12878
12879         * rawbuffer.c: remove useless warning.
12880
12881 Thu Dec 20 12:10:38 CET 2007 Paolo Molaro <lupus@ximian.com>
12882
12883         * threads.h, threads-types.h: move functions to the correct header
12884         (fixes bug#349952).
12885
12886 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12887
12888         * verify.c (mono_method_verify): proper verification
12889         of exception handling clauses ranges and fallthru in
12890         and out of protected blocks.
12891
12892 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12893
12894         * verify.c (mono_method_verify): fixed compilation issue.
12895
12896 2007-12-19  Rodrigo Kumpera  <rkumpera@novell.com>
12897
12898         * verify.c (mono_method_verify): a printf slipped in, changed
12899         to use verifier debug macro.
12900
12901 2007-12-18  Rodrigo Kumpera  <rkumpera@novell.com>
12902
12903         * verify.c (is_correct_leave): check for filter clauses.
12904
12905         * verify.c (do_filter): added.
12906
12907         * verify.c (mono_method_verify): property verification of leave.
12908
12909
12910 2007-12-18  Mark Probst  <mark.probst@gmail.com>
12911
12912         * threads.c: Disable calls to _wapi_thread_signal_self() to fix
12913         Win32 build, until we figure out how to do the proper thing on
12914         Win32.
12915
12916 2007-12-17  Zoltan Varga  <vargaz@gmail.com>
12917
12918         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Fix a crash introduced
12919         by the previous patch.
12920         
12921         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Avoid calling
12922         the assembly resolve handler for refonly assemblies.
12923
12924 2007-12-17  Mark Probst  <mark.probst@gmail.com>
12925
12926         * threads.c, thread-types.h, icall.c: New shutdown safeguards.
12927         Make sure only one thread is allowed to commence shutdown, and
12928         don't allow new threads to be started once shutdown is in
12929         progress.
12930
12931 2007-12-14  Rodrigo Kumpera  <rkumpera@novell.com>
12932
12933         * verify.c (is_correct_endfilter): added.
12934
12935         * verify.c (is_unverifiable_endfilter): added.
12936
12937         * verify.c (do_endfilter): added.
12938
12939         * verify.c (mono_method_verify): property verification of endfilter
12940         and fixed a corner case or endfinally.
12941
12942 2007-12-13  Rodrigo Kumpera  <rkumpera@novell.com>
12943
12944         * verify.h: new flags to support fail fast of unverifiable code and
12945         do non-strict verification. Non-strict verification is required to
12946         have MS runtime compatibility. There are a huge amount of unverifiable
12947         code that it accepts as verifiable. The strict mode verifies the code
12948         as the specs says.
12949         Non-strict mode will be required in cases where code needs to be
12950         accepted as verifiable but fails under strict mode.
12951
12952         * pedump.c: added support to fail fast and non-strict verification.
12953
12954         * verify.c: added support for both fail fast and non-strict verification.
12955
12956 2007-12-12  Rodrigo Kumpera  <rkumpera@novell.com>
12957
12958         * verify.c (is_correct_endfinally): added.
12959
12960         * verify.c (mono_method_verify): property verification of endfinally.
12961
12962 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
12963
12964         * verify.c (in_any_block): check for filter clauses.
12965
12966         * verify.c (is_correct_rethrow): added.
12967
12968         * verify.c (mono_method_verify): property verification of rethrow.
12969
12970         * metadata.h: added MONO_OFFSET_IN_FILTER macro.
12971
12972 2007-12-11  Rodrigo Kumpera  <rkumpera@novell.com>
12973
12974         * verify.c (do_throw): added.
12975
12976         * verify.c (mono_method_verify): property verification of throw
12977
12978 2007-12-11  Zoltan Varga  <vargaz@gmail.com>
12979
12980         * assembly.c (mono_assembly_load_reference): Try an assembly resolve for ref-only
12981         assemblies. Fixes #346425.
12982
12983 2007-12-10  Zoltan Varga  <vargaz@gmail.com>
12984
12985         * reflection.c (mono_reflection_get_token): Call mono_image_create_token () for
12986         FieldBuilders.
12987
12988         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Fix a warning.
12989
12990         * class.c (mono_lookup_dynamic_token_class): Add a 'valid token' argument to
12991         prevent asserts when this is called with a token which might not be valid.
12992
12993         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Call
12994         lookup_dynamic_token_class with valid_token == FALSE.
12995
12996         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.       
12997
12998         * icall.c (ves_icall_System_Reflection_Module_ResolveStringToken): Ditto.
12999
13000         * icall.c (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
13001         
13002 2007-12-10  Mark Probst  <mark.probst@gmail.com>
13003
13004         * gc.c: Don't delay threadpool thread finalization unless Mono is
13005         shutting down.
13006
13007 Mon Dec 10 11:06:23 CET 2007 Paolo Molaro <lupus@ximian.com>
13008
13009         * threads.c: turn an assert into a non-fatal warning.
13010
13011 2007-12-09  Robert Jordan  <robertj@gmx.net>
13012
13013         * icall.c (GetVirtualMethod): Add missing argument validation.
13014
13015 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13016
13017         * verify.c (do_cast): added.
13018
13019         * verify.c (mono_method_verify): property verification of castclass and isinst.
13020
13021
13022 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13023
13024         * verify.c (mono_type_from_opcode): added opcodes for stelem.X.
13025
13026         * verify.c (do_stelem): added.
13027
13028         * verify.c (mono_method_verify): property verification of stelem.X.
13029
13030 2007-12-07  Mark Probst  <mark.probst@gmail.com>
13031
13032         * class.c, class-internals.h: Introduce an environment variable
13033         (MONO_GENERIC_SHARING) through which the extent of generic code
13034         sharing can be controlled (share all classes, share only corlib
13035         classes, or share nothing).
13036
13037         * object.c: Only create runtime generic context for classes for
13038         which sharing is enabled.
13039
13040 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13041
13042         * verify.c (do_ldelem): refactor it to work with ldelem.any.
13043
13044         * verify.c (mono_method_verify): property verification of ldelem.any.
13045
13046 2007-12-06  Rodrigo Kumpera  <rkumpera@novell.com>
13047
13048         * verify.c (get_indirect_op_mono_type): renamed to mono_type_from_opcode,
13049         added ldelem.X opcodes.
13050
13051         * verify.c (do_ldelema): fixed possible invalid usage of MonoType.
13052
13053         * verify.c: proper verification of ldelem.X 
13054
13055 2007-12-06  Zoltan Varga  <vargaz@gmail.com>
13056
13057         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): Allow interface cctors to be called too.
13058
13059 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
13060
13061         * verify.c (mono_method_verify): null literal requires special handling,
13062         the value pushed on stack need to be flagged as so.
13063
13064         * verify.c (do_ldelema): Verify ldelema properly.
13065
13066 2007-12-05  Rodrigo Kumpera  <rkumpera@novell.com>
13067
13068         * verify.c: Verify ldlen properly.
13069
13070 2007-12-05  Zoltan Varga  <vargaz@gmail.com>
13071
13072         * icall.c (ves_icall_MonoField_GetValueInternal): Check that the field belongs
13073         to the target object's type. Fixes #346160.
13074
13075 2007-12-05  Dick Porter  <dick@ximian.com>
13076
13077         * threadpool.c (socket_io_add_poll): Asynchronous connect() on
13078         Solaris needs the same workaround as BSD-derived systems.  Fixes
13079         bug 323524, patch by Burkhard Linke
13080         <burkhard.linke@CeBiTec.Uni-Bielefeld.DE>
13081
13082 2007-12-04  Gert Driesen  <drieseng@users.sourceforge.net>
13083
13084         * process.c: When ProcessStartInfo.ErrorDialog is true, pass window
13085         handle to use when error dialog is shown; otherwise, update mask
13086         to show no error dialog when an error occurs.
13087
13088 2007-12-03  Zoltan Varga  <vargaz@gmail.com>
13089
13090         * icall.c (ves_icall_MonoField_GetRawConstantValue): New icall.
13091
13092         * class.c (mono_class_get_field_default_value): New helper function to initialize
13093         field->def_type and field->data.
13094
13095 2007-11-30  Zoltan Varga  <vargaz@gmail.com>
13096
13097         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Use the delegate trampoline instead of
13098         the general one.
13099
13100         * object.c (mono_runtime_create_delegate_trampoline): New helper function.
13101
13102         * marshal.c: Avoid depending on delegate->method_info being set.
13103
13104         * object.c (mono_delegate_ctor): Avoid initializing delegate->method_info.
13105         
13106         * object.c (mono_delegate_ctor): Set delegate->method.
13107
13108         * object-internals.h (struct _MonoDelegate): Add 'method' field.
13109
13110         * appdomain.c: Bump corlib version.
13111
13112 2007-11-27  Raja R Harinath  <harinath@gmail.com>
13113
13114         * metadata.c (mono_generic_inst_equal_full): Short-circuit
13115         equality check if we're comparing canonicalized MonoGenericInsts.
13116
13117 2007-11-23  Zoltan Varga  <vargaz@gmail.com>
13118
13119         * class.c (generic_array_methods): Call mono_class_setup_methods () before
13120         accessing class->methods.
13121
13122 2007-11-22  Dick Porter  <dick@ximian.com>
13123
13124         * threads.c: Ensure that the synch_cs is set before trying to use
13125         it.
13126
13127 Thu Nov 22 12:34:04 CET 2007 Paolo Molaro <lupus@ximian.com>
13128
13129         * profiler.c: r89126 broke the statistial profiler, unbreak.
13130
13131 2007-11-22  Martin Baulig  <martin@ximian.com>
13132
13133         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 66.
13134
13135         * mono-debug.c
13136         (mono_debug_debugger_version): Bump to 3.
13137         (mono_debug_init): Hook `mono_debugger_class_loaded_methods_func'
13138         -> mono_debugger_class_initialized().
13139
13140         * mono-debug-debugger.c
13141         (mono_debugger_add_type): Renamed into mono_debugger_class_initialized().
13142
13143         * class.c
13144         (mono_debugger_start_class_init_func): Removed.
13145         (mono_debugger_class_loaded_methods_func): Added.
13146         (mono_class_setup_methods): Call it here.
13147
13148 2007-11-22  Martin Baulig  <martin@ximian.com>
13149
13150         * mono-debug.c
13151         (mono_debug_add_delegate_trampoline): New public method.
13152         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_DELEGATE_TRAMPOLINE'.
13153
13154         * mono-debug.h
13155         (MonoSymbolTable): Added `global_data_table'.
13156         (MonoDebuggerTypeKind): Removed.
13157
13158 2007-11-21  Zoltan Varga  <vargaz@gmail.com>
13159
13160         * marshal.c (mono_marshal_get_generic_array_helper): Skip visibility checks for
13161         these methods.
13162
13163         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
13164         
13165 Tue Nov 20 23:10:41 CET 2007 Paolo Molaro <lupus@ximian.com>
13166
13167         * object.c: some fields don't have a valid rva: ignore them (bug #343083).
13168
13169 2007-11-20  Martin Baulig  <martin@ximian.com>
13170
13171         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 65.
13172
13173         * mono-debug-debugger.c
13174         (mono_debugger_insert_method_breakpoint): Moved here from debug-mini.c
13175         (mono_debugger_remove_breakpoint): Likewise.
13176         (mono_debugger_check_breakpoints): Likewise.
13177         (mono_debugger_register_class_init_callback): New public method.
13178         (mono_debugger_remove_class_init_callback): Likewise.
13179         (mono_debugger_add_type): Likewise.
13180
13181         * mono-debug-debugger.h
13182         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_CLASS_INITIALIZED'.
13183
13184 Tue Nov 20 20:54:12 CET 2007 Paolo Molaro <lupus@ximian.com>
13185
13186         * class.c: more interface implementations needed for the
13187         array enumerator (fixes bug #341112).
13188
13189 2007-11-18  Gert Driesen  <drieseng@users.sourceforge.net>
13190
13191         * icall.c: Renamed arguments for ves_icall_System_Enum_ToObject to
13192         fix ParamName of ArgumentNullExceptions.
13193
13194 2007-11-17  Miguel de Icaza  <miguel@novell.com>
13195
13196         * reflection.c (mono_reflection_encode_sighelper): Generate the
13197         modopts and modreqs.   I have a useless test that crashes monodis,
13198         but that shows the code working.
13199
13200 2007-11-17  Zoltan Varga  <vargaz@gmail.com>
13201
13202         * boehm-gc.c (create_allocator): Fix size calculation for the string allocator.
13203         (mono_gc_get_managed_allocator): Enable the string allocator on amd64.
13204
13205 2007-11-15  Dick Porter  <dick@ximian.com>
13206
13207         * threads.c (ves_icall_System_Threading_Thread_Join_internal):
13208         When joining a thread, it's the thread that's calling Join that
13209         gets WaitSleepJoin state not the target.  Fixes the standalone
13210         test case in bug 334740, and hopefully the whole bug too.
13211
13212 2007-11-15  Dick Porter  <dick@ximian.com>
13213
13214         * process.c: Read file version info from the files pointed at by
13215         process modules, not the current process.  Fixes bug 315969.
13216
13217         Use windows typedef names in some places to fix warnings on the
13218         windows build.
13219
13220 2007-11-15  Mark Probst  <mark.probst@gmail.com>
13221
13222         * image.c, metadata-internals.h: Added a generic_class_cache hash
13223         to MonoImage for looking up generic classes when sharing generics.
13224
13225 Thu Nov 15 16:11:30 CET 2007 Paolo Molaro <lupus@ximian.com>
13226
13227         * sgen-gc.c: warning cleanups.
13228
13229 2007-11-15  Zoltan Varga  <vargaz@gmail.com>
13230
13231         * icall.c (ves_icall_Type_GetPropertiesByName): Implement proper hiding of
13232         inherited properties.
13233
13234 2007-11-14  Mark Probst  <mark.probst@gmail.com>
13235
13236         * object.c, class-internals.h: Added more information to the
13237         runtime generic context.
13238
13239 2007-11-13  Zoltan Varga  <vargaz@gmail.com>
13240
13241         * marshal.c (mono_marshal_get_delegate_invoke): Take a delegate as argument
13242         instead of just the target method. Generalize the abstract method handling to
13243         handle any non-static method.
13244
13245         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13246         mono_marshal_get_delegate_invoke () signature change.
13247
13248 2007-11-13  Mark Probst  <mark.probst@gmail.com>
13249
13250         * class.c, class-internals.h: Made
13251         mono_type_get_basic_type_from_generic () public.  Fixed member
13252         access check for shared generics.
13253
13254         * loader.c: Don't insert field into field cache if it's part of a
13255         non-inflated generic class.
13256
13257         * domain.c, domain-internals.h: The generic sharing context is now
13258         part of the jit info data structure.  Added two accessor
13259         functions.
13260
13261 2007-11-12  Zoltan Varga  <vargaz@gmail.com>
13262
13263         * marshal.c (mono_marshal_get_runtime_invoke): Create a non-shared wrapper for
13264         the array Get/Set/Address methods, since the JIT inlines them.
13265
13266         * metadata-internals.h (MonoImage): Add 'runtime_invoke_direct_cache'.
13267
13268         * image.c (mono_image_close): Free runtime_invoke_direct_cache.
13269         (mono_image_init): Initialize runtime_invoke_direct_cache.      
13270
13271         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): Update after
13272         mono_marshal_get_delegate_invoke signature change.
13273
13274         * marshal.c (mono_marshal_get_delegate_invoke): Receive the target_method as
13275         an additional argument. Add support for invoking abstract methods.
13276
13277         * metadata-internals.h (MonoImage): Add 'delegate_abstract_invoke_cache'.
13278
13279         * image.c (mono_image_close): Free delegate_abstract_invoke_cache.      
13280
13281 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13282
13283         * class.c: Do field layout for open generic classes as well.
13284
13285 2007-11-09  Mark Probst  <mark.probst@gmail.com>
13286
13287         * gc.c, gc-internal.h: Don't finalize threadpool threads with
13288         other objects, because the threadpool is still around.  Put them
13289         in a list instead and after finalizing all other objects in the
13290         root domain shut down the thread pool and then finalize the
13291         threads.  Fixes bug #337383.
13292
13293         * threads.c, thread-types.h: New mono_thread_create_internal()
13294         function for marking a thread with the threadpool flag before it
13295         started.  Set synch_cs to NULL after freeing it.
13296
13297         * threadpool.c: Mark threadpool threads before they start.
13298
13299 Thu Nov 8 15:31:21 CET 2007 Paolo Molaro <lupus@ximian.com>
13300
13301         * reflection.h, reflection.c: don't export random functions
13302         and lazy load dbnull and missing objects.
13303
13304 2007-11-07  Jonathan Chambers <joncham@gmail.com>
13305
13306         * class.c: Initialize COM types if COM interfaces
13307         are present (not just COM classes).
13308         
13309         Code is contributed under MIT/X11 license.
13310
13311 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13312         * reflection.c:
13313         create_dynamic_mono_image: hook module profiler events (dynamic case).
13314         mono_image_basic_init: hook assembly profiler events (dynamic case).
13315
13316 2007-11-07  Massimiliano Mantione  <massi@ximian.com>
13317         * profiler.c:
13318         simple_appdomain_unload: completely terminate the profiler
13319         instead of only processing the statistical samples.
13320         simple_shutdown: make sure this is really called exactly once,
13321         even in multithreaded applications, and always listen to
13322         appdomain events.
13323         * gc.c (mono_domain_finalize): don't call mono_profiler_appdomain_event
13324         here, the "[un]load" functions will do it.
13325         Fixes bugs #333791 and #325261.
13326
13327 2007-11-07  Geoff Norton  <gnorton@novell.com>
13328
13329         * socket-io.c:  Use the configure defines for HAVE_SOCKADDR_IN(6)_SIN_LEN
13330         rather than depend on __APPLE__.
13331
13332 2007-11-07  Mark Probst  <mark.probst@gmail.com>
13333
13334         * icall.c: Safety checks in InitializeArray.  Fixes bug #324535.
13335
13336 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com> 
13337
13338         * object.c: Fix mono_string_to_utf8 to handle NULL values inside the
13339         UTF16 MonoString. Fix the crash from bug #335488
13340
13341 2007-11-06  Sebastien Pouliot  <sebastien@ximian.com>
13342
13343         * marshal.c: Correct (for non-Win32 OS) length != size in 
13344         mono_string_from_bstr. Fix #339530.
13345
13346 2007-11-06  Geoff Norton  <gnorton@novell.com>
13347
13348         * socket-io.c: Apple requires sin(6)_len to be set for getnameinfo
13349         to succeed
13350
13351 2007-11-05  KornĂ©l Pál  <kornelpal@gmail.com>
13352
13353         * process.c: Added run-time GetProcessId API detection for Windows.
13354
13355 2007-11-04  Miguel de Icaza  <miguel@novell.com>
13356
13357         * reflection.c  (mono_param_get_objects): If a parameter has the
13358         attribute [System.Runtime.InteropServices.Optional] we should
13359         set the DefaultValue of the ParameterInfo to be
13360         System.Reflection.Missing instead of DBNull.
13361
13362         See bug #339013.
13363
13364         (mono_get_reflection_missing_object): New method,
13365         returns the System.Reflection.Missing.Value singleton instance.
13366
13367 2007-11-03  Atsushi Enomoto  <atsushi@ximian.com>
13368
13369         * culture-info-table.h : regenerated.
13370
13371 2007-11-02  Jonathan Chambers <joncham@gmail.com>
13372
13373         * icall.c: Use GetEnvironmentStrings on windows
13374         so we are using the same environment block as 
13375         GetEnvironmentVariable/SetEnvironmentVariable. Fixes
13376         #333740.
13377         
13378         Code is contributed under MIT/X11 license.
13379
13380 2007-10-31  Martin Baulig  <martin@ximian.com>
13381
13382         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 64.
13383
13384         * mono-debug-debugger.h
13385         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_TRAMPOLINE'.
13386
13387 2007-10-30  Zoltan Varga  <vargaz@gmail.com>
13388
13389         * reflection.c (mono_custom_attrs_from_class): Add support for dynamic inflated 
13390         classes.
13391
13392 2007-10-30  Atsushi Enomoto  <atsushi@ximian.com>
13393
13394         * culture-info-table.h : regenerated.
13395
13396 2007-10-30  Robert Jordan  <robertj@gmx.net>
13397
13398         * icall-def.h, icall.c:
13399         Add ves_icall_Remoting_RemotingServices_GetVirtualMethod ().
13400
13401         Code is contributed under MIT/X11 license.
13402
13403 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13404
13405         * class.c (mono_class_setup_vtable): Find the inflated methods in the
13406         inflated class instead of inflating them again.
13407         
13408         * class.c (mono_class_setup_vtable): Inflate the override methods in the 
13409         dynamic case.
13410
13411         * class.c (mono_generic_class_get_class): Set klass->property.count as well.
13412         Call setup_supertypes () after klass->parent is set.
13413         (mono_class_setup_properties): Enable this to work on dynamic generic classes.
13414
13415         * reflection.c (mono_type_get_object): Only return a MonoGenericClass object
13416         for inflated instances of not yet created dynamic generic classes.
13417         (ctorbuilder_to_mono_method): Handle the case when this is called multiple
13418         times from inflated_method.
13419         (methodbuilder_to_mono_method): Ditto.
13420
13421 Mon Oct 29 21:02:53 CET 2007 Paolo Molaro <lupus@ximian.com>
13422
13423         * gc.c: code cleanup and removed old untested option of not creating the
13424         finalizer thread.
13425
13426 2007-10-29  Zoltan Varga  <vargaz@gmail.com>
13427
13428         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
13429         creating a jump trampoline for dynamic methods.
13430
13431 2007-10-29 Rodrigo Kumpera <rkumpera@novell.com>
13432
13433         * reflection.c (mono_image_create_token): Correctly encode methods and constructors of
13434         generic TypeBuilders when called from another method of the same type (bug #335131).
13435
13436
13437 2007-10-27  Zoltan Varga  <vargaz@gmail.com>
13438
13439         * reflection.c (methodbuilder_to_mono_method): Revert the last change as it
13440         doesn't seem to work perfectly.
13441         
13442         * reflection.c (ctorbuilder_to_mono_method): Handle the case when this is
13443         called multiple times.
13444         (methodbuilder_to_mono_method): Ditto.
13445         (resolve_object): Inflate FieldBuilder's.
13446
13447 Fri Oct 26 19:38:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13448
13449         * string-icalls.c, string-icalls.h, appdomain.c: patch from
13450         Tyler Larson <mono-devel@tlarson.com> to fix the handling of
13451         RemoveEmptyEntries in the string.Split implementation (bug #322375).
13452
13453 2007-10-26  Dick Porter  <dick@ximian.com>
13454
13455         * appdomain.c (MONO_CORLIB_VERSION): Bump version because of
13456         Thread initialisation changes
13457
13458 2007-10-26 Rodrigo Kumpera <rkumpera@novell.com>
13459
13460         * verify.c: fix compatibility check between arrays and System.Array
13461
13462 2007-10-26  Zoltan Varga  <vargaz@gmail.com>
13463
13464         * reflection.c (mono_reflection_get_custom_attrs_info): Handle MonoGenericClass
13465         too. Fixes #336999.
13466
13467 2007-10-25  Zoltan Varga  <vargaz@gmail.com>
13468
13469         * object.c (mono_value_box): Use typed allocation here.
13470
13471 2007-10-23  Zoltan Varga  <vargaz@gmail.com>
13472
13473         * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Create a jump
13474         trampoline instead of compiling the method right away.
13475
13476         * class-internals.h object.c: Add a JIT callback to create a jump trampoline.
13477
13478 2007-10-21  Zoltan Varga  <vargaz@gmail.com>
13479
13480         * class.c (mono_generic_class_get_class): Avoid setting klass->size_inited and
13481         related fields for dynamic classes. Fixes #334493.
13482
13483 2007-10-20  Zoltan Varga  <vargaz@gmail.com>
13484
13485         * class.c (mono_generic_class_get_class): Set klass->field.count as well.
13486         
13487         * class.c (mono_class_layout_fields): Use 1 instead of TRUE for consistency.
13488
13489         * class.c (mono_class_layout_fields): Set size_inited for generic classes as well.
13490         (mono_class_setup_vtable): Obtain overrides for dynamic generic classes correctly.
13491
13492         * class.c (mono_class_setup_methods): Handle dynamic inflated classes correctly.
13493
13494         * reflection.c (create_generic_typespec): Initialize klass->generic_container
13495         if needed.
13496         (reflection_methodbuilder_to_mono_method): Set container->is_method to TRUE.
13497
13498 2007-10-18  Jonathan Chambers <joncham@gmail.com>
13499
13500         * marshal.c: Use correct key when removing item
13501         from ccw_hash.
13502         
13503         Code is contributed under MIT/X11 license.
13504
13505 2007-10-17  William Holmes  <billholmes54@gmail.com>
13506
13507         *marshal.c: Adding a case to marshal booleans to U1
13508
13509         Code is contributed under MIT/X11 license.
13510
13511 2007-10-18  Zoltan Varga  <vargaz@gmail.com>
13512
13513         * class.c (mono_class_from_name): Search the modules compromising dynamic
13514         assemblies. Fixes #331601.
13515
13516 2007-10-16  Zoltan Varga  <vargaz@gmail.com>
13517
13518         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Throw an
13519         exception if the type name contains an assembly component. Fixes #334203.
13520
13521         * reflection.c (mono_reflection_get_type_with_rootimage): Search all the
13522         modules inside dynamic assemblies. Fixes #334200.
13523         
13524         * reflection.c: Set image->public_key and image->public_key_length;
13525
13526         * metadata-internals.h (MonoDynamicImage): Add public_key and public_key_len
13527         fields.
13528
13529         * image.c (mono_image_get_public_key): Handle dynamic assemblies. Fixes #334173.        
13530         
13531 2007-10-16  Mark Probst  <mark.probst@gmail.com>
13532
13533         * metadata.c: Implemented correct comparing of generic classes.
13534         An inflated generic class can be equal to a non-inflated one if it
13535         is inflated with generic type variables as type arguments.  Fixes
13536         bug #333798.
13537
13538 2007-10-15  Dick Porter  <dick@ximian.com>
13539
13540         * monitor.c (mono_monitor_try_enter_internal): Set thread state to
13541         WaitSleepJoin while it is waiting to acquire a lock.  Fixes bug
13542         81646.
13543
13544         * threads.c: Turn the thread synch_lock into a CRITICAL_SECTION,
13545         instead of a monitor lock.  This means that monitor_try_enter and
13546         co can set the thread state safely.
13547         (ves_icall_System_Threading_Thread_Interrupt_internal): Always set
13548         thread_interrupt_requested, so interrupt actually works.
13549
13550         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal,
13551         ves_icall_System_Net_Sockets_Socket_Select_internal): Use thread
13552         state accessor function
13553
13554 2007-10-15  Martin Baulig  <martin@ximian.com>
13555
13556         * mono-debug.h
13557         (MONO_DEBUGGER_VERSION): Bump to 63 to make it impossible to use
13558         the debugger with the current runtime.
13559
13560 Mon Oct 15 10:20:56 CEST 2007 Paolo Molaro <lupus@ximian.com>
13561
13562         * object.c, object-internals.h: added the ability to set a single
13563         trampoline for all the slots in a vtable.
13564
13565 Fri Oct 12 17:50:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13566
13567         * marshal.c: deal with a possible race condition during multicast
13568         delegate invocation.
13569
13570 Fri Oct 12 13:31:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13571
13572         * class.c: ensure value type methods don't have the synchronized
13573         flag set.
13574
13575 Fri Oct 12 08:10:59 CEST 2007 Paolo Molaro <lupus@ximian.com>
13576
13577         * string-icalls.c, string-icalls.h: reverted unapproved patch that
13578         breaks the build.
13579
13580 2007-10-11  Joel Reed  <joelwreed@comcast.com>
13581
13582         * string-icalls.c, string-icalls.h: modify System_String_InternalSplit
13583         to take an options parameter so that empty entries can be removed during
13584         the split procedure. Patch from: Tyler Larson <mono-devel@tlarson.com>
13585
13586 Thu Oct 11 20:16:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13587
13588         * marshal.c: make sure we don't store the signature from a dynamic
13589         method into the runtime invoke cache (bug #327189).
13590
13591 Thu Oct 11 18:22:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13592
13593         * marshal.c: make sure the wrapper methods are properly initialized.
13594
13595 2007-10-11  Mark Probst  <mark.probst@gmail.com>
13596
13597         * metadata.c, metadata-internals.h: Generalized
13598         mono_type_stack_size() to mono_type_stack_size_internal() which
13599         takes an additional argument specifying whether it allows open
13600         types.
13601
13602 2007-10-10  Rodrigo Kumpera  <rkumpera@novell.com>
13603
13604         * verify.c (do_invoke_method): handle typedbyref params
13605         correctly and check for unverifiable return values.
13606
13607         * verify.c (do_newobj): fix a warning.
13608
13609 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13610
13611         * verify.c: don't tread typedbyref as allways unverifable,
13612         so uses, like (ld/st)loc.0 are valid. verify for the cases
13613         that it matters, like boxing related operations.
13614
13615 2007-10-09  Rodrigo Kumpera  <rkumpera@novell.com>
13616
13617         * verify.c: add verification of the newobj opcode. verification
13618         of delegate instantation still missing due ldftn and virldftn not
13619         pushing the function type on stack
13620
13621 2007-10-08  Mark Probst  <mark.probst@gmail.com>
13622
13623         * class-internals.h: Runtime generic context data structure
13624         definition.
13625
13626         * object.c: Initialization of runtime generic context at runtime
13627         vtable creation time.
13628
13629 2007-10-08  Massimiliano Mantione  <massi@ximian.com>
13630         * class.c (mono_class_create_from_typedef,
13631         mono_class_from_generic_parameter, mono_ptr_class_get,
13632         mono_fnptr_class_get, mono_bounded_array_class_get)
13633         * domain.c (mono_domain_create, mono_domain_free)
13634         * assembly.c (mono_assembly_load_from_full, mono_assembly_close)
13635         * image.c (do_mono_image_load, mono_image_close):
13636         Hooked up load-unload profiler events.
13637
13638 Mon Oct 8 11:38:04 CEST 2007 Paolo Molaro <lupus@ximian.com>
13639
13640         * domain.c: track statistics about the actual amount of native code
13641         allocated.
13642
13643 Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
13644
13645         * class.c: the valuetype enumerators don't have the additional
13646         supertypes interfaces.
13647
13648 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
13649
13650         * class.c: need more interfaces setup for the IEnumerator<T>
13651         object created for arrays (tests/ienumerator-interfaces.2.cs).
13652
13653 2007-10-05  Zoltan Varga  <vargaz@gmail.com>
13654
13655         * class.c (mono_ldtoken): Handle methodspec tokens as well. Fixes #331097.
13656
13657 2007-10-05  Alp Toker  <alp@atoker.com>
13658
13659         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
13660         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
13661         #315863.
13662
13663 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13664
13665         * verify.c (verify_type_compatibility_full): verification of
13666         compatibility improved, validates correctly non-strict checks between
13667         native int and I4 types different than (unsigned)int32.
13668
13669         * verify.c (do_store_indirect): added, do all verification of
13670         ldind.X opcodes. 
13671
13672         * verify.c (get_load_indirect_mono_type): renamed to
13673         get_indirect_op_mono_type, as it now returns the MonoType for 
13674         ldind.X and stind.X opcodes.
13675
13676 2007-10-04  Rodrigo Kumpera  <rkumpera@novell.com>
13677
13678         * reflection.c: Fix the encoding of generic type definition for
13679         TypeBuilders.
13680
13681         * reflection.c (mono_image_typedef_or_ref_full: do the same thing as
13682         mono_image_typedef_or_ref but allows to specify if typespec lookups should
13683         be made. Typespec check is done prior to typeref cache lookup.
13684
13685         * reflection.c (mono_image_typedef_or_ref): now just delegate to
13686         mono_image_typedef_or_ref_full.
13687
13688         * reflection.c (encode_generic_class): encode the generic class
13689         directly instead of calling encode_type.
13690
13691         * reflection.c (encode_type): encode the generic type definition
13692         MonoClass as a generic instantiation.
13693
13694         * reflection.c (create_typespec): cache typespec tokens in
13695         the assembly->typespec cache. Don't create typespec for a generic
13696         instance MonoClass. Create typespec for the generic type defintion.
13697
13698         * reflection.c (create_generic_typespec): encode the generic
13699         class directly instead of calling encode_type.
13700
13701         * reflection.c (mono_image_create_token): encode the generic
13702         type definition not using a typespec for MonoType instances.
13703
13704
13705 2007-10-04  Raja R Harinath  <rharinath@novell.com>
13706
13707         Fix #328812
13708         * class.c (mono_image_init_name_cache): Don't return nested
13709         'protected internal' classes.
13710         (mono_class_from_name_case): Likewise.
13711
13712 2007-10-04  Atsushi Enomoto  <atsushi@ximian.com>
13713
13714         * icall-def.h, icall.c : get_bundled_machine_config() is now the
13715           common function used by both DefaultConfig in System.dll and
13716           InternalConfigurationHost in System.Configuration.dll.
13717
13718 Wed Oct 3 17:26:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
13719
13720         * class.c: automatically add to vectors only a few essential explicit
13721         generic interfaces. The rest of the interfaces that arrays should
13722         provide are currently implicitly added (but still not lazily, see the
13723         design in the discussion of bug#325495 for the details of what is
13724         needed for that). Additionally, implicit interfaces are assigned the
13725         same vtable slot as the explicit interfaces (as they are compatible):
13726         this enables huge memory savings since we don't need to instantiate
13727         as many memthods and as large vtables anymore. Also, Since
13728         GetEnumerator<T> returns an instance of a type that is required to
13729         support a similarly large set of interfaces as arrays, we add
13730         implicit interfaces and interface offset sharing support to those
13731         types, too. This change adds all the required interfaces so that
13732         the anonarray.cs test case in the bug report works (we don't add
13733         all the interfaces to arrays of arrays 3-level deep and more because
13734         of the memory requirements explained in the bug and since they are much
13735         less common: the lazy-loading support will enabled them to work, too).
13736
13737 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13738
13739         * verify.c (merge_stacks): major clean up, all type compatibility
13740         checks are done by verify_type_compatibility. This fix my earlier lack
13741         of understanding of the CLR type system and merge_stacks no longer looks
13742         scary.
13743
13744         * verify.c: fixed some bad spelling.
13745
13746 2007-10-02  Rodrigo Kumpera  <rkumpera@novell.com>
13747
13748         * verify.c (mono_type_from_stack_slot): added. returns the MonoType for
13749         a given stack slock.
13750         
13751         * verify.c: killed verify_type_compat in favor of verify_type_compatibility and
13752         verify_type_compatibility_full. This removed a near indentical function and fixed
13753         handling of Int32 and IntPtr across all opcodes.
13754
13755 Tue Oct 2 15:24:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
13756
13757         * class.c: only vectors have the additional generic interfaces.
13758
13759 2007-10-01  Jonathan Chambers <joncham@gmail.com>
13760
13761         * mono-config.c: Use g_strcasecmp instead of
13762         strcasecmp like everywhere else to fix
13763         compilation with MSVC.
13764         
13765         Code is contributed under MIT/X11 license.
13766
13767 Mon Oct 1 14:39:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
13768
13769         * object.c, object-internals.h: refactored the IMT code to enable
13770         building a single slot at a time and lazily creating the IMT trampolines
13771         and thunks.
13772
13773 2007-09-29  Zoltan Varga  <vargaz@gmail.com>
13774
13775         * loader.c (inflate_generic_signature): Allocate inflated signatures from the heap.
13776
13777         * metadata.c (mono_metadata_free_inflated_signature): Free the signature itself too.
13778         Fixes #328501.
13779         
13780 2007-09-29  Raja R Harinath  <harinath@gmail.com>
13781
13782         * loader.c (method_from_methodspec): Rearrange to avoid
13783         un-necessary exposition.  Don't assert out if the method's
13784         declaring type is a generic type definition.
13785
13786 2007-09-28  Martin Baulig  <martin@ximian.com>
13787
13788         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 61.
13789
13790 Fri Sep 28 20:15:47 CEST 2007 Paolo Molaro <lupus@ximian.com>
13791
13792         * class-internals.h: optimize field layout of MonoClass to
13793         requires less cachelines at runtime and save a few bytes on 64 bit
13794         systems.
13795
13796 2007-09-28  Jb Evain  <jbevain@novell.com>
13797
13798         * reflection.c: when encoding type names in custom attributes,
13799         if the type is a closed generic type, its generic arguments
13800         have to be serialized as AssemblyQualifiedName, so that when
13801         they are deserialized, it's possible to re-create them properly.
13802         Fixes #329450.
13803
13804
13805 Fri Sep 28 19:19:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
13806
13807         * object.c, class-internals.h: added delegate-creation counter.
13808
13809 Fri Sep 28 18:07:53 CEST 2007 Paolo Molaro <lupus@ximian.com>
13810
13811         * class.c: cleanup of the code that synthetizes interfaces for
13812         arrays in 2.0: saves quit a bit of corlib mempool memory.
13813         Code to fix bug #325495 ifdeffed out for now until the issues
13814         with memory usage and O(n^2) behaviour are fixed.
13815
13816 Fri Sep 28 17:19:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
13817
13818         * marshal.c: when possible, do not duplicate the name of the methods
13819         in the method builder and in the generated MonoMethod.
13820
13821 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13822         * verify.c: added support for type checking ldind_* opcodes.
13823
13824 2007-09-27  Rodrigo Kumpera  <rkumpera@novell.com>
13825
13826         * class-internals.h (struct _MonoGenericClass): new field is_tb_open
13827         which is used to distinguish the fully open instantiation of a TypeBuilder
13828         with the rest. This temporary hack is required to restore the property that
13829         the fully open instantiation is the same type of the generic type definition.
13830
13831         * class-internals.h (mono_generic_class_is_generic_type_definition):
13832         new function as part of the internal API.
13833
13834         * class.c (inflate_generic_type): return NULL when the generic inst is
13835         fully open. The fully open generic type is now the same as the generic type
13836         definition for non TypeBuilder types.
13837
13838         * class.c (mono_generic_class_get_class): removed assert since it is
13839         no longer valid, gklass->cached_class can point to the generic type definition.
13840
13841         * class.c (mono_generic_class_is_generic_type_definition): new.
13842
13843         * metadata.c (mono_generic_class_hash): added is_tb_open field
13844         to the hash calculation.
13845
13846         * metadata.c (free_generic_class): if the generic class is associated
13847         with the generic type definition, its field will come from the mempool and
13848         must not be freed.
13849
13850         * metadata.c (mono_metadata_is_type_builder_generic_type_definition):
13851         new, this function identifies the corner case of a TypeBuilder fully open
13852         instantiation.
13853
13854         * metadata.c (mono_metadata_lookup_generic_class): use is_tb_open
13855         for lookup. Set gclass->cached_class to be the container class in case of
13856         the fully open instantiation of non TypeBuilder types.
13857
13858         * metadata.c (_mono_metadata_generic_class_equal): use is_tb_open
13859         to compare generic classes.
13860
13861         * reflection.c (method_encode_methodspec): remove assert that
13862         no longer is valid.
13863
13864         * reflection.c (mono_reflection_generic_class_initialize): add
13865         an aditional assert to ensure the proper type is used.
13866
13867 2007-09-26  Rodrigo Kumpera  <rkumpera@novell.com>
13868
13869         * verify.c: disabled all debug spew by default, define MONO_VERIFIER_DEBUG
13870         to enjoy it.
13871
13872 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13873
13874         * verify.c (push_arg): Fixed support for ldarga
13875         * verify.c (set_stack_value): Removed superfluous parameter, fixed the
13876         MonoType used as first arg in case of instance calls.
13877
13878 2007-09-25  Rodrigo Kumpera  <rkumpera@novell.com>
13879
13880         * verify.c: Support for verifying VAR and MVAR types, 
13881
13882 2007-09-25  Zoltan Varga  <vargaz@gmail.com>
13883
13884         * icall.c (ves_icall_get_property_info): Set the reflected type of the
13885         accessors correctly.
13886
13887 Tue Sep 25 14:56:03 CEST 2007 Paolo Molaro <lupus@ximian.com>
13888
13889         * threads.c: support OSX and other systems in
13890         mono_thread_get_stack_bounds (bug #328026).
13891
13892 2007-09-25  Martin Baulig  <martin@ximian.com>
13893
13894         * mono-debug.h
13895         (MonoDebugVarInfo): Replace `MonoClass *klass' with `MonoType *type'.
13896
13897 2007-09-24  Martin Baulig  <martin@ximian.com>
13898
13899         * mono-debug.h
13900         (MonoDebugClassEntry): Moved the definition of this struct into
13901         mono-debug.c to make it private.
13902
13903         * mono-debug.c
13904         (MonoDebugClassEntry): Removed `symfile_id'; since we now use one
13905         type table per symbol file, we don't need to store the symfile id
13906         any longer.
13907
13908 2007-09-24  Martin Baulig  <martin@ximian.com>
13909
13910         Create one type table per symbol file, since a `MonoClass *' gets
13911         invalid when its image is unloaded.
13912
13913         * mono-debug.h (MonoSymbolTable): Removed `type_table'.
13914         (MonoDebugHandle): Added `type_table'.
13915
13916 Mon Sep 24 17:25:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
13917
13918         * mempool.c, mempool.h: added mono_mempool_new_size () API
13919         to be able to specify a smaller initial size for the pool.
13920         Adjusted the code to slowly increase pool size before using
13921         the previous default size.
13922         * image.c: use a small initial size for image mempools.
13923
13924 2007-09-23  Zoltan Varga  <vargaz@gmail.com>
13925
13926         * marshal.c (emit_marshal_array): Generate valid IL for byref array case.
13927         Fixes ##320990.
13928
13929         * icall.c (ves_icall_System_Reflection_Assembly_get_ManifestModuleInternal): 
13930         Rename this to ves_icall_System_Reflection_Assembly_GetManifestModuleInternal.
13931
13932 2007-09-22  Zoltan Varga  <vargaz@gmail.com>
13933
13934         * metadata.c (mono_type_create_from_typespec): Remove an invalid
13935         free. Fixes #327438.
13936
13937 2007-09-21  Raja R Harinath  <harinath@gmail.com>
13938
13939         * metadata.c (type_in_image) <MONO_TYPE_SZARRAY>: Handle arrays of
13940         generic instantiations, etc.
13941         <MONO_TYPE_ARRAY>: Likewise.
13942
13943 2007-09-21  Martin Baulig  <martin@ximian.com>
13944
13945         * mono-debug.h (MonoSymbolFilePriv, MonoDebugHandlePriv): Removed;
13946         these structs were never defined.
13947         (MonoDebugHandle): Removed the `_priv' field, it was never used.
13948
13949 2007-09-21  Martin Baulig  <martin@ximian.com>
13950
13951         * mono-debug.h (MonoDebugVarInfo): Add `MonoClass *klass'.
13952
13953 Fri Sep 21 14:39:45 CEST 2007 Paolo Molaro <lupus@ximian.com>
13954
13955         * image.c: removed the guid hash tables: we can get the same info
13956         without the additional memory usage hit (partially fixes also bug #327052).
13957
13958 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
13959
13960         * profiler.h, profiler-private.h, profiler.c: add a new profiler
13961         event to handle unloading methods. After the event is called, the
13962         corresponding MonoMethod* must be considered invalid.
13963         * loader.c (mono_free_method): call the new mono_profiler_method_free
13964         event.
13965
13966 2007-09-20  Mark Probst  <mark.probst@gmail.com>
13967
13968         * domain-internals.h: New flag in MonoJitInfo which marks shared
13969         generic methods.  New hash table (shared_generics_hash) in
13970         MonoDomain to keep track of shared generic methods.  Prototypes
13971         for functions to register and lookup shared generic methods.
13972
13973         * domain.c: Support for registering and looking up shared generic
13974         methods via a hash table (shared_generics_hash) in MonoDomain.
13975
13976         * class-internals.h: New exception to signal failure of shared
13977         compilation of a generic method.  New counters for generics
13978         sharing in MonoStats.
13979
13980 Thu Sep 20 16:59:36 CEST 2007 Paolo Molaro <lupus@ximian.com>
13981
13982         * image.c, metadata-internals.h: don't keep a file descriptor open
13983         for loaded assemblies (bug#325988).
13984
13985 2007-09-19  Raja R Harinath  <rharinath@novell.com>
13986
13987         * metadata.c (signature_in_image): New.  Carve out of type_in_image.
13988         (ginst_in_image, gclass_in_image): Simplify.  Change signature to
13989         use the corresponding datatypes.
13990         (type_in_image): Update to changes.
13991         (CleanForImageUserData): Simplify.
13992         (steal_gclass_in_image): Carved out of old 'gclass_in_image'.
13993         Avoid quadratic behaviour in handling the "stolen" list by
13994         separating the filter predicate out, and by prepending the stolen
13995         items rather than appending them.
13996         (steal_ginst_in_image): Likewise.
13997         (mono_metadata_clean_for_image): Update to changes.
13998
13999 2007-09-19  Martin Baulig  <martin@ximian.com>
14000
14001         * domain.c (mono_cleanup): Call mono_debug_cleanup() here.
14002
14003 2007-09-19  Martin Baulig  <martin@ximian.com>
14004
14005         * mono-debug.c (mono_debug_cleanup): Don't call
14006         mono_debugger_cleanup(); this is now called earlier from mini_cleanup().
14007
14008 2007-09-19  Raja R Harinath  <harinath@gmail.com>
14009
14010         Fix crash on 'make run-test' in mcs/errors
14011         * metadata.c (type_in_image): New.  Carve out of ginst_in_image.
14012         Avoid more potential allocations in mono_class_from_mono_type.
14013         (ginst_in_image): Update to changes.
14014         (gclass_in_image): Rearrange slightly.
14015
14016 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
14017
14018         * class.c (mono_class_init): Move the code that sets up class->methods to 
14019         mono_class_setup_methods () for inflated generic classes too. Ditto for properties.
14020
14021         * metadata.c (mono_metadata_get_inflated_signature): New function to return a
14022         canonical instance of an inflated generic signature.
14023         (mono_type_create_from_typespec): Remove an invalid free.
14024
14025         * loader.c (mono_method_get_signature_full): Use mono_metadata_get_inflated_signature.  
14026
14027 2007-09-18  Marek Habersack  <mhabersack@novell.com>
14028
14029         * domain-internals.h: added a declaration of the
14030         mono_assembly_load_full_nosearch internal function.
14031
14032         * assembly.c (mono_assembly_load_with_partial_name): use
14033         mono_try_assembly_resolve return value properly.
14034         (mono_assembly_load_full_nosearch): copied the function body from
14035         mono_assembly_load_full, without the code to invoke assembly
14036         search hooks.
14037         (mono_assembly_load_full): calls the above new function and if the
14038         assembly is not resolved, invokes the search hooks.
14039
14040         * appdomain.c (mono_runtime_init): restore the global postload
14041         assembly search handlers.
14042
14043 2007-09-18  Zoltan Varga  <vargaz@gmail.com>
14044
14045         * class.c (mono_class_init): Make sure class->methods and class->properties
14046         are never NULL in the generics case.
14047
14048         * metadata.c (free_generic_class): Enable this again, skip the dynamic case.
14049
14050 2007-09-17  Zoltan Varga  <vargaz@gmail.com>
14051
14052         * metadata.c (free_generic_class): Disable some code to fix the build.
14053
14054         * domain.c (mono_cleanup): Fix a crash introduced by a previous patch.
14055
14056         * marshal.c (mono_marshal_get_xappdomain_dispatch): Allocate a piece of data
14057         from the image mempool.
14058
14059         * metadata.c (free_generic_class): Free more data from the inflated class.
14060
14061         * class.c (mono_class_from_generic_parameter): Allocate memory from the mempool.
14062
14063         * metadata.c (mono_metadata_parse_generic_param): Allocate memory from the image
14064         mempool.
14065         (mono_type_create_from_typespec): Ditto.
14066
14067         * domain.c (get_runtimes_from_exe): Add an out parameter to return the opened
14068         MonoImage to the caller.
14069         (mono_init_internal): Save the opened image in a global variable.
14070         (mono_cleanup): Close the image opened in get_runtimes_from_exe.
14071
14072         * reflection.c (resolve_object): Fix a leak.
14073
14074         * metadata.c: Fix the freeing of data in the generics caches.
14075         
14076         * metadata.c (free_generic_inst): Comment this out to fix the build.
14077         (free_generic_class): Ditto.
14078
14079         * metadata.c: Free cached generic methods, instantinations and classes when
14080         they are removed from the caches.
14081         (mono_metadata_free_type): Free the type itself.
14082
14083         * class.c: Free the result of mono_class_inflate_generic_type () in a few
14084         places.
14085
14086 Mon Sep 17 16:14:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14087
14088         * boehm-gc.c: restrict managed allocs to __thread supporting
14089         architectures.
14090
14091 2007-09-16  Zoltan Varga  <vargaz@gmail.com>
14092
14093         * class.c (mono_class_inflate_generic_type): Add a comment describing memory ownership.
14094         (mono_generic_class_get_class): Fix a leak.
14095
14096         * metadata.c (do_mono_metadata_parse_type): Remove an unneccesary call to
14097         mono_metadata_free_type ().
14098         (mono_metadata_inflate_generic_inst): Fix a leak.
14099
14100 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14101
14102         * mono-debug.c (free_header_data): Fix a leak missed earlier.
14103
14104         * metadata.c (mono_metadata_parse_array_full): Allocate memory from the image
14105         mempool.
14106
14107         * mono-debug.c (mono_debug_close_image): Fix call to 
14108         g_hash_table_remove ().
14109
14110 Fri Sep 14 19:36:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
14111
14112         * icall-def.h: redirect all the string ctor to the managed
14113         CreateString () methods.
14114         * string-icalls.c, string-icalls.h: removed dead code for string
14115         ctors and icalls.
14116
14117 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14118
14119         * mono-debug.c: Fix memory leaks.
14120
14121 2007-09-14  Jonathan Chambers <joncham@gmail.com>
14122
14123         * threads-types.h: Implement mono_hazard_pointer_set and 
14124         mono_hazard_pointer_clear macros using do/while(0) to fix
14125         compilation with MSVC.
14126         
14127         Code is contributed under MIT/X11 license.
14128
14129 2007-09-14  Zoltan Varga  <vargaz@gmail.com>
14130
14131         * gc.c (ves_icall_System_GCHandle_GetAddrOfPinnedObject): Use a return value of
14132         -2 to communicate to managed code that the handle is not pinned. Fixes #82848.
14133
14134 Fri Sep 14 14:04:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14135
14136         * icall-def.h, string-icalls.c: get rid of old, no longer used, string
14137         icalls.
14138
14139 Fri Sep 14 11:41:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14140
14141         * boehm-gc.c, gc-internal.h, object.c: allow strings to be
14142         managed-code allocated as well.
14143
14144 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
14145
14146         * class.c (mono_class_is_assignable_from): Add support for generic variance.
14147
14148 Thu Sep 13 11:55:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
14149
14150         * boehm-gc.c: fixed the build after the AOT changes.
14151
14152 2007-09-13  Zoltan Varga  <vargaz@gmail.com>
14153
14154         * wrapper-types.h: Add an ALLOC wrapper type.
14155
14156         * gc-internals.h boehm-gc.c null-gc.c sgen-gc.c: Add functions needed by AOT to
14157         reference managed allocator methods.
14158
14159 2007-09-12  Marek Safar  <marek.safar@gmail.com>
14160
14161         * icall.c (ves_icall_MonoType_GetGenericArguments): Create an instance
14162         of Type array and not MonoType, a fix suggested by Hari.
14163         
14164 2007-09-12  Jonathan Chambers <joncham@gmail.com>
14165
14166         * domain-internals.h, domain.c : Remove delegate_invoke_impl_with_target_hash
14167         and delegate_invoke_impl_no_target_hash from _MonoDomain struct.
14168         
14169         Code is contributed under MIT/X11 license.
14170
14171 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
14172
14173         * domain.c, object.c, mono-config.c, object-internals.h: Fixed  #82416.
14174
14175 2007-09-12  Marek Habersack  <mhabersack@novell.com>
14176
14177         * image.c (do_mono_image_open): if assembly file fails to open and
14178         MONO_IOMAP is in effect, try to find the path in a
14179         case-insensitive way.
14180
14181         * appdomain.c (mono_runtime_init): do not install postload hooks -
14182         tests show that MS.NET doesn't use anything of that sort to
14183         trigger the AppDomain.AssemblyResolve event.
14184         (mono_try_assembly_resolve): renamed from try_assembly_resolve and
14185         made non-static.
14186         (mono_runtime_init): init portability helpers here.
14187
14188         * assembly.c (mono_assembly_load_with_partial_name): if other   
14189         attempts fail, trigger the AppDomain.AssemblyResolve event handler
14190         to resolve the assembly.
14191
14192         * domain-internals.h: added mono_try_assembly_resolve and marked
14193         it as internal.
14194
14195 2007-09-11  Jb Evain  <jbevain@novell.com>
14196
14197         * object-internals.h (MonoReflectionDynamicMethod): add
14198         a `MonoReflectionType *owner` field. The owner is used
14199         * reflection.c:
14200         (mono_reflection_create_dynamic_method): use the owner of the dynamic
14201         method as the class declaring the dynamic method.
14202         (reflection_methodbuilder_from_dynamic_method): copy the owner of the
14203         dynamic method to the declaring type of the methodbuilder.
14204
14205 2007-09-11  Mark Probst  <mark.probst@gmail.com>
14206
14207         * icall.c (ves_icall_InternalInvoke): Enforce CoreCLR security
14208         rules for calling methods via reflection.
14209
14210 2007-09-11  Zoltan Varga  <vargaz@gmail.com>
14211
14212         * reflection.c (resolve_object): Add support for MonoGenericClass. 
14213         Inflate MonoType's.
14214
14215 Tue Sep 11 16:08:08 CEST 2007 Paolo Molaro <lupus@ximian.com>
14216
14217         * gc-internal.h, boehm-gc.c, null-gc.c, sgen-gc.c: allow the GC to
14218         provide a managed method that does fast allocations without needing
14219         a managed->unmanaged transition. Boehm GC implementation currently
14220         enabled for ptrfree objects on sane architectures.
14221
14222 Tue Sep 11 16:00:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
14223
14224         * marshal.c, marshal.h: exported a couple of useful functions and
14225         added mono_mb_get_label () to easily handle backward branches.
14226
14227 2007-09-10  Zoltan Varga  <vargaz@gmail.com>
14228
14229         * reflection.c (resolve_object): Inflate generic methods. Fixes #82782.
14230
14231 2007-09-10  Massimiliano Mantione  <massi@ximian.com>
14232
14233         * loader.c (find_method): Fixed the regression introduced while
14234         fixing bug #81466.
14235
14236 2007-09-09  Zoltan Varga  <vargaz@gmail.com>
14237
14238         * class.c (mono_lookup_dynamic_token_class): Pass along the context here as
14239         well.
14240         
14241         * class.c loader.c metadata.c object.c class-internals.h object-internals.h
14242         icall.c reflection.c: Pass a MonoGenericContext argument to 
14243         mono_lookup_dynamic_token ().
14244
14245         * reflection.c (resolve_object): Handle GenericTypeParameterBuilder. Fixes
14246         #82744.
14247         
14248 2007-09-09  Robert Jordan  <robertj@gmx.net>
14249
14250         * object.c (mono_class_proxy_vtable): Don't create remoting trampolines
14251         for generic methods.
14252
14253         * object.c (mono_object_get_virtual_method): Handle generic methods.
14254         Fixes bug #78882.
14255
14256         Code is contributed under MIT/X11 license.
14257
14258 Sat Sep 8 18:16:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
14259
14260         * image.c: fix locking in mono_image_load_file_for_image ().
14261
14262 Thu Sep 6 19:48:00 CEST 2007 Paolo Molaro <lupus@ximian.com>
14263
14264         * reflection.c, icall.c, icall-def.h: the methodinfos name field is
14265         used only as a cache: added an icall to fill it.
14266
14267 2007-09-16  Rodrigo Kumpera  <rkumpera@novell.com>
14268
14269         * reflection.h: exposed mono_reflection_free_type_info
14270         * reflection.c (mono_reflection_get_type_internal): type_args is always freed
14271         since mono_reflection_bind_generic_parameters makes a copy of it.
14272         * reflection.c (free_type_info): subinfos should be freed.
14273         * reflection.c (free_type_info): renamed to mono_reflection_free_type_info and 
14274         made non static.
14275         * icall.c (type_from_name and ves_icall_System_Reflection_Assembly_InternalGetType):
14276         replaced explicit cleanup of MonoTypeNameParse struct with a call to mono_reflection_free_type_info,
14277         this fixes #82695 and #81726.
14278    
14279
14280 2007-09-03  Atsushi Enomoto  <atsushi@ximian.com>
14281
14282         * process.h, process.c:  added support for user profile/info in
14283           ProcessStartInfo. For now only Windows works.
14284
14285 Fri Aug 31 17:30:58 CEST 2007 Paolo Molaro <lupus@ximian.com>
14286
14287         * metadata.c: consider the generic arguments when comparing
14288         signatures (bug #82614).
14289
14290 Thu Aug 30 18:34:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14291
14292         * cil-coff.h, image.c: updated assembly loader to cope with the
14293         PE32+ 64 bit file format.
14294
14295 Thu Aug 30 16:47:38 CEST 2007 Paolo Molaro <lupus@ximian.com>
14296
14297         * assembly.c, class.c, domain.c, loader.c: remove useless
14298         inclusion of cil-coff.h.
14299
14300 2007-08-29  Jonathan Chambers  <joncham@gmail.com>
14301
14302         * marshal.c (cominterop_get_ccw): Walk up interface hierarchy
14303         if interface is marked with CoClassAttribute. 
14304    
14305         Code is contributed under MIT/X11 license.
14306
14307 Wed Aug 29 19:27:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
14308
14309         * sgen-gc.c: ensure no object from the to space is copied again or finalized
14310         if it's seen twice in major collections.
14311
14312 Wed Aug 29 18:46:49 CEST 2007 Paolo Molaro <lupus@ximian.com>
14313
14314         * sgen-gc.c: big objects are not copied to the gray area, but they
14315         need to be considered for scanning, too, if they are brought alive
14316         by an object ready for finalizations or a survived one.
14317
14318 Wed Aug 29 18:43:11 CEST 2007 Paolo Molaro <lupus@ximian.com>
14319
14320         * sgen-gc.c: properly account the number of disappearing links when
14321         they are nullified.
14322
14323 Wed Aug 29 18:37:37 CEST 2007 Paolo Molaro <lupus@ximian.com>
14324
14325         * sgen-gc.c: share the code to scan the registered roots between the
14326         different types of collections.
14327
14328 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14329
14330         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunModuleConstructor): New icall.
14331
14332 2007-08-28  Zoltan Varga  <vargaz@gmail.com>
14333
14334         * object.c (mono_class_proxy_vtable): Use max_interface_id instead of
14335         class->max_interface_id in a one place. Fixes transparentproxy.exe test on ia64.
14336
14337 2007-08-28  Mark Probst  <mark.probst@gmail.com>
14338
14339         * security-manager.c (mono_security_manager_get_methods):
14340         LinkDemandSecurityException now has 2 arguments instead of 3.
14341
14342 2007-08-27  Zoltan Varga  <vargaz@gmail.com>
14343
14344         * class.c (mono_class_layout_fields): Only do the struct alignment hack on
14345         platforms which need it.
14346
14347 Mon Aug 27 18:29:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14348
14349         * sgen-gc.c: unregister thread data structures with a pthread_key_t
14350         dtor.
14351
14352 Mon Aug 27 18:27:35 CEST 2007 Paolo Molaro <lupus@ximian.com>
14353
14354         * threads.c: free the thread static data on thread exit.
14355
14356 Mon Aug 27 10:55:54 CEST 2007 Paolo Molaro <lupus@ximian.com>
14357
14358         * class.c: walk the hierarchy to find the generic definition for
14359         a class (fixes runtime part of bug #82498).
14360
14361 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14362
14363         * assembly.c (mono_assembly_close): Move the closing of the referenced assemblies to
14364         ...
14365
14366         * image.c (mono_image_close): Here. Hopefully fixes #82510.
14367
14368 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14369
14370         * monodiet.c (handle_cattrs): Fixed a custom attr leak.
14371
14372 2007-08-24  Robert Jordan  <robertj@gmx.net>
14373
14374         * appdomain.c: don't perform the ':'->';' substitution on Win32.
14375
14376 2007-08-24  Jb Evain  <jbevain@novell.com>
14377
14378         * class.c (mono_type_get_name_recurse): fix AssemblyQualifiedName
14379         for byref types.
14380
14381 2007-08-24  Mark Probst  <mark.probst@gmail.com>
14382
14383         * threads.c: Make sure a thread gets cleaned up only once.  Fixes
14384         #82286.
14385
14386 2007-08-24  Zoltan Varga  <vargaz@gmail.com>
14387
14388         * assembly.c: Fix a warning.
14389         
14390 2007-08-23  Marek Habersack  <mhabersack@novell.com>
14391
14392         * appdomain.c: parse the <runtime> section looking for the probing
14393         element with the 'privatePath' attribute, which sets additional
14394         directories in which the runtime should look for assemblies.
14395
14396 2007-08-23  Robert Jordan  <robertj@gmx.net>
14397
14398         * marshal.c (Marshal_ReAllocHGlobal) : Fix GlobalReAlloc's flags.
14399         Fixes #82499.
14400
14401 2007-08-23  Martin Baulig  <martin@ximian.com>
14402
14403         * mono-debug.[ch]: Rename mono_debug_init_corlib() into
14404         _mono_debug_init_corlib() and remove it from the header file.
14405
14406 2007-08-23  Martin Baulig  <martin@ximian.com>
14407
14408         * mono-debug-debugger.c
14409         (mono_debugger_unhandled_exception): Ignore `ThreadAbortException';
14410         don't notify the debugger about it.
14411
14412         * mono-debug-debugger.h
14413         (MonoDebuggerEvent): Removed `THREAD_ABORT'.
14414
14415 2007-08-23  Robert Jordan  <robertj@gmx.net>
14416
14417         * icall-def.h, process.*: implemented Get|SetPriorityClass icalls.
14418         Code is contributed under MIT/X11 license.
14419
14420 Wed Aug 22 18:35:12 CEST 2007 Paolo Molaro <lupus@ximian.com>
14421
14422         * sgen-gc.h, sgen-gc.c: abstracted most of the OS-specific code.
14423
14424 2007-08-22  Martin Baulig  <martin@ximian.com>
14425
14426         * mono-debug.c: Store debugging info on a per-domain basis and
14427         free it on domain unload.  Add support for unloading symbol files.
14428
14429         * mono-debug.h
14430         (MonoDebugList): New typedef.
14431         (MonoSymbolTable):
14432         - add `data_tables and `type_table'.
14433         - replace 'symbol_files' and `num_symbol_files' with a
14434           `MonoDebugList *'.
14435         (mono_debug_data_table): Removed.
14436         (mono_debug_list_add): New public function.
14437         (mono_debug_list_remove): New public function.
14438         (mono_debug_init_1): Renamed into mono_debug_init_corlib().
14439         (mono_debug_init_2_memory): Renamed into
14440         mono_debug_open_image_from_memory().
14441         (mono_debug_close_image): New public function.
14442         (mono_debug_domain_create): Likewise.
14443         (mono_debug_domain_unload): Likewise.
14444         (MONO_DEBUGGER_VERSION): Bump to 60.
14445
14446         * mono-debug-debugger.h
14447         (MonoDebuggerEvent):
14448         - remove `RELOAD_SYMTABS' and `METHOD_COMPILED'.
14449         - rename `ADD_MODULE' into `LOAD_MODULE'; add `UNLOAD_MODULE'.
14450         - add `DOMAIN_CREATE' and `DOMAIN_UNLOAD'.
14451         - rename `THREAD_CREATED' and `THREAD_EXITED' into
14452           `GC_THREAD_CREATED' and `GC_THREAD_EXITED'.
14453         - re-add `THREAD_CREATED' and `THREAD_EXITED'; with different
14454           meaning.
14455         (mono_debugger_add_symbol_file): Removed.
14456         (mono_debugger_add_type): Removed.
14457         (mono_debugger_lookup_type): Removed.
14458         (mono_debugger_lookup_assembly): Removed.
14459
14460         * domain.c
14461         (mono_domain_create): Call mono_debug_domain_create().
14462         (mono_init_internal): Call mono_debug_init_corlib().
14463
14464         * assembly.c
14465         (mono_assembly_close): Call mono_debug_close_image().
14466
14467 Wed Aug 22 17:26:02 CEST 2007 Paolo Molaro <lupus@ximian.com>
14468
14469         * sgen-gc.c: use the mono-mmap facilitites instead of hard-coding the
14470         mmap call.
14471
14472 Wed Aug 22 17:17:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
14473
14474         * sgen-gc.c: ensure section->pin_queue_end is initialized
14475         correctly when non pinning objects in the section have been found.
14476
14477 2007-08-22  Marek Habersack  <mhabersack@novell.com>
14478
14479         * appdomain.c (set_domain_search_path): cope with PrivateBinPath
14480         containing a list of directories separated by ':'. MSDN docs say
14481         the directories should be separated with ';'. Part of a bugfix for
14482         bug #81446
14483
14484 2007-08-21  Rodrigo Kumpera  <rkumpera@novell.com>
14485
14486         * class.c (mono_type_retrieve_from_typespec) : fixed the return type
14487         it should MonoType and not MonoClass.
14488
14489 2007-08-21  Atsushi Enomoto  <atsushi@ximian.com>
14490
14491         * culture-info-table.h : regenerated.
14492
14493 2007-08-20  William Holmes  <billholmes54@gmail.com>
14494
14495         *file-io.c: Added ves_icall_System_IO_MonoIO_ReplaceFile
14496          to call ReplaceFile Kernel32 on windows or in io-layer.
14497         *file-io.h: Added deceleration for ves_icall_System_IO_MonoIO_ReplaceFile
14498         *icall-def.h: Register ves_icall_System_IO_MonoIO_ReplaceFile
14499          as an internal call.
14500
14501         Code is contributed under MIT/X11 license.
14502
14503 2007-08-20  Jb Evain  <jbevain@novell.com>
14504
14505         * class-internals: add definitions for MONO_EXCEPTION_METHOD_ACCESS
14506         and MONO_EXCEPTION_FIELD_ACCESS.
14507
14508         * debug-helpers.[c|h]: new mono_field_full_name function.
14509
14510 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14511
14512         * class.c: Removed class_security_level() and moved it to
14513         security-core-clr.c.
14514
14515         * security-core-clr.c, security-core-clr.h: class_security_level()
14516         is now public and renamed to mono_security_core_clr_class_level().
14517         It also looks for security attributes in the classes a class is
14518         nested in.
14519
14520 2007-08-20  Mark Probst  <mark.probst@gmail.com>
14521
14522         * security-core-clr.c, security-core-clr.h: CoreCLR security
14523         utility functions.
14524
14525         * Makefile.am: Added security-core-clr.[ch].
14526
14527         * security-manager.c, security-manager.h: Functions and enum for
14528         setting and getting the security mode.
14529
14530         * class.c: CoreCLR security checks.
14531
14532 Mon Aug 20 12:38:42 CEST 2007 Paolo Molaro <lupus@ximian.com>
14533
14534         * icall-def.h, process.c, process.h: implemented icall to get
14535         user/system processor times.
14536
14537 2007-08-17  Mark Probst  <mark.probst@gmail.com>
14538
14539         * domain.c, threads.c, class-internals.h, domain-internals.h: New
14540         reader-lock-free jit_info_table.
14541
14542 2007-08-17  Zoltan Varga  <vargaz@gmail.com>
14543
14544         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_CUSTOM.
14545
14546         * marshal.c (mono_marshal_type_size): Ditto. Fixes #82465 and #82466.   
14547
14548         * object-internals.h (MonoException): Add missing _data member.
14549
14550 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14551
14552         * loader.c (find_method, find_method_in_class): Fixed bug #81466,
14553         checking that only methods with matching qname or fqname are picked
14554         from implemented interfaces.
14555
14556 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14557
14558         * verify.c (do_newarr):added, do type verification of
14559         newarr ops, push the right value on the eval stack.
14560         * verify.c (mono_method_verify): use do_newarr
14561
14562
14563 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14564
14565         * verify.c (do_ldobj_value, do_unbox_value and do_box_value):
14566         factored the common code into get_boxable_mono_type, which
14567         is now using mono_type_get_full, this fixed byref related tests.
14568
14569 2007-08-16  Rodrigo Kumpera  <rkumpera@novell.com>
14570
14571         * class.c: added mono_type_get_full, this function has the same
14572         behavior of mono_class_get_full but the returned MonoType has
14573         all metadata of the associated token in case of a typespec token.
14574         * class.c: added mono_type_retrieve_from_typespec, used by 
14575         mono_type_get_full to retrieve the token type.
14576         * class.c (mono_class_create_from_typespec): changed to use
14577         mono_type_retrieve_from_typespec.
14578         * class.c (mono_ldtoken): changed to use mono_type_get_full
14579         for MONO_TOKEN_TYPE_(DEF|REF|SPEC).
14580         * class-internals.h: exported mono_type_get_full for internal use.
14581
14582 2007-08-16  Jb Evain  <jbevain@novell.com>
14583
14584         * domain.c (supported_runtimes): add entry for
14585         the 'moonlight' runtime version.
14586
14587 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14588
14589         * verify.c (mono_method_verify): small typo sliped in.  
14590
14591 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14592
14593         * verify.c (do_unbox_value): added, do type verification of
14594         unboxing ops
14595         * verify.c (mono_method_verify): use do_unbox_value
14596
14597
14598 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14599
14600         * verify.c (dump_stack_value): fixed typo, was printing string
14601         instead of object on stack.
14602         * verify.c (do_box_value): moved the byref check up as it leads
14603         to invalid code and should be done earlier.
14604         * verify.c: improved error messages for and ldobj
14605
14606 2007-08-15  William Holmes  <billholmes54@gmail.com>
14607
14608         * marshal.c (emit_marshal_custom): Omit the call to 
14609           marshal_native_to_managed when calling native to managed 
14610           and the argument is specified as an out argument.
14611
14612         Code is contributed under MIT/X11 license.
14613
14614 2007-08-15  Rodrigo Kumpera  <rkumpera@novell.com>
14615
14616         * verify.c: fixed the type checks for generics, function pointers and vectors.
14617         Added type verification for ldobj and ldtoken. The verifier
14618         would segfault if header or signature of a method contained references
14619         to non-existant types.
14620
14621 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14622
14623         * marshal.c (cominterop_get_ccw): Patch from
14624         Bill Holmes to no walk up interface hierarchy. 
14625         All parent methods should be present in the interface for COM.
14626    
14627         Code is contributed under MIT/X11 license.
14628
14629 2007-08-15  Jonathan Chambers  <joncham@gmail.com>
14630
14631         * marshal.c (emit_marshal_com_interface): Patch from
14632         Bill Holmes to handle COM Interfaces as return values
14633         for native->managed calls.
14634    
14635         Code is contributed under MIT/X11 license.
14636
14637 2007-08-14  Jonathan Chambers  <joncham@gmail.com>
14638
14639         * marshal.c (cominterop_get_idispatch_for_object): Implement
14640         for runtime callable wrappers.
14641    
14642         Code is contributed under MIT/X11 license.
14643
14644 2007-08-13  Rodrigo Kumpera  <rkumpera@novell.com>
14645
14646         * pedump.c (main): changed from mono_init to mono_init_from_assembly
14647         so 2.0 types are accessible
14648
14649
14650 2007-08-13  Miguel de Icaza  <miguel@novell.com>
14651
14652         * domain.c (mono_init_internal): Call mono_assembly_load_friends
14653         once we load mscorlib.   Due to the order in which we initialize,
14654         the mono_assembly_load_full routine that loads mscorlib did not
14655         load friends.   We now load it once we load the
14656         mono_defaults.internals_visible_class class. 
14657
14658         * assembly.c: Expose the mono_load_friend_assemblies method.
14659
14660 2007-08-11  Rodrigo Kumpera  <rkumpera@novell.com>
14661
14662         * verify.c: improved the handling of boxing, better
14663         type checking for unary ops and conversion. Fix bug
14664         regarding managed pointer compatibility checking
14665
14666 2007-08-11  Zoltan Varga  <vargaz@gmail.com>
14667
14668         * icall.c (ves_icall_System_Array_SetGenericValueImpl): New icall.
14669
14670         * threads.c threads-types.h: Export mono_thread_get_stack_bounds.
14671
14672 2007-08-09  Raja R Harinath  <rharinath@novell.com>
14673
14674         * reflection.c (dup_type): Remove.
14675         * class.c (dup_type): Remove.
14676         (mono_metadata_signature_deep_dup): Use 'mono_metadata_type_dup'
14677         instead of the dodgy 'dup_type'.
14678         (inflate_generic_type): Likewise.  Fix the VAR/MVAR cases to
14679         handle the case where 'dup_type' needed the second argument.
14680
14681 2007-08-08  Zoltan Varga  <vargaz@gmail.com>
14682
14683         * domain.c: Fix a warning.
14684
14685 2007-08-08  Massimiliano Mantione  <massi@ximian.com>
14686
14687         * class.c (mono_class_setup_vtable_general): Fixed bug #77127,
14688         checking that methods with the same fqname are not overridden
14689         with a method from an ancestor.
14690
14691 2007-08-07  Zoltan Varga  <vargaz@gmail.com>
14692
14693         * threads.c (free_thread_static_data_helper): Avoid a crash if
14694         thread->static_data is not yet set.
14695
14696 2007-08-07  Jonathan Chambers  <joncham@gmail.com>
14697
14698         * marshal.c: Use correct image when emitting
14699         native wrapper for COM calls.
14700    
14701         Code is contributed under MIT/X11 license.
14702
14703 2007-08-07  Atsushi Enomoto  <atsushi@ximian.com>
14704
14705         * icall-def.h, security.c, security.h :
14706           added icall wrapper to ProtectedMemory.[Unprotect|Protect]Data().
14707
14708 2007-08-07  Martin Baulig  <martin@ximian.com>
14709
14710         * mono-debug-debugger.h
14711         (MonoDebuggerEvent): Add `MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD'.
14712
14713         * domain.c (mono_domain_free): Call
14714         `mono_debugger_event (MONO_DEBUGGER_EVENT_DOMAIN_UNLOAD)'.
14715
14716 2007-08-06  Rodrigo Kumpera  <rkumpera@novell.com>
14717
14718         * verify.c (check_underflow, check_overflow): error message now returns IL offset
14719         * verify.c (in_same_block): code should test if either offset is inside the clauses
14720         * verify.c (mono_method_verify): push the exception into the eval stack of exception
14721         and filter blocks
14722
14723 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14724
14725         * image.c (mono_image_close): Fix a leak.
14726
14727         * object.c (mono_runtime_invoke_array): Avoid using alloca.
14728
14729         * icall.c (ves_icall_FieldInfo_SetValueInternal): Ditto.        
14730
14731 Fri Aug 3 19:54:23 CEST 2007 Paolo Molaro <lupus@ximian.com>
14732
14733         * domain.c, threads.c, threads-types.h: fix memory retention issue
14734         with thread static variables not being cleared on domain unload.
14735         Reuse thread static slots after domain unload.
14736
14737 2007-08-03  Zoltan Varga  <vargaz@gmail.com>
14738
14739         * object.c (mono_runtime_invoke_array): Handle the case when the receiver is a
14740         nullable type.
14741
14742         * marshal.c (mono_marshal_get_runtime_invoke): Revert the previous change, it is
14743         now done in mono_runtime_invoke_array.
14744
14745         * marshal.c (mono_marshal_get_runtime_invoke): Handle the case when the 
14746         receiver is a nullable type.
14747
14748         * class.c (mono_class_is_assignable_from): Handle the case when klass is a 
14749         generic parameter.
14750
14751 2007-08-03  Jonathan Chambers  <joncham@gmail.com>
14752
14753         * marshal.c: Implement COM Objects as return type for 
14754         managed->unmanaged calls. Added Release calls for COM Object
14755         out/return values in managed->unmanaged calls.
14756
14757         Code is contributed under MIT/X11 license.
14758
14759 Fri Aug 3 17:00:51 CEST 2007 Paolo Molaro <lupus@ximian.com>
14760
14761         * threads.h, threads-type.h: move the hazard pointer declarations
14762         to the private header.
14763
14764 Fri Aug 3 13:13:39 CEST 2007 Paolo Molaro <lupus@ximian.com>
14765
14766         * file-io.c, appdomain.c: memory leak fixes.
14767
14768 2007-08-02  Dick Porter  <dick@ximian.com>
14769
14770         * socket-io.c
14771         (ves_icall_System_Net_Sockets_Socket_Socket_internal): Move the
14772         SO_REUSEADDR setting into io-layer/sockets.c.
14773
14774 2007-08-01  Zoltan Varga  <vargaz@gmail.com>
14775
14776         * icall.c (ves_icall_Type_GetMethodsByName): Return the members inherited
14777         from Object when called on a generic parameter. Fixes #82211.
14778
14779 2007-08-01  Dick Porter  <dick@ximian.com>
14780
14781         * file-io.c (convert_share): Test FileShare values bit-by-bit.
14782         Fixes bug 79250 yet again.
14783
14784 2007-07-30  Martin Baulig  <martin@ximian.com>
14785
14786         Merged the `debugger-dublin' branch.
14787
14788         * mono-debug.h
14789         (MonoDebugDataTable): New typedef.
14790         (MonoDebugMethodAddressList): New typedef.
14791         (MonoDebugWrapperData): Removed.
14792         (MonoDebugSymbolTable): Removed `current_data_table',
14793         `current_data_table_size', `current_data_table_offset'.
14794         (MonoDebugDataItemType): Moved into mono-debug.c.
14795         (MonoDebugMethodJitInfo): Remove `address'.
14796         (mono_debug_data_table): New global variable.
14797         (mono_debug_lookup_method_addresses): New public function.
14798         (mono_debug_find_method): Take a `MonoMethod *', not a
14799         `MonoDebugMethodInfo *'.
14800
14801         * mono-debug.c: Drop support for the old symbol tables.
14802
14803 2007-06-28  Martin Baulig  <martin@ximian.com>
14804
14805         * mono-debug.c (mono_debug_debugger_version): New public variable.
14806
14807 2007-07-31  William Holmes  <billholmes54@gmail.com>
14808
14809         * metadata.c Changed mono_type_create_from_typespec to not insert
14810           the type into the hash map until after
14811           do_mono_metadata_parse_type has completed.
14812         Fixes Bug #82194
14813         Code is contributed under MIT/X11 license.
14814
14815 2007-07-31  Zoltan Varga  <vargaz@gmail.com>
14816
14817         * icall.c (ves_icall_Type_GetMethodsByName): Avoid a crash when called on a
14818         generic parameter. Fixes #82211.
14819
14820 2007-07-27  Jb Evain  <jbevain@novell.com>
14821
14822         * pedump.c (dump_metadata, dump_metadata_header): dump
14823         versions contained in the metadata header.
14824
14825 Fri Jul 27 17:07:40 CEST 2007 Paolo Molaro <lupus@ximian.com>
14826
14827         * threads.c: register small_id_table with the GC.
14828
14829 2007-07-27  Mark Probst  <mark.probst@gmail.com>
14830
14831         * threads.c, threads.h, class-internals.h, object-internals.h:
14832         Hazard pointers, to be used by lock-free parallel algorithms.
14833
14834 2007-07-26  Dick Porter  <dick@ximian.com>
14835
14836         * appdomain.c (mono_runtime_cleanup): Invoke io-layer cleanup
14837         routine on non-windows platforms, as I've not managed to think of
14838         a non-kludgy way of doing this.  Finishes off bug 78739.
14839
14840 Wed Jul 25 18:06:33 CEST 2007 Paolo Molaro <lupus@ximian.com>
14841
14842         * object.c: properly setup interface_bitmap in proxy vtables.
14843
14844 2007-07-25  Marek Habersack  <mhabersack@novell.com>
14845
14846         * appdomain.c (get_shadow_assembly_location): do not use TickCount
14847         to create unique shadow copy target directories, use the domain's
14848         serial number instead. Each domain gets a unique target directory
14849         that way.
14850
14851         * domain.c (mono_domain_create): added code to increment domain
14852         shadow copy serial number and cache the value in the current
14853         domain structure.
14854
14855         * domain-internals.h (struct _MonoDomain): added a new field -
14856         shadow_serial to hold the serial number used in generation of
14857         shadow-copy directories. This is to make sure that the directory
14858         name is unique for each and every domain created. We avoid a race
14859         condition with overriding assemblies already in use by other app
14860         domains.
14861
14862 2007-07-24  Rodrigo Kumpera  <rkumpera@novell.com>
14863
14864         * class.c (mono_bounded_array_class_get): fixed memory leak when 
14865         binding generic parameters.
14866
14867 2007-07-24  Raja R Harinath  <rharinath@novell.com>
14868
14869         * metadata.c (do_mono_metadata_parse_generic_class): Use
14870         mono_metadata_lookup_generic_class.  Don't g_assert on a metadata
14871         error.
14872
14873 Tue Jul 24 15:15:19 CEST 2007 Paolo Molaro <lupus@ximian.com>
14874
14875         * loader.c, class-internals.h, reflection.c: removed the per-method
14876         generics hashtable: we use the global one through the call of
14877         mono_class_inflate_generic_method ().
14878
14879 Mon Jul 23 19:43:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
14880
14881         * class.c, metadata.c, class-internals.h: introduce yet another
14882         generics global cache for inflated methods (fixes 98% of the perf
14883         issue in bug #81806).
14884
14885 2007-07-23  Raja R Harinath  <rharinath@novell.com>
14886
14887         Fix #81035 -- avoid allocating MonoGenericInsts willy-nilly
14888         * metadata.c (mono_metadata_lookup_generic_inst): Kill.
14889         (mono_metadata_get_generic_inst): New.  Given a list of MonoType*,
14890         return a MonoGenericInst containing (a copy) of those types.
14891         (mono_metadata_inflate_generic_inst): Update to changes.
14892         (mono_metadata_parse_generic_inst): Likewise.
14893         (mono_get_shared_generic_inst): Likewise.
14894         * reflection.c (mono_class_bind_generic_parameters): Likewise.
14895         (mono_reflection_bind_generic_method_parameters): Likewise.
14896         * metadata-internals.h: Likewise.
14897         * icall.c (free_generic_context): Kill.
14898         (init_generic_context_from_args): Use mono_metadata_get_generic_inst.
14899
14900         * reflection.c (reflection_methodbuilder_to_mono_method): Use
14901         mono_metadata_type_dup.
14902         * marshal.c (mono_mb_create_method): Likewise.
14903
14904         * metadata.c (mono_metadata_type_dup): Rename from
14905         mono_metadata_type_dup_mp.  Take an optional mempool instead of a
14906         MonoImage.  Handle a few more cases, esp. when no mempool is given.
14907         * marshal.c, metadata-internals.h: Update to changes.
14908
14909 Mon Jul 23 11:43:31 CEST 2007 Paolo Molaro <lupus@ximian.com>
14910
14911         * class.c: fixed a small leak for array classes and removed warning.
14912
14913 2007-07-22  Zoltan Varga  <vargaz@gmail.com>
14914
14915         * loader.c (mono_method_get_param_token): Make this work on generic methods.
14916         Return 0x8000000 for return parameters. Fixes #82161.
14917
14918 2007-07-21  Marek Habersack  <grendello@gmail.com>
14919
14920         * appdomain.c (get_shadow_assembly_location): append the current
14921         ticks value to the path. Avoids overwriting the same assemblies by
14922         several threads at the same time.
14923
14924 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14925         and Raja R Harinath  <rharinath@novell.com>
14926
14927         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
14928         Simplify slightly.
14929         (ves_icall_MonoMethod_GetGenericMethodDefinition): Update
14930         property for testing if a method is a generic method definition.
14931
14932 2007-07-20  Atsushi Enomoto  <atsushi@ximian.com>
14933
14934         * domain-internals.h : added 2.0 member fields to MonoAppDomainSetup.
14935
14936 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14937
14938         * verify.c: used function from private branch, reverted to the one in class.h 
14939
14940 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14941
14942         * verify.c: a typo slipped in and the code wont compile
14943
14944 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14945
14946         * verify.c: now all code use IS_MANAGED_POINTER and UNMASK_TYPE macros.
14947         disabled box instruction as it is doing the wrong thing
14948         improved stack dump messages, now it is easier to debug type related issues
14949
14950
14951 2007-07-19  Juraj Skripsky  <js@hotfeet.ch>
14952
14953         * icall.c (ves_icall_System_MonoType_getFullName): Fix a leak. 
14954
14955 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14956
14957         * verify.c: changed MONO_TYPE_TYPEDBYREF stack type from 
14958         TYPE_COMPLEX to TYPE_PTR, it did not make any sense to be
14959         grouped with class and valuetype. This change will simply 
14960         the code as it should be handled just like unmanaged pointers.
14961
14962 2007-07-19  Mark Probst  <mark.probst@gmail.com>
14963
14964         * class.c (concat_two_strings_with_zero): Fixed a silly bug.
14965
14966 2007-07-19  Rodrigo Kumpera  <rkumpera@novell.com>
14967
14968         * verify.c: several stack merge issues fixed, reference comparisons now
14969         check the type size. strict type check now works correctly.
14970         added more uses of IS_MANAGED_POINTER macro.
14971         fixed issues pointed by running the test suite against .net.
14972         
14973
14974 2007-07-19  Mark Probst  <mark.probst@gmail.com>
14975
14976         * class.c, loader.c, class-internals.h: Removed the
14977         MonoLoaderErrorKind enum and replaced it with the MONO_EXCEPTION_
14978         defines.
14979
14980         * icall.c: Better error checking in some internal reflection
14981         methods.
14982
14983 2007-07-18  William Holmes  <billholmes54@gmail.com>
14984
14985         * filewatcher.c : removed unused variable 'filename' in 
14986           ves_icall_System_IO_FSW_SupportsFSW
14987
14988 Mon Jul 16 19:36:16 CEST 2007 Paolo Molaro <lupus@ximian.com>
14989
14990         * reflection.c, class.c, icall.c, loader.c: mono_get_inflated_method () is
14991         obsolete, removed.
14992
14993 2007-07-15  Zoltan Varga  <vargaz@gmail.com>
14994
14995         * icall.c (ves_icall_System_Reflection_FieldInfo_GetTypeModifiers): New icall.
14996         
14997         * icall.c (ves_icall_System_Reflection_Module_ResolveSignature): New icall.
14998
14999 2007-07-14  Zoltan Varga  <vargaz@gmail.com>
15000
15001         * icall.c (ves_icall_System_Reflection_Module_ResolveMethodToken): 
15002         Implement generics support.
15003         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
15004
15005         * icall.c (ves_icall_System_Reflection_Module_ResolveTypeToken): Add new
15006         type_args and method_args arguments.
15007         (ves_icall_System_Reflection_Module_ResolveMethodToken): Ditto.
15008         (ves_icall_System_Reflection_Module_ResolveFieldToken): Ditto.
15009         (ves_icall_System_Reflection_Module_ResolveMemberToken): Ditto.
15010
15011 2007-07-13  Rodrigo Kumpera  <rkumpera@novell.com>
15012
15013         * reflection.c: patch from Thong Nguyen to fix atribute resolution.
15014           It adds a rootimage parameter to mono_reflection_get_type_internal,
15015           adds new function mono_reflection_get_type_with_rootimage and use
15016           the rootimage to resolve the types instead of the current image
15017
15018 2007-07-13  Rolf Bjarne Kvinge  <RKvinge@novell.com>
15019
15020         * culture-info-table.h: Forgot to update after r78304.
15021
15022 2007-07-13  Raja R Harinath  <rharinath@novell.com>
15023
15024         * class.c (mono_class_is_open_constructed_type)
15025         <MONO_TYPE_GENERICINST>: Don't recompute a computed field.
15026
15027 2007-07-12  Rodrigo Kumpera  <rkumpera@novell.com>
15028
15029         * class.c (mono_bounded_array_class_get):  method fails if used with
15030         an incomplete TypeBuilder enum (no basetype field), fixed it by 
15031         avoiding calculating the size for such array as it cannot be instantiated.
15032         Fix bug #82015
15033
15034 2007-07-12  Raja R Harinath  <rharinath@novell.com>
15035
15036         * class-internals.h (_MonoGenericInst::is_reference): Remove bogus
15037         field.
15038         * metadata.c, reflection.c: Update to changes.
15039
15040 2007-07-11  Rodrigo Kumpera  <rkumpera@novell.com>
15041
15042         * class.c, class-internal.h: added mono_type_is_valid_enum_basetype and
15043         mono_class_is_valid_enum, they are used to valide a enum when loading.
15044         * reflection.c: used new functions to throw TypeLoadException when and
15045         invalid enum is build with TypeBuilder. Fixes #82018
15046   
15047 Wed Jul 11 14:47:07 CEST 2007 Paolo Molaro <lupus@ximian.com>
15048
15049         * object.c: forgot commit of mono_class_setup_methods () to access
15050         iface->methods.
15051         * object-internals.h: added a few more handy fields to
15052         MonoIMTCheckItem.
15053
15054 2007-07-11  Zoltan Varga  <vargaz@gmail.com>
15055
15056         * object.c (build_imt): Call mono_class_setup_methods () before accessing 
15057         iface->methods.
15058
15059 Tue Jul 10 16:49:01 CEST 2007 Paolo Molaro <lupus@ximian.com>
15060
15061         * class-internals.h, object-internals.h, object.c: IMT-based
15062         interface invocation core from Massimiliano Mantione
15063         (massi@ximian.com) with a reworked arch-specific interface,
15064         bsearch implementation and a few bugfixes and memory savings by me.
15065
15066 2007-07-10  Rodrigo Kumpera  <rkumpera@novell.com>
15067
15068         * class.c (mono_class_create_from_typedef): mono would segfault if 
15069         an enum did not have a __value field. It now throws a TypeLoadException
15070         for such cases. Fix bug #82022
15071
15072 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
15073
15074         * marshal.c (mono_marshal_string_to_utf16_copy): Fix allocation size.
15075
15076 2007-07-09  Mark Probst  <mark.probst@gmail.com>
15077
15078         * class.c (mono_class_init): If a class is already inited but has
15079         an exception_type set, return FALSE, not TRUE.  Fixes: 82050.
15080
15081 2007-07-09  Mark Probst  <mark.probst@gmail.com>
15082
15083         * class.c: Properly handle the case of an unimplemented interface
15084         method.  Fixes: 81673.
15085
15086 Mon Jul 9 16:21:43 CEST 2007 Paolo Molaro <lupus@ximian.com>
15087
15088         * class-internals.h, object.c: cleanup patch from massi: use
15089         MonoVTable->interface_bitmap since the vtable interfaces offset array
15090         is going away.
15091
15092 2007-07-10  Zoltan Varga  <vargaz@gmail.com>
15093
15094         * icall-def.h icall.c: Remove Module:get_MDStreamVersion icall and add a new
15095         GetMDStreamVersion icall instead.
15096
15097 Mon Jul 9 11:34:17 CEST 2007 Paolo Molaro <lupus@ximian.com>
15098
15099         * filewatcher.c: patch from Thong Nguyen <tum@veridicus.com> to
15100         not use mono_dl_build_path() with a full library name: makes
15101         fallbacks to libgaim and libfam work.
15102
15103 2007-07-06  William Holmes  <billholmes54@gmail.com>
15104
15105         * assembly.c: Added a continue statement in probe_for_partial_name when
15106          parse_assembly_directory_name fails.  Fixes : 82002
15107
15108 2007-07-06  Rodrigo Kumpera  <rkumpera@novell.com>
15109
15110         * verify.c (check_unmanaged_pointer_type): renamed to check_unverifiable_type
15111         and added a verification  for TYPEDBYREF.
15112         * verify.c (verify_stack_type_compatibility): fix handling of byref types,
15113         make native int interchangeable with int32 and some small cleanup and formating.
15114         * verify.c (push_arg): only ldarg on invalid argument is valid (but not verifiable) and
15115         handle byref of byref.
15116         * verify.c (push_local): handle byref of byref.
15117         * verify.c (do_binop): invalid mix of values is unverifiable
15118         * verify.c (do_invoke_method): fixed the handling of bad params on stack and
15119         added visibility checks
15120         * verify.c (field related method): added visibility checks
15121         * verify.c (do_push_field): cannot take the address of a temporary valuetype field
15122
15123 2007-07-06  Zoltan Varga  <vargaz@gmail.com>
15124
15125         * marshal.c (mono_marshal_string_to_utf16_copy): Null terminate the
15126         string.
15127
15128 2007-07-05  Zoltan Varga  <vargaz@gmail.com>
15129
15130         * profiler.c (mono_profiler_load): Fix an off-by-one error.
15131
15132         * marshal.c (emit_marshal_string): When returning a string from managed code,
15133         allways make a copy even for unicode strings. Fixes #81990.
15134
15135 Wed Jul 4 11:53:57 CEST 2007 Paolo Molaro <lupus@ximian.com>
15136
15137         * object.c: cleaned up mono_runtime_invoke_array () and fixed handling
15138         of byref generic inst types (bug #81997).
15139
15140 2007-07-03  Rodrigo Kumpera  <rkumpera@novell.com>
15141
15142         * class.c: moved methods mono_method_can_access_field and mono_method_can_access_method from mini/mini.c
15143         * class.h: added declarations of mono_method_can_access_field() and mono_method_can_access_method()
15144
15145 2007-07-02  Zoltan Varga  <vargaz@gmail.com>
15146
15147         * marshal.c (emit_marshal_string): Add support for unicode strings in
15148         MARSHAL_ACTION_MANAGED_CONV_RESULT. Fixes #81990.
15149
15150 2007-07-02 Rodrigo Kumpera  <rkumpera@novell.com>
15151
15152         * verify.c: field load/store are now verified, missing only access checks now
15153
15154 2007-06-28  Martin Baulig  <martin@ximian.com>
15155
15156         * mono-debug.c (mono_debug_debugger_version): New public variable.
15157
15158 2007-06-24  Gert Driesen  <drieseng@users.sourceforge.net>
15159
15160         * locales.c: When constructing DateTimeFormat or NumberFormat for
15161         MonoCultureInfo, inherit readonly bit from MonoCultureInfo. The
15162         MonoCultureInfo contructed from the current locale is always
15163         read-only and has UseUserOverride set to true. All MonoCultureInfo
15164         instances returned for GetCultures have both IsReadOnly and
15165         UseUserOverride set to true. Fixes part of bug #81930.
15166
15167 2007-06-22  Jonathan Chambers  <joncham@gmail.com>
15168
15169        * icall-def.h: Update System.__ComObject icalls
15170        * marshal.c: Avoid managed transition (and object creation)
15171        when looking up COM interface in RCW.
15172        * marshal.h: Ditto.
15173        
15174        Code is contributed under MIT/X11 license.
15175
15176 2007-06-22  Zoltan Varga  <vargaz@gmail.com>
15177
15178         * marshal.c (mono_marshal_get_runtime_invoke): Cache in the method image for now
15179         to avoid crashes during assembly unloading.
15180
15181 2007-06-22  Raja R Harinath  <rharinath@novell.com>
15182
15183         Fix MethodInfo.IsGenericMethodDefinition
15184         * reflection.c (mono_reflection_bind_generic_method_parameters):
15185         Rearrange code to ensure we always uses a generic method definition.
15186         * class.c (mono_class_inflate_generic_method_full): Set
15187         'generic_container' field only for generic method definitions.
15188         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition):
15189         Use presense of 'generic_container' field as indication of being a
15190         generic method definition.
15191
15192 2007-06-21  Zoltan Varga  <vargaz@gmail.com>
15193
15194         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15195
15196         * object-internals.h: Reflect changes in the layout of the managed Delegate
15197         class.
15198         
15199         * object-internals.h reflection.c icall-def.h: Applied patch from Robert
15200         Jordan (robertj@gmx.net). Add a dtor to dynamic methods which frees up the
15201         runtime memory used by the dynamic method. Fixes #77146.
15202
15203 2007-06-21  Dick Porter  <dick@ximian.com>
15204
15205         * file-io.h: 
15206         * file-io.c (convert_share): Cope with FileShare.Delete.  Patch
15207         from Wojtek Krawczyk <krawczyk.wojciech@gazeta.pl>, fixes bug
15208         81767.
15209
15210 2007-06-21  Raja R Harinath  <rharinath@novell.com>
15211
15212         * reflection.c (method_encode_methodspec): Add a tripwire.
15213         * class.c (inflate_generic_type): The fully open generic type is
15214         not the same as the generic type definition.
15215
15216 2007-06-21  Martin Baulig  <martin@ximian.com>
15217
15218         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 59.
15219
15220         * mono-debug-debugger.h
15221         (MonoDebuggerBreakpointInfo): Removed.
15222         (mono_debugger_insert_breakpoint_full): Moved to ../mini/debug-mini.h.
15223         (mono_debugger_remove_breakpoint): Likewise.
15224         (mono_debugger_breakpoint_callback): Likewise.
15225         (mono_debugger_start_add_type): Renamed into mono_debugger_add_type().
15226
15227 2007-06-21  Raja R Harinath  <rharinath@novell.com>
15228
15229         * metadata.c (mono_metadata_lookup_generic_class): The fully open
15230         generic type is not the same as the generic type definition.
15231         * class.c (mono_generic_class_get_class): Likewise.
15232
15233 2007-06-20  Geoff Norton  <gnorton@customerdna.com>
15234
15235         * icall.c: The second argument to 
15236         System.Reflection.MethodBase.GetMethodFromHandleInternalType
15237         is a MonoType not a MonoClass.
15238
15239 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
15240
15241         * verify.c: support for function pointers in the verifier
15242
15243 2007-06-20  Rodrigo Kumpera  <kumpera@gmail.com>
15244
15245         * verify.c: unmanaged pointer verification checks (loading unmanaged pointers is unverifiable)
15246
15247 Wed Jun 20 10:22:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
15248
15249         * assembly.c: removed Mono.Data.SqliteClient from the list of
15250         forward-compatible assemblies as it breaks the ABI (bug #81899).
15251
15252 2007-06-19  Raja R Harinath  <rharinath@novell.com>
15253
15254         * metadata.c (mono_metadata_lookup_generic_class): Protect cache
15255         lookup/update with the loader lock.
15256         * reflection.c (mono_class_bind_generic_parameters): No need to
15257         protect mono_metadata_lookup_* with the loader lock.
15258         * class.c (inflate_generic_type): Likewise.
15259         
15260         * metadata.c (ginst_in_image): Avoid mono_class_from_mono_type
15261         on a generic instantiated type.
15262
15263 2007-06-18  Rodrigo Kumpera <kumpera@gmail.com>
15264
15265         *verify.c: produce meanfull error messages on verification error
15266         *verify.c: fixed some cases of verification errors reported as validation errors
15267         *pedump.c: fixed the error name array, now it shows validation errors properly
15268         *verify.h: fixed the contant that should be used for verification errors
15269
15270 Mon Jun 18 17:07:22 CEST 2007 Paolo Molaro <lupus@ximian.com>
15271
15272         * metadata.c, image.c, metadata-internals.h: part of the fixes needed
15273         for bug #77596, 81858 and 80743 (generics data structures on domain
15274         unload).
15275
15276 2007-06-15  Raja R Harinath  <rharinath@novell.com>
15277
15278         Avoid allocating 'MonoGenericContext' on the heap.
15279         * class-internals (_MonoMethodInflated::context): Make field
15280         inline, not a pointer.
15281         * loader.c (method_from_methodspec): Allocate 'new_context' on the
15282         stack.  Use the context embedded within the inflated method as the
15283         hash key, rather than 'new_context'.
15284         * class.c (inflate_generic_context): Simplify.  Return a struct
15285         rather than allocating on the heap.
15286         (mono_class_inflate_generic_method_full): Update to changes.  Now,
15287         doesn't salt away a copy of the context -- simplifying the
15288         lifetime rules of a 'MonoGenericContext *'.
15289         (mono_method_get_context): Return pointer to embedded context.
15290         (setup_generic_array_ifaces): Allocate temporary context on stack.
15291         * reflection.c (inflate_mono_method): Likewise.
15292         (mono_reflection_bind_generic_method_parameters): Likewise.
15293         Use the context embedded within the inflated method as the hash key.
15294
15295         Avoid a source of allocation of 'MonoGenericContext'.
15296         * class-internals.h (_MonoGenericClass::context): Combine 'inst'
15297         and 'cached_context' fields into embedded 'MonoGenericContext' field.
15298         * class.c: Update to changes.
15299         (mono_generic_class_get_context): Simplify drastically.  Now just
15300         returns a pointer to the field.
15301         * metadata-internals.h (mono_metadata_generic_context_hash): Mark
15302         argument as a const pointer.
15303         (mono_metadata_generic_context_equal): Likewise.
15304         * metadata.c, loader.c, icall.c, reflection.c, verify.c:
15305         Update to changes.
15306
15307 2007-06-14  Rodrigo Kumpera  <kumpera@gmail.com>
15308
15309         * verify.c improved the handling of brtrue/brfalse, factored out common code
15310
15311 2007-06-14  Raja R Harinath  <rharinath@novell.com>
15312
15313         Kill MonoGenericMethod.
15314         * class-internals.h (MonoGenericContext::method_inst): Rename from
15315         'gmethod' and convert to a MonoGenericInst.
15316         (MonoGenericMethod): Remove.
15317         * metadata.h (MonoGenericMethod): Note that the name is obsolete.
15318         * loader.c (method_from_methodspec): Update to changes.  Use a
15319         MonoGenericContext as the key to the hashtable.
15320         * metadata.c (mono_metadata_generic_context_equal): Rename from 
15321         'mono_metadata_generic_method_equal' and take MonoGenericContext.
15322         (mono_metadata_generic_context_hash): Likewise from
15323         'mono_metadata_generic_method_hash'.  Change hash function.
15324         (mono_metadata_load_generic_params): Update to changes.
15325         (mono_get_shared_generic_method): Remove.
15326         * metadata-internals.h (mono_get_shared_generic_method): Remove.
15327         * class.c (inflate_generic_type) [MONO_TYPE_MVAR]: Update to changes.
15328         (inflate_generic_context): Likewise.
15329         (mono_class_inflate_generic_method_full): Likewise.
15330         (setup_generic_array_ifaces): Likewise.
15331         (mono_class_create_from_typespec): Likewise.
15332         * reflection.c (encode_generic_method_sig): Take a MonoGenericContext.
15333         (method_encode_methodspec): Update callsite.
15334         (reflection_methodbuilder_to_mono_method): Update to changes.
15335         (mono_reflection_bind_generic_method_parameters): Likewise.  Use a
15336         MonoGenericContext as the key to the hashtable.
15337         (inflate_mono_method): Update to changes.
15338
15339         * class-internals.h (MonoGenericMethod::container): Remove.
15340         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
15341
15342 Thu Jun 14 12:40:05 CEST 2007 Paolo Molaro <lupus@ximian.com>
15343
15344         * profiler-private.h, profiler.c, profiler.h: added API to profile
15345         exception events.
15346
15347 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15348
15349         * verify.c: Fixed pointer type handling, some code and message formating and two invalid assigments 
15350
15351 2007-06-13  Rodrigo Kumpera  <kumpera@gmail.com>
15352
15353         * verify.c: method invocation is now validated, now we verify parameter types on stack.
15354         Fixed overflow and underflow not aborting the verification process.
15355
15356 2007-06-13  Mark Probst  <mark.probst@gmail.com>
15357
15358         * class-internals.h (MonoStats): Added stats entries for dynamic
15359         code allocations.
15360
15361 2007-06-12  Zoltan Varga  <vargaz@gmail.com>
15362
15363         * loader.c (mono_free_method): Free header->locals and header->clauses.
15364
15365         * marshal.c (mono_mb_create_method): Make a copy of the locals as well in the
15366         dynamic case.
15367
15368         * threads.c (mono_thread_get_stack_bounds): Fix memory leak.
15369
15370         * class.c (setup_interface_offsets): Allocate memory from the image mempool.
15371
15372 2007-06-12  Raja R Harinath  <rharinath@novell.com>
15373
15374         * verify.c (TYPE_MAX): Set it to 8 to match the dimensions of all
15375         the tables.
15376
15377 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15378
15379         *pedump.c (main): return error code 4 if assembly cannot be loaded instead of segfaulting
15380
15381 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15382
15383         MonoGenericMethod on a diet
15384         * class-internals.h (_MonoMethodInflated::reflection_info): Move
15385         here ...
15386         (_MonoGenericMethod::reflection_info): ... from here.
15387         * icall.c (ves_icall_MonoMethod_GetGenericMethodDefinition):
15388         Update to changes.
15389         * reflection.c (inflate_mono_method): Likewise.
15390         (mono_reflection_bind_generic_method_parameters): Likewise.
15391
15392 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15393
15394         *verify.c: all debu printf statements are now guarded by VERIFY_DEBUG
15395         *verify.c: factored long ldarg forms to share code with short forms
15396
15397 2007-06-11  Rodrigo Kumpera  <kumpera@gmail.com>
15398
15399         *verify.c: fixed code formating factored some duplicate code
15400         into a new function
15401
15402         *verify.h: fixed binary incompatibility introduced earlier
15403
15404         *pedump.c: fixed formating
15405
15406 2007-06-11  Raja R Harinath  <harinath@gmail.com>
15407
15408         Fix assertion when disassembling Mono.C5.dll
15409         * loader.c (method_from_methodspec): Avoid inflating a method
15410         twice with the same context.  If the methodref is inflated, use
15411         the declaring method instead.
15412
15413         * class.c (mono_class_from_generic_parameter): Fix case similar to
15414         bug #81830 handled below, but for method containers.
15415
15416 2007-06-10  Raja R Harinath  <harinath@gmail.com>
15417
15418         * class.c (inflate_generic_type) [MONO_TYPE_CLASS]: Don't call
15419         get_shared_generic_class.  Directly inflate the instance.
15420         [MONO_TYPE_GENERICINST]: Inline inflate_generic_class.
15421         (inflate_generic_class): Delete.
15422         (get_shared_generic_class): Delete.  Move setting of
15423         'cached_class' and 'cached_context' ...
15424         * metadata.c (mono_metadata_lookup_generic_class): ... here.
15425
15426         * metadata.c (mono_metadata_lookup_generic_class): Change
15427         signature to take the components of a MonoGenericClass rather than
15428         an allocated MonoGenericClass.  Change semantics to be intern-like.
15429         * reflection.c (mono_class_bind_generic_parameters): Update to
15430         changes.  Make locking region tighter.
15431         * class.c (inflate_generic_class): Update to changes.
15432         (get_shared_generic_class): Likewise.
15433         * metadata-internals.h: Likewise.
15434
15435         * reflection.c (mono_class_bind_generic_parameters): Take and
15436         return a MonoClass*, not a MonoType*.  Add 'is_dynamic' parameter.
15437         (mono_reflection_bind_generic_parameters): Use
15438         'mono_class_bind_generic_parameters' rather than duplicate the code.
15439         * class.c (mono_bounded_array_class_get): Update to changes.
15440         * object-internals.h: Likewise.
15441
15442         * reflection.c (mono_class_bind_generic_parameters): Only support
15443         parameterizing generic type definitions.  Remove support for other
15444         open types.
15445
15446 2007-06-08  Zoltan Varga  <vargaz@gmail.com>
15447
15448         * loader.c (mono_free_method): Free method->signature as well. Fixes #81832.
15449
15450         * marshal.c (mono_marshal_get_managed_wrapper): Allocate the signature using malloc
15451         in the dynamic case.
15452
15453 2007-06-08  Gert Driesen  <drieseng@users.sourceforge.net>
15454
15455         * threads.c: When cleaning up thread, reset the Background bit.
15456         Fixes bug #81720.
15457
15458 2007-06-08  Jonathan Chambers  <joncham@gmail.com>
15459
15460        * metadata.c: Move variable declarations to top of scope.
15461        * verify.c: Move variable declarations to top of scope.
15462
15463        Code is contributed under MIT/X11 license.
15464
15465 2007-06-08  Raja R Harinath  <rharinath@novell.com>
15466
15467         * reflection.c (mono_class_bind_generic_parameters): Replace
15468         open-coded loop with mono_metadata_inflate_generic_inst.
15469
15470         * class.c (get_shared_generic_class): Don't call
15471         mono_get_shared_generic_inst.  Use the container's own
15472         'class_inst'.
15473
15474         * metadata.c (mono_metadata_load_generic_params): Move
15475         initialization of 'context' field here from ...
15476         * class.c (mono_class_create_from_typedef): ... here, and ...
15477         * loader.c (mono_get_method_from_token): ... here.
15478
15479         * class.c (get_shared_generic_class): Rename from
15480         mono_get_shared_generic_class and make static.
15481         (mono_get_shared_generic_inst): Move to metadata.c.
15482         * loader.c (mono_get_shared_generic_method): Likewise.
15483         * class-internals.h, metadata-internals.h: Update to changes.
15484
15485         Fix #81830
15486         * class.c (mono_class_from_generic_parameter): Don't assume a
15487         generic container owner exists.  Generic containers from monodis
15488         don't have any.
15489
15490 2007-06-06  Rodrigo Kumpera  <kumpera@gmail.com>
15491
15492         * pedump.c: pedump exists with 2 if assembly is not verifiable and 3 if invalid
15493         * verify.h: new typedefs to returns the non-verifiable status
15494         * verify.c: initial implementation of generics, stack merging and object compatibility check
15495
15496 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15497
15498         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15499         a MonoInternalHashTable again (fixed bug in internal hash table
15500         code).
15501
15502 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15503
15504         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15505         MonoInternalHashTable again (fixed bug in internal hash table
15506         code).
15507
15508 2007-06-06  Mark Probst  <mark.probst@gmail.com>
15509
15510         * class.c, image.c, class-internals.h, domain.c,
15511         domain-internals.h (MonoImage): Reverting MonoInternalHashTable
15512         changes.  Have to figure out what makes them break the SWF
15513         regression.
15514
15515 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15516
15517         * class.c, image.c, class-internals.h (MonoImage): class_cache is
15518         a MonoInternalHashTable now.
15519
15520 2007-06-04  Mark Probst  <mark.probst@gmail.com>
15521
15522         * domain.c, domain-internals.h (MonoDomain): jit_code_hash is a
15523         MonoInternalHashTable now.
15524
15525 2007-05-31  Zoltan Varga  <vargaz@gmail.com>
15526
15527         * domain-internals.h (MonoDomain): Add two new hash tables to store delegate
15528         invoke_impl code.
15529
15530         * object-internals.h (_MonoDelegate): Reflect changes to managed object layout.
15531
15532         * object.c (mono_delegate_ctor): Initialize invoke_impl field with an arch
15533         dependent trampoline.
15534
15535         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
15536
15537         * icall.c (ves_icall_System_Delegate_SetMulticastInvoke): New icall.
15538
15539 2007-05-29  Robert Jordan  <robertj@gmx.net>
15540
15541         * marshal.[c|h]: add mono_win32_compat_* wrappers. Fixes #81754.
15542
15543 2007-05-28  Zoltan Varga  <vargaz@gmail.com>
15544
15545         * icall.c (ves_icall_get_method_info): Handle loader errors. Fixes #81724.
15546
15547 2007-05-25  Jonathan Chambers  <joncham@gmail.com>
15548
15549        * marshal.c: Fix interface lookup loops for
15550        cominterop_get_com_slot_for_method and 
15551        cominterop_get_method_interface. Only need to lookup
15552        if type is a class, else use interface type method is on.
15553
15554        Code is contributed under MIT/X11 license.
15555
15556 2007-05-25  Sebastien Pouliot  <sebastien@ximian.com>
15557
15558         * reflection.c: HasSecurity can be present even if no specially 
15559         encoded (CAS) attributes are available (e.g. SuppressUnmanagedCode
15560         SecurityAttribute). Fix CAS regression tests on buildbot.
15561
15562 2007-05-24  Jonathan Chambers  <joncham@gmail.com>
15563
15564        * appdomain.c: Add configure checks for header files.
15565        * image.c: Add configure checks for header files.
15566        * file-io.c: Add configure checks for header files.
15567        * debug-mono-symfile.c: Add configure checks for header files.
15568        * threadpool.c: Add configure checks for header files.
15569        * console-io.c: Add configure checks for header files.
15570        * profiler.c: Add configure checks for header files.
15571        * rawbuffer.c: Add configure checks for header files.
15572        * icall.c: Add configure checks for header files.
15573        * rand.c: Add configure checks for header files.
15574        * socket-io.c: Add configure checks for header files.
15575
15576        Code is contributed under MIT/X11 license.
15577
15578 2007-05-24  Zoltan Varga  <vargaz@gmail.com>
15579
15580         * reflection.c (mono_custom_attrs_from_builders): Remove the 
15581         assertion as it breaks the build.
15582         
15583         * reflection.c (mono_custom_attrs_from_builders): Add an assertion.
15584
15585         * reflection.c (lookup_custom_attr): Make a copy here too.
15586
15587         * image.c (mono_image_check_for_module_cctor): Avoid accessing metadata in
15588         dynamic images.
15589
15590         * class.c (mono_class_init): Avoid accessing the metadata in dynamic
15591         images.
15592
15593         * reflection.c (mono_custom_attrs_from_param): Make a copy of the dynamic attr
15594         info.
15595
15596 2007-05-22  Zoltan Varga  <vargaz@gmail.com>
15597
15598         * reflection.c (encode_cattr_value): Fix yet another object cattr encoding issue.
15599         (load_cattr_value): Ditto.
15600
15601 2007-05-20  Zoltan Varga  <vargaz@gmail.com>
15602
15603         * marshal.c (mono_marshal_get_delegate_invoke): Improve the generated IL a little.
15604
15605 2007-05-19  Gert Driesen  <drieseng@users.sourceforge.net>
15606
15607         * threads.c: In "start_wrapper", set apartment_state to MTA if
15608         apartment_state is Unknown and we're running on 2.0 profile or
15609         higher.
15610         * object.c: In "mono_runtime_exec_main", if STAThread is not applied
15611         to main method, then set apartment_state to Unknown on 1.0 profile,
15612         and MTA on 2.0 profile.
15613
15614 2007-05-16  Jb Evain  <jb@nurv.fr>
15615
15616         * class-internals.h (MonoDefaults): Add an attribute_class and
15617           customattribute_data_class.
15618         * domain.c (mono_init_internal): Populate them.
15619         * reflection.c: Use them to remove duplicates. Make a vew
15620         MonoClass variables `static'.
15621
15622 2007-05-15  Massimiliano Mantione  <massi@ximian.com>
15623
15624         * class-internals.h: Added "MonoVTable.interface_bitmap" as a next
15625         step in implementing IMT, so that all isinst checks now can go
15626         through the bitmap.
15627         This was needed because vtables for TransparentProxy need to look
15628         like the vtable of the "target" class, so they need to point to
15629         its interface bitmap directly.
15630
15631         * object.c: inside "mono_class_create_runtime_vtable" and
15632         "mono_class_proxy_vtable", initialize "MonoVTable.interface_bitmap".
15633
15634 2007-05-15  Atsushi Enomoto  <atsushi@ximian.com>
15635
15636         * object-internals.h
15637           culture-info.h : added territory field in MonoCulture and
15638           CultureInfoEntry foreach. Added lcid field in RegionInfoEntry.
15639         * locales.c : fill territory field above too.
15640         * culture-info-table.h : regenerated.
15641
15642 2007-05-12  Zoltan Varga  <vargaz@gmail.com>
15643
15644         * class-internals.h (_MonoGenericContainer): Widen type_argc filed to 31 bits.
15645         Fixes #81599.
15646
15647 2007-05-11  Jonathan Chambers  <joncham@gmail.com>
15648
15649         * object.c: Always initialize apartment, even if 
15650         there is no custom attributes on entry point.
15651         
15652         Code is contributed under MIT/X11 license.
15653
15654 2007-05-10  Jonathan Chambers  <joncham@gmail.com>
15655
15656         * marshal.c: LPTSTR == LPWSTR on Win32. Fixes #81370.
15657         * metadata.c: If no encoding is set, check for unicode
15658         on class.
15659         
15660         Code is contributed under MIT/X11 license.
15661
15662 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15663
15664         * threads.c: Handle if mono_thread_current returns NULL 
15665         
15666         Code is contributed under MIT/X11 license.
15667
15668 2007-05-09  Jonathan Chambers  <joncham@gmail.com>
15669
15670         * threads.c: Initialize Thread.AprtmentState and set on Thread.Start
15671         in start_wrapper. Added mono_thread_init_apartment_state and
15672         mono_thread_cleanup_apartment_state.
15673         * object.c: Initialize thread apartment state on main thread
15674         by checking for STAThreadAttribute on entry point.
15675         * object-internals.h: Add apartment_state field to MonoThread.
15676         * threads-types.h: Add unmanaged definition of 
15677         System.Threading.ApartmentState, MonoThreadApartmentState.
15678         
15679         Code is contributed under MIT/X11 license.
15680         
15681 2007-05-08  Jonathan Chambers  <joncham@gmail.com>
15682
15683         * class.c: Fix windows build.
15684         * class-internals.h: Fix windows build.
15685         
15686         Code is contributed under MIT/X11 license.
15687
15688 2007-05-08  Robert Jordan  <robertj@gmx.net>
15689
15690         * process.c (CreateProcess_internal):
15691         Pass CREATE_NO_WINDOW to CreateProcess when ProcessStartupInfo
15692         .CreateNoWindow was specified. Fixes #81496.
15693
15694 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15695
15696         * class-internals.h: Removed "MonoClass.interface_offsets" as a first
15697         step in implementing IMT, replaced it with two compact arrays
15698         (interfaces_packed and interface_offsets_packed) and a bitmap that
15699         is used for isinst checks (interface_bitmap).
15700
15701         * class.c: (compare_interface_ids): compare function to pass to
15702         bsearch when looking for an interface with a given id.
15703         (mono_class_interface_offset): reimplemented using bsearch on
15704         interfaces_packed, getting the offset from interface_offsets_packed.
15705         (print_implemented_interfaces): utility debugging function.
15706         (setup_interface_offsets): reworked to initialize interfaces_packed,
15707         interface_offsets_packed and interface_bitmap.
15708
15709         * object.c: replaced all accesses to "MonoClass.interface_offsets"
15710         with uses of interfaces_packed and interface_offsets_packed.
15711
15712 2007-05-08  Massimiliano Mantione  <massi@ximian.com>
15713
15714         * class-internals.h: Added MONO_CLASS_IMPLEMENTS_INTERFACE macro and
15715         mono_class_interface_offset prototype to wrap all accesses to
15716         "MonoClass.interface_offsets".
15717
15718         * class.c: Implemented mono_class_interface_offset, and wrapped all
15719         accesses to "MonoClass.interface_offsets".
15720
15721         * monodiet.c, object.c, marshal.c, icall.c: wrapped all accesses to
15722         "MonoClass.interface_offsets".
15723
15724 Tue May 8 13:02:09 CEST 2007 Paolo Molaro <lupus@ximian.com>
15725
15726         * icall.c, icall-def.h: implemented new GetFieldFromHandle and
15727         GetMethodFromHandle overloads (bug #78637).
15728
15729 Tue May 8 12:22:14 CEST 2007 Paolo Molaro <lupus@ximian.com>
15730
15731         * assembly.c: parse ProcessorArchitecture in assembly name and ignore
15732         it for now (see mono-devel, from Marek Sieradzki <marek.sieradzki@gmail.com>).
15733
15734 2007-05-01  Zoltan Varga  <vargaz@gmail.com>
15735
15736         * icall.c (custom_attrs_get_by_type): Handle loading errors gracefully. Fixes
15737         #81498.
15738
15739         * reflection.c (mono_reflection_get_custom_attrs_by_type): Handle loading errors
15740         gracefully.
15741         (mono_custom_attrs_from_index): Ditto.
15742
15743         * icall.c (ves_icall_InternalInvoke): Allow calling ctors of abstract classes. 
15744         Fixes #81501.
15745
15746 2007-04-30  Zoltan Varga  <vargaz@gmail.com>
15747
15748         * metadata.c (mono_metadata_parse_type_full): Avoid an invalid free since the type
15749         is now allocated from a mempool.
15750
15751 2007-04-28  Zoltan Varga  <vargaz@gmail.com>
15752
15753         * threads.c (build_wait_tids): Do not call mono_monitor_enter () here since the
15754         caller holds threads_lock, leading to deadlocks. Fixes #81476.
15755
15756 2007-04-26  Zoltan Varga  <vargaz@gmail.com>
15757
15758         * loader.c (mono_loader_error_prepare_exception): Fix crash caused by calling
15759         mono_loader_clear_error () too late. Fixes #81463.
15760
15761 2007-04-26  Atsushi Enomoto  <atsushi@ximian.com>
15762
15763         * culture-info-table.h : regenerated.
15764
15765 2007-04-25  Zoltan Varga  <vargaz@gmail.com>
15766
15767         * appdomain.c (add_assemblies_to_domain): Fix crash when an assembly reference
15768         is missing.
15769
15770 2007-04-25  Dick Porter  <dick@ximian.com>
15771
15772         * Makefile.am: Put the mingw enforced-optimisation back into the
15773         PLATFORM_WIN32 section.
15774
15775 2007-04-24  Zoltan Varga  <vargaz@gmail.com>
15776
15777         * reflection.c (mono_image_load_module_dynamic): Fix crash introduced by previous
15778         patch.
15779
15780         * image.c (mono_image_load_module): New API function to load a module reference.
15781
15782         * image.c (load_modules): Load modules lazily. Fixes #80812.
15783
15784         * class.c (mono_class_from_typeref): Use mono_image_load_module.
15785         
15786         * reflection.c (mono_image_load_module_dynamic): Copy image->modules_loaded too.
15787
15788         * object-internals.h reflection.c icall-def.h (mono_image_load_module): Rename this 
15789         to mono_image_load_module_dynamic.
15790
15791 2007-04-23  Jonathan Chambers  <joncham@gmail.com>
15792
15793         * marshal.c: Fix calling convention for CCW on non-windows
15794         platforms. STDCALL on windows, CDECL everywhere else to work 
15795         with XPCOM and MainWin COM.
15796         
15797         Code is contributed under MIT/X11 license.
15798
15799 2007-04-23  Martin Baulig  <martin@ximian.com>
15800
15801         Fix #80969.
15802
15803         * loader.c
15804         (method_from_memberref): Added `gboolean *used_context' argument.
15805         (mono_get_method_from_token): Likewise.
15806         (mono_get_method_full): Don't insert the method in the cache when
15807         `used_context' is true.
15808
15809 2007-04-23  Raja R Harinath  <rharinath@novell.com>
15810
15811         * monodiet.c (add_types_from_method): Fix "wrong type" warning.
15812
15813         * reflection.c (mono_reflection_bind_generic_parameters): Don't
15814         create new MonoTypes for returned types.
15815         * class.c (mono_generic_class_get_class): Export mono-internal.
15816         * class-internals.h: Update to changes.
15817
15818 Thu Apr 19 16:45:55 CEST 2007 Paolo Molaro <lupus@ximian.com>
15819
15820         * threadpool.c, threadpool.h, icall-def.h: patch from
15821         Robert Jordan to implemnt ThreadPool.SetMaxThreads.
15822
15823 2007-04-18  Zoltan Varga  <vargaz@gmail.com>
15824
15825         * threads.c (mono_thread_get_stack_bounds): Fix windows build.
15826         
15827         * threads.c (mono_thread_get_stack_bounds): Remove an assert which can be triggered.
15828
15829         * threads.c (mono_thread_get_stack_bounds): New helper function.
15830
15831         * threads.c (mono_thread_attach): Applied patch from horst.reiterer@fabasoft.com.
15832         Correctly compute stack bounds when attaching. Fixes #81394.
15833
15834 Wed Apr 18 18:28:41 BST 2007 Paolo Molaro <lupus@ximian.com>
15835
15836         * reflection.c: fix handling of doubles in custom attributes
15837         for the arm-fpa format (bug #81368).
15838
15839 2007-04-18  Raja R Harinath  <rharinath@novell.com>
15840
15841         * reflection.c (assembly_add_win32_resources): Mildly relax an
15842         bounds check to let the end pointer point just past the end of the
15843         allocated buffer.  (may fix #81384)
15844
15845 2007-04-17  Atsushi Enomoto  <atsushi@ximian.com>
15846
15847         * culture-info-table.h : regenerated.
15848
15849 2007-04-07  Zoltan Varga  <vargaz@gmail.com>
15850
15851         * threads.c (start_wrapper): Call push_appdomain_ref () earlier to fix races where
15852         the thread is aborted early.
15853
15854 2007-04-05  Dick Porter  <dick@ximian.com>
15855
15856         * file-io.c (ves_icall_System_IO_MonoIO_GetFileSystemEntries): use
15857         FindFirstFile()/FindNextFile() to find entries.  This lets the
15858         io-layer versions use MONO_IOMAP compatibility helpers.  Fixes bug
15859         81038.
15860
15861         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the usage of
15862         the parameters of
15863         ves_icall_System_IO_MonoIO_GetFileSystemEntries() has changed.
15864
15865 2007-04-04  Martin Baulig  <martin@ximian.com>
15866
15867         * debug-helpers.c
15868         (mono_method_desc_full_match): Add support for nested classes.
15869
15870 2007-04-02  Zoltan Varga  <vargaz@gmail.com>
15871
15872         * marshal.c (cominterop_get_managed_wrapper_adjusted): Fix warnings.
15873
15874 2007-04-01  Zoltan Varga  <vargaz@gmail.com>
15875
15876         * threads.c (abort_appdomain_thread): Avoid handle leakage if we are
15877         waiting for too many threads.
15878
15879 2007-03-28  Sebastien Pouliot  <sebastien@ximian.com>
15880
15881         * environment.c: Fix return value check on uname so we can get the 
15882         executing version on Solaris operating systems.
15883
15884 2007-03-28  Jb Evain  <jbevain@gmail.com>
15885
15886         * class.c (mono_type_get_name_recurse): Complete the
15887         fix for the creation of assembly qualified names for
15888         pointer types. Fixes #81208.
15889
15890 2007-03-27  Dick Porter  <dick@ximian.com>
15891
15892         * appdomain.c (MONO_CORLIB_VERSION): Increment, as the signature
15893         of ves_icall_System_Threading_Mutex_ReleaseMutex_internal() has
15894         changed.
15895
15896         * threads.c
15897         (ves_icall_System_Threading_Mutex_ReleaseMutex_internal): Return
15898         the value of ReleaseMutex().
15899
15900 2007-03-27  Dick Porter  <dick@ximian.com>
15901
15902         * socket-io.c (ipaddress_to_struct_in_addr): IPAddress is stored
15903         in little-endian order, not network endian, so must be converted
15904         to host endian here.  Fixes bug 80593.
15905
15906 2007-03-22  Jb Evain  <jbevain@gmail.com>
15907
15908         * class.c (mono_type_get_name_recurse): Fix the creation of assembly
15909         qualified names for pointer types. Fixes #81208.
15910
15911 2007-03-21  Jonathan Chambers  <joncham@gmail.com>
15912
15913         * marshal.c: Add support for PreserveSigAttribute. 
15914         
15915         Code is contributed under MIT/X11 license.
15916
15917 2007-03-14  Zoltan Varga  <vargaz@gmail.com>
15918
15919         * process.c: Fix endianness issues. Fixes #81126.
15920
15921         * reflection.c (mono_reflection_create_dynamic_method): Fix the last change so
15922         multiple circular calls made from the same DynamicMethod work. Fixes #81141.
15923
15924         * image.c (mono_image_lookup_resource): Make this work on big-endian
15925         machines.Change API contract so the caller needs to free the return value.
15926         
15927         * process.c (process_get_fileversion): Adapt to mono_image_lookup_resource ()
15928         API change.
15929         
15930 2007-03-14  Martin Baulig  <martin@ximian.com>
15931
15932         * debug-helpers.c (mono_type_get_desc): In `MONO_TYPE_ARRAY', use
15933         mono_type_get_desc() as well.
15934
15935 2007-03-13  Jonathan Chambers  <joncham@gmail.com>
15936
15937         * icall.c:  Fix environ access in VS.  
15938         
15939 2007-03-13  Alp Toker  <alp@atoker.com>
15940
15941         * icall.c (ves_icall_MonoType_GetElementType): For enums, return null
15942         rather than the underlying type. Based on a patch by Ben Maurer. Fixes
15943         #63841.
15944
15945 2007-03-12  Zoltan Varga  <vargaz@gmail.com>
15946
15947         * reflection.c (mono_reflection_create_dynamic_method): Add support for 
15948         circular references among dynamic methods. Fixes #81091.
15949
15950         * object-internals.h (MonoReflectionDynamicMethod): Add 'referenced_by' field.
15951
15952 2007-03-09  Martin Baulig  <martin@ximian.com>
15953
15954         * reflection.c (encode_constant): Add support for MONO_TYPE_GENERICINST.
15955
15956 2007-03-09  Jonathan Chambers  <joncham@gmail.com>
15957
15958         * appdomain.c:  Fix shadow copy on Windows. Use g_snprintf instead
15959         of snprintf as it doesn't exist on Win32 (VS build); also for uniformity.  
15960         
15961         Code is contributed under MIT/X11 license.
15962         
15963 2007-03-09  Gert Driesen  <drieseng@users.souceforge.net>
15964
15965         * loader.c: Reapply patch for bug #79424.
15966
15967 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
15968
15969         * metadata.c (mono_type_to_unmanaged): Only convert object to
15970         MARSHAL_CONV_SAFEHANDLE on the 2.0 profile.
15971
15972 Tue Mar 6 15:39:48 CET 2007 Paolo Molaro <lupus@ximian.com>
15973
15974         * class-internals.h, class.c, metadata.c, reflection.c: removed unused
15975         (and incorrectly set) is_reference field from MonoGenericInst.
15976
15977 2007-03-06  Zoltan Varga  <vargaz@gmail.com>
15978
15979         * assembly.c (mono_assembly_load_from_full): Call mono_assemblies_unlock ()
15980         a little earlier.
15981
15982         * icall.c (ves_icall_type_Equals): Rename this to ves_icall_System_Type_EqualsInternal.
15983
15984         * icall-def.h: Rename Type:Equals to Type:EqualsInternal.
15985
15986 2007-03-05  Miguel de Icaza  <miguel@novell.com>
15987
15988         * file-io.c (ves_icall_System_IO_MonoIO_Open): Use the new
15989         FileOptions.1 value to mean "temporary", map that to
15990         FILE_ATTRIBUTE_TEMPORARY and use that to signal 600 permissions.
15991
15992         Fixes 80688
15993
15994 2007-03-03  Marek Habersack  <mhabersack@novell.com>
15995
15996         * appdomain.c: implement MS .Net style shadow copying. Copies of
15997         the assemblies are made in a subdirectory of the dynamic base
15998         directory, the assembly names are preserved.
15999         Copy .mdb and .config files along with the assemblies being shadowed.
16000
16001 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
16002
16003         * marshal.c (emit_object_to_ptr_conv): Emit valid IL for handling HandleRefs.
16004         (emit_marshal_handleref): Ditto.
16005
16006         * profiler.c: Applied patch from Tor Lillqvist (tml@novell.com) to fix output
16007         on Visual C++. Fixes #80671.
16008
16009 Wed Feb 28 16:53:40 CET 2007 Paolo Molaro <lupus@ximian.com>
16010
16011         * boehm-gc.c, null-gc.c, object.h, object.c: sgen gc fixes
16012         for clone operations.
16013
16014 2007-02-28  Zoltan Varga  <vargaz@gmail.com>
16015
16016         * marshal.c: Fix warnings.
16017
16018 Fri Feb 23 15:06:57 CET 2007 Paolo Molaro <lupus@ximian.com>
16019
16020         * loader.c: allow case-insensitive matching of the dll name
16021         in dllmap handling when prefixed with "i:".
16022
16023 2007-02-20  Jonathan Chambers  <joncham@gmail.com>
16024
16025         * threads.c: Fix #ifdef for dummy_apc function for VS.
16026
16027 Tue Feb 20 11:59:42 CET 2007 Paolo Molaro <lupus@ximian.com>
16028
16029         * threads.c: don't throw in MemoryBarrier (), use lock/unlock.
16030
16031 2007-02-19  Massimiliano Mantione  <massi@ximian.com>
16032         * class.c (mono_class_setup_vtable_general): Fix bug 75903,
16033         giving precedence to the methods with a fully qualified name
16034         (InterfaceName.MethodName) when building the interface sections
16035         of the vtable.
16036
16037 2007-02-16  Dick Porter  <dick@ximian.com>
16038
16039         * threadpool.c (append_job): Fix fast-path array handling, so it's
16040         less likely the array will grow exponentially when the load is
16041         heavy.
16042
16043 Fri Feb 16 19:17:30 CET 2007 Paolo Molaro <lupus@ximian.com>
16044
16045         * metadata-internals.h, loader.c: fix dllmap lookup order
16046         for non-function maps, too, and prepare for fallback code.
16047
16048 2007-02-12  Robert Jordan  <robertj@gmx.net>
16049
16050         * marshal.c, marshal.h, icall-def.h: rename mono_marshal_realloc
16051         to ves_icall_System_Runtime_InteropServices_Marshal_ReAllocHGlobal
16052         and use GlobalReAlloc on WIN32 to be in sync with GlobalAlloc,
16053         GlobalFree. Fixes a part of bug #77075.
16054
16055 Mon Feb 12 21:10:07 CET 2007 Paolo Molaro <lupus@ximian.com>
16056
16057         * loader.c: implemented typedef parent in field memberref.
16058
16059 2007-02-11  Jonathan Chambers  <joncham@gmail.com>
16060
16061         * marshal.c: Fix warnings and remember to call Release on
16062         IUnknown of RCW.
16063         
16064         Code is contributed under MIT/X11 license.
16065
16066 2007-02-10  Miguel de Icaza  <miguel@novell.com>
16067
16068         * class-internals.h: Add MonoHandleRef definition, and
16069         handleref_class to mono_defaults. 
16070
16071         * metadata.c (mono_type_to_unmanaged): If we find HandleRefs in a
16072         structure, use new conversion MONO_MARSHAL_CONV_HANDLEREF.
16073
16074         * marshal.c (emit_ptr_to_object_conv): Add support for HandleRefs
16075         (do nothing on this stage)
16076         (emit_object_to_ptr_conv): Extract the handle from the HandleRef.  
16077         (emit_marshal_handleref): New method, used for argument handling
16078         of HandleRefs. 
16079
16080 2007-02-08  Jonathan Chambers  <joncham@gmail.com>
16081
16082         * class.c (mono_class_setup_parent): Lazily init com types.
16083         * domain.c (mono_init_internal, mono_init_com_types): Lazily 
16084         init com types.
16085         * object.c (mono_remote_class_vtable): Lazily init com types.
16086         * class-internals.h: Add iunknown and idispatch to MonoDefaults.
16087         * object-internals.h: Add MonoComInteropProxy and MonoReflectionGuidAttribute.
16088         * domain-internals.h: Expose mono_init_com_types.
16089         * icall-def.h: Add icalls for ComInteropProxy, __ComObject, and Marshal.
16090         * marshal.c: Add mutex for cominterop use. Init locals for wrapper methods.
16091         Add support for COM Callable Wrapper marshalling.
16092         * marshal.h: Add icall definitions.
16093         * gc.c: Handle freeing of CCWs in finalizer code.
16094         
16095         Code is contributed under MIT/X11 license.
16096
16097 Thu Feb 8 12:46:18 CET 2007 Paolo Molaro <lupus@ximian.com>
16098
16099         * reflection.c: changed all the signature encoding code to use
16100         a variable-sized buffer.
16101
16102 Wed Feb 7 20:37:23 CET 2007 Paolo Molaro <lupus@ximian.com>
16103
16104         * marshal.c: locking fixes: never take the loader lock
16105         or other runtime locks when holding the marshal lock
16106         (fixes bug#80664).
16107
16108 Wed Feb 7 18:49:10 CET 2007 Paolo Molaro <lupus@ximian.com>
16109
16110         * marshal.c: make the delegate function pointer mapping
16111         work for the moving GC.
16112
16113 Mon Jan 29 11:30:46 CET 2007 Paolo Molaro <lupus@ximian.com>
16114
16115         * marshal.c: fix from Robert Jordan (robertj@gmx.net)
16116         for bug #80618.
16117
16118 Fri Jan 26 12:49:23 CET 2007 Paolo Molaro <lupus@ximian.com>
16119
16120         * image.h, loader.c, metadata-internals.h: use mono-dl instead of
16121         gmodule.
16122
16123 Fri Jan 26 12:00:45 CET 2007 Paolo Molaro <lupus@ximian.com>
16124
16125         * threadpool.c: made the code moving-GC safe.
16126
16127 Thu Jan 25 20:31:41 CET 2007 Paolo Molaro <lupus@ximian.com>
16128
16129         * assembly.c, boehm-gc.c, class-internals.h, class.c,
16130         debug-mono-symfile.c, domain.c, locales.c, marshal.c, metadata.c,
16131         monitor.c, mono-debug.c, mono-debug.h, object.c, profiler.c:
16132         warning cleanup.
16133         * reflection.c: warning cleanup, some threading and moving GC fixes.
16134
16135 Thu Jan 25 16:22:36 CET 2007 Paolo Molaro <lupus@ximian.com>
16136
16137         * class.c, loader.c: create the needed Set/Get/Address array methods
16138         as well as the .ctors in mono_class_init (), fixes bug #80567.
16139
16140 2007-01-24  Zoltan Varga  <vargaz@gmail.com>
16141
16142         * class.c (mono_class_layout_fields): When force-aligning a field, make sure
16143         we doesn't decrease its alignment. Should fix the sparc build.
16144
16145 2007-01-24  Dick Porter  <dick@ximian.com>
16146
16147         * socket-io.c
16148         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
16149         Create the returned object if we need to ignore an unsupported
16150         socket option.  Fixes a segfault reported by Atsushi.
16151
16152 Tue Jan 23 18:09:21 CET 2007 Paolo Molaro <lupus@ximian.com>
16153
16154         * class.c, object.c: restrict GC-tracked fields to
16155         UIntPtr fields used inside corlib, so we provide better
16156         type info to the GC and also allow broken packing as in
16157         bug #80580.
16158
16159 Mon Jan 22 11:24:27 CET 2007 Paolo Molaro <lupus@ximian.com>
16160
16161         * sgen-gc.c: removed duplicated function.
16162
16163 2007-01-19  Miguel de Icaza  <miguel@novell.com>
16164
16165         *  socket-io.c (convert_sockopt_level_and_name): return -2 as a
16166         value that means that the value is not supported, but that we
16167         should not return a failure, but instead report this as a
16168         successful operation.
16169
16170 2007-01-19  Raja R Harinath  <rharinath@novell.com>
16171
16172         Fix tests/bug79956.2.il
16173         * class.c (mono_type_get_underlying_type): Handle genericinst enums.
16174         (mono_generic_class_get_class): If the generic definition in an
16175         enum, copy over other fields related to it.
16176
16177 Thu Jan 18 18:37:28 CET 2007 Paolo Molaro <lupus@ximian.com>
16178
16179         * metadata.h: fix MONO_TYPE_ISSTRUCT() to not consider
16180         genericinst enums (bug #79215).
16181
16182 2007-01-17  Massimiliano Mantione  <massi@ximian.com>
16183         * class.c: Fix bug 80307.
16184
16185 Wed Jan 17 17:09:20 CET 2007 Paolo Molaro <lupus@ximian.com>
16186
16187         * image.c: if the file table is not present, try to load
16188         all the modules, since we don't have info about them
16189         having or not metadata (bug #80517).
16190         * assembly.c: allow mono_assembly_load_references () to
16191         work for netmodules.
16192
16193 Wed Jan 17 14:28:30 CET 2007 Paolo Molaro <lupus@ximian.com>
16194
16195         * image.c, metadata-internals.h, object.c: execute module
16196         cctors when running on the 2 runtime if present (bug #80487).
16197
16198 Tue Jan 16 15:32:53 CET 2007 Paolo Molaro <lupus@ximian.com>
16199
16200         * icall.c: optimized InitializeArray() on bigendian.
16201
16202 Tue Jan 16 13:18:51 CET 2007 Paolo Molaro <lupus@ximian.com>
16203
16204         * icall.c: fix for the broken ARM FPA double format.
16205
16206 Tue Jan 16 12:51:16 CET 2007 Paolo Molaro <lupus@ximian.com>
16207
16208         * icall.c: handle endian issues for r4 and r8 types, too, in
16209         the InitializeArray() icall.
16210
16211 2007-01-15  Miguel de Icaza  <miguel@novell.com>
16212
16213         * loader.c (mono_loader_error_prepare_exception): Clear the error
16214         once we have extracted the information from it, do this before we
16215         call into the JIT's class loading mechanisms.
16216
16217         * object.c (mono_class_create_runtime_vtable): Do not clear the
16218         loader error before calling mono_class_get_exception_for_failure
16219         as the loader error is needed inside
16220         mono_class_get_exception_for_failure to throw the error (thinko).
16221
16222         Fixes #80521
16223         
16224 Mon Jan 15 10:27:31 CET 2007 Paolo Molaro <lupus@ximian.com>
16225
16226         * reflection.c: align fields rva data so it's faster to load at
16227         runtime.
16228
16229 2007-01-12  Raja R Harinath  <rharinath@novell.com>
16230
16231         Prepare to simplify GenericMethod handling.
16232         * class-internals.h (mono_method_get_context): New accessor function.
16233         * class.c, icall.c, loader.c, reflection.c, verify.c: Use accessor
16234         rather than directly accessing '->context' field.
16235
16236         * class-internals.h (_MonoGenericParam.method): Move ...
16237         (_MonoGenericContainer): ... here.  Add into union with klass field.
16238         * class.c, icall.c, loader.c, metadata.c, reflection.c:
16239         Update to changes.
16240
16241 Fri Jan 12 11:58:52 CET 2007 Paolo Molaro <lupus@ximian.com>
16242
16243         * Makefile.am, class-internals.h, debug-helpers.c: consolidate
16244         the wrapper type enum and reduce relocations.
16245
16246 2007-01-12  Raja R Harinath  <rharinath@novell.com>
16247
16248         * reflection.c (inflate_mono_method): Reuse method instantiation
16249         from the generic method, if available.
16250
16251 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16252
16253         * marshal.c (emit_marshal_variant): Fix conv_arg
16254         type in last commit, based on whether parameter is byref.
16255         
16256 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16257
16258         * marshal.c (emit_marshal_variant): Handle unmanaged->managed
16259         marshalling.
16260         (mono_marshal_emit_managed_wrapper): Convert byref arguments of type
16261         MONO_TYPE_OBJECT back for VARIANT support.
16262
16263 2007-01-11  Jonathan Chambers  <joncham@gmail.com>
16264
16265         * marshal.c, marshal.h, icall-def.h: Implement 
16266         Marshal.ReAllocCoTaskMem.
16267
16268 Thu Jan 11 19:00:03 CET 2007 Paolo Molaro <lupus@ximian.com>
16269
16270         * marshal.c: memory retention fixes: use the proper
16271         image cache for runtime_invoke method lookups.
16272
16273 Thu Jan 11 18:53:19 CET 2007 Paolo Molaro <lupus@ximian.com>
16274
16275         * mempool.c: added code to help debug mempool allocations.
16276
16277 2007-01-11  Dick Porter  <dick@ximian.com>
16278
16279         * socket-io.c (convert_sockopt_level_and_name): Add DontFragment
16280         support (experimenting with faking it with IP_MTU_DISCOVER for
16281         systems that don't have IP_DONTFRAGMENT.)
16282         (ves_icall_System_Net_Sockets_Socket_Disconnect_internal): New
16283         icall.
16284
16285         * icall-def.h: new System.Net.Sockets.Disconnect icall.
16286
16287         * socket-io.h: Add new fields to MonoSocketAsyncResult
16288         corresponding to the new ones in Socket.cs.
16289
16290 2007-01-11  Raja R Harinath  <rharinath@novell.com>
16291
16292         Fix IronPython regression mentioned in #80249
16293         * metadata.c (do_mono_metadata_parse_generic_class): Clear
16294         'cached_context' field, since it may have been initialized as a
16295         side-effect of metadata parsing.
16296
16297         * class-internals.h (_MonoGenericClass.is_inflated): Remove.
16298         (_MonoGenericClass.cached_class): Move here and rename from lone
16299         remaining field of ...
16300         (_MonoInflatedGenericClass): ... this.  Remove.
16301         * metadata.h, class.c, reflection.c, metadata.c, icall.c: Update
16302         to changes.
16303
16304         Fix mcs/tests/test-128.cs regression.
16305         * reflection.c (encode_cattr_value) [MONO_TYPE_SZARRAY]: Revert
16306         2007-01-10 change below.
16307         [MONO_TYPE_OBJECT]: Recurse into array case.
16308
16309 2007-01-11  Raja R Harinath  <harinath@gmail.com>
16310
16311         * class-internals.h (mono_get_inflated_generic_class): Remove.
16312         * class.c (mono_get_inflated_generic_class): Remove.
16313         (mono_generic_class_get_class): Rename from
16314         mono_class_create_generic.
16315         (mono_class_from_mono_type) [GENERICINST]: Use it.
16316         * reflection.c, metadata.c: Update to changes.  Use
16317         'mono_class_from_mono_type'.
16318
16319 Wed Jan 10 16:19:54 CET 2007 Paolo Molaro <lupus@ximian.com>
16320
16321         * reflection.c: use passed type when encoding an array element
16322         in custom attributes (patch from David Mitchell, dmitchell@logos.com).
16323
16324 2007-01-09  Robert Jordan  <robertj@gmx.net>
16325
16326         * marshal.c (mono_delegate_end_invoke): Add check for unpaired asyc
16327         result arguments (someDelegate.EndInvoke (unrelatedAres)).
16328         Fixes bug #80392.
16329
16330 2007-01-09  Raja R Harinath  <rharinath@novell.com>
16331
16332         * class-internals.h (_MonoInflatedGenericClass.is_initialized): Remove.
16333
16334         * object.c (set_value): Avoid aliasing between type->data.klass
16335         and type->data.generic_class.
16336
16337         * class.c (mono_class_create_generic): Don't use 'is_initialized' field.
16338
16339 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16340
16341         * marshal.c (mono_marshal_get_runtime_invoke): Avoid aliasing
16342         between type->data.klass and type->data.generic_class.
16343
16344 2007-01-08  Lluis Sanchez  <lluis@ximian.com>
16345
16346         * marshal.c: In MS.NET, StringBuilder objects are not copied by
16347         value in out parameters.
16348
16349 2007-01-08  Raja R Harinath  <rharinath@novell.com>
16350
16351         Simplify invariant for MonoGenericClass::klass field.
16352         * class.c (mono_class_create_generic): Verify 'klass' is null.
16353         * metadata.c (do_mono_metadata_parse_generic_class): Don't
16354         initialize 'klass' field.
16355
16356 2007-01-05  Raja R Harinath  <rharinath@novell.com>
16357
16358         Ongoing work to avoid redundant data and simplify invariants.
16359         * class-internals.h (_MonoGenericMethod.class_inst): Rename from
16360         'generic_class', and change type to a GenericInst.
16361         (_MonoGenericContext.class_inst): Likewise, rename from 'gclass'.
16362         * class.c, loader.c, metadata.c, reflection.c: Update to changes.
16363
16364 2007-01-05  Atsushi Enomoto  <atsushi@ximian.com>
16365
16366         * class.c : skip io-layer under PLATFORM_WIN32.
16367
16368 2007-01-03  Tor Lillqvist  <tml@novell.com>
16369
16370         Fix #80305: In a bundled executable, look in the bundled exe
16371         assembly to determine the runtime version. Add the possibility to
16372         bundle also the machine.config file.
16373         
16374         * assembly.c (mono_assembly_open_from_bundle): Make
16375         non-static. Allow being called even if we have no bundled
16376         assemblies, and return NULL right away in that case.
16377
16378         * domain-internals.h: Declare mono_assembly_open_from_bundle()
16379         here.
16380
16381         * domain.c (app_config_parse): Take an assembly exe file name as
16382         parameter instead of a config file name. Check for a bundled
16383         config file for that assembly by calling
16384         mono_config_string_for_assembly_file() (see below) before looking
16385         for one in the file system.
16386         (get_runtimes_from_exe): Corrsponding change to call of
16387         app_config_parse().
16388         (get_runtimes_from_exe): Check for bundled assembly exe file first
16389         by calling mono_assembly_open_from_bundle(). If no bundled
16390         assembly exe file is found, call mono_image_open() as before to
16391         look it up in the file system.
16392
16393         * mono-config.c: Add variable bundled_machinec_onfig.
16394         (mono_config_string_for_assembly_file): New function.
16395         (mono_config_for_assembly): Move code snippet that looks for a
16396         bundled assembly .config file into the above new function. Call
16397         it.
16398         (mono_register_machine_config, mono_get_machine_config): New
16399         functions to set and retrieve
16400
16401         * assembly.h: Declare mono_register_machine_config().
16402
16403         * mono-config.h: Declare mono_get_machine_config() and
16404         mono_config_string_for_assembly_file().
16405
16406         * icall.c: No declaration of environ necessary on Win32. It is
16407         declared (as a macro expanding to a function call) in stdlib.h.
16408         (ves_icall_System_Configuration_DefaultConfig_get_bundled_machine_config):
16409         New internal mono function. Returns the value of
16410         mono_get_machine_config() as a Mono string.
16411
16412         * icall-def.h: Add get_bundled_machine_config().
16413
16414 2007-01-04  Raja R Harinath  <rharinath@novell.com>
16415
16416         Remove redundant field
16417         * class-internals.h (_MonoGenericContext.container): Remove field.
16418         * loader.c (mono_method_get_signature_full): Don't parse a
16419         "container" for a signature parse when the signature is inflated
16420         immediately.
16421         (method_from_methodspec): Likewise, for a generic_inst.
16422         * class.c, metadata.c, reflection.c: Update to changes.
16423
16424 2006-01-04  Raja R Harinath  <rharinath@novell.com>
16425
16426         * class-internals.h (_MonoGenericClass): Rename 'context' field to
16427         'cached_context', and change semantics -- it starts off NULL, and
16428         is initialized on demand.
16429         * class.c (mono_generic_class_get_context): New accessor to
16430         replace 'context' field accesses.
16431         (mono_class_get_context): New helper.
16432         (*): Update to changes.
16433         * icall.c, loader.c, metadata.c, reflection.c: Update to changes.
16434
16435 2007-01-03  Miguel de Icaza  <miguel@novell.com>
16436
16437         * marshal.c (mono_string_to_byvalstr): Fix thinko, shorten len
16438         before the memcpy.   Fixes Marshal2 regression.
16439
16440 2007-01-02  Jb Evain  <jbevain@gmail.com>
16441
16442         * blob.h: add a MONO_TYPE_ENUM definition
16443         * reflection.c (load_cattr_value, create_custom_attr, create_custom_attr_data):
16444         fix the encoding of arrays of enums in custom attributes.
16445
16446         Fixes #79666.
16447
16448 2007-01-01  Miguel de Icaza  <miguel@novell.com>
16449
16450         * marshal.c (mono_string_to_byvalwstr): Fix this routine.   The
16451         string is null terminated, but only cut the string short if it
16452         overflows the buffer.   
16453         
16454         (mono_string_to_byvalstr): Also fix this routine.   The code here
16455         was not properly terminating a string (it was only terminated
16456         because of the previous catch-all memset). 
16457
16458         I left the memset, because I do not know if applications expect
16459         the runtime to clear this region. 
16460
16461         Fixes #79944.
16462
16463         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType):
16464         Clear the error before returning to unmanaged code to prevent the
16465         runtime from being confused later on (fixes  80420).
16466         (ves_icall_type_from_name): Always call mono_loader_clear_error
16467         after parsing a type that could have failed.
16468         (ves_icall_System_Reflection_Assembly_GetTypes): ditto.
16469
16470         * loader.c (mono_loader_clear_error): Fix indentation.
16471
16472 2006-12-28  Martin Baulig  <martin@ximian.com>
16473
16474         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 58.
16475
16476 Fri Dec 22 20:04:57 CET 2006 Paolo Molaro <lupus@ximian.com>
16477
16478         * reflection.c: patch from Rolf Bjarne Kvinge to fix
16479         getting a token for an EnumBuilder.
16480
16481 Fri Dec 22 19:49:07 CET 2006 Paolo Molaro <lupus@ximian.com>
16482
16483         * reflection.c: be more careful in case resource generation
16484         fails to create the data array.
16485
16486 Fri Dec 22 18:17:40 CET 2006 Paolo Molaro <lupus@ximian.com>
16487
16488         * sgen-gc.c: write barrier for clone and fix unregister handles.
16489
16490 Fri Dec 22 18:15:33 CET 2006 Paolo Molaro <lupus@ximian.com>
16491
16492         * reflection.c: some fixes needed in the generics code for the moving GC.
16493
16494 2006-12-22  Robert Jordan  <robertj@gmx.net>
16495
16496         * icall.c (ves_icall_System_Array_SetValueImpl): Take enums into
16497         account. Fixes bug #80299.
16498
16499 2006-12-21  Raja R Harinath  <rharinath@novell.com>
16500
16501         Fix WaitHandle usage in delegates.
16502         * object-internals.h (mono_wait_handle_get_HANDLE): Declare.
16503         * object.c (mono_wait_handle_new): Use the property set method to
16504         initialize the handle.
16505         (mono_wait_handle_get_handle): New.
16506         * threadpool.c (mono_async_invoke): Use it.
16507         * threads.c (ves_icall_System_Threading_WaitHandle_WaitAll_internal):
16508         Likewise.
16509         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Likewise.
16510
16511 2006-12-21  Jonathan Chambers  <joncham@gmail.com>
16512
16513         * marshal.c (emit_marshal): Call emit_marshal_variant and
16514         emit_marshal_com_interface when applicable.
16515         (emit_marshal_variant, emit_marshal_com_interface): Add
16516         methods for this case and remove if's from emit_marshal_object.
16517         
16518 Wed Dec 20 11:03:56 CET 2006 Paolo Molaro <lupus@ximian.com>
16519
16520         * filewatcher.c: updated to use the mono-dl API instead of gmodule.
16521
16522 2006-12-19  Jonathan Chambers  <joncham@gmail.com>
16523
16524         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocHGlobal,
16525         ves_icall_System_Runtime_InteropServices_Marshal_FreeHGlobal): Use GlobalAlloc
16526         and GlobalFree on Windows. Remove FIXME.
16527
16528 Tue Dec 19 16:18:16 CET 2006 Paolo Molaro <lupus@ximian.com>
16529
16530         * mono-mlist.h, mono-mlist.c, Makefile.am: linked list
16531         implementation for managed objects.
16532
16533 Tue Dec 19 14:28:03 CET 2006 Paolo Molaro <lupus@ximian.com>
16534
16535         * object.c: implemented code to be used for checking
16536         that no reference field overlaps with non-references.
16537
16538 Tue Dec 19 14:10:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16539
16540         * threadpool.c: fix queue code to be compatible with the
16541         moving GC.
16542
16543 2006-12-18  Miguel de Icaza  <miguel@novell.com>
16544
16545         * marshal.c (emit_object_to_ptr_conv): Handle null safehandles
16546         in structures by throwing ArgumentNullException.
16547
16548         (emit_marshal_safehandle): Also when they are null parameters.
16549
16550         (emit_marshal_safehandle): Add support for ref
16551         SafeHandles parameters
16552
16553 Mon Dec 18 19:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
16554
16555         * profiler.c: updated to use the mono-dl API instead of
16556         gmodule.
16557
16558 Mon Dec 18 19:02:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16559
16560         * profiler.c: updated to use the mono-dl dynamic loading
16561         API instead of gmodule.
16562
16563 Mon Dec 18 18:16:22 CET 2006 Paolo Molaro <lupus@ximian.com>
16564
16565         * profiler.c: use readlink, older versions of glib don't have
16566         g_file_read_link ().
16567
16568 Mon Dec 18 16:40:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16569
16570         * profiler.c: try to detect the path to mono if libc fails to provide
16571         a useful name (bug #80286).
16572
16573 2006-12-16  Raja R Harinath  <rharinath@novell.com>
16574
16575         Fix #80242
16576         * icall.c (ves_icall_Type_GetNestedType): If the type is a generic
16577         instance, use the generic type definition instead.
16578         (ves_icall_Type_GetNestedTypes): Likewise.
16579         * class.c (mono_class_create_generic): Always set the
16580         nested_classes of a generic instance to NULL, even if the generic
16581         type definition has nested types.
16582
16583 2006-12-15  Jonathan Chambers  <joncham@gmail.com>
16584
16585         * marshal.c (mono_string_from_bstr): Revert previous Windows change
16586         and fix on Linux.
16587         
16588 2006-12-15  Miguel de Icaza  <miguel@novell.com>
16589
16590         * marshal.c (mono_string_from_bstr): Jon Chambers pointed out that
16591         my arguments were in the wrong order.   I also fixed the Windows
16592         version which seems to have had the same issue.
16593
16594         (mono_free_bstr): On Unix, this is g_free.
16595         (mono_string_from_bstr, mono_string_to_bstr): Implement bstr
16596         conversions (for the tests in corlib to pass).
16597
16598 2006-12-14  Miguel de Icaza  <miguel@novell.com>
16599
16600         * marshal.c (emit_ptr_to_object_conv): For now, ignore
16601         MONO_MARSHAL_CONV_SAFEHANDLE on return values (we need to throw an
16602         exception if a ref SafeHandle in a struct has changed).
16603         
16604         (emit_struct_conv): Do not perform layout checks for classes
16605         derived from SafeHandle, as those are specially handled. 
16606
16607         (emit_object_to_ptr_conv): Add support for
16608         MONO_MARSHAL_CONV_SAFEHANDLE conversion. 
16609
16610         (emit_marshal_safehandle): Implement conversion of return values
16611         of safehandles (MARSHAL_ACTION_CONV_RESULT).
16612         
16613         * threads.c: WaitHandle now is compiled with two different handles
16614         "IntPtr os_handle" for 1.x and "SafeWaitHandle safe_wait_handle"
16615         for 2.0.
16616         
16617         (ves_icall_System_Threading_WaitHandle_WaitAll_internal) 
16618         (ves_icall_System_Threading_WaitHandle_WaitAny_internal): Adjust
16619         these routines to cope with both kinds of fields.
16620
16621 2006-12-12  Miguel de Icaza  <miguel@novell.com>
16622
16623         * metadata.c (mono_type_to_unmanaged): Handle the case where
16624         type->data.klass is a SafeHandle, and in that case, return the
16625         size of a pointer (MONO_NATIVE_INT) and set the conversion to be
16626         MONO_MARSHAL_CONV_SAFEHANDLE. 
16627
16628 2006-12-11  Miguel de Icaza  <miguel@novell.com>
16629
16630         * marshal.c (emit_marshal): Hook up to the MONO_TYPE_CLASS and
16631         MONO_TYPE_OBJECT cases and check for a SafeHandle here before
16632         calling emit_marshal_object.
16633
16634         (emit_marshal_safehandle): Implement marshalling of
16635         SafeHandle parameters (no ref support yet).
16636
16637         (MarshalAction): Document the defines as I implement
16638         them for SafeHandle.
16639
16640         (emit_marshal_object): indentation police.
16641
16642         * class-internals.h: Define MonoSafeHandle.
16643         Add safehandle_class to MonoDefaults type.
16644
16645         * verify.c: Add System.Runtime.InteropServices.SafeHandle to the
16646         list of classes to check for fields. 
16647
16648         * domain.c (mono_init_internal): Add SafeHandle to the list of
16649         mono_defaults loaded.
16650
16651 2006-12-15  Raja R Harinath  <rharinath@novell.com>
16652
16653         Fix #80253
16654         * reflection.c (mono_reflection_bind_generic_parameters): If the
16655         generic type definition is a type builder, ensure that it is fully
16656         initialized before instantiating it.  Kill some dead code.
16657
16658 Thu Dec 14 17:02:59 CET 2006 Paolo Molaro <lupus@ximian.com>
16659
16660         * object.c: clear the loader_error () before loading
16661         more metadata stuff (bug #80258).
16662
16663 Thu Dec 14 12:49:47 CET 2006 Paolo Molaro <lupus@ximian.com>
16664
16665         * icall.c, icall-defs.h: type modifiers icalls for
16666         parameters and properties.
16667
16668 Wed Dec 13 19:29:50 CET 2006 Paolo Molaro <lupus@ximian.com>
16669
16670         * object.c, icall.c: fixed warnings.
16671
16672 Mon Dec 11 11:03:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16673
16674         * marshal.c: fixed a couple of leaks and coding style in a few places.
16675
16676 2006-12-08  Dick Porter  <dick@ximian.com>
16677
16678         * process.c: Cope with NULL ProcessStartInfo arguments on windows
16679         too.  Patch from Jonathan Chambers <joncham@gmail.com>, fixes bug
16680         80173.
16681
16682 Thu Dec 7 15:20:31 CET 2006 Paolo Molaro <lupus@ximian.com>
16683
16684         * process.c: ProcessStartInfo may have only filename set and
16685         arguments can be NULL.
16686
16687 Tue Dec 5 19:19:34 CET 2006 Paolo Molaro <lupus@ximian.com>
16688
16689         * icall.c: fix leak found by Robert Jordan.
16690
16691 Tue Dec 5 17:53:10 CET 2006 Paolo Molaro <lupus@ximian.com>
16692
16693         * marshal.c, marshal.h: generate managed method to access an element
16694         of a multi-dimensional array.
16695
16696 2006-11-30  Paolo Molaro (lupus@ximian.com)
16697
16698         * metadata.c, marshal.c: locking fixes when writing to image->mempool.
16699
16700 Thu Nov 30 11:11:37 CET 2006 Paolo Molaro <lupus@ximian.com>
16701
16702         * icall.c: back out GetFields () fix until the serialization code is
16703         fixed to not depend on the incorrect behaviour.
16704
16705 Wed Nov 29 22:01:46 CET 2006 Paolo Molaro <lupus@ximian.com>
16706
16707         * profiler.c: provide defaults if none are set.
16708
16709 Tue Nov 28 12:54:51 CET 2006 Paolo Molaro <lupus@ximian.com>
16710
16711         * Makefile.am, attrdefs.h: new public header file with
16712         constants for attributes for use by embedders.
16713
16714 Tue Nov 28 11:44:52 CET 2006 Paolo Molaro <lupus@ximian.com>
16715
16716         * icall.c: GetFields () fix for bug #80064.
16717
16718 Tue Nov 28 10:56:01 CET 2006 Paolo Molaro <lupus@ximian.com>
16719
16720         * filewatcher.c, filewatcher.h, icall-def.h, icall.c, locales.c:
16721         removed long unused icalls.
16722
16723 2006-11-27  Jonathan Chambers  <joncham@gmail.com>
16724   
16725         * marshal.c: 
16726                 (mono_marshal_emit_managed_wrapper): Level of indirection for 
16727                 mono_marshal_get_managed_wrapper so that a wrapper for a managed method
16728                 can be generated without a delegate class.
16729                 (mono_marshal_get_managed_wrapper): Move wrapper logic to mono_marshal_emit_managed_wrapper.
16730         
16731         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16732
16733 2006-11-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16734
16735         * console-io.c: add the 'signal' call removed by mistake. Fixes bug
16736         #80069.
16737
16738 Mon Nov 27 19:29:13 CET 2006 Paolo Molaro <lupus@ximian.com>
16739
16740         * boehm-gc.c, null-gc.c, sgen-gc.c, mono-gc.h, icall.c,
16741         icall-def.h: added icalls needed by System.GC.
16742
16743 Thu Nov 23 20:01:12 CET 2006 Paolo Molaro <lupus@ximian.com>
16744
16745         * loader.c: ensure the class in catch clauses is handled
16746         correctly for generics methods (fixes bug#79980).
16747
16748 Thu Nov 23 17:31:58 CET 2006 Paolo Molaro <lupus@ximian.com>
16749
16750         * monitor.h, monitor.c: added mono_locks_dump () function
16751         to help debug deadlocks involving managed locks.
16752
16753 2006-11-13  Dick Porter  <dick@ximian.com>
16754
16755         * file-io.c (get_file_attributes): If the file is a symlink try
16756         and get the stat data for the target, but also add the
16757         FILE_ATTRIBUTE_REPARSE_POINT flag.  This is an attempt to follow
16758         the specs for the windows symlink support, but will probably have
16759         to be reworked when I have test data from a vista machine.  Fixes
16760         bug 79887.
16761
16762 2006-11-13  Dick Porter  <dick@ximian.com>
16763
16764         * gc.c (mono_domain_finalize): 
16765         * marshal.c (mono_delegate_begin_invoke): 
16766         * threadpool.c (socket_io_init, mono_thread_pool_init)
16767         (mono_thread_pool_finish): 
16768         * monitor.c (mono_monitor_try_enter_internal): 
16769         * threads.c (mono_thread_resume, mono_thread_init)
16770         (mono_thread_suspend_all_other_threads)
16771         (mono_thread_execute_interruption): 
16772         * appdomain.c (mono_domain_unload): Check for NULL error returns
16773         from CreateThread(), CreateEvent() and CreateSemaphore().  See bug
16774         75733.
16775
16776 2006-11-11  Miguel de Icaza  <miguel@novell.com>
16777
16778         * process.c
16779         (ves_icall_System_Diagnostics_Process_CreateProcess_internal):
16780         Only close the handle if the value of the handle is not
16781         INVALID_HANDLE_VALUE.  This just makes the process a bit more
16782         robust.
16783
16784         Improvement for #75733, so that we do not run into this problem. 
16785
16786         
16787         * assembly.c (check_path_env, check_extra_gac_path_env): Do not
16788         include empty directories from MONO_PATH or MONO_GAC_PREFIX in our
16789         internal variables.  Fixes #79462 
16790         
16791
16792 2006-11-09  Dick Porter  <dick@ximian.com>
16793
16794         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16795         Use poll() not select().  Fixes bug 79397.
16796
16797 2006-11-09  Raja R Harinath  <rharinath@novell.com>
16798
16799         Fix #79872
16800         * assembly.c (mono_assembly_load_from_full): Check that the given
16801         image has an assembly manifest.
16802
16803 2006-11-09  Ankit Jain  <jankit@novell.com>
16804
16805         * tabledefs.h (ASSEMBLYREF_RETARGETABLE_FLAG):
16806         (ASSEMBLYREF_ENABLEJITCOMPILE_TRACKING_FLAG):
16807         (ASSEMBLYREF_DISABLEJITCOMPILE_OPTIMIZER_FLAG): Add AssemblyRef flags.
16808
16809 2006-11-07  Dick Porter  <dick@ximian.com>
16810
16811         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16812         Put the old resolver behaviour back for pre-2.0 profiles.
16813
16814 Tue Nov 7 16:56:24 CET 2006 Paolo Molaro <lupus@ximian.com>
16815
16816         * threadpool.c: precise GC and locking fixes.
16817
16818 Tue Nov 7 11:02:42 CET 2006 Paolo Molaro <lupus@ximian.com>
16819
16820         * class.c: don't load types that have an explicit unaligned
16821         managed reference. Provide better info in the TypeLoad exception.
16822         Part of the fix for bug #79744.
16823         * object.c: use the correct check for class type load issues.
16824
16825 Mon Nov 6 17:07:43 CET 2006 Paolo Molaro <lupus@ximian.com>
16826
16827         * class.c: enforce alignment of fields with managed references
16828         even when Pack=1 is forced by the user (bug #77788).
16829
16830 2006-11-03  Dick Porter  <dick@ximian.com>
16831
16832         * socket-io.c (ves_icall_System_Net_Dns_GetHostByAddr_internal):
16833         If the address reverse lookup fails, return it as the hostname
16834         anyway.  Fixes bug 79721.
16835
16836 2006-11-03  Dick Porter  <dick@ximian.com>
16837
16838         * threads.c (ves_icall_System_Threading_Thread_SpinWait_internal):
16839         Fix build on Windows.
16840
16841 2006-11-02  Dick Porter  <dick@ximian.com>
16842
16843         * icall-def.h: 
16844         * object-internals.h: 
16845         * exception.c (mono_get_exception_thread_interrupted): 
16846         * threads.c: Implement Thread.Interrupt and Thread.SpinWait.
16847         Fixes bug 74525.
16848
16849         * monitor.c (ves_icall_System_Threading_Monitor_Monitor_wait):
16850         Check for pending Thread.Interrupt.
16851
16852 2006-10-27  Massimiliano Mantione  <massi@ximian.com>
16853         * loader.c: Fixed bug 79684.
16854
16855 2006-10-27  Dick Porter  <dick@ximian.com>
16856
16857         * file-io.c (get_file_attributes): Force symlinks to directories
16858         to be returned as a regular file.  Fixes bug 79733.
16859 2006-10-26  Dick Porter  <dick@ximian.com>
16860
16861         * file-io.c (ves_icall_System_IO_MonoIO_Open): If we're calling
16862         CreateFile to open a directory then we need to set the
16863         FILE_FLAG_BACKUP_SEMANTICS flag.  Fixes bug 75285.
16864
16865 2006-10-23  Zoltan Varga  <vargaz@gmail.com>
16866
16867         * reflection.c (mono_method_get_object): Cache the MonoMethod class and its
16868         friends.
16869
16870 Mon Oct 23 03:06:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
16871
16872         * sgengc.c: small cleanup of timer code.
16873
16874 Mon Oct 23 02:49:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
16875
16876         * sgen-gc.c: fix some warnings and start adding support for
16877         complete object removal on domain unload.
16878
16879 2006-10-22  Gert Driesen  <drieseng@users.sourceforge.net>
16880
16881         * assembly.c: build_assembly_name should not consider a version
16882         number without build or revision number invalid. Fixes bug #79715.
16883
16884 2006-10-18  Jonathan Chambers  <joncham@gmail.com>
16885
16886         * icall.c: Have ves_icall_System_Diagnostics_DefaultTraceListener_WriteWindowsDebugString
16887         call kernel32 function OutputDebugString directly.
16888         
16889         Signed-off-by: Jonathan Chambers <joncham@gmail.com>
16890         
16891 Tue Oct 17 16:59:59 CEST 2006 Paolo Molaro <lupus@ximian.com>
16892
16893         * reflection.c: small cleanup, using a function to insert a MonoString
16894         in the string heap.
16895
16896 Tue Oct 17 16:45:27 CEST 2006 Paolo Molaro <lupus@ximian.com>
16897
16898         * reflection.c: moving GC fixes.
16899
16900 Mon Oct 16 16:53:12 CEST 2006 Paolo Molaro <lupus@ximian.com>
16901
16902         * sgen-gc.c, gc-internal.h, gc.c: added API to collect and remove
16903         all the objects with finalizers belonging to an unloading appdomain.
16904
16905 Mon Oct 16 15:08:41 CEST 2006 Paolo Molaro <lupus@ximian.com>
16906
16907         * sgen-gc.c: added ability to allocate even when the nursery is fully
16908         pinned and fixed a couple of bugs.
16909
16910 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16911
16912         * threads.h: Revert the last change for now.
16913
16914         * threads.h (mono_thread_get_pending_exception): Rename this to
16915         mono_thread_get_undeniable_exception ().
16916
16917 2006-10-15  Gert Driesen  <drieseng@users.sourceforge.net>
16918
16919         * appdomain.c: Use mono_get_exception_bad_image_format2 to construct
16920         BadImageFormatException in ves_icall_System_Reflection_Assembly_LoadFrom
16921         when fname does not refer to valid assembly. This result in a more
16922         meaningful error message.
16923         * exception.c: added mono_get_exception_bad_image_format2 which 
16924         constructs a BadImageFormatException using the ctor taking a custom
16925         message and the file name. Passing in a NULL msg results in a default
16926         message.
16927         * exception.h: define mono_get_exception_bad_image_format2 function.
16928         * icall.c: in InternalGetAssemblyName, throw BadImageFormatException 
16929         when file name pointed to an invalid IL image. Use 
16930         mono_get_exception_file_not_found2 to construct FileNotFoundException,
16931         as this results in a more meaningful error message.
16932
16933 2006-10-15  Zoltan Varga  <vargaz@gmail.com>
16934
16935         * reflection.c (encode_named_val): Implement proper encoding of arrays. Fixes
16936         #79465.
16937
16938 2006-10-12  Zoltan Varga  <vargaz@gmail.com>
16939
16940         * metadata.c (mono_type_size): Change the align parameter to guint32 for
16941         consistency with the other _size functions.
16942         (mono_type_stack_size): Ditto.
16943
16944         * class.c object.c icall.c: Fix warnings caused by the above change.
16945
16946         * class.c (mono_class_get_method_from_name_flags): Fix a typo.
16947
16948         * image.c (load_metadata_ptrs): Reenable loading of modules with uncompressed metadata.
16949
16950         * metadata.c class.c loader.c: Add proper support for uncompressed metadata.
16951
16952 Wed Oct 11 17:27:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
16953
16954         * console-io.h, filewatcher.h, locales.h, marshal.h, monitor.h,
16955         process.h, rand.h, rawbuffer.h, security-manager.h, security.h,
16956         socket-io.h, string-icalls.h, sysmath.h, threadpool-internals.h,
16957         threadpool.h, threads-types.h: mark more internal functions.
16958
16959 2006-10-11  Dick Porter  <dick@ximian.com>
16960
16961         * socket-io.c (ves_icall_System_Net_Sockets_Socket_Poll_internal):
16962         Fix typo spotted by Robert Jordan in bug 79352 (though I can't
16963         reproduce the bug even before applying the fix.)
16964
16965 Tue Oct 10 15:39:39 CEST 2006 Paolo Molaro <lupus@ximian.com>
16966
16967         * reflection.c: allow retrieving attributes for arguments in generic
16968         methods (bug #79241).
16969
16970 Tue Oct 10 11:45:50 CEST 2006 Paolo Molaro <lupus@ximian.com>
16971
16972         * debug-mono-symfile.c: properly check fopen () result (found by
16973         coverity).
16974
16975 Tue Oct 10 11:30:52 CEST 2006 Paolo Molaro <lupus@ximian.com>
16976
16977         * reflection.c: make error message clearer and fixed two
16978         issuelets found by Coverity.
16979
16980 2006-10-10  Zoltan Varga  <vargaz@gmail.com>
16981
16982         * object-internals.h: Remove duplicate definition of mono_method_get_signature_full ().
16983
16984 Mon Oct 9 19:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
16985
16986         * object-internals.h, gc-internal.h, profiler-private.h:
16987         mark internal functions.
16988
16989 Mon Oct 9 19:28:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
16990
16991         * reflection.c: put data in the text section.
16992         * icall.c: recognize more types in type_from_typename ().
16993         * process.c, marshal.c: added some GC FIXMEs.
16994
16995 Mon Oct 9 19:27:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
16996
16997         * loader.c: check for NULL before initializing.
16998
16999 2006-10-09  Zoltan Varga  <vargaz@gmail.com>
17000
17001         * gc.c (finalizer_thread): Use a non-alertable wait here.
17002
17003         * class.c loader.c metadata.c: Revert the mono_metadata_decode_table_... changes,
17004         until the correct solution is found.
17005
17006 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
17007
17008         * reflection.c (mono_module_get_object): Avoid an assert when operating on
17009         modules with no metadata. Fixes #79596.
17010
17011         * image.c (load_metadata_ptrs): Put back the error message when
17012         the #- heap is encountered since the support is not complete yet.
17013
17014 Fri Oct 6 16:57:26 CEST 2006 Paolo Molaro <lupus@ximian.com>
17015
17016         * gc.c: do not allow the user to SuppressFinalize () a
17017         delegate because it would leak the trampoline if present.
17018
17019 2006-10-06  Zoltan Varga  <vargaz@gmail.com>
17020
17021         * class.c metadata.c row-indexes.h blob.h: Applied patch from Jb. Add support for the
17022         PropertyPtr table.
17023
17024 2006-10-05  Zoltan Varga  <vargaz@gmail.com>
17025
17026         * loader.c (mono_method_signature): Fix a use of MONO_TABLE_METHOD missed earlier.
17027
17028         * metadata.c (mono_metadata_get_param_attrs): Ditto.
17029
17030         * row-indexes.h: Add definitions for *Ptr tables.
17031
17032         * metadata-internals.h (MonoImage): Add an 'uncompressed_metadata' flag.
17033
17034         * metadata.c (mono_metadata_translate_token_index): New helper function to
17035         translate table indexes used in uncompressed metadata.
17036         (mono_metadata_decode_table_row): Ditto.
17037         (mono_metadata_decode_table_row_col): Ditto.
17038
17039         * metadata.c: Add table schema for *Ptr tables.
17040
17041         * class.c loader.c: Use the new helper function to access the affected metadata
17042         tables.
17043         
17044         * image.c (load_metadata_ptrs): Allow assemblies with uncompressed metadata. Fixes
17045         #38532.
17046         
17047 2006-10-04  Zoltan Varga  <vargaz@gmail.com>
17048
17049         * marshal.c (emit_object_to_ptr_conv): Avoid using short branches around IL
17050         sequences which can be unbounded in size. Fixes #79583.
17051
17052 2006-10-02  Zoltan Varga  <vargaz@gmail.com>
17053
17054         * object.c (mono_runtime_class_init): Handle a corner case in handling failure of
17055         static initialization.
17056
17057         * domain-internals.h (MonoDomain): Add a 'type_init_exception_hash' field.
17058
17059         * class-internals.h (MonoVTable): Add an 'init_failed' flag.
17060
17061         * domain.c (mono_domain_free): Free up type_init_exception_hash.
17062
17063         * object.c (mono_runtime_class_init): Implement correct semantics when a static
17064         ctor fails, i.e. throw the same exception on subsequent accesses.
17065         
17066 2006-09-0  Jonathan Chambers  <joncham@gmail.com>
17067
17068         * domain.c, class-internals.h: Added ComInteropProxy class to MonoDefaults.
17069         * marshal.c: Return correct unmanaged size for object when MarshalAs.Struct.
17070         Emit exception rather than crash in case of COM Callable Wrapper (not yet implemented).
17071         Handle marshalling of interfaces and VARIANTs contained in structs.
17072         
17073         Code is contributed under MIT/X11 license.
17074         
17075 2006-09-30  Zoltan Varga  <vargaz@gmail.com>
17076
17077         * marshal.c (emit_marshal_custom): Fix some corner cases. Fixes #79471.
17078         
17079         * marshal.c (mono_marshal_load_type_info): Allocate memory from the image
17080         mempool.
17081
17082 2006-09-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17083
17084         * console-io.c: ignore previous SIGINT handler.
17085
17086 2006-09-27  Zoltan Varga  <vargaz@gmail.com>
17087
17088         * metadata.c class.c: Applied patch from Ricardo Fernandez Pascual 
17089         (ricardo.fernandez@st.com). Add some new MonoClass and MonoType accessors. Fixes
17090         #79460, #79461, #79485.
17091
17092         * class.c (mono_class_from_name_case): Fix incorrect comments. Fixes #79504.
17093
17094         * marshal.c (mono_marshal_load_type_info): Fix a typo which caused an assert. Fixes
17095         #79217.
17096
17097 2006-09-26  Zoltan Varga  <vargaz@gmail.com>
17098
17099         * marshal.c (mono_marshal_get_delegate_invoke): Tweak the IL a little so better code
17100         could be generated from it.
17101
17102 Mon Sep 25 13:29:53 CEST 2006 Paolo Molaro <lupus@ximian.com>
17103
17104         * rand.c: fix read loop to correctly handle EINTR.
17105
17106 Mon Sep 25 11:33:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
17107
17108         * Makefile.am, icall-def.h, icall.c, verify.c: changed the way
17109         internal calls are defined to keep methods closer to the declaring
17110         type and allow a significant reduction in runtime relocations and
17111         memory usage.
17112
17113 2006-09-21 Gert Driesen  <drieseng@users.sourceforge.net>
17114
17115         * appdomain.c: Pass NULL to mono_get_exception_file_not_found2 as
17116         exception message to have FileNotFoundException use the default
17117         assembly load error message. Fixes bug #79426.
17118         * exception.c: Support NULL msg in mono_get_exception_file_not_found2.
17119
17120 2006-09-21 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17121
17122         * threadpool.c: (start_thread_or_queue) use the root domain when
17123         creating the thread instead of the async object one.
17124
17125 Thu Sep 21 19:30:04 CEST 2006 Paolo Molaro <lupus@ximian.com>
17126
17127         * class.c, object.c, class-internals.h, reflection.c:
17128         for arrays, store element_size inside MonoClass (speedup
17129         for array object creation).
17130
17131 Thu Sep 21 17:06:43 CEST 2006 Paolo Molaro <lupus@ximian.com>
17132
17133         * icall.c: fixed CodeBase to use the file name and not the module
17134         name (bug #79365).
17135
17136 Thu Sep 21 12:09:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
17137
17138         * mono-debug.c, mono-debug.h: export find_method as
17139         mono_debug_find_method ().
17140
17141 Wed Sep 20 19:59:06 CEST 2006 Paolo Molaro <lupus@ximian.com>
17142
17143         * debug-helpers.c, class-internals.h: added a few functions useful
17144         when debugging under gdb.
17145
17146 2006-09-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17147
17148         * console-io.[ch]: trigger the ConsoleCancelEvent and retrieve
17149         characters that need special handling.
17150
17151 Tue Sep 19 18:57:38 CEST 2006 Paolo Molaro <lupus@ximian.com>
17152
17153         * mono-config.c: make the os/cpu specification more flexible,
17154         allowing lists and negation.
17155
17156 2006-09-18  Jonathan Chambers  <joncham@gmail.com>
17157
17158         * marshal.c: COM Interop fixes. Handle case where method->klass.
17159         is interface. Handle BSTR/MonoString when null. Use CDECL as 
17160         calling convention on non-windows platforms. This is for
17161         compatibility with XPCOM and MainWin COM.
17162         
17163         Code is contributed under MIT/X11 license.
17164         
17165
17166 2006-09-18  Zoltan Varga  <vargaz@gmail.com>
17167
17168         * marshal.c (mono_marshal_load_type_info): Handle concurrent and recursive calls
17169         correctly. Fixes #79217.
17170
17171         * class-internals.h (MonoClass): Remove unused marshal_info_init_pending field.
17172
17173 Mon Sep 18 16:59:54 CEST 2006 Paolo Molaro <lupus@ximian.com>
17174
17175         * mono-config.c: allow both an os and cpu attribute for dllmap
17176         and dllentry elemnets to enable a single config file to be used
17177         for multiple architectures.
17178
17179 2006-09-18  Gert Driesen  <drieseng@users.sourceforge.net>
17180
17181         * loader.c: MonoLoaderError was cleared too soon on load failure.
17182         Fixes bug #79424.
17183
17184 Mon Sep 18 15:37:13 CEST 2006 Paolo Molaro <lupus@ximian.com>
17185
17186         * icall.c: use the defining class vtable when accessing a
17187         static field, not a pobblibly derived class.
17188
17189 2006-09-17  Zoltan Varga  <vargaz@gmail.com>
17190
17191         * icall.c string-icalls.c: Remove references to unicode.h.
17192
17193         * unicode.h unicode.c Makefile.am: Remove these unused source files.
17194
17195         * NOTES: Moved to ../../docs and renamed to thread-safety.txt.
17196
17197         * marshal.c (mono_marshal_emit_native_wrapper): Add an 'image' argument, 
17198         indicating the image where custom marshaller types should be looked up.
17199         (mono_ftnptr_to_delegate): Use the image of the delegate type to look up
17200         custom marshallers, instead of corlib. Fixes #79425.
17201
17202 2006-09-14  Zoltan Varga  <vargaz@gmail.com>
17203
17204         * marshal.c (emit_marshal_object): Fix marshalling of blittable classes and null.
17205
17206 2006-09-14  Jonathan Chambers  <joncham@gmail.com>
17207
17208         * environment.c (ves_icall_System_Environment_get_ProcessorCount): 
17209         Implement Environment.ProcessorCount.
17210         
17211         * environment.h (ves_icall_System_Environment_get_ProcessorCount): 
17212         Implement Environment.ProcessorCount.
17213         
17214         * icall.c: 
17215         Add Environment.ProcessorCount icall.
17216         
17217         Patch by Jason McFall.
17218
17219 2006-09-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17220
17221         * assembly.c: don't append .exe/.dll when the filename already contains
17222         one of those extensions.
17223
17224 2006-09-12  Martin Baulig  <martin@ximian.com>
17225
17226         * class.c (mono_bounded_array_class_get): Also add `IList<object>'
17227         to array interfaces.
17228
17229 2006-09-11  Martin Baulig  <martin@ximian.com>
17230
17231         * reflection.c (mono_image_build_metadata): Create the
17232         MethodImpl's after emitting all types and methods, so we don't
17233         need another fixup pass for them.
17234
17235 2006-09-11  Zoltan Varga  <vargaz@gmail.com>
17236
17237         * class.c (mono_class_from_name_case): Fix regression introduced by the last
17238         change.
17239
17240 Mon Sep 11 12:57:15 CEST 2006 Paolo Molaro <lupus@ximian.com>
17241
17242         * gc-internal.h, appdomain.c, gc.c: force-destroy GC handles on domain
17243         unload.
17244
17245 2006-09-10  Zoltan Varga  <vargaz@gmail.com>
17246
17247         * object.c (mono_method_return_message_restore): Avoid a crash if one of the out
17248         args is not set. Fixes #78926.
17249
17250 2006-09-08  Zoltan Varga  <vargaz@gmail.com>
17251
17252         * class.c (mono_class_init): Init class->no_special_static_fields from the cached info.
17253
17254         * image.c (load_class_names): Move this to class.c, and rename it to 
17255         'mono_image_init_name_cache'.
17256         (load_modules): Fix a warning.
17257
17258         * class.c icall.c image.c: Initialize image->name_cache lazily.
17259
17260         * class-internals.h (MonoGetClassFromName): New hook function to find a class based
17261         on its name using information in the AOT file.
17262
17263         * class.c (mono_class_from_name): Use the new hook function.
17264
17265 2006-09-06  Zoltan Varga  <vargaz@gmail.com>
17266
17267         * reflection.c (mono_param_get_objects): Handle enum default parameter values
17268         correctly.
17269
17270         * marshal.c (emit_marshal_object): Implement [In, Out] byval marshalling of classes.
17271         Fixes #79289.
17272         
17273 2006-09-06  Martin Baulig  <martin@ximian.com>
17274
17275         * icall.c (mono_lookup_internal_call): Small fix.
17276
17277 2006-09-05  Raja R Harinath  <rharinath@novell.com>
17278
17279         * debug-mono-symfile.c (mono_debug_open_mono_symbols): Remove
17280         double g_free.
17281
17282 2006-09-04  Sebastien Pouliot  <sebastien@ximian.com>
17283
17284         * debug-mono-symfile.c: Fix *some* memory leaks that happens only 
17285         when --debug is specified.
17286
17287 2006-09-04  Zoltan Varga  <vargaz@gmail.com>
17288
17289         * class.c (setup_generic_array_ifaces): Fix a warning.
17290
17291 2006-09-04  Miguel de Icaza  <miguel@novell.com>
17292
17293         * Temporarily remove the patch to assemly.c that checks the
17294         assembly versions as it breaks our gacutil.
17295
17296 2006-09-03  Zoltan Varga  <vargaz@gmail.com>
17297
17298         * metadata.c (mono_metadata_parse_mh_full): Fix an invalid free.
17299
17300         * assembly.c (mono_assembly_load_from_full): Avoid loading net 2.0 assemblies into
17301         a net 1.0 runtime.
17302
17303         * marshal.c (mono_string_builder_to_utf8): Fix marshalling of StringBuilders
17304         created using the default ctor. Fixes #79152.
17305         (mono_string_builder_to_utf16): Ditto.
17306
17307 2006-09-01  Martin Baulig  <martin@ximian.com>
17308
17309         Fix handling of the generic array interfaces.
17310
17311         * class-internals.h
17312         (MonoDefaults): Removed `generic_array_class' and added
17313         `generic_ilist' class.
17314
17315         * class.c
17316         (mono_bounded_array_class_get): Add the new generic array interfaces.
17317         (setup_generic_array_ifaces): New static method; create vtable
17318         entries for each method in the generic array interfaces.
17319
17320         * metadata.c
17321         (select_container): Allow "parent-less" generic methods.
17322
17323         * marshal.c
17324         (mono_marshal_get_generic_array_helper): New public method.
17325
17326         * icall.c
17327         (ves_icall_System_Array_InternalArray_GetGenericValueImpl):
17328         Renamed into ves_icall_System_Array_GetGenericValueImpl() and
17329         moved the interncall into System.Array.
17330
17331 2006-09-01  Raja R Harinath  <rharinath@novell.com>
17332
17333         A few more cases of avoiding work on types with ->byref set.
17334         Has the real fix for #79238
17335         * icall.c (is_generic_parameter): New helper.
17336         (ves_icall_Type_GetGenericParameterPosition): Use it.
17337         (ves_icall_Type_GetGenericParameterAttributes): Likewise.
17338         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
17339         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
17340         (ves_icall_Type_GetGenericTypeDefinition_impl): Return NULL on
17341         reference types.
17342         (ves_icall_Type_get_IsGenericTypeDefinition): Return FALSE on
17343         reference types.
17344         (ves_icall_Type_get_IsGenericInstance): Likewise.
17345         (ves_icall_Type_get_IsGenericType): Likewise.
17346
17347 2006-09-01  Zoltan Varga  <vargaz@gmail.com>
17348
17349         * class.c (mono_class_setup_vtable_general): Share identical vtables with the parent
17350         class if possible.
17351
17352         * mempool.h (mono_mempool_get_allocated): New helper function.
17353
17354         * object.c (mono_class_create_runtime_vtable): Fix problem introduced by last
17355         change.
17356
17357         * mempool.c: Fix warnings and the calculation of stats.
17358
17359         * object.c (mono_class_create_runtime_vtable): Fix the AOT optimization.
17360
17361         * class.c (mono_class_setup_vtable): Update generic_vtable_count stat.
17362
17363         * loader.c (mono_get_method_from_token): Update method_count stat.
17364
17365         * class-internals.h (MonoStats): Add some stats.
17366
17367 2006-08-31 Robert Jordan  <robertj@gmx.net>
17368
17369         * icall.c: Replace the PtrToStringAuto, StringToHGlobalAuto icalls
17370         with managed variants.
17371         All code is contributed under the MIT/X11 license.
17372         
17373 2006-08-31  Zoltan Varga  <vargaz@gmail.com>
17374
17375         * reflection.c (reflection_methodbuilder_to_mono_method): Set 
17376         method->skip_visibility based up the skipVisibility parameter of DynamicMethods.
17377
17378         * class-internals.h (MonoMethod): Add a 'skip_visibility' field.
17379
17380         * marshal.c (mono_marshal_load_type_info): Revert the last change as it can't cope
17381         with cycles in classes.
17382
17383         * icall.c (ves_icall_MonoType_get_Name): Add a '&' for byref types. Fixes #79110.
17384
17385         * marshal.c (emit_marshal_array): Avoid crash when a parameter with type array is 
17386         missing a [MarshalAs] directive. Fixes #79203.
17387
17388         * marshal.c (mono_marshal_load_type_info): Fix a race in initializing 
17389         klass->marshal_info. Fixes #79217.
17390
17391 2006-08-30  Martin Baulig  <martin@ximian.com>
17392
17393         Committing a patch from Joachim Ante <joe@otee.dk>:
17394         Add support for binary data symbol stores.
17395
17396         * debug-mono-symfile.c
17397         (mono_debug_open_mono_symbol_file): Renamed into
17398         mono_debug_open_mono_symbols() and added `raw_contents' and `size'
17399         arguments.
17400
17401         * mono-debug.c
17402         (mono_debug_open_image): Added `raw_contents' and `size' args.
17403         (mono_debug_init_2_memory): New public function.
17404
17405 Fri Aug 25 18:25:23 CEST 2006 Paolo Molaro <lupus@ximian.com>
17406
17407         * icall.c: handle TypedReference in GetTypeCode (bug #79150).
17408
17409 2006-08-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17410
17411         * appdomain.c: implement support for ShadowCopyFiles.
17412
17413 2006-08-22  Sebastien Pouliot  <sebastien@ximian.com>
17414
17415         * string-icalls.c: Add shortcut in ves_icall_System_String_ctor_charp
17416         when value is NULL (and should remove CID #51).
17417
17418 2006-08-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17419
17420         * image.c: moved 2 functions to ../utils.
17421
17422 Tue Aug 22 15:53:29 CEST 2006 Paolo Molaro <lupus@ximian.com>
17423
17424         * gc.c: cope with the target object of a GC handle being NULL
17425         (bug #78877).
17426
17427 Tue Aug 22 11:10:33 CEST 2006 Paolo Molaro <lupus@ximian.com>
17428
17429         * class.c: recursively check parent's explicit implementations
17430         of interface methods (fixes bug #79125).
17431
17432 2006-08-19  Miguel de Icaza  <miguel@novell.com>
17433
17434         * filewatcher.c: Avoid warnings when building, do not redefine
17435         constants that are defined.
17436
17437         Remove warnings.
17438
17439 2006-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17440
17441         * image.c: don't fail when the link points to an absolute path.
17442
17443 2006-08-18  Sebastien Pouliot  <sebastien@ximian.com>
17444
17445         * decimal.c: Remove dead code (unrequired check) in mono_decimalIncr.
17446         Fix CID #3.
17447
17448 2006-08-17  Miguel de Icaza  <miguel@novell.com>
17449
17450         * image.c (full_path): A new method used to obtain the actual path
17451         of an assembly even in the presence of symbolic links.  
17452
17453         This is necessary for the case where we are running a binary that
17454         has been GACed, but we are using the "published" path name
17455         ($prefix/mono/1.0/blah.exe) which happens to point to the real
17456         file in the GAC.
17457
17458         This was the source of the failure for the `xsp' command with the
17459         recent AppDomain changes, as far as the runtime was concerned,
17460         there were two different assemblies: $prefix/mono/1.0/blah.exe and
17461         $prefix/mono/gac/blah/version/blah.exe.
17462
17463         (do_mono_image_open): use full path
17464
17465 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17466
17467         * object.c (mono_class_create_runtime_vtable): Add a FIXME.
17468
17469 2006-08-17  Sebastien Pouliot  <sebastien@ximian.com>
17470
17471         * marshal.c: Fix mono_marshal_check_domain_image if an invalid 
17472         domain_id is supplied. Fix CID #241 and corlib's unit tests.
17473
17474 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17475
17476         * class.c (mono_class_layout_fields): Set min_align to a bigger value for
17477         small structures. Fixes #78990.
17478
17479 2006-08-17  Zoltan Varga  <vargaz@gmail.com>
17480
17481         * marshal.c (mono_marshal_get_xappdomain_invoke): Use the new helper functions here.
17482
17483         * appdomain.c (ves_icall_System_AppDomain_createDomain): Fix a warning.
17484
17485 2006-08-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17486
17487         * appdomain.c:
17488         * marshal.c: don't load all the assemblies from a domain into newly
17489         created ones. The new domains might have different rules and load
17490         assemblies from different locations. Fixes bug #76757.
17491
17492         Patch by Lluis. Conflicts resolved by Brian Crowell.
17493
17494 2006-08-16  Alp Toker  <alp@atoker.com>
17495
17496         * socket-io.c: First half of the fix for #79084.
17497         Set sa_size to the length of the content, not that of the struct.
17498         Don't add NULL suffix to the content, this should be done in
17499         managed code if needed.
17500
17501 2006-08-14  Raja R Harinath  <rharinath@novell.com>
17502
17503         Fix part of #79012
17504         * metadata.c (do_mono_metadata_parse_generic_class): Don't SEGV if
17505         mono_metadata_parse_type returns NULL.
17506
17507 2006-08-13  Atsushi Enomoto  <atsushi@ximian.com>
17508
17509         * normalization-tables.h : new file for string normalization data.
17510         * locales.c, locales.h, icall.c :
17511           added load_normalization_resource() for string normalization,
17512           and icall as well.
17513         * Makefile.am : added normalization-tables.h to the sources.
17514
17515 2006-08-13  Zoltan Varga  <vargaz@gmail.com>
17516
17517         * marshal.c: Add more helper functions to reduce code duplication and use them
17518         everywhere.
17519
17520 2006-08-12  Zoltan Varga  <vargaz@gmail.com>
17521
17522         * marshal.c: Fix non-x86 stdcall warnings.
17523         
17524         * marshal.c marshal.h: Add some helper functions to emit/patch branches, and use 
17525         them everywhere.
17526
17527 2006-08-11  Jonathan Chambers  <joncham@gmail.com>
17528
17529         * class.c (mono_bounded_array_class_get): Fix if statement that caused incorrect
17530         type check on multi-dimensional arrays. Fixes #79000.
17531
17532 2006-08-10  Jonathan Chambers  <joncham@gmail.com>
17533
17534         * class.c (mono_class_setup_parent): setup is_com_object during class initialization.
17535         * object.c (mono_remote_class_vtable/mono_object_new_specific): Changed checks
17536         to use is_com_object instead of MONO_CLASS_IS_IMPORT() macro.
17537         * class-internals.h: add is_com_object to class structure.
17538         * marshal.c: Fixed marshalling for IDispatch and IUnknown, added
17539         null checks to COM object marshalling. Fix .ctor call on RCW.
17540         * icall.c: Added icall implementation for MonoType.IsCOMObjectImpl.
17541         
17542         All code is contributed under the MIT/X11 license.
17543
17544 2006-08-09  Dick Porter  <dick@ximian.com>
17545
17546         * monitor.c (mono_monitor_cleanup): mono_monitor_cleanup() is
17547         racing mono_monitor_allocator_lock() somewhere, so don't delete
17548         the critical section for now.  Found by running and exiting
17549         monodevelop.
17550
17551 2006-08-10  Zoltan Varga  <vargaz@gmail.com>
17552
17553         * marshal.c (cominterop_get_native_wrapper): Fix a warning.
17554         (ves_icall_System_ComObject_FindInterface): Ditto.
17555         (ves_icall_System_ComObject_CacheInterface): Ditto.
17556
17557         * metadata.c (do_mono_metadata_type_equal): Applied patch from Roberto Costa
17558         (roberto.costa@st.com). Add support for MONO_TYPE_FNPTR.
17559
17560 2006-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17561
17562         * threadpool.c: treat pipes from process asynchronous reads as sockets
17563         when reading from them, so we get select/poll or epoll to wait for
17564         data.
17565
17566 2006-08-07  Sebastien Pouliot  <sebatien@ximian.com>
17567
17568         * loader.c: Fix a typo (CID #233) in the null check.
17569
17570 2006-08-07  Zoltan Varga  <vargaz@gmail.com>
17571
17572         * appdomain.c (mono_domain_unload): Close the thread handle of the unload thread.
17573         Hopefully fixes #78949.
17574         
17575         * metadata.c (mono_metadata_parse_method_signature_full): Applied patch from 
17576         Roberto Costa (roberto.costa@st.com). Handle vararg signatures without SENTINEL
17577         bytes. Fixes #78972.
17578
17579 2006-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17580
17581         * filewatcher.c: we need to set errno here.
17582
17583 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17584
17585         * filewatcher.c: let Win32Exception get the error value.
17586
17587 2006-08-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17588
17589         * filewatcher.c: translate errno into win32 errors for Win32Exception
17590         to know what happened.
17591
17592 2006-08-01  Zoltan Varga  <vargaz@gmail.com>
17593
17594         * threadpool.c: Fix more warnings.
17595
17596         * assembly.c (search_loaded): Fix warnings.
17597
17598         * threadpool.c (mono_thread_pool_finish): Fix warnings.
17599         (mono_async_invoke): Ditto.
17600
17601 2006-07-28  Jonathan Chambers  <joncham@gmail.com>
17602
17603         * object.c (mono_remote_class_vtable): Need to create proxy vtable
17604         entries for __ComObject type in addition to ComImport types.
17605         * marshal.c: Added support for marshalling COM RCWs. Fixed warning
17606         about hash table.
17607         
17608         All code is contributed under the MIT/X11 license.
17609
17610 Fri Jul 28 19:04:34 CEST 2006 Paolo Molaro <lupus@ximian.com>
17611
17612         * image.c: avoid tentative loading of modulerefs that contain
17613         no metadata (P/Invoke library names).
17614
17615 2006-07-28  Dick Porter  <dick@ximian.com>
17616
17617         * loader.c (mono_loader_cleanup): mono_loader_cleanup() is racing
17618         mono_loader_lock() somewhere, so don't delete the critical section
17619         for now.  Found by running and exiting monodevelop.
17620
17621 2006-07-26 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17622
17623         * filewatcher.c: define the inotify syscalls when we're building on
17624         linux and have sys/syscall.h. The build system might not have support
17625         for inotify but the target system might have it.
17626
17627 2006-07-26  Miguel de Icaza  <miguel@novell.com>
17628
17629         * domain.c: Documentation updates.
17630
17631         * loader.c (mono_free_method): Do not release the method
17632         information if we are being profiled, as profilers will use this
17633         information at shut down to present some data to the user.
17634
17635         This is needed so that the profiler does not crash, as the
17636         profiler tends to keep MonoMethods around, and they might become
17637         invalid if we free these.
17638
17639         (mono_get_method_constrained): Return the original CIL stream
17640         method as well, so verification can be performed against it.
17641
17642 2006-07-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17643
17644         * filewatcher.[ch]: support for inotify file system watcher.
17645         * icall.c: add new internal calls for the inotify file system watcher.
17646
17647 2006-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17648
17649         * threadpool.c: Windows also misbehaves on async. connects. Fixes bug
17650         #78888.
17651
17652 2006-07-20  Dick Porter  <dick@ximian.com>
17653
17654         * file-io.c (ves_icall_System_IO_MonoIO_Seek): Fix signed/unsigned
17655         warning.
17656
17657 2006-07-20  Dick Porter  <dick@ximian.com>
17658
17659         * threads.c (start_wrapper): Do the thread cleanup while we still
17660         hold a reference to its object.  Fixes bug 78123.
17661
17662 2006-07-18  KornĂ©l Pál  <kornelpal@gmail.com>
17663
17664         * class-internals.h: Added MONO_WRAPPER_MANAGED_TO_MANAGED wrapper type.
17665         * debug-helpers.c: Map MONO_WRAPPER_MANAGED_TO_MANAGED to
17666           "managed-to-managed".
17667         * icall.c: Redirect string constructors that take sbyte* to
17668           ves_icall_System_String_ctor_RedirectToCreateString.
17669         * marshal.c: Redirect ves_icall_System_String_ctor_RedirectToCreateString
17670           to CreateString () methods with matching signature.
17671         * reflection.c: Use original security informations for
17672           MONO_WRAPPER_MANAGED_TO_MANAGED.
17673         * security-manager.c: Use original security informations for
17674           MONO_WRAPPER_MANAGED_TO_MANAGED.
17675         * string-icalls.c: Added ves_icall_System_String_ctor_RedirectToCreateString
17676           that is a placeholder and only its address should be used.
17677         * string-icalls.h: Added ves_icall_System_String_ctor_RedirectToCreateString
17678           that is a placeholder and only its address should be used.
17679
17680 2006-07-15  Jonathan Chambers  <joncham@gmail.com>
17681
17682         Begin implementing COM Interop.
17683         * appdomain.c: Increment corlib version.
17684         * class.c: Set ComImport classes' parent to __ComObject.
17685         * loader.c: Mark cominterop methods as such.
17686         * domain.c: Add __ComObject class to MonoDefaults structure.
17687         * image.c: Add 2 hashtables to the image for COM Interop related methods
17688         * metadata.c: Added mono_metadata_type_dup_mp to duplicate a type
17689         using the mempool allocator
17690         
17691         * metadata-internals.h: Add 2 hashtables to the image for COM Interop related methods
17692         * metadata.h: Added cominterop field to _MonoMethodSignature struct and
17693         declaration for mono_metadata_type_dup_mp.
17694         
17695         * debug-helpers.c: Added strings for two additional wrapper types
17696         * object.c: Create proxy objects for ComImport classes
17697         * class-internals.h: Define 2 new method wrapper types, COM Interop remoting target,
17698         and added __ComObject class to MonoDefaults structure.
17699         
17700         * object-internals.h: Finish MonoRealProxy definition, and add definition of
17701         MonoComInteropProxy and MonoComObject.
17702         
17703         * marshal.c: Added support for COM Interop
17704         (signature_cominterop): Converts managed signature to corresponding
17705         unmanaged COM signature.
17706         (cominterop_get_function_pointer): gets unmanaged function pointer via
17707         COM object vtable
17708         (cominterop_get_com_slot_for_method): returns vtable slot in COM interface of method
17709         (cominterop_get_method_interface): returns interface type that method is defined on
17710         (mono_mb_emit_cominterop_call): emits native call to function pointer
17711         gotten from vtable
17712         (cominterop_get_native_wrapper_adjusted): actual wrapper around unmanaged COM call
17713         that matches signature of unmanaged function.
17714         (cominterop_get_native_wrapper): wrapper around adjusted method call.
17715         (cominterop_get_invoke): forwards call from proxy to __ComObject
17716         (ves_icall_System_Runtime_InteropServices_Marshal_AddRef): Implements Marshal.AddRef 
17717         (ves_icall_System_Runtime_InteropServices_Marshal_QueryInterface): Implements Marshal.QueryInterface 
17718         (ves_icall_System_Runtime_InteropServices_Marshal_Release): Implements Marshal.Release 
17719         
17720         * marshal.h: Added Marshal icall declarations.
17721         * icall.c: Added __ComObject icalls. Need to store interfaces in unmanaged code
17722         so we can access them in finalizer
17723         
17724 2006-07-14  Dick Porter  <dick@ximian.com>
17725
17726         * object.c (mono_type_initialization_cleanup): Fix a race
17727         condition by temporarily commenting out the critical section
17728         deletion.
17729
17730 2006-07-14  Zoltan Varga  <vargaz@gmail.com>
17731
17732         * reflection.c (create_custom_attr): Fix some warnings.
17733         (create_custom_attr_data): Ditto.
17734         (typebuilder_setup_properties): Save custom attrs for properties in dynamic
17735         types. Fixes #78855.
17736
17737 2006-07-11  Zoltan Varga  <vargaz@gmail.com>
17738
17739         * class.c (mono_type_get_name_recurse): Fix the name of 1 dimensional non-szarrays.
17740
17741         * reflection.c (mono_custom_attrs_free): Fix freeing of dynamic cattr info.
17742
17743 2006-07-08  Zoltan Varga  <vargaz@gmail.com>
17744
17745         * reflection.c (resolve_object): Add support for DynamicMethod.
17746
17747         * domain.c appdomain.c threads.c monitor.c object.c gc.c: Applied patch from
17748         Joachim Ante (joe@otee.dk). Fix some shutdown leaks.
17749
17750 2006-07-06  Sebastien Pouliot  <sebastien@ximian.com>
17751
17752         * process.c: In ves_icall_System_Diagnostics_Process_GetModules_internal 
17753         don't leak GPtrArray's pdata has we have no use (nor free) for it.
17754
17755 2006-07-01  Zoltan Varga  <vargaz@gmail.com>
17756
17757         * marshal.c (mono_marshal_get_runtime_invoke): Fix passing of generic valuetypes.
17758         Fixes #77888.
17759
17760 2006-06-30  Raja R Harinath  <rharinath@novell.com>
17761
17762         * icall.c (ves_icall_MonoMethod_get_base_definition): Simplify
17763         slightly: remove a shadow local variable.
17764
17765 2006-06-29  Raja R Harinath  <rharinath@novell.com>
17766
17767         * icall.c (ves_icall_MonoMethod_get_base_definition): Return the
17768         definition that introduces the virtual function slot.
17769         Also fix Coverity #105.
17770
17771 2006-06-29  Zoltan Varga  <vargaz@gmail.com>
17772
17773         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Fix support
17774         for dynamic assemblies. Fixes #78724.
17775
17776 2006-06-28  Zoltan Varga  <vargaz@gmail.com>
17777
17778         * marshal.c (mono_string_to_byvalwstr): Fix this completely broken function.
17779         Fixes #78722.
17780
17781 2006-06-21  Martin Baulig  <martin@ximian.com>
17782
17783         * reflection.c
17784         (method_encode_clauses): Don't assert on `ex_info->handlers' here;
17785         fixes #76484.
17786
17787 2006-06-21  Zoltan Varga  <vargaz@gmail.com>
17788
17789         * object.h (mono_array_setref): Cast value to (MonoObject*) to fix warnings.
17790
17791 2006-06-20  Raja R Harinath  <rharinath@novell.com>
17792
17793         Make 'mono_class_get_full' only inflate TYPESPECs, not TYPEDEFs
17794         nor TYPEREFs.
17795         * class.c (mono_class_create_from_typespec): Add 'context' argument.
17796         Inflate result if necessary.
17797         (mono_class_get_full): Remove old version.  Rename from
17798         'mono_class_get' and add 'context' argument.  Pass it to
17799         ..._create_from_typespec.
17800         (mono_class_get): New.  Simple wrapper to mono_class_get_full.
17801         (mono_ldtoken): Revert change below.
17802
17803 2006-06-20  Martin Baulig  <martin@ximian.com>
17804
17805         * class.c (mono_ldtoken): Don't pass the generic context to
17806         mono_class_get_full() for MONO_TOKEN_TYPE_DEF/REF.  Fixes #78053.
17807
17808 2006-06-15  Zoltan Varga  <vargaz@gmail.com>
17809
17810         * marshal.c (mono_ftnptr_to_delegate): Avoid allocating signature from mempool
17811         and later freeing it. Fixes #78638.
17812
17813 2006-06-15  Miguel de Icaza  <miguel@novell.com>
17814
17815         * icall.c (mono_class_get_throw): Revert over-zealous error
17816         throwing, the caller for mono_class_get_throw will cope with
17817         errors when classes are not properly initialized already.
17818
17819         The code still copes with loader exceptions though.
17820
17821         Fixes the regression in reftype1 and reftype3 from the CAS tests.
17822         
17823 2006-06-14  Miguel de Icaza  <miguel@novell.com>
17824
17825         Fixes the `make run1' version of RuntimeAbort (to be commited,
17826         source is in Bugzilla).
17827         
17828         * metadata.c (mono_metadata_interfaces_from_typedef_full): Return
17829         FALSE on class loading failure instead of returning true.
17830
17831         * class.c (mono_class_create_from_typedef): It is possible for
17832         mono_metadata_interfaces_from_typedef_full to fail if a class is
17833         not found, cope with this.
17834         
17835
17836 2006-06-14  Dick Porter  <dick@ximian.com>
17837
17838         * socket-io.c: 
17839         * process.c: Fix a bunch of signed/unsigned warnings from gcc
17840         4.1.1
17841
17842 2006-06-12  Atsushi Enomoto  <atsushi@ximian.com>
17843
17844         * culture-info-table.h : oops, forgot to make it nsync with r61548.
17845
17846 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17847
17848         * icall.c: Another fix for building mono in Visual Studio.
17849
17850 2006-06-09  Jonathan Chambers  <jonathan.chambers@ansys.com>
17851
17852         * marshal.c icall.c: Minor fixes for building mono in Visual Studio.
17853         
17854 2006-06-09  Martin Baulig  <martin@ximian.com>
17855
17856         * debug-mono-symfile.c: Put this back and really fix it this
17857         time. Sorry for all the trouble.
17858
17859 2006-06-08  Zoltan Varga  <vargaz@gmail.com>
17860
17861         * icall.c (mono_class_get_throw): Fix a warning.
17862         (ves_icall_System_Reflection_Assembly_GetTypes): Allways throw 
17863         ReflectionTypeLoadException if needed. Fixes #78606.
17864
17865         * class.c (mono_class_setup_vtable_general): Handle loader errors a bit better.
17866         (mono_class_init): Ditto.
17867
17868         * loader.c (mono_loader_set_error_assembly_load): Display a separate warning for
17869         ref_only exceptions.
17870         (mono_loader_clear_error): Make this work even if there is no error.
17871
17872 2006-06-08  Jonathan Chambers  <jonathan.chambers@ansys.com>
17873
17874         * object-internals.h marshal.c marshal.h icall.c: Implement method 
17875         Marshal.GetComSlotForMethodInfo using internal call.
17876
17877 2006-06-07  Zoltan Varga  <vargaz@gmail.com>
17878
17879         * class-internals.h: Add a new kind of loader error LOADER_ERROR_ASSEMBLY plus
17880         a function for signalling it.
17881
17882         * class.c (mono_class_from_typeref): Use the new kind of loader error when
17883         a referenced assembly is not found.
17884
17885         * loader.c (mono_loader_error_prepare_exception): Add support for 
17886         LOADER_ERROR_ASSEMBLY. Fix formatting.
17887
17888 2006-06-05  Jonathan Chambers  <jonathan.chambers@ansys.com>
17889
17890         * domain.c appdomain.c class-internals.h marshal.c: Add support 
17891         for VARIANT marshalling on windows and increment corlib version
17892         since Variant struct was added.
17893
17894 2006-06-03  Miguel de Icaza  <miguel@novell.com>
17895
17896         * debug-mono-symfile.c: Revert Martin's previous patch which broke
17897         stack trace line information:
17898
17899         (Martin) (mono_debug_symfile_lookup_location): Fix the algorithm:
17900         (Martin) when looking up B which is between A and C, return A not C.
17901
17902         Bug is #78573.
17903
17904         Thanks to Alexander Olk for tracking this down.
17905
17906 2006-06-02  Zoltan Varga  <vargaz@gmail.com>
17907
17908         * marshal.c (mono_marshal_set_last_error_windows): Fix build.
17909         
17910         * marshal.c (mono_marshal_emit_native_wrapper): Call GetLastError () early and without a wrapper to
17911         avoid clobbering its value.
17912         (mono_string_to_lpstr): Fix a warning on windows.
17913
17914 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17915
17916         * class-internals.h (MonoClass): Removed obsolete 'dummy' flag.
17917
17918         * reflection.c loader.c: Removed references to 'dummy' flag.
17919
17920         * loader.c (mono_loader_error_prepare_exception): Fix a warning.
17921
17922         * threadpool.c: Make ASyncCall a copy of the managed MonoAsyncCall class so
17923         it gets GC tracking.
17924
17925         * object-internals.h (MonoAsyncResult): Add an 'object_data' field which has
17926         GC tracking.
17927         
17928         * object.c (mono_async_result_new): Add an additional parameter 'object_data'.
17929
17930         * marshal.c threadpool.c: Update callers of mono_async_result_new.
17931
17932         * appdomain.c: Bump corlib version.
17933
17934 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17935
17936         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17937         CEE_STIND_REF when working with object references.
17938
17939 2006-05-31  Zoltan Varga  <vargaz@gmail.com>
17940
17941         * class.c (mono_class_setup_fields): Call mono_class_init () for class->parent.
17942         Fixes #78539.
17943
17944 2006-05-30  Miguel de Icaza  <miguel@novell.com>
17945
17946         * loader.c (method_from_memberref): Fix argument value for
17947         mono_loader_set_error_method_load (I was passing the MonoClass
17948         instead of the class name char *).
17949
17950 2006-05-30  Zoltan Varga  <vargaz@gmail.com>
17951
17952         * marshal.c: Use mono_mb_emit_stloc in more places. Use CEE_LDIND_REF and
17953         CEE_STIND_REF when working with object references.
17954
17955 2006-05-30  Martin Baulig  <martin@ximian.com>
17956
17957         * mono-debug.c (mono_debug_print_stack_frame): Reverted the
17958         mono_method_full_name() change and replace the ':' with a '.'
17959         here.
17960
17961 2006-05-30  Martin Baulig  <martin@ximian.com>
17962
17963         * debug-mono-symfile.c
17964         (mono_debug_symfile_lookup_location): Fix the algorithm:
17965         when looking up B which is between A and C, return A not C.
17966
17967 2006-05-29  Martin Baulig  <martin@ximian.com>
17968
17969         * mono-debug.h
17970         (MonoDebugMethodInfo): Make the typedef public.
17971         (MonoDebugSourceLocation): New public struct.
17972
17973         * mono-debug.c
17974         (mono_debug_source_location_from_address): Removed.
17975         (mono_debug_source_location_from_il_offset): Removed.
17976         (mono_debug_il_offset_from_address): Removed.
17977         (mono_debug_address_from_il_offset): Removed.
17978         (mono_debug_lookup_method): New public function.
17979         (mono_debug_lookup_source_location): New public function; replaces
17980         the old mono_debug_source_location_from_*() functions; see the
17981         inline documentation.
17982         (mono_debug_free_source_location): New public function.
17983         (mono_debug_print_stack_frame): New public function; see the
17984         inline documentation.
17985
17986         * debug-mono-symfile.c
17987         (mono_debug_find_source_location): Renamed into
17988         mono_debug_symfile_lookup_location(); only take a
17989         `MonoDebugMethodInfo *' and an `offset' argument; added inline
17990         documentation.
17991         (mono_debug_find_method): Renamed into
17992         mono_debug_symfile_lookup_method().
17993
17994 2006-05-27  Zoltan Varga  <vargaz@gmail.com>
17995
17996         * assembly.c (mono_assembly_open_full): Dont overwrite the status
17997         returned by mono_image_open_full ().
17998
17999         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Convert
18000         MONO_IMAGE_IMAGE_INVALID into a BadImageFormatException. Fixes
18001         #78517.
18002
18003         * object.c (compute_class_bitmap): Use class->class_size for static fields. Fixes
18004         #78518.
18005
18006 2006-05-27  Miguel de Icaza  <miguel@novell.com>
18007
18008         * class.c (mono_class_from_typeref): handle missing images
18009         earlier, deals with bug #78418.   Refactor code; 
18010
18011         Fix a warning introduced in my previous commit (some stale code
18012         from before I revisited my patch).
18013
18014         * class.c (mono_class_create_from_typedef): On failure, remove the
18015         class from the MonoImage->class_cache as the class is not
18016         initialized;   Fixes the leak pointed out by Paolo.
18017
18018 2006-05-25  Dick Porter  <dick@ximian.com>
18019
18020         * threads.c (mono_thread_cleanup): Build fix.  Comment out the
18021         DeleteCriticalSections until I figure out which one may still be
18022         sometimes locked when mono_thread_cleanup is called.
18023
18024 2006-05-24  Dick Porter  <dick@ximian.com>
18025
18026         * threads.c (mono_thread_cleanup): Move the threading cleanup out
18027         of mono_thread_manage and back into its own function, so it can be
18028         called after the finalizer thread has finished.
18029
18030         * appdomain.c (mono_runtime_cleanup): Call mono_thread_cleanup
18031
18032 2006-05-24  Zoltan Varga  <vargaz@gmail.com>
18033
18034         * assembly.c (mono_assembly_open_full): Fix typo introduced by a previous change.
18035         Fixes #78495.
18036
18037         * marshal.c (emit_ptr_to_object_conv): Implement marshalling of byval arrays
18038         with non-blittable elements.
18039         (emit_object_to_ptr_conv): Ditto. Fixes #78492.
18040
18041 2006-05-24  Martin Baulig  <martin@ximian.com>
18042
18043         * mono-debug-debugger.h (MonoDebuggerEvent): Added
18044         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE'.    
18045
18046         * mono-debug-debugger.c (mono_debugger_cleanup): Send a
18047         `MONO_DEBUGGER_EVENT_FINALIZE_MANAGED_CODE' and then set
18048         `mono_debugger_event_handler' to NULL.
18049
18050 2006-05-24  Martin Baulig  <martin@ximian.com>
18051
18052         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 57.
18053
18054 2006-05-24  Martin Baulig  <martin@ximian.com>
18055
18056         * mono-debug-debugger.h
18057         (mono_debugger_create_notification_function): Added
18058         `MonoCodeManager *' argument.
18059
18060 Tue May 23 16:05:47 CEST 2006 Paolo Molaro <lupus@ximian.com>
18061
18062         * boehm-gc.c, null-gc.c: fix compilation on 64 bit systems.
18063
18064 Tue May 23 13:44:11 CEST 2006 Paolo Molaro <lupus@ximian.com>
18065
18066         * Makefile.am, gc-internal.h, reflection.c: updates for the new GC.
18067         * sgen.-gc.c, sgen-gc.h: simple generational compacting GC
18068         implementation.
18069
18070 Tue May 23 13:40:30 CEST 2006 Paolo Molaro <lupus@ximian.com>
18071
18072         * icall.c: precise GC support: objects can't be stored in unmanaged
18073         memory anymore, even if they are kept alive by other references: since
18074         they can move the GC needs to be able to always find them.
18075
18076 Tue May 23 12:57:08 CEST 2006 Paolo Molaro <lupus@ximian.com>
18077
18078         * object.c: precise GC support for static fields. Support
18079         for moving GCs: write barriers and pinned allocation for interned
18080         strings.
18081
18082 Tue May 23 12:41:44 CEST 2006 Paolo Molaro <lupus@ximian.com>
18083
18084         * domain.c, domain-internals.h: precise GC support for the MonoDomain
18085         structure.
18086
18087 Tue May 23 12:38:56 CEST 2006 Paolo Molaro <lupus@ximian.com>
18088
18089         * class.c, gc.c: sgen and precise GC updates.
18090
18091 Tue May 23 12:33:24 CEST 2006 Paolo Molaro <lupus@ximian.com>
18092
18093         * marshal.h, marshal.c: added write barrier wrapper and precise type
18094         fixes.
18095
18096 Tue May 23 12:31:22 CEST 2006 Paolo Molaro <lupus@ximian.com>
18097
18098         * object.h, null-gc.c, boehm-gc.c: more write barrier functions and
18099         support.
18100
18101 Tue May 23 12:27:14 CEST 2006 Paolo Molaro <lupus@ximian.com>
18102
18103         * reflection.c: precise and sgen GC updates.
18104
18105 Tue May 23 12:21:46 CEST 2006 Paolo Molaro <lupus@ximian.com>
18106
18107         * debug-helpers.c, class-internals.h: added write barrier wrapper type.
18108
18109 2006-05-22  Zoltan Varga  <vargaz@gmail.com>
18110
18111         * threads.c (start_wrapper): Fix a missed guint32 tid declaration.
18112
18113 2006-05-20  Zoltan Varga  <vargaz@gmail.com>
18114
18115         * reflection.c (encode_cattr_value): Fix yet another bug in the encoding of
18116         MONO_TYPE_OBJECT. Fixes #78462.
18117
18118 2006-05-18  Zoltan Varga  <vargaz@gmail.com>
18119
18120         * marshal.c (emit_marshal_vtype): Add support for UnmanagedType.LPStruct 
18121         and blittable types.
18122
18123 2006-05-17  Miguel de Icaza  <miguel@novell.com>
18124
18125         * class.c (mono_class_get_exception_for_failure): Implement parts
18126         of a TODO: if the loader error is set (instead of the class
18127         error), we return a Loader exception that can be properly thrown
18128         elsewhere.
18129
18130         This was exposed by some Winforms 2.0 code that I tried to run
18131         (Atsushi pointed me to it).
18132
18133 2006-05-17  Zoltan Varga  <vargaz@gmail.com>
18134
18135         * marshal.c (mono_marshal_emit_native_wrapper): Make the marshalling code more
18136         uniform by moving stuff from this function to the proper emit_marshal_XXX functions.
18137         
18138         * marshal.c (emit_marshal_vtype): Add limited support for 
18139         UnmanagedType.LPStruct. Fixes #78427.
18140
18141         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure): 
18142         Applied a patch from kangaroo to fix #77523.
18143
18144 2006-05-17  Martin Baulig  <martin@ximian.com>
18145
18146         * threads.c
18147         (debugger_thread_vtable): Moved into ../mini/debug-debugger.c.
18148         (debugger_thread_created): Removed.
18149         (debugger_thread_exited): Removed.
18150
18151 2006-05-15  Zoltan Varga  <vargaz@gmail.com>
18152
18153         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
18154
18155         * object-internals.h (MonoReflectionResource): Sync with managed version.
18156
18157 2006-05-12  Wade Berrier <wberrier@novell.com>
18158
18159         * threads.c: Define G_GSIZE_FORMAT for systems with glib < 2.6
18160
18161 2006-05-12  Zoltan Varga  <vargaz@gmail.com>
18162
18163         * class.c (mono_fnptr_class_get): Set class->image to corlib for now, since other
18164         functions try to allocate from the image mempool.
18165
18166 2006-05-12  Dick Porter  <dick@ximian.com>
18167
18168         * threads.c (mono_thread_attach): Fix usage of GetCurrentThread().
18169
18170 2006-05-12  Lluis Sanchez  <lluis@ximian.com>
18171
18172         * object.c: The FieldGetter and FieldSetter methods require the full
18173         name of the class, not only the name. Fixes bug #78277.
18174
18175 2006-05-11  Miguel de Icaza  <miguel@novell.com>
18176
18177         * loader.c (method_from_memberref): Do not pass the NULL klass to
18178         mono_loader_set_error_() methods.  Pass the non-NULL value
18179         (class). 
18180
18181 2006-05-11  Zoltan Varga  <vargaz@gmail.com>
18182
18183         * assembly.c (mono_assembly_load_from_full): Fix a bunch of warnings.
18184         (mono_assembly_close): Null out assembly->image->references after freeing it.
18185
18186         * image.c (mono_image_close): Free image->references.
18187         
18188         * reflection.c (mono_image_basic_init): Fix a small memory leak.
18189
18190 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
18191
18192         * marshal.c: In function mono_mb_add_local don't use the mb pointer 
18193         before checking if it's NULL (g_assert).
18194
18195 2006-05-10  Martin Baulig  <martin@ximian.com>
18196
18197         * metadata.c (mono_type_size): Kill the g_assert() in MONO_TYPE_GENERICINST;
18198         I thought I already killed that two months ago, but now it somehow reappeared.
18199
18200 2006-05-10  Martin Baulig  <martin@ximian.com>
18201
18202         * mono-debug.c (mono_debug_add_method): Allow instantiated generic methods.
18203
18204 2006-05-10  Zoltan Varga  <vargaz@gmail.com>
18205
18206         * reflection.c: Allocate memory for dynamically created methods in the image
18207         mempools.
18208
18209 2006-05-10  Sebastien Pouliot  <sebastien@ximian.com>
18210
18211         * appdomain.c: In ves_icall_System_AppDomain_[Get|Set]Data functions, 
18212         don't use the ad pointer before checking if it's NULL (g_assert).
18213
18214 2006-05-09  Zoltan Varga  <vargaz@gmail.com>
18215
18216         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Remove
18217         a redundant (and incorrect) addref. Hopefully fixes sn.exe on windows.
18218
18219         * marshal.c: Allocate all signatures from mempools.
18220
18221         * marshal.c: Allocate some more signatures from mempools.
18222
18223 2006-05-09  Miguel de Icaza  <miguel@novell.com>
18224
18225         * object.c (mono_load_remote_field): The code used to provide a
18226         temporary variable for returning results if the user did not
18227         provide a result pointer.  But our temporary variable was allocted
18228         on the satck.
18229
18230         Fix calling code to always pass a result area.   Coverity ID 103.
18231
18232 2006-05-06  Zoltan Varga  <vargaz@gmail.com>
18233
18234         * threads.c (ves_icall_System_Threading_Interlocked_Add_Int): Return the new
18235         value, not the old. Fixes #78312.
18236         (ves_icall_System_Threading_Interlocked_Add_Long): Ditto.
18237
18238         * class.c (mono_bounded_array_class_get): Allocate data from the image mempool.
18239         (mono_ptr_class_get): Ditto. Also change the cache from a global one to a 
18240         per-image cache.
18241
18242         * assembly.c (mono_assembly_close): Free image->references.
18243
18244         * assembly.c (mono_assembly_names_equal): Fix a warning.
18245         (mono_assemblies_cleanup): Cleanup more global data.
18246
18247         * metadata-internals.h (MonoImage): Add 'ptr_cache'.
18248
18249         * image.c (mono_image_close): Free up the contents of 'array_cache', free up
18250         ptr_cache and image->modules.
18251
18252         * image.c (mono_image_init): Allocate array_cache lazily.
18253         
18254 2006-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18255
18256         * assembly.c: use GetCurrentThreadId for the hash, as GetCurrentThread
18257         behavior was changed recently and has bad side effects.
18258
18259 2006-05-05  Zoltan Varga  <vargaz@gmail.com>
18260
18261         * assembly.c (mono_assembly_open_full): Add a missing mono_image_close ().
18262         
18263         * assembly.c (mono_assembly_close): Remove a debug printf.
18264
18265         * profiler.c (create_profiler): Use mono_aligned_addr_hash.
18266
18267         * metadata-internals.h image.c assembly.c: Change the reference counting scheme
18268         to also allow for temporary references between mono_image_open ()/close ().
18269
18270         * domain.c (get_runtimes_from_exe): Add a FIXME.        
18271
18272 2006-05-04  Zoltan Varga  <vargaz@gmail.com>
18273
18274         * marshal.c: Fix support for dynamic methods.
18275
18276         * appdomain.c (mono_runtime_cleanup): Call mono_marshal_cleanup ().
18277
18278         * marshal.c (mono_marshal_cleanup): New cleanup function.
18279
18280         * marshal.c: Rewrite the wrapper code to allocate most of its memory from the 
18281         image mempools.
18282
18283         * class.c (mono_class_init): Fix leaking class->nested_classes.
18284
18285         * metadata-internals.h (MonoImage): Add a couple of new wrapper caches.
18286
18287         * image.c (mono_image_init): Initialize the new cashes.
18288
18289         * image.c (mono_image_close): Destroy the new cashes.
18290
18291         * marshal.c: Get rid of most of the static caches in favor of per-image caches.
18292
18293         * mempool.c (mono_mempool_strdup): New helper function.
18294
18295         * class-internals.h: Add prototype for mono_loader_unlock ().
18296
18297         * domain.c (mono_jit_info_table_find): Fix a warning.
18298         (mono_debugger_check_runtime_version): Ditto.
18299
18300         * rawbuffer.h rawbuffer.c metadata-internals.h metadata.c class-internals.h 
18301         class.c loader.c image.h image.c assembly.h assembly.c: Add init () and cleanup ()
18302         functions to these modules.
18303
18304         * domain-internals.h domain (mono_cleanup): New internal method to cleanup most
18305         metadata modules.
18306         
18307         * marshal.c (mono_free_bstr): Fix a warning.
18308
18309         * assembly.c (mono_assembly_open_full): Fix another small leak.
18310
18311         * object.c: Fix some unload leaks in the remoting code.
18312
18313         * object-internals.h object-internal.c (mono_string_to_utf8_mp): New helper
18314         function.
18315
18316         * assembly.c (mono_assembly_close): Fix a leak when unloading dynamic assemblies.
18317
18318         * reflection.c: Fix some unload leaks in dynamic assemblies.
18319
18320 2006-05-02  Jonathan Chambers  <jonathan.chambers@ansys.com>
18321
18322         * marshal.c: Add BSTR support on Win32 (all changes under MIT X11)
18323         * marshal.h: Add BSTR support on Win32
18324         * icall.c: Add BSTR icalls
18325         * metadata.h: Add BSTR enums
18326
18327 2006-04-28  Miguel de Icaza  <miguel@novell.com>
18328
18329         Work to catch the crash from #76795 and turn it into an
18330         exception.   As I stubbed out pieces of the VisualBasic support,
18331         I found a number of places where the code was failing and I added
18332         checks to those places. 
18333         
18334         * metadata.c (do_mono_metadata_parse_generic_class): Make this
18335         function return a status code.  If we fail to parse the signature
18336         from mono_metadata_parse_generic_inst, return FALSE.
18337
18338         * loader.c (mono_get_method_from_token): If we fail to load the
18339         method (mono_class_get) return NULL.   
18340
18341         * (method_from_memberref): Return NULL if we are unable to parse
18342         the method signature
18343
18344         (mono_loader_error_prepare_exception): Since we now use the
18345         loader_error flag internally to stop processing, and obtaining
18346         exceptions that might be thrown will walk this code path the
18347         proper way of going from a MonoLoaderError into a
18348         MonoException was convoluted.   This new routine encapsulates the
18349         process of turning the error into an exception and *clearing* the
18350         error afterwards.
18351         
18352 2006-04-27  Miguel de Icaza  <miguel@novell.com>
18353
18354         Work to catch the crashes from 75075 (cope in Assembly.GetTypes
18355         with missing assemblies), and to cope with:
18356
18357                 * Missing fieldref from a non-existing assembly.
18358                 * Missing methodref from a non-existing assembly.
18359
18360         The first batch of work to address *some* of the issues from 76661.
18361         
18362         * object.c (mono_class_create_runtime_vtable): If we fail to
18363         initialize the class raise the exception here. 
18364
18365         * metadata.c (mono_class_get_overrides_full): If any methods fail
18366         to load return the failure to the caller.
18367
18368         * assembly.c: Use REFERENCE_MISSING instead of (gpointer) -1 for
18369         flagging assemblies that failed to load.   
18370
18371         Do not crash if we are unable to load the assembly.
18372
18373         (mono_assembly_close): Do nothing with REFERENCE_MISSING
18374         assemblies. 
18375
18376         * loader.c (mono_loader_set_error_type_load): Change the
18377         convention to always pass unallocated strings, so we make our own
18378         copies (I know our own code had duplicated strings before, but
18379         this keeps the normal conventions).
18380         (method_from_memberref): Call mono_loader_set_error_method_load
18381         for all possible failures of loading the class. 
18382         Remove assert, turn into a loader error.
18383
18384         (mono_loader_error_to_exception): Move this routine from mini
18385         (mini_loader_error_to_exception) there was no need to have that in
18386         mini. 
18387
18388         * class.c (mono_class_from_typeref): If we were not able to load
18389         the assembly with mono_assembly_load_reference, call the
18390         mono_loader_set_error_type_load to register the problem.
18391
18392         (mono_class_setup_fields): If we fail to load the type from
18393         mono_metadata_parse_type_full, call mono_class_set_failure and
18394         break from the loop.
18395
18396         If class->exception_type is set, we do not layout the fields as
18397         that might crash the runtime, and instead return (from breaking
18398         from the previous loop).
18399
18400         (mono_class_setup_vtable): This now returns a boolean indicating
18401         whether the table was properly setup.   The decision is driven by
18402         mono_class_get_overrides_full which might run into non-existing
18403         methods. 
18404         
18405         (mono_class_init): Returns TRUE on success or FALSE if there was a
18406         problem in loading the type (incorrect assemblies, missing
18407         assemblies, methods, etc).
18408
18409         When we call mono_class_setup_fields we also check for a potential
18410         error inside this call (either a class exception or a general
18411         loader exception).
18412
18413         (mono_class_create_from_typedef): If the parent fails to load
18414         (calling mono_class_get_full) return NULL.
18415         
18416         ** Important **
18417
18418         calls to mono_metadata_parse_type_full should be checked
18419         everywhere and set the mono_class_set_failure
18420         (MONO_EXCEPTION_TYPE_LOAD) if we are not able to get the type.
18421
18422         The current patch checks the places where my manually constructed
18423         tests show the errors are showing up, but we should do it
18424         everywhere. 
18425
18426         ** Important2 **
18427
18428         mono_class_init return values should be tested everywhere, like
18429         the previous case this is something that we should audit
18430         everywhere and not only on the cases exposed by the tests I
18431         created. 
18432
18433 2006-04-26  Miguel de Icaza  <miguel@novell.com>
18434
18435         * file-io.c (ves_icall_System_IO_MonoIO_Open): Remove `async'
18436         boolean parameter and instead pass the information on `options'
18437         parameter (FileOptions).
18438
18439         * icall.c: Register the new signature for MonoIO.Open.
18440
18441         * debug-helpers.c (dis_one): Trying to understand how coverity
18442         works.  Fix Run 5, item 78.
18443
18444 2006-04-26  Dick Porter  <dick@ximian.com>
18445
18446         * socket-io.c (hostent_to_IPHostEntry2): Explicitly check for NULL
18447         dereference.
18448
18449 2006-04-25  Martin Baulig  <martin@ximian.com>
18450
18451         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 56.
18452
18453         * threads.c (mono_thread_attach): Set `thread->stack_ptr' and call
18454         debugger_thread_created().
18455         (debugger_gc_push_all_stacks): Don't handle the main thread in any
18456         special way.
18457         (mono_debugger_init_threads): Removed the `main_thread_stack' arg.
18458         (mono_debugger_finalize_threads): New function; undo the effects
18459         of mono_debugger_init_threads().
18460         (mono_debugger_create_all_threads): Removed.
18461
18462 2006-04-24  Zoltan Varga  <vargaz@gmail.com>
18463
18464         * image.c (mono_image_close): Tidy up trace messages.
18465
18466         * assembly.c (mono_assembly_close): Ditto.
18467
18468         * assembly.c (mono_assembly_close): Clear out image->assembly so the image
18469         no longer references an already freed assembly. Fixes #78168.
18470
18471 2006-04-21  Dick Porter  <dick@ximian.com>
18472
18473         * threads.c (mono_thread_detach): Fix reference counting when
18474         detaching threads.
18475
18476 2006-04-21  Zoltan Varga  <vargaz@gmail.com>
18477
18478         * icall.c (ves_icall_System_Enum_ToObject): Improve exception messages. Fixes
18479         #78155.
18480
18481 2006-04-19  Zoltan Varga  <vargaz@gmail.com>
18482
18483         * marshal.c (mono_type_to_ldind): New helper function moved here from mini.c
18484         (mono_type_to_stind): Ditto.
18485
18486         * marshal.c: Use the new helper functions to simplify code.
18487
18488         * image.c (mono_image_close): Add some code for help debug assembly unloading
18489         problems.
18490
18491         * metadata.c (mono_metadata_parse_type_full): Allocate MonoType's from the
18492         image mempool.
18493
18494         * assembly.c (mono_assembly_open_full): Invoke the load hook when the
18495         assembly was already loaded in another appdomain. Fixes #78083.
18496
18497 2006-04-13  Zoltan Varga  <vargaz@gmail.com>
18498
18499         * assembly.c (mono_assembly_load_reference): Increase the refcount of the
18500         referenced assemblies.
18501         (mono_assembly_close): Decrease the refcount of the referenced assemblies.
18502
18503         * domain.c (mono_domain_free): Add a trace message.
18504
18505         * appdomain.c (add_assemblies_to_domain): Ditto.        
18506
18507         * metadata-internals.h: (_MonoAssembly): Modify the meaning of the ref_count
18508         field.  
18509
18510 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18511
18512         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): Fix image reference counting.
18513
18514 2006-04-12  Martin Baulig  <martin@ximian.com>
18515
18516         * threads.c: Use `MONO_DEBUGGER_SUPPORTED' as the conditional, not
18517         `USE_INCLUDED_LIBGC'.   
18518
18519 2006-04-12  Zoltan Varga  <vargaz@gmail.com>
18520
18521         * image.c (canonicalize_path): Avoid calling strncpy on overlapping strings if
18522         the patch contains ../ and a small directory name later. Hopefully fixes
18523         #78035.
18524
18525 2006-04-10  Martin Baulig  <martin@ximian.com>
18526
18527         Clean up the debugger's thread-handling code.
18528
18529         The debugger's thread-handling code has been moved from
18530         ../mini/debug-debugger.c to threads.c.  We now iterate directly
18531         over the `threads' hash, keep track of exiting threads and also
18532         use proper locking.
18533
18534         We can now debug XSP and XSP based applications with the debugger.
18535
18536         * object-internals.h (MonoThread): Added `gpointer end_stack'.
18537
18538         * threads.h
18539         (MonoThreadCallbacks): Removed; this was only used by the debugger.
18540         (mono_install_thread_callbacks): Likewise.      
18541
18542         * threads.c (mono_thread_callbacks): Removed.
18543         (debugger_thread_created, debugger_thread_exited): New static functions.
18544         (start_wrapper): Call debugger_thread_created().
18545         (thread_cleanup): Call debugger_thread_exited().
18546         (mono_gc_stop_world, mono_gc_start_world): Removed; this was never used.
18547         (mono_debugger_init_threads): New public function.
18548         (debugger_thread_vtable): Moved here from debug-debugger.c; we now
18549         iterate directly over the `threads' hash and also use proper locking.
18550
18551         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped to 55.
18552
18553         * mono-debug-debugger.h
18554         (MonoDebuggerEvent): Added MONO_DEBUGGER_EVENT_THREAD_EXITED.
18555
18556 2006-04-10  Zoltan Varga  <vargaz@gmail.com>
18557
18558         * reflection.c (encode_cattr_value): Fix handling of parameter type=object, 
18559         argument type=array. Fixes #78057.
18560
18561 2006-04-10  Atsushi Enomoto  <atsushi@ximian.com>
18562
18563         * culture-info-table.h : regenerated. Fixed bug #69652.
18564
18565 2006-04-07  Zoltan Varga  <vargaz@gmail.com>
18566
18567         * loader.c metadata.c: Reapply a variant r59116.
18568         
18569         * loader.c metadata.c: Revert r59116 to see if it fixes the breakage.
18570
18571         * class.c (mono_class_setup_interface_offsets): New internal function.
18572
18573         * reflection.c (ensure_runtime_vtable): Setup interface offsets for dynamic
18574         interfaces too. Fixes #77398.
18575
18576         * reflection.c (encode_cattr_value): Add support for 
18577         parameter type=object, argument type=array.
18578         (load_cattr_value): Ditto. Fixes #77916.
18579
18580         * marshal.c (emit_object_to_ptr_conv): Add support for ARRAY_BYVALCHARARRAY.
18581         (emit_ptr_to_object_conv): Ditto. Fixes #77960.
18582
18583         * metadata.c (mono_type_to_unmanaged): Use ARRAY_BYVALCHARARRAY when converting
18584         a byval char array and CharSet is Ansi.
18585
18586         * metadata.h: Add new marshalling conversion ARRAY_BYVALCHARARRAY.
18587
18588 2006-04-06  Zoltan Varga  <vargaz@gmail.com>
18589
18590         * metadata.c: Add some locking comments.
18591         
18592         * metadata.c (mono_metadata_signature_alloc): Allocate signatures in the image
18593         mempool.
18594         (mono_metadata_free_method_signature): Don't free the signature itself.
18595
18596         * loader.c (mono_free_method): Don't free the signature in non-dynamic methods. 
18597
18598         * assembly.c (mono_assembly_open_full): Avoid the situation where two assemblies
18599         reference the same MonoImage.
18600         (mono_assembly_load_from_full): Add an assert.
18601
18602 2006-04-05  Zoltan Varga  <vargaz@gmail.com>
18603
18604         * image.c (mono_image_close): Don't put the image we are about to free into the
18605         loaded_images_guid_hash.
18606
18607         * marshal.c (mono_mb_emit_ptr): Refactor a common code sequence into this function
18608         to reduce code duplication.
18609
18610         * marshal.c: Register the native functions called by this module as icalls, to
18611         somewhat centralize the creation of MonoMethodSignature's.
18612
18613         * loader.c (mono_method_signature): Add a cache for method signatures.
18614
18615         * metadata.c (mono_metadata_get_param_attrs): New helper function to return
18616         the parameter attributes of a method.
18617         (mono_metadata_parse_method_signature_full): Refactored the computation of
18618         parameter attributes into a separate function. Also avoid one allocation in
18619         most cases.
18620
18621         * assembly.c (mono_assembly_close): Ditto.
18622
18623         * image.c (mono_image_close): Log trace messages with INFO level.
18624
18625         * metadata-internals.h (MonoImage): Add a new 'method_signature' cache.
18626
18627         * image.c reflection.c: Correct reference counting of image modules.
18628         
18629         * metadata.c (mono_metadata_interfaces_from_typedef_full): Allocate the result
18630         of this function from the image mempool.
18631         
18632         (mono_metadata_parse_type_full): Remove the mode != MONO_PARSE_PARAM restriction
18633         to allow more cached types to be used.
18634
18635         * mono-debug.c (mono_debug_add_method): Appled patch from
18636         David S. Miller  <davem@sunset.davemloft.net>: Access 
18637         minfo->lexical_blocks[] entry elements using read32().
18638
18639 2006-04-04  Zoltan Varga  <vargaz@gmail.com>
18640
18641         * loader.c (mono_free_method): No longer free the method header for non-dynamic
18642         methods as it is allocated from the mempool.
18643
18644         * metadata.c (mono_metadata_parse_mh_full): Allocate method headers from the
18645         image mempool.
18646
18647         * metadata-internals.h: Add comments describing the reference counting scheme
18648         used for MonoImage and MonoAssembly.
18649
18650         * image.c assembly.c reflection.c: Rework reference counting of images and 
18651         assemblies so they are freed when the runtime is shut down. Free some 
18652         additional memory structures when an image is unloaded.
18653         
18654 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
18655
18656         * class.c loader.c reflection.c: Allocate more data structures in
18657         the image mempool.
18658
18659 2006-03-31  Miguel de Icaza  <miguel@novell.com>
18660
18661         * icall.c
18662         (ves_icall_System_Environment_InternalSetEnvironmentVariable): Fix
18663         build on pre glib 2.4 systems.
18664
18665 2006-03-31  Zoltan Varga  <vargaz@gmail.com>
18666
18667         * icall.c (ves_icall_System_Environment_InternalSetEnvironmentVariable): New icall.
18668
18669         * icall.c: Fix some warnings.
18670
18671 2006-03-29  Atsushi Enomoto  <atsushi@ximian.com>
18672
18673         * culture-info-table.h : regenerated.
18674
18675 Wed Mar 29 18:24:42 CEST 2006 Paolo Molaro <lupus@ximian.com>
18676
18677         * threads.c, object-internals.h, verify.c: changed the culture caching
18678         code to use a normal MonoArray for storage so the GC can keep track of
18679         them easily. Fixed bits of the cache logic, too and simplified the
18680         code.
18681
18682 Wed Mar 29 17:18:16 CEST 2006 Paolo Molaro <lupus@ximian.com>
18683
18684         * gc-internal.h, null-gc.c, boehm-gc.c, gc.c: enable the finalizer
18685         thread for non-Boehm GCs.
18686
18687 Wed Mar 29 17:10:05 CEST 2006 Paolo Molaro <lupus@ximian.com>
18688
18689         * domain.c, object.c, domain-internals.h: reduce the amount of memory
18690         needed to keep track of the data for static fields.
18691
18692 2006-03-29  Raja R Harinath  <rharinath@novell.com>
18693
18694         Fix #75172
18695         * icall.c (ves_icall_Type_GetMethodsByName): Don't use vtable_size
18696         for interface classes.  Use 'num_methods' instead.
18697         (ves_icall_Type_GetPropertiesByName): Likewise.  Setup vtable
18698         before using '->vtable_size' field.
18699
18700 Wed Mar 29 12:53:28 CEST 2006 Paolo Molaro <lupus@ximian.com>
18701
18702         * domain.c, object.c, domain-internals.h: proxy_vtable_hash
18703         doesn't contain managed pointers, so use a normal hashtable.
18704
18705 Mon Mar 27 11:15:00 CEST 2006 Paolo Molaro <lupus@ximian.com>
18706
18707         * reflection.c, class-internals.h, domain.c: fixed handling of types
18708         used as values for objects in custom attributes (bug #77915):
18709
18710 2006-03-24  Martin Baulig  <martin@ximian.com>
18711
18712         * class.c (mono_class_setup_fields): Added support for generic
18713         instances; fixes #77580.
18714
18715 2006-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18716
18717         * assembly.c: publickeytoken is case insensitive. Fixes bug #77898.
18718
18719 2006-03-24  Dick Porter  <dick@ximian.com>
18720
18721         * file-io.c (get_file_attributes): More stat macro breakage.
18722         Fixes bug 77759.
18723
18724 Fri Mar 24 15:26:00 CET 2006 Paolo Molaro <lupus@ximian.com>
18725
18726         * profiler.c: added the file=filename option in the default profiler
18727         to output the profile data to filename.
18728
18729 2006-03-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18730
18731         * icall.c: CodeBase returns '/' instead of '\\' on windows. Fixes
18732         bug #77877.
18733
18734 2006-03-22  Martin Baulig  <martin@ximian.com>
18735
18736         * reflection.c (fieldbuilder_to_mono_class_field): Don't store the
18737         allocated `MonoClassField *' in `fb->handle'.
18738
18739 Tue Mar 21 17:19:37 CET 2006 Paolo Molaro <lupus@ximian.com>
18740
18741         * class.c, image.c, metadata-internals.h: implemented new mechanism to
18742         allocate interface ID to save memory and allow better ID reuse on
18743         appdomain unload. setup_generic_vtable () removal from Martin.
18744
18745 Tue Mar 21 15:54:30 CET 2006 Paolo Molaro <lupus@ximian.com>
18746
18747         * object.h, appdomain.c, domain.c, exception.c, icall.c,
18748         locales.c, marshal.c, object.c, reflection.c, threadpool.c,
18749         threads.c: introduced MONO_OBJECT_SETREF() macro to be able to insert
18750         write barriers for reference stores with managed objects accessed with
18751         C structures in the runtime and in embedding programs.
18752
18753 2006-03-20  Raja R Harinath  <rharinath@novell.com>
18754
18755         * icall.c (ves_icall_Type_GetInterfaces): Avoid using
18756         'interface_id' and 'max_interface_id' fields of MonoClasses
18757         representing open generic types.
18758
18759 Fri Mar 17 18:06:06 CET 2006 Paolo Molaro <lupus@ximian.com>
18760
18761         * object.h, object.c, icall.c: added functions to deal with
18762         storing valuetypes that contain references in managed objects.
18763         * reflection.c, string-icalls.c, threads.c, marshal.c: small
18764         fixes and comments around uses of mono_array_addr ().
18765
18766 Thu Mar 16 17:16:45 CET 2006 Paolo Molaro <lupus@ximian.com>
18767
18768         * object.h, icall.c, monitor.c: object.GetHashCode ()
18769         implementation that supports the moving garbage collector.
18770
18771 Wed Mar 15 16:31:38 CET 2006 Paolo Molaro <lupus@ximian.com>
18772
18773         * icall.c, threads-types.h, threads.c: implemented finalizer for
18774         LocalDataStoreSlot.
18775
18776 2006-03-15  Zoltan Varga  <vargaz@gmail.com>
18777
18778         * metadata.c (mono_type_size): Add a fixme.
18779         (mono_type_stack_size): Ditto.
18780
18781         * object-internals.h (MonoReflectionAssemblyBuilder): Added 
18782         'type_forwarders' field.
18783
18784         * tabledefs.h (TYPE_ATTRIBUTE_FORWARDER): Added new (undocumented) type
18785         attribute from net 2.0.
18786
18787         * object.c (mono_vtable_get_static_field_data): Moved this to object.c
18788         from class.c.
18789
18790         * class.c (mono_class_setup_fields): Fix a warning.
18791         
18792         * class.c (mono_class_from_name): Add support for assemblyref entries
18793         in the EXPORTEDTYPE table.
18794
18795         * reflection.c: Add support for handling type forwarders under net 2.0.
18796
18797         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.       
18798         
18799 2006-03-14  Zoltan Varga  <vargaz@gmail.com>
18800
18801         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Avoid
18802         overwriting entries in ModuleBuild->types, also clean up the code
18803         a little. Fixes #77774.
18804
18805 Tue Mar 14 20:21:18 CET 2006 Paolo Molaro <lupus@ximian.com>
18806
18807         * domain.c, assembly.c, metadata-internals.h, class-internals.h:
18808         load friend assembly info when present.
18809
18810 2006-03-14  Raja R Harinath  <rharinath@novell.com>
18811
18812         Fix crasher on gtest-158.cs.
18813         * metadata.c (mono_metadata_parse_type_full): Avoid canonicalizing
18814         the return value if the MonoClass we want is yet in an
18815         inconsistent state.
18816         * class.c (mono_class_create_from_typedef): Add an comment
18817         explaining an order dependency between mono_class_setup_parent and
18818         mono_class_setup_mono_type.
18819
18820 Mon Mar 13 21:13:27 CET 2006 Paolo Molaro <lupus@ximian.com>
18821
18822         * class.c: documentation updates and events bug fix.
18823
18824 Mon Mar 13 17:28:07 CET 2006 Paolo Molaro <lupus@ximian.com>
18825
18826         * class.c: some cleanup, locking fixes.
18827
18828 Mon Mar 13 10:46:17 CET 2006 Paolo Molaro <lupus@ximian.com>
18829
18830         * class.c: fix the generics code to setup nested
18831         type info to the instantiated type (bug #77770).
18832
18833 Sun Mar 12 16:21:31 CET 2006 Paolo Molaro <lupus@ximian.com>
18834
18835         * marshal.c: fixed a few type correctness issues.
18836
18837 Sat Mar 11 20:14:44 CET 2006 Paolo Molaro <lupus@ximian.com>
18838
18839         * loader.c: the Set/Get/Addrtess array methods should be public.
18840
18841 2006-03-11  Zoltan Varga  <vargaz@gmail.com>
18842
18843         * icall.c (mono_register_jit_icall_wrapper): Fix a warning.
18844         
18845         * icall.c (mono_register_jit_icall_wrapper): Register the argument, not
18846         info->wrapper.
18847
18848 2006-03-10  Zoltan Varga  <vargaz@gmail.com>
18849
18850         * icall.c (mono_register_jit_icall): Allocate the structure using g_new0.
18851
18852         * class-internals.h (MonoJitICallInfo): Add 'trampoline' field used by the JIT.
18853
18854         * mempool.c (mono_mempool_alloc): Speed this up a bit.
18855         (mono_mempool_alloc0): Ditto.
18856
18857 2006-03-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18858
18859         * socket-io.c:
18860         (create_object_from_sockaddr): it was allocating 4 extra bytes
18861         for the AF_UNIX data. Fixes bug #77747.
18862
18863 2006-03-09  Zoltan Varga  <vargaz@gmail.com>
18864
18865         * icall.c (ves_icall_System_MonoMethodInfo_get_retval_marshal): New icall.
18866
18867 2006-03-09  Dick Porter  <dick@ximian.com>
18868
18869         * file-io.c (get_file_attributes): Use S_ISLNK not "& S_IFLNK".
18870         Fixes bug 76966 again.
18871
18872 2006-03-07  Peter Dennis Bartok  <pbartok@novell.com>
18873
18874         * verify.c (dtfinfo_fields): Updated to match new (serializable) field
18875         names from r57532
18876         * appdomain.c: Bumped corlib version to 48 (due to r57532)
18877
18878 2006-03-07  Martin Baulig  <martin@ximian.com>
18879
18880         * object.c
18881         (mono_field_get_value_object): Add support for MONO_TYPE_GENERICINST.
18882
18883 2006-03-07  Martin Baulig  <martin@ximian.com>
18884
18885         * class.c
18886         (mono_class_get_full): Don't inflate TYPEDEF entries; fixes the
18887         regression introduced in r56970; see gtest-252.cs.
18888
18889         * loader.c (mono_get_method_constrained): Correctly handle generic
18890         methods; see gtest-253.cs.
18891
18892 2006-03-04  Zoltan Varga  <vargaz@gmail.com>
18893
18894         * icall.c (ves_icall_type_Equals): Handle NULLs. Fixes #77700.
18895
18896 2006-03-04  Martin Baulig  <martin@ximian.com>
18897
18898         * icall.c (ves_icall_MonoGenericClass_GetParentType): Dynamically
18899         compute the parent type at runtime, just like we're already doing
18900         it for interfaces.
18901
18902         * reflection.c
18903         (mono_reflection_bind_generic_parameters): Don't compute the
18904         parent type anymore.
18905
18906         * class-internals.h (MonoDynamicGenericClass): Removed `parent'.
18907
18908 2006-03-04  Martin Baulig  <martin@ximian.com>
18909
18910         * mono-debug-debugger.h
18911         (mono_debugger_create_notification_function): Allocate memory at
18912         runtime and return a pointer to it.
18913
18914 2006-03-03  Zoltan Varga  <vargaz@gmail.com>
18915
18916         * assembly.c: Fix windows build.
18917         
18918         * assembly.c: Fix build.
18919
18920         * assembly.c: Move the contents of os/{unix,win32}/util.c to this file. 
18921
18922         * gc_wrapper.h: Move the contents of os/gc_wrapper.h to this file.
18923         
18924 2006-03-03  Dick Porter  <dick@ximian.com>
18925
18926         * process.c
18927         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
18928         Check parameters before dereferencing them.  Fixes Aaron's part of
18929         bug 77393.
18930
18931 2006-03-03  Raja R Harinath  <rharinath@novell.com>
18932
18933         Fix performance regression.
18934         * loader.c (find_method_in_class): Add 'from_class' argument.
18935         Rename 'klass' argument to 'in_class'.  The signature is compared
18936         against the method in 'in_class', and the corresponding method is
18937         returned from 'from_class'.
18938         (find_method): Walk both 'in_class' and 'from_class' in parallel.
18939         (method_from_memberref) [PARENT_TYPESPEC]: Use it to walk the
18940         type definition and generic instantiation in parallel.
18941         (mono_get_method_constrained): Update to changes.
18942
18943 Thu Mar 2 12:27:41 CET 2006 Paolo Molaro <lupus@ximian.com>
18944
18945         * threads.c: make sure the domain is correct, too when doing
18946         mono_thread_attach ().
18947
18948 2006-03-01  Zoltan Varga  <vargaz@gmail.com>
18949
18950         * class.c (mono_class_create_from_typedef): Mark classes using CharSet.Auto as unicode on
18951         windows. Fixes #77683.
18952
18953 Wed Mar 1 20:09:25 CET 2006 Paolo Molaro <lupus@ximian.com>
18954
18955         * object.h, *: introduced specific way to set elements of an array
18956         of references to be used as write barrier. Still need to audit the
18957         uses of mono_array_addr.
18958
18959 2006-03-01  Miguel de Icaza  <miguel@novell.com>
18960
18961         * object-internals.h: New field to cache the assmebly name, patch
18962         from Tambet Ingo (tambet@ximian.com)
18963
18964 Wed Mar 1 19:13:30 CET 2006 Paolo Molaro <lupus@ximian.com>
18965
18966         * decimal.h, class-internals.h, metadata-internals.h,
18967         file-io.h: mark a few function declarations as internal, to
18968         reduce the number of PLT entries.
18969
18970 2006-02-28 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18971
18972         * file-io.c: fix typo in warning message.
18973
18974 Tue Feb 28 17:43:20 CET 2006 Paolo Molaro <lupus@ximian.com>
18975
18976         * loader.c: on unix, lookup the "*A" version of a function
18977         if charset is auto as a second option before failing.
18978
18979 2006-02-28  Raja R Harinath  <rharinath@novell.com>
18980
18981         * class.h (mono_class_inflate_generic_method): Revert to two
18982         argument version.
18983         * class-internals.h (MonoMethodInflated): Remove 'inflated' field.
18984         (mono_class_inflate_generic_method_full): Add.
18985         * class.c (mono_class_inflate_generic_method_full): Rename from
18986         'mono_class_inflate_generic_method'.  Don't set 'inflated' field.
18987         (mono_class_inflate_generic_method): New.  Wrapper around ..._full.
18988         * loader.c, reflection.c: Update to changes.
18989
18990 Sat Feb 25 17:57:21 CET 2006 Paolo Molaro <lupus@ximian.com>
18991
18992         * icall.c: const fixes and small improvements.
18993
18994 2006-02-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18995
18996         * threadpool.c: for asynchronous connect(), enable the same workaround
18997         for BSD 6 as for the Mac. Fixes bug #77637.
18998
18999 2006-02-24  Zoltan Varga  <vargaz@gmail.com>
19000
19001         * marshal.c (mono_marshal_free_asany): Fix handling of blittable
19002         formatted classes. Fixes #77524.
19003
19004 2006-02-24  Raja R Harinath  <rharinath@novell.com>
19005
19006         * class.c (inflate_generic_type): Add a couple more
19007         micro-optimizations.
19008         (inflate_generic_context): Don't use the 'gmethod' from
19009         'inflate_with'.
19010         (mono_class_inflate_generic_method): If the method has generic
19011         parameters, but the passed-in context doesn't have a 'gmethod',
19012         create one.  Use the possibly simplified generic instantiation
19013         from the declaring class instead of the one passed in.
19014
19015 2006-02-24  Raja R Harinath  <harinath@gmail.com>
19016
19017         Make generic method signature and method header handling lazy.
19018         * class.c (mono_class_inflate_generic_signature): Move to loader.c.
19019         (inflate_generic_header): Likewise.
19020         (mono_class_inflate_generic_method): Rewrite.  Add a 'klass_hint'
19021         parameter to avoid inflating types.
19022         (mono_get_inflated_method): Empty out.
19023         * class.h (mono_class_inflate_generic_method): Update to changes.
19024         * loader.c (mono_get_method_from_token): Don't parse signature for
19025         generic methods, nor methods of generic classes.
19026         (mono_method_signature): Rename from 'mono_method_signature'.
19027         Inflate signature on demand.
19028         (mono_method_get_header): Inflate method header on demand.
19029         * reflection.c: Update to changes.
19030
19031 2006-02-23  Raja R Harinath  <rharinath@novell.com>
19032
19033         * metadata.c (mono_metadata_inflate_generic_inst): If the
19034         instantiation is closed, don't bother expanding it in the new
19035         context.
19036         * class.c (inflate_generic_class): If the generic instantiation
19037         doesn't change after inflation, return the argument itself.
19038         (inflate_generic_type) [MONO_TYPE_MVAR, MONO_TYPE_VAR]:
19039         Add bounds checks.
19040         (inflate_generic_context): If neither the generic class nor the
19041         generic method instantiations change, return the original context.
19042         * reflection.c (mono_method_get_object): Do
19043         'mono_get_inflated_method' before accessing the ->klass field.
19044         (inflate_mono_method): Don't create a MonoGenericMethod unless
19045         necessary.
19046         (inflate_method): Don't pass a constructed type as the declaring
19047         type of a methodbuilder.
19048
19049 Thu Feb 23 11:57:54 CET 2006 Paolo Molaro <lupus@ximian.com>
19050
19051         * object.c: fix memory overwrite.
19052
19053 2006-02-22  Dick Porter  <dick@ximian.com>
19054
19055         * threads.c: Don't use G_GNUC_PRETTY_FUNCTION in debug messages,
19056         it doesn't work any more.
19057         (mono_threads_request_thread_dump): Fix unused variable warnings.
19058
19059 Wed Feb 22 15:08:44 CET 2006 Paolo Molaro <lupus@ximian.com>
19060
19061         * metadata.h, metadata-internals.h, monodiet.c, debug-helpers.c,
19062         mono-debug.c, profiler.c: cleanup: move MonoMethodHeader out of
19063         the public header file.
19064
19065 2006-02-21  Zoltan Varga  <vargaz@gmail.com>
19066
19067         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Fix writing past memory. Fixes #77613.
19068
19069 Tue Feb 21 19:55:11 CET 2006 Paolo Molaro <lupus@ximian.com>
19070
19071         * class-internals.h, object.c: reduce the size of MonoVTable
19072         and store the interface_offsets array at negative offsets.
19073
19074 Tue Feb 21 19:53:26 CET 2006 Paolo Molaro <lupus@ximian.com>
19075
19076         * metadata.c: tweak table descriptors data structures to reduce
19077         size and runtime relocations.
19078
19079 Tue Feb 21 14:52:13 CET 2006 Paolo Molaro <lupus@ximian.com>
19080
19081         * marshal.c: fix some types and opcodes to be type-safe
19082         in marshaling wrappers.
19083
19084 2006-02-21  Ankit Jain  <jankit@novell.com>
19085
19086         * metadata.h (mono_metadata_decode_signed_value): Add declaration.
19087
19088 2006-02-21  Raja R Harinath  <rharinath@novell.com>
19089
19090         * metadata.c (get_constraints): Relax debugging checks for monodis.
19091
19092 2006-02-21  Ankit Jain  <jankit@novell.com>
19093
19094         * metadata.c (mono_metadata_load_generic_params): Move the code
19095         checking for ambiguous generic params from here to mono/dis/get.c
19096         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Remove.
19097
19098 2006-02-21  Raja R Harinath  <harinath@gmail.com>
19099
19100         Fix assertion triggered when compiling nemerle.
19101         * class.c (mono_get_shared_generic_inst): Rename from
19102         get_shared_inst and make non-static.
19103         * loader.c (mono_get_shared_generic_method): New.  Used to create
19104         the MonoGenericContext-equivalent of a MonoGenericContainer.
19105         (mono_get_method_from_token): Initialize the 'context' field of
19106         the created MonoGenericContainer.
19107         * reflection.c (reflection_methodbuilder_to_mono_method): Likewise.
19108         * metadata.c (get_constraints): Add sanity check.
19109         * class-internals.h: Add new internal methods.
19110
19111         * reflection.c (verify_safe_for_managed_space): New sanity check.
19112         Currently checks that owner-less generic parameters aren't allowed
19113         in managed space.
19114         (mono_type_get_object): Use it.
19115         * icall.c (ves_icall_MonoType_GetGenericArguments): Remove checks
19116         that are now in mono_type_get_object.
19117         (ves_icall_MonoMethod_GetGenericArguments): Likewise.
19118
19119 2006-02-19  Raja R Harinath  <harinath@gmail.com>
19120
19121         * metadata.c (mono_type_create_from_typespec): Rename from
19122         mono_type_create_from_typespec_full.  Remove MonoGenericContainer*
19123         argument and caching of types in the generic container.
19124         (unwrap_arrays, find_generic_param): Remove.
19125         * metadata-internals.h: Update.
19126         * class-internals.h (_MonoGenericContainer): Remove 'types' field.
19127
19128 2006-02-18  Zoltan Varga  <vargaz@gmail.com>
19129
19130         * class.c (mono_class_get_exception_for_failure): Fix a warning.
19131
19132         * marshal.c (mono_marshal_emit_native_wrapper): Handle FNPTR args and
19133         return values. Fixes #77581.
19134
19135         * class.c (mono_fnptr_class_get): Switch name and name_space.
19136
19137         * marshal.c (mono_marshal_asany): Fix marshalling of blittable formatted
19138         classes and add support for [In, Out] attributes.
19139         (mono_marshal_free_asany): Ditto. Fixes #77524.
19140
19141 2006-02-18  Raja R Harinath  <harinath@gmail.com>
19142
19143         * class.c (mono_class_from_generic_parameter): Make more robust to
19144         incomplete MonoGenericContainers from monodis.
19145
19146 Fri Feb 17 16:10:34 CET 2006 Paolo Molaro <lupus@ximian.com>
19147
19148         * class-internals.h: added some more exception types.
19149         * class.c, metadata.c: added a few checks to handle missing
19150         types.
19151
19152 2006-02-17  Raja R Harinath  <rharinath@novell.com>
19153
19154         Use owner-less generic-params some more.
19155         * class.c (my_mono_class_from_generic_parameter): Remove.
19156         (mono_class_from_generic_parameter): Handle null image,
19157         param->name and param->owner.
19158         (mono_class_from_mono_type): Update.
19159         (mono_class_create_from_typespec): Remove 'container' parameter.
19160         If that parameter is non-null, the result is always inflated by
19161         'mono_class_get_full' anyway.
19162         (mono_class_get): Rename from _mono_class_get.  Remove 'container'
19163         parameter.
19164         (mono_class_get_full): Update.
19165
19166         * class.c (inflate_generic_type) [GENERICINST]: If the generic
19167         instance is not open, don't bother inflating.
19168         (mono_class_setup_fields): Hoist some loop-invariants.  Don't
19169         parse metadata for inflated classes.
19170         (_mono_class_get): Change GenericContext* parameter to
19171         GenericContainer*.
19172         (mono_class_create_from_typespec): Likewise.  Simplify, and
19173         implement trivially.  All the cases are handled in
19174         mono_class_from_mono_type.  Don't inflate returned class.
19175         (mono_class_get_full): Delegate GENERICINST optimization to
19176         inflate_generic_type.
19177         (mono_ldtoken) [TOKEN_TYPE_SPEC]: Use mono_class_get_full() here too.
19178
19179 2006-02-16  Dick Porter  <dick@ximian.com>
19180
19181         * socket-io.c (create_object_from_sockaddr): Fix typo.
19182         (create_sockaddr_from_object): Check array lengths before
19183         potentially accessing items off the end.
19184         (ves_icall_System_Net_Sockets_Socket_Receive_internal)
19185         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal)
19186         (ves_icall_System_Net_Sockets_Socket_Send_internal)
19187         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Fix buffer
19188         length checks to avoid wraparound overflows.
19189         (ves_icall_System_Net_Sockets_Socket_Select_internal): Check the
19190         contents of the array of sockets
19191         (hostent_to_IPHostEntry2)
19192         (addrinfo_to_IPHostEntry): IPv6 printed addresses can be 48 bytes.
19193         Check return value of inet_ntop ().
19194         (addrinfo_to_IPHostEntry): Fix typo
19195
19196 2006-02-16  Raja R Harinath  <rharinath@novell.com>
19197
19198         Type metadata parsing doesn't use generic-instantiation information.
19199         * metadata.c (mono_metadata_parse_array_full): Change
19200         MonoGenericContext* parameter to MonoGenericContainer*.
19201         (mono_metadata_parse_type_full): Likewise.
19202         (mono_type_create_from_typespec_full): Likewise.
19203         (mono_metadata_parse_mh_full): Likewise.
19204         (mono_metadata_parse_generic_inst): Likewise.
19205         (do_mono_metadata_parse_generic_class): Likewise.
19206         (do_mono_metadata_parse_type): Likewise.
19207         * metadata-internals.h: Update to changes.
19208         * class.c (mono_class_find_enum_basetype): Likewise.
19209         (mono_class_setup_fields): Likewise.
19210         (mono_class_create_from_typespec): Likewise.
19211         * loader.c (method_from_methodspec): Likewise.
19212         (mono_get_method_from_token): Likewise.
19213         (mono_method_get_header): Likewise.
19214
19215 Thu Feb 16 15:42:13 CET 2006 Paolo Molaro <lupus@ximian.com>
19216
19217         * marshal.c: handle additional GENERICINST case (patch from
19218         Thong Nguyen <tum@veridicus.com>).
19219         Fix a few cases where LDIND_I/STIND_I was used for references.
19220
19221 2006-02-16  Raja R Harinath  <rharinath@novell.com>
19222
19223         * reflection.c (mono_reflection_get_token): Remove unused variable.
19224
19225 2006-02-16  Martin Baulig  <martin@ximian.com>
19226
19227         * reflection.c (mono_reflection_get_token): Add support for fields
19228         in instantiated generic types.
19229
19230         * icall.c
19231         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): Removed.
19232
19233 2006-02-15  Martin Baulig  <martin@ximian.com>
19234
19235         * icall.c
19236         (ves_icall_MonoMethod_get_HasGenericParameters): Removed.
19237         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): Removed.
19238         (ves_icall_MonoMethod_get_IsGenericMethod): New icall.
19239         (ves_icall_MonoMethod_get_IsGenericMethodDefinition): New icall.
19240
19241 Wed Feb 15 16:19:24 CET 2006 Paolo Molaro <lupus@ximian.com>
19242
19243         * class.c, metadata.c, metadata.h, object.c, icall.c,
19244         marshal.c: changed mono_type_get_underlying_type () to do
19245         the sensible thing and introduced mono_type_generic_inst_is_valuetype().
19246         Fixed handling of instantiated generic valuetypes (bug #75479).
19247
19248 2006-02-15  Raja R Harinath  <rharinath@novell.com>
19249
19250         * metadata.c (mono_metadata_decode_signed_value): Simplify.
19251         Delegate to mono_metadata_decode_value, and work on the returned value.
19252
19253         * icall.c (ves_icall_MonoType_GetGenericArguments):
19254         Add consistency check here too.
19255         
19256 2006-02-15  Ankit Jain  <jankit@novell.com>
19257
19258         * metadata.c (mono_metadata_decode_signed_value): Use gint* instead of
19259         char/short etc.
19260
19261 2006-02-15  Ankit Jain  <jankit@novell.com>
19262
19263         * metadata.c (mono_metadata_decode_signed_value): New function to decode
19264         signed values, used only for representing lower bounds of arrays.
19265         (mono_metadata_parse_array_full): Use new
19266         mono_metadata_decode_signed_value to decode lower bounds.
19267
19268 2006-02-14  Martin Baulig  <martin@ximian.com>
19269
19270         * reflection.c
19271         (mono_reflection_get_token): Support "MonoGenericMethod" and
19272         "MonoGenericCMethod" and allow generic instances / methods.
19273
19274 2006-02-11  Zoltan Varga  <vargaz@gmail.com>
19275
19276         * console-io.c (ves_icall_System_ConsoleDriver_GetTtySize): New icall
19277         to obtain the terminal size using an ioctl.
19278
19279         * object.c (mono_nullable_init): Revert this as nullable reference
19280         types are not valid.
19281         (mono_nullable_box): Ditto.
19282
19283 2006-02-09  Dick Porter  <dick@ximian.com>
19284
19285         * threads.c (mono_thread_detach): Drop a reference to the thread
19286         we're detaching.
19287
19288 2006-02-09  Zoltan Varga  <vargaz@gmail.com>
19289
19290         * object.c (mono_nullable_init): Handle nullable reference types.
19291         (mono_nullable_box): Ditto. Fixes #77446.
19292
19293 2006-02-07  Martin Baulig  <martin@ximian.com>
19294
19295         * icall.c (ves_icall_MonoMethod_get_IsGenericMethodDefinition): Removed.
19296
19297 2006-02-07  Ankit Jain  <jankit@novell.com>
19298
19299         * socket-io.h (MonoSocketFlags): New. Copy of System.Net.Sockets.SocketFlags
19300         * socket-io.c (convert_socketflags): New. Convert SocketFlags to native ones.
19301         (ves_icall_System_Net_Sockets_Socket_Receive_internal): Convert flags using convert_socketflags.
19302         (ves_icall_System_Net_Sockets_Socket_ReceiveFrom_internal): Likewise.
19303         (ves_icall_System_Net_Sockets_Socket_Send_internal): Likewise.
19304         (ves_icall_System_Net_Sockets_Socket_SendTo_internal): Likewise.
19305
19306 2006-02-02  Zoltan Varga  <vargaz@gmail.com>
19307
19308         * class.c (mono_class_create_generic): Set type_token as well.
19309
19310         * object.c (mono_runtime_invoke_array): Fix handling of byref vtypes to be
19311         compatible with MS.
19312
19313 2006-02-02  Martin Baulig  <martin@ximian.com>
19314
19315         * threads.c, gc.c: Removed the `WITH_INCLUDED_LIBGC' section; it
19316         has never been used so far.
19317
19318 2006-02-02  Martin Baulig  <martin@ximian.com>
19319
19320         * mono-debug-debugger.h: Changed comment at the top of this file;
19321         the header is not installed, but it's safe to #include it from
19322         within the JIT.
19323
19324         * mono-debug.c: Don't #define _IN_THE_MONO_DEBUGGER.
19325         * mono-debug-debugger.c, debug-mono-symfile.c: Likewise.
19326
19327 2006-02-02  Martin Baulig  <martin@ximian.com>
19328
19329         * mono-debug.h
19330         (MonoSymbolTable): Removed the `metadata_info' field.
19331
19332         * mono-debug.c
19333         (mono_debug_init_1): Always set `mono_symbol_table->corlib'.
19334
19335         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19336         (mono_debugger_add_builtin_types): Removed.
19337         (MonoDebuggerInfo): Moved into ../mini/debug-debugger.h.
19338         (mono_debugger_create_notification_function): We now operate on a
19339         pre-allocated area; take a `gpointer' and return `void'.
19340
19341         * mono-debug-debugger.c
19342         (MonoDebuggerMetadataInfo): Moved into ../mini/debug-debugger.h.
19343         (mono_debugger_add_builtin_types): Removed.
19344
19345 2006-02-02  Martin Baulig  <martin@ximian.com>
19346
19347         * threads.c (mono_debugger_create_all_threads): New public method.
19348
19349 Wed Feb 1 18:22:34 CET 2006 Paolo Molaro <lupus@ximian.com>
19350
19351         * gc-internal.h, boehm-gc.c, null-gc.c: back out the patch, since it
19352         breaks on several platforms.
19353
19354 2006-02-01  Sebastien Pouliot  <sebastien@ximian.com>
19355
19356         * assembly.c: the VS.NET build doesn't supply default values for
19357         MONO_ASSEMBLIES and MONO_CFG_DIR.
19358
19359 2006-02-01  Zoltan Varga  <vargaz@gmail.com>
19360
19361         * gc-internal.h boehm-gc.c null-gc.c (mono_gc_unregister_thread): New
19362         helper function.
19363
19364         * threads.c (mono_thread_detach): Call mono_gc_unregister_thread ().
19365
19366         * loader.c (method_from_memberref): Fix a warning.
19367
19368         * metadata.c (mono_metadata_load_generic_params): Fix a warning.
19369
19370         * marshal.c (emit_struct_conv): Fix marshalling of embedded structs
19371         with explicit layout. Fixes #77433.
19372
19373 2006-01-31  Zoltan Varga  <vargaz@gmail.com>
19374
19375         * icall.c (ves_icall_Type_GetInterfaceMapData): Make sure 
19376         max_interface_id is initialized before using it. Fixes #77398.
19377         (ves_icall_Type_GetInterfaces): Ditto.
19378
19379 2006-01-30  Raja R Harinath  <rharinath@novell.com>
19380
19381         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19382         allocate memory for parameter attributes when parsing memberref
19383         signatures.
19384         * loader.c (mono_loader_set_error_method_load): Don't warn.
19385         (method_from_memberref): Ensure MissingMethodException gets thrown
19386         if method is not found.  Make warning more informative.
19387
19388 2006-01-29  Raja R Harinath  <harinath@gmail.com>
19389
19390         Fix #77397
19391         * icall.c (ves_icall_MonoType_get_IsGenericParameter): Don't
19392         return true if is byref.
19393         (ves_icall_TypeBuilder_get_IsGenericParameter): Likewise.
19394         (ves_icall_MonoType_get_DeclaringType): Return NULL on byref classes.
19395         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
19396
19397 2006-01-27  Raja R Harinath  <rharinath@novell.com>
19398
19399         Fix tests/find-method.2.il
19400         * loader.c (find_method, find_method_in_class): Remove is_inflated
19401         argument.  Revert 2006-01-18 change.
19402         (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
19403         is generic, search for method in its generic definition.
19404         * class.c (mono_class_setup_vtable_general): Print generic
19405         arguments of generic types in debugging printf.
19406
19407 2006-01-26  Zoltan Varga  <vargaz@gmail.com>
19408
19409         * object-internals.h (MonoThread): Add 'thread_dump_requested' field.
19410
19411         * threads.c (mono_threads_request_thread_dump): New helper function.
19412
19413 2006-01-25  Raja R Harinath  <rharinath@novell.com>
19414
19415         * metadata.c (mono_type_create_from_typespec_full): Fix caching of types.
19416
19417 2006-01-25  Ankit Jain  <jankit@novell.com>
19418
19419         * metadata-internals.h (mono_generic_params_with_ambiguous_names): Add declaration and
19420         move definition to ..
19421         * metadata.c (mono_generic_params_with_ambiguous_names): .. here.
19422         
19423 2006-01-25  Ankit Jain  <jankit@novell.com>
19424             Raja R Harinath  <rharinath@novell.com>
19425
19426         * metadata-internals.h (mono_generic_params_with_ambiguous_names): New.
19427         * metadata.c (mono_metadata_load_generic_params): Fill mono_generic_params_with_ambiguous_names
19428         as necessary.
19429
19430 2006-01-25  Martin Baulig  <martin@ximian.com>
19431
19432         * mono-debug-debugger.h: Moved `MonoDebuggerManager' and
19433         `MonoDebuggerThread' into debug-debugger.c.
19434
19435 Tue Jan 24 18:53:35 CET 2006 Paolo Molaro <lupus@ximian.com>
19436
19437         * profiler.c: fix printing of data.
19438
19439 2006-01-24  Atsushi Enomoto  <atsushi@ximian.com>
19440
19441         * object.c, marshal.c : Fixed runtime part of bug #77315. Reject
19442           invalid surrogate in UTF7/UTF8 bytes and don't return NULL.
19443
19444 Tue Jan 24 09:56:16 CET 2006 Paolo Molaro <lupus@ximian.com>
19445
19446         * object.c: fix deadlock related to string interning.
19447
19448 2006-01-23  Martin Baulig  <martin@ximian.com>
19449
19450         * mono-debug-debugger.h (MonoDebuggerIOLayer): Removed.
19451
19452         * mono-debug-debugger.c (mono_debugger_io_layer): Removed.
19453
19454 2006-01-23  Martin Baulig  <martin@ximian.com>
19455
19456         * mono-debug.h: Moved the prototypes of some functions which are
19457         used by the JIT here from mono-debug-debugger.h.
19458
19459 2006-01-21  Martin Baulig  <martin@ximian.com>
19460
19461         * Makefile.am: Don't install mono-debug-debugger.h.
19462
19463 2006-01-21  Martin Baulig  <martin@ximian.com>
19464
19465         * mono-debug-debugger.h: Enforce the private status of this header
19466         file and removed unneccessary #include's in metadata/*.c and mini/*.c.
19467         Moved some stuff from mono-debugger-jit-wrapper.h here.
19468
19469 2006-01-20  Raja R Harinath  <rharinath@novell.com>
19470
19471         * class.c (mono_class_from_typeref): Add a sanity test to help
19472         catch lack of assembly load/search hooks.
19473
19474 2006-01-19  Zoltan Varga  <vargaz@gmail.com>
19475
19476         * marshal.c (emit_struct_conv): Relax the fields with same offset
19477         check even more. Fixes #77230.
19478
19479 2006-01-18  Martin Baulig  <martin@ximian.com>
19480
19481         * loader.c (find_method_in_class): Added `gboolean is_inflated'
19482         argument; if false, we compare the uninstantiated signatures.
19483         (method_from_memberref): Compare the uninstantiated signatures;
19484         fixes #76417.
19485
19486 2006-01-18  Robert Jordan  <robertj@gmx.net>
19487
19488         * boehm-gc.c, null-gc.c (mono_gc_weak_link_remove):
19489         Clear the weak link. Fixes bug #77170.
19490
19491         * gc.c (mono_gchandle_free):
19492         Reflect *-gc.c changes (tiny optimization).
19493
19494 2006-01-18  Zoltan Varga  <vargaz@gmail.com>
19495
19496         * metadata.c (mono_metadata_signature_dup): Applied patch from
19497         Aras Pranckevicius (aras@otee.dk). Fix crash when compiled with MSVC.
19498         Fixes #77288.
19499
19500 2006-01-17  Zoltan Varga  <vargaz@gmail.com>
19501
19502         * marshal.c (emit_struct_conv): Allow fields with the same offset when
19503         marshalling from native to managed code. Fixes #77230.
19504
19505 2006-01-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19506
19507         * threadpool.c: fix problem (Mac only) when more than one asynchronous
19508         connect. Fixes bug #77020.
19509
19510 Mon Jan 16 19:20:43 CET 2006 Paolo Molaro <lupus@ximian.com>
19511
19512         * class.c: fixed id assignement for nested interfaces (bug #77275).
19513         Added also better info for --print-vtable debugging.
19514
19515 2006-01-12  Martin Baulig  <martin@ximian.com>
19516
19517         * icall.c (ves_icall_MonoGenericClass_GetInterfaces): Inflate the
19518         interfaces on-the-fly; fixes #76625.
19519
19520         * class-internals.h
19521         (MonoDynamicGenericClass): Removed `ifaces' and `count_ifaces'; we
19522         don't need that anymore.
19523
19524 2006-01-12  Miguel de Icaza  <miguel@novell.com>
19525
19526         * socket-io.c
19527         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
19528         To avoid initing the nested_classes when not needed I turned the
19529         PeerCredData as a toplevel internal class, as it has to be shared
19530         anyways. 
19531
19532         Fixes the CASA issue.
19533
19534 2006-01-11  Ben Maurer  <bmaurer@andrew.cmu.edu>
19535
19536         * domain.c: Accessors for MonoJitInfo
19537
19538         * profiler-private.h: Add jitinfo to the end jit hook
19539
19540         * profiler.[ch]: Define new hooks, called after jitting which give
19541         the MonoJitInfo that was compiled
19542
19543 2006-01-10  Martin Baulig  <martin@ximian.com>
19544
19545         * class.c (mono_class_setup_events): Add support for generic
19546         classes; fixes #76440.
19547
19548 2006-01-06  Raja R Harinath  <rharinath@novell.com>
19549
19550         Fix #77160.
19551         * icall.c (ves_icall_InternalInvoke): Use mono_get_inflated_method
19552         on passed-in method.
19553
19554 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19555
19556         * object.c (mono_runtime_invoke_array): Add Nullable support.
19557
19558         * icall.c (ves_icall_System_Activator_CreateInstanceInternal): Ditto.
19559
19560 2006-01-03  Sebastien Pouliot  <sebastien@ximian.com>
19561
19562         * file-io.c: Don't consider sockets as directory and avoid an endless
19563         loop. Fix bug #76966.
19564
19565 2006-01-03  Zoltan Varga  <vargaz@gmail.com>
19566
19567         * object.c (mono_nullable_init): New helper function.
19568         (mono_nullable_box): Ditto.
19569
19570         * marshal.c (mono_marshal_get_runtime_invoke): Handle Nullables.
19571
19572         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle Nullables.
19573
19574         * icall.c (ves_icall_MonoField_GetValueInternal): Handle Nullables.
19575         
19576 2006-01-02  Zoltan Varga  <vargaz@gmail.com>
19577
19578         * class.c (mono_class_is_assignable_from): Make T assignable to 
19579         Nullable<T>.
19580
19581 2005-12-23  Sebastien Pouliot  <sebastien@ximian.com>
19582
19583         * appdomain.c: Bump corlib version to 46.
19584         * icalls.c: Renamed CurrentTimeZone to CurrentSystemTimeZone (for
19585         serialization purpose) and changed ves_icall_System_Reflection_
19586         Assembly_get_code_base signature to accept a boolean (to escape, or 
19587         not, the assembly code base).
19588
19589 2005-12-23  Dick Porter  <dick@ximian.com>
19590
19591         * icall.c: 
19592         * threads-types.h: 
19593         * threads.c: Added OpenMutex, OpenSemaphore and OpenEvent icalls.
19594         CreateEvent icall now returns "created" boolean parameter.
19595
19596 2005-12-22  Zoltan Varga  <vargaz@gmail.com>
19597
19598         * marshal.c (mono_mb_emit_restore_result): Add generics support. Fixes
19599         #76967.
19600
19601         * reflection.c (mono_custom_attrs_construct_by_type): Handle the case 
19602         when attr_klass is an interface. Fixes #77045.
19603
19604 2005-12-20  Zoltan Varga  <vargaz@gmail.com>
19605
19606         * marshal.c (emit_struct_conv): Fix previous patch.
19607         
19608         * marshal.c (emit_struct_conv): Add a check for fields with the same
19609         offset.
19610
19611 2005-12-20  Raja R Harinath  <rharinath@novell.com>
19612
19613         Fix regression in Mono.C5.
19614         * class.c (mono_class_create_generic): If 'klass' is an interface
19615         set up the interface offsets.
19616         (mono_class_is_assignable_from): Don't throw away generic arguments.
19617
19618 2005-12-19  Raja R Harinath  <rharinath@novell.com>
19619
19620         * icall.c (ves_icall_System_MonoType_getFullName): Return NULL for
19621         type parameters.
19622
19623 2005-12-15  Raja R Harinath  <rharinath@novell.com>
19624
19625         * metadata.c (mono_metadata_parse_method_signature_full): Remove a
19626         dead store.
19627         (do_mono_metadata_parse_generic_class): Don't pass the current
19628         generic context when parsing the type being instantiated: it
19629         cannot use it, anyway.
19630
19631         * loader.c (method_from_memberref): Don't inflate a signature if
19632         it doesn't contain any type parameters.
19633
19634 2005-12-15  Zoltan Varga  <vargaz@gmail.com>
19635
19636         * class.c (mono_class_setup_vtable): Call mono_reflection_get_dynamic_overrides () to get the overrides in dynamic assemblies.
19637
19638 2005-12-14  Martin Baulig  <martin@ximian.com>
19639
19640         * class.c
19641         (mono_type_get_name_recurse): Don't return null for type
19642         parameters and open generic classes.
19643         (mono_class_setup_methods): Don't exclude generic instances.
19644         (mono_get_unique_iid): Use different IDs for different
19645         instantiations of the same generic type.
19646         (mono_class_setup_vtable): Only use setup_generic_vtable() for
19647         open generic instances; create a normal vtable for closed generic
19648         instances.
19649         (mono_class_setup_vtable_general): We're now also called for
19650         closed generic instances.
19651
19652         * reflection.c
19653         (mono_reflection_bind_generic_parameters): Correctly use
19654         mono_metadata_lookup_generic_inst() everywhere.
19655
19656 2005-12-14  Zoltan Varga  <vargaz@gmail.com>
19657
19658         * object.c (mono_class_create_runtime_vtable): Call 
19659         mono_class_setup_vtable ().
19660
19661         * reflection.c (mono_reflection_get_dynamic_overrides): New helper
19662         function.
19663         (ensure_runtime_vtable): Initialize the generic vtable lazily. Fixes
19664         #76959.
19665
19666         * loader.c (mono_loader_set_error_type_load): Print the type load
19667         warnings to the console so they are more visible to the user.
19668         (mono_loader_set_error_method_load): Ditto.
19669
19670         * reflection.c (ensure_runtime_vtable): Revert the last change as it
19671         is still broken.
19672         
19673         * reflection.c (ensure_runtime_vtable): Fix build.
19674
19675         * reflection.c (ensure_runtime_vtable): Disable an optimization which
19676         doesn't work in all cases.
19677
19678 2005-12-13  Zoltan Varga  <vargaz@gmail.com>
19679
19680         * object.c (mono_array_new_full): Treat a single dimensional array
19681         with 0 lower bounds as an szarray. Fixes #76973.
19682
19683         * reflection.c (custom_attr_visible): Really fix this.
19684
19685 2005-12-12  Zoltan Varga  <vargaz@gmail.com>
19686
19687         * reflection.c (custom_attr_visible): Allow nested public attributes
19688         as well.
19689
19690         * class.c (mono_class_setup_vtable_general): Add missing != -1 to an
19691         interface check.
19692
19693 2005-12-12  Raja R Harinath  <harinath@gmail.com>
19694
19695         * class.c (set_generic_param_owner): Delete.
19696         (mono_class_create_from_typedef): Don't set ->owner field of
19697         generic parameters to "param containers" of enclosing classes.
19698         * reflection.c (mono_reflection_initialize_generic_parameter):
19699         Likewise.
19700
19701 2005-12-11  Zoltan Varga  <vargaz@gmail.com>
19702
19703         * reflection.c (custom_attr_visible): Fix build.
19704
19705 2005-12-10  Zoltan Varga  <vargaz@gmail.com>
19706
19707         * reflection.c (mono_custom_attrs_from_builders): Avoid returning
19708         private attributes.
19709         
19710         * reflection.c (reflection_methodbuilder_to_mono_method): Fix
19711         handling of null parameter defaults.
19712
19713 2005-12-09  Raja R Harinath  <rharinath@novell.com>
19714
19715         * class.c (mono_class_from_generic_parameter): Don't set
19716         klass->generic_container.
19717         (my_mono_class_from_generic_parameter): Likewise.
19718
19719 2005-12-07  Zoltan Varga  <vargaz@gmail.com>
19720
19721         * reflection.c (load_public_key): Fix a warning.
19722         (method_encode_code): Fix unaligned accesses.
19723
19724 2005-12-07  Martin Baulig  <martin@ximian.com>
19725
19726         * object-internals.h (MonoReflectionGenericParam): Added `cattrs'.
19727
19728         * reflection.c
19729         (write_generic_param_entry): Encode our custom attrs.
19730
19731         * appdomain.c (MONO_CORLIB_VERSION): Bump to 45.
19732
19733 2005-12-07  Martin Baulig  <martin@ximian.com>
19734
19735         * reflection.c (encode_new_constraint): Removed; we don't use the
19736         `NewConstraintAttribute' anymore.
19737
19738 2005-12-06  Zoltan Varga  <vargaz@gmail.com>
19739
19740         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): Do
19741         not fire a TypeResolve event when Assembly.GetType () is called.
19742
19743 2005-12-05  Ben Maurer  <bmaurer@ximian.com>
19744
19745         Beginning of support for nullable types in the runtime. Parts of
19746         this patch are from Martin.
19747
19748         * appdomain.c (MONO_CORLIB_VERSION): Bump
19749
19750         * domain.c (mono_init_internal): get the nullable type
19751
19752         * class.c (mono_class_is_nullable): New method
19753         (mono_class_get_nullable_param): New mehod
19754         (mono_class_create_generic): In types T? set cast_class to T
19755
19756         * class-internals.h (MonoDefaults): new nullable default class
19757         (mono_class_get_nullable_param, mono_class_get_nullable_param):
19758         new methods.
19759
19760 2005-12-05  Raja R Harinath  <rharinath@novell.com>
19761
19762         * metadata.c (select_container): New.  Refactor code to select the
19763         appropriate GenericContainer given the type of generic parameter
19764         we are looking for.
19765         (mono_metadata_parse_generic_param): Take a MonoGenericContainer,
19766         not a MonoGenericContext.  Use select_container.  Update parameters.
19767         (do_mono_metadata_parse_type): Combine the code for MONO_TYPE_VAR
19768         and MONO_TYPE_MVAR.
19769         (unwrap_arrays): Remove duplicate tests.
19770         (find_generic_param): Rename from 'has_same_context'.  Now walks a
19771         generic instantiated class to find any arguments that are generic
19772         parameters.
19773         (mono_type_create_from_typespec_full): Use find_generic_param to
19774         avoid evicting some generic instantiations from the typespec
19775         cache.
19776
19777 Mon Dec 5 15:07:42 GMT 2005 Paolo Molaro <lupus@ximian.com>
19778
19779         * reflection.c: fixed writing of doubles on ARM FPA.
19780
19781 2005-12-02  Robert Jordan  <robertj@gmx.net>
19782
19783         * icall.c: Fixed EventInfo.ReflectedType (#76829).
19784
19785 2005-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19786
19787         * filewatcher.c: try loading libgamin-1.so.0 before libfam, since at
19788         least on SUSE 10 they are not the same (on debian, they are just the
19789         same thing).
19790
19791 2005-12-01  Raja R Harinath  <rharinath@novell.com>
19792
19793         * icall.c (ves_icall_MonoType_get_DeclaringType): Implement
19794         DeclaringType for VARs and MVARs.
19795         * class.c (set_generic_param_owner): Fix initialization of owner
19796         fields.
19797
19798 Wed Nov 30 15:48:22 CET 2005 Paolo Molaro <lupus@ximian.com>
19799
19800         * icall.c: fixed Enum.ToObject() to correctly convert the values.
19801
19802 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19803
19804         * threadpool.c: workaround for a bug that shows up on the Mac:
19805         select()+connect() on a blocking socket is not like it should
19806         be, so we proceed to connect() in that case, wasting the I/O
19807         threadpool thread until connect succeedes. Fixes bug #75436.
19808
19809 2005-11-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19810
19811         * threadpool.c: fix typo when setting file descriptor states.
19812
19813 2005-11-28  Raja R Harinath  <rharinath@novell.com>
19814
19815         * class-internals.h (MonoGenericContainer.is_signature): Remove.        
19816         * metadata.c (mono_metadata_parse_method_signature_full): Don't
19817         create a temporary signature container.
19818         (mono_metadata_parse_generic_param): Update to changes.
19819         (mono_type_create_from_typespec_full): Update to changes.
19820         * loader.c (method_from_memberref): Don't use a
19821         MonoGenericContainer while parsing a memberref signature.
19822         (method_from_methodspec): Remove dead-store of the 'container'
19823         variable.  It's overwritten before use.
19824
19825         * metadata.c (mono_type_create_from_typespec_full): Make debugging
19826         checks tighter.
19827         (mono_metadata_parse_generic_param): Likewise.
19828         * loader.c (find_method_in_class): Does not need a
19829         MonoGenericContainer.  Use 'mono_method_signature' rather than
19830         'mono_method_signature_full'.
19831         (find_method, mono_get_method_constrained, method_from_memberref):
19832         Update to changes.
19833
19834         * metadata.c (mono_type_create_from_typespec_full): Ensure that
19835         owner-less generic-parameters are never evicted from the typespec
19836         cache.
19837
19838         * loader.c (method_from_memberref): Don't use the current context
19839         when parsing signatures.
19840         (method_from_methodspec, mono_get_method_from_token): Update to changes.
19841
19842         * metadata.c (do_mono_metadata_parse_generic_class): Avoid
19843         side-effects in g_assert.
19844         * loader.c (mono_get_method_from_token): Resolve klass earlier so
19845         that we don't potentially lose information.
19846
19847 2005-11-26  Dick Porter  <dick@ximian.com>
19848
19849         * icall.c:
19850         * threads.c: icalls to implement basic (ie, not named)
19851         System.Threading.Semaphore.
19852
19853 2005-11-24  Dick Porter  <dick@ximian.com>
19854
19855         * process.c
19856         (ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal):
19857         Use GetProcessId() if it's available.
19858
19859 2005-11-23  Zoltan Varga  <vargaz@gmail.com>
19860
19861         * icall.c threads-types.h threads.c: Add Exchange<T> icall.
19862
19863 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19864             Ankit Jain  <jankit@novell.com>
19865
19866         * loader.c (mono_get_method_from_token): Initialize 'method' field
19867         of all generic parameters before parsing the signature.  Remove
19868         code that "fixed"-up MVAR references.
19869
19870 2005-11-23  Ankit Jain  <jankit@novell.com>
19871
19872         * metadata.c (mono_metadata_has_generic_params):
19873         (mono_metadata_load_generic_param_constraints):
19874         (mono_metadata_load_generic_params): Move duplicate code ...
19875         (mono_metadata_get_generic_param_row): ... here. Returns the
19876         first row-id in GenericParam table for a given owner (token).
19877         * metadata-internals.h (mono_metadata_get_generic_param_row): Add
19878         prototype.
19879
19880 2005-11-23  Raja R Harinath  <rharinath@novell.com>
19881             Ankit Jain  <jankit@novell.com>
19882
19883         * metadata.c (mono_metadata_class_equal): Pass signature_only when
19884         comparing VARs too.
19885         * icall.c (ves_icall_MonoType_get_DeclaringMethod): Look at 
19886         type->data.generic_param only if the type is an MVAR.
19887         (ves_icall_MonoMethod_GetGenericArguments): Ensure that we don't
19888         leak owner-less VARs and MVARs into managed space.
19889
19890 2005-11-21  Martin Baulig  <martin@ximian.com>
19891
19892         * class-internals.h
19893         (MonoMethod): Moved the `generic_container' here from
19894         `MonoMethodNormal' since we now also need it for
19895         `MonoMethodPInvoke';
19896         (MonoMethodNormal): Moved the `generic_container' to `MonoMethod'.
19897         (MonoMethodInflated): Replaced the `MonoMethodNormal nmethod' with
19898         an union containing both `MonoMethodNormal' and
19899         `MonoMethodPInvoke'.
19900
19901         * loader.c
19902         (mono_get_method_from_token): Allow implementing generic methods
19903         as interncalls.
19904
19905         * threads.c
19906         (ves_icall_System_Threading_Interlocked_CompareExchange_T): New
19907         icall.
19908
19909 2005-11-17  Dick Porter  <dick@ximian.com>
19910
19911         * icall.c: 
19912         * process.h: 
19913         * process.c: Split the Process Start_internal icall into
19914         ShellExecuteEx_internal and CreateProcess_internal, which are
19915         called depending on whether UseShellExecute is true.  Fixes bug
19916         76670.
19917
19918         * appdomain.c (MONO_CORLIB_VERSION): Incremented
19919
19920 2005-11-17  Zoltan Varga  <vargaz@gmail.com>
19921
19922         * marshal.c (emit_ptr_to_object_conv): Get rid of the 'usize' and
19923         'msize' parameters, use the information in 'mspec' instead.
19924         (emit_object_to_ptr_conv): Ditto.
19925
19926         * marshal.c (emit_struct_conv): Handle explicit layout structs with
19927         fields out of order. Fixes #76733.
19928
19929 2005-11-17  Ankit Jain  <jankit@novell.com>
19930
19931         * metadata.c (mono_type_create_from_typespec_full): Remove unnecessary g_assert.
19932
19933 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
19934
19935         * icall.c : renamed MakeGenericMethod -> MakeGenericMethod_impl for
19936           bug #76575.
19937
19938 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19939
19940         * object.c (mono_class_compute_gc_descriptor): Disable typed allocation
19941         for types with non-auto layout. Fixes #76717.
19942
19943 2005-11-16  Ankit Jain  <jankit@novell.com>
19944
19945         * class.c (my_mono_class_from_generic_parameter): param->owner can be null.
19946         * metadata.c (mono_metadata_parse_generic_param): Create a dummy MonoGenericParam 
19947         if generic_context is null.
19948           (mono_metadata_generic_param_equal): param->owner can be null.
19949           (mono_type_create_from_typespec_full): Don't cache the MonoType if param->owner is
19950         null.
19951
19952 2005-11-16  Zoltan Varga  <vargaz@gmail.com>
19953
19954         * reflection.c (create_dynamic_mono_image): Set md_version_minor to
19955         the correct value.
19956
19957 2005-11-15  Martin Baulig  <martin@ximian.com>
19958
19959         * object.c (set_value): Use mono_class_from_mono_type() instead of
19960         the hack for generic instances; fixes #76136.
19961
19962 2005-11-15  Zoltan Varga  <vargaz@gmail.com>
19963
19964         * metadata-internals.h (_MonoImage): Add 'md_version_major/minor'
19965         fields.
19966
19967         * image.c (load_metadata_ptrs): Initialize the new fields.
19968
19969         * reflection.c (create_dynamic_mono_image): Ditto.
19970
19971         * reflection.c (build_compressed_metadata): Use the new fields.
19972
19973         * icall.c (ves_icall_System_Reflection_Module_get_MDStreamVersion): New
19974         icall.
19975
19976         * icall.c (mono_assembly_icalls): Remove obsolete get_MetadataToken
19977         icall.
19978         
19979 2005-11-15  Ankit Jain  <jankit@novell.com>
19980             Raja R Harinath  <harinath@gmail.com>
19981
19982         * class-internals.h (_MonoGenericContainer.types): New. Cache for MonoTypes.
19983         * metadata.c (mono_type_create_from_typespec_full): Use MonoType from the
19984         new per-generic_container cache if the cached MonoType's context matches
19985         the current context.
19986           (has_same_context): New. Check if the VARs or MVARs in a GENERIC_INST refer
19987         to the expected context.
19988           (unwrap_arrays): New. Get the element MonoType for an ARRAY/SZARRAY.
19989
19990 2005-11-14  Carlos Alberto Cortez <calberto.cortez@gmail.com>
19991
19992         * appdomain.c: Update MONO_CORLIB_VERSION to 42, since
19993         we changed the signature of an icall.
19994         * icall.c: Modify to mono_double_ParseImpl return true/false 
19995         depending on the success, instead of throwing the exception. This will
19996         help us in Double.TryParse methods.
19997         
19998 2005-11-14  Zoltan Varga  <vargaz@gmail.com>
19999
20000         * marshal.c (emit_marshal_object): Throw an exception when
20001         marshalling 'object' instead of crashing. Fixes #76696.
20002
20003 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
20004
20005         * class-internals.h: Add prototype for mono_type_get_full_name ().
20006
20007 2005-11-11  Dick Porter  <dick@ximian.com>
20008
20009         * threads.c (mono_thread_manage): Make sure the main thread has
20010         abandoned all its mutexes when cleaning up.  Fixes bug 74680.
20011
20012 2005-11-11  Zoltan Varga  <vargaz@gmail.com>
20013
20014         * loader.c (mono_loader_set_error_type_load): Log a warning to the
20015         console about the missing type.
20016         (mono_loader_set_error_method_load): Ditto.
20017
20018 2005-11-09  Miguel de Icaza  <miguel@novell.com>
20019
20020         * mono-config.c (mono_get_config_dir): Set the system defaults if
20021         none is specified.
20022
20023         * assembly.c (mono_set_dirs): New API entry point to set the
20024         assembly and the config directory in one call
20025
20026 2005-11-09  Zoltan Varga  <vargaz@gmail.com>
20027
20028         * marshal.c (mono_ftnptr_to_delegate): Throw a NotSupportedException if
20029         the ftnptr was created from a delegate in a domain other than the
20030         current domain. Fixes #75377.
20031
20032         * exception.h exception.c: Add mono_get_exception_not_supported ().
20033
20034 2005-11-08  Martin Baulig  <martin@ximian.com>
20035
20036         * mono-debug.h (MONO_DEBUGGER_VERSION): Bump to 53.
20037
20038 2005-11-07  Sebastien Pouliot  <sebastien@ximian.com>
20039
20040         * security-manager.h: Added definitions to deal with strongname key 
20041         pairs bigger (and smaller) than 1024 bits.
20042         * reflection.c: Remove hardcoded strongname size (128 bytes) and 
20043         adjust wrt the public key length being used.
20044
20045 2005-11-03  Atsushi Enomoto  <atsushi@ximian.com>
20046
20047         * marshal.c, icall.c : reverted sig->pinvoke changes which broke
20048           Windows build (r51396-51397).
20049
20050 2005-11-03  Martin Baulig  <martin@ximian.com>
20051
20052         * class.c (mono_class_setup_vtable_general): Also add generic
20053         methods to the vtable; fixes #76581.
20054
20055 2005-11-01  Miguel de Icaza  <miguel@novell.com>
20056
20057         * string-icalls.c (ves_icall_System_String_ctor_encoding): Make
20058         sure that we lookup GetString method from the System.Text.Encoding
20059         class, not the derived class or we get an empty method.
20060
20061         Fixed class #76612.
20062
20063 2005-10-25  Miguel de Icaza  <miguel@novell.com>
20064
20065         * assembly.c (mono_assemblies_init): Do not set the Mono root dir
20066         if it has been previously set (embedders). 
20067
20068         Make mono_set_rootdir available also on Unix.
20069
20070 005-10-24  Robert Jordan  <robertj@gmx.net>
20071
20072         * assembly.c: fixed MONO_ASSEMBLIES to be NULL on cygwin as well.
20073
20074 2005-10-30  Zoltan Varga  <vargaz@freemail.hu>
20075
20076         * marshal.c icall.c: Clean up the usage of sig->pinvoke flag. Now
20077         only calls which are made to native code use this flag.
20078
20079         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): Remove the check for FieldBuilders as it is now done in managed code.
20080
20081 2005-10-29  Zoltan Varga  <vargaz@freemail.hu>
20082
20083         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal):
20084         Add support for FieldBuilders.
20085
20086 2005-10-29  Martin Baulig  <martin@ximian.com>
20087
20088         * mono-debug.c
20089         (mono_debug_using_mono_debugger): New public method; returns
20090         whether we're running inside the debugger.
20091
20092 2005-10-27  Zoltan Varga  <vargaz@gmail.com>
20093
20094         * reflection.c (mono_reflection_get_custom_attrs_info): Add support
20095         for Method/Constructor/FieldBuilders.
20096
20097 2005-10-26  Zoltan Varga  <vargaz@gmail.com>
20098
20099         * reflection.c (module_add_cattrs): Save custom attributes for global methods
20100         and fields as well.
20101
20102 2005-10-26  Martin Baulig  <martin@ximian.com>
20103
20104         * mono-debug-debugger.c
20105         (MonoDebuggerMetadataInfo): Added `klass_parent_offset'.
20106
20107 2005-10-24  Raja R Harinath  <harinath@gmail.com>
20108
20109         * icall.c (base64_to_byte_array): Don't pass an out-of-range
20110         integer to isspace.
20111
20112 2005-10-21  Zoltan Varga  <vargaz@gmail.com>
20113
20114         * marshal.c (emit_marshal_vtype): Correctly handle [In,Out] modifiers
20115         when passing valuetypes byref. Fixes #76502.
20116
20117 2005-10-19  Jackson Harper  <jackson@ximian.com>
20118
20119         * profiler.c: Don't put a . in front of types that are not in a
20120         namespace.
20121
20122 2005-10-18  Zoltan Varga  <vargaz@gmail.com>
20123
20124         * icall.c (ves_icall_Type_GetField): Applied patch from Robert Jordan (robertj@gmx.net). Fixes #75515.
20125
20126 2005-10-15  Zoltan Varga  <vargaz@freemail.hu>
20127
20128         * marshal.c: Add generics support to the ldfld/stfld wrappers. Fixes
20129         #76436.
20130         (mono_marshal_get_ldflda_wrapper): Fix a warning.
20131
20132 2005-10-13  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20133
20134         * assembly.c metadata-internals.h icall.c: Define an additional
20135         parameter for mono_assembly_name_parse_full, so we can avoid creating
20136         S.R.AssemblyName.Version when no version info wasn't passed.
20137         
20138 2005-10-09  Miguel de Icaza  <miguel@novell.com>
20139
20140         * class.c (mono_type_get_full_name): Reimplement method that was
20141         removed. 
20142
20143         * image.c: Some docs
20144
20145 2005-10-10  Zoltan Varga  <vargaz@gmail.com>
20146
20147         * profiler.c (output_newobj_profile): Fix printing of Total memory
20148         on x86.
20149
20150 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
20151
20152         * profiler.c: Add support for allocations > 2GB. Fixes #74886.
20153
20154 2005-10-08  Gert Driesen  <drieseng@users.sourceforge.net>
20155
20156         * threads.c: remove debug output.
20157
20158 2005-10-08  Zoltan Varga  <vargaz@freemail.hu>
20159
20160         * threads.c (mono_thread_manage): Fix crashes if more than 64
20161         threads need to be aborted. Hopefully fixes #75899.
20162
20163         * assembly.c (mono_stringify_assembly_name): New helper function.
20164
20165         * class.c: Use mono_stringify_assembly_name instead of the similar
20166         static function.
20167
20168         * assembly.h assembly.c: Add support for calling a postload search 
20169         hook if an assembly cannot be loaded.
20170
20171         * appdomain.c: Register new search hooks which call the AssemblyResolve
20172         events in AppDomain. Fixes #75231
20173
20174 2005-10-07  Martin Baulig  <martin@ximian.com>
20175
20176         * mono-debug.c (mono_debug_add_method): Create a wrapper entry for
20177         methods without debug info.
20178
20179 2005-10-07  Zoltan Varga  <vargaz@gmail.com>
20180
20181         * class-internals.h debug-helpers.c marshal.h marshal.c: Add ldflda
20182         wrappers.
20183
20184 2005-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20185
20186         * file-io.c: now that we return symlinks, use lstat and, when the file
20187         is a symbolic link, stat, to get the file attributes. Also avoid the
20188         conversion to/from utf16/external.
20189
20190 2005-10-06  Zoltan Varga  <vargaz@gmail.com>
20191
20192         * class.c (mono_class_layout_fields): Compute klass->has_references
20193         correctly if an embedded valuetype is not yet initialized. Fixes
20194         #76331.
20195
20196 2005-10-04  Martin Baulig  <martin@ximian.com>
20197
20198         * metadata.c
20199         (mono_metadata_load_generic_param_constraints): New public
20200         function; splitted the constraints loading out from
20201         mono_metadata_load_generic_params().
20202
20203         * class.c (mono_class_create_from_typedef): Call
20204         mono_metadata_load_generic_param_constraints() after setting up
20205         the type and creating our parent; fixes #75329.
20206
20207 2005-10-04  Martin Baulig  <martin@ximian.com>
20208
20209         * icall.c (ves_icall_MonoGenericClass_GetParentType): Allow
20210         non-dynamic parent classes.
20211
20212 2005-10-04  Atsushi Enomoto  <atsushi@ximian.com>
20213
20214         * file-io.c : win32 build fix (ETXTBSY seems not found).
20215
20216 2005-10-04  Martin Baulig  <martin@ximian.com>
20217
20218         * reflection.c
20219         (mono_image_get_methodspec_token): Make the cache actually work;
20220         fixes #75974.
20221
20222 2005-10-04  Martin Baulig  <martin@ximian.com>
20223
20224         * class.c (mono_class_name_from_token): Removed the unneccessary
20225         `MonoGenericContext *' argument.
20226
20227 2005-10-04  Martin Baulig  <martin@ximian.com>
20228
20229         * loader.c
20230         (method_from_methodspec): Make the caching work again; fixes the
20231         performance regression from #76262.
20232
20233 2005-10-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20234
20235         * file-io.c:
20236         * file-io.h:
20237         * icall.c: replace FindFirst/FindNext/FindClose calls with a new
20238         GetFileSystemEntries that performs the same work but without going
20239         into io-layer, locking, etc.
20240
20241 2005-09-30  Zoltan Varga  <vargaz@gmail.com>
20242
20243         * threads.c (ves_icall_System_Threading_Thread_Abort): Handle 
20244         ThreadState_Stopped as well. Fixes #76047.
20245
20246 2005-09-29  Martin Baulig  <martin@ximian.com>
20247
20248         * class.c
20249         (inflate_generic_context): If the new context has a `gmethod', set
20250         its `container' that that gmethod's `container'.
20251
20252         * metadata.c
20253         (mono_metadata_parse_generic_param): Simplify things;
20254         `generic_container = generic_context->container;' is just fine.
20255
20256         * loader.c (method_from_methodspec): Code cleanups.
20257
20258 Wed Sep 28 17:06:01 CEST 2005 Paolo Molaro <lupus@ximian.com>
20259
20260         * decimal.c: fix warning (and let gcc generate correct
20261         code on ARM with optimizations).
20262
20263 2005-09-28  Martin Baulig  <martin@ximian.com>
20264
20265         * loader.c
20266         (method_from_memberref): Added `MonoGenericContext *class_context'
20267         argument; this is used when parsing a MONO_MEMBERREF_PARENT_TYPESPEC.
20268         (method_from_methodspec): If we're a memberref, use the enclosing
20269         context when parsing its parent.  Fixes #76262; see gtest-206.cs.
20270
20271 2005-09-28  Martin Baulig  <martin@ximian.com>
20272
20273         * object.c (mono_runtime_invoke_array): Added support for
20274         MONO_TYPE_GENERICINST; fixes #75917.
20275
20276 2005-09-27  Martin Baulig  <martin@ximian.com>
20277
20278         * reflection.c (encode_type): For `MONO_TYPE_CLASS/VALUETYPE', use
20279         `k->byval_arg.type' to determine the actual type.
20280
20281         * loader.c (method_from_methodspec): Removed some hacks.
20282
20283 2005-09-27  Ben Maurer  <bmaurer@ximian.com>
20284
20285         * class-internals.h (mono_field_is_deleted): Do the test for
20286         rtspecialname before we check the actual name of the field. This
20287         prevents us from dereferencing a pointer into the string table,
20288         saving us from accessing a few pages
20289
20290         * *.c: Replace the use of {Enter,Leave}CriticalSection with
20291         macros. This will allow a deadlock debugger to easily be plugged
20292         in.
20293
20294 2005-09-27  Martin Baulig  <martin@ximian.com>
20295
20296         * loader.c (method_from_methodspec): Create a "signature"
20297         MonoGenericContainer and use mono_get_method_full().  Fixes #75584.
20298
20299 2005-09-27  Martin Baulig  <martin@ximian.com>
20300
20301         * class.c
20302         (inflate_generic_class): Correctly set the new context's
20303         container.
20304
20305         * loader.c
20306         (find_method, find_method_in_class): Take a `MonoGenericContainer *'
20307         instead of a `MonoGenericContext *'.
20308         (mono_method_signature_full): Take a `MonoGenericContainer *'
20309         instead of a `MonoGenericContext *'.
20310
20311         * metadata.c
20312         (mono_metadata_parse_signature_full): Take a `MonoGenericContainer *'
20313         instead of a `MonoGenericContext *'.
20314         (mono_metadata_parse_method_signature_full): Likewise.
20315
20316 2005-09-26  Martin Baulig  <martin@ximian.com>
20317
20318         * class.c
20319         (mono_class_from_generic_parameter): Set `klass->generic_container'
20320         (mono_class_from_generic_parameter): Likewise.
20321         (mono_bounded_array_class_get): We inherit the generic container
20322         from the element class.
20323
20324         * loader.c
20325         (find_method, find_method_in_class): Take a `MonoGenericContext *'
20326         argument rather than computing it here.
20327         (method_from_memberref): Correctly set the generic context before
20328         parsing the signature.  Fixes #75681.
20329
20330 2005-09-26  Zoltan Varga  <vargaz@gmail.com>
20331
20332         * object.c (mono_class_has_special_static_fields): Fix warnings.
20333
20334 2005-09-26  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20335
20336         * assembly.c: Add parse_public_key function, to
20337         par the public keys. Also added mono_assembly_name_parse_full,
20338         to define it the parsed key should be freed or not.
20339         * icall.c: Added ves_icall_System_Reflection_AssemblyName_ParseName,
20340         to parse a long format assembly name.
20341         * metadata-internals.h: Keep mono_assembly_name_parse_full as
20342         private, since calling it to preserve the key requires
20343         freeing it manually.
20344         
20345 2005-09-26  Atsushi Enomoto  <atsushi@ximian.com>
20346
20347         * locales.c : removed HAVE_ICU part.
20348
20349 2005-09-24  Zoltan Varga  <vargaz@freemail.hu>
20350
20351         * object.c (mono_class_create_runtime_vtable): Avoid calling 
20352         field_is_special_static if the klass has no special static fields.
20353
20354         * class-internals.h (MonoClass): Add 'no_special_static_fields' flag.
20355         (MonoCachedClassInfo): Likewise.
20356
20357         * object.c (mono_class_has_special_static_fields): New helper function.
20358
20359 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20360
20361         * class.c (mono_class_create_from_typedef): Don't call 
20362         interfaces_from_typedef_full for enums.
20363         (mono_class_create_from_typedef): Compute the base types of enums directly
20364         without calling mono_class_setup_fields ().
20365         (mono_class_find_enum_basetype): New helper function.
20366
20367         * reflection.c (mono_image_build_metadata): Emit type names+namespaces at
20368         one place inside the string heap.
20369         
20370 Fri Sep 23 19:37:46 CEST 2005 Paolo Molaro <lupus@ximian.com>
20371
20372         * class.c: locking fixes, code cleanups, some docs added.
20373         Allocate some data structures in the image mempool.
20374
20375 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20376
20377         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20378         the example code.
20379         
20380 Fri Sep 23 18:27:02 CEST 2005 Paolo Molaro <lupus@ximian.com>
20381
20382         * class-internals.h, class.c, reflection.c: reduce memory taken by
20383         MonoClass.
20384
20385 Fri Sep 23 17:56:21 CEST 2005 Paolo Molaro <lupus@ximian.com>
20386
20387         * metadata.c, metadata.h, loader.h: documentation updates, code and
20388         API cleanups.
20389
20390 2005-09-23  Zoltan Varga  <vargaz@gmail.com>
20391
20392         * rawbuffer.c: Remove unneccessary set_n_pagefaults () routine and update
20393         the example code.
20394
20395         * rawbuffer.h rawbuffer.c: Add code and APIs to help determine the number of
20396         page faults caused by the runtime while reading metadata.
20397
20398 2005-09-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20399
20400         * socket-io.c: the field names were changed 3 months ago and no one
20401         realized until bug #76077 got filed!
20402
20403 2005-09-20  Martin Baulig  <martin@ximian.com>
20404
20405         * icall.c (assembly_icalls): Removed some unused debugger icalls.
20406
20407 2005-09-20  Martin Baulig  <martin@ximian.com>
20408
20409         * mono-debug.c (mono_debug_add_type): Ignore array types and don't
20410         write the rank into the class entry.
20411
20412 2005-09-20  Martin Baulig  <martin@ximian.com>
20413
20414         * mono-debug-debugger.c (MonoDebuggerMetadataInfo): Added some stuff.
20415
20416 2005-09-19  Zoltan Varga  <vargaz@gmail.com>
20417
20418         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20419
20420         * icall.c (custom_attrs_defined_internal): New icall.
20421
20422         * reflection.c (mono_reflection_get_custom_attrs_by_type): New helper
20423         function.
20424         (mono_custom_attrs_construct_by_type): New helper function.
20425
20426 2005-09-17  Zoltan Varga  <vargaz@freemail.hu>
20427
20428         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): Null
20429         terminate the resulting string. Fixes #76123.
20430
20431 2005-09-16  Martin Baulig  <martin@ximian.com>
20432
20433         * mono-debug.c
20434         (mono_debug_add_method): Ignore inflated methods for the moment.
20435
20436 2005-09-14  Martin Baulig  <martin@ximian.com>
20437
20438         * debug-mono-symfile.h (MONO_SYMBOL_FILE_VERSION): Bump version to 39.
20439
20440 2005-09-13  Zoltan Varga  <vargaz@gmail.com>
20441
20442         * metadata.c (mono_class_get_overrides_full): Modify signature to explicitly
20443         return a success/failure indication.
20444         (mono_metadata_interfaces_from_typedef_full): Ditto.
20445         (get_constraints): Ditto.
20446
20447 2005-09-12  Zoltan Varga  <vargaz@gmail.com>
20448
20449         * marshal.c (emit_marshal_array): Fix handling of null arrays.
20450         
20451         * marshal.c (emit_marshal_array): Add support for returning string
20452         arrays from delegates. Fixes #76063.
20453
20454         * marshal.c: Use the emit_ldloc/stloc macros where possible.
20455
20456 2005-09-11  Zoltan Varga  <vargaz@gmail.com>
20457
20458         * threads.c (ves_icall_System_Threading_Thread_MemoryBarrier): New
20459         icall.
20460
20461 2005-09-09  Zoltan Varga  <vargaz@gmail.com>
20462
20463         * reflection.c icall.c: Fix after mono_get_exception_type_load
20464         signature change.
20465
20466         * assembly.c (mono_assembly_get_assemblyref): New helper function.
20467         (mono_assembly_load_reference): Use the new helper.
20468
20469         * class-internals.h (MonoLoaderError): New structure containing 
20470         information about type loading errors.
20471
20472         * class-internals.h loader.c: Add APIs to store per-thread loader
20473         error information.
20474
20475         * loader.c class.c: Set the loader error if needed.
20476
20477         * exception.h exception.c: Add functions to throw MissingMethod/MissingFieldExceptions.
20478
20479 Thu Sep 8 18:54:07 BST 2005 Paolo Molaro <lupus@ximian.com>
20480
20481         * decimal.c: fixed to handle the broken ARM fp format.
20482
20483 Wed Sep 7 22:17:58 BST 2005 Paolo Molaro <lupus@ximian.com>
20484
20485         * icall.c: on ARM use the libc strtod(), since bsd_strtod() seems
20486         broken.
20487
20488 2005-09-06  Martin Baulig  <martin@ximian.com>
20489
20490         * domain.c (supported_runtimes): Added v2.0.50727.
20491
20492 Tue Sep 6 11:40:24 CEST 2005 Paolo Molaro <lupus@ximian.com>
20493
20494         * culture-info.h: reduce the size of some structures.
20495
20496 2005-09-05  Martin Baulig  <martin@ximian.com>
20497
20498         Reflect latest API changes in the August CTP.
20499
20500         * icall.c
20501         ("Type.BindGenericParameters"): Renamed to "MakeGenericType".
20502         ("MonoType.HasGenericArguments"): Removed.
20503         ("MonoMethod.BindGenericParameters"): Renamed to
20504         "MakeGenericMethod".
20505         ("MethodBuilder.BindGenericParameters"): Renamed to
20506         "MakeGenericMethod".    
20507
20508 2005-09-05  Martin Baulig  <martin@ximian.com>
20509
20510         * mono-debug-debugger.c: Moved the debugger icalls into icall.c.
20511
20512 2005-09-05  Martin Baulig  <martin@ximian.com>
20513
20514         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20515
20516         * icall.c (ves_icall_Type_get_IsGenericType): Return true also if
20517         generic_container is non-NULL.
20518
20519 2005-09-05  Martin Baulig  <martin@ximian.com>
20520
20521         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20522
20523         * object.c (set_value): In MONO_TYPE_VALUETYPE, add generics support.
20524
20525 2005-08-29  Michal Moskal  <malekith@nemerle.org>
20526
20527         * reflection.c (encode_locals,
20528         mono_reflection_sighelper_get_signature_local): Increase buffer sizes
20529         for large generic types.
20530
20531 2005-09-05  Martin Baulig  <martin@ximian.com>
20532
20533         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20534
20535         * class.c (mono_dup_array_type): New public method.
20536         (mono_metadata_signature_deep_dup): New public method.
20537         (dup_type): Correctly duplicate array and function types.
20538
20539 2005-09-05  Martin Baulig  <martin@ximian.com>
20540
20541         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20542
20543         * reflection.c (get_default_param_value_blobs): Handle generic types
20544         and generic methods.
20545
20546 2005-09-02  Sebastien Pouliot  <sebastien@ximian.com>
20547
20548         * class.c: Fixed error reporting (method/class were inversed) for 
20549         inheritance demands.
20550         * security-manager.c|h: Added the AppDomain when calling the managed
20551         System.Security.SecurityManager.InheritanceDemand method.
20552
20553 2005-09-01  Raja R Harinath  <rharinath@novell.com>
20554
20555         * reflection.c (encode_marshal_blob): 'marshaltype' and
20556         'marshaltyperef' are alternate sources for the custom marshaler
20557         name.
20558
20559 Wed Aug 31 17:39:54 CEST 2005 Paolo Molaro <lupus@ximian.com>
20560
20561         * class.c: fix creation of array classes with rank == 1
20562         (patch by Ankit Jain <jankit@novell.com>).
20563
20564 Wed Aug 31 17:35:19 CEST 2005 Paolo Molaro <lupus@ximian.com>
20565
20566         * object.c: fix check for creating the bound data for arrays vs
20567         szarrays.
20568
20569 2005-08-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20570
20571         * object.c: configuration file name is now based on the executable name,
20572         not the image name. Fixes bug #75931.
20573
20574 2005-08-29  Zoltan Varga  <vargaz@gmail.com>
20575
20576         * marshal.c (emit_thread_interrupt_checkpoint_call): Load the
20577         flag using LDIND_U4 since it leads to smaller and faster code on ia64.
20578
20579 2005-08-25  Zoltan Varga  <vargaz@gmail.com>
20580
20581         * rand.c: Use wincrypt.h instead of WinCrypt.h.
20582
20583 2005-08-24  Ankit Jain  <jankit@novell.com>
20584             Raja R Harinath  <rharinath@novell.com>
20585
20586         * class.c (mono_class_from_typeref): Don't call mono_class_init as we might've been
20587           called by it recursively.
20588           (mono_class_init): Remove special case in pending_init handling, since it's
20589           superseded by the fix to mono_class_from_typeref.
20590
20591 2005-08-22  Zoltan Varga  <vargaz@freemail.hu>
20592
20593         * threads.c (ves_icall_System_Threading_Thread_Thread_internal): Remove the 
20594         BROKEN_THREAD_START stuff.
20595
20596 2005-08-21  Zoltan Varga  <vargaz@freemail.hu>
20597
20598         * class-internals.h object.c: Add a new kind of trampoline called a delegate 
20599         trampoline.
20600
20601         * domain-internals.h domain.c: Add a has for delegate trampolines to MonoDomain.
20602         
20603         * object.c (mono_delegate_ctor): Replace the original function address with
20604         a delegate trampoline.
20605
20606 2005-08-21 Gert Driesen <drieseng@users.sourceforge.net>
20607
20608         * icall.c: add boolean argument to base64_to_byte_array and 
20609         InternalFromBase64String to control whether a whitespace-only string
20610         is allowed (or should casue a FormatException to be thrown). We need
20611         this as the behavior has changed between MS.NET 1.x and 2.0, and we
20612         to match the MS behaviour in both profiles.
20613         * appdomain.c: Bump corlib version.
20614
20615 2005-08-20  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20616
20617         This patch implements a big portion of publisher policy
20618         support, used to bind assembly versions and redirect
20619         one assembly from version A to version B.
20620
20621         * assembly.c:
20622         New GSList loaded_assembly_bindings, for storing the cached
20623         assembly bindings.
20624         (assembly_binding_maps_name): New static function for checking if a 
20625         assembly binding information maps an assembly name.
20626         (mono_assembly_binding_info_free): New function for freeing
20627         assembly binding information resources.
20628         (get_publisher_policy_info): New static function for retrieving 
20629         assembly binding information from a MonoImage.
20630         (compare_versions): New static function for comparing an assembly
20631         binding information data and the version of an assembly name.
20632         (check_policy_versions): New static function for checking if an
20633         assembly binding info mapping an assembly name is valid for it.
20634         (mono_assembly_load_publisher_policy): New static function for
20635         loading the 'policy.major.minor.MyAssembly' image for an assembly
20636         with an assembly name 'aname'.
20637         (mono_assembly_bind_version): New static function for updating
20638         assembly redirection.
20639         (mono_assembly_apply_binding): New static function for applying
20640         assembly binding.
20641         (search_binding_loaded): New static function for searching 
20642         loaded assembly binding infos in the cache domain.
20643         (mono_assembly_load_full): Don't apply assembly binding for
20644         reflection only assemblies.
20645
20646         * metadata-internals.h: Add MonoAssemblyBindingInfo,
20647         which contains information about assembly binding. Also
20648         declare signature for mono_config_parse_publisher_policy ()
20649         function, used to retrieve pub policy info.
20650         
20651         * mono-config.c:
20652         (publisher_policy_start): New static function used to parse publisher 
20653         policy config files.
20654         (publisher_policy_parser): New static MonoParseHandler containing 
20655         the functions used when parsing config files.
20656         (mono_config_parse_publisher_policy): New function for parsing
20657         publisher policy files.
20658         
20659 2005-08-20  Zoltan Varga  <vargaz@freemail.hu>
20660
20661         * object.c (mono_delegate_ctor): Add support for IA64 function descriptors.
20662
20663         * marshal.c (mono_delegate_free_ftnptr): Ditto.
20664
20665         * object.c (mono_get_addr_from_ftnptr): New helper function.
20666
20667         * object.h (mono_array_addr): Fix unaligned access warnings on IA64.
20668
20669         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
20670
20671 2005-08-19  Dick Porter  <dick@ximian.com>
20672
20673         * threads.c, threads.h, appdomain.c, appdomain.h,
20674         profiler-private.h, monitor.c, object.c, object-internals.h,
20675         profiler.c, mono-debug-debugger.h, profiler.h: Use a gsize to
20676         store the thread ID, so it can hold a 64 bit value if needed.
20677
20678 2005-08-19  Zoltan Varga  <vargaz@freemail.hu>
20679
20680         * reflection.c (mono_reflection_create_dynamic_method): Store the
20681         handle class into the method references as well so ldtoken works in
20682         dynamic methods.
20683
20684         * icall.c (ves_icall_MonoField_GetValueInternal): Add support for generic
20685         types.
20686
20687 2005-08-19  Ankit Jain <jankit@novell.com>
20688
20689         Fix #75847.
20690         * marshal.c (mono_marshal_get_ptr_to_struct): Build method signature 
20691           here rather than using the method signature of a arbitrary function
20692           named 'System.Runtime.InteropServices.Marshal::PtrToStructure' with 
20693           two arguments.
20694           Hack done with Harinath.
20695
20696 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20697
20698         * threadpool.c: disable printing stack traces when we get a exception
20699         in a threadpool thread. I need to do more testing to figure out which
20700         cases actually print this. Fixes bug #75828.
20701
20702 2005-08-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20703
20704         * icall.c: there might be ignored whitespace after the last '='. This
20705         fixes length computation and bug #75840.
20706
20707 2005-08-18  Zoltan Varga  <vargaz@freemail.hu>
20708
20709         * assembly.c (mono_assembly_load_full): Consider .exe extension as
20710         well. Fixes #75809.
20711
20712         * reflection.c (create_custom_attr): Fix unmanaged memory leak. Fixes
20713         #75784.
20714         
20715         * reflection.c (create_custom_attr_data): Ditto.
20716
20717 2005-08-17  Atsushi Enomoto  <atsushi@ximian.com>
20718
20719         * locales.c, culture-info.h : removed RegionLCIDMap.
20720         * culture-info-tables.h : regenerated.
20721
20722 2005-08-16  Martin Baulig  <martin@ximian.com>
20723
20724         * class.c (mono_type_get_name_recurse): Small fix.
20725
20726 2005-08-16  Atsushi Enomoto  <atsushi@ximian.com>
20727
20728         * locales.c : indentation fixie.
20729
20730 2005-08-15  Atsushi Enomoto  <atsushi@ximian.com>
20731
20732         * object-internals.h,
20733           locales.h,
20734           locales.c,
20735           culture-info.h,
20736           icall.c : added RegionInfo table support.
20737         * culture-info-table.h : regenerated for region support.
20738
20739 2005-08-14  Kamil Skalski  <nazgul@nemerle.org>
20740
20741         * reflection.c (resolve_object): handle all kinds of MonoMethod
20742         including generic ones
20743
20744 2005-08-12  Ankit Jain <jankit@novell.com>
20745
20746         * get.c (dis_stringify_variant_type): New. Stringify MonoMarshalVariant.
20747           (dis_stringify_marshal_spec): Add new case for MONO_NATIVE_SAFEARRAY. 
20748
20749 2005-09-12  Lluis Sanchez  <lluis@ximian.com>
20750
20751         * process.c: Don't close a thread handle when it's NULL. This is a
20752         workaround for bug #75733.
20753
20754 2005-08-11  Zoltan Varga  <vargaz@freemail.hu>
20755
20756         * marshal.c (mono_marshal_get_string_encoding): Fix handling of CharSet.Auto. Fixes #75769.
20757
20758 2005-08-10  Zoltan Varga  <vargaz@freemail.hu>
20759
20760         * icall.c (ves_icall_Type_get_IsGenericType): New icall.
20761
20762 2005-08-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
20763
20764         * threadpool.c: if a work item in the thread pool has a callback that
20765         catches a exception, don't propagate it after invoking the callback.
20766         Fixes bug #75336.
20767
20768 2005-08-08  Zoltan Varga  <vargaz@freemail.hu>
20769
20770         * class.c (class_compute_field_layout): Rename this to mono_class_setup_fields.
20771
20772         * class-internals.h (MonoCachedClassInfo): Add some new fields.
20773
20774         * class.c (mono_class_init): Load field info lazily in the AOT case.    
20775
20776         * reflection.c (mono_image_load_module): Fix error checking. Fixes #75660.
20777
20778 2005-08-03  Ankit Jain  <jankit@novell.com>
20779
20780         Fix #75683.
20781         * loader.c (mono_method_signature_full): Use MONO_CALL_DEFAULT if
20782           PInvoke calling convention is 0.
20783
20784 2005-08-02  Zoltan Varga  <vargaz@freemail.hu>
20785
20786         * socket-io.c (convert_sockopt_level_and_name): Applied patch from 
20787         Julien Puydt (julien.puydt@laposte.net). Add check for IPV6_PKTINFO.
20788
20789 Mon Aug 1 16:52:12 CEST 2005 Paolo Molaro <lupus@ximian.com>
20790
20791         * gc-internal.h, threads.c, null-gc.c, boehm-gc.c: added interface
20792         to handle threads not started by the GC (patch by Michael Meeks
20793         <michael.meeks@novell.com>).
20794
20795 2005-07-31  Kamil Skalski  <nazgul@omega.pl>
20796
20797         * reflection.c: Make buffer used in emitting types larger for some
20798         big generic types (patch by Michal Moskal).
20799
20800 2005-07-30  Zoltan Varga  <vargaz@freemail.hu>
20801
20802         * mono-debug.c: Fix some (not all) alignment problems.
20803
20804 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20805
20806         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw):
20807         Invoke mono_image_load_from_data_full passing the refonly
20808         parameter.
20809
20810         * assembly.c
20811         (mono_assembly_open_from_bundle): Add the refonly argument, 
20812         in order to pass it to other methods it calls to.
20813         (do_mono_assembly_open): Add the refonly argument, in order 
20814         to pass it to other methods it calls to.
20815         (mono_assembly_open_full): Invoke do_mono_assembly_open passing
20816         the refonly parameter to it.
20817
20818         * image.c: Add loaded_images_refonly_hash and
20819         loaded_images_refonly_guid_hash to cache the reflection
20820         only loaded images.
20821         (mono_images_init): Initialize the hash tables used for
20822         caching the reflection only images.
20823         (load_modules): Invoke mono_image_open_full passing the refonly
20824         parameter to load the modules the correct way.
20825         (build_guid_table): Add the refonly argument, to re-build the 
20826         correct hash table.
20827         (do_mono_image_open): Added the refonly argument, in order to
20828         define it for the loaded image.
20829         (mono_image_loaded_full): New function, which receives an
20830         additional parameter to look for the image in the refonly or
20831         non-refonly section.
20832         (mono_image_loaded): Updated, using mono_image_loaded_full.
20833         (mono_image_loaded_by_guid_full): The same case that happens
20834         with mono_image_loaded_full.
20835         (mono_image_loaded_by_guid): Likewise.
20836         (register_image): Use the ref_only variable inside MonoImage
20837         to decide in which hash table store the current image.
20838         (mono_image_open_from_data_full): Rename
20839         mono_image_open_from_data to mono_image_open_from_data_full,
20840         adding the refonly argument, to define the ref_only variable 
20841         inside MonoImage.
20842         (mono_image_open_from_data): Return 
20843         mono_image_open_from_data_full.
20844         (mono_image_open_full): Rename mono_image_open to
20845         mono_image_open_full, receiving the new refonly argument,
20846         to pass it to inner methods.
20847         (mono_pe_file_open): Update this function, to open
20848         a MonoImage as a non-refonly image.
20849         (mono_image_close): Use the refonly variable inside
20850         MonoImage to remove the image from the correct caches.
20851
20852         * image.h: Add the signatures of mono_image_open_full,
20853         mono_image_open_from_data_full, mono_image_loaded_full,
20854         mono_image_loaded_by_guid_full.
20855
20856         * metadata-internals.h: Add the ref_only field to 
20857         MonoImage.
20858         
20859 2005-07-29  Carlos Alberto Cortez <calberto.cortez@gmail.com>
20860
20861         * icall.c (ves_icall_System_Reflection_GetReferencedAssemblies):
20862         Fix the last behavior, which used to load the assemblies and
20863         extract MonoReflectionAssemblyName information, instead of
20864         extract it from the metadata tables. Needed for Reflection
20865         Only assemblies.
20866         
20867 2005-07-29  Martin Baulig  <martin@ximian.com>
20868
20869         * mono-debug-debugger.c
20870         (mono_debugger_lock, mono_debugger_unlock): g_assert() if we're
20871         not initialized.
20872
20873         * mono-debug.c
20874         (mono_debug_address_from_il_offset): Check whether we have
20875         debugging support before attempting to take the lock.
20876         (mono_debug_source_location_from_address): Likewise.
20877         (mono_debug_source_location_from_il_offset): Likewise.
20878         (mono_debug_il_offset_from_address): Likewise.
20879         (mono_debug_address_from_il_offset): Likewise.
20880
20881 2005-07-29  Zoltan Varga  <vargaz@freemail.hu>
20882
20883         * class.c (mono_class_from_name_case): Add support for dynamic images.
20884         Fixes #75650.
20885
20886         * object.c (mono_class_compute_gc_descriptor): Add a workaround
20887         for #75479.
20888
20889 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20890         
20891         * reflection.c (mono_method_get_object): Fix warning.
20892
20893 2005-07-28  Martin Baulig  <martin@ximian.com>
20894
20895         * mono-debug.c
20896         (mono_debug_add_wrapper): Also write the wrapper type.
20897
20898 2005-07-28  Zoltan Varga  <vargaz@freemail.hu>
20899
20900         * class-internals.h (MonoCachedClassInfo): Add has_nested_classes field.
20901         
20902         * class.c (mono_class_init): Avoid reading nested classes if the AOT
20903         data indicates the class has none.
20904
20905 2005-07-26  Ben Maurer  <bmaurer@ximian.com>
20906
20907         * mono-debug.c, debug-mono-symfile.c: Replace the use of the
20908         loader lock with the debugger lock. Prevents deadlocks for beagle.
20909
20910         Beagle can now run on an smp box for a weekend without any
20911         issues. Woohoo!
20912
20913 2005-07-26  Zoltan Varga  <vargaz@freemail.hu>
20914
20915         * class.c (mono_bounded_array_class_get): Avoid crash if eclass is
20916         in a module. Fixes #75629.
20917
20918 2005-07-26  Martin Baulig  <martin@ximian.com>
20919
20920         * mono-debug.c (mono_debug_add_wrapper): New static method.
20921         (mono_debug_add_method): Call mono_debug_add_wrapper() if we're an
20922         interncall or a wrapper.
20923
20924         * mono-debug.h (MonoDebugWrapperData): New public typedef.
20925         (MonoDebugDataItemType): Added `MONO_DEBUG_DATA_ITEM_WRAPPER'.
20926         (MONO_DEBUGGER_VERSION): Bump to 51.
20927
20928         * mono-debug-debugger.c
20929         (mono_debugger_add_type): Removed this empty function.
20930         (mono_debugger_add_method): Likewise.
20931
20932 2005-07-22  Zoltan Varga  <vargaz@freemail.hu>
20933
20934         * icall.c (ves_icall_Type_GetMethodsByName): Call setup_vtable () 
20935         before accessing method->slot.
20936
20937 2005-07-21  Jb Evain  <jbevain@gmail.com>
20938
20939         * reflection.c (method_encode_clauses/class): Handle filters clauses.
20940         Fixes #75010.
20941
20942 2005-07-21  Zoltan Varga  <vargaz@freemail.hu>
20943
20944         * marshal.c (emit_marshal_custom): Implement byref marshalling. Fixes
20945         #75587.
20946
20947 2005-07-20  Zoltan Varga  <vargaz@freemail.hu>
20948
20949         * image.h image.c: Add mono_image_get_guid () API function.
20950
20951 2005-07-19  Ben Maurer  <bmaurer@ximian.com>
20952
20953         There were issues when multiple threads tried to load
20954         assemblies. A deadlock was created between assemblies_mutex and
20955         mono_domain_assemblies_lock. This fixes the issue by making the
20956         assembly ref counting be lock free. See bug 75586.
20957         
20958         * image.c (mono_image_close): The add ref function here was using
20959         Interlocked operations while the unref was using a mutex and a
20960         --. I don't think this was ever a bug that would be exposed in a
20961         non-pendantic way (ie, by an embedder doing a ref on one thread
20962         and an unref on another), but for the sake of correctness, this is
20963         now Interlocked.
20964
20965         * assembly.c (mono_assembly_addref): Use InterlockedIncrement
20966         (mono_assembly_load_reference): Call mono_assembly_addref rather
20967         than touching the refcount ourselves.
20968         (mono_assembly_close): Use InterlockedDecrement to unref the
20969         assembly. Don't acquire the lock unless it is actually needed.
20970
20971 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
20972
20973         * class.c (mono_class_layout_fields): Fix calculation of has_references
20974         for generic types.
20975
20976 2005-07-12  Martin Baulig  <martin@ximian.com>
20977
20978         Applying a patch from Michal Moskal <malekith@nemerle.org>.
20979
20980         * metadata.c
20981         (mono_type_hash): Provide better hashing for generic instances.
20982         (mono_generic_inst_hash): Improve hashing.
20983         (mono_generic_class_hash): Likewise.
20984
20985         * reflection.c (mymono_metadata_type_hash): Improve hashing for
20986         generic instances.
20987
20988 2005-07-12  Martin Baulig  <martin@ximian.com>
20989
20990         * reflection.c (mono_reflection_create_runtime_class): Remove the
20991         hack for generic type definitions and non-`Run' assemblies.
20992         (mono_reflection_bind_generic_parameters): Also use
20993         `klass->wastypebuilder' to check for TypeBuilders.
20994
20995 2005-07-12  Zoltan Varga  <vargaz@freemail.hu>
20996
20997         * class.c (mono_class_layout_fields): Fix calculation of has_references
20998         for generic types.
20999
21000         * class.c (inflate_generic_class): Fix a leak.
21001         (mono_class_init): Fix calculation of gchimpl and has_finalize fields
21002         for generic types.
21003
21004 2005-07-11  Martin Baulig  <martin@ximian.com>
21005
21006         * icall.c (ves_icall_Type_BindGenericParameters): Don't crash here
21007         on error.
21008
21009 2005-07-11  Martin Baulig  <martin@ximian.com>
21010
21011         * loader.c (find_method): Also lookup in
21012         `mono_defaults.object_class' if we're an interfaces; fixes #75460.
21013
21014 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21015
21016         * appdomain.c (mono_domain_unload): Don't free the error message
21017         before passing it to mono_get_exception_...
21018
21019         * reflection.c (CACHE_OBJECT): Fix the race introduced by the previous patch.
21020         
21021 Thu Jul 7 19:59:31 CEST 2005 Paolo Molaro <lupus@ximian.com>
21022
21023         * threads.c: try to better guess an available RT signal (bug #75387).
21024
21025 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21026
21027         * reflection.c (CACHE_OBJECT): Don't hold the domain lock between CHECK_OBJECT
21028         and CACHE_OBJECT.
21029
21030 2005-07-07  Martin Baulig  <martin@ximian.com>
21031
21032         * class.c (mono_type_get_name_full): Return NULL for
21033         MONO_TYPE_NAME_FORMAT_FULL_NAME if we have any generic parameters;
21034         fixes #75408.
21035
21036 2005-07-07  Zoltan Varga  <vargaz@freemail.hu>
21037
21038         * threads.c (mono_threads_abort_appdomain_threads): Wait for threads to
21039         exit the appdomain as well being aborted.
21040
21041         * threadpool.c: Create all threadpool threads inside the root appdomain, and
21042         change back to the root domain after calling managed code. This enables
21043         appdomains using threadpools to be unloaded.
21044
21045 2005-07-07  Martin Baulig  <martin@ximian.com>
21046
21047         * class-internals.h
21048         (MonoInflatedGenericClass): Moved the `MonoType *parent' field
21049         into `MonoDynamicGenericClass' since we only need it for dynamic
21050         types.
21051
21052         * reflection.c (mono_class_bind_generic_parameters): We don't need
21053         to compute the `parent' here.
21054
21055 2005-07-07  Atsushi Enomoto  <atsushi@ximian.com>
21056
21057         * culture-info-table.h : regenerated.
21058
21059 2005-07-06  Martin Baulig  <martin@ximian.com>
21060
21061         * icall.c
21062         (ves_icall_FieldInfo_SetValueInternal): Add MONO_TYPE_GENERICINST.
21063
21064         * object.c (set_value): Add MONO_TYPE_GENERICINST; fixes #75299.
21065
21066 2005-07-06  Martin Baulig  <martin@ximian.com>
21067
21068         * metadata.c (mono_metadata_class_equal): Add MONO_TYPE_SZARRAY if
21069         we're doing a signature-only comparision; fixes #74945.
21070
21071 2005-07-06  Martin Baulig  <martin@ximian.com>
21072
21073         * class-internals.h (MonoGenericClass): Moved some things out into
21074         a new `MonoInflatedGenericClass' type.  
21075         (MonoInflatedGenericClass): New type; the `klass' of a
21076         `MonoGenericClass' is now computed lazyly in
21077         mono_get_inflated_generic_class().      
21078
21079         * class.c (mono_get_inflated_generic_class): New public function.
21080         (mono_class_inflate_generic_method): Removed the unused
21081         `MonoClass *' argument.
21082         (setup_generic_vtable): Don't call mono_get_inflated_method() on
21083         all the methods.
21084         (mono_class_create_generic): Make this static and merge it with
21085         mono_class_create_generic_2(); we're now called automatically from
21086         mono_get_inflated_generic_class().
21087
21088         * loader.c (mono_method_signature): Call
21089         mono_get_inflated_method() here.
21090
21091 2005-07-06  Zoltan Varga  <vargaz@freemail.hu>
21092
21093         * object.c (mono_class_create_runtime_vtable): Allow MONO_TYPE_FNPTR as
21094         type of fields with RVA.
21095
21096         * class.c (mono_class_from_generic_parameter): Avoid calling mono_class_init ()
21097         for this pseudo class.
21098         (my_mono_class_from_generic_parameter): Likewise.
21099         (mono_class_init): Allow interfaces to have cctors.
21100
21101 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
21102
21103         * domain-internals.h domain.c: Add functionality to create MonoJitInfo structures
21104         lazily for AOT methods.
21105
21106 2005-07-05  Martin Baulig  <martin@ximian.com>
21107
21108         * loader.c (mono_lookup_pinvoke_call): g_ascii_strcasecmp()
21109         returns FALSE for a successful match, not TRUE.
21110
21111 2005-07-05  Zoltan Varga  <vargaz@freemail.hu>
21112
21113         * loader.c (mono_method_get_index): Optimize this a bit.
21114
21115 2005-07-04  Martin Baulig  <martin@ximian.com>
21116
21117         * class.c
21118         (class_compute_field_layout): Move the check for generic type
21119         definitions into mono_class_layout_fields().  Fixes #74684.
21120         (mono_class_from_generic_parameter): Correctly compute
21121         `klass->parent'; fixes #75457.
21122
21123         * reflection.c (register_assembly, register_module): Make sure
21124         `domain->rejobject_hash' is already created.
21125
21126 2005-07-02  Martin Baulig  <martin@ximian.com>
21127
21128         * class-internals.h
21129         (MonoGenericClass): Move `count_ifaces' and `ifaces' into
21130         `MonoDynamicGenericClass'.      
21131
21132 2005-07-01  Lluis Sanchez  <lluis@ximian.com>
21133
21134         * icall.c: In ves_icall_InternalExecute() dont't assert if the value
21135         returned by a field getter is null, since null is a valid value.
21136
21137 2005-07-01  Martin Baulig  <martin@ximian.com>
21138
21139         * reflection.c (mono_reflection_generic_class_initialize): Update
21140         the `dgclass->fields [i].parent' to the correct class.
21141         (mono_image_get_fieldref_token): Use the declaring type, not the
21142         reflected type.
21143
21144 2005-07-01  Martin Baulig  <martin@ximian.com>
21145
21146         * loader.c (find_method): Also look in the interfaces; fixes #75429.
21147
21148 2005-06-30  Ben Maurer  <bmaurer@ximian.com>
21149
21150         * threads.c (thread_cleanup): assert that thread != NULL
21151         (wait_for_tids_or_state_change): We were using the wrong variable
21152         when accessing wait->threads. `i' was always out of the bounds of
21153         the array.
21154
21155 2005-06-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21156
21157         * loader.c: map user32 and kernel32 to libMonoSupportW
21158
21159 2005-06-28  Zoltan Varga  <vargaz@freemail.hu>
21160
21161         * appdomain.c (unload_thread_main): Mark this as WINAPI.
21162
21163 2005-06-28  Martin Baulig  <martin@ximian.com>
21164
21165         * loader.c (method_from_methodspec): Fix #75334.
21166
21167 2005-06-28  Martin Baulig  <martin@ximian.com>
21168
21169         Fix #74953 - Arrays now implement the generic IList<T> interface
21170         on the 2.0 platform.
21171
21172         * class-internals.h (MonoDefaults): Added `generic_array_class'.
21173
21174         * reflection.c (mono_class_bind_generic_parameters): New public
21175         function; similar to mono_reflection_bind_generic_parameters(),
21176         but operates on a `MonoType *' and not on a `MonoReflectionType *'.
21177
21178         * domain.c (mono_init_internal): Try to initialize.
21179         `mono_defaults.generic_array_class' here; this'll only succeed if
21180         we're using the 2.0 corlib.
21181
21182         * icall.c
21183         (ves_icall_System_Array_InternalArray_GetGenericValueImpl): Added
21184         interncall for "System.Array/InternalArray`1:GetGenericValueImpl".
21185         (mono_lookup_internal_call): Added support for nested classes.
21186
21187         * loader.c
21188         (mono_get_method_from_token): Set `result->signature->pinvoke' if
21189         we're an interncall and have generic arguments.
21190
21191         * class.c
21192         (mono_class_inflate_generic_methods): Allow interncalls and PInvoke.
21193         (mono_bounded_array_class_get): If we're on the 2.0 corlib, use an
21194         instance of System.Array.InternalArray<T> for arrays, so they
21195         implement the generic IList<T> interface.
21196
21197 2005-06-27  Zoltan Varga  <vargaz@freemail.hu>
21198
21199         * marshal.c (emit_marshal_string): Applied patch from Itamar Rogel
21200         (chastamar@yahoo.com). Fixes #75374.    
21201
21202 2005-06-27  Atsushi Enomoto <atsushi@ximian.com>
21203
21204         * culture-info-table.h: regenerated.
21205
21206 2005-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21207
21208         * icall.c: handle spaces correctly for base64 strings.
21209
21210 2005-06-26  Ben Maurer  <bmaurer@ximian.com>
21211
21212         * *.c: Kill some warnings.
21213
21214 2005-06-23  Duncan Mak  <duncan@novell.com>
21215
21216         * socket-io.c (is_loopback): Cast 'ptr' to 'struct in6_addr *' so
21217         that this builds on Solaris 10 (x86).
21218
21219 2005-06-23  Martin Baulig  <martin@ximian.com>
21220
21221         * class.c
21222         (mono_type_get_name_recurse): Don't use a duplicate '[', ']' for
21223         generic type definitions.
21224
21225 2005-06-23  Martin Baulig  <martin@ximian.com>
21226
21227         Fix #75331.
21228
21229         * metadata.c (mono_class_get_overrides): Renamed to
21230         mono_class_get_overrides_full() and added a `MonoGenericContext *'.
21231         (method_from_method_def_or_ref): Added `MonoGenericContext *' and
21232         pass it to mono_get_method_full().
21233
21234 2005-06-22  Ben Maurer  <bmaurer@ximian.com>
21235
21236         * reflection.c (mono_reflection_create_runtime_class): take the
21237         mono_domain_lock in this method. Prevents deadlocks
21238
21239 2005-06-22  Martin Baulig  <martin@ximian.com>
21240
21241         * loader.c (method_from_methodspec): Fix #75330.
21242
21243 2005-06-22  Martin Baulig  <martin@ximian.com>
21244
21245         * reflection.c (type_get_qualified_name): Use
21246         mono_type_get_name_full() with MONO_TYPE_NAME_FORMAT_REFLECTION.
21247         (_mono_reflection_get_type_from_info): Added `MonoImage *image'
21248         argument; use it if we don't have an assembly name.
21249
21250 2005-06-22  Lluis Sanchez Gual  <lluis@novell.com>
21251
21252         * object.c: In mono_message_init, set "copy out" flag for in
21253         parameters with the [Out] flag.
21254
21255 2005-06-21  Martin Baulig  <martin@ximian.com>
21256
21257         * class.c
21258         (mono_type_get_name_recurse): Correctly handle MONO_TYPE_SZARRAY
21259         and MONO_TYPE_PTR.
21260
21261 2005-06-21  Martin Baulig  <martin@ximian.com>
21262
21263         * class.c (mono_class_init): Don't initialize `class->fields' for
21264         generic instances since they're initialized again in
21265         compute_field_layout(). 
21266         (compute_field_layout): Set the field's `generic_info' here; fix
21267         #75320. 
21268
21269 2005-06-21  Martin Baulig  <martin@ximian.com>
21270
21271         * class-internals.h
21272         (MonoGenericMethod): Added `MonoGenericClass *generic_class'.
21273
21274         * metadata.c (mono_metadata_generic_method_equal): Also
21275         distinguish the `generic_class'; fixes #75334.
21276
21277 2005-06-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21278
21279         * domain.c:
21280         * appdomain.c:
21281         * domain-internals.h:
21282         * reflection.c: 'domain_assemblies' field is now protected by its own
21283         lock. Don't call into managed code to run the AssemblyLoad event if we
21284         now there are no registered delegates for it.
21285
21286 2005-06-20  Martin Baulig  <martin@ximian.com>
21287
21288         * class.c (mono_class_is_assignable_from): Use a custom version of
21289         mono_class_has_parent() to make things work for generic instances;
21290         fix #75300.
21291
21292 2005-06-20  Martin Baulig  <martin@ximian.com>
21293
21294         * loader.c (method_from_methodspec): Apply a patch from
21295         Kamil Skalski <nazgul@nemerle.org> to fix #75296.
21296
21297 2005-06-20  Martin Baulig  <martin@ximian.com>
21298
21299         * class.c (mono_class_init): Reverted Zoltan's last change; it
21300         breaks generics.
21301
21302 2005-06-19  Zoltan Varga  <vargaz@freemail.hu>
21303
21304         * threads.c (wait_for_tids_or_state_change): Add missing locking.
21305
21306 2005-06-18 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21307
21308         * socket-io.c: fix the index in the socket array for writable/error
21309         sockets. Fixes bug #75306.
21310
21311 2005-06-17  Zoltan Varga  <vargaz@freemail.hu>
21312
21313         * class.c (mono_class_init): Allow interfaces to have static ctors.
21314
21315 2005-06-17  Martin Baulig  <martin@ximian.com>
21316
21317         * loader.c (method_from_methodspec): Use `context->container' when
21318         parsing the `gmethod->inst'.
21319
21320 2005-06-17  Martin Baulig  <martin@ximian.com>
21321
21322         * class.c (mono_type_get_name_recurse): Don't add the assembly
21323         name for type arguments.
21324
21325 2005-06-15  Martin Baulig  <martin@ximian.com>
21326
21327         * reflection.c (mono_image_get_inflated_method_token): Encode
21328         correct klass; fixes #75260.
21329
21330 2005-06-13 Michal Moskal <malekith@nemerle.org>
21331
21332         * icall.c: Make GetCorrespondingMethod/Constructor take
21333         MonoReflectionMethod method not MonoMethod. Removed
21334         MonoType.GetCorrespondingField, and make
21335         MonoGenericType.GetCorrespondingField take name not
21336         MonoClassField.
21337
21338 2005-06-13  Michal Moskal <malekith@nemerle.org>
21339
21340         * reflection.c (field_encode_signature, encode_locals):
21341          Make sizes of buffers for types larger (for big generic types).
21342          (create_generic_typespec,
21343          mono_reflection_sighelper_get_signature_local,
21344          mono_reflection_sighelper_get_signature_field):
21345          Add asserts for too small buffers.
21346
21347 2005-06-15  Martin Baulig  <martin@ximian.com>
21348
21349         * icall.c (ves_icall_MonoGenericClass_GetParentType): Return NULL
21350         if our parent is not a dynamic type.
21351
21352 2005-06-15  Martin Baulig  <martin@ximian.com>
21353
21354         * class-internals.h (MonoTypeNameFormat): New enum.
21355
21356         * class.c
21357         (mono_class_get_name_full): Renamed to mono_type_get_name_full().
21358         (mono_type_get_full_name): Removed.
21359         (mono_type_get_name_full): Take a `MonoTypeNameFormat format'
21360         argument instead of the boolean's.
21361
21362         * icall.c (ves_icall_System_MonoType_getFullName):
21363         Added `gboolean assembly_qualified'.    
21364
21365         * reflection.h
21366         (MonoTypeNameParse): Added `GPtrArray *type_arguments'.
21367
21368         * reflection.c (mono_reflection_parse_type): Parse the new type
21369         name format.
21370
21371 2005-06-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21372
21373         * icall.c: no need to convert from utf16 to utf8 and then back again
21374         after the call to GetLogicalDrives.
21375
21376 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21377
21378         * icall.c: frombase64. Fix problems exposed by new tests.
21379
21380 2005-06-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21381
21382         * icall.c: added internal calls for converting char [] and strings in
21383         base64 into byte [].
21384
21385 2005-06-10  Martin Baulig  <martin@ximian.com>
21386
21387         * class.c (mono_class_create_generic_2): Read the nested classes
21388         from the metadata rather than from `gklass->nested_classes' since
21389         `gklass' might not be initialized yet.
21390
21391 2005-06-09  Duncan Mak  <duncan@novell.com>
21392
21393         * *.h: Added G_BEGIN_DECLS and G_END_DECLS where appropriate to
21394         all public headers. Fixes #74919.
21395
21396 2005-06-09  Lluis Sanchez Gual  <lluis@novell.com>
21397
21398         * domain.c: The key for proxy_vtable_hash is now a pointer
21399         array. Added new GHashFunc and GCompareFunc functions for this.
21400
21401         * class.h: The list of interfaces in MonoRemoteClass is known in
21402         advance and can't grow (we create a new MonoRemoteClass if needed),
21403         so now the interface array can be allocated together with
21404         MonoRemoteClass.
21405         
21406         * object.c: Added a new method create_remote_class_key.
21407         Fixed mono_remote_class so it does not depend on
21408         mono_upgrade_remote_class.
21409         Removed extend_interface_array.
21410         Added new method clone_remote_class(), which makes a copy of a remote
21411         class and adds a new interface or class to it.
21412         mono_upgrade_remote_class() now creates a new remote class (or gets
21413         it from the cache) if an vtable upgrade is needed. In this way
21414         we make sure that other objects sharing the same remote class
21415         don't get the new vtable with unwanted interfaces.
21416         
21417         * object-internals.h:
21418         * object.h: Moved mono_upgrade_remote_class to object-internals.h.
21419         
21420         * marshal.c: Track changes in mono_upgrade_remote_class().
21421
21422 2005-06-08  Kamil Skalski <nazgul@nemerle.org>
21423         * icall.c: Add runtime methods for obtaining members of inflated
21424         class, which were created from supplied non-inflated members. It
21425         is used in internal Get{Method,Constructor,Field} methods in
21426         System.Type
21427
21428 2005-06-09  Martin Baulig  <martin@ximian.com>
21429
21430         * reflection.c
21431         (mono_reflection_bind_generic_method_parameters): Fix #75169.
21432
21433 2005-06-08  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21434         * reflection.c (mono_image_basic_init): Define
21435         Version in MonoDynamicAssembly. 
21436         
21437 2005-06-08  Martin Baulig  <martin@ximian.com>
21438
21439         Fix #75136.
21440
21441         * loader.c
21442         (mono_method_signature_full): New public method; takes a
21443         `MonoGenericContext *'.
21444         (find_method): Use mono_method_signature_full() and pass the
21445         klass'es context to it.
21446
21447         * class.c (mono_class_is_inflated_method): Use
21448         mono_method_signature_full() and pass the context to it.
21449
21450 Wed Jun 8 19:26:38 CEST 2005 Paolo Molaro <lupus@ximian.com>
21451
21452         * object.c: add proper locking in mono_remote_class_vtable(),
21453         fixes possible memory corruption.
21454
21455 2005-06-08  Michael Meeks  <michael.meeks@novell.com>
21456
21457         * marshal.c (mono_remoting_marshal_init): set
21458         initialized after initialization.
21459
21460 2005-06-08  Atsushi Enomoto  <atsushi@ximian.com>
21461
21462         * locales.c : hush.
21463
21464 2005-06-06  Michael Meeks  <michael.meeks@novell.com>
21465
21466         * object.c (extend_interface_array): fix really silly
21467         memory corrupting / comparison bug.
21468
21469 2005-06-07  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21470
21471         * reflection.c: Functions added to support the creation
21472         of CustomAttributeData, which includes Attribute data
21473         used by ReflectionOnly methods.
21474
21475         * reflection.h:  mono_reflection_get_custom_attrs_data and
21476          mono_custom_attrs_data_construct added (functions exposed).
21477
21478          * icall.c: Added mono_reflection_get_custom_attrs_data
21479          as icall.
21480         
21481 2005-06-07  Zoltan Varga  <vargaz@freemail.hu>
21482
21483         * Makefile.am (libmonoruntime_la_SOURCES): Revert last change at
21484         lupus's request.
21485
21486 2005-06-06  Zoltan Varga  <vargaz@freemail.hu>
21487
21488         * icall.c (ves_icall_Mono_Runtime_GetDisplayName): Fix warning.
21489
21490         * reflection.c (reflection_methodbuilder_to_mono_method): Fix encoding of
21491         dynamic DllImportAttribute.
21492
21493         * icall.c (ves_icall_MonoMethod_GetDllImportAttribute): Fix decoding of 
21494         dynamic DllImportAttribute.
21495
21496         * Makefile.am (libmonoruntimeinclude_HEADERS): Export tabledefs.h too.
21497         Fixes #75162.
21498
21499 2005-06-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21500
21501         * threads.c: avoid segfault when an unstarted thread is aborted.
21502
21503 2005-06-05  KornĂ©l Pál <kornelpal@hotmail.com>
21504
21505         * icall.c: Added ves_icall_Mono_Runtime_GetDisplayName:
21506         Returns the name and version of the runtime for reporting.
21507
21508 2005-06-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21509
21510         * appdomain.c: bump corlib version.
21511         * object-internals.h: new field in MonoReflectionAssembly.
21512
21513 2005-06-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21514
21515         * object-internals.h: Carlos forgot to add this field.
21516
21517 2005-06-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
21518
21519         * icall.c: Added create_version to create instances
21520         of Version of MonoReflectionAssemblyName. This change helps
21521         the AssemblyName tests to keep running fine.
21522         
21523 2005-06-03  Lluis Sanchez Gual  <lluis@novell.com>
21524   
21525         * object.c (mono_method_return_message_restore): A somehow less
21526         intrusive fix for #75138.
21527
21528 2005-06-03  Raja R Harinath  <rharinath@novell.com>
21529
21530         * object.c (mono_method_return_message_restore): Fix computation
21531         of expected number of out args.
21532
21533 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21534
21535         * reflection.c (mono_image_get_method_info): Fix the case when the
21536         charset is empty.
21537
21538 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com> 
21539
21540         * object.c: Added missing null check in
21541           mono_method_return_message_restore.
21542
21543 2005-06-02  Zoltan Varga  <vargaz@freemail.hu>
21544
21545         * reflection.c (mono_image_get_method_info): Handle the case when
21546         dllentry is empty.
21547
21548 2005-06-02  Lluis Sanchez Gual  <lluis@novell.com>
21549
21550         * object.c: When creating the vtable for a proxy, take into account
21551         all inherited interfaces, not only the ones registered in
21552         iclass->interfaces. This fixs bug #74996.
21553         Also, in mono_method_return_message_restore, verify that the array
21554         of out args has the expected lengh.
21555
21556 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21557
21558         * socket-io.c: update the timeout in Poll when the call is interrupte.
21559
21560 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21561
21562         * socket-io.c: support abort/suspend in Select_internal after last
21563         change.
21564
21565 2005-06-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21566
21567         * threadpool.c: remove warning.
21568
21569 2005-06-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21570
21571         * icall.c:
21572         * socket-io.[ch]: Select_internal uses poll() now when available, thus
21573         removing the 1024 limit from select(). Runtime part of the fix for
21574         bug #71203.
21575
21576 2005-05-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21577
21578         * socket-io.c: when resolving the addresses for the same
21579         host returned by gethostname(), get the local IPs from the interface
21580         list. Loopback addresses are discarded if the are interfaces up with
21581         non-loopback ones. Fixes bug #63265.
21582
21583 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
21584
21585         * appdomain.c, verify.c, object-internals.h, reflection.c:
21586         bumped corlib number to 36, and added new extra_flags field
21587         to ReflectionMethodBuilder and friends.  Fixes #75060.
21588
21589 Fri May 27 14:45:56 CEST 2005 Paolo Molaro <lupus@ximian.com>
21590
21591         * gc.c: register a new weak link only if the object is non-null
21592         (fixes bug#75047).
21593
21594 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21595
21596         * culture-info.h : short time pattern too.
21597
21598 2005-05-26  Atsushi Enomoto  <atsushi@ximian.com>
21599
21600         * culture-info.h : expand long time pattern string length.
21601
21602 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21603
21604         * culture-info-table.h : update (more French date format; #72788).
21605
21606 2005-05-25  Zoltan Varga  <vargaz@freemail.hu>
21607
21608         * icall.c (ves_icall_InternalInvoke): Avoid type checks on this if
21609         the method is static. Fixes #75029.
21610
21611 2005-05-25  Lluis Sanchez Gual  <lluis@novell.com>
21612
21613         * reflection.c: Update the table_idx field of method builders after
21614         saving the module, since it can change. This is a workaround for
21615         bug #74914. 
21616
21617 2005-05-25  Atsushi Enomoto  <atsushi@ximian.com>
21618
21619         * culture-info-table.h : update (additional French date format).
21620
21621 2005-05-20  Zoltan Varga  <vargaz@freemail.hu>
21622
21623         * icall.c (ves_icall_type_Equals): Revert last change.
21624         
21625         * icall.c (ves_icall_type_Equals): Turn the g_print into an assert.
21626
21627         * icall.c (ves_icall_type_GetTypeCode): Rename the icall to GetTypeCodeInternal.
21628
21629 2005-05-20  Sebastien Pouliot  <sebastien@ximian.com>
21630
21631         * class-internals.h: Added executioncontext_class field to 
21632         MonoDefaults structure.
21633         * domain.c: Cache System.Threading.ExecutionContext class in 
21634         mono_defaults.
21635         * object.c: Capture the ExecutionContext for asynchroneous calls in
21636          mono_async_result_new.
21637         * object-internals.h: Added execution_context and original_context 
21638         fields to MonoAsyncResult. Added execution_context to MonoThread.
21639         * security-manager.c|.h: Added mono_get_context_capture_method to 
21640         return the capture method (if required by the security manager or by
21641         the framework version used).
21642         * threadpool.c: Apply capture (if present) ExecutionContext in 
21643         mono_async_invoke and revert to original context after it completes.
21644
21645 2005-05-19  Atsushi Enomoto  <atsushi@ximian.com>
21646
21647         * culture-info-table.h : updated (real hacky solution for zh-CHT).
21648
21649 2005-05-18  Atsushi Enomoto  <atsushi@ximian.com>
21650
21651         * culture-info-table.h : zh-CHT related workaround.
21652
21653 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21654
21655         * marshal.c (emit_marshal_custom): Add some error checking and call the
21656         methods in the ICustomMarshaler interface. Fixes #74875.
21657         
21658         * marshal.c (emit_marshal_array): Implement [Out] marshalling in
21659         native->managed wrappers.
21660
21661 2005-05-12  Martin Baulig  <martin@ximian.com>
21662
21663         * mono-debug-debugger.cs (mono_debugger_lock/unlock): Always lock
21664         here and use the loader lock.
21665
21666         * mono-debug.c: Properly lock when the debugger is not attached.
21667         (mono_debug_init): Release the initial lock if we're not running
21668         in the debugger.
21669
21670 2005-05-12  Zoltan Varga  <vargaz@freemail.hu>
21671
21672         * marshal.c (emit_marshal_custom): Pass through NULL values without
21673         calling the custom marshalling routines.
21674
21675         * marshal.c (emit_ptr_to_object_conv): Implement ftnptr->delegate
21676         conversion in structures. Fixes #74882.
21677
21678 2005-05-12  Atsushi Enomoto  <atsushi@ximian.com>
21679
21680         * culture-info-table.h : zh-* cultures were missing.
21681
21682 2005-05-12  Lluis Sanchez Gual  <lluis@novell.com>
21683
21684         * threads.c: Added a new event background_change_event which is signaled
21685         when a thread changes its background mode.
21686         Moved here several checks previously done in managed code. The checks
21687         require the thread lock, and using the thread lock in managed code
21688         can result in deadlocks.
21689         Merged Start_internal and Thread_internal into a single method. Now 
21690         Thread_internal does all work of creating and starting a thread.
21691         Added icalls for setting and getting the state of the object. Moved from
21692         managed code to avoid locking there.
21693         Added wait_for_tids_or_state_change() which is called instad of
21694         wait_for_tids when waiting for non-backround threads to end. This method
21695         will return if one of the threads ends or the background_change_event
21696         is signaled.
21697         * threadpool.c: use ves_icall_System_Threading_Thread_SetState() to set
21698         the background mode. This method signals the background_change_event
21699         event.
21700         * icall.c:
21701         * threads-types.h: Added icalls for ClrState, SetState and GetState, and
21702         removed Start_internal.
21703         
21704 2005-05-11  Martin Baulig  <martin@ximian.com>
21705
21706         * mono-debug.h (MonoSymbolTable, MonoDebugMethodAddress): Changed
21707         to order of some fields to get proper alignment on 64-bit machines.
21708
21709 2005-05-11  Martin Baulig  <martin@ximian.com>
21710
21711         * mono-debug.c, mono-debug-debugger.c: Revert Paolo's locking
21712         changes as they're broken and completely fuck up the debugger.
21713
21714         * mono-debug.c (mono_debug_add_method): Properly unlock on error.
21715
21716 2005-05-10  Martin Baulig  <martin@ximian.com>
21717
21718         * reflection.c (mono_reflection_generic_class_initialize): Don't
21719         call mono_class_setup_parent() here.
21720
21721 2005-05-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21722
21723         * metadata/socket-io.c: on windows, getsockopt/setsockopt for
21724         send/receive timeout use an integer in milliseconds. We were using a
21725         struct timeval.
21726
21727 2005-05-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21728
21729         * locales.c:
21730         (internal_get_cultures): reserve the first slot of the array for the
21731         InvariantCulture, which will be filled in managed code.
21732
21733 2005-05-06  Zoltan Varga  <vargaz@freemail.hu>
21734
21735         * reflection.c (mono_image_fill_module_table): Initialize the
21736         GENERATION field as well.
21737
21738 2005-05-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21739
21740         * monitor.c: ignore calls to Monitor.Exit even if no one ever called
21741         Monitor.Enter on the object.
21742
21743 2005-05-05  Lluis Sanchez Gual  <lluis@novell.com>
21744
21745         * threads.c: Enable the wait for running threads when exiting.
21746         * icall.c: Suspend all threads before exiting.
21747
21748 2005-05-05  Zoltan Varga  <vargaz@freemail.hu>
21749
21750         * assembly.c (mono_assembly_load_reference): Fix warning.
21751
21752 2005-05-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21753
21754         * threadpool.c: changed the default number of threads per cpu. From now
21755         on, the default will be 20 + (5 * number of cpus) instead of 50.
21756
21757 2005-05-04  Zoltan Varga  <vargaz@freemail.hu>
21758
21759         * loader.c (mono_method_get_signature_full): Add locking here.
21760
21761 2005-05-03  Lluis Sanchez Gual <lluis@novell.com>
21762
21763         * appdomain.c: Moved methods for parsing and freeing assembly
21764         names to assembly.c.
21765         * assembly.c, domain-internals.h: Created public methods for parsing
21766         assembly names. Fixed mono_assembly_load_with_partial_name:
21767         it now finds the best match, taking into account the version,
21768         token and culture specified in the partial name. Also return
21769         the latest version if no version information is specified.
21770
21771 Mon May 2 15:47:57 CEST 2005 Paolo Molaro <lupus@ximian.com>
21772
21773         * threadpool.c: replace check for SocketAsyncCall class.
21774
21775 2005-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21776
21777         * threadpool-internals.h:
21778         * Makefile.am: added threadpool-internals.h
21779
21780         * threadpool.c: call mono_unhandled_exception on exceptions not handled
21781         that happen in threadpool threads (tested on MS).
21782         (mono_thread_pool_remove_socket): new function that dispatch any pending
21783         AIO call on a socket that is closing. By now only epoll really needs it,
21784         as select/poll wake up when the socket closes.
21785
21786
21787         * socket-io.c: call mono_thread_pool_remove_socket in Close_internal.
21788
21789 2005-05-01  Zoltan Varga  <vargaz@freemail.hu>
21790
21791         * marshal.c (mono_marshal_get_managed_wrapper): Handle changing the calling convention.
21792
21793 2005-05-01  Lluis Sanchez Gual  <lluis@novell.com>
21794
21795         * gc.c: In mono_gc_cleanup(), wait for 2 seconds, not 2000 seconds.
21796
21797 2005-04-30  Lluis Sanchez Gual  <lluis@novell.com>
21798
21799         * threads.c: In mono_thread_suspend_all_other_threads, if a thread
21800         has an abort request, convert it into a suspend request.
21801
21802 2005-04-30  Ben Maurer  <bmaurer@ximian.com>
21803
21804         * marshal.c (mono_marshal_get_managed_wrapper): give a friendly
21805         warning for the usage of `UnmanagedFunctionPointerAttribute' which
21806         is not supported yet.
21807
21808 2005-04-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21809
21810         * image.c: register assemblies loaded from data (bundles) in the loaded
21811         assemblies hash. Fixes bug #74772.
21812
21813 2005-04-29  Martin Baulig  <martin@ximian.com>
21814
21815         * class.c (mono_type_get_name_recurse): Update to the new naming
21816         schema from the latest .NET 2.x beta2.
21817         (mono_class_setup_vtable_general): If we're a generic instance,
21818         copy the vtable from our generic type definition and inflate all
21819         the methods in it.
21820
21821         * loader.c (find_method): Update to the new naming schema from the
21822         latest .NET 2.x beta2.
21823
21824 2005-04-29  Raja R Harinath  <harinath@gmail.com>
21825
21826         * class.c (mono_class_init): Add a mono_loader_unlock to the
21827         #74734 fix.
21828
21829 2005-04-28  Zoltan Varga  <vargaz@freemail.hu>
21830
21831         * icall.c (ves_icall_System_Environment_Exit): Remove the 
21832         suspend_all_other_threads () call for the time being, since it can hang.
21833
21834         * threads.c (mono_thread_manage): Similarly, disable the waiting for
21835         the background threads to exit, since it can also hang.
21836
21837         * class.c (mono_class_init): Applied patch from Ankit Jain 
21838         (radical@gmail.com). Avoid pending init errors when a field refers
21839         to a nested class using a typeref. Fixes #74734.
21840
21841         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): Fix
21842         this for dynamic modules.
21843
21844 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21845
21846         * threads.c: don't wait for threads that are in the process of aborting
21847         or aborted. Set the 'shutting_down' flag before cleaning the threadpool
21848         and waiting for background threads to finish. This makes xsp and
21849         mod-mono-server exit without random length delays and/or hangs.
21850
21851 2005-04-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21852
21853         * icall.c: remove duplicate assignment from GetReferencedAssemblies.
21854
21855 2005-04-25  Zoltan Varga  <vargaz@freemail.hu>
21856
21857         * class.c (mono_class_is_assignable_from): Call is_assignable_to for
21858         dynamic types to prevent infinite loops. Fixes #74727.
21859
21860         * reflection.c (mono_reflection_call_is_assignable_from): Rename to
21861         ..._is_assignable_to.
21862
21863 2005-04-25  Sebastien Pouliot  <sebastien@ximian.com>
21864
21865         * security.c: Fixed #74698 where sysconf returned -1 on FreeBSD.
21866
21867 2005-04-25  Martin Baulig  <martin@ximian.com>
21868
21869         Upgrade to the latest .NET 2.x beta (Visual Studio 2005 Beta 2).
21870
21871         * domain.c
21872         (supported_runtimes): Change "v2.0.40607" -> "v2.0.50215".
21873
21874         * row-indexes.h (MONO_GENERICPARAM_KIND): Removed.
21875
21876         * reflection.c (build_compressed_metadata): Set metadata header
21877         version to 2.0.
21878
21879 2005-04-23  Zoltan Varga  <vargaz@freemail.hu>
21880
21881         * sysmath.c (ves_icall_System_Math_Round2): Use modf to decompose the
21882         number into an integral and a decimal part. Fixes #70473.
21883
21884         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): Ignore static fields. Fixes #74703.
21885
21886 2005-04-23  Atsushi Enomoto  <atsushi@ximian.com>
21887
21888         * culture-info-table.h : reflected the latest locale-builder output.
21889
21890 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21891
21892         * threadpool.c: check for SuspendRequested too when deciding if
21893         mono_thread_interruption_checkpoint should be called.
21894
21895 2005-04-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21896
21897         * appdomain.[ch]: added function to set the shutting_down flag to TRUE.
21898         * threads.c: remove interruption_mutex and use Interlocked instead. When
21899         suspending all the threads, wait for all the suspended events at once.
21900         If we're shutting down and get an APC that is going to be queued,
21901         call mono_thread_execute_interruption immediately, as the thread might
21902         be sleeping on a pthread condition or mutex.
21903
21904         * icall.c: call mono_runtime_set_shutting_down before suspending the
21905         threads.
21906
21907         Fixes bug #74693. And now xsp is happier when exiting.
21908
21909 2005-04-22  Zoltan Varga  <vargaz@freemail.hu>
21910
21911         * loader.c (mono_stack_walk): Fix #74690.
21912
21913 2005-04-22  Martin Baulig  <martin@ximian.com>
21914
21915         * mono-debug.h (MonoDebugMethodJitInfo): Added
21916         `MonoDebugMethodJitInfo *jit'.
21917
21918         * mono-debug.c (mono_debug_read_method): Cache the
21919         MonoDebugMethodJitInfo in `address->jit'.
21920         (mono_debug_free_method_jit_info): New public method.
21921
21922 2005-04-22  Martin Baulig  <martin@ximian.com>
21923
21924         * class.c (mono_class_is_assignable_from): Disallow
21925         type parameter -> interface.
21926
21927 2005-04-21  Dick Porter  <dick@ximian.com>
21928
21929         * threads.c (mono_thread_create): Turn an assertion into an error.
21930
21931 2005-04-20  Zoltan Varga  <vargaz@freemail.hu>
21932
21933         * threads.c object.c icall.c: Fix some gcc 4.0 warnings.
21934         
21935         * threads.c marshal.h marshal.c exceptions.h exceptions.c appdomain.c: 
21936         Fix some gcc 4.0 warnings.
21937
21938 Wed Apr 20 16:09:06 CEST 2005 Paolo Molaro <lupus@ximian.com>
21939
21940         * file-io.c: fix alt dir separator char on unix systems
21941         and cleanup (fixes bug #71214).
21942
21943 2005-04-19  Lluis Sanchez Gual  <lluis@novell.com>
21944
21945         * marshal.c: Use CALLVIRT instead of CALL when dispatching
21946         a call to a remote domain, since the method may be an
21947         interface method in the client domain. This fixes bug #74192.
21948
21949 2005-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21950
21951         * threadpool.c: recv/send are now performed before going back to managed
21952         code to save one transition.
21953
21954 2005-04-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21955
21956         * metadata/socket-io.c: fixed semantics in Socket.Blocking icall.
21957
21958         * metadata/threadpool.c: removed hack to workaround the bug above.
21959
21960         Fixes bug #74618.
21961
21962 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
21963
21964         * reflection.c reflection.h: Fix handling of parameter defaults in
21965         dynamic methods. Also fixes handling of parameter attributes.
21966         Fixes #74609.
21967
21968         * mono-debug.c (mono_debug_close_image): Fix warning.
21969
21970 2005-04-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21971
21972         * socket-io.h: replaced old unused field with new 'blocking'.
21973         * threadpool.c: restore socket blocking state on windows(tm).
21974
21975 2005-04-14  Sebastien Pouliot  <sebastien@ximian.com>
21976
21977         * icall.c: don't return the codebase in the AssemblyName[] returned by
21978         ves_icall_System_Reflection_Assembly_GetReferencedAssemblies.
21979         * object-internals.h: Removed FIXME (fields were presents) and fixed
21980         versioncompat declaration.
21981
21982 2005-04-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21983
21984         * threadpool.c: sometimes we get EBADF from epoll but the epollfd is
21985         not closed, so don't cleanup when it happens.
21986
21987 2005-04-13  Chris Toshok  <toshok@ximian.com>
21988
21989         * mono-debug-debugger.h: change prototype for
21990         mono_debugger_lookup_type.
21991
21992         * mono-debug-debugger.c (mono_debugger_lookup_type): reinstate
21993         this function, although it should probably be named
21994         mono_debugger_init_type.
21995
21996 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
21997
21998         * threadpool.c: fix non-AIO case.
21999
22000 2005-04-13  Zoltan Varga  <vargaz@freemail.hu>
22001
22002         * profiler.c (mono_profiler_install_simple): Add a 'jit' option to
22003         the built-in profiler to measure just JIT compilation times.
22004
22005 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22006
22007         * threadpool.c: the epollfd might be closed by another thread at
22008         any time, so ignore EBADF at treat it as a "we're closing" sign.
22009
22010 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22011
22012         * threadpool.c: release the semaphores with a count equals to the number
22013         of working threads in both IO and regular pools. Fixed typo that messed
22014         up the count of IO pool threads. Don't initialize the pipe handles if
22015         we're using epoll.
22016
22017 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22018
22019         * threadpool.c: some systems don't like a NULL when deleting the socket
22020         from epoll.
22021
22022 2005-04-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22023
22024         * threadpool.c: fix semaphore allocation.
22025
22026 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22027
22028         * threadpool.c: added epoll() based implementation for asynchronous IO
22029         that is used instead of the default poll() when available.
22030         It can be disabled by setting MONO_DISABLE_AIO.
22031
22032 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22033
22034         * threadpool.c: windows needs 'closesocket' and instead of returning
22035         0 when the stream is closed while in select, it returns -1. Fixes bug
22036         #74573.
22037
22038 2005-04-12  Zoltan Varga  <vargaz@freemail.hu>
22039
22040         * class.c (class_compute_field_layout): Fix the regression caused by
22041         the previous try.
22042
22043 2005-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22044
22045         * threadpool.c: separate pool for socket async. IO.
22046         * threadpool.h: mono_max_worker_threads is not a global any more.
22047
22048 2005-04-10  Zoltan Varga  <vargaz@freemail.hu>
22049
22050         * class.c (class_compute_field_layout): Fix #74549.
22051
22052 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22053
22054         * threadpool.c: select() on windows doesn't allow pipe handles, soooo
22055         use 2 connected sockets instead.
22056
22057 2005-04-08  Miguel de Icaza  <miguel@novell.com>
22058
22059         * mono-config.c: Add new entry point for mkbundle
22060         mono_config_parse_memory. 
22061
22062 2005-04-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22063
22064         * threadpool.c: removed another unused function.
22065
22066 2005-04-08  Ankit Jain  <radical@corewars.org>
22067
22068         * reflection.c (get_default_param_value_blobs): Add 'types'
22069         parameter to get the types encoded in the constant table.
22070         (mono_param_get_objects): Use the type from the constant table,
22071         not the type of the parameter, when creating default values.
22072         Handle null default values correctly.
22073
22074 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22075
22076         * file-io.c:
22077         * file-io.h:
22078         * threadpool.c:
22079         * threadpool.h:
22080         * icall.c:
22081         * socket-io.c: removed dead code for async IO.
22082
22083 2005-04-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22084
22085         * socket-io.h: 2 more fields in MonoSocketAsyncResult.
22086
22087         * threadpool.c: intercept socket async. calls and pass them to a thread
22088         that is polling and dispatching the job items to the threadpool as
22089         socket become ready. Fixes bugs #71217, #71933.
22090
22091         * icall.c: Removed AsyncReceive and AsyncSend. Speed up for copies
22092         between char and short/ushort arrays.
22093
22094         * socket-io.c: remove dead code.
22095
22096 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
22097
22098         * locales.c,
22099           icall.c : removed InternalToUpper_Comp() and
22100           InternalToLower_Comp().
22101
22102 2005-04-06  Atsushi Enomoto  <atsushi@ximian.com>
22103
22104         * char-conversions.h : The tables were incorrectly generated. Should
22105           be generated against invariant culture.
22106
22107 2005-04-04  Zoltan Varga  <vargaz@freemail.hu>
22108
22109         * object.c (mono_runtime_invoke_array): Fix return value when 
22110         passing pre-created valuetype objects to ctors.
22111
22112         * gc.c (mono_gchandle_is_in_domain): Applied patch from Jon Larimer 
22113         (jlarimer@gmail.com). Avoid crashes when the wrapper object is null.
22114         Fixes #74338.
22115
22116 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
22117
22118         * domain.c: removed g_assert for runtimesecurityframe_class. This is 
22119         only used with --security and hides the wrong corlib version error.
22120
22121 2005-03-30  Joshua Tauberer  <tauberer@for.net>
22122
22123         * class.c: Changed mono_class_name_from_token so that types
22124         outside of a namespace don't have an initial period.  Improved
22125         the g_warning message used in _mono_class_get when loading
22126         fails.
22127         * assembly.c: In mono_assembly_load_reference, when an assembly
22128         can't be found, "No such file or directory" is misleading and
22129         unhelpful because a few paths were checked for the presence of
22130         the assembly.  When that happens (ENOENT), display a nicer
22131         message indicating the directories that were searched.  In all
22132         cases, the warning is made easier to read for non-hackers.
22133
22134 2005-03-29  Sebastien Pouliot  <sebastien@ximian.com>
22135
22136         * assembly.c: Set MONO_ASSEMBLIES to NULL when compiling from a VS.NET
22137         project/solution.
22138         * appdomain.h|domain.c: Removed inline from functions.
22139         * appdomain.c: Reduced warnings when compiling on windows.
22140         * icall.c: Fixed output_debug declaration to gunichar2*.
22141         * mono-config.c: Reduced warnings when compiling on windows.
22142         * rand.c: Added missing "windows.h". Added missing return value.
22143         * rawbuffer.c: Added missing winsock2.h for windows.
22144         * sysmath.h: Added mono-compiler.h header to allow/ease 
22145         compilation with non-GCC compilers.
22146         * threads.c: Fixed declarations to compile with VS.NET C compiler.
22147         Removed cast warnings.
22148
22149         Adapted from the work of J Lothian (for VC6).
22150
22151 2005-03-29  Zoltan Varga  <vargaz@freemail.hu>
22152
22153         * assembly.c (mono_assembly_load_corlib): Do not try loading corlib
22154         from default_path.
22155
22156 2005-03-27  Zoltan Varga  <vargaz@freemail.hu>
22157
22158         * marshal.c (mono_marshal_get_managed_wrapper): Fix bogus assert on
22159         the 2.0 profile.
22160
22161 2005-03-27  Raja R Harinath  <harinath@gmail.com>
22162
22163         * Makefile.am (assembliesdir): Fix.  If it is arch-dependent it
22164         has to be in $(exec_prefix).  $(prefix) is for arch-independent
22165         stuff, and it would probably use $(prefix)/share rather than
22166         $(prefix)/lib.
22167
22168 2005-03-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22169
22170         * console-io.c: added 2 includes that might be missing.
22171
22172 2005-03-24  Zoltan Varga  <vargaz@freemail.hu>
22173
22174         * marshal.c (mono_marshal_get_managed_wrapper): Fix crashes in 2.0
22175         profile.
22176
22177         * reflection.c (create_custom_attr): Allocate the params array using
22178         alloca so it gets GC tracking.
22179
22180 2005-03-23  Chris Toshok  <toshok@ximian.com>
22181
22182         * mono-debug-debugger.c (mono_debugger_runtime_invoke): comment
22183         out some spew.
22184
22185 2005-03-24  Raja R Harinath  <rharinath@novell.com>
22186
22187         * Makefile.am (assembly.lo, mono-config.lo): Rebuild when Makefile
22188         changes to pick up any changes in prefix, etc.
22189
22190 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
22191
22192         * marshal.c (mono_marshal_get_managed_wrapper): Remove fixme.
22193         
22194         * marshal.c (mono_marshal_get_managed_wrapper): Remove debugging output.
22195         * marshal.c (mono_marshal_get_managed_wrapper): Add support for the modopt(CallConvCdecl).
22196
22197 2005-03-23  Zoltan Varga  <vargaz@freemail.hu>
22198
22199         * class-internals.h object-internals.h class.c reflection.c: Extend the
22200         mono_lookup_dynamic_token () function to return the class of the
22201         token as well. 
22202
22203         * class.c (mono_ldtoken): Handle MEMBERREFS in the dynamic case as
22204         well. Fixes #73848.
22205
22206 2005-03-23  Sebastien Pouliot  <sebastien@ximian.com>
22207
22208         * security-manager.c: Skip inheritance checks for intra-corlib
22209         class inheritance and method overrides. This skips a lot of checks
22210         and (anyway) permissions cannot work until corlib is loaded.
22211
22212 2005-03-23  Martin Baulig  <martin@ximian.com>
22213
22214         * marshal.c (mono_marshal_get_stfld_wrapper): Add support for
22215         MONO_TYPE_GENERICINST.  
22216
22217 2005-03-23  Martin Baulig  <martin@ximian.com>
22218
22219         * metadata.c (mono_type_to_unmanaged): Add MONO_TYPE_GENERICINST.
22220
22221 Tue Mar 22 16:57:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22222
22223         * class.c: added locking comments to some functions.
22224         Cache the interface offsets arrays (saves about 20 KB
22225         of runtime memory in a typical app).
22226         Reduce the time overhead in mono_class_setup_supertypes ().
22227
22228 Tue Mar 22 16:35:57 CET 2005 Paolo Molaro <lupus@ximian.com>
22229
22230         * icall.c: speedup and fix leaks in GetMethodsByName and
22231         GetPropertiesByName.
22232
22233 Tue Mar 22 16:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22234
22235         * reflection.c: some locking fixes.
22236
22237 Tue Mar 22 15:13:54 CET 2005 Paolo Molaro <lupus@ximian.com>
22238
22239         * metadata.c: added missing break in case statement.
22240
22241 2005-03-22  Zoltan Varga  <vargaz@freemail.hu>
22242
22243         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22244         typedbyref return values. Fixes #73941.
22245
22246 2005-03-17  Sebastien Pouliot  <sebastien@ximian.com>
22247
22248         * security-manager.c|h: Added demandunmanaged method and 
22249         suppressunmanagedcodesecurity class to MonoSecurityManager.
22250         Renamed aptc class to allowpartiallytrustedcallers.
22251
22252 2005-03-17  Martin Baulig  <martin@ximian.com>
22253
22254         * class.c (inflate_generic_type): Add MONO_TYPE_ARRAY.
22255
22256 2005-03-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22257
22258         * file-io.c: disabled file async. IO using aio_*. It uses the
22259         threadpool now. Workaround for bug #73718.
22260
22261 Wed Mar 16 18:08:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22262
22263         * assembly.h, mono-config.c: added code to deal with bundled configs
22264         for bundled assemblies.
22265
22266 Wed Mar 16 16:34:38 CET 2005 Paolo Molaro <lupus@ximian.com>
22267
22268         * *.c, private.h: cleanup, removing old private.h header file.
22269
22270 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
22271
22272         * reflection.c (mono_image_get_method_info): Encode best_fit_mapping
22273         and throw_on_unmappable_char attributes.
22274
22275 2005-03-13  Sebastien Pouliot  <sebastien@ximian.com>
22276
22277         * process.c: Fix buffer length in ves_icall_System_Diagnostics_Process
22278         _ProcessName_internal.
22279
22280 2005-03-13  Zoltan Varga  <vargaz@freemail.hu>
22281
22282         * object.c (mono_array_new_full): Fix aligning of array size. Fixes
22283         #73631.
22284
22285         * icall.c threads.c threads-types.h: Remove slothash icalls as they
22286         are no longer used.
22287
22288 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
22289
22290         * object.c (compute_class_bitmap): Add support for generics. Fixes
22291         #73527.
22292
22293 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22294
22295         * reflection.c (mono_reflection_create_runtime_class): Fix 2.0 build.
22296
22297 2005-03-10 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22298
22299         * filewatcher.c: commented out the code for windows watcher, as we don't
22300         use it (we use the managed implementation instead).
22301
22302 2005-03-10  Zoltan Varga  <vargaz@freemail.hu>
22303
22304         * object-internals.h (MonoThread): Remove 'unused1' field.
22305
22306         * appdomain.c: Bump corlib version.
22307
22308         * marshal.c: Remove calls to Reset/RestoreDataStoreStatus ().
22309
22310         * reflection.c (mono_reflection_create_runtime_class): Remove the
22311         AssemblyBuilder.Save optimization since it causes too many problems.
22312
22313 2005-03-10  Sebastien Pouliot  <sebastien@ximian.com>
22314
22315         * exception.c|h: Added mono_get_exception_reflection_type_load to
22316         create a ReflectionTypeLoadException object.
22317         * icall.c: Updated ves_icall_System_Reflection_Assembly_InternalGetType
22318         to return NULL is a InheritanceDemand fails during reflection. Updated
22319         ves_icall_System_Reflection_Assembly_GetTypes to throw a 
22320         ReflectionTypeLoadException if an InheritanceDemand fails during 
22321         reflection. Added icall mapping for GetLinkDemandSecurity.
22322         * security-manager.c|h: Added ves_icall_System_Security_
22323         SecurityManager_GetLinkDemandSecurity internal call to return the
22324         class and methods permissions set for a LinkDemand. Removed unused
22325         fields in MonoSecurityManager.
22326
22327 2005-03-10  Martin Baulig  <martin@ximian.com>
22328
22329         * class.c (mono_bounded_array_class_get): Initialize `eclass' if
22330         it's a generic instance.
22331
22332 2005-03-09  Zoltan Varga  <vargaz@freemail.hu>
22333
22334         * reflection.c (mono_get_object_from_blob): Applied patch from
22335         Ankit Jain (radical@gmail.com). Fix enum default values. Fixes #73457.
22336
22337         * class.c (mono_class_is_assignable_from): Another try at fixing 
22338         #73469 without breaking anything.
22339
22340 2005-03-08  Zoltan Varga  <vargaz@freemail.hu>
22341
22342         * class.c: (mono_class_is_assignable_from): Revert the last changes
22343         since they don't work with generics.
22344         
22345         * class.c (mono_class_is_assignable_from): Fix build bustage.
22346
22347         * class.c (mono_class_is_assignable_from): If oklass is dynamic, call
22348         the managed IsAssignableFrom method. Fixes #73469.
22349
22350         * reflection.c (mono_reflection_call_is_assignable_from): New helper
22351         function.
22352
22353 2005-03-04  Zoltan Varga  <vargaz@freemail.hu>
22354
22355         * object.c (mono_load_remote_field_new): Fix returning uninitialized
22356         memory when the remoting callback does not sets the out arguments.
22357         Fixes #73007.
22358
22359         * marshal.c (mono_delegate_free_ftnptr): Remove debug array checked in
22360         by mistake.
22361
22362         * string-icalls.c: Return String.Empty where needed. Fixes #73310.
22363
22364         * object-internals.h (MonoStackFrame): Sync with managed object layout.
22365
22366         * appdomain.c: Bump corlib version.
22367
22368 2005-03-03  Zoltan Varga  <vargaz@freemail.hu>
22369
22370         * gc-internal.h boehm-gc.c null-gc.c: Add mono_gc_is_gc_thread () API
22371         function.
22372
22373         * threads.c (mono_thread_attach): Detect threads which are not started
22374         by the GC pthread wrappers.
22375
22376 2005-03-03  Sebastien Pouliot  <sebastien@ximian.com>
22377
22378         * icall.c: Added new icall for RNG.
22379         * rand.c|h: Added new icall to open the RNG. This allows to share a 
22380         single handle on Linux to access /dev/urandom and fix #73183.
22381
22382 Thu Mar 3 17:53:17 CET 2005 Paolo Molaro <lupus@ximian.com>
22383
22384         * object.c: setting the new vtable in a transparent proxy object must
22385         not change the GC descriptor.
22386
22387 Thu Mar 3 12:11:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22388
22389         * object.c: fixed compilation without GCJ support.
22390         * reflection.c: for runtime-created types ensure klass->has_references
22391         is correct (bug #73215).
22392
22393 2005-03-02  Martin Baulig  <martin@ximian.com>
22394
22395         * class.c (mono_class_is_assignable_from): Make this work if
22396         `oklass' is a generic instance; fixes #72831.
22397
22398 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22399
22400         * marshal.c (mono_marshal_get_managed_wrapper): Fix handling of methods
22401         with hasthis set.
22402         
22403         * marshal.c (emit_marshal_array): Emit native->managed marshalling of blittable arrays.
22404
22405         * marshal.c: Reorganize native->managed marshalling code to also use
22406         the emit_marshal_... functions.
22407
22408 Tue Mar 1 16:16:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22409
22410         * object.c: typed allocs have issues with bitmap sizes > 30,
22411         so check for max_set >= 30.
22412
22413 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
22414
22415         * marshal.c (emit_marshal_array): Implement marshalling of arrays to
22416         managed code. Fixes #73012.
22417
22418         * metadata.h (MonoMarshalSpec): Add elem_mult field.
22419
22420         * metadata.c reflection.c: Load/Emit elem_mult as well.
22421         
22422         * metadata.h (MonoMarshalSpec): Add comment.
22423
22424         * metadata.h: Add MONO_MARSHAL_CONV_LPTSTR_STR.
22425
22426         * metadata.c (mono_metadata_parse_marshal_spec): Set param_num and
22427         num_elem to -1 if not given.
22428
22429         * object-internals.h (MonoReflectionMarshal): Add has_size field.
22430
22431         * reflection.c (encode_marshal_blob): Differentiate between 0 and not
22432         given values.
22433
22434 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
22435
22436         * null-gc.c (mono_gc_free_fixed): Was not compilable.
22437
22438 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
22439
22440         * reflection.c (encode_marshal_blob): Encode param_num field as well.
22441
22442         * object-internals.h (MonoReflectionMarshal): Add param_num field.
22443
22444 Mon Feb 28 11:59:42 CET 2005 Paolo Molaro <lupus@ximian.com>
22445
22446         * object.c: generalized the reference bitmap creation
22447         and added hooks for the new GC.
22448         * class-internals.c: removed the gc_bitmap field from MonoClass.
22449
22450 Sat Feb 26 16:06:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22451
22452         * domain.c: help the compiler to produce better code
22453         in mono_jit_info_table_find ().
22454
22455 Fri Feb 25 16:50:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22456
22457         * object.c: make all allocations look typed.
22458
22459 Fri Feb 25 16:18:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22460
22461         * socket-io.c: load Mono.Posix if it's not loaded already
22462         (fixes bug#73033).
22463
22464 2005-02-24  Martin Baulig  <martin@ximian.com>
22465
22466         * class.c (dup_type): Correctly duplicate MONO_TYPE_PTR.
22467         * reflection.c (dup_type): Likewise.
22468
22469 2005-02-24  Zoltan Varga  <vargaz@freemail.hu>
22470
22471         * gc.c (run_finalize): Set the domain for finalizing delegates as well.
22472         Thanks to Willibald Krenn and Scott Mohekey for tracking this down.
22473
22474 Thu Feb 24 15:19:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22475
22476         * domain.c, threads.c, object-internals.h: make the critical thread
22477         local vars use the fast access mode (even when we're compiled in
22478         a lib). Provide accessors to be used by the jit during codegen.
22479
22480 2005-02-24  Carlos Alberto Cortez <calberto.cortez@gmail.com>
22481
22482         * appdomain.c: Changed hook functios behavior to include
22483         support for the reflection only assemblies. Some icalls were changed
22484         to support the mentioned assemblies too. Signatures of static methods
22485         try_assembly_resolve and real_load now have an additional parameter:
22486         refonly.
22487
22488         * assembly.c: General changes to mono_assembly_ methods to support
22489         reflection only api. Functions mono_assembly_open, mono_assembly_load,
22490         mono_assembly_load_from and mono_assembly_loaded have got a '_full'
22491         suffix, to support an additional gbool parameter to specify whether
22492         the assembli is reflection only or not. Created some new hook functions 
22493         to add support for reflection only assemblies. Signatures of static 
22494         methods load_in_path, search_loaded, and mono_assembly_load_from_gac 
22495         have now an additional parameter: refonly.
22496
22497         * metadata-internals.h: MonoAssembly now has a gbool ref_only flag,
22498         indicating whether the assembly is reflection only or not.
22499
22500         * exception.c: Add mono_get_exception_invalid_operation.
22501
22502         * icall.c: Throw an InvalidOperationException when trying to invoke
22503         a property/method/event, or trying to set/get the value of a field.
22504         Also add an icall to retrieve the ref_only flag to the
22505         MonoReflectionAssembly.
22506
22507 2005-02-23  Chris Toshok  <toshok@ximian.com>
22508
22509         Part of fix for #72827.
22510         * mono-debug.c (mono_debug_add_method): add lexical block data to
22511         the info we write.  Kind of a hack at the moment - we copy the
22512         lexical block info from the MonoDebugMethodInfo to the
22513         MonoDebugMethodJitInfo here, before writing it.
22514         (mono_debug_read_method): read the lexical block info.
22515
22516         * mono-debug.h (_MonoDebugMethodJitInfo): add lexical block slots.
22517
22518         * debug-mono-symfile.h: add lexical block support.
22519
22520         * debug-mono-symfile.c (mono_debug_find_method): add lexical block
22521         support.
22522
22523 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22524
22525         * loader.c (mono_lookup_pinvoke_call): Fix warning.
22526
22527         * object.c (mono_runtime_free_method): Call mono_free_method () and
22528         put the TODOs there.
22529
22530         * loader.c (mono_free_method): Free up most memory allocated for 
22531         dynamic methods.
22532
22533 Wed Feb 23 18:54:26 CET 2005 Paolo Molaro <lupus@ximian.com>
22534
22535         * reflection.c: properly flag a Type argument to a
22536         named custom attr value (bug #72248).
22537
22538 Wed Feb 23 18:32:35 CET 2005 Paolo Molaro <lupus@ximian.com>
22539
22540         * reflection.c: reduce code duplication in named custom
22541         attribute encoding.
22542
22543 Wed Feb 23 17:23:52 CET 2005 Paolo Molaro <lupus@ximian.com>
22544
22545         * reflection.c: properly encode custom attrs of type object
22546         (bug #72649).
22547
22548 2005-02-23  Zoltan Varga  <vargaz@freemail.hu>
22549
22550         * marshal.c (mono_delegate_free_ftnptr): Make this thread safe.
22551
22552 Tue Feb 22 21:54:47 CET 2005 Paolo Molaro <lupus@ximian.com>
22553
22554         * socket-io.c: load System.dll if it's not loaded already
22555         (bug #72850 and #70477).
22556
22557 2005-02-21  Martin Baulig  <martin@ximian.com>
22558
22559         * marshal.c (mono_marshal_get_runtime_invoke): Add support for
22560         generic instances.
22561
22562 2005-02-21  Martin Baulig  <martin@ximian.com>
22563
22564         * reflection.c (mono_image_build_metadata): We also need to
22565         "fixup" the MethodImpl table after we computed the final method
22566         indices.  Call fixup_methodimpl() to do that.
22567         (fixup_methodimpl): New private method.
22568
22569 Mon Feb 21 16:17:14 CET 2005 Paolo Molaro <lupus@ximian.com>
22570
22571         * assembly.c: special case mscorlib.dll (bug#72536),
22572         patch from Carlos Alberto Cortez.
22573
22574 2005-02-20  Zoltan Varga  <vargaz@freemail.hu>
22575
22576         * threads-types.h threads.c: Fix build bustage.
22577
22578         * threads.c: Use a union for long<->double conversions.
22579
22580         * threads-types.h threads.c icall.c: Implement the net 2.0 interlocked
22581         functions based on a patch by Luca Barbieri (luca.barbieri@gmail.com).
22582
22583         * marshal.c (emit_thread_interrupt_checkpoint_call): Mark the bblock 
22584         containing the checkpoint call with NOT_TAKEN.
22585         
22586         * marshal.c (mono_marshal_get_managed_wrapper): Emit interrupt 
22587         checkpoint before pushing the arguments, so they won't have to be
22588         spilled to stack.
22589
22590 Sat Feb 19 15:19:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22591
22592         * domain.c, assembly.c, domain-internals.h: make some data
22593         const and relocation-free.
22594
22595 Sat Feb 19 11:12:34 CET 2005 Paolo Molaro <lupus@ximian.com>
22596
22597         * object.c, appdomain.c, class-internals.h: introduce the
22598         MonoClassRuntimeInfo structure to hold the info needed to
22599         use a class at runtime. Made mono_class_vtable() lock-free
22600         for all the appdomains.
22601
22602 Sat Feb 19 11:11:12 CET 2005 Paolo Molaro <lupus@ximian.com>
22603
22604         * metadata-internals.h, image.c: introduce a per-image mempool to
22605         be used for memory that has the same lifetime as the image.
22606
22607 2005-02-18  Lluis Sanchez Gual  <lluis@novell.com>
22608
22609         * domain.c: In mono_init_internal(), instead of selecting the first
22610         runtime version supported by an executable, get a list of all
22611         supported versions and select the one for which an mscorlib exists
22612         (since even if the runtime supports a given version, it doesn't mean
22613         that the framework for that version is installed).
22614         Modified get_runtimes_from_exe to support this behavior.
22615         In supported_runtimes, added information about additional system
22616         assembly versions.
22617         
22618         * assembly.c: Added support for more than one system assembly version
22619         per runtime version. Updated the assembly list.
22620         In mono_assembly_remap_version, removed the initial version check,
22621         since we don't know to which version we need to compare until we
22622         get the version set on which the assembly is based.
22623         Moved the code for loading corlib into the new method
22624         mono_assembly_load_corlib(), so it can be used by the initialization
22625         code.
22626         
22627         * domain-internals.h: Updated data structures and added declaration
22628         for mono_assembly_load_corlib.
22629
22630 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22631
22632         * reflection.c (resolve_object): Fix the creation of the signature in 
22633         the SignatureHelper case.
22634
22635         * assembly.c (mono_assembly_remap_version): Fix binary search.
22636         
22637 2005-02-17  Sebastien Pouliot  <sebastien@ximian.com>
22638  
22639         * class.c: Added inheritance check when a method is overloaded (from a
22640         virtual method or when implementing an interface) and when a class is
22641         inherited. Added functions to set a failure for a class and to 
22642         retreive the exception from a failure.
22643         * class-internals.h: Added fields to MonoClass to keep the exception
22644         information status for inheritance (or other exceptions) to be thrown
22645         later (i.e. not at load time).
22646         * object.c: Throw the inheritance SecurityException when a type is to 
22647         be created with either class or method inheritance violations.
22648         * reflection.c|h: Fix when getting declsec from a class. Removed 
22649         unrequired code for class. Improved sanity in parameter naming.
22650         * security-manager.c|h: Added functions to check for class and method
22651         inheritance.
22652
22653 2005-02-17  Zoltan Varga  <vargaz@freemail.hu>
22654
22655         * reflection.c (mono_reflection_create_runtime_class): Set has_cctor
22656         and has_finalize in dynamic types as well.
22657
22658 2005-02-17  Atsushi Enomoto  <atsushi@ximian.com>
22659
22660         * culture-info-table.h : fixed currency format for en-GB (and so on).
22661
22662 Wed Feb 16 16:28:15 CET 2005 Paolo Molaro <lupus@ximian.com>
22663
22664         * gc.c: ensure the GC handles never have 0 as a value.
22665
22666 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22667
22668         * marshal.c (emit_marshal_ptr): Raise an exception if trying to pass
22669         a pointer to a struct to unmanaged code. Fixes #72625.
22670
22671 2005-02-16  Martin Baulig  <martin@ximian.com>
22672
22673         * mono-debug.c (mono_debug_open_image): Ignore dynamic images.
22674
22675 2005-02-16  Zoltan Varga  <vargaz@freemail.hu>
22676
22677         * marshal.c (emit_marshal_array): Only marshal unicode char arrays as [Out].
22678
22679 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22680
22681         * loader.c (mono_lookup_pinvoke_call): Fix stdcall name mangling.
22682
22683         * marshal.c (mono_ftnptr_to_delegate): If the delegate has the 
22684         UnmanagedFunctionPointerAttribute, use it for determining calling convention
22685         etc. Fixes #71471.
22686
22687         * reflection.c (mono_custom_attrs_get_attr): New helper function.
22688
22689         * object-internals.h: Add MonoReflectionUnmanagedFunctionPointerAttribute.
22690
22691 Tue Feb 15 18:03:41 CET 2005 Paolo Molaro <lupus@ximian.com>
22692
22693         * domain.c, appdomain.c, appdomain.h, object-internals.h, object.h:
22694         changes to make the current context a field in MonoThread.
22695
22696 2005-02-15  Zoltan Varga  <vargaz@freemail.hu>
22697
22698         * marshal.c (mono_marshal_get_native_wrapper): Fix a crash caused by
22699         the last change.
22700         
22701         * marshal.c (mono_marshal_emit_native_wrapper): New helper function
22702         extracted from mono_marshal_get_native_wrapper.
22703
22704         * marshal.c (mono_marshal_get_native_func_wrapper): New helper function
22705         to create wrappers around native functions.
22706
22707         * marshal.c (mono_ftnptr_to_delegate): Add support for creating 
22708         delegates for arbitrary function pointers. Fixes #71472.
22709
22710 Tue Feb 15 11:01:09 CET 2005 Paolo Molaro <lupus@ximian.com>
22711
22712         * threads.c: cleaned up the code a little.
22713
22714 2005-02-15  Martin Baulig  <martin@ximian.com>
22715
22716         * mono-debug.h (MonoSymbolTable): Allow variable-length chunks in
22717         the data table.
22718
22719         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Set to 32768; we may now
22720         allocate larger chunks if needed.
22721
22722 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22723
22724         * threads.c (start_wrapper): Remove #ifdef PLATFORM_WIN32 probably left
22725         in by mistake.
22726
22727 Mon Feb 14 16:48:24 CET 2005 Paolo Molaro <lupus@ximian.com>
22728
22729         * domain.c: keep the domains in an array and ensure the domain ids
22730         are kept small, so they can be used as indexes to domain-specific data
22731         with a small memory overhead.
22732
22733 2005-02-14  Zoltan Varga  <vargaz@freemail.hu>
22734
22735         * icall.c: Handle byref types in Type icalls. Fixes #72544.
22736
22737 Mon Feb 14 15:39:56 CET 2005 Paolo Molaro <lupus@ximian.com>
22738
22739         * Makefile.am: remove libmetadata: we build just libmonoruntime now.
22740
22741 2005-02-13  Zoltan Varga  <vargaz@freemail.hu>
22742
22743         * tabledefs.h (MANIFEST_RESOURCE_VISIBILITY_MASK): Add flags for ManifestResource.
22744
22745         * loader.c (mono_lookup_pinvoke_call): Correct the search order used for different CharSet
22746         values.
22747
22748         * marshal.c (mono_marshal_get_string_encoding): CHAR_SET_AUTO means Unicode on windows.
22749         
22750 2005-02-12  Ben Maurer  <bmaurer@ximian.com>
22751
22752         * domain-internals.h: add the hashtable here.
22753
22754         * class-internals.h: Remove `info' from MonoMethod
22755
22756         * domain.c: Add a new hashtable, jit_trampoline_hash
22757
22758 Fri Feb 11 17:11:20 CET 2005 Paolo Molaro <lupus@ximian.com>
22759
22760         * object.c: don't set the value of static fields
22761         (fixes bug#72494).
22762
22763 2005-02-11  Martin Baulig  <martin@ximian.com>
22764
22765         * mono-debug.c (DATA_TABLE_CHUNK_SIZE): Increase to 131072.
22766         (mono_debug_add_method): Silently ignore the method if it's too big.
22767         (mono_debug_add_type): Likewise.
22768
22769 Fri Feb 11 16:22:10 CET 2005 Paolo Molaro <lupus@ximian.com>
22770
22771         * threads.c, appdomain.c: remove #ifdefs from the code.
22772
22773 2005-02-10  Sebastien Pouliot  <sebastien@ximian.com>
22774
22775         * metadata-internals.h: Added flags to MonoAssembly to cache the most
22776         common security informations. This allows us to stay in unmanaged code
22777         when doing LinkDemand and it's special cases (except for the first 
22778         time for initialization). The flags a very much used with --security.
22779         * reflection.c|h: Added code to get declarative security attributes 
22780         for LinkDemand and InheritanceDemand. This required to refactor the
22781         existing code for Demand.
22782         * security-manager.c|h: Added new method fields for the special cases
22783         of LinkDemand.
22784
22785 2005-02-10  Martin Baulig  <martin@ximian.com>
22786
22787         * icall.c (ves_icall_MonoDebugger_MakeArrayType): New interncall.
22788         (ves_icall_MonoDebugger_GetTypeToken): New interncall.
22789
22790 2005-02-10  Martin Baulig  <martin@ximian.com>
22791
22792         * mono-debug.c, mono-debug-debugger.c: Completely reworked the
22793         debugging code; this is almost a complete rewrite.
22794
22795         * icall.c (ves_icall_MonoDebugger_GetMethodIndex): New interncall.
22796
22797 Thu Feb 10 15:19:01 CET 2005 Paolo Molaro <lupus@ximian.com>
22798
22799         * domain.c, object.h: expose mono_string_equal () and 
22800         mono_string_hash ().
22801         * icall.c, string-icalls.c: remove the string.GetHashCode () icall,
22802         it's implemented in managed code.
22803
22804 Thu Feb 10 15:03:46 CET 2005 Paolo Molaro <lupus@ximian.com>
22805
22806         * icall.c, gc.c, gc-internal.h: make sure gchandles can't be used
22807         lo leak objects between appdomains.
22808
22809 Thu Feb 10 14:25:00 CET 2005 Paolo Molaro <lupus@ximian.com>
22810
22811         * assembly.c: old compilers compilation fix from 
22812         robertj@gmx.net (Robert Jordan).
22813
22814 2005-02-09  Ben Maurer  <bmaurer@ximian.com>
22815
22816         * class-internals.h: Little reminder for the future.
22817
22818         * debug-helpers.c: Fix up wrapper_type_names
22819
22820 Wed Feb 9 19:34:29 CET 2005 Paolo Molaro <lupus@ximian.com>
22821
22822         * image.c, metadata-internals.h: when loading an image from a file,
22823         mmap all of it and use the same codepaths as when using a
22824         in-memory image: the code is simpler and we use less memory
22825         (both writable and readonly).
22826
22827 Wed Feb 9 18:32:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22828
22829         * gc-internal.h, null-gc.c, boehm-gc.c: added functions to the GC
22830         API to alloc runtime data structures that need to be tracked by the
22831         GC and contain pointers.
22832         * appdomain.c, threads.c, object.c, gc.c: use the above changes to
22833         make the code more readable and eventually use a different GC.
22834
22835 2005-02-09  Zoltan Varga  <vargaz@freemail.hu>
22836
22837         * marshal.c (emit_marshal_vtype): Don't do managed->native conversion
22838         for out arguments.
22839         
22840 2005-02-09  Lluis Sanchez Gual  <lluis@novell.com>
22841
22842         * object.c: In release_type_locks(), don't release the cctor lock
22843         if it has already been released. This fixes a crash in the
22844         thread5 test.
22845
22846 Tue Feb 8 19:02:59 CET 2005 Paolo Molaro <lupus@ximian.com>
22847
22848         * gc.c, marshal.c, icall.c: register a delegate for finalization
22849         only when the native function pointer has been allocated for it.
22850
22851 Tue Feb 8 18:12:27 CET 2005 Paolo Molaro <lupus@ximian.com>
22852
22853         * object.c: cleaned up some code, allocate objects that are
22854         pointer free with the atomic malloc variant. Allocate memory
22855         for static data from the mempool if it's pointer-free.
22856         Allocate the bounds array at the end of the array data, when needed.
22857         * object-internals.h, object.h: move a private function in a private
22858         header.
22859         * class.c: handle missing case in tracking references in fields.
22860
22861 Tue Feb 8 18:04:51 CET 2005 Paolo Molaro <lupus@ximian.com>
22862
22863         * class.c, class-internals.h: keep track if a type has
22864         reference fields in either the instance or static fields.
22865
22866 2005-02-07  Lluis Sanchez Gual  <lluis@novell.com>
22867
22868         * domain.c, domain-internals.h: Moved RuntimeInfo to domain-internals.h,
22869         and renamed to MonoRuntimeInfo. Added fields to store the expected
22870         framework assembly version. Changed mono_get_framework_version and
22871         mono_get_runtime_version for a single mono_get_runtime_info method.
22872         
22873         * assembly.c: Added method to remap system assembly versions to the
22874         current executing runtime version. Removed old mapping code.
22875         Remap assembly versions in mono_assembly_load and mono_assembly_loaded.
22876         
22877         * icall.c, reflection.c: Track api changes.
22878
22879 2005-02-06  Miguel de Icaza  <miguel@novell.com>
22880
22881         * loader.c (method_from_memberref): Improve error reporting,
22882         produce the class name instead of the typeref/typedef index. 
22883
22884 2005-02-07  Zoltan Varga  <vargaz@freemail.hu>
22885
22886         * marshal.c (mono_marshal_get_stfld_remote_wrapper): Fix wrapper type.
22887
22888 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22889
22890         * loader.c (mono_lookup_pinvoke_call): Allow for combination of
22891         stdcall and charset name mangling.  Reorganize the code and add
22892         some tracing stuff.
22893
22894 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22895
22896         * monodiet.c: More iters!
22897
22898         * marshal.c: Iter usage.
22899
22900         * icall.c: Iter usage.
22901
22902         * object.c: Use iters.
22903
22904         * debug-helpers.c: More iters
22905
22906 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22907
22908         * loader.c (mono_lookup_pinvoke_call): Add brute-force checking for mangled function names
22909         under win32.
22910
22911 2005-02-05  Ben Maurer  <bmaurer@ximian.com>
22912
22913         * mono-debug-debugger.c: use iters
22914
22915         * class.c, class-internals.h: mono_class_setup_events is static
22916         now
22917
22918         * All callers: use iters
22919
22920 2005-02-05  Zoltan Varga  <vargaz@freemail.hu>
22921
22922         * class.c string-icalls.c marshal.c reflection.c: Applied patch from
22923         Robert Jordan (robertj@gmx.net). Fix compilation errors under gcc-2.95.
22924
22925 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22926
22927         * object.c (mono_class_proxy_vtable): Add missing _setup () calls.
22928
22929         * marshal.h: Add prototypes for ldfld/stfld_remote.
22930
22931         * appdomain.c (mono_domain_fire_assembly_load): Handle the case when
22932         this is called during startup.
22933         
22934 Fri Feb 4 20:27:58 CET 2005 Paolo Molaro <lupus@ximian.com>
22935
22936         * appdomain.c, monitor.c, monitor.h, threads-types.h: made the
22937         MonoThreadsSync struct private in monitor.c. Changed the way
22938         MonoThreadsSync is allocated so it's faster and there is no
22939         need to keep track of it with a finalizer and it uses less memory.
22940         This also finally allows us to allocate mono objects as ptrfree when
22941         there are no reference fields.
22942
22943 Fri Feb 4 20:24:03 CET 2005 Paolo Molaro <lupus@ximian.com>
22944
22945         * gc.c, null-gc.c, boehm-gc.c, gc-internal.h: added functions to deal with
22946         disappearing link to the GC interface and use them to simplify
22947         the gchandles code.
22948
22949 2005-02-04  Zoltan Varga  <vargaz@freemail.hu>
22950
22951         * class-internals.h marshal.c: Add two new wrappers, ldfld_remote and
22952         stfld_remote which call mono_load/store_field_new. This allows methods
22953         calling ldfld/stfld wrappers to be AOTed.
22954
22955         * console-io.c: Include sys/filio.h under solaris.
22956         
22957         * console-io.c: Include curses.h if needed correctly.
22958
22959 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
22960         
22961         * icall.c (ves_icall_MonoMethod_get_base_definition): Initialize
22962         method->klass as well.
22963
22964         * class-internals.h (MonoCachedClassInfo): Add 'finalize_image' field.
22965
22966         * class.c (mono_class_init): Switch on lazy initialization of 
22967         methods.
22968
22969         * class.c (mono_class_get_finalizer): Handle the case when the 
22970         finalizer is inherited.
22971
22972 2005-02-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
22973
22974         * console-io.c: <curses.h> is needed by term.h on solaris.
22975
22976 2005-02-03  Ben Maurer  <bmaurer@ximian.com>
22977
22978         * icall.c, class-internals.h, monodiet.c, class.c: Remove
22979         mono_class_setup_properties where possible. Remove this ftn from
22980         the header file, and make it static.
22981
22982 2005-02-03  Zoltan Varga  <vargaz@freemail.hu>
22983
22984         * loader.c: Add missing setup_... call.
22985
22986         * class.c: Add missing setup_... calls.
22987
22988         * class.c (mono_class_init): Switch on lazy initialization of 
22989         the generic vtable.
22990         
22991         * class.c (mono_class_init): Fix generics broken by the recent changes.
22992
22993         * monodiet.c (handle_type): Add missing setup_... calls.
22994
22995         * class.c: Back out garbage in previous patch.
22996         
22997         * class.c: Add missing setup_... calls.
22998
22999         * class.c (mono_class_get_method_from_name_flags): Avoid calling
23000         mono_class_setup_methods () if possible.
23001
23002         * class-internals.h (MonoClass): Add 'has_cctor' flag.
23003
23004         * class-internals.h (MonoCachedClassInfo): New structure.
23005
23006         * class.c: Initialize properties and events fields of MonoClass lazily.
23007
23008         * class.c: Add infrastructure for lazily initializing the methods and
23009         vtable fields of MonoClass. Not yet used.
23010
23011         * class.c (mono_class_get_finalizer): New helper function.
23012
23013         * class.c: Add infrastructure for loading some class related data from
23014         an AOT file.
23015
23016         * object.c: Add infrastructure for initializing the vtable from data
23017         in the AOT file.
23018
23019         * gc.c (run_finalize): Use mono_class_get_finalizer ().
23020
23021         * class.c loader.c object.c icall.c gc.c reflection.c: Call the
23022         appropriate initialization function before accessing parts of the
23023         MonoClass structure.
23024
23025         * marshal.c: Fix warnings.
23026         
23027         * marshal.c (emit_marshal_array): Add missing 'break'. Fixes #72169.
23028
23029         * mono-debug-debugger.c (get_exception_message): Use 
23030         mono_class_get_method_from_name_flags ().
23031
23032 2005-02-02  Ben Maurer  <bmaurer@ximian.com>
23033
23034         * reflection.c, appdomain.c: Replace a few manual searches that
23035         Zoltan missed. (Paolo approved this part of my initial patch).
23036
23037 Wed Feb 2 16:32:08 CET 2005 Paolo Molaro <lupus@ximian.com>
23038
23039         * profiler.c: disable recording statistical events at report time.
23040
23041 Wed Feb 2 14:14:00 CET 2005 Paolo Molaro <lupus@ximian.com>
23042
23043         * icall.c: patch from Geoff Norton <gnorton@customerdna.com>
23044         to byteswap arrays of enum values, too (bug #72080).
23045
23046 2005-02-02  Zoltan Varga  <vargaz@freemail.hu>
23047
23048         * appdomain.c (set_domain_search_path): Allow this to be called if
23049         domain->setup is not yet set.
23050
23051         * loader.c (mono_method_get_index): New helper function.
23052
23053         * loader.c reflection.c: Use mono_method_get_index ().
23054
23055         * class.c (mono_class_get_method_from_name_flags): New helper method.
23056
23057         * debug-helpers.h debug-helpers.c (mono_find_method_by_name): Remove
23058         this.
23059
23060         * class.c (mono_class_get_cctor): New helper method.
23061
23062         * string-icalls.c object.c class.c marshal.c reflection.c: Use
23063         mono_class_get_method () to look up methods.
23064
23065 2005-02-01  Miguel de Icaza  <miguel@novell.com>
23066
23067         * console-io.c: Fix the build, this should work on Windows.
23068
23069 2005-01-31  Ben Maurer  <bmaurer@ximian.com>
23070
23071         * marshal.c (mono_marshal_xdomain_copy_out_value): cached_str must
23072         be set to null to keep things valid
23073
23074 2005-01-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23075
23076         * icall.c: added Console 2.0 icalls.
23077         * Makefile.am: added console-io.[ch]
23078         * console-io.[ch]: internal calls for Console 2.0 API.
23079
23080 Mon Jan 31 19:01:29 CET 2005 Paolo Molaro <lupus@ximian.com>
23081
23082         * class.c: make sure we consider all the interfaces
23083         when calculating max_interface_id (bug found by
23084         Jeroen Frijters running ikvm).
23085
23086 2005-01-31  Zoltan Varga  <vargaz@freemail.hu>
23087
23088         * icall.c (ves_icall_FieldInfo_SetValueInternal): Handle setting of
23089         valuetype fields to null.
23090
23091         * object.c (set_value): Ditto. Fixes #71669.    
23092
23093 2005-01-31  Martin Baulig  <martin@ximian.com>
23094
23095         * metadata.c (mono_metadata_has_generic_params): New public
23096         function; checks whether something is a generic method.
23097
23098 Sun Jan 30 20:19:48 CET 2005 Paolo Molaro <lupus@ximian.com>
23099
23100         * appdomain.c: fix infinite recursion when adding assemblies.
23101
23102 2005-01-30  Sebastien Pouliot  <sebastien@ximian.com>
23103
23104         * object.c: Fix small typo to return all items for Environment.
23105         GetCommandLineArgs.
23106
23107 Sun Jan 30 16:49:01 CET 2005 Paolo Molaro <lupus@ximian.com>
23108
23109         * domain.c, appdomain.c, assembly.c, image.c, domain-internals.h,
23110         reflection.c: more domain and assembly-unload related fixes
23111         and memory leaks plugs.
23112
23113 2005-01-30  Zoltan Varga  <vargaz@freemail.hu>
23114
23115         * 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.
23116
23117 2005-01-29  Ben Maurer  <bmaurer@ximian.com>
23118
23119         * loader.c (mono_method_signature): Make this method lazy
23120         (mono_get_method_from_token): Don't computate the signature here.
23121
23122         Doing this saves quite a bit of memory. I got 90 kb on starting up
23123         monodoc. It should also save some disk reads on startup.
23124
23125         * *: MonoMethod->signature might be NULL now. You *MUST* use
23126         mono_method_signature.
23127
23128 2005-01-29  Zoltan Varga  <vargaz@freemail.hu>
23129
23130         * object.c (mono_runtime_get_main_args): Return an array from the
23131         current domain here. Fixes #71938.
23132
23133 Sat Jan 29 15:59:05 CET 2005 Paolo Molaro <lupus@ximian.com>
23134
23135         * monitor.c: formatting changes to comply with the
23136         mono coding style and remove #ifdefs from the code.
23137
23138 Sat Jan 29 15:18:54 CET 2005 Paolo Molaro <lupus@ximian.com>
23139
23140         * metadata.c, private.h: remove some unneeded data
23141         and use a more compact representation for table schemas.
23142
23143 Fri Jan 28 18:23:44 CET 2005 Paolo Molaro <lupus@ximian.com>
23144
23145         * metadata.c, metadata-internals.h: add mono_aligned_addr_hash()
23146         to get a better distribution in hash tables.
23147         * *.c: use mono_aligned_addr_hash() where appropriate.
23148         * assembly.c: make var static.
23149
23150 2005-01-28  Zoltan Varga  <vargaz@freemail.hu>
23151
23152         * domain-internals.h: Put MonoJitInfo on a diet.
23153
23154         * domain.c: Fix a warning.
23155
23156 Wed Jan 26 22:20:46 CET 2005 Paolo Molaro <lupus@ximian.com>
23157
23158         * gc.c: rework the gc handles code to reuse handles
23159         when freed.
23160
23161 Wed Jan 26 17:34:09 CET 2005 Paolo Molaro <lupus@ximian.com>
23162
23163         * domain.c: fixed long standing bug in mono_string_equal() which
23164         was brought to light with the ldstr changes.
23165
23166 2005-01-26  Sebastien Pouliot  <sebastien@ximian.com>
23167
23168         * reflection.c: Remove warning by adding missing include for marshal.h
23169
23170 Tue Jan 25 18:06:00 CET 2005 Paolo Molaro <lupus@ximian.com>
23171
23172         * domain.c, object.c: change the ldstr_table to hold
23173         MonoString* as keys: makes the runtime isinterned lookup
23174         faster and simplifies memory management.
23175
23176 2005-01-25  Sebastien Pouliot  <sebastien@ximian.com> 
23177  
23178         * icall.c: Renamed GetEnvironmentVariable so internal* so it was
23179         possible to add imperative security checks before calling the icall.
23180         * reflection.c: Return security attributes on the original MonoMethod
23181         (and not the wrapped one). This fix permissions on icalls.
23182
23183 2005-01-25  Dick Porter  <dick@ximian.com>
23184
23185         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Make
23186         the check for mktime() support actually test the mktime() return
23187         value.  "Fixes" bug 71682, though the output is still different to
23188         MS.
23189
23190 2005-01-25  Martin Baulig  <martin@ximian.com>
23191
23192         * class.c (mono_class_is_assignable_from): Make this work for
23193         generic instances.
23194
23195 2005-01-24  Ben Maurer  <bmaurer@ximian.com>
23196
23197         * marshal.c (mono_string_utf8_to_builder)
23198         (mono_string_builder_to_utf16): We might not have ownership of the
23199         string. In thise case, we need to create a new buffer.
23200
23201         * object-internals.h (mono_stringbuilder_capacity): sb->str might
23202         be null, in which case, use the default capacity.
23203
23204 Mon Jan 24 16:42:29 CET 2005 Paolo Molaro <lupus@ximian.com>
23205
23206         * gc-internal.h, null-gc.c, profiler.c, boehm-gc.c: hook the
23207         GC events to the profiler.
23208
23209 Mon Jan 24 15:59:54 CET 2005 Paolo Molaro <lupus@ximian.com>
23210
23211         * gc.c: remove valgrind detection nonsense. Set GC_DONT_GC
23212         if you don't want the GC to run.
23213
23214 Mon Jan 24 15:53:25 CET 2005 Paolo Molaro <lupus@ximian.com>
23215
23216         * Makefile.am, gc.c, mono-gc.h, boehm-gc.c, null-gc.c, gc-internal.h:
23217         start providing a GC API and keeping different implementations in
23218         their own file.
23219         * profiler.h, profiler.c, profiler-private.h: provide the GC events API.
23220
23221 2005-01-22  Ben Maurer  <bmaurer@ximian.com>
23222
23223         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Use
23224         mmap rather than allocating a huge buffer.
23225         (mono_debug_close_mono_symbol_file): Free the buffer allocated
23226         above.
23227
23228 2005-01-22  Sebastien Pouliot  <sebastien@ximian.com>
23229
23230         * icall.c: Add new internal calls for SecurityManager.SecurityEnabled
23231         and CheckExecutionRights.
23232         * reflection.c|h: Keep the index of the declarative security to be 
23233         used, instead of the pointer, when AOT compiler is used. Also add 
23234         class initialization when requesting demands.
23235         * security-manager.c|h: Implement SecurityManager.SecurityEnabled and
23236         CheckExecutionRights. Both properties are now FALSE by default, and
23237         unmodifiable, unless the --security option is used.
23238
23239 Fri Jan 21 15:29:27 CET 2005 Paolo Molaro <lupus@ximian.com>
23240
23241         * domain.c, appdomain.c, assembly.c, image.c, metadata-internals.h,
23242         reflection.c: properly refcount images and assemblies, many leaks fixed.
23243
23244 2005-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23245
23246         * threadpool.c: increase the timeout for threads in the thread pool to
23247         10s.  Fixes bug #67159.
23248
23249 2005-01-20  Bernie Solomon  <bernard@ugsolutions.com>
23250
23251         * class-internals.h: Sun's compiler insists on explicit
23252         signed on bit fields to handle then correctly.
23253
23254 2005-01-19  Miguel de Icaza  <miguel@ximian.com>
23255
23256         * file-io.c (ves_icall_System_IO_MonoIO_get_InvalidPathChars):
23257         Make the size of the array fit only the number of invalid path
23258         chars that we have.
23259
23260         * class.c (_mono_class_get): Improve the error reporting when a
23261         class referenced is not found, to assist debugging. 
23262
23263 Wed Jan 19 19:57:43 CET 2005 Paolo Molaro <lupus@ximian.com>
23264
23265         * threads.c: fix off-by-one error.
23266         * domain.c: free data allocated in the domain.
23267
23268 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23269
23270         * reflection.c (mono_method_body_get_object): Fill out exception info
23271         as well.
23272
23273         * object-internals.h: Add MonoReflectionExceptionHandlingClause 
23274         structure.
23275         
23276 2005-01-19  Martin Baulig  <martin@ximian.com>
23277
23278         * loader.c (mono_get_method_constrained): Make this work again.
23279
23280 2005-01-19  Zoltan Varga  <vargaz@freemail.hu>
23281
23282         * object-internals.h (_MonoReflectionMethodBody): Make local_index a 
23283         guint16 to match the managed side.
23284
23285         * reflection.c (mono_reflection_body_get_object): Fill out local
23286         variables array.
23287
23288         * reflection.c (mono_method_body_get_object): Fill out local_var_sig_token
23289         as well.
23290
23291         * object-internals.h (_MonoReflectionMethodBody): Rename 'sig_token' to
23292         'local_var_sig_token'.
23293
23294 2005-01-18  Zoltan Varga  <vargaz@freemail.hu>
23295
23296         * loader.c (mono_lookup_pinvoke_call): Revert the previous patch as it breaks 
23297         System.Drawing.
23298
23299         * reflection.c (mono_method_body_get_object): Handle abstract and
23300         runtime methods.
23301
23302 Mon Jan 17 19:22:39 CET 2005 Paolo Molaro <lupus@ximian.com>
23303
23304         * marshal.c, loader.c, class-internals.h, reflection.c:
23305         store the emthod data for a wrapper in an array instead of a list.
23306
23307 Mon Jan 17 18:48:53 CET 2005 Paolo Molaro <lupus@ximian.com>
23308
23309         * marshal.c: change the code to allocate memory more
23310         conservatively for method wrappers.
23311
23312 Mon Jan 17 18:03:30 CET 2005 Paolo Molaro <lupus@ximian.com>
23313
23314         * class-internals.h, marshal.c: move the str_to_ptr and ptr_to_str
23315         fields from MonoClass to the marshal info structure where they belong.
23316
23317 Mon Jan 17 16:14:46 CET 2005 Paolo Molaro <lupus@ximian.com>
23318
23319         * class.c, object.c, class-internals.h, marshal.c: rearrange
23320         some fields and tweak some types to lower memory usage.
23321
23322 2005-01-17  Zoltan Varga  <vargaz@freemail.hu>
23323
23324         * threads.c (signal_thread_state_change): Handle the case when the
23325         target thread is the current thread.
23326
23327         * marshal.c (mono_struct_delete_old): Do not free lpwstr fields.
23328
23329         * marshal.c: Rename emit_ptr_to_str_conv and its pair to 
23330         emit_ptr_to_object_conv. 
23331
23332         * marshal.c (emit_ptr_to_object_conv): Add support for lpwstr->str
23333         marshalling. Fixes #71352.
23334
23335 Mon Jan 17 10:59:20 CET 2005 Paolo Molaro <lupus@ximian.com>
23336
23337         * metadata.h, blob.h: move table enum to blob.h so it can be included
23338         in any header.
23339         * image.c, metadata.c, metadata-internals.h, pedump.c, reflection.c:
23340         cut the size of MonoImage/MonoDynamicImage.
23341
23342 2005-01-16  Zoltan Varga  <vargaz@freemail.hu>
23343
23344         * profiler.c (mono_profiler_install_simple): Fix default arguments.
23345
23346 Sun Jan 16 12:25:22 CET 2005 Paolo Molaro <lupus@ximian.com>
23347
23348         * reflection.c, reflection.h, icall.c: add a function to check
23349         if an attribute type is defined for a metadata object.
23350
23351 2005-01-14  Lluis Sanchez Gual  <lluis@novell.com>
23352
23353         * object-internals.h: Added some needed fields from StringBuilder class.
23354         * marshal.c: Set the maxCapacity when creating a StringBuilder.
23355
23356 2005-01-13  Zoltan Varga  <vargaz@freemail.hu>
23357
23358         * icall.c (ves_icall_System_Environment_Exit): Suspend all managed
23359         threads before shutting down the runtime.
23360
23361         * threads.c (mono_thread_suspend_all_other_threads): New helper function.
23362
23363 Thu Jan 13 18:16:35 CET 2005 Paolo Molaro <lupus@ximian.com>
23364
23365         * object-internal.h, threads.c: implement stacksize and 
23366         parameterized thread start functionality (requires
23367         matching corlib). Marked broken code for later removal.
23368
23369 2005-01-12  Martin Baulig  <martin@ximian.com>
23370
23371         * class-internals.h (MonoGenericClass): Moved the `initialized'
23372         flag to MonoDynamicGenericClass, removed `init_pending'.
23373         (MonoGenericInst): Added `is_reference' flag.
23374
23375 2005-01-12  Zoltan Varga  <vargaz@freemail.hu>
23376
23377         * reflection.c (mono_image_create_pefile): Only set the pe_offset
23378         inside the MSDOS header. Fixes #71201.
23379
23380         * gc.c (mono_gc_cleanup): Handle the case when this is called from the
23381         gc thread.
23382         (mono_domain_finalize): Ditto.
23383
23384 2005-01-12  Martin Baulig  <martin@ximian.com>
23385
23386         * class.c (mono_get_shared_generic_class): Use the cache for
23387         non-dynamic generic classes.
23388
23389         * class-internals.h (mono_class_create_generic_2): Removed
23390         function prototype, this function is now static inside class.c.
23391
23392         * class.c (mono_class_create_generic_2): Made this static, only
23393         call it from mono_class_init() and mono_class_setup_parent().
23394         (collect_implemented_interfaces_aux): Call mono_class_init() on
23395         the interfaces we collect.
23396         (mono_class_setup_vtable): Call mono_class_init (class->parent).
23397
23398 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23399
23400         * threads.c (mono_thread_attach): Call DuplicateHandle on the thread handle on win32 to make
23401         it a real thread handle.
23402
23403         * domain-internals.h: Move exvar_offset from MonoJitInfo to 
23404         MonoJitExceptionInfo, since each catch clause needs its own variable.
23405         
23406 2005-01-11  Dick Porter  <dick@ximian.com>
23407
23408         * image.c (mono_pe_file_open): New variant on mono_image_open()
23409         that does not set up the CLI metadata; used for FileVersionInfo so
23410         it can get the data for windows binaries too.
23411         
23412         * process.c (process_read_string_block): Don't read off the end of
23413         the StringTable block.
23414
23415         These both fix bug 70766.
23416
23417 Tue Jan 11 15:26:00 CET 2005 Paolo Molaro <lupus@ximian.comt>
23418
23419         * gc.c: set some fields to NULL at GC cleanup time.
23420         * threads.c: if we quit the main thread, call exit ().
23421
23422 2005-01-11  Zoltan Varga  <vargaz@freemail.hu>
23423
23424         * threads.c (interruption_request_apc): Decore APC callbacks with CALLBACK under win32.
23425
23426 Mon Jan 10 18:47:28 CET 2005 Paolo Molaro <lupus@ximian.com>
23427
23428         * threads.h, threads.c, object.c: added accessor and settor for
23429         main_thread. Handle it specially when exiting from it: wait
23430         for other foreground threads to exit.
23431
23432 Mon Jan 10 12:06:18 CET 2005 Paolo Molaro <lupus@ximian.com>
23433
23434         * process.c, verify.c: remove some bloat.
23435
23436 2005-01-09  Zoltan Varga  <vargaz@freemail.hu>
23437
23438         * loader.c (mono_lookup_pinvoke_call): If we found the function without name mangling, change
23439         the calling convention to cdecl under win32.
23440
23441 2005-01-08  Ben Maurer  <bmaurer@ximian.com>
23442
23443         * object.c (mono_object_get_size): New function to get the size of
23444         an object instance.
23445
23446         * profiler.c (simple_allocation): Use above.
23447
23448 2005-01-08  Sebastien Pouliot  <sebastien@ximian.com>
23449
23450         * appdomain.c: Replaced ves_icall_System_AppDomain_getDomainByID by
23451         ves_icall_System_AppDomain_getRootDomain (as it's not required to
23452         get an appdomain by it's id and we can't assume the root's id is 0).
23453         * domain-internals.h: Change the function prototype to match.
23454         * icall.c: Change the icall table for AppDomain.
23455
23456 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
23457
23458         * locales.c (string_invariant_compare_char): Only compute
23459         GUnicodeTypes in the case where we need them.  Test for ordinality
23460         first and return if so.
23461
23462         From the commit:
23463
23464                 /*
23465                  * FIXME: here we must use the information from c1type and c2type
23466                  * to find out the proper collation, even on the InvariantCulture, the
23467                  * sorting is not done by computing the unicode values, but their
23468                  * actual sort order.
23469                  */
23470
23471 Sat Jan 8 19:03:26 CET 2005 Paolo Molaro <lupus@ximian.com>
23472
23473         * loader.c: for P/Invoke methods, allow the "Internal" shared
23474         library name to refer to the calling process symbol namespace.
23475
23476 2005-01-07  Sebastien Pouliot  <sebastien@ximian.com>
23477
23478         * Makefile.am: Add the security manager to the build.
23479         * security-manager.c|h: New. Initialization of the security manager.
23480
23481 2005-01-07  Dick Porter  <dick@ximian.com>
23482
23483         * threads.c: 
23484         * monitor.c: Update thread state during Monitor and WaitHandle
23485         waits.  Fixes bug 71031.
23486
23487 2005-01-07  Zoltan Varga  <vargaz@freemail.hu>
23488
23489         * reflection.c (property_encode_signature): Correctly handle when the
23490         property has no methods.
23491
23492 2005-01-06  Zoltan Varga  <vargaz@freemail.hu>
23493
23494         * reflection.c (reflection_methodbuilder_to_mono_method): Remove debug stuff.
23495         
23496         * reflection.c (reflection_methodbuilder_from_method_builder): Copy
23497         fields from mb, not rmb. Fixes #71017.
23498
23499         * marshal.c (emit_ptr_to_str_conv): Add support for 
23500         ByValTStr -> string conversion. Fixes #71015.
23501
23502         * appdomain.c (mono_domain_owns_vtable_slot): New helper function.
23503
23504         * mempool.c (mono_mempool_contains_addr): New helper function.
23505
23506 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23507
23508         * metadata.c (mono_metadata_compute_size): Fix size calculation of
23509         HasSematics encoded fields.
23510         
23511         * metadata.c (mono_type_to_unmanaged): Improve error message for 
23512         invalid string marshalling.
23513
23514         * metadata.c: Fix warnings.
23515         
23516 Wed Jan 5 16:17:27 CET 2005 Paolo Molaro <lupus@ximian.com>
23517
23518         * profiler-private.h, profiler.c, profiler.h, gc.c: sample statistical
23519         profiler support.
23520
23521 2005-01-05  Zoltan Varga  <vargaz@freemail.hu>
23522
23523         * domain.c object.c domain-internals.h: Revert part of r38077 since the
23524         keys to proxy_vtable_hash are GCd objects. Fixes running the class lib
23525         tests.
23526
23527 2005-01-03  Zoltan Varga  <vargaz@freemail.hu>
23528
23529         * marshal.c: Use MONO_CLASSCONST instead of MONO_LDPTR in some places,
23530         so methods containing these can be AOTed.
23531
23532 2005-01-03  Martin Baulig  <martin@ximian.com>
23533
23534         * loader.c (find_method): Removed the hack for generic instances.
23535         (method_from_memberref): If our parent is a generic instance, pass
23536         its generic type definition to find_method() and then inflate the
23537         method.
23538         (mono_get_method_constrained): Pass the generic type definition to
23539         find_method() and inflate the method later.
23540
23541         * class-internals.h (MonoStats): Added `generic_class_count'.
23542
23543         * icall.c (ves_icall_MonoGenericMethod_get_reflected_type):
23544         Renamed to ves_icall_MonoGenericMethod_get_ReflectedType().
23545
23546         * reflection.c (mono_custom_attrs_from_params): Don't ignore
23547         generic type definitions.
23548
23549 2004-12-30  Zoltan Varga  <vargaz@freemail.hu>
23550
23551         * loader.c icall.c: Fix warnings.
23552
23553 2004-12-29  Zoltan Varga  <vargaz@freemail.hu>
23554
23555         * marshal.c (mono_marshal_get_managed_wrapper): Fix returning of
23556         blittable types. Fixes #70864.
23557
23558 2004-12-29  Martin Baulig  <martin@ximian.com>
23559
23560         * icall.c
23561         (ves_icall_MonoGenericMethod_get_reflected_type): New interncall.
23562
23563         * reflection.c (mono_method_get_object): Create a
23564         "System.Reflection.MonoGenericMethod" for inflated methods; don't
23565         call mono_get_inflated_method().
23566
23567         * class-internals.h (MonoStats): Added `inflated_method_count_2'.
23568
23569 2004-12-27  Martin Baulig  <martin@ximian.com>
23570
23571         * class-internals.h (MonoMethod): Added `is_inflated' flag.
23572         (MonoMethodInflated): Added `inflated' field.
23573
23574         * class.c (mono_class_inflate_generic_method): Don't really
23575         inflate the method here; just set the `is_inflated' flag in the
23576         MonoMethod.
23577         (mono_class_get_inflated_method): Actually inflate the method here
23578         if it's not already inflated; we use the MonoMethodInflated's new
23579         `inflated' field as a cache.
23580
23581 2004-12-26  Martin Baulig  <martin@ximian.com>
23582
23583         * class.c
23584         (inflate_generic_class): Moved some code out of inflate_generic_type().
23585         (mono_class_inflate_generic_method): If we're already inflated,
23586         inflate the context and use the declaring method; ie. make sure
23587         the declaring method of an inflated method is always the generic
23588         method definition.
23589         (mono_class_create_from_typedef): Create
23590         `class->generic_container->context->gclass'.
23591
23592 2004-12-24  Ben Maurer  <bmaurer@ximian.com>
23593
23594         * metadata-internals.h, marshal.c, reflection.c: More
23595         MonoGHashTable->GHashTable.
23596
23597         * domain-internals.h, class.c: Change MonoGHashTable's into
23598         GHashTables for some cases where no gc stuff is used
23599
23600         All users: update apis
23601
23602 2004-12-23  Ben Maurer  <bmaurer@ximian.com>
23603
23604         * metadata.c (builtin_types): Make this `const'. Makes this get
23605         put into the shareable section.
23606         (mono_metadata_init): Casts to make gcc happy.
23607
23608 2004-12-22  Zoltan Varga  <vargaz@freemail.hu>
23609
23610         * gc.c (mono_gc_init): Add a '\n' to the valgrind warning.
23611
23612 2004-12-21  Sebastien Pouliot  <sebastien@ximian.com> 
23613
23614         * icall.c: Added an internal call to retrieve the position and length
23615         of assembly-level declarative security attributes (RequestMinimum, 
23616         RequestOptional and RequestRefuse). This is used by the Assembly class
23617         to re-create the corresponding permission sets.
23618
23619 Tue Dec 21 14:50:31 CET 2004 Paolo Molaro <lupus@ximian.com>
23620
23621         * marshal.c: fix the stelemref wrapper to be type correct
23622         (and faster).
23623
23624 2004-12-20  Ben Maurer  <bmaurer@ximian.com>
23625
23626         * icall.c (ves_icall_System_Object_GetHashCode): There was no need
23627         to do key & 0x7fffffff. Hashtable already does this. It just
23628         results in longer code.
23629
23630 2004-12-20  Sebastien Pouliot  <sebastien@ximian.com>
23631
23632         * appdomain.c: Bump corlib version.
23633         * class-internals.h: Added RuntimeSecurityFrame to mono_defaults.
23634         * domain.c: Add RuntimeSecurityFrame to mono_defaults.
23635         * reflection.c|h: Add functions to get declarative security infos
23636         (blob position and length) for assemblies, classes and methods.
23637
23638 Mon Dec 20 15:28:54 CET 2004 Paolo Molaro <lupus@ximian.com>
23639
23640         * reflection.c: sort the constant table (bug #70693).
23641
23642 Mon Dec 20 12:19:37 CET 2004 Paolo Molaro <lupus@ximian.com>
23643
23644         * object-internals.h, threads.c, domain.c: add accessors for
23645         the MonoThread and MonoDomain tls keys.
23646
23647 2004-12-18  Martin Baulig  <martin@ximian.com>
23648
23649         * class.c (inflate_generic_type): If we're inflating a generic
23650         instance, set `ngclass->context->container = context->container';
23651         ie. the container we inflated into.
23652
23653         * metadata.c (mono_metadata_parse_generic_param): Reflect above
23654         inflate_generic_type() changes.
23655
23656 2004-12-17  Martin Baulig  <martin@ximian.com>
23657
23658         * class-internals.h
23659         (MonoGenericClass): Replaced `MonoType *generic_type' with
23660         `MonoClass *generic_class'.  Removed `dynamic_info'; if
23661         `is_dynamic' is true, we're a `MonoDynamicGenericClass'.
23662         (MonoDynamicGenericClass): Derive from `MonoGenericClass'.
23663
23664 2004-12-16  Zoltan Varga  <vargaz@freemail.hu>
23665
23666         * exception.c (mono_exception_from_token): New helper function.
23667
23668 2004-12-15  Zoltan Varga  <vargaz@freemail.hu>
23669
23670         * assembly.c (mono_assembly_load_with_partial_name): Call 
23671         mono_assembly_loaded before invoking the preload hooks. Fixes
23672         #70564.
23673
23674         * object-internals.h (MonoThread): Change culture_info and 
23675         ui_culture_info into an array.
23676
23677         * threads.c: Cache culture info objects from more than one appdomain.
23678
23679         * threads.c threads-types.h icall.c: Add icalls for manipulating the 
23680         current UI culture.
23681
23682 2004-12-14  Zoltan Varga  <vargaz@freemail.hu>
23683
23684         * threads.h threads.c appdomain.c: Clear the culture_info field of
23685         all threads during unloading if they point to an object in the dying
23686         appdomain.
23687
23688 2004-12-13  Ben Maurer  <bmaurer@ximian.com>
23689
23690         * culture-info.h (TextInfoEntry): New struct
23691         * object-internals.h: sync with managed
23692         * locales.c: fill the `text_info_data' field
23693         * culture-info-tables.h: update
23694
23695 Mon Dec 13 18:10:50 CET 2004 Paolo Molaro <lupus@ximian.com>
23696
23697         * Makefile.am, monodiet.c: add monodiet, an IL code garbage
23698         collector.
23699
23700 2004-12-12  Ben Maurer  <bmaurer@ximian.com>
23701
23702         * icall.c (ves_icall_ModuleBuilder_getToken): Check for null
23703         (ves_icall_ModuleBuilder_getMethodToken): Ditto
23704
23705 2004-12-12  Martin Baulig  <martin@ximian.com>
23706
23707         * mono-debug-debugger.c (write_type): If we're an enum and the
23708         builtin types have already been initialized, call mono_class_init().
23709
23710 2004-12-11  Martin Baulig  <martin@ximian.com>
23711
23712         * metadata.c (mono_metadata_load_generic_params): Added
23713         `MonoGenericContainer *parent_container' argument; automatically
23714         compute `container->is_method'; pass the correct owner to
23715         get_constraints().      
23716
23717         * reflection.c (compare_genericparam): Sort the GenericParam table
23718         according to increasing owners. 
23719
23720 Fri Dec 10 18:43:46 CET 2004 Paolo Molaro <lupus@ximian.com>
23721
23722         * profiler.c: allow disabling the default profiler.
23723
23724 Fri Dec 10 18:42:11 CET 2004 Paolo Molaro <lupus@ximian.com>
23725
23726         * decimal.c, icall.c: allow disabling System.Decimal support.
23727
23728 2004-12-09  Marek Safar <marek.safar@seznam.cz>
23729
23730         * reflection.c: Add support for null attribute arguments.
23731
23732 2004-12-09  Martin Baulig  <martin@ximian.com>
23733
23734         * metadata.h, loader.h: Use `idx' instead of `index' in parameter
23735         names to get rid of compiler warnings.
23736
23737 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23738
23739         * marshal.c (mono_marshal_get_struct_to_ptr): Call 
23740         mono_marshal_load_type_info (). Fixes #69625.
23741         (mono_marshal_get_ptr_to_struct): Likewise.
23742
23743 2004-12-08  Martin Baulig  <martin@ximian.com>
23744
23745         * mono-debug.h: Bumped version number to 47.
23746
23747         * mono-debug-debugger.c
23748         (mono_debugger_event_handler, mono_debugger_event): Take two
23749         guint64 arguments insteed of a gpointer and a guint32.  
23750
23751 2004-12-08  Martin Baulig  <martin@ximian.com>
23752
23753         * debug-mono-symfile.h
23754         (MonoDebugLineNumberEntry): Renamed `offset' to `il_offset' and
23755         `address' to `native_offset'.
23756
23757 2004-12-08  Martin Baulig  <martin@ximian.com>
23758
23759         * class.c (mono_class_create_from_typespec): Only inflate if we
23760         either have `context->gclass' or `context->gmethod'.
23761
23762 2004-12-08  Zoltan Varga  <vargaz@freemail.hu>
23763
23764         * metadata-internals.h (MonoAssembly): Add 'corlib_internal' field.
23765
23766         * object-internals.h (MonoReflectionAssemblyBuilder): Move 'corlib_internal' field from Assembly to AssemblyBuilder.
23767
23768         * reflection.c (mono_image_basic_init): Initialize assembly->corlib_internal from the assembly builder.
23769
23770         * reflection.c (mono_assembly_get_object): Remove the workaround put
23771         in for the release.
23772         
23773         * appdomain.c: Use the corlib_internal field from MonoAssembly.
23774
23775         * appdomain.c: Bump corlib version.
23776
23777         * reflection.c (mono_assembly_get_object): Add a workaround so __MetadataTypes won't
23778         be visible in other appdomains.
23779
23780 2004-12-07  Ben Maurer  <bmaurer@ximian.com>
23781
23782         * threads.c: Interlocked inc and dec for longs were messed up,
23783         use a KISS based impl for this. Fixes 70234
23784
23785 2004-12-07  Zoltan Varga  <vargaz@freemail.hu>
23786
23787         * threads.c (ves_icall_System_Threading_Thread_GetCachedCurrentCulture): Make this lock-less.
23788
23789 Tue Dec 7 10:47:09 CET 2004 Paolo Molaro <lupus@ximian.com>
23790
23791         * icall.c: fix to follow policy not to allow struct
23792         arguments in icalls.
23793
23794 2004-12-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23795
23796         * process.c: make the patch that handles spaces in file paths work
23797         on mono/windows too.
23798
23799 2004-12-06  Martin Baulig  <martin@ximian.com>
23800
23801         * class.c (mono_class_create_generic): Call
23802         mono_class_setup_supertypes() if we're dynamic.
23803         (mono_class_is_subclass_of): `g_assert (klass->idepth > 0)'.
23804
23805 2004-12-06  Zoltan Varga  <vargaz@freemail.hu>
23806
23807         * object-internals.h: Add new fields to MonoThread.
23808
23809         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
23810
23811         * icall.c threads-types.h threads.c: Add new icalls.
23812
23813         * object-internals.h (MonoThread): Remove unused 'unmanaged' field.
23814
23815         * object-internals.h (MonoReflectionAssembly): Sync object layout with
23816         managed side.
23817
23818         * appdomain.c: Bump corlib version.
23819
23820         * appdomain.c (ves_icall_System_AppDomain_GetAssemblies): Skip
23821         internal assemblies. Fixes #69181.
23822
23823 2004-12-05  Martin Baulig  <martin@ximian.com>
23824
23825         * class.c (mono_class_inflate_generic_signature): Make this a
23826         no-op if `context' is NULL or we don't have any type parameters;
23827         also copy `sentinelpos'.        
23828
23829 2004-12-04  Zoltan Varga  <vargaz@freemail.hu>
23830
23831         * image.c: Add unbox_wrapper_cache.
23832
23833         * class-internals.h debug-helpers.c: Add MONO_WRAPPER_UNBOX.
23834
23835         * marshal.h marshal.c (mono_marshal_get_unbox_wrapper): New wrapper
23836         function generator.
23837         
23838         * object.c (mono_delegate_ctor): Call unbox wrapper if neccesary.
23839         Fixes #70173.
23840
23841         * metadata-internals.h image.c: Add MonoImage->unbox_wrapper_cache.
23842         
23843 2004-12-04  Martin Baulig  <martin@ximian.com>
23844
23845         * loader.c (mono_method_get_signature_full): New public function;
23846         like mono_method_get_signature(), but with an additional
23847         `MonoGenericContext *' argument.
23848
23849         * class.c (mono_class_inflate_generic_signature): Formerly known
23850         as inflate_generic_signature(); make this public.
23851
23852 2004-12-04  Martin Baulig  <martin@ximian.com>
23853
23854         * metadata.c
23855         (mono_metadata_parse_type_full): Take a `MonoGenericContext *'
23856         instead of a `MonoGenericContainer *'.  
23857         (mono_metadata_parse_array_full): Likewise.
23858         (mono_metadata_parse_signature_full): Likewise.
23859         (mono_metadata_parse_method_signature_full): Likewise.
23860         (mono_metadata_parse_generic_inst): Likewise.
23861         (mono_metadata_parse_generic_param): Likewise.
23862         (mono_metadata_parse_mh_full): Likewise.
23863         (mono_type_create_from_typespec_full): Likewise.
23864
23865 2004-12-03  Martin Baulig  <martin@ximian.com>
23866
23867         * class-internals.h (MonoGenericContainer): Replaced the
23868         `MonoGenericContext * pointer with a `MonoGenericContext'
23869         structure and made it the first element.
23870
23871 2004-12-03  Martin Baulig  <martin@ximian.com>
23872
23873         * class.c
23874         (inflate_generic_type): Set the `context->container' when creating
23875         a new MonoGenericContext.
23876         (mono_class_inflate_generic_method): Likewise.
23877         (mono_class_create_from_typespec): Just use `context->container'
23878         to get the container.
23879
23880         * loader.c (method_from_methodspec): Set `context->parent' from
23881         `context->container' - and if that's a method container, use its
23882         parent.  Also set the `context->container' when creating a new
23883         MonoGenericContext.
23884         (mono_get_method_from_token): Use just `context->container' to get
23885         the container.
23886
23887         * metadata.c (do_mono_metadata_parse_generic_class): Also set
23888         `gclass->context->container'.
23889
23890         * reflection.c (do_mono_reflection_bind_generic_parameters): Set
23891         the `context->container' when creating a new MonoGenericContext.
23892
23893 2004-12-03  Zoltan Varga  <vargaz@freemail.hu>
23894
23895         * reflection.c (compare_genericparam): Sort params with identical
23896         owner by their number. Fixes gen-111 on sparc.
23897
23898 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23899
23900         * threadpool.c (async_invoke_thread): Call push/pop_appdomain_ref
23901         around the domain changes.
23902
23903         * appdomain.c (mono_domain_unload): Handle the case when the thread
23904         calling Unload is itself being aborted during unloading. Fixes #70022.
23905
23906         * appdomain.h: Add prototype for mono_install_runtime_cleanup.
23907
23908         * marshal.c (emit_thread_interrupt_checkpoint_call): Call 
23909         checkpoint_func as an icall so it gets a wrapper.
23910         (mono_marshal_get_xappdomain_invoke): Call push/pop_appdomain_ref ()
23911         in the cross-appdomain wrappers too.
23912
23913         * threads.c (mono_thread_has_appdomain_ref): Make this public.
23914
23915         * assembly.c (mono_assembly_open_from_bundle): Fix warning.
23916
23917         * reflection.c: Fix some memory leaks.
23918         
23919 2004-12-02  Martin Baulig  <martin@ximian.com>
23920
23921         * metadata-internals.h (MonoImage): Removed `generic_class_cache'.
23922
23923         * metadata.c (generic_class_cache): New static hashtable.
23924         (mono_metadata_lookup_generic_class): New public method.
23925
23926 2004-12-02  Martin Baulig  <martin@ximian.com>
23927
23928         * class.c (mono_class_create_from_typedef): Call
23929         mono_class_setup_parent() and mono_class_create_mono_type() before
23930         parsing the interfaces.
23931
23932 2004-12-02  Martin Baulig  <martin@ximian.com>
23933
23934         * metadata.c (generic_inst_cache): New static hashtable.
23935         (mono_metadata_lookup_generic_inst): New public function.
23936         (mono_metadata_inflate_generic_inst): New public function.
23937         (mono_metadata_parse_generic_inst): New public function.
23938         (do_mono_metadata_parse_generic_class): Use the new
23939         mono_metadata_parse_generic_inst() for parsing the `gclass->inst'
23940         since this'll also use the cache.
23941
23942         * reflection.c (mono_reflection_bind_generic_method_parameters):
23943         Use mono_metadata_lookup_generic_inst() to use the new cache.
23944
23945         * class.c (inflate_mono_type): Use
23946         mono_metadata_inflate_generic_inst() to inflate a generic
23947         instance; this'll also use the new cache.
23948
23949         * loader.c (method_from_methodspec): Use
23950         mono_metadata_parse_generic_inst() and
23951         mono_metadata_inflate_generic_inst() rather than parsing it
23952         manually, so we can use the new cache.
23953
23954 2004-12-02  Zoltan Varga  <vargaz@freemail.hu>
23955
23956         * threads.c (wait_for_tids): Do not incorrectly free threads when 
23957         the wait times out.
23958
23959 2004-12-01  Neale Ferguson <Neale.Ferguson@SoftwareAG-usa.com>
23960
23961         * icall.c (mono_ArgIterator_Setup) : Conditionally compile calculation of
23962         iter->args based on whether parameters are passed in registers (i.e.
23963         MONO_ARCH_REGPARMS is defined)
23964
23965 2004-12-01  Zoltan Varga  <vargaz@freemail.hu>
23966
23967         * loader.c (mono_lookup_pinvoke_call): Use the remapped dll name in
23968         the exception message. Fixes #70070.
23969         (method_from_methodspec): Fix warnings.
23970
23971 2004-12-01 Gonzalo Paniagua Javier <gonzalo@ximian.com>
23972
23973         * process.c: (complete_path) return the path quoted
23974
23975 2004-12-01  Martin Baulig  <martin@ximian.com>
23976
23977         * class-internals.h (MonoGenericInst): New structure.
23978         (MonoGenericClass): Replaced `type_argc', `type_argv' and
23979         `is_open' with `MonoGenericInst *inst'.
23980         (MonoGenericMethod): Replaced `mtype_argc', `mtype_argv' and
23981         `is_open' with `MonoGenericInst *inst'.
23982
23983 2004-11-30  Martin Baulig  <martin@ximian.com>
23984
23985         Generics API cleanup: renamed MonoGenericInst -> MonoGenericClass.
23986
23987         * metadata-internals.h (MonoImage): Renamed `generic_inst_cache'
23988         to `generic_class_cache'.
23989
23990         * metadata.c
23991         (mono_generic_inst_hash): Renamed to mono_generic_class_hash().
23992         (mono_generic_inst_equal): Renamed to mono_generic_class_equal().
23993         (mono_generic_inst_is_valuetype): Renamed to
23994         mono_generic_class_is_valuetype().
23995
23996         * class-internals.h
23997         (MonoGenericInst): Renamed to MonoGenericClass.
23998         (MonoDynamicGenericInst): Renamed to MonoDynamicGenericClass.
23999         (MonoClass): Renamed `generic_inst' to `generic_class'.
24000         (MonoGenericContext): Renamed `ginst' to `gclass'.
24001
24002         * object-internals.h
24003         (MonoReflectionGenericInst): Renamed to MonoReflectionGenericClass.
24004
24005         * reflection.c (mono_reflection_generic_inst_initialize): Renamed to
24006         mono_reflection_generic_class_initialize().
24007
24008         * icall.c (icall_entries): "System.Reflection.MonoGenericInst" is
24009         now known as "System.Reflection.MonoGenericClass".
24010         (monogenericinst_icalls): Renamed to monogenericclass_icalls.
24011
24012 2004-11-29  Sebastien Pouliot  <sebastien@ximian.com>
24013
24014         * class-internals.h: Added a flag field to MonoClass to cache the
24015         declarative security attributes actions associated with the class.
24016         * domain-internals.h: Added booleans to MonoJitInfo to cache the
24017         (class or method level) stack modifiers (Assert, Deny and PermitOnly)
24018         applicable to the JITted method.
24019         * reflection.c|h: Added functions to extract (as flags) which security
24020         actions are available (declaratively) for a method, class or assembly.
24021         * metadata.c|h: Added functions to search the declarative security
24022         table in the metadata.
24023         
24024 2004-11-29  Ben Maurer  <bmaurer@ximian.com>
24025
24026         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces):
24027         EXPORTEDTYPES are already in the class name cache, so there is no
24028         need to add extra code here to look at them. Just removes a bit of
24029         cruft.
24030
24031         (ves_icall_System_Environment_get_TickCount): No need for #if
24032         WINDOWS. We already have the code in io-layer.
24033
24034 2004-11-28  Martin Baulig  <martin@ximian.com>
24035
24036         * loader.c
24037         (method_from_methodspec): Also inflate the `gmethod->mtype_argv'.
24038         Fixes gen-112.cs.
24039
24040 2004-11-27  Miguel de Icaza  <miguel@ximian.com>
24041
24042         * assembly.c (do_mono_assembly_open): Instead of having a
24043         conditional WITH_BUNDLE, incorporate support for bundles here, by
24044         having a global `bundles' variable holding a pointer to the actual
24045         bundles. 
24046
24047         (mono_register_bundled_assemblies): New API call used by the
24048         bundle code. 
24049
24050         See mkbundle.1 for details.
24051         
24052 2004-11-27  Martin Baulig  <martin@ximian.com>
24053
24054         * object.c (mono_class_vtable): Store the `MonoMethod *' itself in
24055         the vtable for generic methods.
24056
24057 2004-11-26  Martin Baulig  <martin@ximian.com>
24058
24059         * metadata.c
24060         (mono_metadata_generic_method_hash): New public function.
24061         (mono_metadata_generic_method_equal): Likewise.
24062
24063         * class-internals.h
24064         (MonoGenericContainer): Added `GHashTable *method_hash'.
24065
24066         * reflection.c (ReflectionMethodBuilder): Added
24067         `MonoGenericContainer *generic_container'.
24068         (reflection_methodbuilder_to_mono_method): Don't create a new
24069         MonoGenericContainer each time we're called.
24070         (mono_reflection_bind_generic_method_parameters): Use
24071         `container->method_hash' to cache the results so we don't create a
24072         different method if we're called several times with the same
24073         arguments.
24074
24075         * loader.c (method_from_methodspec): Use the new
24076         `container->method_hash' here, too.
24077
24078 2004-11-26  Martin Baulig  <martin@ximian.com>
24079
24080         * class.c (inflate_generic_signature): Correctly compute
24081         `res->has_type_parameters'.
24082         (mono_class_vtable): Use the `has_type_parameters' flag to
24083         determine whether we're a generic method.
24084
24085         * metadata.c (mono_metadata_parse_method_signature_full): Likewise.
24086
24087 2004-11-25  Zoltan Varga  <vargaz@freemail.hu>
24088
24089         * object.c (mono_runtime_run_main): Fix a small memory leak.
24090
24091 2004-11-25  Martin Baulig  <martin@ximian.com>
24092
24093         * class.c (set_generic_param_owner): Fixed the loop.
24094
24095 2004-11-25  Martin Baulig  <martin@ximian.com>
24096
24097         * object.c (mono_class_vtable): Don't create any JIT wrappers for
24098         generic methods.
24099
24100 2004-11-24  Zoltan Varga  <vargaz@freemail.hu>
24101
24102         * reflection.c: Allow all kinds of whitespace, not just ' ' in type
24103         names. Fixes #69787.
24104
24105 2004-11-24  Martin Baulig  <martin@ximian.com>
24106
24107         * class.c (mono_class_create_generic_2): If we don't have a
24108         `ginst->parent', inflate `gklass->parent' to get our parent.
24109
24110 2004-11-24  Martin Baulig  <martin@ximian.com>
24111
24112         * reflection.c (compare_genericparam): Correctly sort the
24113         GenericParam table; fixes #69779.
24114
24115 2004-11-23  Ben Maurer  <bmaurer@ximian.com>
24116
24117         * reflection.c: When writing a PE file, don't create a huge
24118         buffer in memory. Just write the arrays we have to the file.
24119         This reduces memory usage.
24120
24121         * metadata-internals.h: MonoDynamicStream pefile is no longer used
24122         globally.
24123
24124 2004-11-17  Martin Baulig  <martin@ximian.com>
24125
24126         * class.c (mono_class_init): Don't setup `class->parent' for
24127         dynamic instances; moved this to mono_class_generic_2().
24128         (mono_class_create_generic): Also set `klass->inited' for dynamic
24129         generic instances.
24130         (mono_class_create_generic_2): Don't do anything for dynamic
24131         generic instances.  Set `klass->parent' here and also call
24132         mono_class_setup_parent() here. 
24133
24134         * reflection.c (do_mono_reflection_bind_generic_parameters): Added
24135         `MonoType *parent' argument; set `ginst->parent' before calling
24136         mono_class_create_generic_2(), so we set the correct parent.
24137
24138 Thu Nov 18 17:10:32 CET 2004 Paolo Molaro <lupus@ximian.com>
24139
24140         * reflection.c: allow getting attributes from ModuleBuilder
24141         (used by ikvm).
24142
24143 2004-11-17  Martin Baulig  <martin@ximian.com>
24144
24145         * class.c (mono_class_create_from_typedef): If a type parameter is
24146         inherited from an outer class, set its owner to that class.
24147
24148 2004-11-17  Atsushi Enomoto  <atsushi@ximian.com>
24149
24150         * reflection.c: (mono_image_create_pefile): Don't use NULL argument
24151           for (int*) written size. This fixes bug #69592.
24152
24153 2004-11-15  Sebastien Pouliot  <sebastien@ximian.com>
24154
24155         * icall.c: Added IsAuthenticodePresnet internal call.
24156         * image.c|h: New function that check a MonoImage for an Authenticode
24157         signature in the certificate PE data directory.
24158         * security.c|h: New internal call to ask the runtime if an 
24159         Authenticode signature seems referenced in the PE header.
24160
24161 2004-11-15  Zoltan Varga  <vargaz@freemail.hu>
24162
24163         * icall.c (ves_icall_type_isprimitive): Native int is a primitive type.
24164
24165         * reflection.c (mono_image_create_pefile): Free the assembly streams
24166         after writing out the assembly file.
24167
24168         * object.c (mono_runtime_run_main): Fix small memory leak.
24169
24170         * icall.c (ves_icall_Type_GetPropertiesByName): Add support for
24171         property access modifiers. Fixes #69389.
24172
24173 Mon Nov 15 11:54:22 CET 2004 Paolo Molaro <lupus@ximian.com>
24174
24175         * domain.c, object.c, object-internals.h, domain-internals.h,
24176         object.h, marshal.c: keep dynamic code info per domain.
24177
24178 2004-11-15  Martin Baulig  <martin@ximian.com>
24179
24180         * class.c (mono_type_get_name_recurse): Put type arguments in
24181         `[',`]' instead of in `<','>'.  Thanks to Atsushi for the patch,
24182         see bug #68387.
24183
24184 2004-11-15  Martin Baulig  <martin@ximian.com>
24185
24186         * class.c (mono_type_get_name_recurse): Added `include_ns' flag.
24187         (mono_class_setup_vtable): When computing `the_cname' for a
24188         generic instance, don't include the namespace since we'd otherwise
24189         add it twice.
24190
24191 2004-11-15  Martin Baulig  <martin@ximian.com>
24192
24193         * class.c (mono_class_create_generic): Changed return type to void.
24194         (mono_class_create_generic_2): New public function; setup
24195         `class->method', `class->field' and `class->interfaces' here
24196         instead of in mono_class_init().
24197
24198         * class.h (mono_class_create_generic): Moved to class-internals.h.
24199
24200 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
24201
24202         * reflection.c (mono_image_create_pefile): take a file HANDLE.
24203         rather than writing to memory, write to this file. Right now,
24204         we are just writting into a buffer, and copying that. However
24205         we can avoid the buffer later.
24206
24207         (mono_dynamic_stream_reset): new function
24208
24209         * icall.c, object-internals.h: update for the above.
24210
24211 2004-11-13  Ben Maurer  <bmaurer@ximian.com>
24212
24213         * reflection.c: Remove *_ATOMIC macros. We really shouldn't
24214         have been using gc'd memory. First it is slower, unlikely
24215         the comment in the source code said, secondly, it increases
24216         our footprint to do it in the gc.
24217
24218         * icall.c (WriteToFile): rename of getDataChunk. Rewrite
24219         the method so that it does not have to copy to managed code.
24220
24221 2004-11-12  Zoltan Varga  <vargaz@freemail.hu>
24222
24223         * loader.c (mono_method_get_header): Fix build for older glibs which does not define G_LIKELY.
24224
24225 2004-11-12  Martin Baulig  <martin@localhost>
24226
24227         * reflection.c (mono_image_create_token): Allow generic method
24228         definitions here, since they may appear in an `.override'; see
24229         gen-98/gen-99 for an example.
24230
24231 2004-11-11  Zoltan Varga  <vargaz@freemail.hu>
24232
24233         * icall.c (ves_icall_Type_GetField): Support BFLAGS_IgnoreCase. Fixes
24234         #69365.
24235
24236         * marshal.c (mono_string_to_ansibstr): Make g_error messages more
24237         descriptive.
24238
24239 2004-11-11  Martin Baulig  <martin@ximian.com>
24240
24241         * class.c (mono_class_setup_vtable): In an explicit interface
24242         implementation, the method name now includes the arity.
24243
24244 2004-11-10  Zoltan Varga  <vargaz@freemail.hu>
24245
24246         * object.c (mono_array_full_copy): Fix warning.
24247
24248 2004-11-10  Lluis Sanchez Gual  <lluis@novell.com>
24249
24250         * appdomain.c: Removed look_for_method_by_name(). Use the new method
24251         mono_class_get_method_from_name() instead.
24252         
24253         * class-internals.h: Added two new types of wrappers. 
24254         Added MonoRemotingTarget enum. Added new trampoline function type, which
24255         takes an additional MonoRemotingTarget value as parameter, so it is
24256         possible to request a trampoline for a specific target.
24257         
24258         * class.c: Added new mono_class_get_method_from_name() method.
24259         
24260         * class.h: In MonoRemoteClass, we can have now to vtables, one for
24261         general remoting sinks and one specific for cross domain calls.
24262         
24263         * debug-helpers.c: Added new wrapper names.
24264         
24265         * icall.c: Use the new method mono_remote_class_vtable() to get the vtable
24266         of a remote class.
24267         
24268         * image.c: Porperly delete value objects form the remoting invoke hashtable.
24269         
24270         * marshal.c: Added mono_marshal_get_xappdomain_invoke(), which together
24271         with several other methods (mono_marshal_get_xappdomain_dispatch,
24272         mono_marshal_get_xappdomain_target, mono_marshal_get_serialize_exception,
24273         and others) can generate a fast remoting wrapper for cross domain calls.
24274         More information can be found in docs/remoting.
24275         Other changes: Removed mono_find_method_by_name, and used
24276         mono_class_get_method_from_name instead.
24277         Remoting wrappers are now stored in a MonoRemotingMethods struct, which
24278         is stored in the remoting invoke hashtable.
24279         
24280         * marshal.h: published the new method for getting the xdomain wrapper,
24281         and also added a method for getting the adequate wrapper for a given
24282         method and target.
24283         
24284         * object-internals.h, object.c: Added a couple of methods for capying and
24285         cloning arrays.
24286         Modified mono_install_remoting_trampoline, which takes the new remoting
24287         trampoline that has a remoting target as parameter.
24288         mono_class_proxy_vtable now also takes a remoting target as parameter, and
24289         will return the most suitable vtable for the target.
24290         Added mono_remote_class_vtable, which returns the vtable of a remote class
24291         (which can be the normal remoting vtable or the xdomain vtable).
24292         
24293         * threads.c: the xdomain invoke and dispatch wrappers must also be
24294         protected against interruptions.
24295
24296 2004-11-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24297
24298         * icall.c: use memmove in BlockCopyInternal when the source and
24299         destination arrays are the same.
24300
24301 2004-11-09  Martin Baulig  <martin@ximian.com>
24302
24303         * class-internals.h (MonoGenericContainer): Removed `method' and
24304         `signature', replaced them with `is_method' and `is_signature'
24305         flags.  Added `context'.
24306
24307         * loader.c (method_from_methodspec): Take a `MonoGenericContext *'
24308         instead of a `MonoGenericContainer *'.
24309
24310         * metadata.c (mono_metadata_generic_param_equal): Removed the hack
24311         for dynamic type parameters.
24312         (mono_metadata_load_generic_params): Setup `container->context'.
24313
24314         * reflection.c (mono_reflection_setup_generic_class): Setup
24315         `tb->generic_container->context'.
24316         (do_mono_reflection_bind_generic_parameters): Use
24317         mono_class_inflate_generic_type() to correctly inflate types,
24318         rather than using our own hack just for MONO_TYPE_VAR.
24319
24320 2004-11-09  Martin Baulig  <martin@ximian.com>
24321
24322         * class.c (mono_class_inflate_generic_method): Small fix; don't
24323         crash here.
24324
24325         * icall.c
24326         (ves_icall_MonoType_GetGenericArguments): Don't ignore `byref' types.
24327         (ves_icall_Type_get_IsGenericTypeDefinition): Likewise.
24328         (ves_icall_Type_GetGenericTypeDefinition_impl): Likewise.
24329         (ves_icall_Type_BindGenericParameters): Likewise.
24330         (ves_icall_Type_get_IsGenericInstance): Likewise.
24331         (ves_icall_Type_GetGenericParameterPosition): Likewise.
24332         (ves_icall_MonoType_get_HasGenericArguments): Likewise.
24333         (ves_icall_MonoType_get_IsGenericParameter): Likewise.
24334         (ves_icall_MonoType_get_DeclaringMethod): Likewise.
24335
24336 2004-11-09  Zoltan Varga  <vargaz@freemail.hu>
24337
24338         * assembly.c (mono_assembly_names_equal): Reenable the comparison of
24339         assembly versions and public key tokens. Fixes #69113.
24340
24341 Tue Nov 9 17:34:05 CET 2004 Paolo Molaro <lupus@ximian.com>
24342
24343         * metadata.c: fix bug introduced with the type cache changes
24344         on 2004-11-06.
24345
24346 Tue Nov 9 17:26:29 CET 2004 Paolo Molaro <lupus@ximian.com>
24347
24348         * metadata.h, metadata.c, domain-internals.h, marshal.c: include
24349         the MonoClass pointer instead of the token in exception clauses.
24350         * reflection.c: updates for the above and make the code not depend
24351         on the structure of MonoExceptionClause.
24352
24353 2004-11-08  Zoltan Varga  <vargaz@freemail.hu>
24354
24355         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24356         Add support for dynamic assemblies. Fixes #69114.
24357
24358         * loader.c (mono_method_get_header): Handle icalls and pinvoke methods.
24359
24360 2004-11-07  Ben Maurer  <bmaurer@ximian.com>
24361
24362         * class-internals.h (MonoMethod): Move addr to MonoMethodPInvoke
24363         since most only those methods use it. the code member of
24364         MonoMethodPInvoke was dead, so that can be removed too. Also,
24365         remove inline_count (again, not used), and move slot so that it
24366         can share bits with some other flags. This saves 8 bytes in the
24367         structure and gives us about 50 kb back for mcs helloworld.cs
24368
24369         * *.[ch]: Do naming changes for the above.
24370
24371         * loader.c (mono_method_get_header): Lazily init the header
24372         on first access.
24373         (mono_get_method_from_token): don't init the header here
24374         (mono_free_method): the header may never be allocated
24375
24376         Overall, this saves 150 kb of unmanaged allocations
24377         for mcs helloworld.cs. That accounts for 10% of the unmanaged
24378         memory at runtime.
24379         
24380         * loader.c, loader.h (mono_method_get_header): new accessor.
24381
24382         * *.[ch]: use the above method. Prepares us to lazily load
24383         the header.
24384
24385         * *.[ch]: Clean up all the pesky warnings. gcc now only gives
24386         three warnings, which are actual bugs (see 69206).
24387
24388         * class-internals.h (MonoMethod): Remove remoting_tramp. It is
24389         unused. Saves a cool 4 bytes / method.
24390
24391 2004-11-06  Ben Maurer  <bmaurer@ximian.com>
24392
24393         * metadata.c (builtin_types): Add types for System.Object here.
24394         (mono_metadata_parse_type_full): Cache MonoType*'s that are
24395         for a class or valuetype from klass->this_arg or klass->byval_arg.
24396
24397         On mcs for a hello world, this gets us down from 21836 MonoType's
24398         to 14560.
24399
24400         (mono_metadata_free_type): Account for the above change.
24401
24402 2004-11-06  Zoltan Varga  <vargaz@freemail.hu>
24403
24404         * appdomain.c (ves_icall_System_AppDomain_GetData): Throw an 
24405         exception instead of asserting if name is null.
24406         (ves_icall_System_AppDomain_GetData): Ditto.
24407
24408 2004-11-05  Zoltan Varga  <vargaz@freemail.hu>
24409
24410         (ves_icall_get_enum_info): Avoid crash when called on a non-finished
24411         EnumBuilder.
24412
24413         * icall.c (ves_icall_System_Reflection_Assembly_GetEntryAssembly): 
24414         Return NULL when the domain does not have entry_assembly set.
24415
24416         * icall.c (ves_icall_System_Reflection_Assembly_GetFilesInternal): 
24417         Add a 'resource_modules' argument.
24418         (ves_icall_type_GetTypeCode): Fix typecode of byref types.
24419
24420         * reflection.c (mono_reflection_create_runtime_class): Move setting
24421         of wastypebuilder here, so mono_get_type_object () returns a MonoType
24422         for enums too.
24423
24424         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi): Return NULL here instead of an empty string to match MS behavior.
24425         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAnsi_len):
24426         Throw an ArgumentNullException if 'ptr' is null.
24427
24428         * appdomain.c (mono_domain_assembly_search): Avoid matching dynamic
24429         assemblies here. Fixes #69020.
24430
24431 2004-11-05  Geoff Norton  <gnorton@customerdna.com>
24432
24433         * reflection.c (build_compressed_metadata): Fix the previous patch for
24434         big endian systems.  GUINT32_FROM_LE isn't needed on strlen and was overwriting
24435         the stack.
24436
24437 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
24438
24439         * assembly.c (mono_assembly_names_equal): Allow a match if one of
24440         the cultures is false. Fixes #69090.
24441
24442         * reflection.c (build_compressed_metadata): Fix invalid memory read 
24443         detected by valgrind.
24444         
24445         * reflection.c (mono_reflection_get_type): Avoid triggering a 
24446         TypeResolve multiple times for the same type. Fixes #65577.
24447
24448 2004-11-04  Ben Maurer  <bmaurer@ximian.com>
24449
24450         * marshal.c: Avoid using ldftn to call managed functions. It is
24451         much slower than just a call.
24452
24453         * reflection.c (mono_module_get_object): free the basename we
24454         allocate here from glib.
24455         
24456         * reflection.c (ensure_runtime_vtable): make sure to free
24457         overrides.  Also, we were allocating an array of MonoMethod not an
24458         array of MonoMethod*.
24459
24460         * marshal.c (mono_marshal_get_stelemref): do a mono_mb_free here.
24461
24462         * image.c (mono_image_close): free image->guid here.
24463
24464 2004-11-02  Zoltan Varga  <vargaz@freemail.hu>
24465
24466         * reflection.c: Fix some spec conformance issues with the PE file
24467         structures so mcs compiled apps run on the Net 2.0 beta.
24468
24469 2004-11-01  Zoltan Varga  <vargaz@freemail.hu>
24470
24471         * string-icalls.c (ves_icall_System_String_ctor_encoding): 
24472         Implement this. Fixes #67264.
24473
24474         * debug-helpers.h debug-helpers.c marshal.c: Move 
24475         mono_find_method_by_name to debug-helpers.c.
24476
24477 2004-10-31  Zoltan Varga  <vargaz@freemail.hu>
24478
24479         * object.c (mono_release_type_locks): type_initialization_hash is
24480         a GHashTable.
24481
24482         * reflection.c object.c object-internals.h: Fix warnings.
24483
24484         * icall.c (ves_icall_Type_GetPropertiesByName): Handle properties
24485         without accessors. Fixes #61561.
24486
24487         * appdomain.c (ves_icall_System_AppDomain_createDomain): Inherit
24488         application base from the root domain if not set. Fixes #65641.
24489         (mono_runtime_init): Fix warning.
24490
24491 2004-10-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24492
24493         * appdomain.c: call mono_thread_pool_init.
24494         * threadpool.[ch]: new mono_thread_pool_init that sets the max. number
24495         of worker threads based on the number of CPUs and the environment
24496         variable MONO_THREADS_PER_CPU if present. The defaults are 50 (25)
24497         for non-windows (windows) systems.
24498
24499 2004-10-27  Chris Toshok  <toshok@ximian.com>
24500
24501         * mono-debug-debugger.c (write_class): don't call mono_class_init
24502         here, as even with the check for (!klass->init_pending), we get
24503         into a situation where we're hitting cycles in class
24504         initialization.  Fixes #68816.
24505
24506 2004-10-25  Zoltan Varga  <vargaz@freemail.hu>
24507
24508         * image.c: Avoid overwriting values in the loaded_images_hash when an
24509         assembly is loaded multiple times. Fixes #61152.
24510
24511         * assembly.c (mono_assembly_names_equal): Compare the cultures as well,
24512         so multiple satellite assemblies for the same name can be loaded.
24513         Fixes #68259.
24514
24515         * mono_domain_assembly_preload: Actually return the loaded assembly, 
24516         not NULL.
24517
24518         * icall.c (ves_icall_type_is_subtype_of): Fix this for byref types.
24519         (ves_icall_type_is_assignable_from): Ditto. Fixes #68582.
24520
24521         * gc.c (finalize_domain_objects): Call GC_invoke_finalizers () so
24522         pending finalizers are not invoked after the appdomain has been 
24523         unloaded. Fixes #67862.
24524
24525 2004-10-22  Martin Baulig  <martin@ximian.com>
24526
24527         * mono-debug-debugger.c
24528         (mono_debugger_runtime_invoke): Don't box valuetypes.
24529
24530 2004-10-22  Chris Toshok  <toshok@ximian.com>
24531
24532         * mono-debug-debugger.c (do_write_class): handle .cctors too, and
24533         don't hide private methods.
24534
24535 2004-10-22  Sebastien Pouliot  <sebastien@ximian.com>
24536
24537         * icall.c: Allows the runtime to "share" (when known) the public key
24538         token of an assembly. This avoid the need to recalculate the token 
24539         (from the public key) in managed code.
24540
24541 2004-10-21  Chris Toshok  <toshok@ximian.com>
24542
24543         * debug-helpers.c (append_class_name): argh, revert last patch.
24544         
24545 2004-10-21  Chris Toshok  <toshok@ximian.com>
24546
24547         * debug-helpers.c (append_class_name): use '+' as the delimiter,
24548         not '/', so that it matches what the debugger uses to look up
24549         methods.
24550
24551 2004-10-21  Martin Baulig  <martin@ximian.com>
24552
24553         * mono-debug-debugger.c (mono_debugger_throw_exception): New
24554         public method; this is called each time an exception is thrown and
24555         allows the debugger to use exception catch points.
24556
24557 2004-10-21  Martin Baulig  <martin@ximian.com>
24558
24559         * mono-debug-debugger.c (mono_debugger_handle_exception): Write
24560         the stack pointer and the exception object in some struct and pass
24561         that to the debugger.
24562
24563 2004-10-21  Chris Toshok  <toshok@ximian.com>
24564
24565         * mono-debug-debugger.c (do_write_class): add instance/static
24566         event support.  We don't expose "raise" or "other" yet.
24567         (event_is_static): new method.
24568
24569 2004-10-20  Bernie Solomon  <bernard@ugsolutions.com>
24570
24571         * mono-debug-debugger.c
24572         (mono_debugger_handle_exception): Remove
24573         bogus return value for fussy compilers.
24574
24575 2004-10-20  Martin Baulig  <martin@ximian.com>
24576
24577         * mono-debug-debugger.c
24578         (mono_debugger_unhandled_exception): Added `gpointer stack' argument.
24579         (mono_debugger_handled_exception): Likewise.
24580
24581 2004-10-20  Martin Baulig  <martin@ximian.com>
24582
24583         * mono-debug-debugger.h (MonoDebuggerEvent): Added
24584         MONO_DEBUGGER_EVENT_EXCEPTION.
24585
24586         * mono-debug-debugger.c (mono_debugger_handle_exception): New
24587         public function to send the debugger a notification for an
24588         exception and inform it about a catch/finally clause.
24589
24590 2004-10-19  Zoltan Varga  <vargaz@freemail.hu>
24591
24592         * marshal.c, icall.c: Applied patch from Alexandre Rocha Lima e
24593         Marcondes (alexandremarcondes@psl-pr.softwarelivre.org). Really
24594         fix 2.95 build. 
24595
24596         * icall.c (ves_icall_InternalExecute): Fix build for gcc-2.95.
24597
24598 2004-10-18  Zoltan Varga  <vargaz@freemail.hu>
24599
24600         * marshal.c (emit_marshal_object): Fix freeing of memory when a reference type is
24601         marshalled as [In,Out]. Fixes #58325.
24602
24603 2004-10-14  Zoltan Varga  <vargaz@freemail.hu>
24604
24605         * reflection.c (mono_method_body_get_object): Implement some fields.
24606
24607 2004-10-12  Martin Baulig  <martin@ximian.com>
24608
24609         * reflection.c (mono_reflection_bind_generic_parameters): Small
24610         fix, correctly retrieve our parent from a generic instance.
24611
24612 2004-10-12  Martin Baulig  <martin@ximian.com>
24613
24614         * metadata.c (mono_metadata_generic_param_equal): We always have
24615         an owner.
24616
24617         * class.c
24618         (mono_class_from_generic_parameter): We need to have an owner.
24619         (my_mono_class_from_generic_parameter): Likewise.
24620
24621         * reflection.c (mono_reflection_setup_generic_class): Renamed to
24622         mono_reflection_create_generic_class() and added a new
24623         mono_reflection_setup_generic_class().  
24624         (mono_reflection_initialize_generic_param): If we're a nested
24625         generic type and inherited from the containing class, set our
24626         owner to the outer class.
24627
24628 2004-10-11  Zoltan Varga  <vargaz@freemail.hu>
24629
24630         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodBodyInternal): New icall.
24631
24632         * reflection.c (mono_method_body_get_object): New function to create
24633         a MethodBody object.
24634
24635         * object-internals.h object.h: Add MonoReflectionMethodBody structure.
24636
24637 2004-10-11  Martin Baulig  <martin@ximian.com>
24638
24639         * metadata.c (_mono_metadata_type_equal): Renamed to
24640         do_mono_metadata_type_equal() and made static.
24641
24642 2004-10-11  Martin Baulig  <martin@ximian.com>
24643
24644         * appdomain.c: Bump corlib version number to 28.
24645
24646 2004-10-10  Martin Baulig  <martin@ximian.com>
24647
24648         * class-internals.h
24649         (MonoGenericInst): Added `MonoGenericContainer *container'.
24650         (MonoGenericMethod): Likewise.
24651         (MonoGenericContext): Likewise.
24652         (MonoGenericParam): Added `MonoGenericContainer *owner'.
24653
24654         * metadata.c
24655         (do_mono_metadata_parse_type): Added a `MonoGenericContainer *' argument.
24656         (do_mono_metadata_parse_generic_inst): Likewise.
24657         (mono_metadata_parse_type_full): New public method.  This is the actual
24658         mono_metadata_parse_type() implementation - with an additional
24659         `MonoGenericContainer *' argument.
24660         (mono_metadata_parse_array_full): Likewise.
24661         (mono_metadata_parse_signature_full): Likewise.
24662         (mono_metadata_parse_method_signature_full): Likewise.
24663         (mono_metadata_parse_mh_full): Likewise.
24664         (mono_type_create_from_typespec): Likewise.
24665         (mono_metadata_interfaces_from_typedef_full): New public method;
24666         this is similar to the other _full() methods, but we take a
24667         `MonoGenericContext *' since we have to pass it to mono_class_get_full().
24668         (mono_metadata_parse_generic_param): Take an additional
24669         `MonoGenericContainer *' argument and lookup the MonoGenericParam
24670         from that container.
24671         (mono_metadata_generic_param_equal): New static method to compare
24672         two type parameters.
24673         (_mono_metadata_type_equal): New static method; takes an
24674         additional `gboolean signature_only' argument - if true, we don't
24675         compare the owners of generic parameters.
24676         (mono_metadata_signature_equal): Call _mono_metadata_type_equal()
24677         with a TRUE argument - do a signature-only comparision.
24678
24679         * loader.c: Use the new _full() methods and pass the
24680         MonoGenericContainer to them.
24681
24682         * object-internals.h (MonoReflectionTypeBuilder): Added
24683         `MonoGenericContainer *generic_container' field.
24684         (MonoReflectionMethodBuilder): Likewise.
24685
24686 2004-10-08  Zoltan Varga  <vargaz@freemail.hu>
24687
24688         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): Special
24689         case initial images of dynamic assemblies.
24690
24691         * reflection.c (mono_image_basic_init): Set 'initial_image' field.
24692
24693         * metadata-internals.h (MonoDynamicImage): Add 'initial_image' field.
24694
24695         * reflection.c (mono_reflection_event_builder_get_event_info): Fix
24696         length of event->other array.
24697         (typebuilder_setup_events): Ditto.
24698
24699         * domain-internals.h (MonoDomain): Rename 'assemblies' hash table to
24700         'assembly_by_name' and add an 'assemblies' list.
24701
24702         * assembly.h assembly.c: Add a new search hook for determining whenever
24703         an assembly is already loaded. Use this instead of searching in the
24704         loaded_assemblies list.
24705
24706         * domain.c appdomain.c: Implement the new search hook so loaded 
24707         assemblies are now scoped by appdomain. Fixes #67727.
24708
24709 2004-10-07  Zoltan Varga  <vargaz@freemail.hu>
24710
24711         * threads.c (mono_thread_attach): Initialize synch_lock field so
24712         mono_thread_detach works again.
24713
24714         * loader.c (mono_lookup_pinvoke_call): Try the dllname prefixed with
24715         'lib' too. Fixes #63130.
24716
24717 2004-10-06  Jackson Harper  <jackson@ximian.com>
24718
24719         * culture-info-tables.h: regenerated.
24720
24721 2004-10-06  Zoltan Varga  <vargaz@freemail.hu>
24722
24723         * icall.c (ves_icall_Type_GetInterfaces): Include interfaces 
24724         implemented by other interfaces in the result. Fixes #65764.
24725         
24726         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24727         Handle unloadable modules without crashing.
24728
24729         * image.c (load_modules): Revert the previous patch since modules must
24730         have a fixed index inside the array.
24731         
24732         * image.c (load_modules): Don't include native modules in the modules
24733         array.
24734
24735 2004-10-05  Zoltan Varga  <vargaz@freemail.hu>
24736
24737         * reflection.h: Add param_defaults field.
24738
24739         * reflection.c: Add support for parameter defaults in dynamic methods.
24740         Fixes #64595.
24741
24742         * icall.c (ves_icall_MonoType_get_Namespace): Return NULL instead of
24743         an empty string when a type has no namespace. Fixes #64230.
24744
24745 2004-10-04  Sebastien Pouliot  <sebastien@ximian.com>
24746
24747         * tabledefs.h: Added "internal" security actions to support non-CAS
24748         permissions NonCasDemand, NonCasLinkDemand and NonCasInheritance. 
24749         Note: they do not seems to be used anymore in 2.0 (new metadata format)
24750
24751 2004-10-04  Zoltan Varga  <vargaz@freemail.hu>
24752
24753         * icall.c (ves_icall_InternalInvoke): Throw an exception when calling
24754         constructor of abstract class. Fixes #61689.
24755
24756 2004-10-04  Martin Baulig  <martin@ximian.com>
24757
24758         * class-internals.h (MonoGenericContainer): New type.
24759         (MonoMethodNormal): Replaced `MonoGenericParam *gen_params' with
24760         `MonoGenericContainer *generic_container'.
24761         (MonoClass): Replaced `gen_params' and `num_gen_params' with
24762         `MonoGenericContainer *generic_container'.
24763
24764         * metadata.c (mono_metadata_load_generic_params): Return a
24765         `MonoGenericContainer *' instead of a `MonoGenericParam *';
24766         removed the `num' argument.
24767
24768 2004-10-03  Zoltan Varga  <vargaz@freemail.hu>
24769
24770         * icall.c (ves_icall_System_Reflection_Module_GetPEKind): Add support
24771         for dynamic images.
24772
24773         * object-internals.h (MonoReflectionAssemblyBuilder): Add pe_kind and
24774         machine fields.
24775
24776         * metadata-internals.h (MonoDynamicImage): Add pe_kind and machine fields.
24777
24778         * reflection.c: Save pe_kind and machine values into the generated
24779         image file.
24780
24781         * appdomain.c: Bump corlib version number.
24782
24783         * object-internals.h: Reorganize layout of LocalBuilder.
24784
24785         * class-internals.h class.c (mono_class_get_implemented_interfaces): 
24786         New helper function.
24787
24788         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Return the
24789         created MonoType for dynamic types. Fixes #66180.
24790
24791 2004-10-02  Ben Maurer  <bmaurer@ximian.com>
24792
24793         * threadpool.c: the ares hashtable needs a critical section around it.
24794         this prevents some nasty segfaults
24795
24796 2004-10-02  Massimiliano Mantione  <massi@ximian.com>
24797
24798         * process.c: Fixed alignments to 32 bits as casting to unsigned is unsafe
24799         on 64 bits platforms, patch by will@exomi.com (Ville-Pertti Keinonen), see
24800         bug 67324).
24801         
24802 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24803
24804         * object-internals.h (MonoReflectionTypeBuilder): Add 'created' field.
24805         
24806 2004-09-30  Lluis Sanchez Gual  <lluis@novell.com>
24807
24808         * image.c: Always canonicalize image file names, to avoid loading
24809         the same assembly twice when referenced using a relative path.
24810
24811 2004-09-30  Zoltan Varga  <vargaz@freemail.hu>
24812
24813         * marshal.h marshal.c icall.c: Fix bugs in previous patch.
24814
24815         * marshal.c marshal.h icall.c: Add GetDelegateForFunctionPointerInternal icall.
24816
24817         * marshal.c: Fix warnings.
24818
24819 2004-09-29  Geoff Norton  <gnorton@customerdna.com>
24820
24821         * marshal.c (mono_ftnptr_to_delegate): This method was improperly
24822         attempting to marshal the delegate_trampoline as the method_addr.
24823         This patch has a static hashtable of marshalled delegates so that 
24824         we can map delegate_trampoline addresses back to delegates.  This
24825         allows a delegate passed to managed code to be passed back into native
24826         code.  Fixes #67039
24827
24828 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24829
24830         * icall.c: Add GetFunctionPointerForDelegateInternal icall.
24831
24832         * reflection.c (method_encode_code): Align method headers properly.
24833         Fixes #66025.
24834
24835 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24836
24837         * marshal.c: In the runtime invoke wrapper, reset the abort
24838         exception if it is cached. This avoids the automatic rethrowal of 
24839         the exception after the catch of the wrapper. Also check for pending
24840         interruptions before calling the managed method. This is done using
24841         the new method emit_thread_force_interrupt_checkpoint, since the
24842         normal checkpoint method is ignored when running the invoke wrapper.
24843         * object.c: If the abort exception is rethrown, set the abort_exc
24844         field of the thread, so it will be rethrown aftere every catch.
24845         * threadpool.c: Only run an interruption checkpoint if what has been
24846         requested is a stop of the thread (aborts will be ignored).
24847         * threads.c: By default, a thread will now never be interrumped while
24848         running the runtime invoke wrapper (this ensures that runtime_invoke
24849         will always return to the caller if an exception pointer is provided).
24850         There is a new special method mono_thread_force_interruption_checkpoint()
24851         to force an interruption checkpoint even if running a protected
24852         wrapper, which is used by the same runtime invoke wrapper to do a check
24853         at a safe point.
24854
24855 2004-09-28  Lluis Sanchez Gual  <lluis@novell.com>
24856
24857         * object.c, object-internals.h: Implemented mono_release_type_locks,
24858         which releases the cctor locks held by a thread.
24859         * threads.c, threads.h: In thread_cleanup, release cctor locks held
24860         by a thread. Added mono_thread_exit() method to be used to safely stop
24861         a thread.
24862
24863 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24864
24865         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal): 
24866         Move null check before dereference.  Avoid indexing beyond the end
24867         of the 'modules' array.
24868
24869 2004-09-28  Raja R Harinath  <rharinath@novell.com>
24870
24871         * metadata-internals.h (MonoImage): Add module_count field.
24872         * image.c (load_modules): Set image->module_count.
24873         (mono_image_load_file_for_image): Use image->module_count.
24874         * reflection.c (mono_image_load_module): Append to image->modules array 
24875         of dynamic assembly.
24876         (mono_module_get_object): Fix loop to actually increment index.
24877         Use image->module_count.
24878         * assembly.c (mono_assembly_load_references): Use image->module_count.
24879         * icall.c (ves_icall_System_Reflection_Assembly_GetModulesInternal):
24880         Likewise.
24881
24882 2004-09-28  Zoltan Varga  <vargaz@freemail.hu>
24883
24884         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): 
24885         Avoid assert on generic types.
24886
24887 2004-09-26  Zoltan Varga  <vargaz@freemail.hu>
24888
24889         * icall.c (ves_icall_System_Reflection_FieldInfo_GetUnmanagedMarshal): New icall.
24890
24891         * reflection.c (mono_param_get_objects): Fill out MarshalAsImpl field.
24892
24893         * reflection.c (mono_reflection_marshal_from_marshal_spec): New 
24894         function to convert a MarshalSpec structure to its managed counterpart.
24895
24896         * reflection.c: Fix warnings.
24897         
24898         * object-internals.h (MonoReflectionParameter): Add MarshalAsImpl
24899         field.
24900
24901         * icall.c (mono_create_icall_signature): Fix build.
24902
24903 2004-09-25  Zoltan Varga  <vargaz@freemail.hu>
24904
24905         * icall.c: Add MakePointType icall.
24906
24907         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage): Fix
24908         warnings.
24909
24910 2004-09-25 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24911
24912         * threadpool.c: reuse allocated slots in the queue.
24913
24914 2004-09-24  Zoltan Varga  <vargaz@freemail.hu>
24915
24916         * object-internals.h (MonoReflectionDllImportAttribute): New structure.
24917
24918         * icall.c: Add new icalls for GetDllImportAttribute and GetFieldOffset.
24919
24920         * reflection.h reflection.c (mono_reflection_get_custom_attrs): Revert
24921         previous change.
24922
24923         * tabledefs.h: Add constants for pinvoke attributes BestFit and
24924         ThrowOnUnmappableChar.
24925
24926         * icall.c (ves_icall_Type_GetPacking): New icall.
24927
24928 2004-09-24  Martin Baulig  <martin@ximian.com>
24929
24930         * icall.c (ves_icall_Type_GetGenericParameterConstraints): New interncall.
24931
24932 2004-09-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
24933
24934         * appdomain.c:
24935         (mono_domain_set): allow setting a domain that is being unloaded.
24936         (mono_domain_unload): invoke the DomainUnload callbacks in the domain
24937         being unloaded.
24938
24939 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24940
24941         * icall.c reflection.h reflection.c: Add a 'pseudo_attrs' argument to
24942         the GetCustomAttributes icall.
24943
24944 2004-09-23  Martin Baulig  <martin@ximian.com>
24945
24946         * object-internals.h (MonoReflectionGenericParam): Replaced
24947         'has_ctor_constraint', `has_reference_type' and `has_value_type'
24948         with `guint32 attrs'.
24949
24950 2004-09-23  Martin Baulig  <martin@ximian.com>
24951
24952         * icall.c (ves_icall_Type_GetGenericParameterAttributes): New interncall.
24953
24954 2004-09-23  Martin Baulig  <martin@ximian.com>
24955
24956         * object-internals.h (GenericParameterAttributes): New enum.
24957
24958 2004-09-23  Zoltan Varga  <vargaz@freemail.hu>
24959
24960         * object-internals.h (MonoEventInfo): Add 'other_methods' field.
24961         
24962         * class.c (init_events): Fill out event->other field.
24963
24964         * class.c: Fix warnings.
24965
24966         * icall.c (ves_icall_get_event_info): Fill out 'other_methods' field.
24967
24968 Wed Sep 22 19:04:32 CEST 2004 Paolo Molaro <lupus@ximian.com>
24969
24970         * class-internals.h, icall.c, loader.c, loader.h: added a faster stack
24971         walk which doesn't supply the IL offset.
24972
24973 2004-09-22  Martin Baulig  <martin@ximian.com>
24974
24975         * reflection.c (mono_reflection_setup_internal_class): If we're
24976         System.ValueType, System.Object or System.Enum, set
24977         `klass->instance_size' and create the vtable.
24978         (mono_reflection_create_internal_class): If we're an enum type,
24979         get the base class from our current corlib.
24980
24981 2004-09-22  Zoltan Varga  <vargaz@freemail.hu>
24982
24983         * reflection.h (MonoResolveTokenError): New type.
24984
24985         * icall.c (ves_icall_System_Reflection_Module_ResolveMemberToken): New
24986         icall.
24987
24988         * icall.c: Add an 'error' argument to the ResolveToken icalls.
24989
24990 2004-09-22  Lluis Sanchez Gual  <lluis@novell.com>
24991
24992         * icall.c: Support ContextBoundObject proxies in ves_icall_InternalExecute.
24993         Support also calling constructors, but only for already allocated objects.
24994
24995 2004-09-17  Geoff Norton <gnorton@customerdna.com>
24996
24997         * reflection.c (type_get_qualified_name): If the klass is null
24998         return the typename to avoid a NullRefEx.
24999         (encode_cattr_value): Get the qualified name of the boxed type,
25000         not the underlying enumtype.  Fixes #62984.
25001
25002 2004-09-21  Zoltan Varga  <vargaz@freemail.hu>
25003
25004         * marshal.c: Fix problems with previous checkin.
25005
25006 2004-09-21    <vargaz@freemail.hu>
25007
25008         * marshal.h marshal.c icall.c: Add new icalls for Alloc/FreeHGlobal. Change the
25009         existing mono_marshal_alloc/free functions to use CoTaskMemAlloc/Free under windows.
25010
25011         * marshal.c: Allocate marshaller memory using mono_marshal_alloc/free.
25012
25013 2004-09-21  Geoff Norton <gnorton@customerdna.com>
25014
25015         * icall.c (ves_icall_MonoType_GetElementType): GetElementType
25016         should only return a type for pointers, arrays, and passbyref types.
25017         Fixes bug #63841.
25018
25019 2004-09-21  Martin Baulig  <martin@ximian.com>
25020
25021         * domain.c (mono_debugger_check_runtime_version): New public
25022         function.
25023
25024         * icall.c (ves_icall_MonoDebugger_check_runtime_version): New icall.    
25025
25026 2004-09-20  Sebastien Pouliot  <sebastien@ximian.com>
25027
25028         * reflection.c: Added missing sort to the declarative security 
25029         attributes table. MS implementation stops seeing the attributes if the
25030         token number regress in the table (as shown by ildasm and permview).
25031
25032 2004-09-20  Zoltan Varga  <vargaz@freemail.hu>
25033
25034         * object-internals.h (MonoReflectionModule): Add 'token' field.
25035         
25036         * reflection.c (mono_reflection_get_token): Add support for Module
25037         and Assembly.
25038         (mono_module_get_object): Set 'token' field.
25039         (mono_module_file_get_object): Set 'token' field.
25040
25041         * icall.c: Add new Assembly and Module icalls.
25042
25043         * appdomain.c: Bump corlib version.
25044
25045 2004-09-19  Zoltan Varga  <vargaz@freemail.hu>
25046
25047         * loader.h loader.c class.h class.c: Add helper functions for obtaining
25048         tokens of metadata objects.
25049
25050         * reflection.h reflection.c (mono_reflection_get_token): New function
25051         to obtain the token of a metadata object.
25052
25053         * icall.c: Add icalls for MetadataToken and ModuleHandle methods.
25054
25055 2004-09-17  Zoltan Varga  <vargaz@freemail.hu>
25056
25057         * loader.c (mono_lookup_pinvoke_call): Try the underscore prefixed name as well.
25058         
25059         * loader.c (mono_lookup_pinvoke_call): Add support for stdcall name mangling.
25060
25061 2004-09-16  Sebastien Pouliot  <sebastien@ximian.com>
25062
25063         * appdomain.c: Bumped MONO_CORLIB_VERSION to 25.
25064         * object-internals.h: Added 3 MonoArray* members to MonoReflection
25065         AssemblyBuilder to access the permissions set in the class lib.
25066         * reflection.c: Added security attributes encoding step in 
25067         mono_image_build_metadata.
25068         * tabledefs.h: Added new security actions defined in 2.0:
25069         LinkDemandChoice, InheritanceDemandChoice and DemandChoice.
25070
25071 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
25072
25073         * threads.c: Fixed SET_CURRENT_OBJECT macros, they were ignoring the
25074         macro parameter.
25075
25076 2004-09-16  Lluis Sanchez Gual  <lluis@novell.com>
25077  
25078         * locales.c: nullify the ICU_collator member of CompareInfo when it is
25079           finalized. There where random SIGSEVs at program termination, when
25080           an object being finalized was trying to do a string comparison and
25081           the current culture was already finalized.
25082  
25083 2004-09-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25084
25085         * threads.c: call thread_cleanup before finishing the thread if we get
25086         there.
25087
25088 2004-09-16  Zoltan Varga  <vargaz@freemail.hu>
25089
25090         * appdomain.c (ves_icall_System_AppDomain_createDomain): Load all
25091         assemblies from the parent. Fixes #65665.
25092
25093 2004-09-15  Zoltan Varga  <vargaz@freemail.hu>
25094
25095         * metadata.c (mono_metadata_parse_type): Fix parsing of custom
25096         modifiers.
25097
25098 2004-09-14  Bernie Solomon  <bernard@ugsolutions.com>
25099
25100         * reflection.h: add prototype for mono_get_dbnull_object
25101         * reflection.c: add prototypes for get_default_param_value_blobs 
25102         and mono_get_object_from_blob for fussier compilers
25103
25104 2004-09-14  Lluis Sanchez Gual  <lluis@novell.com>
25105  
25106         * object.c: Added a "done" flag to TypeInitializationLock. This avoids
25107         false deadlock checks in class initialization.
25108  
25109 2004-09-13  Zoltan Varga  <vargaz@freemail.hu>
25110
25111         * image.c (mono_image_addref): Fix comment.
25112
25113         * metadata.c (mono_metadata_parse_type): Avoid memory allocations if
25114         possible.
25115
25116 2004-09-12  Jambunathan K  <kjambunathan@novell.com>
25117
25118         * reflection.c (mono_param_get_objects): Modified to return
25119         ParameterInfo.DefaultValue object.
25120
25121         (get_default_param_value_blobs):
25122         (mono_get_object_from_blob):
25123         (mono_get_dbnull_object): New helper routines. 
25124
25125         * object.c (mono_get_constant_value_from_blob): New helper routine
25126         carved out from get_default_field_value ()
25127
25128         * object-internals.h (mono_get_constant_value_from_blob): Added
25129         function declaration.
25130
25131 2004-09-11  Zoltan Varga  <vargaz@freemail.hu>
25132
25133         * assembly.c assembly.h icall.c class.c appdomain.c: Lazily load 
25134         referenced assemblies. Fixes #62135.
25135
25136         * exception.h exception.c (mono_get_exception_file_not_found2): New
25137         helper function.
25138
25139 2004-09-10  Zoltan Varga  <vargaz@freemail.hu>
25140
25141         * class.h class.c: Add mono_type_get_underlying_type ().
25142
25143 2004-09-09  Geoff Norton <gnorton@customerndna.com>
25144
25145         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes):
25146         Fix GetTypes() to support dynamically created assemblies.
25147
25148 2004-09-09  Zoltan Varga  <vargaz@freemail.hu>
25149
25150         * reflection.c (reflection_methodbuilder_to_mono_method): Remove TODO.
25151         
25152         * reflection.c (reflection_methodbuilder_to_mono_method): Fix bug in
25153         previous patch.
25154
25155         * reflection.h reflection.c loader.c: Allow dynamic construction of
25156         pinvoke methods. Fixes #65571.
25157         
25158         * reflection.c (mono_reflection_get_type): Revert previous change since
25159         it causes regressions.
25160
25161 2004-09-08  Martin Baulig  <martin@ximian.com>
25162
25163         * class.c (class_compute_field_layout): Don't call
25164         mono_class_layout_fields() for open generic instances.
25165
25166 2004-09-08 Bernie Solomon <bernard@ugsolutions.com>
25167         * threads.c appdomain.c: fix typo in GC macro
25168
25169 2004-09-08 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25170
25171         * threads.c: don't call mono_thread_detach() in start_wrapper(),
25172         avoiding a possible hang in GetCurrentThreadId(0). Fixes bug #65379.
25173
25174 2004-09-08  Zoltan Varga  <vargaz@freemail.hu>
25175
25176         * image.c (mono_image_close): Applied patch from 
25177         vasantha.paulraj@honeywell.com (Vasantha selvi). Fix crash when an
25178         assembly is loaded multiple times from data.
25179         
25180         * image.c (mono_image_open): Fix warning.
25181
25182 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25183
25184         * reflection.h reflection.c icall.c: Only call TypeResolve handlers
25185         once. Fixes #58334.
25186         
25187         * reflection.c (mono_reflection_create_runtime_class): Initialize
25188         klass->nested_classes. Fixes #61224.
25189
25190 Tue Sep 7 14:35:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
25191
25192         * threads.c: sched_yield() on exit, to allow threads to quit.
25193
25194 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25195
25196         * object.c (mono_unhandled_exception): Remove leftover debug code.
25197
25198 2004-09-07  Atsushi Enomoto  <atsushi@ximian.com>
25199
25200         * appdomain.c, threads.c : don't use GC_CreateThread when with-gc=none
25201
25202 2004-09-07  Zoltan Varga  <vargaz@freemail.hu>
25203
25204         * marshal.c (emit_marshal_array): Really null terminate string arrays.
25205         
25206         * marshal.c (emit_marshal_string): Fix freeing of unicode strings.
25207
25208 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25209
25210         * marshal.c (emit_marshal_array): Null terminate string arrays.
25211         
25212         * marshal.c (raise_auto_layout_exception): Fix warning.
25213
25214         * reflection.c (mono_param_get_objects): Initialize the default value
25215         with DBNull.Value, not null. Fixes #62123.
25216
25217 2004-09-01  Miguel de Icaza  <miguel@ximian.com>
25218
25219         * marshal.c (mono_marshal_get_managed_wrapper): Remove FIXME and
25220         throw an exception with a cute explanation.
25221
25222 2004-09-06  Dick Porter  <dick@ximian.com>
25223
25224         * process.c (ves_icall_System_Diagnostics_Process_Start_internal):
25225         Close the new process's thread handle, as we don't use it.  The
25226         handle stays around forever otherwise.
25227
25228 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25229
25230         * object.c (arith_overflow): Fix warning.
25231
25232         * reflection.c (mono_image_get_methodref_token): Do not emit unmanaged
25233         calling conventions in method refs. Fixes #65352.
25234
25235         * reflection.c: Fix warnings.
25236
25237 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
25238
25239         * icall.c: Add a new icall for Array.Clear
25240
25241 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
25242
25243         * object.c: When allocating an array, we have to throw
25244         an overflow exception if any of the lengths are < 0.
25245
25246 2004-09-06  Zoltan Varga  <vargaz@freemail.hu>
25247
25248         * marshal.h marshal.c: Free unmanaged memory allocated by managed code
25249         properly. Also move implementation of string array marshalling to 
25250         managed code. Fixes #42316.
25251
25252 2004-09-05 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25253
25254         * assembly.c: provide more information when loading an assembly fails.
25255
25256 2004-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25257
25258         * filewatcher.c: don't expect the development fam package to be
25259         installed.
25260
25261 2004-09-03  Zoltan Varga  <vargaz@freemail.hu>
25262
25263         * marshal.c: Make a copy of the signature cookie since it will be
25264         freed by the caller.
25265         
25266         * marshal.c (mono_delegate_to_ftnptr): Fix bug in previous patch.
25267
25268         * marshal.c (mono_delegate_to_ftnptr): Fix memory leaks.
25269
25270         * metadata.c (mono_metadata_free_marshal_spec): New function to free
25271         marshal specs.
25272
25273         * marshal.c: More refactoring.
25274         
25275         * marshal.c: Refactor the mono_marshal_get_native_wrapper function into
25276         smaller functions.
25277
25278 2004-09-03  Lluis Sanchez Gual  <lluis@novell.com>
25279
25280         * object.c: In mono_message_invoke, fill the output parameter array after
25281           calling the managed method (it was done before the call). This fixes
25282           bug #59299.
25283
25284 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25285
25286         * marshal.c (mono_marshal_alloc): Return a valid pointer on size 0
25287         as well.
25288
25289 2004-09-02  Martin Baulig  <martin@ximian.com>
25290
25291         * class.c (mono_class_instance_size): Don't allow generic type
25292         definitions or open generic instances.
25293         (mono_class_array_element_size): If we're a value type, call
25294         mono_class_instance_size() on the original class.
25295
25296         * metadata.c (mono_type_size, mono_type_stack_size): Correctly
25297         handle generic instances.
25298
25299         * mono-debug-debugger.c (write_type): Handle generic instances
25300         like classes.
25301
25302 2004-09-02  Zoltan Varga  <vargaz@freemail.hu>
25303
25304         * marshal.c (mono_marshal_alloc): Raise an OutOfMemory exception if
25305         the allocation request fails. Fixes #65089.
25306
25307         * object.c (mono_runtime_free_method): Do not call mono_free_method.
25308         
25309         * object.c (mono_runtime_free_method): New function to free a dynamic
25310         method.
25311
25312         * marshal.c (mono_delegate_free_ftnptr): New function to free the
25313         delegate trampoline.
25314
25315         * marshal.c (mono_marshal_get_managed_wrapper): Mark managed wrapper
25316         with hasthis as dynamic,
25317
25318         * icall.c (ves_icall_System_Delegate_FreeTrampoline): New icall.
25319
25320         * domain.c (mono_jit_info_table_remove): New function to remove an
25321         entry from the jit info table.
25322
25323         * class-internals.h (MonoMethod): Add 'dynamic' field.
25324
25325         * loader.c: Fix warnings.
25326
25327 2004-09-01  Martin Baulig  <martin@ximian.com>
25328
25329         * mono-debug.c, debug-mono-symfile.c: Use mono_loader_lock()
25330         instead of mono_debugger_lock() because the latter one is a no-op
25331         unless running in the debugger.
25332
25333 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25334
25335         * class.c (class_compute_field_layout): Classes with auto-layout or
25336         reference fields are not blittable.
25337         
25338 2004-09-01  Dick Porter  <dick@ximian.com>
25339
25340         * icall.c (ves_icall_System_Reflection_Assembly_get_location): Use
25341         mono_image_get_filename() to get the assembly location.
25342
25343         * icall.c:
25344         * metadata.h: Fix compile warnings
25345
25346 2004-09-01  Zoltan Varga  <vargaz@freemail.hu>
25347
25348         * class.c (class_compute_field_layout): System.Object is blittable.
25349
25350         * marshal.c (mono_marshal_get_native_wrapper): Pass blittable classes
25351         as in/out. Fixes #59909.
25352
25353 2004-09-01  Martin Baulig  <martin@ximian.com>
25354
25355         * metadata.h (MONO_TYPE_ISREFERENCE): Call
25356         mono_metadata_generic_inst_is_valuetype() if we're a generic
25357         instance to check whether our underlying type is a reference type.
25358
25359 2004-09-01  Martin Baulig  <martin@ximian.com>
25360
25361         * metadata.c (mono_type_size): If we're a generic instance, call
25362         mono_class_value_size() for value types.
25363
25364 2004-08-31  Zoltan Varga  <vargaz@freemail.hu>
25365
25366         * marshal.c: Implement more custom marshalling functionality. Fixes
25367         #64915.
25368
25369 Tue Aug 31 17:55:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
25370
25371         * mono-debug.c, debug-mono-symfile.c: add some locking love.
25372
25373 2004-08-30  Zoltan Varga  <vargaz@freemail.hu>
25374
25375         * domain-internals.h domain.c: Add a per-domain jump trampoline hash.
25376
25377         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): Rename to ...Internal.
25378
25379         * icall.c: Fix some warnings.
25380
25381         * threads.c (abort_appdomain_thread): Fix unref errors.
25382         (mono_thread_current): Fix THREAD_DEBUG define.
25383
25384 2004-08-29  Zoltan Varga  <vargaz@freemail.hu>
25385
25386         * metadata.h (MONO_TYPE_ISSTRUCT): Fix warning.
25387
25388         * icall.c (ves_icall_System_Reflection_MethodBase_GetMethodFromHandle): New icall.
25389
25390 2004-08-28  Zoltan Varga  <vargaz@freemail.hu>
25391
25392         * marshal.c (mono_marshal_get_native_wrapper): Add support for byref 
25393         string arrays.
25394
25395 2004-08-28  Martin Baulig  <martin@ximian.com>
25396
25397         * metadata.c
25398         (mono_metadata_generic_inst_is_valuetype): New public function.
25399
25400         * metadata.h (MONO_TYPE_ISSTRUCT): Call
25401         mono_metadata_generic_inst_is_valuetype() if we're a generic
25402         instance to check whether our underlying type is a valuetype.
25403
25404 2004-08-26  Zoltan Varga  <vargaz@freemail.hu>
25405
25406         * class.c (mono_ptr_class_get): Fix name of pointer classes. Fixes
25407         #63768.
25408
25409 2004-08-25  Martin Baulig  <martin@ximian.com>
25410
25411         * loader.c (mono_get_method_from_token): Abstract methods can also
25412         be generic and thus have type parameters.
25413
25414         * metadata-internals.h
25415         (MonoDynamicImage): Added `GPtrArray *gen_params'.
25416
25417         * reflection.c (mono_image_get_generic_param_info): Don't create a
25418         metadata row, just add an entry to the `gen_params' array.
25419         (build_compressed_metadata): Sort the `gen_params' array and then
25420         actually create the metadata.
25421
25422 2004-08-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25423
25424         * threadpool.c: remove unneeded 'if' around mono_monitor_enter.
25425
25426 2004-08-25  Zoltan Varga  <vargaz@freemail.hu>
25427
25428         * debug-helpers.c: Handle MONO_TYPE_GENERICINST.
25429
25430 2004-08-24  Martin Baulig  <martin@ximian.com>
25431
25432         * class.cs (mono_class_is_subclass_of): Like an interface, a
25433         generic instance also derives from System.Object.
25434
25435 2004-08-23  Zoltan Varga  <vargaz@freemail.hu>
25436
25437         * metadata.c (mono_metadata_parse_type): Alloc pinned, byref and
25438         custom modifiers to be in any order. Fixes #61990.
25439
25440 2004-08-20  Zoltan Varga  <vargaz@freemail.hu>
25441
25442         * object.c: Register mono_object_new_fast icall.
25443         
25444         * object.c (mono_class_get_allocation_ftn): Return to calling
25445         mono_object_new_fast, since it seems faster to compute the object 
25446         size in unmanaged code than passing it as a parameter.
25447
25448         * object.c (mono_class_get_allocation_ftn): Add marshalbyref case.
25449
25450         * gc-internal.h gc.c: Add mono_gc_out_of_memory () function. Register
25451         this function with Boehm as the oom handler, so we don't have to check
25452         the result of GC_malloc.
25453
25454         * object.c: Remove checks for oom.
25455
25456         * object.h object.c (mono_class_get_allocation_ftn): New function to
25457         return the icall which can be used to allocate an instance of a given
25458         class. 
25459
25460         * object.c: Handle common allocation requests using GC_gcj_fast_malloc.
25461
25462         * class-internals.h: Add 'enabled' field.
25463
25464 2004-08-19  Zoltan Varga  <vargaz@freemail.hu>
25465
25466         * domain.c (mono_init_internal): Call MONO_GC_PRE_INIT ().
25467
25468 2004-08-18  Jambunathan K  <kjambunathan@novell.com>
25469         * tabledefs.h: Corretced PARAM_ATTRIBUTE_OPTIONAL to the right
25470         value 0x0010.
25471
25472 2004-08-18 Ben Maurer  <bmaurer@users.sourceforge.net>
25473
25474         * appdomain.c: use the Tls function for appdomain too,
25475         at Zoltan's request. Actually return in mono_context_get
25476
25477         * appdomain.c, profiler.c, threads.c: use __thread
25478
25479 2004-08-18  Zoltan Varga  <vargaz@freemail.hu>
25480
25481         * appdomain.c threads.c: Call GC_CreateThread on windows.
25482
25483         * Makefile.am (libmetadata_la_LIBADD): Avoid linking libmonoos into
25484         multiple libraries since this don't work on windows.
25485
25486 2004-08-18  Martin Baulig  <martin@ximian.com>
25487
25488         * class-internals.h
25489         (MonoMethodNormal): Moved `MonoGenericParam *gen_params' here from
25490         MonoMethodHeader.
25491
25492         * metadata.h (MonoMethodHeader): Moved the `gen_params' field to
25493         MonoMethodNormal since we also need it for abstract and interface
25494         methods.
25495
25496         * reflection.c
25497         (build_compressed_metadata): Sort the GenericParam table.
25498         (mono_image_create_token): Added `gboolean create_methodspec'
25499         argument; this is false when generating a MethodImpl token.
25500         (reflection_methodbuilder_to_mono_method): Abstract and interface
25501         methods may also have generic parameters.
25502
25503 2004-08-17 Ben Maurer  <bmaurer@users.sourceforge.net>
25504
25505         * appdomain.c: thread local alloc
25506
25507 2004-08-17  Martin Baulig  <martin@ximian.com>
25508
25509         * appdomain.c: Bumped MONO_CORLIB_VERSION to 24.
25510
25511         * icall.c
25512         (ves_icall_System_MonoType_getFullName): Added `gboolean full_name'
25513         argument.
25514
25515         * class.c (mono_type_get_full_name): New public function.
25516         (mono_type_get_name): Don't include the type arguments.
25517
25518 2004-08-16  Zoltan Varga  <vargaz@freemail.hu>
25519
25520         * Makefile.am: Build static versions of libmetadata and libmonoruntime
25521         for inclusion into the mono executable.
25522
25523 2004-08-16  Martin Baulig  <martin@ximian.com>
25524
25525         * metadata.c (do_mono_metadata_parse_generic_inst): Store the
25526         MonoGenericInst, not the MonoType in the `generic_inst_cache'.
25527
25528 2004-08-14  Martin Baulig  <martin@ximian.com>
25529
25530         * class.c (dup_type): Also copy the `byref' field.
25531
25532 2004-08-15  Zoltan Varga  <vargaz@freemail.hu>
25533
25534         * reflection.c (create_dynamic_mono_image): Revert the last change 
25535         since it breaks bootstrap.
25536
25537 2004-08-14  Zoltan Varga  <vargaz@freemail.hu>
25538
25539         * reflection.c (create_dynamic_mono_image): Set ref_count to 1.
25540
25541         * image.c (mono_image_close): Dynamic images are GC_MALLOCed, so do
25542         not free them with g_free.
25543
25544 2004-08-11  Martin Baulig  <martin@ximian.com>
25545
25546         * reflection.c (mono_reflection_setup_internal_class): Also call
25547         mono_class_setup_mono_type() if we already have a `tb->type.type'.
25548
25549 2004-08-09  Sebastien Pouliot  <sebastien@ximian.com>
25550
25551         * appdomain.c: Fix ves_icall_System_AppDomain_getDomainByID when 
25552         called during default (first) AppDomain creation. Keep track of
25553         Evidence when loading assemblies.
25554
25555 Mon Aug 9 14:41:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
25556
25557         * opcodes.c, opcodes.h: reduce runtime relocations.
25558
25559 Mon Aug 9 13:30:53 CEST 2004 Paolo Molaro <lupus@ximian.com>
25560
25561         * culture-info.h, locales.c: fixes and chages to sue the new
25562         optimized format of the locale data.
25563         * culture-info-tables.h: regenerated.
25564
25565 2004-08-06  Geoff Norton <gnorton@customerdna.com>
25566         
25567         * filewatcher.c: If HAVE_KQUEUE return mode 3 to use the new kqueue watcher
25568
25569 2004-08-05  Sebastien Pouliot  <sebastien@ximian.com>
25570
25571         * appdomain.c: Bumped MONO_CORLIB_VERSION to 23. Added new icall
25572         ves_icall_System_AppDomain_getDomainByID to get an AppDomain by Id.
25573         * domain-internals.h: icall declaration.
25574         * icall.c: icall registration.
25575         * object-internals.h: New fields in MonoAssembly for CAS.
25576
25577 2004-08-05  Duncan Mak  <duncan@ximian.com>
25578
25579         * verify.c: Renamed CEE_STELEM to CEE_STELEM_ANY and CEE_LDELEM to
25580         CEE_LDELEM_ANY.
25581
25582 Thu Aug 5 17:11:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
25583
25584         * reflection.c: fix to deal with object[] arrays in custom ctors
25585         (bug #62550).
25586
25587 2004-08-05  Martin Baulig  <martin@ximian.com>
25588
25589         * class.c (mono_class_array_element_size): Added support for
25590         generic instances and correctly handle "recursive" types.
25591
25592 2004-08-05  Zoltan Varga  <vargaz@freemail.hu>
25593
25594         * assembly.c: Fix warnings.
25595
25596 2004-08-04  Martin Baulig  <martin@ximian.com>
25597
25598         * class.c
25599         (mono_type_get_name_recurse): Added `gboolean include_arity'
25600         argument specifying whether or not we should include the generic
25601         arity in the type name.
25602         (_mono_type_get_name): New static function.
25603         (mono_class_setup_vtable): If we're a generic instance, don't
25604         include the generic arity in the names of explicit method
25605         implementations.        
25606
25607 2004-08-03  Martin Baulig  <martin@ximian.com>
25608
25609         * class.c (mono_type_get_name_recurse): Enclose the generic type
25610         arguments in `<', '>'.
25611
25612 Tue Aug 3 17:54:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25613
25614         * gc.c: make GC warning messages use the trace API, they are just
25615         noise to most of the users.
25616
25617 2004-08-03  Martin Baulig  <martin@ximian.com>
25618
25619         * debug-mono-symfile.c (read_string): Correctly read the string.
25620
25621 2004-07-30  Zoltan Varga  <vargaz@freemail.hu>
25622
25623         * marshal.c (signature_dup_add_this): Fix bug in previous patch.
25624         
25625         * marshal.c (mono_marshal_get_icall_wrapper): Add support for vararg
25626         icalls.
25627         (mono_marshal_get_runtime_invoke): Correctly handle valuetype methods.
25628
25629 2004-07-30  Martin Baulig  <martin@ximian.com>
25630
25631         * debug-mono-symfile.c, mono-debug.c, mono-debug-debugger.c:
25632         Reflect latest symbol writer changes.   
25633
25634 Fri Jul 30 16:49:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25635
25636         * object.c: always create an object if null is passed
25637         to Invoke() where a valuetype is expected.
25638
25639 2004-07-29  Bernie Solomon  <bernard@ugsolutions.com>
25640
25641         * marshal.c (mono_marshal_init): make managed
25642         signatures match native ones better for 64bits.
25643
25644 2004-07-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
25645
25646         * appdomain.c: hack to build correctly the private bin path on windows.
25647         Fixes bug #61991.
25648
25649 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
25650
25651         * assembly.c: Load mscorlib from the correct framework directory
25652           (mono/<version>/mscorlib.dll).
25653         * appdomain.h: Added prototypes for new functions.
25654         * internals.h: Added some prototypes.
25655         * domain.c: When initializing the runtime, get from the executable and
25656           the configuration files the runtime version that the app supports.
25657           Added support methods for reading app.exe.config. Added list of versions
25658           supported by the JIT. Added two new methods: mono_init_from_assembly,
25659           which initializes the runtime and determines the required version from
25660           the provided exe file, and mono_init_version, which initializes
25661           the runtime using the provided version.
25662         * icall.c: Get machine.config from version-specific directory.
25663         * reflection.c: When generating an image, embed the version number
25664           of the current runtime.
25665
25666 2004-07-28  Dick Porter  <dick@ximian.com>
25667
25668         * socket-io.c
25669         (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal): Check
25670         returned sockaddr size before creating the remote address object.
25671         Patch by Nick Vaughan (dev@6wardlaw.freeserve.co.uk), fixes bug
25672         61608.
25673
25674 2004-07-28  Dick Porter  <dick@ximian.com>
25675
25676         * locales.c (string_invariant_compare_char): Fix invariant char
25677         compares between upper and lower cases.  Fixes bug 61458.
25678
25679 2004-07-27  Ben Maurer  <bmaurer@ximain.com>
25680         
25681         * marshal.c: actually cache stelem.ref wrappers.
25682         
25683 Tue Jul 27 16:56:55 CEST 2004 Paolo Molaro <lupus@ximian.com>
25684
25685         * class.c, image.c, loader.c, cil-coff.h: lazily mmap the image 
25686         sections and remove the mono_cli_rva_map () function.
25687
25688 Tue Jul 27 15:58:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
25689
25690         * debug-mono-symfile.c: fix one more endianess issue, from a patch
25691         by Geoff Norton (<gnorton@customerdna.com>).
25692
25693 Tue Jul 27 15:47:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
25694
25695         * class.c: fix class loads for pointer types (typeof(int) !=
25696         typeof(int*)).
25697
25698 2004-07-27  Martin Baulig  <martin@ximian.com>
25699
25700         * debug-mono-symfile.c (mono_debug_open_mono_symbol_file): Support
25701         reading the debugging information from an external ".mdb" file.
25702
25703 2004-07-24  Martin Baulig  <martin@ximian.com>
25704
25705         * reflection.c (mono_image_get_type_info): Only write a class
25706         layout entry if we actually have a size or a packing size.
25707
25708 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25709
25710         * reflection.c (type_get_fully_qualified_name): 
25711         insert cast to get type checking of ?: with non-gcc compilers
25712
25713 2004-07-21  Bernie Solomon  <bernard@ugsolutions.com>
25714
25715         * rand.c: use g_getenv for both lookups of
25716         MONO_EGD_SOCKET
25717
25718 2004-07-17  Martin Baulig  <martin@ximian.com>
25719
25720         * reflection.c (mono_reflection_bind_generic_method_parameters):
25721         Set `gmethod->reflection_info'.
25722
25723 2004-07-17  Martin Baulig  <martin@ximian.com>
25724
25725         * class.c (mono_class_create_from_typedef): Insert the newly
25726         created class into the hash table before computing the interfaces
25727         since we could be called recursively.
25728
25729 2004-07-16  Ben Maurer  <bmaurer@ximain.com>
25730
25731         * marshal.[ch] (mono_marshal_get_stelemref): a new wrapper
25732         function to implement stelem.ref in managed code
25733         * class-internals.h, debug-helpers.c: a new wrapper type
25734         for the above.
25735
25736 Wed Jul 14 19:26:05 CEST 2004 Paolo Molaro <lupus@ximian.com>
25737
25738         * gc.c: allow GC handles to work even when no GC is compiled in.
25739         Fix part of bug #61134 (GetAddrOfPinnedObject).
25740
25741 2004-07-13  Peter Williams  <peter@newton.cx>
25742  
25743         * process.c (complete_path): Make sure we don't attempt to execute
25744         directories.
25745  
25746 2004-07-12  Geoff Norton <gnorton@customerdna.com>
25747
25748         * DateTime.cs: Patch for bug #61112.  Our DateTime wasn't roundtripping over timezone
25749           boundaries properly.  This patch checkes ToLocalTime() to see if we're tripping over a boundary
25750           and will add/subtract the hour if needed
25751
25752 2004-07-12  Martin Baulig  <martin@ximian.com>
25753
25754         * reflection.c (mono_field_get_object): If we have
25755         `field->generic_info', take the attributes from
25756         `field->generic_info->generic_type'.    
25757
25758 2004-07-12  Martin Baulig  <martin@ximian.com>
25759
25760         * mono-debug.c (mono_debug_init): Don't take a `MonoDomain *'.
25761         This function must be called before initializing the runtime.
25762         (mono_debug_init_1): New function; call this after initializing
25763         the runtime, but before loading the assembly.  It tells the
25764         debugger to load corlib and the builtin types.
25765
25766         * mono-debug-debugger.c: Did some larger changes in the debugging
25767         code; support recursive class declarations, make sure we actually
25768         add all classes.
25769
25770 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25771
25772         * debug-helpers.c: undo my previous patch and fixed the real issue in
25773         ../mini/exceptions-x86.c
25774
25775 2004-07-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25776
25777         * debug-helpers.c: prevent SIGSEGV. It happened running xsp on monodoc
25778         when no HOME env. variable was set and a NullRef was thrown in a .cctor
25779         called from other .cctors.
25780
25781 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
25782
25783         * loader.c: Removed the mono_loader_wine_init hack now that we are
25784         doing a managed version of Windows.Forms.
25785
25786 2004-07-09  Ben Maurer  <bmaurer@ximian.com>
25787
25788         * domain.c, gc.c, marshal.c, mono-debug-debugger.c,
25789         threadpool.c, threads.c: remove static data from rootset.
25790
25791 2004-07-09  Dick Porter  <dick@ximian.com>
25792
25793         * locales.c (ves_icall_System_String_InternalReplace_Str_Comp):
25794         Don't do any more processing if the matched length was 0.  It was
25795         increasing the size of the string before.  Fixes bug 61167.
25796
25797 2004-07-09  Dick Porter  <dick@ximian.com>
25798
25799         * socket-io.h:
25800         * socket-io.c
25801         (ves_icall_System_Net_Sockets_Socket_GetSocketOption_obj_internal):
25802         Add support for SO_PEERCRED if its available.
25803
25804 2004-07-09  Peter Bartok <pbartok@novell.com>
25805         * loader.c: winelib.exe.so error message is now only displayed if
25806         MONO_DEBUG is set. To help us avoid questions when people are trying
25807         out the new Managed.Windows.Forms.
25808
25809 2004-07-08  Zoltan Varga  <vargaz@freemail.hu>
25810
25811         * class-internals.h debug-helpers.c marshal.c: Add new wrapper types 
25812         for isinst and castclass wrappers.
25813
25814         * class-internals.h icall.c: Move registration and lookup of JIT icalls
25815         to libmetadata from the JIT, so they could be used by the marshalling
25816         code and the interpreter.
25817
25818         * marshal.c: Register marshalling related JIT icalls here instead of
25819         in mini.c. Use CEE_MONO_ICALL instead of the family of 
25820         CEE_MONO_PROC<x> opcodes to call marshalling functions.
25821
25822         * metadata.h: Remove unneeded marshalling conversions.
25823
25824         * opcodes.c: Update for new opcodes.
25825         
25826 2004-07-08  Martin Baulig  <martin@ximian.com>
25827
25828         * mono-debug.c: Check for `handle->symfile' being non-NULL everywhere.
25829         (mono_debug_get_domain_data): Make this function static.
25830
25831 Wed Jul 7 12:32:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25832
25833         * gc.c, object.h: add nice GC handle API for embedders.
25834
25835 2004-07-06  Ben Maurer  <bmaurer@ximian.com>
25836
25837         * reflection.c: more changes for the new api
25838
25839         * object.c: When we reflect on a field w/ a constant value, it
25840         will not have a memory location, so we must access metadata. Also,
25841         allow easier reading of strings so that we can read them from
25842         the constant data.
25843
25844         * class.c (mono_class_layout_fields): no need for literal fields here.
25845
25846         * class-internals.h: api changes for const fields
25847
25848         * icall.c (ves_icall_get_enum_info): use new apis for const fields
25849
25850 2004-07-06  Martin Baulig  <martin@ximian.com>
25851
25852         * mono-debug.h: Increment version number to 44.
25853
25854         * mono-debug.c (mono_debug_add_wrapper): The second argument is
25855         now a gpointer, rewrote this whole method.
25856
25857         * mono-debug-debugger.c (mono_debugger_add_wrapper): New
25858         function.  Add information about the wrapper in a new "misc table".
25859
25860         * mono-debug-debugger.h (MonoDebuggerSymbolTable): Added fields
25861         for the new misc table.
25862
25863 2004-07-05  Zoltan Varga  <vargaz@freemail.hu>
25864
25865         * metadata-internals.h image.c: Add a cache for helper signatures.
25866
25867         * monosn.c: Applied patch from "grompf" (grompf@sublimeintervention.com). Fix compilation under OSX.
25868
25869 2004-07-03  Zoltan Varga  <vargaz@freemail.hu>
25870
25871         * marshal.c (mono_marshal_get_managed_wrapper): Handle returning
25872         delegates from a delegate. Fixes #61033.
25873         
25874         * marshal.c: Fix managed->native stringbuilder marshalling. Implement
25875         marshalling of stringbuilder arrays. Fixes #59900.
25876
25877 2004-07-02  Zoltan Varga  <vargaz@freemail.hu>
25878
25879         * icall.c: Add EnumBuilder:setup_enum_type icall.
25880
25881 2004-06-30  Ben Maurer  <bmaurer@ximian.com>
25882
25883         * icall.c: Added a new icall for the property version of
25884         OffsetOfStringData.
25885
25886 2004-06-30  Zoltan Varga  <vargaz@freemail.hu>
25887
25888         * class-internals.h (MonoVTable): Make max_interface_id a guint32 so
25889         it has a constant size across platforms.
25890
25891         * marshal.c (mono_delegate_end_invoke): Avoid crash when there is no
25892         stack trace.
25893
25894 2004-06-29  Martin Baulig  <martin@ximian.com>
25895
25896         * mono-debug.c (mono_debug_add_method): Protect the whole function
25897         in mono_debugger_lock(), not just parts of it.
25898
25899 Fri Jun 25 21:36:26 CEST 2004 Paolo Molaro <lupus@ximian.com>
25900
25901         * reflection.c: make sure padding bytes in heaps are zeroed.
25902
25903 2004-06-24  David Waite  <mass@akuma.org>
25904
25905         * appdomain.c, class.c, domain.c, file-io.c, gc.c, icall.c,
25906         image.c, loader.c, locales.c, marshal.c, metadata.c,
25907         mono-debug.[ch], object.c, reflection.c, security.c, socket-io.c,
25908         string-icalls.c, threads.c: change to C90-style comments from C99 /
25909         C++ -style
25910
25911 2004-06-24  Dick Porter  <dick@ximian.com>
25912
25913         * threads.c
25914         (ves_icall_System_Threading_Mutex_CreateMutex_internal): Correctly
25915         return createdNew.  Fixes bug 60412.
25916
25917         * threads-types.h: 
25918         * icall.c: Add createdNew parameter to CreateMutex icall
25919
25920 Thu Jun 24 16:06:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
25921
25922         * reflection.c, object-internals.h: save default value in params.
25923
25924 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25925
25926         * appdomain.c: for paths in PrivateBinPath that are absolute, there's
25927         no need to build a new path combining that with the application base.
25928         Fixes bug #60442.
25929
25930 Wed Jun 23 18:36:58 CEST 2004 Paolo Molaro <lupus@ximian.com>
25931
25932         * reflection.c: fixed minor standard compliance issues.
25933
25934 Wed Jun 23 17:59:29 CEST 2004 Paolo Molaro <lupus@ximian.com>
25935
25936         * reflection.c: fixed issue with encoding some custom attributes
25937         (arrays in properties and fields, bug #60411).
25938
25939 2004-06-23 Gonzalo Paniagua Javier <gonzalo@ximian.com>
25940
25941         * reflection.c: fix start address when copying the public key token.
25942
25943 2004-06-23  Martin Baulig  <martin@ximian.com>
25944
25945         * mono-debug-debugger.c (mono_debugger_unhandled_exception): Store
25946         the `exc' object in a static object to put it into the GC's root set.
25947
25948 Wed Jun 23 15:37:31 CEST 2004 Paolo Molaro <lupus@ximian.com>
25949
25950         * reflection.c: make mono_reflection_setup_internal_class ()
25951         callable a second time to setup a new parent class.
25952
25953 2004-06-23  Dick Porter  <dick@ximian.com>
25954
25955         * threads.c: Check for WAIT_IO_COMPLETION return values.
25956
25957 2004-06-22  Sebastien Pouliot  <sebastien@ximian.com>
25958
25959         * appdomain.c: Removed the g_free on the public key token. Now copy 
25960         the pk token string into the MonoAssemblyName buffer using g_strlcpy.
25961         * assembly.c: Added public key token string value when loading 
25962         assemblies. Fix bug #60439.
25963         * icall.c: Added missing informations (like public key) in 
25964         GetReferencedAssemblies. Fix #60519.
25965         * image.h: Changed definition for public key token from const char*
25966         public_tok_value to guchar public_key_token [17];
25967         * reflection.c: Updated for changes to public key token.
25968
25969 2004-06-22  Lluis Sanchez Gual
25970
25971         * icall.c: In ves_icall_InternalExecute, when setting a filed, also look 
25972         for the field in base classes.
25973
25974 Tue Jun 22 16:48:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
25975
25976         * mono-debug.h, mono-debug-debugger.h, debug-mono-symfile.h:
25977         mark headers as not supported, they are installed only for use by the
25978         debugger.
25979
25980 Tue Jun 22 16:32:03 CEST 2004 Paolo Molaro <lupus@ximian.com>
25981
25982         * *.c, *.h: avoid namespace pollution in public headers.
25983
25984 2004-06-21  Martin Baulig  <martin@ximian.com>
25985
25986         * exception.c (mono_get_exception_security): It's in
25987         "System.Security", not in "System".
25988
25989         * mono-debug-debugger.c (mono_debugger_add_builtin_types): Add all
25990         the exception classes.
25991
25992 2004-06-21  Martin Baulig  <martin@ximian.com>
25993
25994         * mono-debug-debugger.c (mono_debugger_unhandled_exception):
25995         Protect the exception object from being finalized.
25996
25997 2004-06-21  Martin Baulig  <martin@ximian.com>
25998
25999         * mono-debug-debugger.h (mono_debugger_unhandled_exception): New
26000         public function.
26001
26002 2004-06-21  Sebastien Pouliot  <sebastien@ximian.com>
26003
26004         * reflection.c: Load the assembly in mono_reflection_type_from_name,
26005         if it was not loaded before. Fix parts of #60439.
26006
26007 Mon Jun 21 16:04:43 CEST 2004 Paolo Molaro <lupus@ximian.com>
26008
26009         * marshal.c, icall.c, object.c, image.c: fix the runtime_invoke ()
26010         code that was broken since Ben's change: wrappers are now
26011         dependent on the method signature only again.
26012
26013 2004-06-21  Martin Baulig  <martin@ximian.com>
26014
26015         * mono-debug-debugger.c (write_class): Cleaned this up a bit and
26016         added interface support.
26017
26018 2004-06-21  Martin Baulig  <martin@ximian.com>
26019
26020         * class.c (mono_vtable_get_static_field_data): New public method.
26021
26022 2004-06-20  Atsushi Enomoto  <atsushi@ximian.com>
26023
26024         * filewatcher.c : Windows build fix to be compliant with API changes.
26025
26026 Sat Jun 19 19:04:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
26027
26028         * class.h, class.c: more accessors.
26029         * metadata.h, metadata.c: prepare for hiding MonoType and
26030         MonoMethodSignature: people should use the accessors from now on
26031         outside of the tree.
26032
26033 Sat Jun 19 17:56:50 CEST 2004 Paolo Molaro <lupus@ximian.com>
26034
26035         * *.c, *.h: more API cleanups.
26036
26037 2004-06-18  Jackson Harper  <jackson@ximian.com>
26038
26039         * assembly.c: Trace loading assemblies.
26040         * loader.c: Trace loading native libraries.
26041         * mono-config.c: Trace loading config files.
26042         
26043 2004-06-18  Dick Porter  <dick@ximian.com>
26044
26045         * locales.c: Tell ICU the lengths of strings, it can cope with
26046         embedded \0 then.  Fixes bug 59274, and doesn't break bug 55822.
26047
26048 Fri Jun 18 11:59:57 CEST 2004 Paolo Molaro <lupus@ximian.com>
26049
26050         * image.c: swapped name/filename;
26051
26052 2004-06-18  Martin Baulig  <martin@ximian.com>
26053
26054         * mono-debug-debugger.c (write_class): Write the parent class at
26055         the end of the header.
26056
26057 Thu Jun 17 16:50:44 CEST 2004 Paolo Molaro <lupus@ximian.com>
26058
26059         * *.c, *.h, Makefile.am: more API cleanups and bugfixes.
26060
26061 2004-06-17  Raja R Harinath  <rharinath@novell.com>
26062
26063         * Makefile.am (PLATFORM_LIB): New.  Possibly refer to ../os/libmonoos.la.
26064         (bundle_obj): New conditional define.
26065         (BUILT_SOURCES): Remove.
26066         ($(bundle_srcs)): Make parallel-make safe.
26067         (libmonoruntime_la_LIBADD): Make unconditional.
26068         (libmetadata_la_LIBADD): Make unconditional.  Refer to $(bundle_obj).
26069         (libmetadata_la_SOURCES): Don't refer to $(bundle_srcs).
26070
26071 2004-06-17  Atsushi Enomoto  <atsushi@ximian.com>
26072
26073         * culture-info-tables.h: It was inconsistent with the latest
26074           supp info files.
26075
26076 2004-06-17  Zoltan Varga  <vargaz@freemail.hu>
26077
26078         * assembly.c (mono_assembly_open): Fix crash when the assembly can't
26079         be loaded.
26080
26081         * threads.c (ves_icall_System_Threading_Thread_Resume): Fix compilation
26082         with gcc 2.95.
26083
26084 Wed Jun 16 18:23:45 CEST 2004 Paolo Molaro <lupus@ximian.com>
26085
26086         * threads.h, icall.c, object.c, threadpool.c, threads-types.h:
26087         cleaned up public header threads.h.
26088
26089 Wed Jun 16 18:11:41 CEST 2004 Paolo Molaro <lupus@ximian.com>
26090
26091         * Makefile.am, *.c, *.h: more API cleanups.
26092
26093 Wed Jun 16 14:33:22 CEST 2004 Paolo Molaro <lupus@ximian.com>
26094
26095         * Makefile.am: removed monosn from compilation.
26096         * appdomain.c, assembly.c, assembly.h, blob.h, class.c,
26097         debug-helpers.c, debug-mono-symfile.c, domain.c, icall.c,
26098         image.c, image.h, loader.c, marshal.c, metadata-internals.h,
26099         metadata.c, metadata.h, mono-config.c, mono-debug-debugger.c,
26100         mono-debug.c, object.c, opcodes.c, opcodes.h, pedump.c, process.c,
26101         reflection.c, reflection.h, verify.c: more API cleanups and fixes.
26102
26103 2004-06-15  Jackson Harper  <jackson@ximian.com>
26104
26105         * assembly.c: Make locales lower case when searching the GAC for
26106         assemblies. gacutil will always make locales lowercase when
26107         installing so this effectively makes them case insensitive.
26108         
26109 2004-06-15  Lluis Sanchez Gual  <lluis@ximian.com>
26110
26111         * locales.c, threadpool.c: use mono_monitor_enter instead of mono_monitor_try_enter.
26112         * monitor.c: New method mono_monitor_try_enter_internal, which takes a new
26113           parameter which allows to choose whether the wait can be interrupted or 
26114           not. Also added the method mono_monitor_enter(), which locks the monitor
26115           using an infinite wait and without allowing interruption.
26116           In the Monitor.Enter and Wait icalls, retry the lock if the wait is
26117           interrupted.
26118         * object.h: Added new fields in MonoThread. suspend_event holds the event
26119           used to susped/resume the thread. synch_lock is the lock object to use for
26120           modifying the thread state.
26121         * threads.c: Use the new synch_lock object for locking, instead of "this",
26122           which can generate deadlocks.
26123           Moved thread state change in Thread.Sleep and Thread.Join from managed
26124           to unmanaged code. This avoids a deadlock when the thread was suspended
26125           just after acquiring the thread lock.
26126           In general, use mono_monitor_enter instead of mono_monitor_try_enter.
26127           Implemented Thread.Suspend using an event instead of ThreadSuspend,
26128           which is not fully implemented in the io-layer.
26129         * socket-io.c: Only try IPv6 DNS lookup if IPv4 fails.
26130
26131 Tue Jun 15 18:34:21 CEST 2004 Paolo Molaro <lupus@ximian.com>
26132
26133         * Makefile.am, monitor.h, object.h, threadpool.c, threadpool.h,
26134         threads-types.h: more API cleanups.
26135
26136 Tue Jun 15 16:40:19 CEST 2004 Paolo Molaro <lupus@ximian.com>
26137
26138         * domain-internals.h, Makefile.am, appdomain.c, appdomain.h,
26139         domain.c, gc.c, icall.c, mono-debug.c, object.c, reflection.c,
26140         threadpool.c, threads.c: first pass at the exported API cleanup.
26141
26142 Tue Jun 15 15:29:47 CEST 2004 Paolo Molaro <lupus@ximian.com>
26143
26144         * icall.c: fix signatures of some VolatileRead and VolatileWrite icalls.
26145
26146 2004-06-15 Gonzalo Paniagua Javier <gonzalo@ximian.com>
26147
26148         * icall.c: added internalGetHome.
26149
26150 2004-06-14  Dick Porter  <dick@ximian.com>
26151
26152         * file-io.c (ves_icall_System_IO_MonoIO_FindFirstFile): It was
26153         possible to return successfully when '.' or '..' were the only
26154         entries in a directory, but were skipped.  The MonoIOStat was not
26155         filled in in that case.  Now return ERROR_NO_MORE_FILES instead.
26156         Fixes bug 59574.
26157
26158 Mon Jun 14 00:27:15 CEST 2004 Paolo Molaro <lupus@ximian.com>
26159
26160         * reflection.c: make binaries run on .Net 1.1 by default.
26161
26162 Sun Jun 13 18:22:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
26163
26164         * threadpool.c, threadpool.h: use the correct return type in SetMinThreads ().
26165
26166 Sun Jun 13 16:44:39 CEST 2004 Paolo Molaro <lupus@ximian.com>
26167
26168         * marshal.c: keep track of struct size with explicit layout
26169         (bug #59979).
26170
26171 2004-06-12  Martin Baulig  <martin@ximian.com>
26172
26173         * mono-debug-debugger.c: Comment out a debugging g_message().
26174
26175 Sat Jun 12 14:15:02 CEST 2004 Paolo Molaro <lupus@ximian.com>
26176
26177         * reflection.c, reflection.h: do not free custom attrs that are cached.
26178         * icall.c: use braces to make code clearer.
26179
26180 2004-06-11  Martin Baulig  <martin@ximian.com>
26181
26182         * class.h (MonoInflatedField): New type.
26183         (MonoClassField): Replaced `MonoType *generic_type' with
26184         `MonoInflatedField *generic_info'.
26185
26186         * icall.c
26187         (ves_icall_MonoField_Mono_GetGenericFieldDefinition): New icall.
26188
26189 2004-06-11  Martin Baulig  <martin@ximian.com>
26190
26191         * reflection.c (mono_image_create_method_token): Correctly encode
26192         varargs methods.
26193
26194 2004-06-11  Martin Baulig  <martin@ximian.com>
26195
26196         * metadata.c (mono_metadata_parse_method_signature): When parsing
26197         a MethodDef which has VarArgs, also set sentinelpos if we don't
26198         have any parameters.
26199
26200 2004-06-11  Martin Baulig  <martin@ximian.com>
26201
26202         * verify.c (mono_method_verify): In CEE_CALL, use
26203         mono_method_get_signature() to get the method's signature, unless
26204         we're a PInvoke method.
26205
26206 2004-06-10  Jackson Harper  <jackson@ximian.com>
26207
26208         * assembly.c: Use <path>/lib/mono/gac for the extra paths
26209         lookup. Rename MONO_GAC_PATH to MONO_GAC_PREFIX, this is a more
26210         logical name as the supplied path is just a prefix to the gac not
26211         the direct path to it.
26212         
26213 Thu Jun 10 20:10:16 CEST 2004 Paolo Molaro <lupus@ximian.com>
26214
26215         * reflection.c: make the token for a created method match
26216         the token of the MethodBuilder it was created from
26217         (IKVM requires this behaviour now).
26218
26219 Thu Jun 10 16:02:27 CEST 2004 Paolo Molaro <lupus@ximian.com>
26220
26221         * image.c, image.h, appdomain.c, assembly.c, loader.c, metadata.c,
26222         reflection.c, socket-io.c: leak fixes.
26223
26224 Wed Jun 9 18:23:59 CEST 2004 Paolo Molaro <lupus@ximian.com>
26225
26226         * icall.c: handle sentinel pos in vararg methods in position different
26227         from 0.
26228
26229 2004-06-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26230
26231         * culture-info-tables.h: freshly generated.
26232
26233 2004-06-09  Martin Baulig  <martin@ximian.com>
26234
26235         * loader.c (mono_get_method_constrained): Call `mono_class_init
26236         (constrained_class)'.   
26237
26238 2004-06-08  Gert Driesen <drieseng@users.sourceforge.net>
26239
26240         * icall.c (ves_icall_MonoType_GetEvent): Handle events without
26241         any methods. Fixes #59629.
26242
26243 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26244
26245         * culture-info-tables.h: reflecting locale-builder updates.
26246
26247 2004-06-08  Dick Porter  <dick@ximian.com>
26248
26249         * object.h:
26250         * locales.c: Fixed compile warnings, including a real bug in
26251         CompareInfo_internal_compare.
26252         
26253 2004-06-08  Dick Porter  <dick@ximian.com>
26254
26255         * locales.c
26256         (ves_icall_System_Globalization_CompareInfo_internal_index):
26257         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26258         Double-check the resuls of usearches, because ICU currently
26259         ignores most of the collator settings here.  Fixes bug 59720.
26260         
26261 2004-06-08  Dick Porter  <dick@ximian.com>
26262
26263         * locales.c
26264         (ves_icall_System_Globalization_CompareInfo_internal_index_char):
26265         Fix memory leak and segfault-causing typo.  No idea how this one
26266         lasted so long without being noticed.
26267
26268 2004-06-09  Zoltan Varga  <vargaz@freemail.hu>
26269
26270         * icall.c (ves_icall_Type_GetEvents_internal): Handle events without
26271         any methods. Fixes #59629.
26272
26273 2004-06-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26274
26275         * assembly.c:
26276         (mono_assembly_load): search_loaded -> mono_assembly_loaded (we didn't
26277         own the critical section before). Removed dead code (that's done
26278         in the preload hook).
26279
26280         (mono_assembly_load_with_partial_name): call the preload hook.
26281
26282 2004-06-08  Martin Baulig  <martin@ximian.com>
26283
26284         * metadata.c (mono_metadata_signature_alloc): Default
26285         `sentinelpos' to -1.
26286
26287         * reflection.c (mono_image_get_array_token): Likewise.
26288
26289 2004-06-08  Martin Baulig  <martin@ximian.com>
26290
26291         * icall.c (ves_icall_ModuleBuilder_getMethodToken): New icall.
26292
26293         * metadata.c (mono_metadata_parse_method_signature): When parsing
26294         a MethodDef which has VarArgs, set sentinelpos.
26295
26296         * metadata.h (MonoMethodSignature): Make `sentinalpos' a signed
26297         `gint16' since we're using -1 for non-varargs methods.
26298
26299         * reflection.c
26300         (ReflectionMethodBuilder): Added `MonoArray *opt_types'.
26301         (method_encode_signature): Added varargs support.
26302         (method_builder_encode_signature): Likewise.
26303         (mono_image_get_varargs_method_token): New static method.
26304         (mono_image_create_method_token): New public method; this is
26305         called via an icall instead of mono_image_create_token() when
26306         calling a varargs method.       
26307
26308 2004-06-08  Lluis Sanchez Gual  <lluis@ximian.com>
26309
26310         * locales.c: Fixed memory leak in Char.ToLower/ToUpper.
26311
26312 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26313
26314         * culture-info-tables.h : Reflecting the latest locale-builder that
26315           fixed empty array representation ({} to {0}).
26316
26317 2004-06-07  Jackson Harper  <jackson@ximian.com>
26318
26319         * assembly.c: It should be <MONO_GAC_PATH>/lib/mono/gac when
26320         looking up extra gac paths. This allows MONO_GAC_PATH to act
26321         exactly like a prefix.
26322         
26323 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26324
26325         * reflection.c (mono_reflection_type_from_name): Make a copy of the
26326         type name before modifying it. Fixes #59405.
26327
26328 2004-06-08  Atsushi Enomoto  <atsushi@ximian.com>
26329
26330         * culture-info.h: added fields for "all datetime patterns".
26331         * locales.c: (  ves_icall_System_Globalization_CultureInfo
26332           _construct_datetime_format ()): fill xxx_patterns fields.
26333         * object.h: added fields for "all datetime patterns" to
26334           MonoDateTimeFormatInfo.
26335         * culture-info-tables.h: reflecting locale-builder updates.
26336
26337 2004-06-08  Zoltan Varga  <vargaz@freemail.hu>
26338
26339         * icall.c (ves_icall_Type_GetEvents_internal): Handle the case when
26340         the event has no add and remove methods. Fixes #59629.
26341
26342 2004-06-05  Sebastien Pouliot  <sebastien@ximian.com>
26343
26344         * object.c: Fixed possible integer overflow when allocating large
26345         strings.
26346
26347 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26348
26349         * culture-info-tables.h: reflecting locale-builder updates.
26350
26351 2004-06-05  Atsushi Enomoto  <atsushi@ximian.com>
26352
26353         * culture-info-tables.h: reflecting locale-builder updates.
26354
26355 2004-06-03  Atsushi Enomoto  <atsushi@ximian.com>
26356
26357         * culture-info-tables.h: reflecting locale-builder updates.
26358
26359 2004-06-03  Lluis Sanchez Gual  <lluis@ximian.com>
26360
26361         * threads.c: Made Thread.Sleep abortable.
26362
26363 2004-06-02  Martin Baulig  <martin@ximian.com>
26364
26365         * mono-debug.h (MONO_DEBUGGER_VERSION): Bumped version to 41.
26366
26367         * debug-mono-symfile.h: Bumped symbol file version number to 37.
26368
26369 2004-05-31  Zoltan Varga  <vargaz@freemail.hu>
26370
26371         * marshal.c (mono_marshal_get_runtime_invoke): Fix CR/LFs.
26372
26373 2004-05-30  Jackson Harper  <jackson@ximian.com>
26374
26375         * reflection.c: Do not hardcode assembly versions or public key
26376         tokens anymore. All of this except the corlib section was dead
26377         code anyways.
26378         
26379 2004-05-29  Zoltan Varga  <vargaz@freemail.hu>
26380
26381         * object.c (mono_runtime_invoke_array): Automatically create boxed
26382         objects for byref valuetypes if needed. Fixes #59300.
26383         
26384         * object.c (mono_method_return_message_restore): Handle 
26385         MONO_TYPE_OBJECT as well.
26386
26387 2004-05-28  Jackson Harper  <jackson@ximian.com>
26388
26389         * reflection.c: The modified type encoding was causing build
26390         problems. Reverted for now.
26391         
26392 2004-05-28  Jackson Harper  <jackson@ximian.com>
26393
26394         * reflection.c/h: Take an assembly ref so that we dont create
26395         fully qualified names when encoding types in the same assembly as
26396         the custom attribute being emitted.
26397         * appdomain.c: Increment version number.
26398         
26399 2004-05-26  Duncan Mak  <duncan@ximian.com>
26400
26401         * icall.c
26402         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
26403         Set the full version number (major, minor, build, revision).
26404
26405 2004-05-28  Vladimir Vukicevic  <vladimir@pobox.com>
26406
26407         * marshal.c (emit_struct_conv): increment src/dst after blit
26408         (mono_marshal_get_managed_wrapper,
26409         mono_marshal_get_native_wrapper): make sure we have marshalling
26410         info before marshalling params (info computation affects
26411         blittable)
26412
26413         * class.c (class_compute_field_layout): correctly deal with
26414         blittable
26415         (mono_class_layout_fields): Don't do gc_aware_layout for AUTO
26416         value types (as per what windows dows by default)
26417         (mono_class_setup_mono_type): System.ValueType is blittable
26418         (mono_ptr_class_get, mono_fnptr_class_get): Pointer classes are
26419         blittable
26420
26421         * marshal.c (mono_marshal_load_type_info): flag types  as
26422         non-blittable if the native layout doesn't match the managed
26423         layout
26424
26425 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26426
26427         * appdomain.c: don't add stuff in the private search path that is
26428         above the application base. If application base is not set, there's
26429         no private search path.
26430
26431 2004-05-28  Zoltan Varga  <vargaz@freemail.hu>
26432
26433         * marshal.c (mono_marshal_get_managed_wrapper): Add proper support for
26434         byref struct arguments in native->managed marshalling.
26435
26436 2004-05-28      Patrik Torstensson      <totte@hiddenpeaks.com>
26437
26438         * marshal.c (mono_marshal_get_runtime_invoke): correctly
26439         cache methods using signature (special case for methods
26440         that are value type or string class)
26441         
26442         * image.c (mono_image_close): clean up allocated GSList's
26443         in runtime_invoke_cache.
26444
26445 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26446
26447         * mono-config.c: set the correct path for mono_cfg_dir on windows when
26448         there's no MONO_CFG_DIR environment variable defined.
26449
26450 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26451
26452         * threads.c: windows version must be >= 0x0500 to include OpenThread.
26453
26454 2004-05-28  Lluis Sanchez Gual  <lluis@ximian.com>
26455
26456         * threadpool.c: Really wait for 500ms after the async call, even if the wait
26457           is interrumped.
26458         * threads.c: In mono_thread_manage, call OpenThread to ref each handle
26459           before waiting for it, and call CloseHandle after the wait to unref it.
26460           This will make sure that handles are not disposed too early.
26461
26462 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26463
26464         * appdomain.c:
26465         * appdomain.h:
26466         * icall.c: removed
26467         ves_icall_System_AppDomainSetup_InitAppDomainSetup as it's not
26468         needed now.
26469
26470         * object.c: se the application_base only for the domain that runs
26471         Main. Fixes bug #59216,
26472
26473 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26474
26475         * appdomain.c:
26476         * object.c: only the domain in which Main is run have
26477         SetupInformation.ConfigurationFile set, so moved a few lines from
26478         appdomain.c to object.c.
26479
26480 2004-05-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26481
26482         * appdomain.c: we tried to load [name].(dll|exe), but according
26483         to bug #57710, we must also try [culture]/[name].(dll|exe) and
26484         [culture]/[name]/[name](dll|exe). This patch fixes the bug.
26485         There's a test case attached to bug #58922.
26486
26487 2004-05-27  Dick Porter  <dick@ximian.com>
26488
26489         * icall.c:
26490         * file-io.c: Implemented icalls for locking and unlocking regions
26491         in a file.
26492         (ves_icall_System_IO_MonoIO_FindNextFile): FindNextFile() returns
26493         FALSE on error (fixes both compiler warning and real bug.)
26494
26495 2004-05-27  Atsushi Enomoto  <atsushi@ximian.com>
26496
26497         * culture-info-tables.h: reflecting locale-builder updates.
26498
26499           (Added missing ChangeLog entry for 05/26)
26500
26501 2004-05-27  Jackson Harper  <jackson@ximian.com>
26502
26503         * locales.c: Fix some cut and paste errors.
26504         
26505 2004-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26506
26507         * mono-config.c: set the correct path for config. directory on windows.
26508
26509 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26510
26511         * icall.c : Fixed ves_icall_System_DateTime_GetNow() to return utc
26512           on win32.
26513
26514 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26515
26516         * marshal.c (mono_marshal_get_native_wrapper): Free strings returned
26517         from pinvoke functions.
26518         
26519         * marshal.c (mono_ftnptr_to_delegate): Implement this.
26520
26521 2004-05-26  Atsushi Enomoto  <atsushi@ximian.com>
26522
26523         * culture-info-tables.h: reflecting locale-builder updates.
26524
26525 2004-05-26  Zoltan Varga  <vargaz@freemail.hu>
26526
26527         * profiler.c (simple_allocation): Skip icall wrapper methods. Fixes
26528         #59086.
26529
26530 2004-05-26  Sebastien Pouliot  <sebastien@ximian.com>
26531
26532         * appdomain.cs: Bumped MONO_CORLIB_VERSION to 20.
26533         * icall.c: Modified icalls for RNG.
26534         * rand.c|h: Changed RNG interface to allow thread-safe usage under 
26535         Windows (CryptoAPI).
26536
26537 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26538
26539         * locales.c: Fix build.
26540
26541 2004-05-25  Atsushi Enomoto  <atsushi@ximian.com>
26542
26543         * culture-info-tables.h: reflecting locale-builder updates.
26544
26545 2004-05-25  Jackson Harper  <jackson@ximian.com>
26546
26547         * locales.c: When creating the current culture use the $LANGs
26548         specific culture. So DateTimeFormat and NumberFormat entries are created.
26549         
26550 2004-05-25  Zoltan Varga  <vargaz@freemail.hu>
26551
26552         * string-icalls.{h,c} icalls.c: Add new icalls for Strcpy which take
26553         a char array as parameter.
26554
26555 2004-05-24  Lluis Sanchez Gual  <lluis@ximian.com>
26556
26557         * image.c: In mono_image_open(), always use an absolute path name to
26558           look for already loaded images.
26559
26560 2004-05-24  Sebastien Pouliot  <sebastien@ximian.com>
26561
26562         * icall.c: Added define for CSIDL_FLAG_CREATE (0x8000) in case it is
26563         missing in the windows build (like older cygwin include files).
26564
26565 2004-05-23  Sebastien Pouliot  <sebastien@ximian.com>
26566
26567         * icall.c: Fixed check for possible integer overflow in Buffer_
26568         BlockCopy icall. Replaced comments style // by /* */.
26569
26570 2004-05-22  Zoltan Varga  <vargaz@freemail.hu>
26571
26572         * marshal.c (mono_ftnptr_to_delegate): Fix warning.
26573         
26574         * marshal.c (mono_marshal_get_proxy_cancast): Move thread interrupt
26575         check after MONO_VTADDR. Fixes pinvoke2.exe.
26576
26577         * marshal.h marshal.c metadata.h: Add beginnings of support for
26578         ftnptr -> delegate marshalling.
26579
26580 2004-05-21  Zoltan Varga  <vargaz@freemail.hu>
26581
26582         * threads.c (ves_icall_System_Threading_Thread_ResetAbort): Fix compilation on gcc-2.95.
26583         * threads.c: Fix warnings.
26584
26585 2004-05-20  Lluis Sanchez Gual  <lluis@ximian.com>
26586
26587         * appdomain.c, gc.c: Make use of the new WaitForSingleObjectEx.
26588         * icall.c: Registered icalls for Suspend and Resume.
26589         * locales.c: Beware, mono_monitor_try_enter can now be interrupted by
26590           Thread.Abort.
26591         * monitor.c: Use WaitForSingleObjectEx. Added some interruption checkpoints.
26592         * mono-debug-debugger.c: Use WaitForSingleObjectEx et al.
26593         * process.c: Use WaitForSingleObjectEx.
26594         * threadpool.c: Use WaitForSingleObjectEx. Added some interruption 
26595           checkpoints.
26596         * threads.c, threads.h: Make use of new Ex wait methods. Improved
26597           implementation of Thread.Abort and Thread.ResetAbort icalls. Added icalls
26598           for Suspend and Resume. Added new mono_thread_stop, used for stoping
26599           background threads. Added basic support for Abort in Windows.
26600           Start new threads using a managed delegate invoke wrapper. This wrapper
26601           has an interruption checkpoint that is needed since an interruption
26602           can be requested before the thread leaves the unmanaged code that starts 
26603           the thread.
26604         * marshal.c: Added interruption checkpoint after every native call, and
26605           also before managed calls for wrappers called from unmanaged code to
26606           go into managed code.
26607         * object.h: Added new field in MonoThread to keep track of interruption
26608           requests.
26609
26610 2004-05-20  Zoltan Varga  <vargaz@freemail.hu>
26611
26612         * marshal.c: Insert SAVE_LMF and RESTORE_LMF opcodes around native
26613         calls.
26614
26615 2004-05-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26616
26617         * appdomain.c:
26618         * assembly.c:
26619         * gc.c:
26620         * locales.c:
26621         * mono-config.c:
26622         * rand.c: getenv -> g_getenv (windows!)
26623
26624         * process.c: complete_path is also used on non-windows platforms.
26625
26626 2004-05-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26627
26628         * icall.c: new signature for Process_Start.
26629
26630         * process.[ch]: new signature for Process_Start. If we're on windows
26631         and UseShellExecute is false, we have to search for the program by
26632         ourselves if we don't get a full path.
26633
26634 2004-05-18  Zoltan Varga  <vargaz@freemail.hu>
26635
26636         * marshal.c (mono_marshal_get_native_wrapper): Fix up custom 
26637         marshalling and call CleanUpNativeData if needed. Fixes #58646.
26638
26639 2004-05-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26640
26641         * socket-io.c: field value changed for Int32 from 'value' to 'm_value'.
26642         Fixes bug #58373.
26643
26644 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26645
26646         * process.c: use double quotes to quote program name and arguments on
26647         windows. Fixes bug #58575.
26648
26649 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26650
26651         * file-io.c: don't return "." and ".." when using windows Find*File.
26652
26653 2003-05-17      Patrik Torstensson <totte@hiddenpeaks.com>
26654
26655         * marshal.c: Don't pass wrappers to message init because method 
26656         addressed used to lookup metadata. part of remoting[2|3] fix.
26657
26658 2004-05-15  Jackson Harper  <jackson@ximian.com>
26659
26660         * assembly.c: Remove user gac and implement MONO_GAC_PATH, this
26661         path is essentially the same as MONO_PATH except that it points to
26662         GACs instead of lib directories.
26663         * loader.h: The user gac is gone so we dont need function to
26664         enable/disable it.
26665         * mono-config.c: user gac option is now gone.
26666         
26667 2004-05-15  Jackson Harper  <jackson@ximian.com>
26668
26669         * culture-info.h: Make defines more consistent, add calendar data
26670         to the culture info table.
26671         * culture-info-tables.h: Add basic calendar data. Basically
26672         everyone gets default gregorian until all the data is
26673         updated.
26674         * locales.c: Use the new consistent defines. Set calendar data for
26675         culture info objects.
26676         * object.h: add a field for calendar data to CultureInfo
26677         
26678 2004-05-14 Ben Maurer  <bmaurer@users.sourceforge.net>
26679
26680         * image.c: image->runtime_invoke_cache is keyed on signatures now.
26681         * marshal.c (mono_mb_emit_calli): new helper to emit a CEE_CALLI with
26682         a signature.
26683         (mono_mb_emit_managed_call, mono_mb_emit_native_call): use the above.
26684         (mono_marshal_get_runtime_invoke): The runtime invoke method now takes
26685         an extra param that is the pointer of the method to invoke. The IL for
26686         the invoke method is no longer specific to the method, but to the
26687         signature of the method. Thus, we can share the same code for multiple
26688         methods. This reduces the number of methods that have to be compiled.
26689
26690 2004-05-14  Zoltan Varga  <vargaz@freemail.hu>
26691
26692         * icall.c (ves_icall_System_Reflection_Assembly_load_with_partial_name): Fix warning.
26693
26694         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
26695
26696         * icall.c: Optimize Buffer.BlockCopy.
26697
26698 2004-05-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26699
26700         * culture-info-tables.h: seems like Spanish and Portuguese cultures had
26701         DateTimeFormatInfo.YearMonthPattern like "MMMM' yyyy" (note the single
26702         quote). Changed them to "MMMM yyyy".
26703
26704 2004-05-12  Miguel de Icaza  <miguel@ximian.com>
26705
26706         * rand.c
26707         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_InternalGetBytes): Always close the file. 
26708
26709 2004-05-13  Zoltan Varga  <vargaz@freemail.hu>
26710
26711         * reflection.h: Updated after changes to managed structures.
26712
26713         * appdomain.c: Bump corlib version.
26714
26715 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26716
26717         * Makefile.am: also add libmonoos to libmetadata. Fixes the build on
26718         windows.
26719
26720 2004-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26721
26722         * Makefile.am: link to ../os/libmonoos.la on windows.
26723
26724         * assembly.c:
26725                 -If MONO_DEBUG, warn about non-existing directories in
26726                 MONO_PATH.
26727                 -Added mono_assembly_getrootdir() that replaces MONO_ASSEMBLIES
26728                 compile time variable.
26729                 -Removed init_default_path and call mono_set_rootdir from
26730                 libmonoos.a instead (windows only).
26731
26732         * assembly.h: declare mono_assembly_getrootdir().
26733
26734         * domain.c:
26735         * icall.c: use mono_assembly_getrootdir() instead of MONO_ASSEMBLIES.
26736
26737         * loader.c: s/getenv/g_getenv/
26738
26739 2004-05-11  Zoltan Varga  <vargaz@freemail.hu>
26740
26741         * marshal.{h,c}: Add support for UnmanagedType.AsAny.
26742
26743         * marshal.c: Use mono_metadata_signature_{alloc,dup} where appropriate.
26744
26745         * metadata.h: Add new marshalling conversions.
26746
26747         * metadata.h metadata.c (mono_metadata_signature_dup): New helper
26748         function.
26749
26750         * reflection.c (mono_reflection_get_type): Lookup the type in all
26751         modules of a multi-module assembly. Fixes #58291.
26752
26753 2004-05-11  Lluis Sanchez Gual  <lluis@ximian.com>
26754
26755         * threads.c: Before aborting a background, set the StopRequested
26756         state.  This avoids throwing the Abort exception.
26757         In mono_thread_manage, don't continue with the shutdown until all
26758         aborted threads have actually stopped.
26759
26760 2004-05-10  Jackson Harper  <jackson@ximian.com>
26761
26762         * locales.c: Remove the modifier from culture names.
26763         
26764 2004-05-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26765
26766         * Makefile.am: monosn is not installed any more. It has been deprecated
26767         in favor of sn.
26768
26769 2004-05-07  Jackson Harper  <jackson@ximian.com>
26770
26771         * locales.c
26772         (ves_icall_System_Globalization_CultureInfo_internal_get_cultures):
26773         Fix array construction, add bailout if the length is 0.
26774
26775 2004-05-07  Dick Porter  <dick@ximian.com>
26776
26777         * socket-io.c (addrinfo_to_IPHostEntry): Don't crash if the
26778         machine doesn't have a DNS entry.  Patch by Urs Muff
26779         (umuff@quark.com), fixes bug 57928.
26780
26781 2004-05-06  Jackson Harper  <jackson@ximian.com>
26782
26783         * reflection.c: Handle null PublicTokens properly. alloc mem for
26784         assembly names culture so we dont crash when freeing it.
26785         
26786 2004-05-06  Jackson Harper  <jackson@ximian.com>
26787
26788         * assembly.c: Check the usergac when loading with partial names.
26789         
26790 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26791
26792         * rand.c|h: Added new icall for (optionally) seeding the PRNG. This 
26793         does nothing for now (not required for Linux/Windows) but the class
26794         library can call it (and a newer or modified runtime could need it).
26795         * icall.c: Registred icall.
26796
26797 2004-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26798
26799         * loader.c: prints a message on module loading error we set MONO_DEBUG
26800         environment variable.
26801
26802 2004-05-05  Jackson Harper  <jackson@ximian.com>
26803
26804         * appdomain.c: Handle PublicKeyToken=null properly.
26805         
26806 2004-05-05  Sebastien Pouliot  <sebastien@ximian.com>
26807
26808         * environment.c|h: Added icall ves_icall_System_Environment_
26809         GetOSVersionString to get the current OS version as a string.
26810         * icall.c: Registred icall.
26811
26812 2004-05-05  Lluis Sanchez Gual  <lluis@ximian.com>
26813
26814         * object.c: in mono_object_get_virtual_method(), take into account that
26815         non-virtual methods don't have a slot in the vtable. Check needed when
26816         the object is a proxy.
26817
26818 2004-05-05  Zoltan Varga  <vargaz@freemail.hu>
26819
26820         * marshal.h marshal.c icall.c: Applied patch from vladimir@pobox.com
26821         (Vladimir Vukicevic). Implement UnsafeAddrOfPinnedArrayElement.
26822
26823         * object.c (mono_class_compute_gc_descriptor): Fix warning.
26824
26825         * object.c (mono_runtime_invoke_array): Add an assert so null cannot be
26826         passed when a valuetype is expected.
26827
26828         * object.c (mono_unhandled_exception): Only set the exit code if the
26829         exception happens in the main thread. Fixes thread5.exe.
26830
26831         * appdomain.c (get_info_from_assembly_name): Fix infinite loop on
26832         invalid names. Fixes #58047.
26833
26834 2004-05-03  Jackson Harper  <jackson@ximian.com>
26835
26836         * assembly.c: This line was committed accidently and is unneeded.
26837         
26838 2004-05-03  Jackson Harper  <jackson@ximian.com>
26839
26840         * icall.c: Add new icall for Assembly::LoadWithPartialName
26841         * assembly.c/.h: new function that probes the GAC to load partial
26842         assembly names by Paolo Molaro.
26843         
26844 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26845
26846         * appdomain.c: use g_strncasecmp when looking for 'Culture=' et al.
26847         * reflection.c: use g_strncasecmp when looking for 'Culture=' et al.
26848         (type_get_fully_qualified_name): Added PublicKeyToken when building a
26849         full type name.
26850
26851 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26852
26853         * appdomain.c: fixed check for 'neutral' culture and removed warning.
26854         * reflection.c: fix bug when parsing a full type name and Version is not
26855         the last thing in the string.
26856
26857 2004-05-03  Zoltan Varga  <vargaz@freemail.hu>
26858
26859         * appdomain.c (get_info_from_assembly_name): Strdup "" to prevent
26860         crashes when it is freed.
26861
26862 2004-05-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26863
26864         * assembly.c: print the compat warning to stderr.
26865
26866 2004-05-01  Miguel de Icaza  <miguel@ximian.com>
26867
26868         * assembly.c (mono_assembly_load_references): Add a compatibility
26869         hack to run old applications that might be still referencing the
26870         3300-based assemblies, only do this for System.xxx.
26871
26872 2004-05-01  Jackson Harper  <jackson@ximian.com>
26873
26874         * appdomain.c: If the culture is neutral we set it to "".
26875         
26876 2004-04-29  Jackson Harper  <jackson@ximian.com>
26877
26878         * locales.c: Add some missing MONO_ARCH_SAVE_REGS'.
26879
26880 2004-04-29  Andreas Nahr <ClassDevelopment@A-SoftTech.com>
26881  
26882         * string-icalls.c: added low overhead function for copying chars
26883         * icall.c: added needed icall for the above function
26884  
26885 2004-04-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26886
26887         * icall.c: fix return value of get_global_assembly_cache.  Implemented
26888         Environment.GetLogicalDrives.
26889
26890 2004-04-28  Bernie Solomon  <bernard@ugsolutions.com>
26891
26892         * rand.c: try and talk to egd or prngd
26893         for random bytes if opening devices fail.
26894
26895 2004-04-28  Zoltan Varga  <vargaz@freemail.hu>
26896
26897         * marshal.c (mono_marshal_load_type_info): Calculate the minimum
26898         alignment for the type using the native alignment of its members 
26899         instead of using klass->min_align.
26900
26901         * metadata.c (mono_type_stack_size): Fix size of TYPEDBYREF.
26902
26903 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26904
26905         * file-io.c:
26906         * socket-io.c: added check for sys/aio.h.
26907
26908 2004-04-28  Dick Porter  <dick@ximian.com>
26909
26910         * threads.c: Don't abort a thread thats already aborting, when
26911         terminating everything.
26912
26913 2004-04-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26914
26915         * icall.c: added 2 new async calls for Socket.
26916
26917         * socket-io.[ch]: fixed some warnings. Added support for asynchronous
26918         IO on *nix systems.
26919
26920         * threadpool.c: removed unused variable.
26921
26922 2004-04-27  Zoltan Varga  <vargaz@freemail.hu>
26923
26924         * marshal.c: Handle null properly in PtrToString* icalls. Fixes #57706.
26925
26926 Tue Apr 27 15:55:17 CEST 2004 Paolo Molaro <lupus@ximian.com>
26927
26928         * locales.c: put back string_invariant_tolower () and
26929         string_invariant_toupper ().
26930
26931 2004-04-26 David Waite <mass@akuma.org>
26932
26933         * file-io.h:
26934         * socket-io.h:
26935         * threads.h:
26936         * unicode.h: remove comma from end of enumeration declarations
26937
26938 2004-04-26 David Waite <mass@akuma.org>
26939
26940         * debug-mono-symfile.h:
26941         * decimal.c:
26942         * mono_debug.h:
26943         * sysmath.c: Define 64 bit constants as long long types (i.e. 10ULL)
26944
26945
26946 2004-04-26  Jackson Harper  <jackson@ximian.com>
26947
26948         * appdomain.c: Increment version number.
26949         
26950 2004-04-26  Jackson Harper  <jackson@ximian.com>
26951
26952         * appdomain.c: Set assembly references public token value when
26953         PublicKeyToken is specified, not the hash_value. Free public token
26954         values when free assembly name data. Previously the public key
26955         token was hex decoded, however we are using hex encoded public key
26956         tokens, so this is not neccasary.
26957         * assembly.c: Lookup assemblies in the gac if their public token
26958         value is set. Add function to allow enabling user gac
26959         lookups. Specify whether or not the assembly was loaded from the
26960         GAC. Compare full assembly names when checking the cache for
26961         assemblies (Temporarily disabled see comment in code). Remove
26962         mscorlib -> corlib mapping cruft. Add trace-loading. When a user
26963         specifies trace-loader they get extra info to stdout on the
26964         loading of assemblies.
26965         * image.h: Add a field for an assembly references public token
26966         value to MonoAssemblyname. Add a field to MonoAssembly to specifiy
26967         whether an assembly has been loaded from the GAC.
26968         * image.c: Remove a corlib -> mscorlib name mapping.
26969         * loader.h: Add function to enable/disable the user gac.
26970         * mono-config.c: Check if the usergac is enabled in the config
26971         file.
26972         * icall.c: New icall to determine whether or not an assembly has
26973         been loaded from the GAC. Remove some mscorlib -> corlib mappings.
26974         * tabldefs.h: Add constant for assemblyref flag that specifies a
26975         full public key is used instead of a public token.
26976         * reflection.c: Remove mscorlib -> corlib mappings. Set
26977         PublicTokenValue instead of hash value. This value is a hex
26978         string so it does not need to be expanded.
26979
26980 2004-04-26  Martin Baulig  <martin@ximian.com>
26981
26982         * mono-debug-debugger.c (mono_debugger_initialize): Set
26983         `mono_debugger_initialized' before calling mono_debug_lock().
26984
26985 2004-04-42  Robert Shade <rshade@dvsconsulting.com>
26986
26987         * icall.c: icalls for Char.ToUpper/ToLower are now hooked to
26988           InternalToUpper/InternalToLower.
26989         * locales.c: (ves_icall_System_{Char,String}_InternalTo{Upper,Lower}_Comp)
26990           removed invariant culture shortcut.  This is now done in managed code.
26991         * locales.c: (string_invariant_toupper/tolower) removed.
26992
26993 2004-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
26994
26995         * icall.c: added GetSupportsAsync for Socket (same as MonoIO).
26996         Added Poll internal call.
26997
26998         * socket-io.[ch]: _wapi_socket == WSASocket. Added internal
26999         call for Poll. Select was too heavy for polling a single socket.
27000
27001         * threadpool.[ch]: added mono_threadpool_cleanup.
27002         * threads.c: use it. Don't use Thread_Abort on windows.
27003
27004 2004-04-23  Martin Baulig  <martin@ximian.com>
27005
27006         * mono-debug-debugger.c (mono_debugger_lookup_assembly): New function.
27007
27008 2004-04-23  Sebastien Pouliot  <sebastien@ximian.com>
27009
27010         * icall.c: Registred new icalls for key pair protection and added an
27011         icall for Environment.GetFolderPath on Windows.
27012         * security.c|h: Added new icalls for key pair protection.
27013
27014 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27015
27016         * socket-io.c: don't display the non-supported family warning for known
27017         families. Now this is not displayed on windows when checking support
27018         for IPv4/IPv6.
27019
27020 2004-04-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27021
27022         * class.c: don't display the layout warning for static fields.
27023
27024 2004-04-21  Lluis Sanchez Gual <lluis@ximian.com>
27025
27026         * icall.cs: Registered new icalls for Char.ToLower and Char.ToUpper.
27027         * locales.c, locales.h: Added new icalls for culture-specific
27028         Char.ToLower and Char.ToUpper.
27029
27030 2004-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27031
27032         * threads.c: the 2nd argument when aborting a thread is NULL now. Patch
27033         by David Waite.
27034
27035 2004-04-20  Martin Baulig  <martin@ximian.com>
27036
27037         * mono-debug-debugger.c (mono_debugger_lookup_type): Make a copy
27038         of the type name before passing it to mono_reflection_type_from_name().
27039
27040 2004-04-19  Zoltan Varga  <vargaz@freemail.hu>
27041
27042         * marshal.c (mono_marshal_get_managed_wrapper): Handle different string
27043         encodings here. Fixes #56965.
27044
27045 2004-04-18  Bernie Solomon <bernard@ugsolutions.com>
27046
27047         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
27048         fix test on strstr result not that I can see anything that
27049         relies on the result.
27050
27051 2004-04-18  Zoltan Varga  <vargaz@freemail.hu>
27052
27053         * metadata.c (mono_type_to_unmanaged): Handle MONO_NATIVE_FUNC as well.
27054         Fixes #57081.
27055
27056         * marshal.c (mono_marshal_get_string_encoding): New helper function.
27057
27058         * marshal.c (mono_marshal_get_native_wrapper): Use the new helper
27059         function to determine which marshalling to use for strings. Fixes
27060         #56965.
27061
27062         * marshal.c (mono_marshal_string_array_to_unicode): Fix warning.
27063
27064         * reflection.c (encode_marshal_blob): Add support for LPARRAY.
27065
27066 2004-04-15  Bernie Solomon  <bernard@ugsolutions.com>
27067
27068         * icall.c: #include mono-config.h
27069
27070 2004-04-15  Jackson Harper  <jackson@ximian.com>
27071
27072         * culture-info-tables.h: Fix date formats for en-US culture.
27073         
27074 2004-04-15  Lluis Sanchez Gual  <lluis@ximian.com>
27075
27076         * icall.c: Registered icalls for ThreadPool.GetMinThreads and 
27077         ThreadPool.SetMinThreads.
27078         * threadpool.c: Implemented ThreadPool.GetMinThreads and
27079         ThreadPool.SetMinThreads.
27080
27081 Thu Apr 15 15:36:40 CEST 2004 Paolo Molaro <lupus@ximian.com>
27082
27083         * mono-config.c: also load the .config file in the directory
27084         where the assembly was found.
27085
27086 Thu Apr 15 14:24:49 CEST 2004 Paolo Molaro <lupus@ximian.com>
27087
27088         * assembly.c: load per-assembly config files.
27089         * icall.c: decrapified code to get the config dir and moved to
27090         mono-config.c.
27091         * image.h, loader.c, loader.h, mono-config.c, mono-config.h: allow
27092         per-assembly config files. When doing a dll map lookup give precedence
27093         to the per-assembly data.
27094
27095 2004-04-14  Martin Baulig  <martin@ximian.com>
27096
27097         * mono-debug-debugger.h (MonoDebuggerEvent): Removed
27098         MONO_DEBUGGER_EVENT_TYPE_ADDED and MONO_DEBUGGER_EVENT_METHOD_ADDED
27099         and added MONO_DEBUGGER_EVENT_RELOAD_SYMTABS.
27100
27101         * mono-debugger-debugger.c: While the debugger is locked, remember
27102         whether the symbol tables have changes and send one single
27103         MONO_DEBUGGER_EVENT_RELOAD_SYMTABS when releasing the lock.
27104
27105 2004-04-14  Zoltan Varga  <vargaz@freemail.hu>
27106
27107         * metadata.h: Add STRARRAY_STRWLPARRAY marshalling convention.
27108
27109         * marshal.h marshal.c (mono_marshal_string_array_to_unicode): New 
27110         function.
27111
27112         * marshal.c (mono_marshal_get_native_wrapper): Take CharSet into
27113         account when marshalling string arrays. Fixes #56965.
27114
27115 2004-04-13  Sebastien Pouliot  <sebastien@ximian.com>
27116
27117         * icall.c: Add new icalls mapping for security.
27118         * security.c|h: Add internal calls for WindowsIdentity,
27119         WindowsImpersonationContext and WindowsPrincipal.
27120
27121 2004-04-13  Gert Driesen (drieseng@users.sourceforge.net)
27122
27123         * class.c: Added comment to ensure the System.MonoDummy class
27124         is removed when no longer necessary
27125
27126 2004-04-13  Miguel de Icaza  <miguel@ximian.com>
27127
27128         * appdomain.c: Pass arguments to the bootstraping exceptions to
27129         minimize JITed methods at boot
27130
27131         * metadata.c (mono_exception_from_name_two_strings): Allow for the
27132         second string to be null.
27133
27134         * icall.c (ves_icall_System_Text_Encoding_InternalCodePage):
27135         Change the protocol to minimize the JIT methods at startup.  Now
27136         it Returns the internal codepage, if the value of "int_code_page"
27137         is 1 at entry, and we can not compute a suitable code page
27138         number, returns the code page as a string.
27139
27140 2004-04-13  Jackson Harper  <jackson@ximian.com>
27141
27142         * culture-info-tables.h: Fix number of decimal digits for all
27143         english locales.
27144
27145 2004-04-13  Jackson Harper  <jackson@ximian.com>
27146
27147         * icall.c: Clairfy out of sync error message. It is not always
27148         your corlib that is out of sync.
27149
27150 2004-04-13  Zoltan Varga  <vargaz@freemail.hu>
27151
27152         * icall.c (ves_icall_Type_GetPropertiesByName): Avoid duplicate
27153         properties when only the set accessor is overriden. Fixes #55874.
27154
27155 2004-04-09  Zoltan Varga  <vargaz@freemail.hu>
27156
27157         * assembly.c (mono_assembly_load_references): Make this thread safe.
27158         Fixes #56327.
27159
27160 2004-04-08  Zoltan Varga  <vargaz@freemail.hu>
27161
27162         * monosn.c: Add missing initialization calls.
27163
27164 2004-04-08  Bernie Solomon  <bernard@ugsolutions.com>
27165
27166         * locales.c:
27167         ves_icall_System_Globalization_CultureInfo_construct_number_format
27168         Fix g_assert so it compiles on fussier compilers re int/ptr
27169         mismatch
27170
27171 2004-04-08  Dick Porter  <dick@ximian.com>
27172
27173         * socket-io.h:
27174         * socket-io.c: Don't set SO_REUSEADDR on windows.  Fixes bug
27175         53992.  Also rearrange the code so that the internal calls return
27176         an error value and exceptions are thrown from managed code.
27177
27178         * icall.c: Add type info to the socket icalls.
27179
27180 2004-04-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27181
27182         * object.h: synchronize MonoCompareInfo with CompareInfo class. Someone
27183         owes me a beer.
27184
27185 2004-04-07  Martin Baulig  <martin@ximian.com>
27186
27187         * class.c (mono_class_from_generic_parameter): Don't default
27188         `klass->parent' to `mono_defaults.object_type'.
27189
27190 2004-04-07  Martin Baulig  <martin@ximian.com>
27191
27192         * reflection.c (mono_reflection_initialize_generic_parameter): Set
27193         `param->pklass->reflection_info'.       
27194
27195 2004-04-07  Jackson Harper  <jackson@ximian.com>
27196
27197         * culture-info-tables.h: Fix date separator symbol.
27198         
27199 2004-04-07  Martin Baulig  <martin@ximian.com>
27200
27201         * icall.c (ves_icall_Type_GetGenericArguments): Moved this icall
27202         from System.Type to System.MonoType.
27203
27204 2004-04-07  Martin Baulig  <martin@ximian.com>
27205
27206         * reflection.h
27207         (MonoReflectionGenericParam): Added `has_reference_type' and
27208         `has_value_type' fields.
27209
27210         * reflection.c (mono_image_get_generic_param_info): Encode the
27211         correct flags if we have the `class' or `struct' constraint.
27212
27213 2004-04-07  Martin Baulig  <martin@ximian.com>
27214
27215         * reflection.h
27216         (MonoReflectionGenericParam): Added `MonoBoolean has_ctor_constraint'.
27217
27218 2004-04-07  Jackson Harper  <jackson@ximian.com>
27219
27220         * appdomain.c: Revert extra patches, just wanted to bump the
27221         version number.
27222         
27223 2004-04-07  Jackson Harper  <jackson@ximian.com>
27224
27225         * Makefile.am: Add culture-info private headers.
27226         * icall.c: Add new icalls for contructing locales.
27227         * locales.c: Construct CultureInfo objects from lookup tables instead of using ICU.
27228         * locales.h: Declare new culture info construction methods.
27229         * object.h: Add new fields used to avoid the CultureMap to
27230         MonoCultureInfo.
27231         * culture-info.h: Definition of structs used in the culture info
27232         tables.
27233         * culture-info-tables.h: Autogenerated tables that contain culture
27234         info data. This file was generated with the locale-builder tool.
27235         * appdomain.c: Incement corlib version number.
27236         
27237 2004-04-07  Bernie Solomon  <bernard@ugsolutions.com>
27238
27239         * appdomain.c: (mono_runtime_init) move mono_thread_init
27240         to before mono_object_new calls so critical sections
27241         are initialized before use.
27242
27243 2004-04-07  Martin Baulig  <martin@ximian.com>
27244
27245         * icall.c
27246         (ves_icall_TypeBuilder_define_generic_parameter): Removed.
27247         (ves_icall_MethodBuilder_define_generic_parameter): Removed.
27248         (ves_icall_MonoGenericParam_initialize): Removed.
27249         (monogenericparam_icalls): Removed.
27250         (generictypeparambuilder_icalls): Added new table for
27251         System.Reflection.Emit.GenericTypeParameterBuilder.
27252
27253         * reflection.c
27254         (mono_reflection_define_generic_parameter): Removed.
27255         (mono_reflection_initialize_generic_parameter): This is now called
27256         from GenericTypeParameterBuilder's .ctor.
27257
27258 2004-04-06  Martin Baulig  <martin@ximian.com>
27259
27260         * class.c (mono_class_init): Don't inflate nested classes in a
27261         generic instance.
27262         (mono_type_get_name_recurse): Include the generic arguments for
27263         generic instances and generic type declarations.
27264         (inflate_generic_type): Correctly inflate MONO_TYPE_SZARRAY.
27265         (_mono_class_get_instantiation_name): Removed.
27266         (mono_class_create_generic): Always use `gklass->name' as our name.
27267
27268         * class.h (MonoGenericInst): Removed `nested_in', and `nested'.
27269
27270         * icall.c (ves_icall_MonoGenericInst_GetDeclaringType): Removed.
27271         (ves_icall_MonoGenericInst_GetNestedTypes): Removed.
27272         (ves_icall_MonoMethod_GetGenericParameters): Renamed to
27273         ves_icall_MonoMethod_GetGenericArguments() and correctly handle
27274         closed generic methods here.
27275
27276         * reflection.c
27277         (mono_reflection_generic_inst_get_nested_types): Removed.
27278         (inflate_mono_method): Copy the generic parameters from the
27279         MonoMethodHeader into out MonoGenericMethod.
27280
27281 2004-04-06  Martin Baulig  <martin@ximian.com>
27282
27283         * row-indexes.h
27284         (MONO_GENERICPARAM_DEPRECATED_CONSTRAINT): Removed.
27285
27286         * metadata.c (GenericParamSchema): Removed "DeprecatedConstraint".
27287
27288         * reflection.c (build_compressed_metadata): If we have any entries
27289         in the GenericParam, MethodSpec or GenericParamConstraint tables,
27290         set the header version to 1.1.
27291
27292 2004-04-06  Martin Baulig  <martin@ximian.com>
27293
27294         * class.c (mono_class_init): If we're a generic instance,
27295         initialize our nested classes, too.
27296         (_mono_class_get_instantiation_name): Deal with the new `!%d'
27297         suffix. 
27298
27299 2004-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27300
27301         * process.c: quote the argument passed to the shell on windows.
27302
27303 2004-04-05  Zoltan Varga  <vargaz@freemail.hu>
27304
27305         * threads.c (mono_alloc_special_static_data): Allow this to be
27306         called during startup.
27307
27308 2004-04-02  Martin Baulig  <martin@ximian.com>
27309
27310         * icall.c
27311         (ves_icall_MonoGenericInst_GetDeclaringType): New icall.
27312
27313 2004-04-02  Zoltan Varga  <vargaz@freemail.hu>
27314
27315         * icall.c: Fix build.
27316
27317 2004-04-02  Sebastien Pouliot  <sebastien@ximian.com>
27318
27319         * Makefile.am: Added security.c|h.
27320         * icall.c: Added icall for get_UserName;
27321         * security.c: New file for security related icalls. Added function
27322         get_UserName for System.Environment (fix #56144).
27323         * security.h: New. Header file for security.c
27324
27325 2004-04-02  Dick Porter  <dick@ximian.com>
27326
27327         * icall.c: Deleted the icalls that were obsoleted some time ago
27328         by the ICU string code, and which were mixed into the icall
27329         rearranging.  Fixes bug 55969.
27330
27331         * string-icalls.h: 
27332         * string-icalls.c: Deleted the code that those icalls reference.
27333
27334 2004-04-01  Martin Baulig  <martin@ximian.com>
27335
27336         * metadata.h (MONO_CLASS_IS_INTERFACE): New macro.
27337
27338         * class.c (mono_class_from_generic_parameter): Don't set 
27339         TYPE_ATTRIBUTE_INTERFACE.
27340         (my_mono_class_from_generic_parameter): Likewise.
27341
27342 2004-04-01  Martin Baulig  <martin@ximian.com>
27343
27344         * loader.c (find_method): Added an optional `MonoClass *ic'
27345         argument to search in a specific interface.
27346         (mono_get_method_constrained): New public function.
27347
27348 2004-04-01  Martin Baulig  <martin@ximian.com>
27349
27350         * reflection.c (mono_image_get_generic_field_token): Use the
27351         `handleref' cache here.
27352
27353 2004-04-01  Martin Baulig  <martin@ximian.com>
27354
27355         * reflection.h (MonoDynamicImage): Added `GHashTable *typespec'.
27356
27357         * reflection.c (create_generic_typespec): Use the `typespec' hash
27358         here, not the `typeref' one.    
27359
27360 2004-04-01  Martin Baulig  <martin@ximian.com>
27361
27362         * class.c (mono_class_inflate_generic_type): Moved the
27363         functionality into a new static inflate_generic_type() which
27364         returns NULL if it didn't do anything.  Only increment the
27365         `mono_stats.inflated_type_count' if we actually inflated
27366         something.
27367         (mono_class_get_full): Check the classes type to see whether we
27368         need to inflate it; also inflate MONO_TYPE_(M)VAR.
27369
27370 2004-04-01  Jackson Harper  <jackson@ximian.com>
27371
27372         * reflection.c: Set culture for assembly references.
27373         
27374 2004-04-01 Ben Maurer  <bmaurer@users.sourceforge.net>
27375
27376         * reflection.[ch], icall.[ch], Fix support for pinning variables.
27377
27378 2004-04-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27379
27380         * assembly.c:
27381         (do_mono_assembly_open): the critical section also covers
27382         mono_image_open and mono_image_open_from_data. Fixes bug #56327.
27383
27384 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27385
27386         * threads.c:
27387         (mono_manage_threads): abort the background threads when finishing.
27388         Fixes bug #47232.
27389
27390 2004-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27391
27392         * gc.c: only close the done_event handle if there was no timeout.
27393         C-ified comments.
27394
27395 2004-03-30  Martin Baulig  <martin@ximian.com>
27396
27397         * icall.c (icall_entries): It's called "System.Activator", not
27398         "System.Activation".    
27399
27400 2004-03-30  Martin Baulig  <martin@ximian.com>
27401
27402         * class.c (mono_ldtoken): Added `MonoGenericContext *' argument.
27403         (mono_class_create_from_typespec): Likewise.
27404
27405 2004-03-30  Martin Baulig  <martin@ximian.com>
27406
27407         * reflection.h (MonoReflectionGenericParam): Use MonoBoolean for
27408         `has_ctor_constraint' and `initialized'.
27409
27410 2004-03-30  Martin Baulig  <martin@ximian.com>
27411
27412         * reflection.c (encode_new_constraint): New static function to add
27413         the constructor constraint attribute to a type parameter.
27414         (encode_constraints): Call encode_new_constraint() if necessary.
27415
27416         * reflection.h
27417         (MonoReflectionGenericParam): Added `guint32 has_ctor_constraint'.
27418
27419         * row-indexes.h: Added CUSTOM_ATTR_GENERICPAR.
27420         
27421 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
27422
27423         * reflection.c, icall.c: add support for pinning variables. 
27424
27425 2004-03-29  Bernie Solomon  <bernard@ugsolutions.com>
27426
27427         * marshal.c (mono_marshal_get_managed_wrapper):
27428         init bool local with zero rather than null.
27429
27430 2004-03-29  Martin Baulig  <martin@ximian.com>
27431
27432         * icall.c (ves_icall_MonoMethod_get_HasGenericParameters): Show
27433         the "official" behavior here.
27434         (ves_icall_MonoMethod_get_Mono_IsInflatedMethod): New interncall.
27435
27436 2004-03-29  Martin Baulig  <martin@ximian.com>
27437
27438         * icall.c: Reflect latest API changes.
27439
27440 2004-03-29  Martin Baulig  <martin@ximian.com>
27441
27442         * loader.c (mono_get_method_from_token): Also call
27443         mono_metadata_load_generic_params () for abstract and interface
27444         methods; replace the type arguments in the method signature with
27445         the ones which are loaded from the metadata.
27446
27447 2004-03-29  Lluis Sanchez Gual  <lluis@ximian.com>
27448
27449         * monitor.c: In mono_monitor_exit(), don't throw an exception if the owner
27450         of the lock is not the current thread. MS.NET don't do it, in spite of
27451         what the documentation says. See bug #56157.
27452
27453 2004-03-28  Martin Baulig  <martin@ximian.com>
27454
27455         * class.c (mono_class_init): Don't call init_properties() and
27456         init_events() for generic instances; set `prop->parent' when
27457         inflating properties.
27458
27459         * reflection.c (mono_generic_inst_get_object): Call
27460         `mono_class_init (ginst->klass)'.
27461         (mono_type_get_object): Only create a MonoGenericInst if your
27462         generic type is a TypeBuilder.
27463         (do_mono_reflection_bind_generic_parameters): Only set
27464         `ginst->is_dynamic' if our generic type is a TypeBuilder.
27465
27466 2004-03-28  Zoltan Varga  <vargaz@freemail.hu>
27467
27468         * appdomain.c (unload_thread_main): Do not clear proxy_vtable_hash.
27469         Fixes #56091.
27470
27471 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27472
27473         * icall.c: added Kill_internal icall.
27474         * process.[ch]: added Kill_internal icall.
27475
27476 2004-03-25  Martin Baulig  <martin@ximian.com>
27477
27478         * class.h (MonoStats): Added `generic_instance_count',
27479         `inflated_method_count', `inflated_type_count' and
27480         `generics_metadata_size'.       
27481
27482 2004-03-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27483
27484         * reflection.c: no warnings now.
27485
27486 2004-03-25  Martin Baulig  <martin@ximian.com>
27487
27488         * class.c (mono_class_get_full): New public function; does a
27489         mono_class_get(), but also takes a `MonoGenericContext *'.
27490
27491         * loader.c (mono_field_from_memberref): Renamed to
27492         `field_from_memberref', made static and added `MonoGenericContext *'
27493         argument.
27494         (mono_field_from_token): Added `MonoGenericInst *' argument.
27495         (method_from_memberef): Likewise.
27496         (mono_get_method_from_token): Likewise.
27497         (mono_get_method_full): New public function; does a
27498         mono_get_method(), but also takes a `MonoGenericContext *'.
27499
27500         * verify.c (mono_method_verify): Get the method's generic context
27501         and pass it to mono_field_from_token(), mono_get_method_full() and
27502         mono_class_get_full().
27503
27504 2004-03-25  Martin Baulig  <martin@ximian.com>
27505
27506         * class.c (mono_class_inflate_generic_type): Take a
27507         `MonoGenericContext *' instead of a `MonoGenericInst *' and a
27508         `MonoGenericMethod *'.
27509
27510 2004-03-25  Martin Baulig  <martin@ximian.com>
27511
27512         * loader.h (MonoMethodInflated): Store the MonoGenericContext
27513         instead of the MonoGenericMethod here.
27514
27515 2004-03-25  Martin Baulig  <martin@ximian.com>
27516
27517         * class.h (MonoGenericInst): Added `MonoGenericContext *context';
27518         each time we create a new MonoGenericInst, we also create a new
27519         context which points back to us.
27520
27521         * class.c (inflate_method): Use `ginst->context' instead of
27522         creating a new context.
27523
27524         * loader.c (method_from_memberref): Use
27525         `klass->generic_inst->context' instead of creating a new context.
27526
27527 2004-03-25  Martin Baulig  <martin@ximian.com>
27528
27529         * class.h (MonoGenericContext): New struct.
27530         (MonoGenericMethod): Removed `generic_inst'.
27531
27532         * class.c (mono_class_inflate_generic_method): Take a
27533         `MonoGenericContext *' instead of a `MonoGenericMethod *'.
27534
27535 2004-03-25  Martin Baulig  <martin@ximian.com>
27536
27537         * loader.h (MonoMethodInflated): New typedef.
27538
27539         * metadata.h (MonoMethodSignature): Removed `gen_method', make
27540         `generic_param_count' consume just 30 bits, added `is_inflated'
27541         and `has_type_parameters' flags (one bit each).
27542
27543         * class.c (mono_class_inflate_generic_method): Create a
27544         MonoMethodInflated instead of a MonoMethodNormal and set
27545         `is_inflated' in the method signature.
27546
27547         * class.h (MonoGenericMethod): Removed `generic_method'.
27548
27549 2004-03-25  Lluis Sanchez Gual  <lluis@ximian.com>
27550
27551         * image.c: Make sure the name of a MonoImage is always an absolute path.
27552           This fixes bug #54415.
27553
27554 2004-03-24  Martin Baulig  <martin@ximian.com>
27555
27556         * class.c (mono_class_setup_vtable): If we're a generic instance,
27557         use our generic type's vtable size.
27558
27559 2004-03-24  Zoltan Varga  <vargaz@freemail.hu>
27560
27561         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Add
27562         MONO_NO_UNLOAD env var as a temporary workaround for unloading 
27563         problems.
27564
27565 2004-03-23  Martin Baulig  <martin@ximian.com>
27566
27567         * class.h (MonoDynamicGenericInst): Added `int count_events' and
27568         `MonoEvent *events'.
27569
27570         * icall.c (ves_icall_MonoGenericInst_GetEvents): New interncall.
27571         (typebuilder_icalls): Added "get_event_info"; calls
27572         mono_reflection_event_builder_get_event_info(). 
27573
27574         * reflection.c (mono_reflection_generic_inst_initialize): Added
27575         `MonoArray *events'.
27576         (mono_reflection_event_builder_get_event_info): New function.
27577
27578 2004-03-23  Bernie Solomon  <bernard@ugsolutions.com>
27579
27580         * object.h: add mono_type_initialization_init
27581
27582         * object.c (mono_runtime_class_init): 
27583         implement class constructor synchronization rules
27584         to cope with threading issues.  
27585         add mono_type_initialization_init
27586
27587         * appdomain.c (mono_runtime_init): call 
27588         mono_type_initialization_init
27589
27590         * class.h: removing initializing field from MonoVTable
27591
27592 2004-03-23  Martin Baulig  <martin@ximian.com>
27593
27594         * class.c (my_mono_class_from_generic_parameter): Use
27595         `param->name' if it's not NULL. 
27596
27597 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
27598
27599         * class.c: do not insert non-virtual methods in the vtable.
27600         * icall.c, mono-debug-debugger.c, object.c: if method->slot == -1,
27601         that means the method is non-virtual. This never would have
27602         happened before.
27603
27604 2004-03-22  Lluis Sanchez Gual  <lluis@ximian.com>
27605
27606         * profiler.c: Added lock for accessing coverage_hash.
27607
27608 2004-03-22  Martin Baulig  <martin@ximian.com>
27609
27610         * icall.c (ves_icall_MethodInfo_get_IsGenericMethod): Use
27611         `method->method->signature->generic_param_count != 0' to make it
27612         work for interface methods.
27613
27614 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27615
27616         * process.c: quote the string passed to the shell using g_shell_quote.
27617
27618 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27619
27620         * threads.c:
27621         (mono_threads_manage): don't remove the finalizer thread and self
27622         from the threads hash table so that mono_thread_manage can be called
27623         more than once.
27624
27625 2004-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27626
27627         * process.c: quote the arguments when UseShellExecute is true. Fixes
27628         bug #55790.
27629
27630 2004-03-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27631
27632         * threads.c: set mono_thread_detach as a cleanup routine for every
27633         thread. This way it's always executed upon thread termination, either
27634         aborted or finished normally. No more xsp hangs!
27635
27636 2004-03-17  Martin Baulig  <martin@ximian.com>
27637
27638         * class.h (MonoGenericInst): Replaced the `GList *nested' with an
27639         `int count_nested' and a `MonoType **nested'.
27640
27641         * reflection.c (mono_reflection_bind_generic_parameters): Moved
27642         most of the functionality into a new static
27643         do_mono_reflection_bind_generic_parameters() and don't take a
27644         `MonoType *nested_in' argument any more.  Don't compute nested
27645         types here.
27646         (mono_reflection_generic_inst_get_nested_types): New public method
27647         to get nested types.
27648
27649         * class.c (mono_class_create_generic): Set `klass->nested_in' if
27650         we're a nested class.
27651
27652         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): Call
27653         mono_reflection_generic_inst_get_nested_types() to compute the
27654         nested types.
27655
27656 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27657
27658         * threads.c (ves_icall_System_Threading_Thread_Abort): Add a more
27659         descriptive error message under windows.
27660         
27661 2004-03-17  Martin Baulig  <martin@ximian.com>
27662
27663         * class.c (dup_type): Added `const MonoType *original' argument;
27664         copy the attrs from the original type.
27665
27666 2004-03-17  Martin Baulig  <martin@ximian.com>
27667
27668         * metadata.c (do_mono_metadata_parse_generic_inst): Use the
27669         `m->generic_inst_cache' here.
27670
27671 2004-03-17  Zoltan Varga  <vargaz@freemail.hu>
27672
27673         * exception.h exception.c: Add stack_overflow_exception.
27674
27675 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27676
27677         * threadpool.c:
27678         (overlapped_callback): call SetEvent *after* invoking the callback.
27679         No need to call CloseHandle.
27680
27681 2004-03-16  Martin Baulig  <martin@ximian.com>
27682
27683         * reflection.c (mono_image_get_fieldref_token): Take a
27684         `MonoReflectionField *' instead of a `MonoClassField *' and a
27685         `MonoClass *'; store the `MonoReflectionField *' in the hash.
27686
27687 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27688
27689         * appdomain.c: don't add the culture to the filename we're looking for
27690         if it's neutral or NULL. Fixes bug #53788. Removed redundant memset.
27691
27692 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27693
27694         * locales.c: don't ignore symbols when doing case insensitive compares.
27695         Thanks Dick! Fixes bug #54046.
27696
27697         * threads.c: surround 'threads' usage with enter/leave in
27698         mono_thread_manage.
27699
27700 2004-03-16  Zoltan Varga  <vargaz@freemail.hu>
27701
27702         * marshal.c (mono_marshal_get_native_wrapper): Char arrays are 
27703         implicitly marshalled as [Out]. Fixes #55450.
27704
27705         (mono_marshal_get_runtime_invoke): Zero out the result if there is
27706         an exception.
27707
27708 2004-03-16  Martin Baulig  <martin@ximian.com>
27709
27710         * class.c (mono_class_from_generic_parameter): Use the actual
27711         parameter name. 
27712
27713 2004-03-16  Martin Baulig  <martin@ximian.com>
27714
27715         * reflection.c (type_get_signature_size): New static function.
27716         Compues the size of the type in a method signature.
27717         (method_get_signature_size): New static function; calls
27718         type_get_signature_size() to compute the actual size of the
27719         method's signature.
27720         (method_encode_signature): Use method_get_signature_size() to get
27721         the signature's size rather than using `nparams * 10'.
27722
27723 2004-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27724
27725         * file-io.h: define here WapiOverlapped on windows. I don't want the
27726         regular OVERLAPPED one.
27727
27728         * file-io.c:
27729         * threadpool.c: somehow, BindIoCompletionCallback is not found.
27730         Disabling AIO on windows.
27731
27732 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27733
27734         * marshal.c: Marshal.SizeOf throws an exception for AutoLayout. Fixes
27735         bug #55385.
27736
27737 2004-03-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27738
27739         * appdomain.c: upgraded corlib version.
27740
27741         * file-io.c: implemented new icalls: GetSupportsAIO, BeginRead
27742         and BeginWrite. Allow opening files for asynchrnous operations.
27743
27744         * file-io.h: new struct that maps FileStreamAsyncResult.
27745         * icall.c: added new icalls.
27746         * process.[ch]: support setting child process environment variables
27747         and use the SHELL or COMSPEC when UseShellExecute is true.
27748
27749         * threadpool.[ch]: fixed warnings, moved ThreadPool icalls here. The
27750         callback for async. IO is here and also BindHandle.
27751
27752         * threads.[ch]: added mono_thread_detach and removed ThreadPool icalls
27753         from here.
27754
27755 2004-03-14  Zoltan Varga  <vargaz@freemail.hu>
27756
27757         * reflection.c (create_custom_attr): Allow len == 0.
27758
27759         * object.c (mono_class_compute_gc_descriptor): Fix descriptor
27760         computation on big-endian machines.
27761
27762 2004-03-13  Martin Baulig  <martin@ximian.com>
27763
27764         * class.h (MonoGenericInst): Added `int count_ifaces'.
27765
27766         * iclass.c (ves_icall_MonoGenericInst_GetInterfaces): Use
27767         `ginst->count_ifaces' instead `klass->interface_count' since we
27768         may get called before the vtable is created.
27769
27770         * loader.c (mono_method_get_param_names): If we're a generic
27771         instance, return and don't initialize the class.
27772
27773         * reflection.c (mono_reflection_setup_generic_class): Don't call
27774         ensure_runtime_vtable().
27775         (mono_reflection_bind_generic_parameters): Set
27776         `ginst->count_ifaces'.
27777
27778 2004-03-11  Jackson Harper <jackson@ximian.com>
27779
27780         * icall.c:
27781         * unicode.c:
27782         * unicode.h: Remove unused System.Char icalls.
27783         
27784 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
27785
27786         * loader.c (mono_lookup_pinvoke_call): Call the Windows.Forms init
27787         code when we P/Invoke the first library in Windows.Forms, instead
27788         of when we first open the assembly.
27789
27790         * assembly.c: Drop the lookup from here.
27791
27792 2004-03-10  Martin Baulig  <martin@ximian.com>
27793
27794         * reflection.c (mono_reflection_get_custom_attrs): Use the correct
27795         class for properties, fields and events.  Finally fixes #54945.
27796
27797 2004-03-10  Martin Baulig  <martin@ximian.com>
27798
27799         * metadata.c (mono_metadata_class_equal): New static function;
27800         checks whether two generic instances or two generic parameters are
27801         equal.
27802         (mono_metadata_type_equal): Use mono_metadata_class_equal() to
27803         compare classes.        
27804
27805 2004-03-10  Martin Baulig  <martin@ximian.com>
27806
27807         * class.h (MonoGenericMethod): Added `gpointer reflection_info'.
27808
27809         * reflection.c (inflate_mono_method): Added `MonoObject *obj'
27810         argument and write it into the `reflection_info' field.
27811
27812         * icall.c
27813         (ves_icall_MethodBase_GetGenericMethodDefinition): New interncall.
27814         (ves_icall_MethodBase_get_HasGenericParameters): New interncall.
27815
27816 2004-03-09  Jackson Harper  <jackson@ximian.com>
27817
27818         * char-conversions.h: use 8 bits for numeric data its all we need
27819         * icall.c: numeric data is only 8 bits now.
27820
27821 2004-03-09  Martin Baulig  <martin@ximian.com>
27822
27823         * class.h (MonoProperty, MonoEvent): Added `MonoClass *parent'.
27824
27825         * class.c (init_properties, init_events): Initialize the new
27826         `parent' field.
27827
27828         * reflection.c (typebuilder_setup_properties): Likewise.
27829         (typebuilder_setup_events): Likewise.
27830
27831         * reflection.h (MonoEventInfo): Replaced `parent with
27832         `declaring_type' and `reflected_type'.
27833
27834         * icall.c (ves_icall_get_property_info): Distinguish between
27835         declaring and reflected type.
27836         (ves_icall_get_event_info): Likewise.
27837
27838 2004-03-09  Martin Baulig  <martin@ximian.com>
27839
27840         * icall.c (ves_icall_Type_GetTypeCode): Added MONO_TYPE_GENERICINST.
27841         (ves_icall_Type_GetField): Correctly set field->klass.
27842
27843 2004-03-09  Zoltan Varga  <vargaz@freemail.hu>
27844
27845         * loader.h: Fix warning.
27846
27847 2004-03-08  Miguel de Icaza  <miguel@ximian.com>
27848
27849         *  loader.c, loader.h (mono_loader_wine_init): Loads the Wine/Lib
27850         library routine if present.  Notice that it will still continue
27851         executing even if its missing, for those working on the Gtk#
27852         edition of Windows.Forms.
27853
27854         * assembly.c (do_mono_assembly_open): If loading the
27855         System.Windows.Forms call mono_loader_wini_init.
27856
27857 2004-03-04  Lluis Sanchez Gual  <lluis@ximian.com>
27858
27859         * class.h: Added MonoRemoteClass struct.
27860         * domain.c: Changed hash function for proxy_vtable_hash. It now uses a
27861         function for MonoStrings.
27862         * icall.c: In GetTransparentProxy, assign a MonoRemoteClass to the proxy.
27863         Added internal call for getting the proxy type.
27864         * marshal.c: Get the type of transparent proxies from its remote_class.
27865         Added methods that generate the IL for type checks and casts:
27866         mono_marshal_get_isinst, mono_marshal_get_castclass, 
27867         mono_marshal_get_proxy_cancast.
27868         * marshal.h: Declaration of the previous new methods.
27869         * object.c: Added new moethods for creating and updating MonoRemoteClass
27870         instances: mono_remote_class, mono_upgrade_remote_class, 
27871         * object.h: Added MonoRemoteClass reference in MonoTransparentProxy.
27872         * verify.c: FIx transparent_proxy_fields layout.
27873         * appdomain.c: Bump corlib version.
27874
27875 2004-03-04  Jackson Harper  <jackson@ximian.com>
27876
27877         * icall.c: Add icall to access char conversion tables.
27878         * char-conversions.h: Character conversion tables.
27879         * Makefile.am: Add char-conversions.h private header file.
27880         
27881 2004-03-04  Zoltan Varga  <vargaz@freemail.hu>
27882
27883         * appdomain.c (unload_thread_main): Increase unloading timeout to
27884         10 sec as a temporary workaround for Nant problems.
27885
27886 2004-02-29  Zoltan Varga  <vargaz@freemail.hu>
27887
27888         * gc.c: Add checks for GC_enable and GC_disable.
27889
27890         * string-icalls.c locales.c: Applied patch from Jaroslaw Kowalski
27891         (jaak@zd.com.pl). Fix memory corruption in String.Replace 
27892         (bug #54988).
27893         
27894 2004-02-27  Martin Baulig  <martin@ximian.com>
27895
27896         * reflection.c (mono_reflection_bind_generic_parameters): Take a
27897         `MonoReflectionType *' instead of a `MonoType *'.
27898
27899 2004-02-26  Zoltan Varga  <vargaz@freemail.hu>
27900
27901         * gc.c (run_finalize): Avoid finalizing the object representing the
27902         finalizer thread.
27903         (finalizer_thread): Fix warning.
27904
27905 2004-02-25  Martin Baulig  <martin@ximian.com>
27906
27907         * class.c (_mono_class_get_instantiation_name): Added `int offset'
27908         argument for nested types.
27909         (mono_class_create_generic): Added support for nested generictypes.
27910
27911         * class.h (MonoGenericInst): Added `MonoType *nested_in' and
27912         `GList *nested'.
27913
27914         * icall.c (ves_icall_MonoGenericInst_GetNestedTypes): New icall.
27915
27916         * reflection.c (method_encode_signature): Increase the minimum
27917         value of `size' from 10 to 11.
27918         (mono_reflection_bind_generic_parameters): Take `int type_argc'
27919         and `MonoType **types' arguments instead of the `MonoArray
27920         *types'; added `MonoType *nested_in'.  Recursively instantiate
27921         nested classes. 
27922
27923 2004-02-23  Zoltan Varga  <vargaz@freemail.hu>
27924
27925         * appdomain.h (MonoDomain): Add preallocated null_reference_ex and 
27926         stack_overflow_ex members which are used by exception handling.
27927
27928         * appdomain.c (mono_runtime_init): Initialize the new members.
27929
27930         * gc.c (mono_gc_enable): New helper function.
27931         * gc.c (mono_gc_disable): New helper function.
27932
27933 2004-02-23  Martin Baulig  <martin@ximian.com>
27934
27935         * icall.c: I must have been really stupid - make it actually work
27936         this time ;-)
27937
27938 2004-02-23  Martin Baulig  <martin@ximian.com>
27939
27940         * loader.c (method_from_memberref): Only inflate the method if
27941         it's in another klass.
27942
27943 2004-02-23  Martin Baulig  <martin@ximian.com>
27944
27945         * class.c (mono_class_inflate_generic_type): Fixed two bugs.
27946         (mono_class_init): If we're a generic instance and an interface,
27947         compute `class->interface_id'; also create `class->interfaces'
27948         here and inflate them.
27949
27950         * metadata.c (do_mono_metadata_parse_generic_inst): Compute
27951         `ginst->is_open'.
27952         (mono_type_stack_size): Fix for MONO_TYPE_GENERICINST.
27953
27954         * reflection.c (mono_image_create_token): Allow "MonoGenericInst".
27955
27956 2004-02-15  Miguel de Icaza  <miguel@ximian.com>
27957
27958         * reflection.c (method_encode_code): Improved the error message
27959         generated by the exception.
27960
27961 2004-02-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
27962
27963         * icall.c: Martin did not do what he said in the ChangeLog for
27964         2004-02-18, but put back the changes for properties and events.
27965         Commenting those changes out again and adding comment to bug #54518.
27966         
27967         * process.c: removed warning.
27968
27969 2004-02-20  Zoltan Varga  <vargaz@freemail.hu>
27970
27971         * marshal.c (emit_struct_conv): Print an error message instead of
27972         asserting when a type does not have the StructLayout attribute.
27973
27974 2004-02-20  Martin Baulig  <martin@ximian.com>
27975
27976         * reflection.c (mono_type_get_object): Also use the cache for
27977         generic instances.
27978         (mono_reflection_bind_generic_parameters): Always compute
27979         `ginst->ifaces'.        
27980
27981 2004-02-20  Martin Baulig  <martin@ximian.com>
27982
27983         * class.h (MonoGenericMethod): Removed `klass'.
27984
27985         * class.c (mono_class_inflate_generic_method): Added `MonoClass
27986         *klass' argument.
27987
27988 2004-02-20  Martin Baulig  <martin@ximian.com>
27989
27990         * reflection.c (method_encode_methodspec): Actually use the
27991         uninflated signature for the memberref.
27992
27993 2004-02-20  Martin Baulig  <martin@ximian.com>
27994
27995         * class.h (MonoGenericMethod): Removed `declaring'.
27996
27997         * class.c (mono_class_inflate_generic_method): If `gmethod->klass'
27998         is NULL, compute it here.
27999
28000 2004-02-20  Martin Baulig  <martin@ximian.com>
28001
28002         * image.h (MonoImage): Added `GHashTable *generic_inst_cache'.
28003
28004         * metadata.c (mono_metadata_generic_inst_hash): New method.
28005         (mono_metadata_generic_inst_equal): New method.
28006
28007         * reflection.c (mono_reflection_bind_generic_parameters): Use the
28008         `klass->image->generic_inst_cache' cache to avoid creating
28009         duplicate MonoGenericInst's.
28010
28011         * class.c (mono_class_inflate_generic_type): Use the cache.
28012
28013 Thu Feb 19 19:39:09 CET 2004 Paolo Molaro <lupus@ximian.com>
28014
28015         * object.c: fixed gc descriptor calculation for embedded valuetypes.
28016
28017 2004-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28018
28019         * icall.c: added Socket.WSAIoctl icall.
28020
28021         * socket-io.[ch]: implemented
28022         ves_icall_System_Net_Sockets_Socket_WSAIoctl.
28023
28024 2004-02-19  Atsushi Enomoto  <atsushi@ximian.com>
28025
28026         * icall.c: removed IsDigit, IsSeparator, IsWhiteSpace from char_icalls.
28027
28028 2004-02-18  Urs C Muff  <umuff@quark.com>
28029
28030         * debug-mono-symfile.c, mono-debug-debugger.c, mono-debug.c: Make
28031         this work on PPC and other big-endian architectures.
28032
28033         * debug-mono-symfile.h: Prepended the names of all the `guint32'
28034         fields with an underscore to make sure they're only accessed by
28035         the read32() macro.
28036
28037 2004-02-18  Martin Baulig  <martin@ximian.com>
28038
28039         * icall.c: Put the klass->refclass changes back for methods and
28040         fields, but not for properties and events.  We're currently not
28041         distinguishing between DeclaringType and ReflectedType for
28042         properties and events, that's what caused the regressions.
28043
28044 2004-02-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28045
28046         * object.c:
28047         (mono_async_result_new): the handle can be NULL.
28048
28049         * threadpool.c: Use an event instead of a semaphore, don't initialize
28050         it until needed. This saves quite a few semaphores from being created
28051         when using the threadpool.
28052
28053 2004-02-18  Zoltan Varga  <vargaz@freemail.hu>
28054
28055         * object.c (mono_string_is_interned_lookup): Fix interning of long
28056         strings. Fixes #54473.
28057
28058         * domain.c (ldstr_equal): Optimize if the two strings are equal.
28059
28060         * icall.c: Revert the klass->refclass changes since they introduce
28061         regressions (bug #54518).
28062
28063 2004-02-18  Martin Baulig  <martin@ximian.com>
28064
28065         * class.c (mono_class_init): If we're a generic instance and don't
28066         come from a TypeBuilder, inflate our members here.
28067         (mono_class_from_generic): Removed; just use `ginst->klass' instead.
28068         (mono_class_create_generic): New public method.
28069         (mono_class_initialize_generic): Removed.
28070         (get_instantiation_name): Renamed to
28071         _mono_class_get_instantiation_name() and made it public.
28072
28073 2004-02-18  Martin Baulig  <martin@ximian.com>
28074
28075         * class.c (mono_class_inflate_generic_type): Clear the new
28076         instance's `nginst->klass' when inflating a generic instance.
28077         (mono_class_is_subclass_of): Added (basic) support for generic
28078         instances.
28079
28080 Tue Feb 17 21:40:16 CET 2004 Paolo Molaro <lupus@ximian.com>
28081
28082         * appdomain.h, domain.c: use a MonoCodeManager instead of a
28083         MonoMempool to hold compiled native code.
28084
28085 2004-02-17  Martin Baulig  <martin@ximian.com>
28086
28087         * class.h (MonoDynamicGenericInst): Added `count_properties' and
28088         `properties'.
28089
28090         * reflection.c (mono_reflection_generic_inst_initialize): Added
28091         `MonoArray *properties' argument.
28092
28093         * icall.c (ves_icall_MonoGenericInst_GetProperties): New interncall.    
28094
28095 2004-02-17  Martin Baulig  <martin@ximian.com>
28096
28097         * icall.c (ves_icall_Type_GetFields): Renamed to
28098         ves_icall_Type_GetFields_internal() and added a
28099         `MonoReflectionType *rtype' argument; pass it to
28100         mono_field_get_object() to set the field's "reflected" type.
28101         (ves_icall_Type_GetConstructors): Likewise.
28102         (ves_icall_Type_GetEvents): Likewise.
28103         (ves_icall_Type_GetMethodsByName): Added `MonoReflectionType *rtype'
28104         argument; pass it to mono_method_get_object() to set the method's
28105         "reflected" type.       
28106
28107 2004-02-17  Martin Baulig  <martin@ximian.com>
28108
28109         * class.h (MonoDynamicGenericInst): New type.
28110         (MonoGenericInst): Added `dynamic_info' and `is_dynamic' fields.
28111
28112         * icall.c (ves_icall_MonoGenericInst_GetMethods): New interncall.
28113         (ves_icall_MonoGenericInst_GetConstructors): New interncall.
28114         (ves_icall_MonoGenericInst_GetFields): New interncall.
28115
28116         * class.c (mono_class_from_generic): Don't call
28117         mono_class_initialize_generic() if this is a dynamic instance;
28118         ie. it's being created from a TypeBuilder.
28119         Use MONO_TYPE_GENERICINST for `class->this_arg.type' and
28120         `class->byval_arg.type'.
28121
28122         * reflection.c (mono_reflection_inflate_method_or_ctor): Renamed
28123         to `inflate_method' and made static.
28124         (mono_reflection_inflate_field): Removed.
28125         (mono_reflection_generic_inst_initialize): New public method.
28126
28127         * reflection.h (MonoReflectionGenericInst): Removed `methods',
28128         `ctors' and `fields'; added `initialized'.
28129
28130 2004-02-14  Zoltan Varga  <vargaz@freemail.hu>
28131
28132         * debug-helpers.c (mono_method_full_name): Fix output for empty
28133         namespaces.
28134
28135 2004-02-12  Martin Baulig  <martin@ximian.com>
28136
28137         * class.h (MonoClassField): Added `MonoType *generic_type'.
28138
28139         * reflection.c (mono_image_get_fieldref_token): Added support for
28140         instantiated generic types.
28141         (field_encode_inflated_field): Removed.
28142         (mono_image_get_inflated_field_token): Removed.
28143         (mono_reflection_inflate_field): Return a `MonoReflectionField *'.
28144
28145         * reflection.h (MonoReflectionInflatedField): Removed.
28146
28147 2004-02-12  Martin Baulig  <martin@ximian.com>
28148
28149         * metadata.h (MonoMethodHeader, MonoMethodSignature): Moved the
28150         `gen_method' field from MonoMethodHeader to MonoMethodSignature.
28151
28152         * reflection.c (mono_image_get_methodspec_token): Take a
28153         `MonoMethod *' instead of a `MonoReflectionInflatedMethod *'.
28154         (mono_image_create_token): Check whether we have a
28155         `method->signature->gen_method' and call
28156         mono_image_get_methodspec_token() if appropriate.
28157         (inflated_method_get_object): Removed.
28158         (mono_reflection_bind_generic_method_parameters): Return a
28159         `MonoReflectionMethod *', not a `MonoReflectionInflatedMethod *'.
28160         (mono_reflection_inflate_method_or_ctor): Likewise.
28161
28162         * reflection.h (MonoReflectionInflatedMethod): Removed.
28163
28164 2004-02-12  Zoltan Varga  <vargaz@freemail.hu>
28165
28166         * marshal.c (mono_marshal_get_native_wrapper): Implement proper support
28167         for custom valuetype marshalling.
28168
28169         * icall.c (icall_entries): Diagnostic -> Diagnostics. Fixes #54261.
28170
28171 2004-02-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28172
28173         * icall.c: fixed WSAGetLastError_internal name.
28174
28175 2004-02-11  Zoltan Varga  <vargaz@freemail.hu>
28176
28177         * threads.c (mono_thread_attach): Allow this to be called multiple
28178         times for a thread.
28179         
28180         * threads.c (build_wait_tids): Do not wait for ourselves.
28181
28182         * threads.c (mono_thread_pop_appdomain_ref): Avoid crash if the 
28183         appdomain list is empty.
28184
28185         * marshal.c (mono_marshal_get_native_wrapper): Do not free the
28186         memory returned by mono_string_builder_to_utf16, since it points into
28187         managed memory. Thanks to Bernie Solomon for noticing this.
28188
28189         * icall.c: Add AppDomainSetup icalls.
28190
28191         * reflection.h (MonoReflectionMethodAux): Add 'param_cattr' field.
28192
28193         * reflection.c (mono_custom_attrs_from_param): Add support for dynamic
28194         types.
28195
28196         * reflection.c (reflection_methodbuilder_to_mono_method): Save
28197         custom attributes to the method_aux struct. Also fix array indexes etc.
28198
28199         * loader.c (mono_method_get_param_names): Make dynamic case work again.
28200         
28201 Tue Feb 10 17:03:04 CET 2004 Paolo Molaro <lupus@ximian.com>
28202
28203         * icall.c, loader.c: icall cleanup: we save quite a bit of memory
28204         (both static and runtime) and reduce startup time.
28205
28206 2004-02-10  Zoltan Varga  <vargaz@freemail.hu>
28207
28208         * marshal.c (mono_marshal_get_native_wrapper): Throw an exception on
28209         AsAny marshalling conversion instead of crashing.
28210
28211         * marshal.c: Fix warnings.
28212
28213 2004-02-09  Martin Baulig  <martin@ximian.com>
28214
28215         * class.h (MonoGenericMethod): Added `MonoMethod *declaring'.
28216
28217         * reflection.h (MonoReflectionInflatedMethod): Removed the
28218         `declaring' field, it's now in the unmanaged MonoGenericMethod.
28219
28220         * reflection.c (method_encode_methodspec): Removed the `method'
28221         argument; we get it from `gmethod->declaring'.
28222         (inflated_method_get_object): Removed the `declaring' argument.
28223
28224 2004-02-09  Martin Baulig  <martin@ximian.com>
28225
28226         * class.h (MonoGenericMethod): New type.
28227         (MonoGenericInst): Remove `mtype_argc', `mtype_argv' and
28228         `generic_method'.
28229
28230         * metadata.h (MonoMethodHeader): Replaced the `geninst' field with
28231         a `MonoGenericMethod *gen_method' one.
28232
28233         * class.c (mono_class_inflate_generic_type): Take an additional
28234         `MonoGenericMethod * argument.  This is only non-NULL if we're
28235         inflating types for a generic method.   
28236         (mono_class_inflate_generic_signature): Renamed to
28237         inflate_generic_signature() and made static; take a
28238         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
28239         (inflate_generic_header): Take a `MonoGenericMethod *' argument
28240         instead of a `MonoGenericInst *' one.
28241         (mono_class_inflate_generic_method): Likewise.
28242
28243         * reflection.c (encode_generic_method_sig): Take a
28244         `MonoGenericMethod *' argument instead of a `MonoGenericInst *'.
28245         (method_encode_methodspec): Likewise.
28246         (inflated_method_get_object): Likewise. 
28247
28248         * reflection.h (MonoReflectionGenericInst): Replaced the `ginst'
28249         field with a `MonoGenericMethod *gmethod' one.  
28250
28251 2004-02-08  Bernie Solomon  <bernard@ugsolutions.com>
28252
28253         * class.h (mono_class_has_parent): add parens to expansion
28254         so you can ! this.
28255
28256 2004-02-08  Martin Baulig  <martin@ximian.com>
28257
28258         * image.h (MonoImage): Removed `generics_cache'.
28259
28260         * class.c (mono_class_from_generic): Take a `MonoGenericInst *'
28261         instead of a `MonoType *' argument; removed the `inflate_methods'
28262         argument.  Don't inflate methods here.
28263
28264         * loader.c (find_method): If it's a generic instance, call
28265         mono_class_init() on the `sclass->generic_inst->generic_type'.
28266
28267         * metadata.c (mono_type_size): Make this work on uninitialized
28268         generic instances; call it on the `ginst->generic_type's class.
28269
28270         * reflection.c (mono_reflection_bind_generic_parameters): Call
28271         mono_class_from_generic() to create the `ginst->klass'.
28272
28273 2004-02-08  Martin Baulig  <martin@ximian.com>
28274
28275         * class.h (MonoClass): Changed type of `generic_inst' from
28276         `MonoType *' to `MonoGenericInst *'.
28277
28278 2004-02-08  Martin Baulig  <martin@ximian.com>
28279
28280         * icall.c (ves_icall_Type_BindGenericParameters): Just call
28281         mono_type_get_object(), this is now creating a `MonoGenericInst'
28282         for MONO_TYPE_GENERICINST.
28283         (ves_icall_MonoGenericInst_GetParentType): Likewise.
28284         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.
28285
28286         * reflection.c (mono_type_get_object): Return a `MonoGenericInst'
28287         instead instead of a `MonoType' for MONO_TYPE_GENERICINST.
28288         (inflated_method_get_object): Added `MonoClass *refclass' argument.
28289         (mono_reflection_inflate_method_or_ctor): Correctly set declaring
28290         and reflected type.
28291
28292         * reflection.h (MonoReflectionInflatedMethod): Removed
28293         `declaring_type' and `reflected_type'.
28294
28295 2004-02-08  Martin Baulig  <martin@ximian.com>
28296
28297         * class.h (MonoGenericInst): Added `MonoType *parent' and
28298         `MonoType **ifaces'.
28299
28300         * reflection.h (MonoReflectionGenericInst): Removed `klass',
28301         `parent' and `interfaces'.
28302
28303         * reflection.c (mono_reflection_bind_generic_parameters): Take a
28304         `MonoType *' argument and return a `MonoType *'.
28305
28306         * icall.c
28307         (ves_icall_MonoGenericInst_GetParentType): New interncall.
28308         (ves_icall_MonoGenericInst_GetInterfaces): Likewise.    
28309
28310 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28311
28312         * marshal.c (mono_marshal_get_native_wrapper): Add support for custom
28313         valuetype marshalling.
28314
28315 2004-02-06  Martin Baulig  <martin@ximian.com>
28316
28317         * class.c
28318         (mono_class_from_generic_parameter): Added TYPE_ATTRIBUTE_PUBLIC.
28319         (my_mono_class_from_generic_parameter): Likewise.
28320
28321 2004-02-06  Zoltan Varga  <vargaz@freemail.hu>
28322
28323         * debug-mono-symfile.c debug-mono-symfile.h mono-debug.c: Read the
28324         contents of the symbol files lazily.
28325
28326         * object.h (MonoThread): Add 'name' and 'name_len' fields.
28327
28328         * threads.h threads.c icall.c: New icalls for getting and setting the
28329         threads name.
28330
28331 2004-02-05  Zoltan Varga  <vargaz@freemail.hu>
28332
28333         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRefByID): 
28334         Raise an exception when the domain is not found.
28335
28336 2004-02-03  Martin Baulig  <martin@ximian.com>
28337
28338         * reflection.c (mono_image_get_methodspec_token): Use the
28339         uninflated signature; fixes gen-33.
28340
28341 2004-02-02  Zoltan Varga  <vargaz@freemail.hu>
28342
28343         * gc.c threads.c: Make the finalizer thread a normal managed thread so
28344         the finalizer code can use thread functionality.
28345
28346         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Fix check for 
28347         the finalizer thread.
28348
28349         * threads.c: Make some functions more robust.
28350
28351         * loader.c (mono_lookup_pinvoke_call): Another attempt at fixing #22532.
28352
28353         * metadata.h: Add new marshalling conventions.
28354
28355         * marshal.c (mono_marshal_get_native_wrapper): Add support for unicode
28356         stringbuilder marshalling. Fixes #53700.
28357
28358         * reflection.h (MonoReflectionTypeBuilder): Add 'permissions' field.
28359
28360         * reflection.c (mono_image_get_type_info): Save declarative security
28361         info.
28362
28363         * reflection.c (mono_image_get_field_info): Handle uninitialized 
28364         unmanaged fields as well.
28365
28366         * appdomain.c: Bump corlib version.
28367
28368 2004-02-01  Martin Baulig  <martin@ximian.com>
28369
28370         * loader.c (method_from_methodspec): Use `ginst->mtype_argc/v' for
28371         method type arguments.  
28372
28373 2004-01-30  Duncan Mak  <duncan@ximian.com>
28374
28375         * marshal.h: Add prototype for
28376         "ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem"
28377         and
28378         "ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem" to
28379         fix the build.
28380
28381 2004-01-30  Zoltan Varga  <vargaz@freemail.hu>
28382
28383         * marshal.c (ves_icall_System_Runtime_InteropServices_Marshal_AllocCoTaskMem): New icall.
28384         (ves_icall_System_Runtime_InteropServices_Marshal_FreeCoTaskMem): New icall.
28385
28386 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28387
28388         * marshal.c (mono_marshal_get_native_wrapper): Add support for
28389         custom marshalling of valuetypes.
28390
28391         * marshal.c: Fix some warnings.
28392
28393 2004-01-29  Martin Baulig  <martin@ximian.com>
28394
28395         * class.h (MonoGenericInst): Added `mtype_argc' and `mtype_argv'
28396         for generic method parameters.
28397
28398         * reflection.c (method_encode_methodspec): Write the uninflated
28399         signature into the methodspec table.
28400         (mono_reflection_inflate_method_or_ctor): Ensure `res->declaring'
28401         is always the uninflated method.
28402         (reflection_methodbuilder_to_mono_method): Copy the generic
28403         parameters from the MethodBuilder into `header->gen_params'.
28404
28405 2004-01-29  Zoltan Varga  <vargaz@freemail.hu>
28406
28407         * class.c (mono_class_from_generic_parameter): Fix warning.
28408
28409 2004-01-27  Martin Baulig  <martin@ximian.com>
28410
28411         * class.c (mono_class_from_generic_parameter): Don't create
28412         `klass->methods' here.  
28413
28414 2004-01-26  Zoltan Varga  <vargaz@freemail.hu>
28415
28416         * loader.c (mono_lookup_pinvoke_call): Disable trimming of .dll
28417         extension since it does not work with libraries named lib<FOO>.dll.so.
28418
28419 2004-01-25  Martin Baulig  <martin@ximian.com>
28420
28421         * class.c (mono_class_inflate_generic_type): Added support for
28422         MONO_TYPE_GENERICINST.
28423
28424         * reflection.c (mono_reflection_inflate_method_or_ctor): Also
28425         inflate methods on open constructed types.      
28426
28427 2004-01-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28428
28429         * object.c: fire ProcessExit event in the root AppDomain after running
28430         Main. Fixes bug #53299.
28431
28432 Fri Jan 23 21:27:40 CET 2004 Paolo Molaro <lupus@ximian.com>
28433
28434         * socket-io.c: include the new socket-wrappers.h header.
28435         Use the wrappers instead of the unix socket functions to make the code
28436         more clear.
28437
28438 2004-01-23  Zoltan Varga  <vargaz@freemail.hu>
28439
28440         * profiler.c (merge_methods): Fix merging of profile info. Fixes #53010.
28441
28442         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28443         Fixes #22532.
28444
28445 2004-01-22  Zoltan Varga  <vargaz@freemail.hu>
28446
28447         * reflection.c (mono_image_create_pefile): Handle the case when the
28448         entry point is not a MethodBuilder.
28449
28450         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28451         field to ReflectionMethod since it is not allways a builder.
28452
28453         * reflection.c (type_get_fully_qualified_name): New helper function to
28454         return the fully qualified name of a type.
28455
28456         * reflection.c (encode_marshal_blob): Always emit the fully qualified
28457         type name for custom marshallers.
28458
28459         * reflection.c (mono_marshal_spec_from_builder): Ditto.
28460
28461         * class.c (mono_class_setup_vtable): If a parent class already 
28462         implements an interface, use the implementing methods from that class.
28463         Fixes #53148.
28464
28465 2004-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28466
28467         * threadpool.c: just return instead of ExitThread to allow for thread
28468         clean up earlier.
28469
28470 2004-01-21  Zoltan Varga  <vargaz@freemail.hu>
28471
28472         * icall.c (ves_icall_System_Reflection_Module_Close): Prevent assertion
28473         when closing resource modules.
28474
28475         * reflection.c (mono_image_create_pefile): Handle the case when the
28476         entry point is not a MethodBuilder.
28477
28478         * reflection.h (MonoReflectionAssemblyBuilder): Change 'entry_point'
28479         field to ReflectionMethod since it is not allways a builder.
28480
28481 2004-01-20  Bernie Solomon  <bernard@ugsolutions.com>
28482
28483         * marshal.c (mono_marshal_get_managed_wrapper): 
28484         mono_marshal_alloc takes native int so CONV_I
28485         the arg for 64bits.
28486
28487 2004-01-20  Zoltan Varga  <vargaz@freemail.hu>
28488
28489         * reflection.c (fixup_cattrs): New function to fixup the methoddef
28490         tokens in the cattr table. Fixes #53108.
28491
28492 2004-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28493
28494         * loader.c: don't trim ".dll" before looking up in the config file.
28495         Don't leak orig_scope. Reopened bug #22532 in the meanwhile.
28496
28497 2004-01-19  Zoltan Varga  <vargaz@freemail.hu>
28498
28499         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): 
28500         Return the module which contains the resource as well.
28501         (ves_icall_System_Reflection_Module_Close): New icall.
28502
28503         * appdomain.c: Bump corlib version number.
28504
28505         * image.c (mono_image_addref): New public function.
28506
28507         * assembly.c: Call mono_image_addref.
28508
28509         * reflection.c (mono_module_get_object): Increase reference count of 
28510         the image.
28511
28512         * loader.c (mono_lookup_pinvoke_call): Strip .dll from library names.
28513         Fixes #22532.
28514
28515         * exception.h exception.c loader.h loader.c icall.c marshal.h marshal.c:
28516         Applied patch from Bernie Solomon  <bernard@ugsolutions.com>. Throw
28517         proper exceptions on DllImport problems.
28518
28519 Mon Jan 19 17:50:27 CET 2004 Paolo Molaro <lupus@ximian.com>
28520
28521         * class.c, metadata.c: eliminate CSIZE macro.
28522
28523 2004-01-19  Lluis Sanchez Gual  <lluis@ximian.com>
28524
28525         * icall.c: Added ves_icall_type_IsInstanceOf internal call.
28526         * object.h: Added async_callback field in MonoAsyncResult.
28527         * marshal.c: In mono_delegate_begin_invoke, set the value of async_callback.
28528         * verify.c: Added async_callback in MonoAsyncResult layout.
28529
28530 2004-01-17  Zoltan Varga  <vargaz@freemail.hu>
28531
28532         * reflection.c (mono_reflection_get_custom_attrs): Add support
28533         for Modules.
28534
28535 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28536
28537         * marshal.c (mono_string_builder_to_utf8): Fix stringbuilder 
28538         marshalling.
28539         (mono_marshal_method_from_wrapper): Add null pointer check.
28540
28541 2004-01-16  Martin Baulig  <martin@ximian.com>
28542
28543         * debug-mono-symfile.h: Set version number to 36 and reflect
28544         latest symbol writer changes.
28545
28546 2004-01-16  Zoltan Varga  <vargaz@freemail.hu>
28547
28548         * class.c (mono_bounded_array_class_get): Set 'bounded' to FALSE for
28549         multi-dimensional arrays.
28550         (mono_class_is_assignable_from): Check vectors<->one dim. arrays.
28551         (mono_class_from_mono_type): Use bounded_array_class_get.
28552         
28553         * class.c (mono_bounded_array_class_get): New function which takes
28554         a 'bounded' bool argument to distinguish vectors from one dimensional
28555         arrays.
28556
28557         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Call 
28558         bounded_array_class_get if the array has bounds.
28559
28560         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
28561         Search modules loaded using AssemblyBuilder:AddModule as well.
28562
28563 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28564
28565         * appdomain.c: increased corlib version.
28566         * filewatcher.c: removed g_print.
28567         * icall.c:
28568         (get_property_info): only allocate what is actually requested.
28569         (ves_icall_Type_GetInterfaces): free the bitset in case of early error.
28570
28571 2004-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28572
28573         * Makefile.am: added filewatcher.[ch]
28574         * filewatcher.[ch]: FileSystemWatcher runtime support.
28575         * icall.c: added new FSW icalls.
28576
28577 Tue Jan 13 20:03:17 CET 2004 Paolo Molaro <lupus@ximian.com>
28578
28579         * string-icalls.c: fix stringbuilder regression as suggested by
28580         Iain McCoy <iain@mccoy.id.au>.
28581
28582 2004-01-13  Zoltan Varga  <vargaz@freemail.hu>
28583
28584         * process.c (process_read_stringtable_block): Recognize '007f' as
28585         a language neutral stringtable block.
28586
28587 2004-01-12  Patrik Torstensson
28588
28589         * object.h (MonoStringBuilder) : Changed layout to support our
28590         new stringbuilder class.
28591         * marshal.c: Change marshalling to support the new layout of 
28592         string builder.
28593         * appdomain.c: increased version number because new layout of
28594         string builder.
28595
28596 2004-01-12  Zoltan Varga  <vargaz@freemail.hu>
28597
28598         * appdomain.c (ves_icall_System_AppDomain_LoadAssembly): Receive the
28599         assembly name as an string instead of an AssemblyName, since it is
28600         easier to extract info from it.
28601
28602         * appdomain.c (mono_domain_assembly_preload): Look for assemblies in
28603         the culture subdirectories too. Fixes #52231.
28604
28605 2004-01-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28606
28607         * icall.c: renamed ves_icall_Type_GetMethods to GetMethodsByName.
28608         It takes 2 new parameters with an optional name for the method to look
28609         for and case ignoring info.
28610
28611         * threadpool.c: removed unused variable.
28612
28613 2004-01-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28614
28615         * icall.c: renamed ves_icall_Type_GetProperties to GetPropertiesByName.
28616         It takes 2 new parameters with an optional name for the property to look
28617         for and case ignoring info.
28618         Fixes bug #52753.
28619
28620 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
28621
28622         * reflection.c: Applied patch from Benjamin Jemlich (pcgod@gmx.net).
28623         Fix #52451.
28624
28625 2004-01-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28626
28627         * appdomain.c:
28628         * assembly.c: escape the uri before passing it to g_filename_from_uri.
28629         Fixes bug #52630.
28630
28631 2004-01-07  Zoltan Varga  <vargaz@freemail.hu>
28632
28633         * reflection.c: Add support for more than one unmanaged resource.
28634
28635         * icall.c (ves_icall_get_enum_info): Store the value of the enum fields
28636         in field->def_value, as done in all other cases.
28637
28638         * reflection.c (mono_reflection_get_custom_attrs): Add support for
28639         TypeBuilders.
28640
28641         * reflection.c (mono_reflection_create_runtime_class): Remove 
28642         errorneous assignment to klass->element_class, since it is already
28643         done in mono_reflection_setup_internal_class.
28644
28645 2004-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28646
28647         * gc.c: added missing LeaveCriticalSection.
28648         * icall.c: indented a couple of lines.
28649         * threadpool.c: remove dangling LeaveCriticalSection. Don't wait forever
28650         if we call EndInvoke inside a callback. Fixes bug #52601.
28651
28652 2004-01-07  Martin Baulig  <martin@ximian.com>
28653
28654         * mono-debug-debugger.h
28655         (MonoDebuggerIOLayer): Added `GetCurrentThreadID'.
28656
28657 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
28658
28659         * appdomain.c: Use messages in NotImplementedException.
28660
28661         * exception.c (mono_get_exception_not_implemented): Now this takes
28662         a message argument.
28663
28664         * marshal.c (emit_str_to_ptr_conv): g_warning and throw an
28665         exception instead of g_asserting an aborting when something is not
28666         implemented.
28667
28668         Add some inline docs.
28669
28670 2004-01-05  Zoltan Varga  <vargaz@freemail.hu>
28671
28672         * reflection.h: Update after changes to object layout.
28673
28674         * reflection.c: Implement saving of unmanaged aka win32 resources.
28675
28676         * appdomain.c: Bump version number.
28677
28678         * appdomain.c (ves_icall_System_AppDomain_InternalSetDomainByID): 
28679         Handle missing domains gracefully.
28680
28681 2004-01-05  Atsushi Enomoto <atsushi@ximian.com>
28682
28683         * file-io.c : On Windows, there are much more invalid_path_chars.
28684
28685 Fri Jan 2 13:35:48 CET 2004 Paolo Molaro <lupus@ximian.com>
28686
28687         * class.h, object.c: prepare for GetType () speedup.
28688
28689 2003-12-24  Atsushi Enomoto <atsushi@ximian.com>
28690
28691         * profiler.c: workaround for --profile null reference exception on
28692           cygwin. Patch by Patrik Torstensson.
28693
28694 2003-12-22  Bernie Solomon  <bernard@ugsolutions.com>
28695
28696         * marshal.c: (ves_icall_System_Runtime_InteropServices_Marshal_Read/WriteXXX)
28697         make work for unaligned access.
28698
28699 Mon Dec 22 18:37:02 CET 2003 Paolo Molaro <lupus@ximian.com>
28700
28701         * class.c: small cleanup (class->fields [i] -> field).
28702         * image.c: check address of metadata is valid.
28703
28704 2003-12-22  Zoltan Varga  <vargaz@freemail.hu>
28705
28706         * assembly.h assembly.c (mono_assembly_loaded): New public function to
28707         search the list of loaded assemblies.
28708
28709         * reflection.c (mono_reflection_type_from_name): Use 
28710         mono_assembly_loaded instead of mono_image_loaded.
28711
28712         * reflection.c: Fix warnings.
28713
28714 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
28715
28716         * image.h (MonoImage): Add a new 'dynamic' field to denote that the image 
28717         is dynamic. This is needed since an assembly can contain both dynamic and
28718         non-dynamic images.
28719
28720         * class.c loader.c metadata.c object.c: Use image->dynamic instead of 
28721         assembly->dynamic.
28722
28723         * icall.c reflection.c: Add new AssemblyBuilder:AddModule icall.
28724
28725         * reflection.h (MonoReflectionAssemblyBuilder): Add 'loaded_modules' field
28726         to store modules loaded using AddModule.
28727
28728         * reflection.c (mono_image_fill_file_table): Generalize this so it works
28729         on Modules.
28730
28731         * reflection.c (mono_image_fill_export_table_from_class): New helper function.
28732
28733         * reflection.c (mono_image_fill_export_table_from_module): New function to
28734         fill out the EXPORTEDTYPES table from a module.
28735
28736         * reflection.c (mono_image_emit_manifest): Refactor manifest creation code
28737         into a separate function. Also handle loaded non-dynamic modules.
28738
28739         * reflection.c (mono_image_basic_init): Fix memory allocation.
28740
28741         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28742
28743         * assembly.c (mono_assembly_load_references): Make this public.
28744
28745 2003-12-19  Martin Baulig  <martin@ximian.com>
28746
28747         * class.c (mono_class_initialize_generic): Made this static, take
28748         a `MonoGenericInst *' instead of a `MonoClass *'.
28749         (mono_class_from_generic): Call mono_class_initialize_generic()
28750         unless we're already initialized or being called from
28751         do_mono_metadata_parse_generic_inst().
28752
28753         * class.h (MonoGenericInst): Added `initialized' and
28754         `init_pending' flags.
28755
28756         * metadata.c (do_mono_metadata_parse_generic_inst): Don't call
28757         `mono_class_init (gklass)' or mono_class_initialize_generic()
28758         here; set `generic_inst->init_pending' while parsing the
28759         `type_argv'.
28760
28761 2003-12-19  Bernie Solomon  <bernard@ugsolutions.com>
28762
28763         * locales.c: include string.h for memxxx prototypes
28764
28765 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
28766
28767         * icall.c (ves_icall_MonoField_GetValueInternal): Do not run the class
28768         constructor when accessing literal fields.
28769
28770 2003-12-17  Zoltan Varga  <vargaz@freemail.hu>
28771
28772         * appdomain.c (MONO_CORLIB_VERSION): Bump corlib version.
28773
28774         * reflection.c (assembly_add_resource_manifest): New function to fill
28775         the MANIFESTRESOURCE table.
28776
28777         * reflection.c (mono_image_build_metadata): Emit MANIFESTRESOURCE table.
28778
28779         * reflection.h: Update to changes in class layout.
28780
28781         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): 
28782         Reenable call to mono_runtime_is_shutting_down ().
28783
28784         * appdomain.c (mono_runtime_is_shutting_down): New helper function to
28785         determine if the runtime is shutting down.
28786
28787 2003-12-16  Jackson Harper <jackson@ximian.com>
28788
28789         * icall.c: comment out call to mono_runtime_is_shutting_down to
28790         fix build.
28791         
28792 2003-12-16  Zoltan Varga  <vargaz@freemail.hu>
28793
28794         * icall.c (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal): Add support for loading resources from modules.
28795         (ves_icall_System_Environment_get_HasShutdownStarted): New icall.
28796
28797 2003-12-15  Bernie Solomon  <bernard@ugsolutions.com>
28798
28799         * reflection.c: move definition of swap_with_size
28800         to before its first call
28801
28802 2003-12-15  Zoltan Varga  <vargaz@freemail.hu>
28803
28804         * appdomain.c (mono_runtime_is_shutting_down): New public function.
28805
28806         * icall.c (ves_icall_System_Environment_get_HasShutdownStarted): New
28807         icall.
28808
28809         * object.c: Fix warnings.
28810
28811         * icall.c (ves_icall_Type_Get...): Only consider inherited static
28812         members if FlattenHierarchy is set.
28813
28814         * reflection.c (mono_image_add_decl_security): New function to emit
28815         declarative security.
28816
28817         * reflection.h reflection.c: Add support for declarative security.
28818
28819         * appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28820         
28821 2003-12-13  Zoltan Varga  <vargaz@freemail.hu>
28822
28823         appdomain.c (MONO_CORLIB_VERSION): Bump version number.
28824         
28825         * appdomain.c verify.c: Moved corlib version checking into its own
28826         function in appdomain.c since it needs to create vtables etc.
28827
28828 2003-12-13  Patrik Torstensson <p@rxc.se>
28829
28830         * marshal.c (mono_remoting_wrapper): Fix bug 48015, using TP as this 
28831         instead of unwrapped server.
28832
28833 2003-12-12  Zoltan Varga  <vargaz@freemail.hu>
28834
28835         * verify.c (check_corlib): Fix field index.
28836
28837 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
28838
28839         * icall.c: Applied patch from Todd Berman (tbermann@gentoo.org). New
28840         GetGacPath icall.
28841
28842 2003-12-10  Bernie Solomon  <bernard@ugsolutions.com>
28843
28844         * process.c:  (ves_icall_System_Diagnostics_Process_GetWorkingSet_internal
28845         ves_icall_System_Diagnostics_Process_SetWorkingSet_internal):
28846         cope with sizeof(size_t) != sizeof(guint32).
28847
28848 2003-12-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
28849
28850         * process.[ch]: the 'pid' field in MonoProcInfo stores GetLastError
28851         in case of failure.
28852
28853 2003-12-10  Mark Crichton <crichton@gimp.org>
28854
28855         * icall.c: removed the GetNonZeroBytes.  We now handle this case
28856         in managed code.
28857
28858         * rand.c, rand.h: Same here.  Also cleaned up the clode slightly.
28859
28860 Tue Dec 9 15:36:18 CET 2003 Paolo Molaro <lupus@ximian.com>
28861
28862         * class.h, class.c, icall.c, marshal.c, object.c: ignore fields
28863         marked as deleted.
28864
28865 2003-12-09  Zoltan Varga  <vargaz@freemail.hu>
28866
28867         * verify.c (check_corlib): Handle the case when the version field is 
28868         initialized by a static constructor.
28869
28870 2003-12-08  Patrik Torstensson  <p@rxc.se>
28871
28872     * rand.c (InternalGetBytes): Implemented win32 version with cryptapi
28873
28874 2003-12-08  Martin Baulig  <martin@ximian.com>
28875
28876         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Return
28877         a MonoReflectionGenericParameter, also take the parameter index
28878         and name as arguments.
28879         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.
28880         (ves_icall_MonoGenericParam_initialize): New interncall.
28881         (ves_icall_Type_make_byref_type): New interncall.
28882
28883         * reflection.h (MonoReflectionGenericParam): Derive from
28884         MonoReflectionType, not just from MonoObject.  Added `refobj' and
28885         `index' fields.
28886
28887         * reflection.c (mono_reflection_define_generic_parameter): Create
28888         and return a new MonoReflectionGenericParam; don't initialize the
28889         constraints here.
28890         (mono_reflection_initialize_generic_parameter): New public method;
28891         initializes the constraints and creates the `param->pklass'.
28892
28893 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
28894
28895         * reflection.h reflection.c: Use the new fields 'num_types', 
28896         'num_fields' and 'num_methods' to track the number of types etc.
28897
28898         * verify.c (check_corlib): Check corlib version number.
28899
28900 2003-12-07  Zoltan Varga  <vargaz@freemail.hu>
28901
28902         * marshal.c (mono_marshal_method_from_wrapper): Remove assert so this
28903         function works on all methods.
28904
28905 2003-12-07  Lluis Sanchez Gual  <lluis@ximian.com>
28906
28907         * domain.c, loader.h: Added IRemotingTypeInfo interface in MonoDefaults.
28908         * icall.c: in, ves_icall_Remoting_RealProxy_GetTransparentProxy set
28909         the custom_type_info flag of the transparent proxy.
28910         * object.c: Added method mono_object_isinst_mbyref for casting mbyref
28911         objects that supports IRemotingTypeInfo.
28912         * object.h: Added custom_type_info field in transparent proxy.
28913
28914 2003-12-06  Martin Baulig  <martin@ximian.com>
28915
28916         * class.c (mono_class_create_from_generic): Removed.
28917         (mono_class_from_generic): Check `ginst->klass' before doing
28918         anything else.  This is important to fully support "recursive"
28919         generic types.
28920
28921         * metadata.c (do_mono_metadata_parse_generic_inst): Create an
28922         empty `generic_inst->klass' before doing anything else.
28923
28924 2003-12-06  Dick Porter  <dick@ximian.com>
28925
28926         * verify.c: 
28927         * object.h:
28928         * icall.c:
28929         * locales.c: Use C structs to access class fields.  Don't do a
28930         conversion between MonoString and UChar because both are
28931         platform-endian UTF-16.  Compare now takes startindex and count
28932         parameters.  Add a char overload for IndexOf.  Speed up the
28933         invariant string IndexOf.
28934
28935 2003-12-05  Zoltan Varga  <vargaz@freemail.hu>
28936
28937         * Makefile.am (monosn_LDADD): Fix parallel build.
28938
28939 2003-12-04  Martin Baulig  <martin@ximian.com>
28940
28941         * icall.c
28942         (ves_icall_type_GetTypeCode): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
28943         (ves_icall_Type_make_array_type): New interncall.       
28944
28945 2003-12-04  Martin Baulig  <martin@ximian.com>
28946
28947         * locales.c: also change it in the !HAVE_ICU case.
28948
28949 2003-12-04  Dick Porter  <dick@ximian.com>
28950
28951         * icall.c:
28952         * locales.c: construct_compareinfo is now in CompareInfo, not
28953         CultureInfo.
28954
28955 2003-12-04  Zoltan Varga  <vargaz@freemail.hu>
28956
28957         * image.c (mono_image_load_file_for_image): Cache loaded images in the
28958         image->files array.
28959
28960         * image.c (load_class_name): Load class names from the EXPORTEDTYPES
28961         table as well.
28962
28963         * assembly.c (mono_assembly_load_references): Only load references
28964         once.
28965
28966         * class.c (mono_class_from_name): Avoid linear search of the 
28967         EXPORTEDTYPE table.
28968
28969         * loader.c (mono_field_from_token): Cache lookups of fieldrefs as well.
28970
28971 2003-12-03  Zoltan Varga  <vargaz@freemail.hu>
28972
28973         * image.h (MonoImage): Add 'field_cache' field.
28974
28975         * loader.c (mono_field_from_token): Cache field lookups.
28976         
28977         * reflection.c (mono_module_get_object): Fix name property.
28978
28979         * icall.c (ves_icall_get_enum_info): Update after changes to 
28980         mono_metadata_get_constant_index ().
28981
28982         * icall.c: Get rid of get_type_info icall, use a separate icall for
28983         each type property to avoid needless memory allocations. Fixes #51514.
28984
28985         * metadata.c (mono_metadata_get_constant_index): Add a 'hint' parameter
28986         to avoid needless binary searches.
28987
28988         * class.c (class_compute_field_layout): Move the initialization of
28989         field->def_value to mono_class_vtable ().
28990
28991         * class.c (mono_class_layout_fields): Enable GC aware auto layout for
28992         non-corlib types.
28993
28994         * object.c (mono_object_allocate): Make it inline.
28995
28996         * object.c (mono_object_allocate_spec): Make it inline.
28997         
28998 2003-12-02  Dick Porter  <dick@ximian.com>
28999
29000         * locales.c (create_NumberFormat): NumberFormatInfo construction.
29001         Patch by Mohammad DAMT (mdamt@cdl2000.com).
29002
29003 2003-12-01  Dick Porter  <dick@ximian.com>
29004
29005         * threads.c: Fix signature and call in CreateMutex and
29006         CreateEvent.
29007
29008 2003-12-01  Dick Porter  <dick@ximian.com>
29009
29010         * icall.c: 
29011         * locales.c: Implement string compares and searching
29012
29013         * object.h: Add extra Thread field
29014
29015 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
29016
29017         * reflection.c (fixup_method): Add support for MonoCMethod.
29018
29019 2003-11-28  Zoltan Varga  <vargaz@freemail.hu>
29020
29021         * gc.c: Fix hangs and error messages when GC_DONT_GC is set.
29022
29023         * reflection.c (assembly_name_to_aname): Allow extra characters in
29024         assembly names. Fixes #51468.
29025
29026 2003-11-26  Zoltan Varga  <vargaz@freemail.hu>
29027
29028         * exception.c (mono_exception_from_name_domain): New helper function.
29029
29030         * appdomain.c (ves_icall_System_AppDomain_createDomain): Create the
29031         exception object in the correct domain.
29032
29033         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix 
29034         formatting + make a copy a the input data.
29035
29036         * loader.c (mono_get_method_from_token): Methods which contain
29037         native code do not have entries in the ImplMap.
29038
29039         (ves_icall_System_AppDomain_LoadAssemblyRaw): Fix exception throw.
29040         Thanks to Gonzalo for spotting this.
29041         
29042         * appdomain.c (ves_icall_System_AppDomain_LoadAssemblyRaw): Applied
29043         patch from ztashev@openlinksw.co.uk (Zdravko Tashev). New icall.
29044
29045         * assembly.h (mono_assembly_load_from): Split the second part of 
29046         assembly loading into a new public function.
29047
29048         * exception.h (mono_get_exception_bad_image_format): New function.
29049
29050 2003-11-24  Zoltan Varga  <vargaz@freemail.hu>
29051
29052         icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
29053         Enumerate all modules inside a dynamic assembly. Fixes #51293.
29054         
29055         * icall.c: Add new icall for creating dynamic methods.
29056
29057         * loader.h debug-helpers.c: Add new wrapper type for dynamic methods.
29058
29059         * reflection.h (MonoReflectionDynamicMethod): Fix type of bool fields.
29060
29061         * reflection.c (mono_reflection_create_dynamic_method): New icall to
29062         create a dynamic method.
29063
29064         * reflection.c (resolve_object): New helper function.
29065
29066         * reflection.c: Generalize ReflectionMethodBuilder and the functions
29067         which manipulate it so they can also work on dynamic methods.
29068
29069         * reflection.c (reflection_method_builder_to_mono_method): Avoid 
29070         creating the MonoReflectionMethodAux structure if it is not needed.
29071         
29072         * reflection.h verify.c: Update after changes to object layout.
29073
29074         * reflection.c (method_builder_encode_signature): Fix compilation on
29075         gcc 2.95.x.
29076
29077 2003-11-21  Lluis Sanchez Gual  <lluis@ximian.com>
29078
29079         * appdomain.h: Added support for context static fields. Added static_data
29080           field to MonoAppContext and renamed thread_static_fields to a more
29081           generic special_static_fields in MonoAppDomain, since it can now contain
29082           context static fields.
29083         * domain.c: Updated hashtable name.
29084         * object.c: Replaced field_is_thread_static() for a more generic
29085           field_is_special_static() which also checks for context static attribute.
29086           In mono_class_vtable(), added support for static context fields.
29087         * threads.c: Changed methods that manage thread static fields to more
29088           generic methods so they can be reused both for thread and context static
29089           data.
29090         * threads.h: Declared some new methods.
29091
29092 2003-11-21  Zoltan Varga  <vargaz@freemail.hu>
29093
29094         * reflection.h: Update after changes to the managed types.
29095
29096         * reflection.c (encode_custom_modifiers): New helper function.
29097
29098         * reflection.c (method_encode_signature): Emit custom modifiers.
29099
29100         * reflection.c (field_encode_signature): Emit custom modifiers.
29101
29102 2003-11-18  Zoltan Varga  <vargaz@freemail.hu>
29103
29104         * reflection.h (MonoReflectionAssemblyName): Applied patch from Laurent Morichetti (l_m@pacbell.net). Fix type of 'flags' field.
29105
29106         * icall.c (ves_icall_System_ValueType_Equals): New optimized 
29107         implementation.
29108
29109         * icall.c (ves_icall_System_ValueType_InternalGetHashCode): New 
29110         icall.
29111
29112         * object.c (mono_field_get_value_object): New function.
29113
29114         * object.c appdomain.h appdomain.c: Make out_of_memory_ex domain
29115         specific.
29116
29117 2003-11-17  Zoltan Varga  <vargaz@freemail.hu>
29118
29119         * appdomain.c (mono_runtime_get_out_of_memory_ex): New function to
29120         return a preallocated out-of-memory exception instance.
29121
29122         * object.c (out_of_memory): Use the new function.
29123
29124         * metadata.c (mono_metadata_parse_type): Handle the case when the byref
29125         flag is before the custom modifiers. Fixes #49802.
29126
29127 2003-11-16  Martin Baulig  <martin@ximian.com>
29128
29129         * class.c (mono_class_is_open_constructed_type): Implemented the
29130         MONO_TYPE_GENERICINST case.
29131
29132 2003-11-16  Zoltan Varga  <vargaz@freemail.hu>
29133
29134         * assembly.c (mono_assembly_fill_assembly_name): New function to
29135         fill out the MonoAssemblyName structure.
29136         (mono_assembly_open): Use the new function.
29137
29138         * icall.c (fill_reflection_assembly_name): New helper function.
29139
29140         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Use the
29141         new function.
29142
29143         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetAssemblyName): New icall.
29144
29145 2003-11-15  Martin Baulig  <martin@ximian.com>
29146
29147         * class.c (mono_class_is_open_constructed_type): New public
29148         function; checks whether a type is an open constructed type,
29149         ie. whether it still contains type parameters.
29150         (mono_class_inflate_generic_type): If we're a type parameter and
29151         the inflated type is also a MONO_TYPE_(M)VAR, return the original
29152         type.
29153
29154         * class.h (MonoGenericInst): Added `guint32 is_open'.
29155
29156         * loader.c (method_from_methodspec): Check whether we're an open
29157         or closed constructed type and set `ginst->is_open'.
29158
29159         * reflection.c (mono_reflection_bind_generic_parameters): Check
29160         whether we're an open or closed constructed type and set
29161         `ginst->is_open'.
29162         (mono_reflection_inflate_method_or_ctor): Don't inflate methods
29163         from open constructed types.
29164
29165 2003-11-15  Martin Baulig  <martin@ximian.com>
29166
29167         * reflection.c (mono_reflection_bind_generic_parameters): If we're
29168         a generic instance (instead of a generic type declaration) with
29169         unbound generic parameters, bind them to our actual types.
29170
29171 2003-11-14  Martin Baulig  <martin@ximian.com>
29172
29173         * reflection.h (MonoReflectionGenericInst): Added `MonoArray *interfaces'.
29174
29175         * reflection.c (mono_reflection_bind_generic_parameters): If we're
29176         an interface type, populate `res->interfaces' with instantiated
29177         versions of all the interfaces we inherit.
29178
29179 2003-11-13  Aleksey Demakov  <avd@openlinksw.com>
29180
29181         * assembly.c (mono_assembly_load): Fixed problem finding mscorlib.dll
29182         when MONO_PATH is set but doesn't contain the install dir.
29183
29184 2003-11-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29185
29186         * icall.c:
29187         (ves_icall_Type_GetInterfaces): don't return an interface twice when
29188         it's also implemented in base classes. Fixes bug #50927.
29189
29190 2003-11-13  Zoltan Varga  <vargaz@freemail.hu>
29191
29192         * gc.c (ves_icall_System_GC_WaitForPendingFinalizers): Avoid deadlocks
29193         if this method is called from a finalizer. Fixes #50913.
29194
29195 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
29196
29197         * threads.c: Implement VolatileRead/VolatileWrite
29198
29199         * icall.c: Add new icalls for VolatileRead/VolatileWrite
29200
29201 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29202
29203         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Applied 
29204         patch from Danilo Sagan (dsegan@gmx.net). Fix compilation under gcc
29205         2.95.3.
29206
29207         * assembly.c (mono_assembly_open): Fix windows build. Applied patch 
29208         from Peter Ross (pro@missioncriticalit.com).
29209         
29210 2003-11-12  Lluis Sanchez Gual  <lluis@ximian.com>
29211
29212         * icall.c: Added internal call for System.Environment::GetMachineConfigPath
29213
29214 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29215
29216         * assembly.c (mono_assembly_load_references): Disable check because it
29217         triggers on older corlibs which lots of people have.
29218
29219 2003-11-12  Jackson Harper  <jackson@ximian.com>
29220
29221         * assembly.c: Change corlib name to mscorlib. Add a temp. hack to
29222         load corlib.dll if mscorlib.dll is not found.
29223         * assembly.h: Remove corlib name define.
29224         * class.c:
29225         * domain.c:
29226         * image.c: Change corlib name to mscorlib.
29227         
29228 2003-11-12  Zoltan Varga  <vargaz@freemail.hu>
29229
29230         * debug-mono-symfile.c: Add patch from FreeBSD ports tree.
29231
29232 2003-11-11  Miguel de Icaza  <miguel@ximian.com>
29233
29234         * appdomain.h: Added loader_optimization here to sync with the C#
29235         code, and add disallow_binding_redirects field.
29236
29237 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
29238
29239         * mono-debug.c (mono_debug_add_method): Ignore unknown modules.
29240
29241         * reflection.c (mono_image_build_metadata): Fix crash on modules
29242         with no types.
29243
29244         * reflection.h (MonoMethodInfo): Track changes to the managed structure.
29245
29246         * icall.c (ves_icall_get_method_info): Return callingConvention as
29247         well.
29248
29249         * icall.c (ves_icall_System_Reflection_Assembly_GetNamespaces): Add 
29250         namespaces from the EXPORTEDTYPE table as well.
29251
29252         * icall.c (ves_icall_System_Reflection_Assembly_GetTypes): Merge types
29253         from all modules inside the assembly.
29254         
29255 2003-11-11  Martin Baulig  <martin@ximian.com>
29256
29257         * reflection.c (mono_reflection_bind_generic_parameters): Make
29258         this work for interfaces.
29259
29260 2003-11-11  Martin Baulig  <martin@ximian.com>
29261
29262         * mono-debug.c (mono_debug_add_type): Ignore unknown modules.
29263
29264 2003-11-11  Martin Baulig  <martin@ximian.com>
29265
29266         * reflection.c (mono_reflection_inflate_method_or_ctor): Allow
29267         "MonoInflatedMethod" and "MonoInflatedCtor".
29268
29269 2003-11-11  Zoltan Varga  <vargaz@freemail.hu>
29270
29271         * reflection.c (resolution_scope_from_image): Use the assembly table
29272         from the manifest module, since other modules don't have it.
29273
29274         * debug-helpers.c (mono_type_full_name): New helper function.
29275
29276         * image.h (MonoAssembly): Change 'dynamic' to a boolean.
29277
29278         * image.c (mono_image_load_file_for_image): New public function which
29279         is a replacement for the load_file_for_image in class.c.
29280
29281         * assembly.c (mono_assembly_load_module): A wrapper for the function
29282         above which does assembly association and reference loading too.
29283
29284         * class.c (mono_class_from_name): Call mono_assembly_load_module.
29285
29286 2003-11-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29287
29288         * appdomain.c: not all of the attributes for the full assembly name
29289         are required and the order doesn't matter. Fixes bug #50787.
29290
29291 2003-11-10  Dick Porter  <dick@ximian.com>
29292
29293         * locales.c: Use platform-endian UTF16
29294
29295 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29296
29297         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29298         
29299 2003-11-10  Martin Baulig  <martin@ximian.com>
29300
29301         * metadata.c
29302         (mono_metadata_load_generic_params): Make this actually work.
29303
29304         * reflection.c (mono_reflection_bind_generic_parameters): If our
29305         parent is a generic instance, pass all the `types' to it, no
29306         matter whether it has the same number of type parameters or not.
29307
29308 2003-11-10  Zoltan Varga  <vargaz@freemail.hu>
29309
29310         * reflection.c: Emit FILE and EXPORTEDTYPE tables.
29311
29312         * assembly.c (mono_assembly_load_references): Move the image<->assembly
29313         assignment code to this function so it gets called recursively for all
29314         modules.
29315
29316         * image.c (load_modules): Remove the assembly assignment since it is
29317         now done by mono_assembly_load_references.
29318         
29319         * icall.c (ves_icall_System_Reflection_Assembly_InternalGetType): 
29320         Add 'module' argument.
29321         (mono_module_get_types): New helper function.
29322         (ves_icall_System_Reflection_Module_InternalGetTypes): New icall.
29323
29324 2003-11-08  Martin Baulig  <martin@ximian.com>
29325
29326         * class.c (mono_class_inflate_generic_method): Interface method
29327         don't have a header.
29328
29329         * reflection.c (mono_image_get_methodspec_token): Take an
29330         additional `MonoGenericInst *' argument instead of reading it from
29331         the header; this is necessary to support interfaces.
29332         (mono_image_create_token): Pass the `MonoGenericInst *' from the
29333         MonoReflectionInflatedMethod to mono_image_get_methodspec_token().
29334         (inflated_method_get_object): Take an additional `MonoGenericInst *'
29335         argument.
29336
29337         * reflection.h (MonoReflectionInflatedMethod): Added
29338         `MonoGenericInst *ginst'.
29339
29340 2003-11-07  Zoltan Varga  <vargaz@freemail.hu>
29341
29342         * gc.c (mono_domain_finalize): Fix compilation for no GC case.
29343
29344 2003-11-06  Zoltan Varga  <zovarga@ws-zovarga2>
29345
29346         * appdomain.c (mono_domain_unload): Add a workaround for bug #27663.
29347
29348 2003-11-06  Zoltan Varga  <vargaz@freemail.hu>
29349
29350         * reflection.c 
29351         (reflection_methodbuilder_from_method_builder):
29352         (reflection_methodbuilder_from_ctor_builder): New helper functions to 
29353         initialize a ReflectionMethodBuilder structure.
29354         (mono_image_get_methodbuilder_token):
29355         (mono_image_get_ctorbuilder_token): New functions to emit memberref
29356         tokens which point to types in another module inside the same assembly.
29357
29358         * reflection.c: Use the new helper functions.
29359         
29360         * reflection.c (mono_image_basic_init): Initialize basedir and culture.
29361
29362         * icall.c loader.c reflection.c: Use ModuleBuilder->dynamic_image 
29363         instead of AssemblyBuilder->dynamic_assembly in the appropriate places.
29364
29365         * reflection.c (resolution_scope_from_image): Emit a moduleref if
29366         neccesary.
29367
29368         * reflection.c (mono_image_build_metadata): Emit metadata only for the
29369         current module. Emit the manifest only for the main module.
29370
29371         * reflection.c (mono_image_create_token): Add assertion when a 
29372         memberref needs to be created.
29373
29374         * reflection.c reflection.h (MonoDynamicAssembly): Remove unused fields.
29375
29376         * reflection.c (mono_reflection_get_custom_attrs_blob): Allocate a 
29377         larger buffer for the custom attribute blob. Fixes #50637.
29378         
29379 2003-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29380
29381         * threadpool.c: notify listener on async processing handles after
29382         invoking the async callback. Thanks to Zoltan.
29383
29384 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29385
29386         * reflection.c (create_dynamic_mono_image): Call mono_image_init to 
29387         avoid code duplication.
29388
29389         * reflection.h (MonoDynamicImage): New type which is currently unused,
29390         but will be used through the ref.emit code in place of 
29391         MonoDynamicAssembly.
29392
29393         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29394         object layout.
29395
29396         * reflection.c (create_dynamic_mono_image): Rewrote so it now creates
29397         a MonoDynamicImage instead of just a MonoImage.
29398         
29399         * reflection.h reflection.c icall.c: Move nearly all AssemblyBuilder
29400         icalls to ModuleBuilder but keep their semantics, so they will work
29401         with moduleb->assemblyb. This will change later.
29402         
29403 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29404
29405         * reflection.h (MonoReflectionAssemblyBuilder): Track changes to the
29406         object layout.
29407
29408         * reflection.c (mono_image_build_metadata): Avoid creation of a default
29409         main module, since it is now done by the managed code.
29410
29411 2003-11-03  Martin Baulig  <martin@ximian.com>
29412
29413         * reflection.c (mono_reflection_inflate_method_or_ctor): Set
29414         `ginst->klass' here.
29415         (method_encode_methodspec): Don't use the `ginst->generic_method's
29416         klass if it's a generic instance, use `ginst->klass' in this case.
29417
29418 2003-11-03  Martin Baulig  <martin@ximian.com>
29419
29420         * reflection.c (mono_image_get_generic_method_param_info):
29421         Removed, use mono_image_get_generic_param_info() instead.
29422         (mono_image_get_type_info): Write the GenericParam table before
29423         the Method table.  This is neccessary because in the GenericParam
29424         table, type parameters of the class (ie. '!0' etc.) must come
29425         before the ones from its generic methods (ie. '!!0' etc).
29426
29427 2003-11-03  Zoltan Varga  <vargaz@freemail.hu>
29428
29429         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill out AssemblyName->codebase. Fixes #50469.
29430
29431 2003-11-02  Martin Baulig  <martin@ximian.com>
29432
29433         * reflection.c (create_generic_typespec): Take a
29434         `MonoReflectionTypeBuilder *' instead of a `MonoType *' and get
29435         the generic parameters from it.
29436
29437 2003-11-02  Martin Baulig  <martin@ximian.com>
29438
29439         * reflection.c (fieldref_encode_signature): Take a `MonoType *'
29440         instead of a `MonoClassField *' since we just need the type.
29441         (create_generic_typespec): New static function.  Creates a
29442         TypeSpec token for a generic type declaration.
29443         (mono_image_get_generic_field_token): New static function.
29444         (mono_image_create_token): If we're a FieldBuilder in a generic
29445         type declaration, call mono_image_get_generic_field_token() to get
29446         the token.
29447
29448 2003-11-02  Martin Baulig  <martin@ximian.com>
29449
29450         * reflection.h
29451         (MonoReflectionInflatedMethod, MonoReflectionInflatedField): Added
29452         `MonoReflectionGenericInst *declaring_type' and
29453         `MonoReflectionGenericInst *reflected_type' fields.
29454
29455         * reflection.c (mono_reflection_inflate_method_or_ctor): Take a
29456         `MonoReflectionGenericInst *declaring_type' and a
29457         `MonoReflectionGenericInst *reflected_type' argument instead of a
29458         single `MonoReflectionGenericInst *type' one.  Set
29459         `res->declaring_type' and `res->reflected_type' from them.
29460         (mono_reflection_inflate_field): Likewise.      
29461
29462 2003-11-02  Martin Baulig  <martin@ximian.com>
29463
29464         * class.c (mono_class_setup_vtable): Don't store generic methods
29465         in the vtable.  
29466
29467 2003-11-02  Martin Baulig  <martin@ximian.com>
29468
29469         * reflection.h (MonoReflectionGenericInst): Added
29470         `MonoReflectionType *declaring_type'.
29471
29472         * reflection.c (mono_reflection_bind_generic_parameters): Use
29473         `if (tb->parent)' instead of `klass->parent'.
29474
29475 2003-11-01  Zoltan Varga  <vargaz@freemail.hu>
29476
29477         * assembly.c (mono_assembly_open): Avoid crash if a module is loaded
29478         with an empty ASSEMBLY table.
29479
29480         * reflection.c (mono_image_build_metadata): Avoid using the same loop
29481         variable in the inner and outer loops.
29482
29483 2003-10-31  Zoltan Varga  <vargaz@freemail.hu>
29484
29485         * metadata.h (mono_metadata_make_token): Put parentheses around macro
29486         argument.
29487
29488         * appdomain.h appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): Fix signature.
29489         
29490         * appdomain.c appdomain.h icall.c: Get rid of the InvokeInDomain 
29491         icalls. Instead, do everything in managed code. This is needed since
29492         it is hard to restore the original domain etc. in unmanaged code in the
29493         presence of undeniable exceptions.
29494
29495         * appdomain.c (ves_icall_System_AppDomain_InternalPushDomainRef): 
29496         New icalls to push and pop appdomain refs.
29497
29498 2003-10-31  Martin Baulig  <martin@ximian.com>
29499
29500         * class.c (inflate_generic_type): Renamed to
29501         mono_class_inflate_generic_type() and made it public.
29502
29503         * icall.c ("System.Reflection.MonoGenericInst::inflate_field"):
29504         New interncall.
29505
29506         * loader.c (mono_field_from_memberref): Also set the retklass for
29507         typespecs.
29508
29509         * fielder.c (mono_image_get_inflated_field_token): New static
29510         method; creates a metadata token for an inflated field.
29511         (mono_image_create_token, fixup_method): Added support for
29512         "MonoInflatedField".
29513         (fieldbuilder_to_mono_class_field): New static function.
29514         (mono_reflection_inflate_field): New public function.
29515
29516         * reflection.h
29517         (MonoReflectionGenericInst): Added `MonoArray *fields'.
29518         (MonoReflectionInflatedField): New typedef.     
29519
29520 2003-10-30  Bernie Solomon  <bernard@ugsolutions.com>
29521
29522         * socket-io.c (in6_addr ipaddress_to_struct_in6_addr): fix
29523         for Solaris and other platforms without s6_addr16
29524
29525 2003-10-30  Martin Baulig  <martin@ximian.com>
29526
29527         * class.c (inflate_generic_type): Take just one `MonoGenericInst *'
29528         argument instead of two.
29529         (mono_class_inflate_generic_signature): Likewise.
29530         (inflate_generic_header): Likewise.
29531         (mono_class_inflate_generic_method): Likewise.  In addition, if
29532         `ginst->klass' is set, it becomes the new `method->klass'.
29533
29534         * class.h (MonoGenericInst): Removed the `gpointer mbuilder'
29535         field.
29536
29537         * reflection.c (encode_generic_method_sig): Write a 0xa as the
29538         first byte. [FIXME]
29539         (method_encode_methodspec): If we have generic parameters, create
29540         a MethodSpec instead of a MethodRef.
29541         (fixup_method): Added support for "MonoInflatedMethod" and
29542         "MonoInflatedCtor".
29543         (mono_image_create_token): Added support for "MonoInflatedMethod"
29544         and "MonoInflatedCtor".
29545         (inflated_method_get_object): New static function; returns a
29546         managed "System.Reflection.MonoInflatedMethod" object.
29547         (mono_reflection_bind_generic_method_parameters): Return a
29548         `MonoReflectionInflatedMethod' instead of a `MonoReflectionMethod'.
29549         (mono_reflection_inflate_method_or_ctor): Likewise.
29550         (mono_image_get_generic_method_param_info): Initialize unused
29551         fields to zero.
29552         (mono_image_get_generic_param_info): Likewise.
29553
29554         * reflection.h (MonoReflectionInflatedMethod): New public
29555         typedef.  Corresponds to the managed "S.R.MonoInflatedMethod" and
29556         "S.R.MonoInflatedCtor" classes.
29557
29558         * loader.c (method_from_memberref): If we're a TypeSpec and it
29559         resolves to a generic instance, inflate the method.
29560
29561 2003-10-28  Dick Porter  <dick@ximian.com>
29562
29563         * object.c (mono_runtime_run_main): Convert command-line arguments
29564         into utf8, falling back to the user's locale encoding to do so.
29565
29566 2003-10-27  Zoltan Varga  <vargaz@freemail.hu>
29567
29568         * loader.c (mono_get_method_from_token): Avoid looking up the icalls
29569         at this time.
29570
29571         * marshal.c (mono_marshal_get_native_wrapper): Lookup icalls here.
29572
29573         * reflection.c (reflection_methodbuilder_to_mono_method): Avoid looking
29574         up icalls at method definition time. Partially fixes #33569.
29575
29576 2003-10-25  Zoltan Varga  <vargaz@freemail.hu>
29577
29578         * marshal.c (mono_marshal_get_native_wrapper): Add support for [Out]
29579         marshalling of arrays. Fixes #50116.
29580
29581         * appdomain.c (ves_icall_System_AppDomain_InternalIsFinalizingForUnload): New icall.
29582
29583         * appdomain.c (unload_thread_main): Clear class->cached_vtable if it
29584         points to a vtable in the dying appdomain.
29585
29586         * appdomain.c (mono_domain_unload): Move the notification of OnUnload
29587         listeners into unmanaged code inside the lock.
29588
29589         * object.c (mono_class_vtable): Turn off typed allocation in non-root
29590         domains and add some comments.
29591
29592 2003-10-25  Martin Baulig  <martin@ximian.com>
29593
29594         * class.h (MonoGenericInst): Added `MonoClass *klass' field.
29595
29596         * image.h (MonoImage): Added `GHashTable *typespec_cache'.
29597
29598         * metadata.c (mono_metadata_parse_generic_inst): Renamed to
29599         `do_mono_metadata_parse_generic_inst'; pass it the MonoType we're
29600         currently parsing.  Create the generic class and store it in
29601         `generic_inst->klass' before parsing the type arguments.  This is
29602         required to support "recursive" definitions; see mcs/tests/gen-23.cs
29603         for an example.
29604         (mono_type_create_from_typespec): Use a new `image->typespec_cache'
29605         to support recursive typespec entries.
29606
29607         * class.c (mono_class_setup_parent): If our parent is a generic
29608         instance, we may get called before it has its name set.
29609         (mono_class_from_generic): Splitted into
29610         mono_class_create_from_generic() and mono_class_initialize_generic().
29611
29612 2003-10-25  Martin Baulig  <martin@ximian.com>
29613
29614         * icall.c (ves_icall_Type_BindGenericParameters): Return a
29615         `MonoReflectionGenericInst *' instead of a `MonoReflectionType *'.
29616         ("System.Reflection.MonoGenericInst::inflate_method"): New interncall.
29617         ("System.Reflection.MonoGenericInst::inflate_ctor"): New interncall.
29618
29619         * reflection.c (my_mono_class_from_mono_type): Added MONO_TYPE_GENERICINST.
29620         (create_typespec): Likewise.
29621         (mono_reflection_bind_generic_parameters): Return a
29622         `MonoReflectionGenericInst *' instead of a `MonoClass *'.
29623         (mono_reflection_inflate_method_or_ctor): New public function.
29624
29625         * reflection.h (MonoReflectionGenericInst): New typedef.        
29626
29627 2003-10-24  Zoltan Varga  <vargaz@freemail.hu>
29628
29629         * object.c (mono_class_proxy_vtable): Run the whole vtable construction
29630         inside the domain lock. Fixes #49993.
29631         
29632         * object.c (mono_class_vtable): When typed allocation is used, 
29633         allocate vtables in the GC heap instead of in the mempool, since the
29634         vtables contain GC descriptors which are used by the collector even
29635         after the domain owning the mempool is unloaded.
29636
29637         * domain.c (mono_domain_set): Rename to mono_domain_set_internal.
29638
29639         * domain.c (mono_domain_unload): Rename to mono_domain_free to better
29640         reflect what it does. Also invalidate mempools instead of freeing
29641         them if a define is set.
29642
29643         * appdomain.h (MonoAppDomainState): New enumeration to hold the state
29644         of the appdomain.
29645         
29646         * appdomain.h (_MonoDomain): New field 'finalizable_object_hash' to
29647         hold the finalizable objects in this domain.
29648
29649         * appdomain.h (_MonoDomain): New field 'state' to hold the state of the
29650         appdomain.
29651
29652         * appdomain.c (mono_domain_set): New function to set the current
29653         appdomain, but only if it is not being unloaded.
29654
29655         * appdomain.c threads.c threadpool.c object.c: Avoid entering an
29656         appdomain which is being unloaded.
29657         
29658         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Prevent
29659         unloading of the root appdomain.
29660
29661         * appdomain.c (ves_icall_System_AppDomain_InternalInvokeInDomain): New
29662         icall to execute a method in another appdomain. Intended as a 
29663         replacement for InternalSetDomain, which can confuse the code 
29664         generation in the JIT.
29665
29666         * appdomain.c (mono_domain_is_unloading): New function to determine
29667         whenever an appdomain is unloading.
29668
29669         * appdomain.c (mono_domain_unload): New function to correctly unload
29670         an appdomain.
29671
29672         * assembly.c (mono_assembly_load_references): Check that an assembly
29673         does not references itself.
29674
29675         * gc.c (mono_domain_finalize): Rewrote so instead of finalizing a
29676         domain manually, it asks the finalizer thread to do it, then waits for
29677         the result. Also added a timeout.
29678
29679         * icall.c: Register the new icalls.
29680
29681         * threads.h threads.c: Export the mono_gc_stop_world and 
29682         mono_gc_start_world functions.
29683         
29684         * mempool.h mempool.c (mono_mempool_invalidate): New debugging 
29685         function to fill out the mempool with 0x2a.
29686
29687 2003-10-22  Zoltan Varga  <vargaz@freemail.hu>
29688
29689         * reflection.h (MonoReflectionMethodAux): New structure to store
29690         information which is rarely used, thus is not in the MonoMethod
29691         structure.
29692
29693         * reflection.h (MonoDynamicAssembly): New field 'method_aux_hash' to
29694         store the aux info.
29695
29696         * reflection.c (mono_methodbuilder_to_mono_method): Store param names
29697         and marshalling info into the aux structure.
29698
29699         * loader.c (mono_method_get_marshal_info): Retrieve the marshal info
29700         from the aux structure.
29701
29702         * loader.c (mono_method_get_param_names): Retrieve the param names from
29703         the aux structure.
29704         
29705 2003-10-21  Zoltan Varga  <vargaz@freemail.hu>
29706
29707         * exception.h exception.c: Add AppDomainUnloadedException && fix 
29708         warning.
29709
29710 2003-10-21  Dick Porter  <dick@ximian.com>
29711
29712         * socket-io.c
29713         (ves_icall_System_Net_Sockets_Socket_Select_internal): Applied
29714         patch from Laramie Leavitt moving divide out of loop. (Bug 45381).
29715
29716 2003-10-21  Martin Baulig  <martin@ximian.com>
29717
29718         * reflection.c (mono_reflection_bind_generic_parameters):
29719         `klass->parent' is NULL for interfaces.
29720
29721 2003-10-21  Martin Baulig  <martin@ximian.com>
29722
29723         * reflection.c (create_typespec): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
29724
29725 2003-10-20  Zoltan Varga  <vargaz@freemail.hu>
29726
29727         * exception.c (mono_exception_from_name_msg): New helper function for
29728         creating exceptions and initializing their message field.
29729
29730         * exception.c: Simplify functions using the new helper.
29731
29732         * exception.h exception.c (mono_get_exception_cannot_unload_appdomain):
29733         New function.
29734
29735         * object.h object.c: Remove G_GNUC_NORETURN from the signature of
29736         mono_raise_exception, since otherwise gcc doesn't generate the function
29737         epilog for raise_exception, confusing the stack unwinding in the JIT.
29738         Fixes #45043.
29739
29740         * rawbuffer.c (mono_raw_buffer_load_mmap): Map mmap-ed memory with
29741         PROT_EXEC. This seems to prevent segmentation faults on Fedora Linux.
29742         Fixes #49499.
29743
29744 2003-10-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29745
29746         * icall.c: OutputDebugStringW expects 16-bit unicode characters, not
29747         utf8.
29748
29749 2003-10-18  Lluis Sanchez Gual  <lluis@ximian.com>
29750
29751         * icall.c: Removed GetUninitializedObject method because
29752           AllocateUninitializedClassInstance does the same.
29753
29754 2003-10-18  Martin Baulig  <martin@ximian.com>
29755
29756         * class.c (inflate_generic_signature): Renamed to
29757         mono_class_inflate_generic_signature() and made it public.
29758         (my_mono_class_from_generic_parameter): New static function; if we
29759         don't already have the generic parameter's MonoClass, create a
29760         very simple one which is just used internally in the runtime and
29761         not passed back to managed code.
29762
29763         * class.h (MonoGenericInst): Added `gpointer mbuilder' field.
29764
29765         * metadata.h (MonoMethodSignature): Moved the
29766         `MonoGenericParam *gen_params' to the MonoMethodHeader.
29767         (MonoMethodHeader): Moved the `MonoGenericParam *gen_params' here.
29768
29769         * icall.c (ves_icall_MethodInfo_GetGenericArguments): Renamed to
29770         ves_icall_MonoMethod_GetGenericArguments(); this is now an
29771         interncall on the MonoMethod class, not on MethodInfo.
29772         (ves_icall_MethodInfo_BindGenericParameters): Removed, we're now
29773         calling mono_reflection_bind_generic_method_parameters() directly.
29774
29775         * loader.c (mono_method_get_signature): If this is a MethodSpec;
29776         return the already computed `method->signature'.
29777         (method_from_methodspec): New static function to load a method
29778         from a MethodSpec entry.
29779         (mono_get_method_from_token): Call the new method_from_methodspec()
29780         for MethodSpec tokens.  
29781         (mono_get_method_from_token): If we're a generic method, load the
29782         type parameters.
29783
29784         * reflection.c (mono_image_get_memberref_token): Allow
29785         MEMBERREF_PARENT_TYPEDEF here; this will be used in the MethodSpec
29786         table.
29787         (fixup_method): Added support for MONO_TABLE_METHODSPEC.
29788         (mono_image_create_token): First check whether it's a generic
29789         method (so we'd need to create a MethodSpec), then do the other
29790         two alternatives.
29791         (mono_reflection_bind_generic_method_parameters): Return a
29792         `MonoReflectionMethod *' instead of a `MonoMethod *'; we're now
29793         called directly from the interncall.
29794
29795 2003-10-17  Zoltan Varga  <vargaz@freemail.hu>
29796
29797         * reflection.c (load_public_key): Move loading of the public key
29798         into managed code.
29799
29800         * image.h (MonoAssemblyName): Add public_key and hash_alg fields.
29801
29802         * assembly.c (mono_assembly_open): Fill in public_key and hash_alg
29803         fields.
29804
29805         * icall.c (ves_icall_System_Reflection_Assembly_FillName): Fill in
29806         culture, hash_alg and public_key. Fixes #49555.
29807
29808 2003-10-17  Martin Baulig  <martin@ximian.com>
29809
29810         * class.h (MonoGenericInst): Moved this declaration here and added
29811         `MonoMethod *generic_method'.
29812
29813         * icall.c
29814         (ves_icall_MethodInfo_GetGenericArguments): New interncall.
29815         (ves_icall_MethodInfo_BindGenericParameters): New interncall.
29816
29817         * metadata.c (mono_metadata_type_equal): Two types of
29818         MONO_TYPE_VAR or MONO_TYPE_MVAR equals if they have the same
29819         index; ie. don't compare the address of the `MonoGenericParam'
29820         structure.
29821         (mono_metadata_load_generic_params): Removed the `MonoMethod
29822         *method' argument.
29823
29824         * metadata.h (MonoGenericInst): Moved declaration to class.h.
29825         (MonoMethodHeader): Added `MonoGenericInst *geninst'.
29826
29827         * reflection.c (method_encode_signature): Encode the number of
29828         generic parameters.
29829         (encode_generic_method_sig): New static function.
29830         (method_encode_methodspec): New static function; creates an entry
29831         in the MethodSpec table for a generic method.
29832         (mono_image_get_methodspec_token): New static function.
29833         (mono_image_create_token): Call mono_image_get_methodspec_token()
29834         for generic methods.
29835         (mono_reflection_bind_generic_method_parameters): New public
29836         function.  Instantiates a generic method.
29837
29838 2003-10-16  Martin Baulig  <martin@ximian.com>
29839
29840         * metadata.h (MonoMethodSignature): Moved `MonoGenericParam
29841         *gen_params' here from MonoMethodHeader.
29842
29843         * metadata.c (mono_metadata_parse_method_signature): If we have
29844         generic parameters, initialize `method->gen_params' and then set
29845         the correct `type->data.generic_param' in all the parameters.
29846
29847 2003-10-16  Zoltan Varga  <vargaz@freemail.hu>
29848
29849         * threads.c (mono_threads_get_default_stacksize): New function to 
29850         return the default stacksize.
29851
29852         * gc.c (mono_gc_cleanup): Use a separate event for waiting for the
29853         termination of the finalizer thread, since the previous method had
29854         race conditions. Fixes #49628.
29855
29856         * gc.c (mono_gc_init): Use the same stacksize for the finalizer thread
29857         as for the other managed threads.
29858
29859 2003-10-16  Martin Baulig  <martin@ximian.com>
29860
29861         * class.c (inflate_generic_signature): Copy `generic_param_count'
29862         and `gen_params'.
29863
29864         * icall.c (ves_icall_MethodInfo_get_IsGenericMethodDefinition):
29865         New interncall.
29866
29867         * metadata.c (mono_metadata_parse_method_signature): Actually set
29868         the `method->generic_param_count' here.
29869         (mono_metadata_load_generic_params): Initialize `pklass' to NULL.
29870
29871 2003-10-15  Zoltan Varga  <vargaz@freemail.hu>
29872
29873         * object.h: Add a new field to TypedRef to simplify the implementation
29874         of the REFANY opcodes in the JIT.
29875
29876         * icall.c: Make use of the new field.
29877
29878         * metadata.c (mono_type_size): Compute the size of TYPEDBYREF types
29879         dynamically.
29880
29881 2003-10-15  Martin Baulig  <martin@ximian.com>
29882
29883         * class.c (mono_class_from_gen_param): Renamed to
29884         mono_class_from_generic_parameter() and moved most of the
29885         functionality from mono_reflection_define_generic_parameter()
29886         here; ie. we create a "real" class here.
29887         (mono_class_from_mono_type): Only allow MONO_TYPE_VAR and
29888         MONO_TYPE_MVAR if mono_class_from_generic_parameter() has
29889         previously been called.
29890
29891         * class.h (MonoGenericParam): Moved the declaration of this struct
29892         here from metadata.h and added `MonoMethod *method'.
29893
29894         * icall.c (ves_icall_MonoType_get_DeclaringMethod): New
29895         interncall.
29896
29897         * loader.c (mono_get_method_from_token): If we have any generic
29898         parameters, call mono_metadata_load_generic_params() to read them
29899         from the MONO_TABLE_GENERICPAR.
29900
29901         * metadata.c (mono_metadata_load_generic_params): Added
29902         `MonoMethod *method' argument which is used MONO_TYPE_MVAR.
29903
29904         * metadata.h (MonoMethodSignature): Replaced
29905         `MonoGenericInst *geninst' with `guint16 generic_param_count'.
29906         (MonoMethodHeader): Added `MonoGenericParam *gen_params'.
29907
29908         * reflection.c (mono_reflection_define_generic_parameter): Moved
29909         most of the functionality into the new
29910         mono_class_from_generic_parameter(); set the `method' field if
29911         we're a method parameter.       
29912
29913 2003-10-13 Bernie Solomon  <bernard@ugsolutions.com>
29914
29915         * marshal.c (emit_struct_conv): if native size is 0
29916         emit no code.
29917
29918 2003-10-14  Martin Baulig  <martin@ximian.com>
29919
29920         * icall.c: The generics API has changed in the spec since it was
29921         added to System.Type; these modifications make it match the spec
29922         again.
29923         (ves_icall_Type_GetGenericParameters): Renamed to
29924         `ves_icall_Type_GetGenericArguments'.
29925         (ves_icall_Type_get_IsGenericTypeDefinition): New interncall.
29926         (ves_icall_MonoType_get_HasGenericParameteres): Renamed to
29927         `ves_icall_MonoType_get_HasGenericArguments'.
29928         (ves_icall_MonoType_get_IsUnboundGenericParameter): Renamed to
29929         `ves_icall_MonoType_get_IsGenericParameter'.
29930         (ves_icall_MonoType_get_HasUnboundGenericParameters): Removed;
29931         this is no interncall anymore.
29932         (ves_icall_TypeBuilder_get_IsUnboundGenericParameter): Renamed to
29933         `ves_icall_TypeBuilder_get_IsGenericParameter'.
29934
29935 2003-10-14  Martin Baulig  <martin@ximian.com>
29936
29937         * reflection.c (mono_reflection_bind_generic_parameters): Also
29938         inflate generic methods if we're reading the class from IL.
29939
29940 2003-10-13  Martin Baulig  <martin@ximian.com>
29941
29942         * reflection.c (mono_reflection_define_generic_parameter): This
29943         method isn't called directly from the icall anymore; take a
29944         `MonoReflectionAssemblyBuilder *' so we can use this for type and
29945         method generic parameters.
29946         (ReflectionMethodBuilder): Added `MonoArray *generic_param'.
29947         (method_builder_encode_signature): Encode generic parameters.
29948         (mono_image_get_method_info): Write generic params to the
29949         MONO_TABLE_GENERICPARAM table.
29950
29951         * reflection.h (MonoReflectionMethodBuilder): Added
29952         `MonoArray *generic_params'.
29953
29954         * metadata.h (MonoMethodSignature): Added `MonoGenericInst *geninst'.
29955
29956         * icall.c (ves_icall_TypeBuilder_define_generic_parameter): Added
29957         wrapper for mono_reflection_define_generic_parameter().
29958         (ves_icall_MethodBuilder_define_generic_parameter): Likewise.   
29959
29960 2003-10-13  Zoltan Varga  <vargaz@freemail.hu>
29961
29962         * marshal.h: Add missing function to fix build.
29963
29964         * marshal.c (mono_marshal_get_native_wrapper): Add support for 
29965         the SetLastError pinvoke attribute.
29966
29967         * marshal.c (mono_marshal_set_last_error): New helper function called
29968         by the generated code.
29969         
29970         * marshal.c (mono_mb_emit_branch): New helper function.
29971
29972         * marshal.c (mono_mb_emit_exception): Added exception name parameter.
29973
29974         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
29975         classes as parameters and return values of delegates. Fixes #29256. 
29976
29977 2003-10-12  Bernie Solomon  <bernard@ugsolutions.com>
29978
29979         * locales.c: use gint32 in non HAVE_ICU case
29980
29981 2003-10-11  Martin Baulig  <martin@ximian.com>
29982
29983         * mono-debug.c (mono_debug_add_method): Added a workaround for
29984         bug #48591.
29985
29986 2003-10-10  Zoltan Varga  <vargaz@freemail.hu>
29987
29988         * marshal.c (mono_marshal_get_managed_wrapper): Under windows,
29989         delegates passed to native code must use the STDCALL calling 
29990         convention. Fixes #35987.
29991
29992 2003-10-10  Martin Baulig  <martin@ximian.com>
29993
29994         * class.c (inflate_generic_type): If we're inflating for a generic
29995         type instance (and not for a generic method), return
29996         MONO_TYPE_MVAR unchanged.
29997
29998 2003-10-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
29999
30000         * string-icalls.c: Join ignores null strings in the source array.
30001         * threadpool.[ch]: export busy_worker_threads, not mono_worker_threads.
30002         * threads.c: GetAvailableTheads is slightly more accurate.
30003
30004 2003-10-09  Bernie Solomon  <bernard@ugsolutions.com>
30005
30006         * threads.h threads.c : add mono_threads_set_default_stacksize
30007         and pass default to CreateThread calls.
30008
30009 2003-10-09  Dick Porter  <dick@ximian.com>
30010
30011         * icall.c:
30012         * locales.h:
30013         * locales.c: Internal calls for constructing CultureInfo and
30014         related objects from libicu (if its available.)
30015
30016 2003-10-09  Zoltan Varga  <vargaz@freemail.hu>
30017
30018         * debug-helpers.c (wrapper_type_names): Add 'unknown' wrapper type.
30019
30020 2003-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30021
30022         * threadpool.c: added an argument to async_invoke_thread that is the
30023         item to process, pass the MonoAsyncResult to the thread start function
30024         when creating a new thread. This way we don't need to acquire any lock
30025         when we're creating a new thread. Readded a semaphore for faster
30026         response times (instead of that Sleep i added).
30027
30028 2003-10-08  Bernie Solomon  <bernard@ugsolutions.com>
30029
30030         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
30031         get daylight change dates better on Windows, fix handling
30032         of platforms without tm_gmtoff.
30033
30034 2003-10-06  Martin Baulig  <martin@ximian.com>
30035
30036         * class.c (inflate_generic_method): Renamed to
30037         mono_class_inflate_generic_method() and made public.
30038         (mono_class_init): Don't inflate the generic methods here.
30039         (mono_class_from_generic): Added `gboolean inflate_methods'
30040         argument.  Inflate the methods here.
30041
30042         * loader.c (mono_method_get_param_names): Ignore instances of
30043         generic types for the moment.
30044
30045         * reflection.c (fixup_method): Added support for inflated methods.
30046         (mono_image_create_token): Use mono_image_get_methodref_token()
30047         for inflated methods.
30048         (mono_custom_attrs_from_param): Ignore instances of generic types
30049         for the moment.
30050         (mono_reflection_bind_generic_parameters): New public function.
30051         Moved all the functionality from
30052         ves_icall_Type_BindGenericParameters() here and added support for
30053         dynamic types.
30054         (mono_reflection_define_generic_parameter): Initialize
30055         `klass->methods' here.
30056
30057         * icall.c (ves_icall_Type_BindGenericParameters): Moved all the
30058         functionality into mono_reflection_define_generic_parameter().
30059         (ves_icall_Type_GetGenericTypeDefinition): If we're coming from a
30060         TypeBuilder, return that TypeBuilder.
30061
30062 2003-10-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30063
30064         * appdomain.c: removed mono_delegate_semaphore.
30065
30066         * threadpool.c:
30067         (mono_thread_pool_add): moved hash table creation inside and the thread 
30068         creation outside of the critical region.
30069         (mono_thread_pool_finish): removed obsolete code.
30070         (async_invoke_thread): don't use the semaphore. Use a plain Sleep and
30071         continue or exit the thread depending on the queue.
30072
30073 2003-10-07  Bernie Solomon  <bernard@ugsolutions.com>
30074
30075         * metadata.c (mono_type_to_unmanaged): allow bools to marshal as I1
30076         marshal.c (emit_ptr_to_str_conv & mono_marshal_get_native_wrapper):
30077         handle more bool marshalling options
30078
30079 2003-10-07  Zoltan Varga  <vargaz@freemail.hu>
30080
30081         * marshal.c (mono_marshal_get_native_wrapper): Fix marshalling of
30082         arrays of structs. Also add a more descriptive error message when
30083         a structure member is marshalled as LPArray.
30084
30085 2003-10-06  Zoltan Varga  <vargaz@freemail.hu>
30086
30087         * marshal.c (mono_marshal_get_native_wrapper): Add support for
30088         marshalling arrays of complex types. Fixes #29098. Also remove an
30089         usused and incomplete function.
30090
30091 Mon Oct 6 15:38:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
30092
30093         * gc.c: report heap_size - free_bytes as total memory allocated
30094         (bug#49362).
30095
30096 2003-10-05  Zoltan Varga  <vargaz@freemail.hu>
30097
30098         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Finally 
30099         fix timezone handling problems on Windows.
30100         
30101         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Avoid
30102         asserts when the year is outside the range handled by ms the functions.
30103
30104         * class.c (setup_interface_offsets): If the class is an interface,
30105         fill out its interface_offsets slot.
30106
30107 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30108
30109         * threadpool.c: mark threadpool threads as background.
30110
30111 2003-10-03  Bernie Solomon  <bernard@ugsolutions.com>
30112
30113         * decimal.c - define DECINLINE to nothing if not using GCC
30114
30115 2003-10-03  Zoltan Varga  <vargaz@freemail.hu>
30116
30117         * assembly.c: More refcount fixes.
30118
30119 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30120
30121         * string-icalls.c: if we're not trimming, return the same string.
30122         When not splitting, don't create a new string.
30123
30124 2003-10-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30125
30126         * image.c:
30127         (mono_image_open): increment the ref_count inside the critical section.
30128
30129 2003-10-02  Zoltan Varga  <vargaz@freemail.hu>
30130
30131         * image.c (mono_image_open): Fix reference counting bug.
30132
30133 2003-09-30  Bernie Solomon  <bernard@ugsolutions.com>
30134
30135         * marshal.c (mono_marshal_type_size) struct alignment changed for 
30136         64bit machines.  (emit_ptr_to_str_conv) Fix bool conversions for 
30137         64bits. Avoid leak in mono_marshal_get_native_wrapper when
30138         mono_lookup_pinvoke_call throws.        
30139
30140 2003-09-30  Zoltan Varga  <vargaz@freemail.hu>
30141
30142         * reflection.c (mono_reflection_parse_type): Fix #49114.
30143
30144         * file-io.c (ves_icall_System_IO_MonoIO_GetFileAttributes): Add
30145         temporary workaround for cygwin header problem.
30146
30147         * object.c (mono_object_isinst): Synchronize this with the code
30148         generated by the JIT for casts.
30149
30150 2003-09-29  Zoltan Varga  <vargaz@freemail.hu>
30151
30152         * reflection.c (encode_type): Fix #38332.
30153
30154 2003-09-26  Zoltan Varga  <vargaz@freemail.hu>
30155
30156         * marshal.c (mono_marshal_method_from_wrapper): New function to return
30157         the original method from the wrapper method.
30158
30159 2003-09-25  Martin Baulig  <martin@ximian.com>
30160
30161         * icall.c (ves_icall_Type_IsGenericTypeDefinition): Removed this
30162         interncall since it was identical to `Type.GetGenericTypeDefinition()'.
30163         (ves_icall_Type_get_IsGenericInstance): New interncall.
30164
30165 2003-09-24 Bernie Solomon <bernard@ugsolutions.com>
30166
30167         * object.c: fix cast warning in big endian code.
30168
30169 2003-09-19 Jackson Harper <jackson@latitudegeo.com>
30170
30171         * icall.c: Timezone patch from Zoltan Varga (vargaz@freemail.hu)
30172         
30173 2003-09-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30174
30175         * assembly.c: don't call check_env from mono_assembly_load. It's
30176         already done once in mono_assemblies_init and may cause headaches when
30177         multiple threads are loading assemblies.
30178
30179 2003-09-19  Martin Baulig  <martin@ximian.com>
30180
30181         * reflection.c (mono_reflection_define_generic_parameter): Don't
30182         allocate `klass->methods', set `klass->flags' to
30183         TYPE_ATTRIBUTE_INTERFACE, not TYPE_ATTRIBUTE_ABSTRACT.
30184
30185 2003-09-18  Martin Baulig  <martin@ximian.com>
30186
30187         * class.c (mono_class_init): Don't create `class->methods' if it's
30188         already initialized.
30189
30190         * metadata.c (mono_metadata_load_generic_params): Make this
30191         actually work.
30192
30193         * reflection.c (mono_reflection_define_generic_parameter): Set
30194         parent class and interfaces from the constraints.
30195
30196         * reflection.h (MonoReflectionGenericParam): Added `guint32 flags'
30197         to keep this struct in sync with the declaration in TypeBuilder.cs.
30198
30199 2003-09-17  Martin Baulig  <martin@ximian.com>
30200
30201         * metadata.h (MonoType): Replaced the data's `int type_param'
30202         field with `MonoGenericParam *generic_param'.
30203         (MonoGenericParam): Added `MonoClass *klass'.
30204
30205         * class.c (mono_class_from_gen_param): Removed the
30206         `MonoImage *image' and `int type_num' arguments.
30207
30208         * metadata.c (mono_metadata_parse_generic_param): New static
30209         method; creates a MonoGenericParam which just contains the index.
30210         (do_mono_metadata_parse_type): Call
30211         mono_metadata_parse_generic_param() for MONO_TYPE_VAR and
30212         MONO_TYPE_MVAR.
30213
30214         * reflection.c (mono_image_typedef_or_ref): Generic type
30215         parameters may be in the same assembly, but never use a typedef
30216         for them.
30217         (mono_reflection_define_generic_parameter): We're now creating a
30218         "real" class for the type parameter; it's now safe to call
30219         mono_class_from_mono_type() on the class'es type, it'll do the
30220         right thing.
30221
30222 2003-09-16  Martin Baulig  <martin@ximian.com>
30223
30224         * mono-debug-debugger.c (allocate_symbol_file_entry): Initialize
30225         `symfile->range_entry_size' and `symfile->class_entry_size' here;
30226         the `symfile' data structure must be fully initialized before it
30227         gets added to the table.
30228
30229 2003-09-15  Zoltan Varga  <vargaz@freemail.hu>
30230
30231         * icall.c (ves_icall_Type_IsArrayImpl): Added MONO_ARCH_SAVE_REGS.
30232
30233         * appdomain.h domain.c (MonoDomain): Added new hashtable to store the
30234         class init trampolines.
30235
30236 2003-09-11  Zoltan Varga  <vargaz@freemail.hu>
30237
30238         * profiler.c (mono_profiler_load): Added '-time' and '-alloc' options
30239         to the built-in profiler to turn off time and allocation profiling
30240         respectively.
30241
30242 2003-09-10  Zoltan Varga  <vargaz@freemail.hu>
30243
30244         * profiler.c (mono_profiler_coverage_alloc): Use NULL instead of
30245         g_direct_equal.
30246
30247         * debug-helpers.c (mono_method_full_name): Print the wrapper type
30248         in human readable form.
30249
30250 2003-09-08  Zoltan Varga  <vargaz@freemail.hu>
30251
30252         * reflection.c icall.c: Fixed warnings.
30253
30254         * image.c (load_class_names): Use a temporary hash table to hold the
30255         namespaces in order to avoid doing many string comparisons.
30256
30257         * image.h: Fix typo.
30258
30259         * image.c class.c rawbuffer.c reflection.c threads.c verify.c domain.c:
30260         Pass NULL instead of g_direct_equal to the GHashTable constructor 
30261         since the NULL case is short-circuited inside g_hash_table_lookup, 
30262         leading to better performance.  
30263
30264         * metadata.c (mono_metadata_custom_attrs_from_index): New function to
30265         obtain the first custom attribute for a given index. Depends on the
30266         CustomAttribute table being sorted by the parent field.
30267
30268         * reflection.c (mono_custom_attrs_from_index): Use the new function 
30269         for better performance.
30270
30271 2003-09-07  Martin Baulig  <martin@ximian.com>
30272
30273         * class.c (mono_class_init): If we're a generic instance, inflate
30274         all our methods instead of loading them from the image.
30275         (mono_class_from_generic): Set `class->methods = gklass->methods'.
30276
30277 2003-09-07  Martin Baulig  <martin@ximian.com>
30278
30279         * mono-debug-debugger.c: Added support for constructors.
30280
30281 2003-09-06  Martin Baulig  <martin@ximian.com>
30282
30283         * icall.c (ves_icall_TypeBuilder_get_IsUnboundGenericParameter):
30284         New interncall.
30285
30286         * reflection.c (mono_reflection_setup_generic_class): Call
30287         ensure_runtime_vtable() to create the vtable.
30288
30289 2003-09-05  Martin Baulig  <martin@ximian.com>
30290
30291         * class.c (mono_class_array_element_size): Added MONO_TYPE_VAR and
30292         MONO_TYPE_MVAR.
30293
30294 2003-09-04  Martin Baulig  <martin@ximian.com>
30295
30296         * reflection.c (mono_reflection_define_generic_parameter): Generic
30297         parameters start with zero.
30298
30299 2003-09-04  Martin Baulig  <martin@ximian.com>
30300
30301         * metadata.c (mono_type_size): Added MONO_TYPE_VAR and MONO_TYPE_MVAR.
30302
30303         * reflection.h (MonoReflectionGenericParam): New typedef.
30304         (MonoReflectionTypeBuilder): Added `generic_params' fields to get
30305         the generic parameters from the managed TypeBuilder.
30306
30307         * reflection.c (mono_reflection_define_generic_parameter): New function.
30308         (mono_reflection_create_runtime_class): Encode generic parameters.
30309         (mono_reflection_setup_generic_class): New function; this is
30310         called after adding adding all generic params to the TypeBuilder.
30311         (encode_type): Added MONO_TYPE_VAR.
30312
30313 2003-09-04  Zoltan Varga  <vargaz@freemail.hu>
30314
30315         * class.h class.c (mono_class_needs_cctor_run): Moved this method
30316         here from the JIT.
30317
30318         * assembly.h assembly.c: Moved the AOT loading code into an assembly
30319         load hook.
30320
30321 2003-09-03  Zoltan Varga  <vargaz@freemail.hu>
30322
30323         * reflection.h reflection.c class.h class.c: Delete duplicate 
30324         definition of mono_type_get_name () from reflection.c and export the
30325         one in class.c.
30326
30327         * class.c: Class loading fixes from Bernie Solomon 
30328         (bernard@ugsolutions.com).
30329
30330         * reflection.c: Endianness fixes from Bernie Solomon 
30331         (bernard@ugsolutions.com).
30332         
30333 2003-09-01  Zoltan Varga  <vargaz@freemail.hu>
30334
30335         * assembly.h assembly.c: Define a file format version for AOT
30336         libraries.
30337         
30338         * assembly.c (mono_assembly_open): Fix leaking of MonoImage-s.
30339
30340         * appdomain.h (MonoJitInfo): New field to determine whenever the
30341         code is domain neutral.
30342         
30343 2003-08-31  Miguel de Icaza  <miguel@ximian.com>
30344
30345         * marshal.c (emit_struct_conv): Add MONO_TYPE_CHAR
30346
30347 2003-08-30  Zoltan Varga  <vargaz@freemail.hu>
30348
30349         * icall.c (ves_icall_System_Web_Util_ICalls_get_machine_install_dir): 
30350         (ves_icall_System_Configuration_DefaultConfig_get_machine_config_path):
30351         Avoid caching the result since strings must be domain specific. Fixes
30352         #48050.
30353
30354 2003-08-29  Zoltan Varga  <vargaz@freemail.hu>
30355
30356         * marshal.c (mono_marshal_init): Make this callable multiple times
30357         since it is hard to find a correct place to call it.
30358
30359         * object.c (mono_runtime_class_init): Execute static constructors in
30360         the correct appdomain.
30361
30362         * image.c (build_guid_table): Handle the case when multiple images have
30363         the same GUID.
30364
30365 2003-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30366
30367         * icall.c: added a couple of icalls for System.Web.
30368
30369 2003-08-28  Martin Baulig  <martin@ximian.com>
30370
30371         * icall.c (ves_icall_Type_BindGenericParameters): Use
30372         `klass->generic_inst' instead of `&klass->byval_arg' in the
30373         mono_type_get_object() call.  The returned type must be
30374         MONO_TYPE_GENERICINST and not MONO_TYPE_CLASS.
30375
30376 2003-08-27  Zoltan Varga  <vargaz@freemail.hu>
30377
30378         * NOTES: New file.
30379
30380         * object.c (mono_class_proxy_vtable): Make it thread safe.
30381
30382         * pedump.c: Fix warning.
30383
30384         * object.c appdomain.h: Get rid of metadata_section. 
30385         It is no longer needed and it was causing deadlocks with domain->lock.
30386
30387         * appdomain.c (add_assemblies_to_domain): Make it thread safe.
30388
30389 2003-08-26  Martin Baulig  <martin@ximian.com>
30390
30391         * pedump.c (main): Don't call mono_image_close() if `verify_pe'.
30392
30393 2003-08-26  Martin Baulig  <martin@ximian.com>
30394
30395         * pedump.c (main): Call mono_metadata_init(),
30396         mono_raw_buffer_init(), mono_images_init(), mono_assemblies_init()
30397         and mono_loader_init().
30398
30399 2003-08-26  Zoltan Varga  <vargaz@freemail.hu>
30400
30401         * loader.h: Add missing include to fix build.
30402
30403         * image.h: mono_image_load_references is no more.
30404
30405         * assembly.c: Reworked assembly loading to make it really thread safe.
30406         After these changes, the assembly returned by mono_assembly_open is
30407         fully initialized, i.e. all its references assemblies are loaded.
30408
30409         * assembly.c (mono_image_load_references): Renamed to 
30410         mono_assembly_load_references, and made private, since clients no
30411         longer need to call it.
30412
30413         * class.c: Removed calls to mono_assembly_load_references, since it was
30414         a source of deadlocks.
30415
30416         * loader.h loader.c class.h class.c: Protect data structures using a 
30417         new lock, the loader lock.
30418
30419         * class.c (mono_class_setup_vtable): Create temporary hash tables and
30420         GPtrArrays only when needed.
30421
30422         * class.c (mono_class_layout_fields): Ignore the dummy field inserted 
30423         into empty structures by mcs. Fixes pinvoke7.cs.
30424         
30425         * domain.c (mono_init): Call a new initialization function.
30426
30427         * appdomain.c (mono_runtime_init): Call the new initializer function
30428         of the marshal module.
30429
30430         * marshal.c (mono_marshal_load_type_info): Ignore the dummy field
30431         inserted into empty structures by mcs. Fixes pinvoke7.cs.
30432
30433         * marshal.h marshal.c: Added locks around the wrapper caches to make
30434         this module thread safe.
30435
30436         * icall.c (ves_icall_InternalInvoke): Method wrappers doesn't require a
30437         this argument. Fixes pinvoke1.exe.
30438
30439 2003-08-25  Lluis Sanchez <lluis@ximian.com>
30440
30441         * object.h: Added call_type field to MonoMethodMessage and the corresponding
30442         enumeration of values. Removed fields to store remote call output values in
30443         MonoAsyncResult. Not needed any more.
30444         * object.c: Initialize call_type and async_result fields in mono_message_init.
30445         * marshal.c: mono_delegate_begin_invoke(): for proxies, set call_type before
30446         dispatching the message.
30447         mono_delegate_end_invoke (): delegate to the proxy the work of waiting for the
30448         async call to finish. To do it use a message with EndInvoke call type.
30449
30450 2003-08-25  Zoltan Varga  <vargaz@freemail.hu>
30451
30452         * loader.h loader.c (mono_method_hash_marhal_info): New function which
30453         determines whenever a method has marshalling info.
30454
30455 2003-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30456
30457         * assembly.c: fix the build on windows.
30458
30459 2003-08-22 Lluis Sanchez <lluis@ximian.com>
30460
30461         * object.cs: Fixed bug #47785.
30462
30463 2003-08-22 Jackson Harper <jackson@latitudegeo.com>
30464
30465         * string-icalls.c (StringReplace): If their are no occurances of
30466         the old string found return a reference to the supplied
30467         string. This saves some memory and matches MS behavoir.
30468         
30469 2003-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30470
30471         * socket-io.c: fixed compilation for systems that define AF_INET6
30472         and don't define SOL_IP/SOL_IPV6.
30473
30474 2003-08-21  Zoltan Varga  <vargaz@freemail.hu>
30475
30476         * object.c (mono_object_isinst): Fix casts to TransparentProxy in
30477         the interpreter. Patch by Bernie Solomon (bernard@ugsolutions.com).
30478
30479         * rawbuffer.c rawbuffer.h: Make this module thread safe.
30480
30481         * domain.c: Make this module thread safe.
30482
30483         * domain.c (mono_init): Call new initialization function.
30484
30485         * icall.c (ves_icall_System_Array_SetValueImpl): Check types for
30486         reference types too. Fixes #38812.
30487
30488         * image.c (mono_image_init): Fixed warnings.
30489
30490         * class.c (mono_class_from_typeref): Handle assembly load failure
30491         correctly.
30492
30493         * appdomain.c (add_assemblies_to_domain): Handle the case when
30494         the references of an assembly are not yet loaded.
30495
30496         * metadata.c image.c assembly.c: Moved initialization of global
30497         variables to a separate function called at startup since lazy 
30498         initialization of these variables is not thread safe.
30499         
30500         * image.c assembly.c: Made this module thread safe by adding locks in 
30501         the appropriate places.
30502
30503         * domain.c (mono_init): Call the new initialization functions of the
30504         three modules.
30505
30506 2003-08-20  Lluis Sanchez Gual  <lluis@ximian.com>
30507
30508         * marshal.c: mono_delegate_begin_invoke(): If the target is a proxy,
30509           make a direct call. It is proxy's work to make the call asynchronous.
30510           mono_delegate_end_invoke(): If the targe is a proxy, just collect
30511           the return values.
30512         * object.cs: mono_method_call_message_new(): read AsyncResult and
30513           state object from parameters list, if this info is requested.
30514         * object.h: Added fields to store remote call output values in
30515           MonoAsyncResult. Added AsyncResult field in MonoMethodMessage.
30516
30517 Wed Aug 20 12:57:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30518
30519         * object.h: add needed fields to MonoThread.
30520         * threads.c, threads.h: allow registering a function to cleanup data
30521         allocated per thread by the JIT.
30522
30523 Tue Aug 19 18:22:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30524
30525         * loader.h: portability fix by Bernie Solomon
30526         * <bernard@ugsolutions.com>.
30527
30528 2003-08-16  Zoltan Varga  <vargaz@freemail.hu>
30529
30530         * reflection.h reflection.c (mono_param_get_objects): Changed this to 
30531         return a MonoArray. This simplifies the code and also ensures that
30532         the cache allways contains an object reference as a value.
30533
30534         * icall.c (ves_icall_get_parameter_info): Simplified using the new
30535         function.
30536
30537 2003-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30538
30539         * socket-io.c: patch by Bernie Solomon <bernard@ugsolutions.com> that
30540         fixes a problem with byte ordering when getting the address family for
30541         a socket.
30542
30543 2003-08-15  Zoltan Varga  <vargaz@freemail.hu>
30544
30545         * .cvsignore: Added monosn.
30546
30547         * reflection.h reflection.c loader.c: Added support for parameter
30548         marshalling to dynamically created types. Fixes #47295.
30549
30550 Fri Aug 15 11:42:46 CEST 2003 Paolo Molaro <lupus@ximian.com>
30551
30552         * rand.c: remove useless warnings.
30553
30554 Wed Aug 13 15:49:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30555
30556         * class.c: implemented ldtoken for methods and fieldrefs.
30557
30558 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30559
30560         * threadpool.c: when mono_async_invoke was called, no one took care of
30561         monitoring the queue. So if the method invoked took some time and we
30562         got new async invoke requests after 500 ms (the thread created waited
30563         that long in WaitForSingleObject), the new async invoke was not called
30564         until the previous one finished.
30565
30566         This is fixed now. Thanks to Totte for helping with it.
30567
30568 2003-08-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30569
30570         * threadpool.c: set threadpool_thread to TRUE. Patch by totte.
30571
30572 2003-08-11  Martin Baulig  <martin@ximian.com>
30573
30574         * mono-debug-debugger.c (mono_debugger_lookup_type): New function.
30575
30576 2003-08-06  Martin Baulig  <martin@ximian.com>
30577
30578         * mono-debug-debugger.c: Added support for static fields,
30579         properties and methods.
30580
30581 2003-08-06  Martin Baulig  <martin@ximian.com>
30582
30583         * mono-debug-debugger.c: Don't store the MonoString's vtable to
30584         make this work for applications with multiple application domains.
30585
30586 2003-08-04  Martin Baulig  <martin@ximian.com>
30587
30588         * mono-debug-debugger.c: Completely reworked the type support; the
30589         most important thing is that we're now just using one single
30590         `MonoType' instance per type.
30591
30592 Sat Aug  2 13:05:27 BST 2003 Malte Hildingson <malte@amy.udd.htu.se>
30593
30594         * mono-endian.h, mono-endian.c, icall.c: Added icall
30595         ves_icall_System_Double_AssertEndianity to assert double word endianity
30596         on ARM (FPA). The icall uses a macro defined in mono-endian.h.
30597
30598 Fri Aug 1 16:51:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30599
30600         * class.c, class.h, reflection.c, metadata.c, icall.c: more generics
30601         support, icalls and fixes.
30602
30603 2003-07-31  Miguel de Icaza  <miguel@ximian.com>
30604
30605         * unicode.c (ves_icall_System_Char_IsPunctuation): The set of
30606         classes that are a punctuation character in .NET is not the same a
30607         g_unichar_ispunct.
30608
30609 Tue Jul 29 18:07:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
30610
30611         * socket-io.c: ipv6 portability fixes from Felix Ortga (guile@lared.es).
30612
30613 2003-07-29  Miguel de Icaza  <miguel@ximian.com>
30614
30615         * icall.c: Add new MemCopy internalcall.
30616         (ves_icall_System_Reflection_Assembly_GetManifestResourceInternal):
30617         Simplified code; It is not necessary to handle all the cases here,
30618         as the C# code takes care of it.  Only handle the case of the name
30619         resource embedded into the assembly.
30620
30621         Changed signature to return the data pointer and the size of the
30622         data. 
30623
30624 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
30625
30626         * reflection.c (mono_image_get_method_info): Allow for 0x40 to be
30627         encoded.        (Partition II.22.1.7: PInvokeAttribute:SupportsLastErr).
30628
30629 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30630
30631         * socket-io.c: ignore EINTR error in select.
30632
30633 Tue Jul 29 15:25:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
30634
30635         * class.h, class.c: removed unused subclasses field in MonoClass.
30636
30637 2003-07-29  Lluis Sanchez Gual  <lluis@ximian.com>
30638
30639         * icall.c: improve fix of get_base_definition(). If the parent class
30640           doesn't have the mehod, look at the parent of the parent.
30641         * object.c: mono_message_init(): use the attribute PARAM_ATTRIBUTE_OUT
30642           to check if a parameter is an in or out parameter
30643           (PARAM_ATTRIBUTE_IN is not set by default).
30644           mono_method_return_message_restore(): Use mono_class_value_size to
30645           get the size of a value type. mono_type_stack_size (parameterType)
30646           does not return the correct value if parameterType is byRef.
30647           mono_load_remote_field(), mono_load_remote_field_new(),
30648           mono_store_remote_field(), mono_store_remote_field_new():
30649           raise exception if the remote call returns an exception.
30650
30651 2003-07-28  Martin Baulig  <martin@ximian.com>
30652
30653         * mono-debug-debugger.c (mono_debugger_runtime_invoke): New
30654         method.  This is a wrapper around mono_runtime_invoke() which
30655         boxes the instance object if neccessary.
30656
30657 Fri Jul 25 19:14:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30658
30659         * class.c, class.h, image.c, image.h, loader.c, metadata.c,
30660         metadata.h, row-indexes.h, verify.c: first cut of generics support.
30661
30662 Thu Jul 24 11:34:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30663
30664         * icall.c: disable mcs bug workaround.
30665
30666 2003-07-21  Miguel de Icaza  <miguel@ximian.com>
30667
30668         * object.c (mono_runtime_class_init): Take the metadata_section
30669         mutex before obtaining the domain mutex.
30670
30671         * appdomain.h: Added definition of metadata_section mutex here. 
30672
30673         * object.c: define metadata_mutex here.
30674
30675 2003-07-24  Ravi Pratap  <ravi@ximian.com>
30676
30677         * icall.c: Remove the FIXED_MCS_45127 workarounds - this has been
30678         fixed.
30679
30680 2003-07-24  Lluis Sanchez Gual  <lluis@ximian.com>
30681
30682         * reflection.c: Fix bug #46669
30683
30684 2003-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30685
30686         * exception.c:
30687         * exception.h:
30688         * icall.c:
30689         * object.h: fill in the type name for TypeLoadException.
30690
30691 2003-07-23  Ravi Pratap  <ravi@ximian.com>
30692
30693         * class.c: Fixes from Paolo in response to bug #45415 (Subclass
30694         relationship between TypeBuilders while compiling corlib) and bug
30695         45993 (Array types returned from the runtime while compiling
30696         corlib were from the loaded corlib).
30697
30698 2003-07-22  Martin Baulig  <martin@ximian.com>
30699
30700         * mono-debug-debugger.c: Reworked the type support a bit more;
30701         distinguish between types and classes.
30702
30703 Tue Jul 22 15:48:50 CEST 2003 Paolo Molaro <lupus@ximian.com>
30704
30705         * icall.c: add IsArrayImpl icall.
30706
30707 2003-07-22  Zoltan Varga  <vargaz@freemail.hu>
30708
30709         * class.c (mono_class_layout_fields): Fix gc aware auto layout by
30710         initializing real_size only once. Also fix bug #46602.
30711
30712 2003-07-21  Jerome Laban <jlaban@wanadoo.fr>
30713
30714         * object.c: Renamed mono_metadata_section to metadata_section.
30715
30716 2003-07-21  Lluis Sanchez Gual  <lluis@ximian.com>
30717
30718         * icall.c: in MS.NET ves_icall_Type_GetInterfaces returns an
30719           empty array if the type is an array. Fixed.
30720           ves_icall_MonoMethod_get_base_definition: if the base method
30721           is abstract, get the MethodInfo from the list of methods of
30722           the class.
30723         * reflection.c: ParameterInfo.PositionImpl should be zero-based
30724           and it was 1-based. Fixed in mono_param_get_objects.
30725
30726 2003-07-20  Martin Baulig  <martin@ximian.com>
30727
30728         * mono-debug.h: Set version number to 31.
30729         (mono_debug_init): Added `MonoDomain *' argument.
30730
30731         * mono-debug-debugger.c: Reworked the type support; explicitly
30732         tell the debugger about builtin types; pass the `klass' address to
30733         the debugger.
30734
30735 2003-07-20 Jackson Harper <jackson@latitudegeo.com>
30736
30737         * image.c: Allow new metadata tables to be loaded without a
30738         warning. Also update the warning message to give the new constant value.
30739                 
30740 Fri Jul 18 13:12:21 CEST 2003 Paolo Molaro <lupus@ximian.com>
30741
30742         * class.c, class.h, debug-helpers.c, icall.c, image.c, marshal.c,
30743         metadata.c, metadata.h, mono-debug-debugger.c, object.c, reflection.c: 
30744         array type representation changes.
30745
30746 Fri Jul 18 11:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30747
30748         * icall.c, appdomain.h, appdomain.c: support full runtime shutdown
30749         on Environment.Exit () call.
30750
30751 Thu Jul 17 17:21:57 CEST 2003 Paolo Molaro <lupus@ximian.com>
30752
30753         * icall.c, reflection.h, reflection.c, verify.c: cleanups,
30754         requires a matching corlib.
30755
30756 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30757
30758         * Changelog: My editor decided to add a CR to each line. Sorry about that.
30759           Committed again without the CRs.
30760         
30761 2003-07-17  Lluis Sanchez Gual  <lluis@ximian.com>
30762
30763         * socket-io.c: Get system_assembly using mono_image_loaded(), instead
30764           getting it from the "this" socket instance. Did not work
30765           if the socket is a subclass of Socket.
30766           Also fixed bug #35371.
30767
30768 Thu Jul 17 13:39:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
30769
30770         * metadata.c: fixed size for TypedByRef.
30771         * loader.c: when searching for a method, consider the vararg amrker.
30772         * unicode.c, decimal.c: constify some arrays.
30773
30774 2003-07-15  Dick Porter  <dick@ximian.com>
30775
30776         * socket-io.c: Fixed compilation for gcc < 3.2.
30777
30778         Fixed compilation for machines that don't have AF_INET6 (thanks to
30779         Bernie Solomon <bernard@ugsolutions.com> for that part.)
30780
30781         Fixed compile warnings.
30782         
30783         Fixed formatting and line endings.
30784
30785 2003-07-14  Jerome Laban <jlaban@wanadoo.fr>
30786
30787         * socket-io.h:
30788         * socket-io.c: Added IPv6 support.
30789
30790 2003-07-13  Zoltan Varga  <vargaz@freemail.hu>
30791
30792         * class.c (mono_class_is_assignable_from): New function to implement
30793         the is_assignable_from logic. Used by mono_object_isinst, 
30794         Type::IsAssignableFrom () and the interpreter.
30795
30796         * class.c (mono_class_is_subclass_of): Make all classes a subclass of
30797         Object, even interfaces.
30798         
30799         * object.c (mono_object_isinst): Implement in terms of 
30800         is_assignable_from.
30801
30802         * icall.c (ves_icall_type_is_assignable_from): New icall.
30803
30804 2003-07-11  Zoltan Varga  <vargaz@freemail.hu>
30805
30806         * domain.c (foreach_domain): fix compiler warning.
30807
30808 2003-07-11  Dietmar Maurer  <dietmar@ximian.com>
30809
30810         * image.c (load_metadata_ptrs): use g_strndup because strndup is
30811         not available on all plattforms
30812
30813 2003-07-10  Zoltan Varga  <vargaz@freemail.hu>
30814
30815         * image.h image.c: Store the metadata version string in MonoImage.
30816         * icall.c: New icall to retrieve the image version.
30817         * reflection.c (create_dynamic_image): Fill in the image version field
30818         * reflection.c (build_compressed_metadata): Use the image version
30819         from the image structure.
30820
30821 2003-07-08  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30822
30823         * appdomain.c: modified comment.
30824         * gc.c: finalizer_thread can call finalizers even when finished == TRUE.
30825         That will be its last iteration when mono_gc_cleanup is called from
30826         mono_runtime_cleanup and before the domain is unloaded.
30827
30828         Fixes bug #45962.
30829
30830 2003-07-04  Dietmar Maurer  <dietmar@ximian.com>
30831
30832         * marshal.c (mono_marshal_get_native_wrapper): fixes for [out]
30833         attributes.
30834
30835 Thu Jul 3 17:22:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30836
30837         * object.c, file-io.c, metadata.c, mono-endian.h, reflection.c,
30838         rawbuffer.c: more 64 bit and picky (or old) compiler fixes from
30839         Bernie Solomon <bernard@ugsolutions.com>.
30840
30841 Thu Jul 3 17:17:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
30842
30843         * object.c, object.h: provide mono_object_new_fast() for faster
30844         allocation in some special cases.
30845
30846 Wed Jul 2 13:21:26 CEST 2003 Paolo Molaro <lupus@ximian.com>
30847
30848         * object.h, reflection.h, verify.c: fixes for some 64bit issues,
30849         mostly from a patch by Laramie Leavitt <lar@leavitt.us>.
30850
30851 Tue Jul 1 21:24:14 CEST 2003 Paolo Molaro <lupus@ximian.com>
30852
30853         * threadpool.c: fix leaks.
30854
30855 2003-07-01  Dick Porter  <dick@ximian.com>
30856
30857         * threadpool.c (mono_async_invoke): Use mono_g_hash_table_remove when
30858         using MonoGHashTables.  Fixes threadpool bug posted to list.
30859
30860 Tue Jul 1 11:45:40 CEST 2003 Paolo Molaro <lupus@ximian.com>
30861
30862         * image.h, image.c: added support to load an assembly from a byte array.
30863         * Makefile.am, assembly.c, make-bundle.pl, sample-bundle: added 
30864         assembly bundle support.
30865
30866 2003-06-27  Dietmar Maurer  <dietmar@ximian.com>
30867
30868         * threadpool.c (mono_thread_pool_add): keep a reference to the
30869         AsyncResult to prevent GC
30870
30871 Thu Jun 26 12:13:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
30872
30873         * class.c: leak fix.
30874
30875 2003-06-25  Dick Porter  <dick@ximian.com>
30876
30877         * threadpool.c (mono_thread_pool_add): Don't set up a finaliser
30878         for the async object, the WaitHandle object will close the handle.
30879         Fixes bug 45321.
30880
30881 Wed Jun 25 18:12:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
30882
30883         * class.c: in mono_array_class_get (), lookup from the hash with the
30884         same type we insert: this works around a bug in
30885         mono_metadata_type_hash() with SZARRAY and fixes a leak reported by
30886         lluis. The real fix will have to wait for after the release.
30887
30888 Wed Jun 25 13:14:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
30889
30890         * icall.c: fix memory leak when getting type members.
30891
30892 Mon Jun 23 16:12:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30893
30894         * reflection.c: added more pubtoken special cases.
30895
30896 Mon Jun 23 15:29:06 CEST 2003 Paolo Molaro <lupus@ximian.com>
30897
30898         * class.c: handle field offset correctly when class size
30899         is set (bug# 45182, partially from a patch by jlaban@wanadoo.Fr (Jerome Laban)).
30900
30901 2003-06-20  Martin Baulig  <martin@ximian.com>
30902
30903         * mono-debug-debugger.h (MonoDebuggerSymbolFile): Added `MonoImage
30904         *image' field.
30905
30906 2003-06-20  Martin Baulig  <martin@ximian.com>
30907
30908         * image.h, mono-debug-debugger.h: Fixed compiler warnings.
30909
30910 2003-06-20  Martin Baulig  <martin@ximian.com>
30911
30912         * mono-debug.h (MONO_DEBUG_VAR_ADDRESS_MODE_STACK): Removed.  We
30913         just distinguish between variables in registers and variables at
30914         an offset relative to a register.
30915
30916 2003-06-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
30917
30918         * icall.c: #ifdef out latest changes until mcs is fixed.
30919
30920 Thu Jun 19 11:03:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
30921
30922         * icall.c: return members in metadata order.
30923
30924 Wed Jun 18 15:26:58 CEST 2003 Paolo Molaro <lupus@ximian.com>
30925
30926         * icall.c: avoid infinite loop in GetTimeZoneData.
30927
30928 Wed Jun 18 12:47:43 CEST 2003 Paolo Molaro <lupus@ximian.com>
30929
30930         * icall.c: added Marshal.Prelink/All icalls.
30931
30932 Wed Jun 18 12:17:48 CEST 2003 Paolo Molaro <lupus@ximian.com>
30933
30934         * object.c, object.h: fix warnings and do some overflow checking
30935         when creating arrays.
30936
30937 2003-06-17  Dick Porter  <dick@ximian.com>
30938
30939         * file-io.h:
30940         * file-io.c: File attributes need to be tweaked slightly when
30941         passed from the managed to the w32 world.
30942
30943 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30944         * profiler.h profiler-private.h profiler.c: Rework last patch
30945         based on suggestion by Paolo.
30946         
30947 2003-06-17  Zoltan Varga  <vargaz@freemail.hu>
30948
30949         * profiler.h profiler-private.h profiler.c: Added infrastructure for 
30950         instruction level coverage data collection.
30951         * profiler.h profiler.c (: Added new callback function which can be
30952         used by the profiler to limit which functions should have coverage
30953         instrumentation.
30954         * profiler.c (mono_profiler_load): Call g_module_build_path to
30955         generate the file name of the profiler library.
30956
30957 Mon Jun 16 18:11:13 CEST 2003 Paolo Molaro <lupus@ximian.com>
30958
30959         * profiler.c, profiler.h, profiler-private.h: added basic block 
30960         coverage profiling API.
30961
30962 2003-06-15  Zoltan Varga  <vargaz@freemail.hu>
30963
30964         * reflection.c (mono_reflection_create_runtime_class): Add support
30965         for events in dynamically generated code.
30966
30967         * gc.c: Start GCHandle indexes from 1, since 0 means the handle is
30968         not allocated.
30969
30970 Sat Jun 14 19:01:32 CEST 2003 Paolo Molaro <lupus@ximian.com>
30971
30972         * icall.c: when getting timezone info, return reasonable values if we
30973         can't get the actual data.
30974
30975 2003-06-14  Dick Porter  <dick@ximian.com>
30976
30977         * threads.c (start_wrapper): Remove the reference to the thread
30978         object in the TLS data, so the thread object can be finalized.
30979         This won't be reached if the thread threw an uncaught exception,
30980         so those thread handles will stay referenced :-( (This is due to
30981         missing support for scanning thread-specific data in the Boehm GC
30982         - the io-layer keeps a GC-visible hash of pointers to TLS data.)
30983
30984 Sat Jun 14 13:16:17 CEST 2003 Paolo Molaro <lupus@ximian.com>
30985
30986         * reflection.c: ensure streams and tables are first allocated with
30987         ALLOC_ATOMIC (GC_realloc uses plain GC_malloc otherwise).
30988
30989 Sat Jun 14 13:13:20 CEST 2003 Paolo Molaro <lupus@ximian.com>
30990
30991         * icall.c: fixed GetElementType for byrefs (bug# 44792).
30992
30993 2003-06-13  Zoltan Varga  <vargaz@freemail.hu>
30994
30995         * reflection.c (mono_reflection_create_runtime_class): Add support for
30996         properties to dynamically created classes.
30997         * reflection.c: Fix a few places where non-MonoObjects were inserted
30998         into the tokens hashtable.
30999
31000 Fri Jun 13 19:10:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31001
31002         * object.c: some support to handle out of memory exceptions.
31003
31004 2003-06-12  Dietmar Maurer  <dietmar@ximian.com>
31005
31006         * marshal.c (mono_marshal_get_native_wrapper): support reference
31007         return types
31008
31009 Wed Jun 11 18:32:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
31010
31011         * object.h, object.c: more portability stuff from Bernie Solomon.
31012         Unexport mono_object_allocate(). Added mono_object_unbox ().
31013         Set exitcode when an unhandled exception is thrown.
31014
31015 2003-06-11  Dietmar Maurer  <dietmar@ximian.com>
31016
31017         * marshal.c (mono_marshal_get_native_wrapper): use custom
31018         marshaler for return types.
31019
31020 2003-06-10  Dick Porter  <dick@ximian.com>
31021
31022         * socket-io.c: Don't assume that one of struct ip_mreqn or struct
31023         ip_mreq is available
31024
31025 Tue Jun 10 17:35:03 CEST 2003 Paolo Molaro <lupus@ximian.com>
31026
31027         * debug-mono-symfile.c, marshal.c, metadata.c, monitor.c,
31028         mono-debug-debugger.c, mono-debug.c, process.c: portability fixes
31029         by Bernie Solomon <bernard@ugsolutions.com>.
31030
31031 2003-06-10  Zoltan Varga  <vargaz@freemail.hu>
31032
31033         * gc.c (mono_gc_init): Avoid error message on shutdown when
31034         GC_DONT_GC=1 is used.
31035
31036         * icall.c (ves_icall_System_Reflection_Module_GetGuidInternal): 
31037         New icall to return the GUID of a module.
31038
31039 Mon Jun 9 19:33:51 CEST 2003 Paolo Molaro <lupus@ximian.com>
31040
31041         * class.c: ensure instance size always includes the parent's size
31042         even whem class size is set explicitly (fixes bug#44294).
31043
31044 Thu Jun 5 19:51:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
31045
31046         * profiler.h, profiler.c: made the simple profiler thread-safe,
31047         get more accurate timing info. Allow the loading of an
31048         externally-developed profiler module.
31049
31050 2003-06-05  Dietmar Maurer  <dietmar@ximian.com>
31051
31052         * marshal.c (mono_marshal_get_native_wrapper): improved
31053         class/byref arguments.
31054         (mono_marshal_get_native_wrapper): better string marshaling support.
31055
31056 Wed Jun 4 18:01:22 CEST 2003 Paolo Molaro <lupus@ximian.com>
31057
31058         * class.c: ensure .pack and .size are handled correctly and
31059         simplified layout of static fields.
31060
31061 2003-06-04  Dietmar Maurer  <dietmar@ximian.com>
31062
31063         * appdomain.c
31064         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): fix for bug 42934
31065
31066         * loader.c (mono_lookup_pinvoke_call): look for modules in the
31067         current directory (fix bug 44008)
31068
31069 2003-06-03  Dietmar Maurer  <dietmar@ximian.com>
31070
31071         * marshal.c (mono_marshal_get_native_wrapper): started support for
31072         custom marshalers.
31073         (mono_delegate_to_ftnptr): consider marshalling specifications
31074
31075 Tue Jun 3 11:17:02 CEST 2003 Paolo Molaro <lupus@ximian.com>
31076
31077         * reflection.c, reflection.h: emit custom marshal info.
31078
31079 2003-06-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31080
31081         * object.c: free the GError.
31082         * icall.c: added CloseEvent_internal.
31083         * threads.[ch]:
31084         (ves_icall_System_Threading_Events_CloseEvent_internal): new internal
31085         call.
31086
31087 2003-06-01  Zoltan Varga  <vargaz@freemail.hu>
31088
31089         * loader.c (mono_method_get_signature): Add support for dynamic
31090         assemblies.
31091
31092 Sat May 31 15:22:07 CEST 2003 Paolo Molaro <lupus@ximian.com>
31093
31094         * reflection.c: fixed bug #43905.
31095
31096 Fri May 30 12:56:29 CEST 2003 Paolo Molaro <lupus@ximian.com>
31097
31098         * class.c, domain.c, icall.c, metadata.h, object.h: support for
31099         handling TypedReference and ArgIterator.
31100         * loader.c, loader.h: added function to get signature at call site.
31101
31102 Thu May 29 11:34:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31103
31104         * metadata.c, metadata.h, private.h, tokentype.h, loader.c: make more 
31105         data readonly. Buglets and warning fixes. Some MethodSpec support.
31106
31107 Tue May 27 16:34:39 CEST 2003 Paolo Molaro <lupus@ximian.com>
31108
31109         * class.h, class.c, object.c: remove relative numbering support.
31110
31111 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
31112
31113         * marshal.c (mono_marshal_get_native_wrapper): For now, do not
31114         free the string, until we get a chance to fix Gtk#
31115
31116 2003-05-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31117
31118         * marshal.c: revert last patch.
31119
31120 Mon May 26 20:21:52 CEST 2003 Paolo Molaro <lupus@ximian.com>
31121
31122         * icall.c: updates for new mono_class_vtable() not calling
31123         the type constructor anymore.
31124
31125 Mon May 26 12:10:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
31126
31127         * object.h, object.c: separate vtable creation from type
31128         initialization. Make running the .cctor thread safe.
31129
31130 2003-05-26  Dietmar Maurer  <dietmar@ximian.com>
31131
31132         * marshal.c (mono_marshal_get_native_wrapper): free string return values.
31133
31134 2003-05-21  Dietmar Maurer  <dietmar@ximian.com>
31135
31136         * loader.c (mono_get_method): consider calling convention
31137
31138 2003-05-21  Zoltan Varga  <vargaz@freemail.hu>
31139
31140         * icall.c (ves_icall_System_Reflection_Module_GetGlobalType): New icall
31141         to return the invisible global type for a module.
31142
31143         * reflection.c (mono_image_build_metadata): Emit global fields too.
31144
31145 2003-05-20  Peter Williams  <peterw@ximian.com>
31146
31147         * loader.c (mono_lookup_internal_call): Add a few newlines.
31148
31149 2003-05-20  Zoltan Varga  <vargaz@freemail.hu>
31150
31151         * reflection.c (mono_reflection_lookup_dynamic_token): Intern dynamic
31152         literal strings.
31153
31154         * appdomain.c (set_domain_search_path): Recalculate search path when
31155         AppDomainSetup.PrivateBinPath changes.
31156
31157         * object.c (mono_class_compute_gc_descriptor): It turns out some
31158         parts of the class libs (like System.Thread) holds pointers to
31159         GC_MALLOC()-d memory in IntPtrs, which is wrong. The workaround is
31160         to treat native int a pointer type here.
31161         
31162 Tue May 20 17:18:16 CEST 2003 Paolo Molaro <lupus@ximian.com>
31163
31164         * appdomain.h, domain.c: add hashtable for jump target resolution.
31165
31166 2003-05-19  Zoltan Varga  <vargaz@freemail.hu>
31167
31168         * reflection.h reflection.c icall.c: Added new icalls 
31169         GetManifestResourceInfoInternal, GetModulesInternal and support
31170         infrastructure.
31171
31172 2003-05-16  Dick Porter  <dick@ximian.com>
31173
31174         * icall.c:
31175         * file-io.h:
31176         * file-io.c: Implement System.IO.MonoIO::GetTempPath
31177
31178 2003-05-14  Lluis Sanchez Gual  <lluis@ideary.com>
31179
31180         * object.c: mono_store_remote_field: little fix to previous patch.
31181
31182 Wed May 14 18:10:42 CEST 2003 Paolo Molaro <lupus@ximian.com>
31183
31184         * class.c: add constructors to array classes.
31185         * icall.c: special case array construction for InternalInvoke (),
31186
31187 2003-05-14  Zoltan Varga  <vargaz@freemail.hu>
31188
31189         * class.h class.c reflection.c object.c: Added support for field
31190         defaults in dynamically generated classes.
31191
31192 Wed May 14 13:35:27 CEST 2003 Paolo Molaro <lupus@ximian.com>
31193
31194         * reflection.c: properly encode charset for ddlimport.
31195
31196 Wed May 14 11:14:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
31197
31198         * threads.c: allow compiling without GC.
31199
31200 Tue May 13 16:41:49 CEST 2003 Paolo Molaro <lupus@ximian.com>
31201
31202         * appdomain.h, object.c, object.h, threads.c, threads.h: added
31203         handling of thread static data.
31204
31205 Tue May 13 16:36:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
31206
31207         * reflection.h, reflection.c: added mono_custom_attrs_free ().
31208
31209 2003-05-13  Dietmar Maurer  <dietmar@ximian.com>
31210
31211         * class.c (mono_array_class_get): always set the serializable flags
31212         (mono_array_class_get): always set the SEALED attribute for array types
31213
31214 2003-05-12  Dietmar Maurer  <dietmar@ximian.com>
31215
31216         * loader.c (mono_lookup_pinvoke_call): consider Ansi/Unicode
31217         attributes (fix for bug 42021).
31218
31219 2003-05-12  Dick Porter  <dick@ximian.com>
31220
31221         * gc.c: Don't run finalizers when the finalizer thread is
31222         finishing up, because the default domain has already been
31223         destroyed.
31224
31225 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
31226
31227         * string-icalls.c (ves_icall_System_String_ctor_chara_int_int): if
31228         value is null, we should throw an exception.   This is slightly
31229         different than the other conventions used for the constructor.
31230
31231 2003-05-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31232
31233         * socket-io.c: fixed windows build.
31234
31235 2003-05-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31236
31237         * socket-io.c: patch by Jerome Laban that fixes bug #42393.
31238
31239 2003-05-10  Zoltan Varga  <vargaz@freemail.hu>
31240
31241         * object.c (mono_string_new_wrapper): Compatibility fix for MS
31242         compilers.
31243
31244 2003-05-09  Zoltan Varga  <vargaz@freemail.hu>
31245
31246         * class.c (mono_class_layout_fields): Add experimental GC aware
31247         auto layout facility. Requires class library changes to work correctly.
31248
31249         (mono_class_setup_vtable): Avoid overriding explicit interface
31250         method implementations. Fixes iface3.exe test.
31251
31252         * object.c (mono_class_compute_gc_descriptor): Type I can't hold an
31253         object reference.
31254         (mono_array_new_specific): Add MONO_ARCH_SAVE_REGS.
31255         (mono_string_new_wrapper): Add MONO_ARCH_SAVE_REGS.
31256
31257         * metadata.h: Add new type classification macro which determines
31258         whenever the type holds an object reference.
31259
31260 2003-05-08  Dietmar Maurer  <dietmar@ximian.com>
31261
31262         * marshal.c (mono_marshal_get_native_wrapper): cleanups
31263
31264 2003-05-07  Zoltan Varga  <vargaz@freemail.hu>
31265
31266         * gc.c (finalizer_thread): Work around a GC bug.
31267
31268 2003-05-07  Dietmar Maurer  <dietmar@ximian.com>
31269
31270         * marshal.c (emit_struct_conv): allow unions
31271
31272         * class.c (class_compute_field_layout): added patches from Jerome Laban <jlaban@wanadoo.fr>
31273
31274 2003-05-06  Dietmar Maurer  <dietmar@ximian.com>
31275
31276         * marshal.c (mono_marshal_get_native_wrapper): free strings after pinvoke
31277
31278 2003-05-06  Martin Baulig  <martin@ximian.com>
31279
31280         * mono-debug-debugger.h: #include <mono/io-layer/io-layer.h>.
31281
31282 2003-05-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31283
31284         * socket-io.c:
31285         (Select_internal): allow NULLs, don't create arrays if not needed.
31286         Coupled with Socket.cs changes.
31287
31288         * threadpool.c:
31289         (mono_thread_pool_add): use GC_MALLOC to allocate the ASyncCall and
31290         register a finalizer for it that will close the semaphore handle. This
31291         fixes the leak and make Lupus' test run with > 4080 loops.
31292
31293 2003-05-05  Dietmar Maurer  <dietmar@ximian.com>
31294
31295         * marshal.c (mono_marshal_get_struct_to_ptr): added fixes from
31296         Jerome Laban (bug #42287)
31297
31298 2003-05-02  Martin Baulig  <martin@ximian.com>
31299
31300         * debug-mono-symfile.h
31301         (MonoSymbolFile): Moved declaration into mono-debug.h.
31302         (MonoDebugMethodJitInfo): Likewise.
31303         (mono_debug_open_mono_symbol_file): Take the MonoDebugHandle as
31304         argument.
31305         (_mono_debug_address_from_il_offset): Take a
31306         MonoDebugMethodJitInfo instead of a MonoDebugMethodInfo.
31307
31308         * mono-debug.h
31309         (MonoDebugDomainData): New struct.
31310         (mono_debug_get_domain_data): New function.
31311         (mono_debug_add_method): Take an additional `MonoDomain *'
31312         argument.
31313         (mono_debug_source_location_from_address): Likewise.
31314         (mono_debug_il_offset_from_address): Likewise.
31315         (mono_debug_address_from_il_offset): Likewise.
31316
31317 Thu May 1 19:40:37 CEST 2003 Paolo Molaro <lupus@ximian.com>
31318
31319         * reflection.c: one more check for null type in custom attrs.
31320
31321 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31322
31323         * reflection.c: avoid warning (comparison is always false due to limited
31324         range of data type).
31325
31326 2003-05-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31327
31328         * icall.c: throw an exception in Type.GetField if the argument 'name'
31329         is NULL.
31330
31331 Wed Apr 30 10:53:09 CEST 2003 Paolo Molaro <lupus@ximian.com>
31332
31333         * reflection.c: fixed handling of enums in named arguments to custom
31334         attributes (bug #42123).
31335
31336 Tue Apr 29 19:15:10 CEST 2003 Paolo Molaro <lupus@ximian.com>
31337
31338         * reflection.c: use the right array element type and handle
31339         a null for a Type argument, too.
31340
31341 Tue Apr 29 15:46:00 CEST 2003 Paolo Molaro <lupus@ximian.com>
31342
31343         * reflection.c: handle arrays as arguments to custom attributes.
31344
31345 Tue Apr 29 11:43:01 CEST 2003 Paolo Molaro <lupus@ximian.com>
31346
31347         * reflection.c: handle a string value in a custom attr
31348         ctor that takes an object.
31349
31350 2003-04-29  Dietmar Maurer  <dietmar@ximian.com>
31351
31352         * marshal.c (mono_mb_emit_restore_result): support MONO_TYPE_PTR
31353         (fix bug #42063)
31354
31355 2003-04-28  Zoltan Varga  <vargaz@freemail.hu>
31356
31357         * icall.c (ves_icall_Type_GetNestedType): Fixed warnings.
31358
31359 2003-04-27  Martin Baulig  <martin@ximian.com>
31360
31361         * mono-debug-debugger.h (MonoDebuggerEvent): Renamed
31362         MONO_DEBUGGER_EVENT_BREAKPOINT_TRAMPOLINE to
31363         MONO_DEBUGGER_EVENT_BREAKPOINT.
31364         (mono_breakpoint_trampoline_code): Removed.
31365         (mono_debugger_event_handler): The last argument is now a
31366         `guint32'.
31367         (mono_debugger_insert_breakpoint_full): Removed the
31368         `use_trampoline' argument.
31369         (mono_debugger_method_has_breakpoint): Likewise.
31370         (mono_debugger_trampoline_breakpoint_callback): Renamed to
31371         mono_debugger_breakpoint_callback(); take the method and
31372         breakpoint number as arguments.
31373
31374 Sat Apr 26 19:25:31 CEST 2003 Paolo Molaro <lupus@ximian.com>
31375
31376         * metadata.c: fix off by one when loading parameters attributes.
31377
31378 2003-04-24  Martin Baulig  <martin@ximian.com>
31379
31380         * mono-debug-debugger.c (mono_debugger_io_layer): Put this back.
31381
31382 2003-04-24  Martin Baulig  <martin@ximian.com>
31383
31384         * mono-debug-debugger.c: Moved all code which interacts with the
31385         Mono Debugger here.
31386
31387         * debug-mono-symfile.c: This code now just deals with the symbol
31388         file itself, the debugger code is now in mono-debug-debugger.c.
31389
31390 2003-04-23  Martin Baulig  <martin@ximian.com>
31391
31392         * mono-debug.c (mono_debug_source_location_from_il_offset):
31393         New method; like mono_debug_source_location_from_address(), but
31394         takes an IL offset instead of a machine address.
31395
31396 2003-04-23  Martin Baulig  <martin@ximian.com>
31397
31398         * debug-mono-symfile.h (MonoDebugLineNumberEntry): Removed the
31399         `line' field; this is now computed by the debugger.
31400
31401 2003-04-23  Martin Baulig  <martin@ximian.com>
31402
31403         * mono-debug.[ch]: New files.  This is the new debugging interface.
31404
31405         * mono-debug-debugger.[ch]: New files.  Moved all code which
31406         interacts with the Mono Debugger here.
31407
31408 2003-04-22  Dietmar Maurer  <dietmar@ximian.com>
31409
31410         * domain.c (mono_init): initialize mono_defaults.monitor_class
31411
31412 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
31413
31414         * reflection.c (method_encode_code): Add a spicy exception to help
31415         future compiler authors.
31416
31417 2003-04-21  Martin Baulig  <martin@ximian.com>
31418
31419         * icall.c
31420         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
31421         Make this work with relative pathnames; g_filename_to_uri() needs
31422         an absolute filename.
31423
31424 2003-04-18  Zoltan Varga  <vargaz@freemail.hu>
31425
31426         * icall.c: Track name changes in Object and ValueType.
31427
31428 2003-04-18  Dietmar Maurer  <dietmar@ximian.com>
31429
31430         * metadata.c (mono_type_stack_size): size should be a multiple of
31431         sizeof (gpointer)
31432
31433 2003-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31434
31435         * gc.c:
31436         (internal_domain_finalize): moved into mono_domain_finalize. No need
31437         to create another thread because the finalizers will be run in the
31438         finalizer thread.
31439         
31440         (ves_icall_System_GC_WaitForPendingFinalizers): implemented.
31441         (finalizer_notify): if shutting down, wait 2 seconds for the finalizers
31442         to be run (MS does this too).
31443
31444 2003-04-17  Zoltan Varga  <vargaz@freemail.hu>
31445
31446         * object.c (mono_class_compute_gc_descriptor): Update comment.
31447
31448         * loader.h marshal.h marshal.c: Added synchronized method wrappers.
31449
31450         * image.h: Add synchronized wrapper cache.
31451
31452         * image.c (do_mono_image_open): Initialize cache.
31453
31454         * reflection.c (create_dynamic_mono_image): Initialize cache.
31455
31456 2003-04-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31457
31458         * icall.c: patch by Jerome Laban <jlaban@wanadoo.fr> that fixes
31459         ves_icall_System_Buffer_ByteLengthInternal.
31460
31461 Tue Apr 15 13:56:55 CEST 2003 Paolo Molaro <lupus@ximian.com>
31462
31463         * reflection.c: setup klass->nested_in earlier. Allow
31464         a dash in the assembly name.
31465
31466 2003-04-15  Dietmar Maurer  <dietmar@ximian.com>
31467
31468         * metadata.c (mono_type_to_unmanaged): dont access
31469         type->data.klass for MONO_TYPE_OBJECT
31470         (mono_type_to_unmanaged): consider System.Delegate class
31471
31472 Tue Apr 15 11:16:05 CEST 2003 Paolo Molaro <lupus@ximian.com>
31473
31474         * class.c: just setup supertypes in the proper place instead of
31475         initializing the full element class for arrays.
31476
31477 Tue Apr 15 11:03:25 CEST 2003 Paolo Molaro <lupus@ximian.com>
31478
31479         * class.c: ensure the element class of arrays is initialized.
31480         Setup the supertype info for array classes, too.
31481
31482 2003-04-14  Miguel de Icaza  <miguel@ximian.com>
31483
31484         * icall.c (ves_icall_Type_GetNestedType): Add new internal call.
31485
31486 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31487
31488         * Makefile.am: re-added -m option when running cygpath. This way,
31489         MONO_ASSEMBLIES and MONO_CFG_DIR will contain '/' as directory
31490         separator.
31491         * mono-config.c: same codepath for locating mono config file for WIN32
31492         and the rest.
31493         * assembly.c: if mono_assembly_setrootdir is called, don't override
31494         the value set.
31495
31496 2003-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31497
31498         * Makefile.am: patch by Urs Muff <umuff@quark.com> that fixes
31499         MONO_ASSEMBLIES variable.
31500
31501 Fri Apr 11 12:44:15 CEST 2003 Paolo Molaro <lupus@ximian.com>
31502
31503         * icall.c: added Assembly::GetNamespaces() icall.
31504
31505 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31506
31507         * reflection.c: fix from Jaak <jaak@zd.com.pl>.
31508
31509 2003-04-10  Lluis Sanchez Gual  <lluis@ideary.com>
31510
31511         * appdomain.c,appdomain.h,icall.c: Added internal method that returns the process guid
31512         * object.c: fixed bug in the construction of vtable for proxies
31513
31514 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
31515
31516         * object.c (mono_array_new): Mark mono_array_new as an icall.
31517
31518 2003-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31519
31520         * class.c: fixed test for public method when overriding interfaces.
31521         Closes bug #40970.
31522
31523 Wed Apr 9 15:19:41 CEST 2003 Paolo Molaro <lupus@ximian.com>
31524
31525         * appdomain.h, domain.c: added mono_domain_foreach() to
31526         be able to access the currently loaded appdomains.
31527         * object.c: make string interning work across sppdomains.
31528         Mark some functions for use as icalls.
31529
31530 2003-04-09  Zoltan Varga  <vargaz@freemail.hu>
31531
31532         * class.c reflection.c: Fix memory leaks reported by ccmalloc.
31533
31534         * reflection.h reflection.c: Allocate long living data using 
31535         GC_MALLOC_ATOMIC so the collector does not need to scan it.
31536
31537         * reflection.c: Double the allocation size in streams instead of
31538         increasing it, to prevent unneccesary copying on large assemblies.
31539         
31540         * reflection.c (mono_reflection_create_runtime_class): Avoid vtable
31541         creation if the assembly does not have the Run flag set.
31542
31543 Tue Apr 8 11:19:53 CEST 2003 Paolo Molaro <lupus@ximian.com>
31544
31545         * class.h: avoid the C++ keywords in header files (Jerome Laban
31546         spotted and fixed this).
31547
31548 2003-04-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31549
31550         * object.c:
31551         (mono_unhandled_exception): fill in the arguments for the
31552         UnhandledException event. Only trigger that event for the default
31553         domain (as MS does).
31554
31555 2003-04-04  Zoltan Varga  <vargaz@freemail.hu>
31556
31557         * object.c: Improve typed allocation stuff based on suggestions from
31558         Paolo. Also turn it on if the GC library supports it.
31559
31560 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31561
31562         * object.c object.h class.h: Added experimental typed allocation
31563         facility using the interfaces in gc_gcj.h.
31564
31565         * os/gc_wrapper.h: Added new include files.
31566         
31567 2003-04-03  Martin Baulig  <martin@ximian.com>
31568
31569         All the following changes are conditional to `WITH_INCLUDED_LIBGC'
31570         which is not yet enabled by default.
31571
31572         * gc.c (mono_gc_init): Set the gc_thread_vtable to our thread
31573         functions.
31574         (mono_gc_lock, mono_gc_unlock): New static functions.
31575
31576         * threads.c (mono_gc_stop_world, mono_gc_start_world): New public
31577         functions; stop/start the world for the garbage collector.  This
31578         is using the windows API; we need to complete the SuspendThread()/
31579         ResumeThread() implementation in the io-layer to make this work on Unix.
31580         (mono_gc_push_all_stacks): New public function; tells the garbage
31581         collector about the stack pointers from all managed threads.
31582
31583 2003-04-03  Martin Baulig  <martin@ximian.com>
31584
31585         * object.h (MonoThread): Added `gpointer stack_ptr'.
31586
31587         * threads.c (start_wrapper): Save the stack pointer in `stack_ptr'.
31588
31589 2003-04-03  Martin Baulig  <martin@ximian.com>
31590
31591         * Makefile.am: It's called `cygpath -w', not `cygpath -m'.
31592
31593 2003-04-03  Zoltan Varga  <vargaz@freemail.hu>
31594
31595         * reflection.c (typebuilder_setup_fields): Initialize field.first and
31596         field.last.
31597
31598 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
31599
31600         * loader.c (mono_lookup_internal_call): Report the corlib that is
31601         out of sync.
31602
31603 2003-03-05  Aleksey Demakov <avd@openlinksw.com>
31604
31605         * icall.c (ves_icall_type_GetTypeCode): fixed check for
31606         System.DBNull (it's class not valuetype).
31607
31608 Wed Apr 2 18:37:35 CEST 2003 Paolo Molaro <lupus@ximian.com>
31609
31610         * reflection.c: set table_idx in MonoReflectionArrayMethod object even 
31611         if the array method was already assigned a token (fixes bug#40646).
31612
31613 2003-04-02  Zoltan Varga  <vargaz@freemail.hu>
31614
31615         * reflection.c (mono_reflection_get_type): Attempt type resolve even
31616         if no assembly is given.
31617
31618 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
31619
31620         * metadata.h: Added the new tables.
31621
31622         * row-indexes.h: Added definitions for new tables.
31623
31624         * metadata.c: Add schemas for new tables, and add support for
31625         computing the sizes of them.
31626
31627         * class.c: Update for handling the new type cases.
31628
31629 2003-04-01  Dietmar Maurer  <dietmar@ximian.com>
31630
31631         * metadata.h (MONO_TYPE_IS_VOID): new macro
31632
31633 2003-03-31  Martin Baulig  <martin@ximian.com>
31634
31635         * threads.h (MonoThreadCallbacks): Added `thread_created'.
31636
31637         * threads.c (mono_thread_new_init): Call `thread_created' in the
31638         mono_thread_callbacks.
31639
31640 2003-03-31  Lluis Sanchez Gual <lluis@ideary.com>
31641
31642         * loader.h: added marshalbyrefobject_class to mono_defaults
31643         * domain.c: added initialization of mono_defaults.marshalbyrefobject_class 
31644         * icall.c: ves_icall_InternalExecute: fixed bug in field setter and in the
31645           generation of output parameters.
31646           ves_icall_Remoting_RealProxy_GetTransparentProxy: added support for interfaces.
31647         * marshal.c: mono_remoting_wrapper(): avoided call through proxy when the type is
31648           contextbound and the target object belongs to the context of the caller.
31649         * object.h: added context and unwrapped_server variables in MonoRealProxy.
31650         * object.c: Implemented support for interfaces and abstract classes
31651           in mono_class_proxy_vtable. Fixed several methods to avoid unneeded calls through
31652           proxy. Fixed problem when dealing with output parameters in mono_runtime_invoke_array.
31653
31654 2003-03-30  Zoltan Varga  <vargaz@freemail.hu>
31655
31656         * class.h class.c (mono_class_is_subclass_of): New function.
31657         
31658         * icall.c (ves_icall_System_Array_FastCopy): Added optimized copy
31659         routines for most common case (calls from ArrayList::ToArray).
31660
31661         * icall.c (ves_icall_System_Environment_Exit): Call profiler shutdown 
31662         routine so programs which call Environment::Exit() can be profiled.
31663
31664         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle): 
31665         Added MONO_ARCH_SAVE_REGS.
31666
31667         * icall.c (ves_icall_type_is_subtype_of): Use new function.
31668
31669 2003-03-29  Miguel de Icaza  <miguel@ximian.com>
31670
31671         * blob.h: Add a couple of new MonoType types definitions.
31672
31673         * tabledefs.h: Add a couple of new call convs.
31674
31675 2003-03-27  Zoltan Varga  <vargaz@freemail.h>
31676
31677         * reflection.h (MonoReflectionDynamicAssembly): track changes in
31678         the layout of the class.
31679
31680         * reflection.c (alloc_table): double the size on overflow to avoid
31681         unnecessary copying.
31682
31683         * reflection.h reflection.c: If AssemblyBuilderAccess is Run, then
31684         avoid filling out metadata tables and blobs. Also set mb->ilgen to
31685         null so it can be garbage collected.
31686         
31687 2003-03-27  Zoltan Varga  <vargaz@freemail.hu>
31688
31689         * reflection.c (mono_reflection_get_type): Return the resolved type
31690         only if it is in the assembly we searched.
31691
31692         * reflection.c (ensure_runtime_vtable): Initialize method slots.
31693
31694         * class.c (mono_class_setup_vtable): Set the slot of the overriding
31695         method.
31696
31697 2003-03-26  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31698
31699         * appdomain.c:
31700         (set_domain_search_path): allow 'file://blah'. It's an invalid URI,
31701         the right one is 'file:///blah', but MS allows it.
31702         * assembly.c:
31703         (mono_assembly_open): allow 'file://blah'
31704
31705         Fixes bug #40306. Thanks to Mitko Iliev (imitko@openlinksw.co.uk).
31706
31707 2003-03-26  Aleksey Demakov <avd@openlinksw.com>
31708
31709         * socket-io.c: fixes bug #40310.
31710
31711 2003-03-25  Zoltan Varga  <vargaz@freemail.hu>
31712
31713         * reflection.c (mono_reflection_parse_type): handle deeply nested
31714         types correctly.
31715
31716         * reflection.c (mono_image_create_token): Use unique token values
31717         since they will be put into a hash table.
31718
31719         * class.c (mono_class_setup_vtable): If a method occurs in more than
31720         one place in the vtable, and it gets overriden, then change the
31721         other occurances too.
31722
31723         * marshal.c (mono_marshal_get_managed_wrapper): Added support for
31724         object as return type.
31725
31726 2003-03-22  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31727
31728         * icall.c: Deleted "ToString" implementation for double and float
31729         because they are full implemented in managed code.
31730
31731 Wed Mar 19 18:05:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31732
31733         * reflection.c, reflection.h: implemented and exported functions
31734         to retrieve info about custom attributes.
31735
31736 2003-03-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31737
31738         * appdomain.c: moved Uri handling to assembly.c
31739         * assembly.c: use g_filename_from_uri (). This makes assembly.LoadFrom
31740         work when using a file Uri in *nix and windows.
31741
31742         * icall.c: fixed Assembly.CodeBase to return a valid Uri. The same for
31743         GetReferencedAssemblies.
31744
31745 2003-03-18  Dick Porter  <dick@ximian.com>
31746
31747         * icall.c: Rename a couple of internal calls
31748
31749         * threads.c: Set the thread state to Stopped when a thread exits.
31750         Fixes bug 39377.
31751
31752 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>
31753
31754         * icall.c (ves_icall_System_Reflection_FieldInfo_internal_from_handle):
31755         New icall.
31756
31757         * object.c (mono_class_vtable): fix warning.
31758
31759 2003-03-17  Zoltan Varga  <vargaz@freemail.hu>  
31760
31761         * icall.c (ves_icall_type_is_subtype_of): Avoid vtable creation.
31762
31763         * reflection.c (mono_blob_entry_hash): Avoid reading uninitialized
31764         memory.
31765         (method_encode_clauses): Create exception info structures in the right
31766         order.
31767         (mono_reflection_setup_internal_class): Initialize supertypes field.
31768
31769         * class.c object.c: Handle interfaces which implement other interfaces 
31770         correctly.
31771
31772         * class.h class.c: Move the supertypes array initialization code into 
31773         a separate function so it can be used for dynamic types too. Also call
31774         it earlier, in mono_class_init(), since it can be used before the
31775         type is initialized.
31776
31777 2003-03-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31778
31779         * Makefile.am:
31780         * assembly.c:
31781         * icall.c: make MONO_ASSEMBLIES and MONO_CFG_DIR work on windows.
31782
31783         * appdomain.c:
31784         * appdomain.h:
31785         * marshal.c:
31786         * object.c: remove warnings.
31787
31788 2003-03-13  Martin Baulig  <martin@ximian.com>
31789
31790         * debug-mono-symfile.h (MonoSymbolFileLexicalBlockEntry): New type.
31791         (MonoDebugLexicalBlockEntry): New types.
31792
31793         * debug-mono-symfile.c
31794         (_mono_debug_address_from_il_offset): Moved here from ../jit/debug.c.
31795
31796 2003-03-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31797
31798         * process.c: ret can be any non-zero value accroding to MS doc.
31799
31800 2003-03-07  Miguel de Icaza  <miguel@ximian.com>
31801
31802         * class.c (mono_marshal_load_type_info): Fix buglet:  Noticed when
31803         fixing a warning for a miss-used prototype, would have cause
31804         random memory corruption.
31805
31806 2003-03-07  Martin Baulig  <martin@ximian.com>
31807
31808         * marshal.c (mono_marshal_free_array): That "TESTFREE %p" was
31809         getting really annoying ....
31810
31811 2003-03-07  Zoltan Varga  <vargaz@freemail.hu>
31812
31813         * reflection.c (fixup_method): added support for array methods.
31814
31815 Tue Mar 4 18:03:27 CET 2003 Paolo Molaro <lupus@ximian.com>
31816
31817         * socket-io.c:  handle case when AF_INET6 and AF_IPX are not defined
31818         (pointed out by Michael Adams).
31819
31820 2003-03-04  Dick Porter  <dick@ximian.com>
31821
31822         * icall.c: Temporarily reverted the Double and Single ToString()
31823         change, because it broke nunit.
31824
31825 Tue Mar 4 12:40:58 CET 2003 Paolo Molaro <lupus@ximian.com>
31826
31827         * object.h, threads.h: make include files compatible with C++
31828         (patch by Jerome Laban <jlaban@wanadoo.fr>).
31829
31830 2003-03-04  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
31831
31832         * icall.c: Erased ToString helper functions for Double and Single.
31833         Now, that implementations ar all in managed code (Double and Single
31834         Formatters).
31835
31836 2003-03-03  Lluis Sanchez Gual  <lluis@ideary.com>
31837
31838         * appdomain.c: Added method for initializing the default context of
31839         a domain. Added internal call for getting the default context.
31840         * appdomain.h: Added context variable in MonoDomain struct.
31841         * domain.c: mono_domain_set also sets the default context of the domain
31842         * icall.c: Mapped internal method InternalGetDefaultContext.
31843         * object.c: mono_object_get_virtual_method returns always a remoting
31844         wrapper if the object is a transparent proxy.
31845         mono_runtime_invoke_array: when creating an object by calling the
31846         constructor, if the created object is a proxy, then the constructor should
31847         be called using the a remoting wrapper.
31848
31849 2003-03-03  Dick Porter  <dick@ximian.com>
31850
31851         * socket-io.c (create_sockaddr_from_object): Rename sockaddr_un
31852         variable so it compiles on solaris.  Problem spotted by
31853         Christopher Taylor <ct@cs.clemson.edu>
31854
31855 2003-03-01  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31856
31857         * appdomain.c:
31858         (get_info_from_assembly_name): don't leak value.
31859
31860         * icall.c:
31861         (ves_icall_System_Reflection_Assembly_GetFilesInternal): initialize
31862         result.
31863
31864 Sat Mar 1 15:32:56 CET 2003 Paolo Molaro <lupus@ximian.com>
31865
31866         * assembly.c: export mono_image_load_references ().
31867         * class.c: handle function pointers. mono_class_from_name() now
31868         supports nested type names directly.
31869
31870 2003-02-28  Zoltan Varga  <vargaz@freemail.hu>
31871
31872         * reflection.h reflection.c: Encode already created dynamic methods 
31873         and fields correctly as a DEF instead of a REF.
31874
31875         * reflection.c: Get rid of the force_ref argument to 
31876         mono_image_typedef_or_ref since it was wrong in the first place.
31877
31878         * string-icalls.c: add error checking to string constructors according
31879         to the MSDN docs.
31880
31881         * reflection.c: Emit types in the order their TypeBuilders were 
31882         created. Previously, a new table index was assigned to each type before
31883         the tables were emitted. This was wrong because the signature blob
31884         might already refer to a type by its original table index.
31885
31886 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>
31887
31888         * metadata.c (mono_metadata_nesting_typedef): fix bug in previous
31889         change.
31890         
31891 2003-02-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31892
31893         * Makefile.am: make assemblies dir have \ instead of / on windows.
31894
31895 2003-02-27  Zoltan Varga  <vargaz@freemail.hu>  
31896
31897         * metadata.c metadata.h (mono_metadata_nesting_typedef): changed to
31898         iterate over the NESTEDCLASS table using a linear search since the
31899         table is not guaranteed to be sorted by the secondary key.
31900
31901         * class.c (mono_class_create_from_typedef): fixed up call to
31902         mono_metadata_nesting_typedef.
31903         
31904 2003-02-27  Dietmar Maurer  <dietmar@ximian.com>
31905
31906         * marshal.c (mono_string_to_byvalstr): clear the memory as
31907         suggested by Jerome Laban <jlaban@wanadoo.fr>
31908
31909 2003-02-26  Dick Porter  <dick@ximian.com>
31910
31911         * process.c: Cope with padding in .rsrc blocks
31912
31913 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31914
31915         * metadata.h: reverted the filter_len change, it breaks reflection
31916         
31917 2003-02-26  Dietmar Maurer  <dietmar@ximian.com>
31918
31919         * metadata.h: added a new field to store the filter_len
31920         
31921
31922 Tue Feb 25 10:56:16 CET 2003 Paolo Molaro <lupus@ximian.com>
31923
31924         * reflection.c: handle custom attributes for types and members
31925         created with Reflection.Emit (bug#38422).
31926
31927 2003-02-22  Zoltan Varga  <vargaz@freemail.hu>
31928
31929         * reflection.c: define RTSpecialName automatically for constructors for
31930         compatibility with MS.NET.
31931
31932         * reflection.c (mono_reflection_create_runtime_class): initialize
31933         nested_in field of dynamically created classes.
31934
31935 2003-02-22  Martin Baulig  <martin@ximian.com>
31936
31937         * debug-mono-symfile.h: Incremented version number.
31938
31939 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31940
31941         * object.h icall.c process.c: fix warnings.
31942
31943 2003-02-21  Zoltan Varga  <vargaz@freemail.hu>
31944
31945         * appdomain.h appdomain.c:
31946         (mono_domain_try_type_resolve): split the 
31947         name_or_tb argument into a name and a tb argument.
31948         (mono_domain_has_type_resolve): new function to check whenever the
31949         application has registered a TypeResolve event handler.
31950         
31951         * icall.c reflection.h reflection.c: move the type resolve logic into
31952         mono_reflection_get_type () so it will be invoked when 
31953         Assembly::GetType () is called.
31954
31955         * reflection.c:
31956         (mono_reflection_get_type): renamed to get_type_internal.
31957         (mono_reflection_get_type): fixed type name generation so it works 
31958         for nested types too.
31959         (mono_reflection_get_type): call has_type_resolve () to avoid the 
31960         costly type name generation if there is no resolve event handler.
31961
31962 Fri Feb 21 11:36:57 CET 2003 Paolo Molaro <lupus@ximian.com>
31963
31964         * class.c, image.c: load exported types from file references.
31965
31966 2003-02-19  Lluis Sanchez Gual  <lluis@ideary.com>
31967
31968         * appdomain.h: Added in MonoDomain a couple of MonoMethod* variables
31969           used to cache the managed methods used to create proxies and make 
31970           remote invocation of methods.
31971         * class.h: Added in MonoVTable a flag to indicate that a class needs 
31972           to be remotely created.
31973         * object.c: Modified the method mono_class_vtable(). It now initializes 
31974           the remote flag of the vtable. Modified mono_object_new_specific(), 
31975           so now it checks the remote flag.
31976         * icall.c: Added a couple of internal methods, one for enabling instance 
31977           creation interception for a type, and one for creating objects bypassing
31978           the remote check.
31979
31980 2003-02-18  Martin Baulig  <martin@ximian.com>
31981
31982         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethodToken):
31983         New interncall to get a method's metadata token.
31984
31985         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethodToken"):
31986         New interncall for the debugger.
31987
31988 2003-02-18  Dietmar Maurer  <dietmar@ximian.com>
31989
31990         * class.c (mono_class_setup_vtable): allocate supertype array
31991
31992 2003-02-18  Martin Baulig  <martin@ximian.com>
31993
31994         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Added `has_this'.
31995
31996 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
31997
31998         * reflection.c:
31999         (assembly_name_to_aname): jump over unknown properties (i've found
32000         something like: 'type, assembly, version=xxx, custom=null, public...',
32001         so now will ignore custom=null and still get the rest of the values).
32002
32003 2003-02-17  Dick Porter  <dick@ximian.com>
32004
32005         * threads.c: Have Thread.Start() wait for a semaphore to signal
32006         that the thread has set up all its local data.  This fixes bug
32007         34323, where Abort() raced the new thread's TLS data.
32008
32009         Also removes the handle_store() call from start_wrapper, because
32010         threads are now always created suspended and there is no longer a
32011         race between the parent and child threads to store the info.
32012
32013 Mon Feb 17 13:13:31 CET 2003 Paolo Molaro <lupus@ximian.com>
32014
32015         * image.c: explain the #- heap issue in a message, hopefully
32016         avoiding FAQs on mono-list.
32017
32018 2003-02-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32019
32020         * icall.c:
32021         (GetEntryAssembly): if the domain has not invoked
32022         AppDomain.ExecuteAssembly yet, return the assembly of the default
32023         AppDomain.
32024
32025 2003-02-16  Zoltan Varga  <vargaz@freemail.hu>
32026
32027         * class.c (mono_ldtoken): make it work in dynamic assemblies.
32028
32029 Sun Feb 16 13:10:06 CET 2003 Paolo Molaro <lupus@ximian.com>
32030
32031         * metadata.c, reflection.c: simple speedup to type hash
32032         and equals code.
32033
32034 Sat Feb 15 15:15:03 CET 2003 Paolo Molaro <lupus@ximian.com>
32035
32036         * image.c, image.h, class.c, assembly.c: move module loading
32037         to MonoImage. When loading metadata, consider alignemnet from
32038         the start of metadata, not from the metadata address in memory.
32039
32040 2003-02-13  Zoltan Varga  <vargaz@freemail.hu>
32041
32042         * reflection.c (mono_reflection_get_custom_attrs): Added support for 
32043         AssemblyBuilder objects. Factored out custom attribute creation into
32044         a separate function.
32045         (create_custom_attr): new function to create custom attributes.
32046
32047 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
32048
32049         * Makefile.am: Got tired of typing the full pathname to pedump.
32050         Until there is another option, am installing this.
32051
32052 2003-02-12  Dietmar Maurer  <dietmar@ximian.com>
32053
32054         * class.c (class_compute_field_layout): always set field->parent 
32055         (mono_ldtoken): use mono_defaults.fieldhandle_class;
32056
32057 2003-02-11  Dick Porter  <dick@ximian.com>
32058
32059         * threads-types.h:
32060         * monitor.c: Rewrote Monitor, making lock much faster and
32061         Pulse/Wait work as specified.  Also uses much fewer handles, and only
32062         creates them as needed.
32063
32064         * exception.c: Added SynchronizationLockException
32065
32066         * threads.c: Deleted old Monitor implementation.  The new one is
32067         in a new file.
32068
32069 Mon Feb 10 17:54:10 CET 2003 Paolo Molaro <lupus@ximian.com>
32070
32071         * class.c: handled TypedReference type code. Set the correct size for
32072         class data. Setup interface_offsets for interface classes, too.
32073
32074 2003-02-09  Martin Baulig  <martin@ximian.com>
32075
32076         * debug-mono-symfile.h: Reflect latest symbol writer changes.
32077
32078 Sun Feb 9 18:37:01 CET 2003 Paolo Molaro <lupus@ximian.com>
32079
32080         * loader.c: implemented MEMBERREF_PARENT_TYPEDEF.
32081         * metadata.c, reflection.c: missing MONO_TYPE_TYPEDBYREF handling.
32082         * object.c: fixed mono_object_get_virtual_method () for interfaces.
32083         * verify.c: check for code that runs after the end of the method.
32084
32085 2003-02-08  Pedro Mart?nez Juli?  <yoros@wanadoo.es>
32086
32087         * icall.c: Added "System.Math::Floor", "System.Math::Round" and
32088         "System.Math::Round2".
32089         * sysmath.h: Added Floor, Round and Round2 definitions.
32090         * sysmath.c: Modified certain functions that were not 100% compliant
32091         with MS.NET (math precision) and added the implementation of Floor,
32092         Round and Round2.
32093
32094 2003-02-07  Martin Baulig  <martin@ximian.com>
32095
32096         * debug-mono-symfile.c (mono_debug_symfile_add_method): Ignore interncalls.
32097
32098 2003-02-07  Martin Baulig  <martin@ximian.com>
32099
32100         * debug-mono-symfile.c: Reflected latest symwriter changes.
32101         (mono_debug_create_mono_symbol_file): Removed.
32102         (mono_debug_open_mono_symbol_file): Take an argument which
32103         specifies whether to create a dynamic symbol file.
32104
32105 2003-02-07  Dietmar Maurer  <dietmar@ximian.com>
32106
32107         * class.c (mono_class_from_mono_type): added MONO_TYPE_TYPEDBYREF
32108
32109 2003-02-05  Martin Baulig  <martin@ximian.com>
32110
32111         * reflection.c (mono_image_build_metadata): Make this public,
32112         protect it against being called multiple times, don't create
32113         resources and don't build the compressed metadata here.
32114         (mono_image_create_pefile): Do this here.
32115
32116         * icall.c
32117         ("System.Reflection.Emit.AssemblyBuilder::build_metadata"): Added.
32118
32119 2003-02-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32120
32121         * socket-io.c: fixed bug #36322.
32122
32123 2003-02-06  Piers Haken <piersh@friskit.com>
32124
32125         * appdomain.[ch]:
32126         * class.h:
32127         * debug-mono-symfile.c:
32128         * icall.c:
32129         * loader.c:
32130         * mono-config.c:
32131         * monosn.c:
32132         * reflection.c:
32133         * socket-io.c: warning cleanups
32134
32135 2003-02-06  Dietmar Maurer  <dietmar@ximian.com>
32136
32137         * marshal.c (mono_marshal_get_remoting_invoke_with_check): new
32138         function. works like remoting invoke, but does a check for the Proxy first.
32139
32140 2003-02-05  Miguel de Icaza  <miguel@ximian.com>
32141
32142         * appdomain.c (ves_icall_System_AppDomain_InternalUnload): Make it compiler.
32143
32144 2003-02-05  Dietmar Maurer  <dietmar@ximian.com>
32145
32146         * marshal.c (mono_marshal_get_native_wrapper): only allocate an
32147         array of pointers.
32148         (mono_marshal_get_ldfld_wrapper): only generate necessary ldfld wrappers.
32149         (mono_marshal_get_stfld_wrapper): only generate necessary stfld wrappers.
32150
32151         * object.c (mono_store_remote_field_new): used by the new jit
32152         instead of mono_store_remote_field
32153         (mono_load_remote_field_new): used by the new jit
32154         instead of mono_load_remote_field
32155
32156 2003-02-05  Patrik Torstensson
32157
32158         * appdomain.c: changed unload to take the domain id instead
32159         of domain
32160         
32161         * icall.c: changed icall for AppDomain.Unload to AppDomain.InternalUnload
32162
32163
32164 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32165
32166         * appdomain.c: don't look for assemblies in ApplicationBase if
32167         PrivateBinPathProbe is set.
32168
32169 2003-02-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32170
32171         * object.c: make the first argument in main_args contain the absolute
32172         path to the assembly. Fixes bug #37511.
32173
32174 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32175
32176         * icall.c: get correct UTC offset for countries not using daylight
32177         time saving. Fixes bug #30030.
32178
32179 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32180
32181         * socket-io.c: support AF_UNIX and use the same layout as MS (bytes 0
32182         and 1 are the family).
32183
32184 2003-02-04  Dietmar Maurer  <dietmar@ximian.com>
32185
32186         * icall.c (ves_icall_InternalExecute): removed wrong assertion
32187
32188         * marshal.c (mono_marshal_get_remoting_invoke): generate valid IL
32189
32190 2003-02-04  Zoltan Varga  <vargaz@freemail.hu>
32191
32192         * reflection.c: added support for SignatureHelper tokens, which is
32193         needed by the Calli opcode.
32194
32195         * reflection.h: track changes to SignatureHelper class.
32196
32197         * metadata.c (mono_metadata_parse_signature): handle dynamic tokens.
32198
32199 2003-02-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32200
32201         * appdomain.c: fixed loading assemblies from PrivateBinPath.
32202
32203 2003-02-03  Patrik Torstensson
32204         * appdomain.[c|h], domain.c : 
32205          - Added support for getting a domain via domain id
32206          - Support for setting and getting domain from System.AppDomain 
32207            (used in cross appdomain channel)
32208          - Added support for get/set for a MonoAppContext on a thread 
32209            (Context class in System.Runtime.Remoting.Contexts),
32210          - Removed hack in Get/SetData and ExecuteAssembly.
32211         
32212         * icall.c : renamed GetTransparantProxy to InternalGetTransparantProxy to allow
32213         the managed world to get control when a proxy is created.
32214
32215         * icall.c (ves_icall_InternalExecute) : bug fix, must return empty array
32216         
32217 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
32218
32219         * icall.c
32220         (ves_icall_System_Reflection_Assembly_GetReferencedAssemblies):
32221         Populate the codebase field as well.
32222
32223 2003-02-02  Martin Baulig  <martin@ximian.com>
32224
32225         * debug-mono-symfile.c
32226         (MonoSymbolFileMethodAddress): Added `wrapper_address' field.
32227         (mono_debug_symfile_add_method): Allow interncalls.
32228
32229 2003-01-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32230
32231         * icall.c: throw parse exception if strtod fails or the string is empty.
32232
32233 Fri Jan 31 16:09:48 CET 2003 Paolo Molaro <lupus@ximian.com>
32234
32235         * marshal.c: handle object type separately from defined
32236         class types.
32237
32238 Fri Jan 31 16:01:20 CET 2003 Paolo Molaro <lupus@ximian.com>
32239
32240         * marshal.c: handle NATIVE_LPSTR for strings when it's
32241         explicitly specified.
32242
32243 Fri Jan 31 11:51:43 CET 2003 Paolo Molaro <lupus@ximian.com>
32244
32245         * reflection.c, reflection.h, icall.c: setup the reflection
32246         handle cache for ModuleBuilders and AssemblyBuilders.
32247
32248 2003-01-30  Dietmar Maurer  <dietmar@ximian.com>
32249
32250         * reflection.c (reflection_methodbuilder_to_mono_method): set
32251         pinvoke flag
32252
32253 2003-01-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32254
32255         * icall.c: implemented ves_icall_MonoMethod_get_base_definition.
32256
32257 2003-01-29  Dick Porter  <dick@ximian.com>
32258
32259         * threads.c: No need for the fake_thread kludge now that Thread
32260         doesn't run a class constructor
32261         
32262 2003-01-29  Dick Porter  <dick@ximian.com>
32263
32264         * threads.c: Use g_direct_hash instead of the rather bogus
32265         g_int_hash
32266
32267 2003-01-29  Dietmar Maurer  <dietmar@ximian.com>
32268
32269         * marshal.c (mono_marshal_get_native_wrapper): add check for null
32270         (fix pinvoke12.exe)
32271         (mono_marshal_get_struct_to_ptr): generate valid IL code
32272         (mono_marshal_get_ptr_to_struct): generate valid IL code
32273         (*): correctly set sig->pinvoke, we need to memdup the signature
32274         to do that
32275
32276 Tue Jan 28 22:57:57 CET 2003 Paolo Molaro <lupus@ximian.com>
32277
32278         * marshal.c, marshal.h: use larger integers in mono_mb_emit_add_to_local()
32279         to avoid overflows (bug spotted and fixed by Jerome Laban <jlaban@wanadoo.fr>).
32280
32281 Tue Jan 28 18:55:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32282
32283         * profiler.c: provide more callers information.
32284
32285 2003-01-28  Dietmar Maurer  <dietmar@ximian.com>
32286
32287         * marshal.c (mono_marshal_get_managed_wrapper): generate valid IL code
32288
32289         * appdomain.h:added fix from Patrik: _MonoAppDomain is a MBR object
32290
32291         * marshal.c (mono_marshal_get_native_wrapper): generate valid IL code
32292
32293 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32294
32295         * icall.c: (ves_icall_System_CurrentTimeZone_GetTimeZoneData): raise an
32296         exception instead of going into an infinite loop on dates which it 
32297         can't yet handle.
32298
32299         * string-icalls.c (ves_icall_System_String_get_Chars): raise 
32300         out-of-range exception if needed.
32301
32302         * class.c (mono_class_setup_vtable): allow a virtual method to provide
32303         an implementation for an interface method and to override an inherited
32304         method at the same time. 
32305         Imagine a scenario when a virtual method is used to override a
32306         virtual abstract method in a parent class, and this same method 
32307         provides an implementation for an method inherited from an interface. 
32308         In this case, the interface resolution code will set im->slot, which 
32309         means that the virtual method override pass will skip this method 
32310         which means a pointer to the abstract method inherited from the parent
32311         will remain in the vtable of this non-abstract class.
32312
32313         * class.c: (mono_class_setup_vtable): continue search for a real 
32314         method if only an abstract method is found.     
32315
32316 Mon Jan 27 17:12:19 CET 2003 Paolo Molaro <lupus@ximian.com>
32317
32318         * reflection.c: add size to encoding for ByValStr and ByValArray
32319         marshal blob (from "Jerome Laban" <jlaban@wanadoo.fr>).
32320
32321 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32322
32323         * class.c (mono_class_setup_vtable): pass the override info as an
32324         argument.
32325
32326         * class.c (mono_class_setup_vtable): set the slot of overriding methods
32327         correctly.
32328         
32329         * reflection.c (ensure_runtime_vtable); add support for method 
32330         overrides.
32331         
32332 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32333
32334         * reflection.c (resolution_scope_from_image): Hack to work to work with
32335         dynamic assemblies.
32336
32337         * reflection.c (mono_image_typedef_or_ref): renamed to ..._aux and 
32338         added a 'force_ref' argument to force this function to allways return 
32339         a TypeRef. This is needed by mono_image_get_memberref_token ().
32340         
32341 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32342
32343         * reflection.c (mono_image_get_type_info): interfaces really don't have
32344         a parent.
32345
32346         * reflection.c (mono_image_basic_init): fill out missing fields of
32347         image structure.
32348
32349         * reflection.c (mono_image_basic_init): Invoke assembly load hooks for 
32350         dynamic assemblies. This is required so dynamic assemblies show up in
32351         AppDomain.GetAssemblies (), emit an AssembyLoadEvent, gets searched by
32352         Type::GetType() etc. This is consistent with MS behaviour.
32353
32354         * image.c image.h reflection.c: add newly created classes to the name 
32355         cache so mono_class_get () will find them.      
32356
32357 2003-01-27  Zoltan Varga  <vargaz@freemail.hu>
32358
32359         First part of changes to get IKVM.NET running under mono.
32360         
32361         * appdomain.h, appdomain.c: added new function 
32362         mono_domain_try_type_resolve() which will emit TypeResolve events. 
32363         This function will call AppDomain::DoTypeResolve to do the actual work.
32364
32365         * class.h, class.c, loader.c, object.c, reflection.h, reflection.c: 
32366         moved existing code dealing with dynamic tokens to a new function 
32367         called mono_reflection_lookup_dynamic_token (). This function will 
32368         raise TypeResolve events when appropriate. Since reflection.c is not 
32369         part of libmetadata, a new hook function called 
32370         mono_lookup_dynamic_token() is added to class.c which will call this.
32371
32372         * assembly.h assembly.c: make the invoke_load_hook function public,
32373         so it can be called for dynamic assemblies.
32374
32375         * icall.c (ves_icall_System_Runtime_CompilerServices_RuntimeHelpers_RunClassConstructor): skip interfaces since they do not have initializers.
32376
32377         * icall.c (ves_icall_type_from_name): emit a TypeResolve event if the 
32378         type isn't found.
32379
32380         * reflection.c reflection.h: change MonoDynamicAssembly.tokens to a 
32381         MonoGHashTable, since it contains pointers to objects which the GC 
32382         needs to track.
32383
32384         * assembly.c (search_loaded): remove unused variable.
32385         
32386 Mon Jan 27 12:18:45 CET 2003 Paolo Molaro <lupus@ximian.com>
32387
32388         * object.c: fixed issue exposed by gcc-generated IL programs
32389         that use RVA data for pointers.
32390
32391 2003-01-25  Martin Baulig  <martin@ximian.com>
32392
32393         * threads.c (start_wrapper): Moved the initialization of
32394         `start_func' above the mono_new_thread_init() call to which we
32395         pass it as argument.
32396
32397 2003-01-24  Martin Baulig  <martin@ximian.com>
32398
32399         * threads.h (MonoThreadCallbacks): Pass the thread ID instead of
32400         the MonoThread pointer.
32401
32402 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
32403
32404         * icall.c: Rename `PowImpl' to Pow.
32405
32406 2003-01-23  Dick Porter  <dick@ximian.com>
32407
32408         * threads.c (start_wrapper): Create a Thread object if needed, so
32409         the Main() thread can do the class initialisation in a subthread
32410         that has been set up to allow managed code execution.
32411
32412         Pass the thread ID instead of the MonoThread pointer to the thread
32413         start and attach callbacks.  This change is required, because the
32414         jit thread start callback must be called _before_ the Thread
32415         object can be created.
32416         
32417         (mono_thread_init): Removed much object creation code that is no
32418         longer needed.  No managed code is called from here now.
32419
32420         * object.c (mono_runtime_exec_managed_code): Create a subthread
32421         for Main, and call back to the runtime to use it.
32422         Set the exit code when Main exits.
32423
32424         * gc.c: Make sure domain finalisation happens in a subthread.
32425         Re-enable threaded GC, fixing bug 31333 (again).
32426
32427         * environment.c: System.Environment internall calls (so far just
32428         ExitCode is here, the others are still in icall.c)
32429
32430         * appdomain.c (mono_runtime_cleanup): All threads running managed
32431         code should have finished before mono_runtime_cleanup() is
32432         reached, so no need to clean up threads.
32433
32434 2003-01-22  Martin Baulig  <martin@ximian.com>
32435
32436         * appdomain.h (MonoThreadStartCB): Added `MonoThread *thread' and
32437         `gpointer func' arguments.      
32438         (MonoThreadAttachCB): New typedef; like the old MonoThreadStartCB,
32439         but added `MonoThread *thread' argument.
32440         (mono_runtime_init): The last argument is now a MonoThreadAttachCB.
32441
32442         * threads.c (mono_new_thread_init): Added `gpointer func' argument
32443         and pass it to the mono_thread_start_cb callback.
32444         (mono_install_thread_callbacks): New public function to install a
32445         set of callbacks which are set by the debugger.
32446         (mono_thread_init): The last argument is now a MonoThreadAttachCB.
32447
32448 2003-01-22  Martin Baulig  <martin@ximian.com>
32449
32450         * Makefile.am: Install debug-mono-symfile.h.
32451
32452 2003-01-21  Aleksey Demakov <avd@openlinksw.com>
32453
32454         * marshal.c: fixed copy_from_managed and copy_to_unmanaged for 0 length.
32455
32456 2003-01-21  Dietmar Maurer  <dietmar@ximian.com>
32457
32458         * added the following fix from Jackson Harper <jackson@latitudegeo.com>
32459         * class.c (mono_ptr_class_get): correctly set access levels of pointers
32460         (mono_array_class_get): correctly set access levels of arrays
32461
32462 2003-01-20      Patrik Torstensson
32463         * image.h (MonoAssemblyName): changed major, minor, build, revision
32464         from signed to unsigned.
32465
32466 2003-01-20  sean kasun <skasun@azstarnet.com>
32467
32468         * reflection.c (load_cattr_value): Now this handles
32469         MONO_TYPE_SZARRAY.  Fixes bug #35629
32470
32471 2003-01-20  Miguel de Icaza  <miguel@ximian.com>
32472
32473         * marshal.c (emit_struct_conv): Handle MONO_TYPE_PTR as an
32474         integer value
32475
32476 2003-01-18  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32477
32478         * decimal.c: fixed bug #26056.
32479
32480 2003-01-17  Martin Baulig  <martin@ximian.com>
32481
32482         * gc.c: Raise an ExecutionEngineException instead of using g_error().
32483
32484 2003-01-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32485
32486         * exception.[ch]:
32487         (mono_get_exception_type_initialization): new function.
32488
32489         * object.c: throw a TypeInitializationException when an exception is
32490         thrown invoking the class constructor.
32491
32492 2003-01-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32493
32494         * reflection.c: fixed attribute reading.
32495
32496 2003-01-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32497
32498         * icall.c:
32499         (ves_icall_type_from_name): make it work as MS. Ie, if no assembly name
32500         provided, look for the type in the calling assembly and then in
32501         mscorlib; if the assembly name is provided, only try that one.
32502
32503 Tue Jan 14 14:52:52 CET 2003 Paolo Molaro <lupus@ximian.com>
32504
32505         * object.c: register the vtable before there is a chance it's
32506         queried again recursively.
32507
32508 2003-01-13  Duncan Mak  <duncan@ximian.com>
32509
32510         * Makefile.am (libmonoruntime_la_SOURCES): Change gc.h to
32511         gc-internal.h. 
32512         
32513 2003-01-12  Patrik Torstensson <totte@race-x-change.com>
32514
32515         * string-icall.[c|h], icall.c: Added support for CompareOrdinal mode
32516
32517 2003-01-11  Martin Baulig  <martin@ximian.com>
32518
32519         * debug-mono-symfile.h (MONO_SYMBOL_FILE_DYNAMIC_VERSION): Incremented
32520         this to 20 for the release.
32521
32522 2003-01-10  Dietmar Maurer  <dietmar@ximian.com>
32523
32524         * marshal.c (emit_struct_conv): added support for EXPLICIT_LAYOUT
32525
32526         * loader.c (mono_method_get_marshal_info): bug fix
32527
32528         * marshal.c (mono_marshal_get_ptr_to_struct): don't convert
32529         structures with explicit layout
32530
32531 Fri Jan 10 15:58:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32532
32533         * profiler.c: made the output more readable (and sorted). 
32534         Added caller information for the allocation profiler.
32535
32536 2003-01-09  Sebastien Pouliot  <spouliot@videotron.ca>
32537
32538         * icall.c, rand.c, rand.h: Prepended RNG functions with Internal.
32539
32540 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32541
32542         * icall.c: added ves_icall_System_Activator_CreateInstanceInternal. Used
32543         to get value types.
32544         
32545 Thu Jan 9 19:43:11 CET 2003 Paolo Molaro <lupus@ximian.com>
32546
32547         * object.c, profiler.h, profiler.c, profiler-private.h:
32548         Added object allocation profiler.
32549
32550 Thu Jan 9 16:17:00 CET 2003 Paolo Molaro <lupus@ximian.com>
32551
32552         * reflection.h, reflection.c: handle global methods.
32553         Compress blob entries.
32554
32555 Thu Jan 9 15:54:53 CET 2003 Paolo Molaro <lupus@ximian.com>
32556
32557         * marshal.c: fix compilation.
32558
32559 2003-01-09  Dietmar Maurer  <dietmar@ximian.com>
32560
32561         * loader.c (mono_method_get_marshal_info): impl.
32562
32563         * metadata.c (mono_metadata_field_info): use mono_metadata_get_marshal_info
32564
32565 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32566
32567         * icall.c: applied fix from Zoltan Varga that fixes Type.IsPrimitive
32568         for reference types.
32569
32570 Wed Jan 8 20:11:46 CET 2003 Paolo Molaro <lupus@ximian.com>
32571
32572         * loader.c: fixed off by one error in loaded parameter names.
32573
32574 2003-01-08  Dietmar Maurer  <dietmar@ximian.com>
32575
32576         * marshal.c (mono_marshal_get_icall_wrapper): like
32577         mono_marshal_get_native_wrapper, but simpler and use a MonoMethodSignature
32578         instead of a MonoMethod.
32579
32580 2003-01-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32581
32582         * decimal.c: fixed bug #36537.
32583
32584 Mon Jan 6 19:37:59 CET 2003 Paolo Molaro <lupus@ximian.com>
32585
32586         * marshal.c: throw a missing method exception if a
32587         P/Invoke method is not found.
32588
32589 Sun Jan 5 11:57:09 CET 2003 Paolo Molaro <lupus@ximian.com>
32590
32591         * icall.c: allow a null this for constructors.
32592
32593 Sat Jan 4 18:28:42 CET 2003 Paolo Molaro <lupus@ximian.com>
32594
32595         * icall.c: raise the proper exceptions if the arguments to the
32596         internal Invoke are incorrect.
32597
32598 2003-01-03  Dietmar Maurer  <dietmar@ximian.com>
32599
32600         * marshal.c (mono_marshal_get_ptr_to_struct): code cleanups
32601
32602 2003-01-03  Martin Baulig  <martin@ximian.com>
32603
32604         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32605
32606 2002-12-31  Martin Baulig  <martin@ximian.com>
32607
32608         * debug-mono-symfile.c: Completely rewrote the type section.
32609         Instead of using individual malloc()ed fields, we use one big
32610         continuous memory area and offsets into this area.
32611         See the comments in the source code for details.
32612
32613 2002-12-30  Martin Baulig  <martin@ximian.com>
32614
32615         * debug-mono-symfile.h (MonoDebugTypeInfo): Renamed to MonoDebugClassInfo.
32616
32617 2002-12-30  Martin Baulig  <martin@ximian.com>
32618
32619         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Include the
32620         line number table in this data blob instead of using an external
32621         pointer.
32622
32623 2002-12-28  Martin Baulig  <martin@ximian.com>
32624
32625         * debug-mono-symfile.h: Increment MONO_SYMBOL_FILE_DYNAMIC_VERSION.
32626
32627 2002-12-22  Rachel Hestilow  <hestilow@ximian.com>
32628
32629         * marshal.c (mono_marshal_get_runtime_invoke): Support MONO_TYPE_CHAR
32630         as a boxed return type.
32631
32632 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
32633
32634         * appdomain.c
32635         (ves_icall_System_AppDomainSetup_InitAppDomainSetup): Use
32636         g_build_filename to properly get separators on the filename created.
32637
32638         * object.h: Small change, introduce MonoMarshalByRefObject to
32639         track the layout of that structure in the C# universe as we make
32640         changes there.
32641
32642 Thu Dec 19 16:23:19 CET 2002 Paolo Molaro <lupus@ximian.com>
32643
32644         * object.c: removed assert to allow static fields on interfaces.
32645         * loader.c: a TypeSpec may be used for any type, not just arrays.
32646
32647 Thu Dec 19 14:19:42 CET 2002 Paolo Molaro <lupus@ximian.com>
32648
32649         * class.c, class.h: added mono_class_array_element_size ().
32650         Ignore static methods in interfaces.
32651
32652 2002-12-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32653
32654         * threads.c: fixed the build under cygwin.
32655
32656 Wed Dec 18 18:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
32657
32658         * reflection.c: handle nullref constants. Allocate keys for
32659         reflection handles with the GC.
32660
32661 Wed Dec 18 11:34:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32662
32663         * threads.c, threads.h: added mono_thread_get_abort_signal()
32664         to get a suitable signal for thread abort.
32665
32666 Wed Dec 18 11:26:18 CET 2002 Paolo Molaro <lupus@ximian.com>
32667
32668         * metadata.c: fix handling of ExportedType table.
32669
32670 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32671
32672         * icall.c: added WriteWindowsDebugString internal call.
32673
32674 2002-12-15  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32675
32676         * reflection.h: added fields to match C# implementation.
32677
32678 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32679
32680         * icall.c: patch from Jaroslaw Kowalski to fix Environment.MachineName.
32681
32682 2002-12-12  Juli Mallett  <jmallett@FreeBSD.org>
32683
32684         * gc.h, gc-internal.h: Rename header for GC internal calls to
32685         gc-internal.h from gc.h as to not clash with Boehm GC having its
32686         header installed as <gc.h> in outside include paths.
32687         * appdomain.c, gc.c, icall.c, object.c: Account for aforementioned.
32688         * threads.c: If SIGRTMIN is not defined, fall back to SIGUSR1.
32689
32690 2002-12-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32691
32692         * icall.c: assign minor, build and revision in FillName.
32693
32694 2002-12-11  Zoltan Varga  <vargaz@freemail.hu>
32695
32696         * image.h reflection.h reflection.c class.h class.c loader.c object.c:
32697         Added support for running code generated by Reflection.Emit.
32698
32699 2002-12-11  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32700
32701         * appdomain.c: check for NULL argument in LoadFrom.
32702
32703 2002-12-10  Dick Porter  <dick@ximian.com>
32704
32705         * threads.c: WaitHandle fixes from Tum <tum@veridicus.com>
32706
32707 2002-12-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32708
32709         * appdomain.c: fix buglet when building exe file name.  Handle full
32710         assembly name (needed after latest changes to AssemblyName).
32711         * image.c:
32712         (mono_image_close): free some hashtables.
32713
32714 2002-12-05  Dietmar Maurer  <dietmar@ximian.com>
32715
32716         * threads.c (ves_icall_System_Threading_Thread_Abort): we use SIGRTMIN 
32717         instead of SIGUSR1, because SIGUSR1 is used by the pthread implementation 
32718         on some systems (redhat 7.3) 
32719
32720 Thu Dec 5 16:13:40 CET 2002 Paolo Molaro <lupus@ximian.com>
32721
32722         * threads.c: delete the critical section of a sync block,
32723         spotted and fixed by tum@veridicus.com (Thong (Tum) Nguyen).
32724
32725 Thu Dec 5 12:52:52 CET 2002 Paolo Molaro <lupus@ximian.com>
32726
32727         * pedump.c, cil-coff.h, monosn.c: add strong name cli header flag.
32728
32729 2002-12-05  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32730
32731         * appdomain.[ch]: handle the assembly preload event to try loading the
32732         assemblies using the paths we have in the current domain.
32733
32734         * assembly.[ch]: created an assembly preload hook that is called to try
32735         loading the assembly by other means that the ones provided here.
32736
32737         * domain.c: initialize the domain search path.
32738
32739         From now on, assemblies (TODO: except corlib and System) are loaded
32740         according to these rules when using mono_assembly_load ():
32741
32742                 1. It tries to load the assembly from the ApplicationBase
32743                 of the current domain appending .dll and .exe (TODO: have to
32744                 try loading from name/name.dll and name/name.exe).
32745
32746                 2. It tries the search path specified in PrivateBinPath for the
32747                 current domain (if any).
32748
32749                 3. Previous behavior.
32750
32751 Wed Dec 4 16:02:25 CET 2002 Paolo Molaro <lupus@ximian.com>
32752
32753         * icall.c: implemented GetInterfaceMap() related icall.
32754         * domain.c, loader.h: load MethodInfo in mono_defaults.
32755
32756 Wed Dec 4 11:02:30 CET 2002 Paolo Molaro <lupus@ximian.com>
32757
32758         * gc.c: disable the finalizer thread for now, untill all the issues
32759         with it are resolved.
32760
32761 Wed Dec 4 10:44:01 CET 2002 Paolo Molaro <lupus@ximian.com>
32762
32763         * string-icalls.c: handle embedded nulls in string ctor when the
32764         length is specified.
32765
32766 Tue Dec 3 19:29:20 CET 2002 Paolo Molaro <lupus@ximian.com>
32767
32768         * class.c: look for explicit interface implementation in parent
32769         classes, too.
32770
32771 2002-12-03  Dietmar Maurer  <dietmar@ximian.com>
32772
32773         * gc.c (run_finalize): dont run the finalizer (strange behaviour on rh7.3) 
32774
32775 Tue Dec 3 12:40:06 CET 2002 Paolo Molaro <lupus@ximian.com>
32776
32777         * gc.c: protect handles with a critical section.
32778
32779 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32780
32781         * icall.c:
32782         (ves_icall_type_from_name): it now has throwOnError and ignoreCase
32783         parameters. If no assembly specified, try getting the type from all
32784         the assemblies in the current domain, else, load the assembly and get
32785         the type from it.
32786
32787 2002-11-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32788
32789         * marshal.c: applied patch from Aleksey Demakov that fixes
32790         ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringUni.
32791
32792 2002-11-28  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32793
32794         * icall.c: fixed get_location.
32795
32796 2002-11-28  Dietmar Maurer  <dietmar@ximian.com>
32797
32798         * icall.c: moved MONO_ARCH_SAVE_REGS to the end of the
32799         declarations to make it work with older gcc. 
32800
32801         * loader.c (mono_get_method): set signature->pinvoke for native calls
32802
32803 2002-11-20  Dick Porter  <dick@ximian.com>
32804
32805         * threads.c (mono_thread_init): Set the main thread's handle
32806
32807 Tue Nov 19 14:15:34 CET 2002 Paolo Molaro <lupus@ximian.com>
32808
32809         * gc.c: allow compilation without GC support. Changed to match the
32810         mono coding style.
32811
32812 Mon Nov 18 18:41:51 CET 2002 Paolo Molaro <lupus@ximian.com>
32813
32814         * gc.c: don't start the finalizer thread if the env var GC_DONT_GC is set.
32815
32816 Mon Nov 18 16:35:22 CET 2002 Paolo Molaro <lupus@ximian.com>
32817
32818         * reflection.c: set a public key token on the core assemblies.
32819
32820 2002-11-18  Dick Porter  <dick@ximian.com>
32821
32822         * threads.c: Split out some thread initialisation so that other
32823         files can set the start callback function.
32824
32825         * gc.c: Run finalisers in a separate thread, to avoid stack
32826         overflow.  Fixes bug 31333.
32827
32828         * appdomain.c: Set up GC finalisation thread.
32829
32830         * reflection.c: 
32831         * object.c: 
32832         * domain.c: Use gc.h macros for GC_malloc
32833         
32834 2002-11-15  Dick Porter  <dick@ximian.com>
32835
32836         * threadpool.c: 
32837         * threads.c:
32838         * appdomain.c: Removed mono_runtime_init_with_attach(),
32839         mono_thread_create_arg(), and mono_thread_init_with_attach(), by
32840         merging the extra parameter with the existing function.  Removed
32841         unneeded code in mono_thread_attach().
32842
32843 2002-11-14  Dietmar Maurer  <dietmar@ximian.com>
32844
32845         * image.c (mono_image_loaded_by_guid): a method to get loaded
32846         images by guid. 
32847         (load_metadata_ptrs): we store the guid as string.
32848
32849 2002-11-11  Dietmar Maurer  <dietmar@ximian.com>
32850
32851         * assembly.c (mono_assembly_open): check the guid of aot compiled lib.
32852
32853         * metadata.c (mono_guid_to_string): imported method form Zoltan
32854         Varga (slightly modified)
32855
32856         * assembly.c (mono_assembly_open): load precompiled code
32857
32858         * loader.h (MonoMethod): we store the method token for use in the
32859         aot compiler. 
32860
32861 2002-11-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32862
32863         * appdomain.c: insert the loaded assemblies in the domain->assemblies in
32864         the hook function called when an assembly is loaded.
32865         
32866         * domain.c: Modified file.
32867         (mono_domain_assembly_load): removed hash table insertion of assemblies.
32868
32869         Fixes bug #33196.
32870
32871 2002-11-07  Miguel de Icaza  <miguel@ximian.com>
32872
32873         * reflection.c: Map PEFileKind to the value expected by the WinNT
32874         image loader. 
32875
32876 2002-11-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32877
32878         * rand.c: use /dev/urandom. If it fails to open, use the previous one.
32879         Read until the buffer is filled completely.
32880
32881 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32882
32883         * icall.c: implemented MonoType.InternalGetEvent ().
32884
32885 2002-11-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32886
32887         * appdomain.c: implemented InitAppDomainSetup. Delayed
32888         AppDomain.SetupInformation until mono_runtime_exec_main, where we get
32889         the entry_assembly.
32890
32891         * assembly.c: base_dir is now an absolute path ending with
32892         G_DIR_SEPARATOR.
32893
32894         * icall.c: modified get_location according to the above changes.
32895
32896         * object.c: init AppDomain.SetupInformation for the default domain after
32897         we have the entry assembly.
32898
32899         * domain.c: when unloading a domain, setup = NULL.
32900
32901 2002-11-04  Dietmar Maurer  <dietmar@ximian.com>
32902
32903         * marshal.c (emit_ptr_to_str_conv): try to fix bug 29548
32904
32905 Sun Nov 3 15:39:28 CET 2002 Paolo Molaro <lupus@ximian.com>
32906
32907         * object.h, object.c: introduced mono_object_get_virtual_method ()
32908         to lookup the method invoked on an object when a callvirt is done on
32909         a method.
32910         * icall.c: make MethodInfo::Invoke() always do a virtual call.
32911
32912 2002-11-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32913
32914         * appdomain.c: invoke AssemblyLoad and AsemblyResolve events in the
32915         current domain when loaded an assembly and failed to load it.
32916
32917         * icall.c: changed ...Assembly_GetType to Assembly_InternalGetType.
32918
32919 2002-10-31  Dick Porter  <dick@ximian.com>
32920
32921         * icall.c: 
32922         * file-io.h: 
32923         * file-io.c: Return the error status in a parameter, as the
32924         GetLastError() value has long since been blown away if we try and
32925         look it up in a subsequent internal call invocation.  Delete the
32926         GetLastError() internal call, because it's useless.
32927
32928 2002-10-31  Dietmar Maurer  <dietmar@ximian.com>
32929
32930         * class.[ch]: added cast_class to fix bug 29517
32931
32932 Wed Oct 30 19:37:32 CET 2002 Paolo Molaro <lupus@ximian.com>
32933
32934         * marshal.c: create valid IL code in the filter clause:
32935         the new JIT is less forgiving:-)
32936
32937 2002-10-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32938
32939         * icall.c: removed get_property internal call.
32940
32941 2002-10-25  Zoltan Varga  <vargaz@freemail.hu>
32942
32943         * appdomain.h domain.c: Added an ID to appdomains.
32944         
32945         * threads.c threads.h icall.c: Implement icall
32946         Thread:GetDomainID(), and remove unused icall 
32947         CurrentThreadDomain_internal.
32948
32949 2002-10-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
32950
32951         * icall.c: Don't recurse through the base types in GetConstructor.
32952         Fixes bug #32063. 
32953
32954 Thu Oct 24 16:56:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
32955
32956         * mempool.h, mempool.c: added mono_mempool_empty() and
32957         mono_mempool_stats().
32958
32959 2002-10-23  Dick Porter  <dick@ximian.com>
32960
32961         * file-io.c: 
32962         * file-io.h: 
32963         * icall.c: Added MonoIO.GetFileType internal call
32964
32965 2002-10-17  Dick Porter  <dick@ximian.com>
32966
32967         * appdomain.c (mono_runtime_cleanup): Don't signal the async
32968         delegate semaphore before waiting for all threads to finish,
32969         because new threads can also call async delegates.  Fixes bug
32970         32004.
32971
32972         * threadpool.c (async_invoke_thread): Only wait for 500ms instead
32973         of 3 seconds, in case another async job is queued.  (This part is
32974         needed because the bug fix reintroduced the 3s exit lag.)  This
32975         makes the mono_runtime_shutdown flag superfluous.
32976
32977 Thu Oct 17 13:11:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
32978
32979         * reflection.c: include ehader size in method section headers.
32980         Really check for suplicated modules entries.
32981
32982 2002-10-17  Martin Baulig  <martin@gnome.org>
32983
32984         * debug-mono-symfile.c: Added back support for locals.
32985
32986 2002-10-14  Martin Baulig  <martin@gnome.org>
32987
32988         * debug-mono-symfile.c: Added MONO_TYPE_I, MONO_TYPE_U and
32989         MONO_TYPE_VOID.
32990
32991 2002-10-14  Martin Baulig  <martin@gnome.org>
32992
32993         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetType): Use
32994         mono_class_get() instead of looking in the class cache. 
32995
32996 2002-10-13  Martin Baulig  <martin@gnome.org>
32997
32998         * debug-mono-symfile.c: Set version number to 28, include the
32999         signature in method names.
33000
33001 2002-10-13  Martin Baulig  <martin@gnome.org>
33002
33003         * debug-mono-symfile.h: Set version number to 27.
33004
33005 2002-10-11  Martin Baulig  <martin@gnome.org>
33006
33007         * gc.c: Don't register/unregister NULL pointers as disappearing links.
33008
33009 Thu Oct 10 14:56:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33010
33011         * metadata.c, metadata.h: added helper function to allocate signatures.
33012
33013 2002-10-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33014
33015         * icall.c: added internal call to get the location of machine.config.
33016
33017 2002-10-08  Martin Baulig  <martin@gnome.org>
33018
33019         * debug-mono-symfile.c: Ignore classes with a pending init for the
33020         moment.
33021
33022 2002-10-03  Dick Porter  <dick@ximian.com>
33023
33024         * threads.c: Freebsd pthread_t is a pointer
33025
33026 2002-10-03  Dick Porter  <dick@ximian.com>
33027
33028         * socket-io.c: Implemented GetHostName_internal
33029
33030 2002-10-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33031
33032         * mono-config.c:
33033         (mono_config_parse_file): don't leak the text.
33034
33035 2002-10-02  Martin Baulig  <martin@gnome.org>
33036
33037         * debug-mono-symfile.c: Added support for methods.
33038
33039 2002-10-01  Martin Baulig  <martin@gnome.org>
33040
33041         * debug-mono-symfile.c: Don't emit methods and line numbers for
33042         the dynamic symbol file, just write the type table.  We can easily
33043         have an external helper program which creates a symbol file for an
33044         IL file.        
33045
33046 2002-10-01  Dick Porter  <dick@ximian.com>
33047
33048         * threads.c (ves_icall_System_Threading_Thread_Start_internal):
33049         Only add the handle to the cleanup array when we're about to
33050         launch the thread.  Bug 31425 deadlocked when the test was run on
33051         mono under w32.
33052
33053 2002-10-01  Martin Baulig  <martin@gnome.org>
33054
33055         * debug-mono-symfile.c: Added support for properties.
33056
33057 Fri Sep 27 18:55:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33058
33059         * reflection.c: unaligned store fix from Mark Crichton
33060         <crichton@gimp.org>.
33061
33062 2002-09-27  Martin Baulig  <martin@gnome.org>
33063
33064         * icall.c ("System.Reflection.Assembly::GetReferencedAssemblies"):
33065         New interncall.
33066
33067 Fri Sep 27 15:38:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
33068
33069         * assembly.h, assembly.c: use a sane API to hook into the assembly
33070         loading process instead of a useless special-purpouse hack
33071         (ngen needs a hook, too, for example).
33072
33073 2002-09-27  Dick Porter  <dick@ximian.com>
33074
33075         * threads.c (mono_thread_init): Call GetCurrentProcess() so
33076         io-layer can set up some process handle info.  Not needed on w32,
33077         but doesn't hurt either.
33078
33079         * process.c: Pass the program name in the second parameter to
33080         CreateProcess, so the path is searched.  Include the working
33081         directory. Implemented process name, process enumeration, and some
33082         process detail internal calls.
33083         
33084         * icall.c: Added internal calls for process lookup, and some
33085         process details
33086
33087 2002-09-26  Martin Baulig  <martin@gnome.org>
33088
33089         * assembly.c (mono_install_open_assembly_hook): New global
33090         function to install a function to be invoked each time a new
33091         assembly is loaded.
33092         (mono_assembly_open): Run this callback function if set.
33093
33094         * debug-mono-symfile.c: Put back line numbers for the dynamic
33095         symbol file and also record the .il file as source file.  This
33096         allows us to install the temporary symbol file as `file.dbg' just
33097         like a compiler-generated one.
33098
33099 2002-09-26  Nick Zigarovich <nick@chemlab.org>
33100
33101         * Corrected typo in gc.c (BOHEM vs BOEHM).
33102
33103 2002-09-25  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33104
33105         * icall.c: fixed bug #31235 by copying a few lines from GetMethods to
33106         GetProperties. Also avoid calling g_slist_length in GetProperties and
33107         GetMethods.
33108
33109 Wed Sep 25 22:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33110
33111         * reflection.c: avoid unaligned stores (bug spotted by
33112         Mark Crichton  <crichton@gimp.org>).
33113
33114 2002-09-25  Martin Baulig  <martin@gnome.org>
33115
33116         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Use pointers
33117         instead of guint64 for addresses and added prologue/epilogue info.
33118
33119 2002-09-25  Martin Baulig  <martin@gnome.org>
33120
33121         * debug-mono-symfile.h (MonoDebugLineNumberEntry): New type to
33122         store line number info.  For the dynamic symbol file, we only need
33123         to provide the JIT generated dynamic line number info for the dynamic
33124         symbol file.
33125
33126 2002-09-25  Martin Baulig  <martin@gnome.org>
33127
33128         * debug-mono-symfile.h: Incremented version number.
33129
33130 2002-09-24  Martin Baulig  <martin@gnome.org>
33131
33132         * class.c (mono_debugger_class_init_func): New global function
33133         pointer variable.
33134         (mono_class_init): If mono_debugger_class_init_func is non-NULL,
33135         call it.
33136
33137         * debug-mono-symfile.c (mono_debug_symfile_add_type): New
33138         function.  This is called via the mono_debugger_class_init_func
33139         hook to add all types to the dynamic type table.
33140         (ves_icall_MonoDebugger_GetType): New interncall to get a class
33141         from its metadata token.
33142
33143         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetType"):
33144         New interncall for the debugger.
33145
33146 2002-09-24  Nick Drochak <ndrochak@gol.com>
33147
33148         * icall.c (ves_icall_System_Enum_ToObject): validate the type parameter
33149         before using it in case it is null.
33150         
33151 Tue Sep 24 13:24:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
33152
33153         * metadata.c: allow custom modifiers in local var signatures
33154         (bug spotted by Zoltan Varga).
33155
33156 Tue Sep 24 12:12:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
33157
33158         * class.c: deal with the <Module> class that may have a NULL vtable.
33159         Eliminate warnings.
33160
33161 Tue Sep 24 11:28:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33162
33163         * image.c, image.h: more strong name helpers.
33164         * monosn.c: more work: convert pem keys to cryptoapi format.
33165
33166 Tue Sep 24 11:27:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33167
33168         * string-icalls.c: speedup IndexOf.
33169
33170 Tue Sep 24 11:17:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33171
33172         * icall.c: updates from Zoltan.2.Varga@nokia.com.
33173
33174 Tue Sep 24 11:09:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33175
33176         * icall.c: cleanup: use mono_object_domain ().
33177
33178 2002-09-23  Martin Baulig  <martin@gnome.org>
33179
33180         * debug-mono-symfile.c: Improved type support.
33181
33182 2002-09-22  Martin Baulig  <martin@gnome.org>
33183
33184         * debug-mono-symfile.c: Added support for reference types and strings.
33185
33186 2002-09-22  Martin Baulig  <martin@gnome.org>
33187
33188         * debug-mono-symfile.c: Started to work on the type table.
33189
33190 2002-09-21  Martin Baulig  <martin@gnome.org>
33191
33192         * debug-mono-symfile.c: Largely reworked the symbol table format.
33193         The symbol table is now incrementally updated each time a new
33194         method is added.  We're now also using our own magic and version
33195         so that you don't need to recompile all your classes if the
33196         dynamic table changes.
33197         (mono_debug_update_mono_symbol_file): Removed.
33198         (mono_debug_symfile_add_method): New function to add a method.
33199
33200 2002-09-21  Martin Baulig  <martin@gnome.org>
33201
33202         * icall.c
33203         ("System.Reflection.Assembly::MonoDebugger_GetLocalTypeFromSignature"):
33204         New interncall.
33205
33206         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetLocalTypeFromSignature):
33207         New interncall to get a method from its metadata token.
33208
33209 2002-09-21  Martin Baulig  <martin@gnome.org>
33210
33211         * debug-mono-symfile.c: Create type table.
33212
33213 2002-09-20  Martin Baulig  <martin@gnome.org>
33214
33215         * debug-mono-symfile.c: Reflect latest Mono.CSharp.Debugger changes.
33216
33217 2002-09-20  Martin Baulig  <martin@gnome.org>
33218
33219         * debug-mono-symfile.c: Provide information about params and locals.
33220
33221 2002-09-20  Martin Baulig  <martin@gnome.org>
33222
33223         * icall.c ("System.Reflection.Assembly::MonoDebugger_GetMethod"):
33224         New interncall.
33225
33226         * debug-mono-symfile.c (ves_icall_MonoDebugger_GetMethod): New
33227         interncall to get a method from its metadata token.
33228
33229 2002-09-20  Martin Baulig  <martin@gnome.org>
33230
33231         * debug-mono-symfile.c: Added a few checks for method->header
33232         being non-NULL.  This should never happen, but for the moment
33233         let's use a g_warning() rather than a g_assert().
33234
33235 2002-09-19  Mark Crichton  <crichton@gimp.org>
33236
33237         * gc.c: ves_icall_System_GCHandle_FreeHandle made a call to libgc
33238         even if support for it isn't present.  Added an #ifdef to fix this.
33239
33240         * socket-io.c: Added checks back for Solaris support.
33241
33242 2002-09-19  Martin Baulig  <martin@gnome.org>
33243
33244         * debug-mono-symfile.c (read_string, write_string): Reflect latest
33245         changes in the symbol file format.
33246
33247 2002-09-18  Martin Baulig  <martin@gnome.org>
33248
33249         * debug-mono-symfile.c: Set version number to 21.
33250
33251 2002-09-18  Dick Porter  <dick@ximian.com>
33252
33253         * threads.c (mon_new): Use the GC_MALLOC macro to hide differences
33254         on netbsd.  Fixes bug 30051.
33255
33256 2002-09-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33257
33258         * reflection.c:
33259         (set_version_from_string): little fix.
33260
33261 Mon Sep 16 18:57:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33262
33263         * monosn.c, Makefile.am: added strong name utility.
33264         * reflection.h, reflection.c: implemented delayed signing,
33265         locale, version and hash id assembly attributes.
33266
33267 Mon Sep 16 18:51:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
33268
33269         * loader.c, metadata.c: load param attributes in signatures.
33270
33271 2002-09-16  Martin Baulig  <martin@gnome.org>
33272
33273         * debug-mono-symfile.c: Added string table with all method names.
33274
33275 2002-09-14  Martin Baulig  <martin@gnome.org>
33276
33277         * debug-mono-symfile.h (MonoSymbolFile): Added method range table for
33278         fast method lookup.
33279
33280 Fri Sep 13 16:04:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33281
33282         * reflection.c: record the public key token of referenced assemblies.
33283
33284 Fri Sep 13 15:41:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
33285
33286         * image.c, image.h: added functions to get the strong name and the
33287         public key of an assembly.
33288         * pedump.c: use them.
33289
33290 2002-09-12  Dietmar Maurer  <dietmar@ximian.com>
33291
33292         * marshal.c (emit_str_to_ptr_conv): support marshalling of delegates.
33293
33294 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
33295
33296         * marshal.c (mono_marshal_get_managed_wrapper): Added
33297         MONO_TYPE_BOOLEAN 
33298
33299 2002-09-11  Martin Baulig  <martin@gnome.org>
33300
33301         * gc.c: Call GC_unregister_disappearing_link() on all links when
33302         finalizing them, this is necessary to aviod a crash in boehm's
33303         finalize handler.
33304
33305 Wed Sep 11 17:06:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33306
33307         * gc.c: handle GetTarget for finalized objects spotted and fixed by
33308         nick@chemlab.org.
33309
33310 Wed Sep 11 15:27:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
33311
33312         * icall.c: implemented MonoType::Module.
33313         * reflection.c, reflection.h: mono_module_get_object () from
33314         Tomi Pakarinen <tomi.pakarinen@welho.com>.
33315
33316 Wed Sep 11 12:53:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
33317
33318         * icall.c: ignore overridden methods in GetMethods ().
33319         Fix for FieldInfo::SetValue().
33320         * object.c: handle float/double in runtime invoke.
33321
33322 Tue Sep 10 15:51:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
33323
33324         * object.c: allow a constructor to be called again on an object.
33325
33326 Tue Sep 10 11:58:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33327
33328         * class.h, class.c: move field layout code to it's own function and
33329         export it. Get an interface id earlier. Move fields in MonoClass
33330         so they are more cache friendly and align the bitfields.
33331         * loader.c: temporary handle get_param_names() for a runtime method.
33332         * reflection.c, reflection.h: more code to handle runtime creation of
33333         types.
33334
33335 2002-09-09  Martin Baulig  <martin@gnome.org>
33336
33337         * marshal.c (mono_marshal_get_native_wrapper): We need to use a special
33338         signature with the pinvoke field being set for the actual call.
33339
33340 Sat Sep 7 10:12:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33341
33342         * icall.c: removed some unused icalls. Start of map of glib charsets
33343         to corlib names. Implemented RuntimeMethod::GetFunctionPointer ().
33344
33345 Fri Sep 6 16:08:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33346
33347         * debug-helpers.c: break infinite loop (found and fixed by
33348         Holger Arnold <harnold@gmx.de>).
33349
33350 Thu Sep 5 18:50:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
33351
33352         * icall.c: target may be null in create_delegate.
33353
33354 Thu Sep 5 17:42:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
33355
33356         * marshal.c: handle a boolean return type.
33357
33358 Thu Sep 5 13:09:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
33359
33360         * gc.c: put HIDE_POINTER/REVEAL_POINTER only here.
33361
33362 Wed Sep 4 19:23:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33363
33364         * gc.c: fix weakreferences.
33365
33366 Wed Sep 4 13:59:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
33367
33368         * icall.c: added icall to get default codepage.
33369
33370 2002-09-03  Dick Porter  <dick@ximian.com>
33371
33372         * threads.h: 
33373         * threads.c: Use MonoThread instead of MonoObject where
33374         apropriate.
33375
33376         Store running thread objects in a hash table, so that we have all
33377         the info to hand when waiting for them to finish
33378         (means we don't need OpenThread() any more, so mingw builds should
33379         be fully functional again.)
33380
33381         * verify.c:
33382         * object.h: Added thread ID to MonoThread
33383
33384 2002-09-03  Martin Baulig  <martin@gnome.org>
33385
33386         * icall.c (System.Reflection.Assembly::get_location): New interncall.
33387
33388 2002-09-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33389
33390         * icall.c: fixed leak in get_temp_path. Thanks lupus.
33391
33392 2002-09-03  Martin Baulig  <martin@gnome.org>
33393
33394         * debug-helpers.c (mono_disasm_code_one): Added `const guchar **endp'
33395         argument to store the end address of the disassembled instruction.
33396
33397         * debug-mono-symfile.h (MonoDebugMethodInfo, MonoDebugVarInfo): Moved
33398         here from debug-symfile.h.
33399         (MonoDebugMethodJitInfo): Moved all fields which are filled out by the
33400         JIT into this struct.
33401         (MonoSymbolFile): Added `char *image_file' field.
33402         (MonoDebugGetMethodFunc): Removed.
33403         (mono_debug_update_mono_symbol_file): Removed the hash table argument.
33404         (mono_debug_create_mono_symbol_file): Removed the `source_file' argument.
33405         (mono_debug_find_method): New method.
33406
33407         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): Always
33408         create a full symbol file.
33409         (mono_debug_update_mono_symbol_file): Don't distinguish between dynamic
33410         and static symbol files.
33411         (mono_debug_find_method): The symbol file keeps an internal method hash,
33412         call this to get a MonoDebugMethodInfo from a MonoMethod.
33413
33414         * debug-symfile.[ch]: Removed.
33415
33416 2002-08-29  Miguel de Icaza  <miguel@ximian.com>
33417
33418         * image.c (do_mono_image_open): Remove linker version check.
33419
33420 2002-08-29  Dietmar Maurer  <dietmar@ximian.com>
33421
33422         * marshal.c (mono_marshal_get_managed_wrapper): don't cache
33423         wrappers for instance methods.
33424         
33425 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33426
33427         * icall.c: added ves_icall_System_IO_Path_get_temp_path.
33428
33429 2002-08-28  Dick Porter  <dick@ximian.com>
33430
33431         * Makefile.am: Export HOST_CC for w32 builds
33432
33433 Tue Aug 27 18:34:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
33434
33435         * file-io.c process.c: MonoString are null terminated, no
33436         need for mono_string_to_utf16() anymore.
33437
33438 Tue Aug 27 17:51:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33439
33440         * icall.c, unicode.h, unicode.c: removed unused iconv stuff.
33441
33442 Tue Aug 27 16:38:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
33443
33444         * icall.c, reflection.h: speedup System.MonoType.
33445
33446 Tue Aug 27 16:37:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
33447
33448         * reflection.c: allow null as the value of a string argument in
33449         custom attributes constructors.
33450
33451 2002-08-27  Martin Baulig  <martin@gnome.org>
33452
33453         * debug-mono-symfile.h (MonoSymbolFileMethodAddress): Removed the
33454         `trampoline_address' field.
33455
33456 2002-08-27  Dietmar Maurer  <dietmar@ximian.com>
33457
33458         * marshal.c (mono_marshal_get_native_wrapper): removed wrong null
33459         check (fixes bug #29486) 
33460
33461 2002-08-27  Martin Baulig  <martin@gnome.org>
33462
33463         * debug-mono-symfile.c: Changed the file format in a way that allows us
33464         open it read-only and to use a specially malloced area for all the
33465         dynamic data.  We can now also generate a symbol file on-the-fly if we're
33466         debugging IL code and there is no MCS generated symbol file for it.
33467
33468 Mon Aug 26 16:47:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
33469
33470         * object.c: added a define for a good string and array
33471         creation speedup (not enabled by default because we need to deal with
33472         the synch stuff).
33473
33474 2002-08-26  Martin Baulig  <martin@gnome.org>
33475
33476         * debug-mono-symfile.c (mono_debug_create_mono_symbol_file): New
33477         function to create a dynamic symbol file.  This is used by the
33478         debugger to create a symbol file for IL code on-the-fly.
33479
33480 2002-08-26  Martin Baulig  <martin@gnome.org>
33481
33482         * loader.c (mono_lookup_pinvoke_call): Include the error message
33483         from g_module_error() in the error message.
33484
33485 2002-08-24  Martin Baulig  <martin@gnome.org>
33486
33487         * debug-mono-symfile.c (mono_debug_update_mono_symbol_file): New
33488         function to update the symbol file.  The symbol file is mmap()ed
33489         writable, but private.  This allows us to install the symbol file
33490         together with the assembly.
33491
33492 2002-08-24  Martin Baulig  <martin@gnome.org>
33493
33494         * debug-mono-symfile.[ch]: New files.  Similar to debug-symfile.[ch]
33495         but they can read the new symbol file format which mcs is now creating.
33496
33497         * debug-symfile.c (mono_debug_find_source_location): Moved to
33498         debug-mono-symfile.c; this is now operating on the new symbol file.
33499
33500 2002-08-23  Martin Baulig  <martin@gnome.org>
33501
33502         * debug-helpers.c (mono_method_desc_from_method): New function to get
33503         a MonoMethodDesc from a MonoMethod.
33504
33505 Fri Aug 23 15:54:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
33506
33507         * object.c: fixes assertion failure caused by multiple ExecuteAssembly
33508         calls for same domain (patch by Tomi Pakarinen <Tomi.Pakarinen@iki.fi>).
33509
33510 Fri Aug 23 12:14:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
33511
33512         * string-icalls.[ch]: make helper methods static.
33513
33514 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33515
33516         * icall.c: re-applied patch to GetValueInternal. Also added R4 and R8
33517         types to it and to SetValueInternal.
33518
33519         * object.c: Moved handle_enum label to its proper place. This was the
33520         f... bug! ;-)
33521
33522         This time i compiled mcs and gtk-sharp and they both work.
33523
33524 2002-08-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33525
33526         * icall.c: reverted partially my previous patch until 
33527         object.c:set_value handles enums correcly.
33528
33529 2002-08-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33530
33531         * icall.c:
33532         (ves_icall_MonoField_GetValue): changed to use mono_field_get_value.
33533         (ves_icall_System_Environment_get_MachineName): removed warning when
33534         compiling under cygwin.
33535
33536 Thu Aug 22 18:49:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
33537
33538         * object.c: fixed field_get_value() for reference types.
33539
33540 2002-08-22  Dick Porter  <dick@ximian.com>
33541
33542         * socket-io.c (ves_icall_System_Net_Sockets_Socket_RecvFrom_internal):
33543         Don't free a buffer while it's still needed.  Patch from Jonathan
33544         Liger <Jonathan.liger@wanadoo.fr>
33545
33546 2002-08-21  Miguel de Icaza  <miguel@ximian.com>
33547
33548         * icall.c (ves_icall_System_Environment_get_Platform): Add new
33549         internal call.
33550
33551 2002-08-21  Dietmar Maurer  <dietmar@ximian.com>
33552
33553         * icall.c (ves_icall_get_method_info): s/MonoMethod/MonoReflectionMethod/
33554         (ves_icall_get_parameter_info): s/MonoMethod/MonoReflectionMethod/
33555
33556         * marshal.c (mono_marshal_get_remoting_invoke): save lmf, because
33557         we call unmanaged code which throws exceptions.
33558
33559 Wed Aug 21 12:56:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33560
33561         * appdomain.h: added per-domain entry_assembly.
33562         * appdomain.c: ensure mono_runtime_exec_main () gets non-null
33563         arguments.
33564         * icall.c: Assembly::GetEntryAssembly icall.
33565         * object.c: set domain->entry_assembly in mono_runtime_exec_main().
33566         Changes above from a patch by Tomi Pakarinen <tomi.pakarinen@welho.com>.
33567
33568 Tue Aug 20 15:42:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33569
33570         * appdomain.h, gc.c: added mono_domain_finalize ().
33571
33572 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33573
33574         * object.c:
33575         (mono_print_unhandled_exception): changed g_warning by g_printerr
33576         because g_log has a 1024 characters limit (yeah, i got a big stack
33577         trace). Don't print exception name, that should be in ToString 
33578         returned string.
33579
33580 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33581
33582         * icall.c: added ves_icall_FieldInfo_SetValueInternal.
33583         * object.c: added missing MONO_TYPE_ARRAY in mono_runtime_invoke_array.
33584
33585 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33586
33587         * object.c:
33588         (mono_print_unhandled_exception): after previous commit, i realized
33589         that MS calls ToString on the exception. I changed this function to
33590         do that. This way we get stack_trace for free.
33591
33592 2002-08-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33593
33594         * object.c:
33595         (mono_print_unhandled_exception): invoke Message property instead of
33596         getting 'message' field from Exception. Don't allocate memory for
33597         'trace' and 'message' if not needed.
33598
33599 2002-08-18  Dick Porter  <dick@ximian.com>
33600
33601         * unicode.c: Fix asserts to match Encoder.cs checks
33602
33603 Fri Aug 16 21:42:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33604
33605         * marshal.c: fix unaligned store issue and a few wrong
33606         opcode argument types.
33607
33608 2002-08-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33609
33610         * icall.c: added GetUninitializedObjectInternal internal call.
33611
33612 2002-08-16  Dietmar Maurer  <dietmar@ximian.com>
33613
33614         * appdomain.c (mono_runtime_invoke_in_domain): transfer Exception
33615         to the right domain.
33616
33617 2002-08-14  Dietmar Maurer  <dietmar@ximian.com>
33618
33619         * marshal.c (mono_marshal_get_runtime_invoke): unbox value types
33620
33621         * class.c (class_compute_field_layout): set blittable to false for Strings
33622
33623         * appdomain.c (mono_domain_transfer_object): added support for ISerializable
33624
33625 Wed Aug 14 17:26:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33626
33627         * appdomain.h, reflection.c, icall.c, object.c, reflection.h:
33628         first chunk of code to create types at runtime. Code to
33629         handle ReflectedType/DeclaringType. Make reflection handles
33630         domain specific.
33631
33632 Wed Aug 14 17:24:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
33633
33634         * class.c: set correct name in arrays.
33635
33636 2002-08-13  Dietmar Maurer  <dietmar@ximian.com>
33637
33638         * appdomain.c (mono_domain_transfer_object): make it work with
33639         valuetypes. bug fixes.
33640
33641 2002-08-12  Dick Porter  <dick@ximian.com>
33642
33643         * object.h: Rename some parameters to avoid c++ keywords (Patch
33644         from Joseph Wenninger <kde@jowenn.at>)
33645
33646 Thu Aug 8 13:04:18 CEST 2002 Paolo Molaro <lupus@ximian.com>
33647
33648         * icall.c: added icall to implement Assembly.GetFile*.
33649
33650 Thu Aug 8 10:18:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33651
33652         * reflection.h, reflection.c: code to embed managed resources.
33653
33654 Tue Aug 6 17:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
33655
33656         * class.c: move all the type size stuff into
33657         class_compute_field_layout().
33658
33659 Tue Aug 6 11:20:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
33660
33661         * class.c: ensure enums have always the correct instance size.
33662         * unicode.c: remove wrong assert.
33663
33664 Mon Aug 5 19:30:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
33665
33666         * assembly.c: fix mem corruption issue.
33667         * image.h, image.c: added mono_image_get_resource () to access
33668         managed resources.
33669         * icall.c: implemented Assembly.EntryPoint property and some
33670         Managed Resources related internalcalls.
33671
33672
33673 Mon Aug 5 18:18:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
33674
33675         * image.c, image.h: impemented mono_image_get_entry_point ().
33676         * appdomain.c: use mono_image_get_entry_point.
33677
33678 Mon Aug 5 13:08:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33679
33680         * reflection.c: support the object type argument when loading
33681         custom attributes.
33682
33683 2002-08-05  Dietmar Maurer  <dietmar@ximian.com>
33684
33685         * marshal.c (mono_marshal_get_managed_wrapper): add suppport for
33686         String as return type.
33687
33688 Fri Aug 2 21:15:42 CEST 2002 Paolo Molaro <lupus@ximian.com>
33689
33690         * reflection.c: fix encoding of named args for custom attrs to match
33691         the ms implementation. Read them back when instantiating custom
33692         attributes.
33693
33694 2002-08-02  Radek Doulik  <rodo@ximian.com>
33695
33696         * marshal.c (mono_mb_add_data): convert ret value to LE, suggested
33697         by Dietmar as quick fix
33698         (mono_marshal_get_delegate_begin_invoke): use sig->param_count +
33699         16 as stack size, used on more places as quick fix before Dietmar
33700         will fix it properly
33701
33702 Fri Aug 2 17:48:17 CEST 2002 Paolo Molaro <lupus@ximian.com>
33703
33704         * object.h, object.c: added accessors for fields and properties.
33705
33706 Fri Aug 2 17:45:15 CEST 2002 Paolo Molaro <lupus@ximian.com>
33707
33708         * class.c, class.h: made mono_class_get_field_from_name ()
33709         loop on parent types.
33710         Added mono_class_get_property_from_name ().
33711
33712 Fri Aug 2 11:40:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
33713
33714         * class.c, class.h: move the code to setup the type vtable in its own
33715         function so that it can be reused also for types created at runtime.
33716         Eliminate the "class" identifier from the header file.
33717         * reflection.c: setup the vtable for enums so that we can create
33718         objects for use in SetConstant ().
33719
33720 2002-08-02  Dietmar Maurer  <dietmar@ximian.com>
33721
33722         * marshal.c (mono_delegate_to_ftnptr): pass delegate->target
33723         instead of the delegate itself as this pointer (bug #28383)
33724
33725 2002-08-01  Dietmar Maurer  <dietmar@ximian.com>
33726
33727         * marshal.c (mono_marshal_get_managed_wrapper): added return type
33728         conversions.
33729
33730 Wed Jul 31 16:49:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33731
33732         * loader.c: don't set the pinvoke bit on icalls.
33733
33734 2002-07-31  Dietmar Maurer  <dietmar@ximian.com>
33735
33736         * debug-helpers.c (mono_method_full_name): only print a number to
33737         indicate wrapper type (so that the output is more readable in traces).
33738
33739 2002-07-30  Dietmar Maurer  <dietmar@ximian.com>
33740
33741         * class.c (mono_class_init): include method override patch from Paolo
33742
33743 Tue Jul 30 15:20:08 CEST 2002 Paolo Molaro <lupus@ximian.com>
33744
33745         * icall.c: fixed GetTypeCode().
33746
33747 2002-07-29  Dietmar Maurer  <dietmar@ximian.com>
33748
33749         * threads.c (ves_icall_System_Threading_Thread_Thread_internal):
33750         use real delegate invoke function to make it work with multicast
33751         delegates (fix bug# 28291).
33752
33753 Fri Jul 26 11:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
33754
33755         * object.c: load constant strings.
33756
33757 Fri Jul 26 11:36:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
33758
33759         * reflection.c: no magic numbers.
33760         * tabledefs.h: security action enum.
33761
33762 Fri Jul 26 11:22:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
33763
33764         * assembly.c: fix possible memory corruption.
33765
33766 Thu Jul 25 13:58:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
33767
33768         * reflection.h, reflection.c: added support for linking resources.
33769         * verify.c: check we have an updated corlib.
33770
33771 2002-07-25  Dietmar Maurer  <dietmar@ximian.com>
33772
33773         * marshal.c (mono_marshal_get_native_wrapper): correctly marshal
33774         string arrays.
33775         (mono_marshal_string_array): null terminate unmanaged string arrays.
33776         (mono_marshal_get_managed_wrapper): print warning for arrays (not implemented)
33777
33778 Wed Jul 24 13:32:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
33779
33780         * icall.c: Type.GetType () can now return also types from the
33781         calling assembly.
33782
33783 Wed Jul 24 13:04:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33784
33785         * loader.h, loader.c: stack walking support.
33786         * icall.c: implemented GetCurrentMethod, GetExecutingAssembly,
33787         GetCallingAssembly.
33788
33789 2002-07-24  Dietmar Maurer  <dietmar@ximian.com>
33790
33791         * marshal.c: added optimisations for blittable types 
33792
33793         * class.c (mono_array_class_get): do not set blittable attribute on arrays
33794         (mono_class_setup_mono_type): set blittable attribute for single
33795         and double.
33796
33797         * marshal.c (mono_string_utf8_to_builder): impl.
33798         (mono_string_builder_to_utf8): impl.
33799         (mono_marshal_get_native_wrapper): impl. StringBuilder marshaling
33800
33801 2002-07-23  Dietmar Maurer  <dietmar@ximian.com>
33802
33803         * marshal.c (mono_marshal_get_native_wrapper): impl. byref types
33804         (mono_marshal_get_managed_wrapper): impl. byref types
33805
33806 2002-07-23  Gonzalo Paniagua Javier <gonzalo@ximian.com>
33807
33808         * icall.c:
33809         (search_method): don't display debug message. 
33810
33811 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33812
33813         * metadata.c (mono_type_stack_size): removed temporary fix for new gcc
33814
33815 Mon Jul 22 18:17:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
33816
33817         * appdomain.c: set the missing filename when throwing exception.
33818
33819 2002-07-22  Dietmar Maurer  <dietmar@ximian.com>
33820
33821         * metadata.c (mono_type_size): code cleanup
33822         (mono_type_stack_size): removed some test code
33823
33824 2002-07-21  Miguel de Icaza  <miguel@ximian.com>
33825
33826         * appdomain.c (ves_icall_System_Reflection_Assembly_LoadFrom): Use
33827         mono_get_exception_file_not_found now.
33828
33829         * exception.c (mono_exception_from_name_two_strings): New version
33830         that will call a constructor with two string arguments. 
33831         (mono_get_exception_file_not_found): New helper routine, used to
33832         report file-not-found errors.
33833
33834 2002-07-20  Dick Porter  <dick@ximian.com>
33835
33836         * process.h:
33837         * process.c: Pass file handles to CreateProcess
33838         
33839         * icall.c:
33840         * file-io.h:
33841         * file-io.c: Implemented CreatePipe
33842
33843 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33844
33845         * metadata.c (mono_get_param_info): set alignment for value types
33846
33847 Fri Jul 19 18:58:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
33848
33849         * appdomain.h, domain.c, threads-types.h: don't include config.h in headers.
33850         Constify mono_domain_assembly_open().
33851         * loader.c: handle null namespace in icalls.
33852
33853 2002-07-19  Dietmar Maurer  <dietmar@ximian.com>
33854
33855         * marshal.c (emit_ptr_to_str_conv): marshal object as structs
33856         (emit_str_to_ptr_conv): marshal object as structs
33857
33858         * metadata.c (mono_type_to_unmanaged): marshal object as structs
33859
33860         * marshal.c (mono_marshal_get_runtime_invoke): support value types
33861
33862 2002-07-18  Dietmar Maurer  <dietmar@ximian.com>
33863
33864         * marshal.c (mono_marshal_get_runtime_invoke): use exception filters
33865         (mono_marshal_get_native_wrapper): we an now return value types
33866
33867 Wed Jul 17 18:21:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
33868
33869         * verify.c: more checks implemented.
33870
33871 2002-07-17  Dietmar Maurer  <dietmar@ximian.com>
33872
33873         * marshal.c (mono_delegate_to_ftnptr): invoke the right method
33874         (fix bug #27695)
33875         (mono_marshal_get_native_wrapper): allow byref arguments
33876         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringXXX):
33877         impl. PtrToStringXXX methods
33878         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStructure_type): impl.
33879         (ves_icall_System_Runtime_InteropServices_Marshal_OffsetOf): impl.
33880         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalAnsi): impl.
33881         (ves_icall_System_Runtime_InteropServices_Marshal_StringToHGlobalUni): impl.
33882         (ves_icall_System_Runtime_InteropServices_Marshal_DestroyStructure): impl.
33883
33884 Tue Jul 16 19:00:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33885
33886         * reflection.c: fix buglet in parsing an assembly name.
33887
33888 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33889
33890         * marshal.c (emit_ptr_to_str_conv): first impl.
33891
33892 Tue Jul 16 12:39:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
33893
33894         * object.c, class.h: cache the vtable in the class as suggested by
33895         vargaz@freemail.hu (Zoltan Varga).
33896
33897 Tue Jul 16 11:27:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
33898
33899         * class.h, loader.c: added mono_field_from_token().
33900         * verify.c: first cut of type checking code.
33901
33902 2002-07-16  Dietmar Maurer  <dietmar@ximian.com>
33903
33904         * marshal.c (mono_marshal_get_native_wrapper): support valuetypes
33905
33906 2002-07-15  Dietmar Maurer  <dietmar@ximian.com>
33907
33908         * marshal.c (mono_marshal_get_native_wrapper): handle enum types
33909         (fix bug #27782)
33910         (mono_marshal_get_remoting_invoke): impl.
33911         (mono_delegate_begin_invoke): impl.
33912         (mono_mb_emit_save_args): impl.
33913         (mono_delegate_end_invoke): impl.
33914         (mono_marshal_get_delegate_begin_invoke):
33915         (mono_marshal_get_delegate_end_invoke):
33916         (mono_marshal_get_delegate_invoke): generate a special name for
33917         those methods (including the signature) and associate them whith
33918         the delegate class. 
33919
33920 2002-07-13  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
33921
33922         * reflection.[ch]: 
33923         (mono_reflection_type_from_name): now it has a MonoImage parameter
33924         which is used as the default image to search the type in. If the image
33925         is NULL or getting the type from it fails, it defaults to corlib.
33926
33927         * icall.c: changed 1 call to mono_reflection_type_from_name to match
33928         new parameter.
33929
33930 Sat Jul 13 19:32:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
33931
33932         * reflection.c: update the parameter table index.
33933
33934 Sat Jul 13 17:34:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33935
33936         * domain.c: don't include the mark byte in the string hash.
33937
33938 Sat Jul 13 15:06:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
33939
33940         * icall.cs: icall for Type.GetTypeCode ().
33941         * verify: a couple of fixes and disabled local initialization checks.
33942
33943 2002-07-12  Dietmar Maurer  <dietmar@ximian.com>
33944
33945         * marshal.c: better debugging support (DEBUG_RUNTIME_CODE)
33946
33947         * debug-helpers.c (mono_method_full_name): print the type of the
33948         runtime wrapper
33949
33950         * metadata.c (mono_signature_hash): a hash function for signatures
33951         (mono_signature_hash): better hash algorithm
33952
33953         * marshal.c (mono_marshal_get_delegate_invoke): cache methods by signature
33954
33955         * debug-helpers.c (mono_method_full_name): this can now generate
33956         method names with signatures
33957
33958         * marshal.c (mono_marshal_get_managed_wrapper): bug fix: unmanaged
33959         method dont have this pointers.
33960
33961 Fri Jul 12 11:35:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
33962
33963         * reflection.c: fixup typebuilder tokens.
33964         * image.c: fix buglet.
33965         * marshal.h: remove whitespace.
33966         * metadata.h, metadata.c: reinstate code that was removed.
33967         * verify.c: handle catch directives and fix another couple of bugs.
33968
33969 2002-07-11  Dietmar Maurer  <dietmar@ximian.com>
33970
33971         * marshal.c (mono_marshal_get_native_wrapper): support BOOLEAN
33972         (mono_marshal_get_native_wrapper): make it comp. with the old code
33973         (mono_marshal_get_native_wrapper): support boolean
33974         (mono_marshal_get_managed_wrapper): support more types
33975
33976 2002-06-25  Dietmar Maurer  <dietmar@ximian.com>
33977
33978         * class.c (class_compute_field_layout): compute class->blittable attribute.
33979
33980 2002-07-09  Dick Porter  <dick@ximian.com>
33981
33982         * threads.c: Make the thread cleaning up cope with threads that
33983         call ExitThread()
33984
33985 2002-07-08  Radek Doulik  <rodo@ximian.com>
33986
33987         * reflection.c (method_encode_code): use non-translated values to
33988         compute finally_start, this fixes exception handling on ppc, yay!
33989
33990         * decimal.h (struct signscale): fix endianess
33991
33992 2002-07-07  Radek Doulik  <rodo@ximian.com>
33993
33994         * reflection.c: swap box_val and not val
33995
33996 Mon Jul 8 15:18:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
33997
33998         * reflection.c, reflection.h: handle full assembly info in type name.
33999         Handle Type arguments when loading custom attributes.
34000         * icall.c: updated to use new mono_reflection_type_from_name () method.
34001
34002 2002-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34003
34004         * loader.c:
34005         (method_from_memberref): also print assembly name when method not found.
34006
34007 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34008
34009         * icall.c:
34010         (ves_icall_TypeGetProperties): fixed bug #27473. 
34011
34012 2002-07-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34013
34014         * reflection.c: display image name and token when cannot find the
34015         .ctor for an attribute.
34016
34017 2002-07-05  Martin Baulig  <martin@gnome.org>
34018
34019         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
34020
34021 2002-07-04  Dick Porter  <dick@ximian.com>
34022
34023         * threads.c (mono_thread_cleanup): Nasty kludge to get this to
34024         compile on mingw.  This will cause mingw builds to not wait for
34025         subthreads to terminate after the main thread does.  I've lodged a
34026         bug with the mingw developers for them to wrap OpenThread().
34027
34028 2002-07-03  Dick Porter  <dick@ximian.com>
34029
34030         * threads.c: Store thread IDs instead of handles, because
34031         GetCurrentThread() returns a pseudohandle and therefore stores
34032         useless values.  mono_thread_cleanup() continues checking the
34033         array of threads until it is empty, to cope with subthreads
34034         spawning new threads after the main thread has finished.
34035
34036         * profiler.h:
34037         * profiler.c:
34038         * profiler-private.h: Pass the thread ID to thread profiler
34039         functions, instead of a handle
34040
34041 Wed Jul 3 17:43:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34042
34043         * verify.c: fixes to make it more usable.
34044         * pedump.c: added --verify code to verify IL code in an assembly.
34045
34046 Tue Jul 2 20:40:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34047
34048         * reflection.c: turn errors into warnings to allow compiling corlib.
34049
34050 Tue Jul 2 19:33:20 CEST 2002 Paolo Molaro <lupus@ximian.com>
34051
34052         * reflection.c: add special cases to compile corlib.
34053
34054 Mon Jul 1 18:00:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34055
34056         * reflection.c: handle properties with only a set method.
34057
34058 Mon Jul 1 17:11:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34059
34060         * opcodes.h: add enum with opcodes in opval order.
34061
34062 2002-07-01  Dick Porter  <dick@ximian.com>
34063         
34064         * object.h:
34065         * object.c (mono_runtime_run_main): Removed unneeded argument
34066
34067 2002-06-28  Martin Baulig  <martin@gnome.org>
34068
34069         * debug-symfile.c: Reflect latest MonoDwarfFileWriter changes.
34070
34071 2002-06-27  Dick Porter  <dick@ximian.com>
34072
34073         * threads.c: Store the handle in both the parent thread and in the
34074         subthread, to minimise the time between starting a new thread and
34075         storing its ID.
34076
34077 2002-06-26  Dick Porter  <dick@ximian.com>
34078
34079         * appdomain.c (mono_runtime_cleanup): Close the socket library
34080         after all the threads have finished, not before
34081
34082 2002-06-26  Martin Baulig  <martin@gnome.org>
34083
34084         * debug-symfile.c (mono_debug_find_source_location): Added
34085         `guint32 *line_number' argument.  If it's not NULL, store the line number
34086         there and return the file name without the line number.
34087
34088 2002-06-25  Dick Porter  <dick@ximian.com>
34089
34090         * icall.c:
34091         * process.h:
34092         * process.c: Process forking and other support functions
34093
34094 2002-06-25  Dick Porter  <dick@ximian.com>
34095
34096         * image.c (do_mono_image_open): Set ref_count to 1, so that bad
34097         things dont happen when the image is closed.
34098         (mono_image_lookup_resource): Walk the resource section looking
34099         for a particular entry
34100
34101         * cil-coff.h: PE resource section decoding
34102
34103 2002-06-25  Dick Porter  <dick@ximian.com>
34104         
34105         * assembly.h:
34106         * assembly.c: 
34107         (mono_assembly_foreach): Accessor functions to walk the list of
34108         loaded assemblies
34109         (mono_assembly_set_main):
34110         (mono_assembly_get_main): Process methods need to know which
34111         assembly is the "main" one
34112
34113         * object.c (mono_runtime_run_main): Record the main assembly
34114
34115         * debug-helpers.c: Fix typo
34116
34117 2002-06-24  Dietmar Maurer  <dietmar@ximian.com>
34118
34119         * icall.c (ves_icall_System_Runtime_InteropServices_Marshal_copy_to_unmanaged): impl.
34120         (ves_icall_System_Runtime_InteropServices_Marshal_copy_from_unmanaged): impl.
34121
34122 Sat Jun 22 11:37:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34123
34124         * icall.c: fix off-by-one in Assembly.GetTypes() reported by bob@karr.ath.cx.
34125
34126 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
34127
34128         * image.c (do_mono_image_open): Initialize reference count,
34129         otherwise we leak the MonoImage.
34130
34131 Fri Jun 21 19:16:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
34132
34133         * reflection.c: small tweak to handle self-hosting.
34134
34135 Thu Jun 20 23:28:13 CEST 2002 Paolo Molaro <lupus@ximian.com>
34136
34137         * reflection.c: fix type name parse code.
34138
34139 Thu Jun 20 19:24:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34140
34141         * reflection.c: break out of the loop.
34142         * image.c: special case corlib.
34143
34144 Thu Jun 20 16:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34145
34146         * reflection.c: add all the custom attrs at the end to ensure the
34147         ctors have been properly initialized when the attributes are defined
34148         in the current assembly.
34149
34150 Thu Jun 20 13:46:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34151
34152         * reflection.c: handle correctly multiple-nested types.
34153
34154 Thu Jun 20 11:49:00 CEST 2002 Paolo Molaro <lupus@ximian.com>
34155
34156         * row-indexes.h: fix typos.
34157         * reflection.c: adjust for typos and fix method_def_or_ref
34158         encoding in MethodImpl table.
34159
34160 Wed Jun 19 21:57:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34161
34162         * reflection.c: fix entry point patching (thanks Serge!).
34163
34164 2002-06-18  Dietmar Maurer  <dietmar@ximian.com>
34165
34166         * verify.c: add check for System.Exception
34167
34168 Mon Jun 17 20:23:23 CEST 2002 Paolo Molaro <lupus@ximian.com>
34169
34170         * image.c, class.c: minifix for code just c&p'ed.
34171         * reflection.c: warning fix.
34172         * object.h, loader.h, domain.c: load also StringBuilder.
34173
34174 Mon Jun 17 17:29:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
34175
34176         * marshal.h, marshal.c: some support code to handle complex marshaling.
34177
34178 Mon Jun 17 16:32:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34179
34180         * class.h, class.c, reflection.c: handle ignorecase in GetType ().
34181         Better signatures with vtable error dump.
34182
34183 Mon Jun 17 16:13:35 CEST 2002 Paolo Molaro <lupus@ximian.com>
34184
34185         * reflection.c, reflection.h, icall.c: fixes for multiple-nested types.
34186
34187 2002-06-17  Dietmar Maurer  <dietmar@ximian.com>
34188
34189         * icall.c (ves_icall_Type_GetField): impl.
34190
34191 Mon Jun 17 16:08:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34192
34193         * metadata.h, metadata.c: added mono_metadata_get_marshal_info()
34194         to retrieve a marshal description blob for a field or param.
34195
34196 Mon Jun 17 14:57:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
34197
34198         * reflection.h, reflection.c: change order of nested type emission
34199         to avoid table corruption. The NestedTypes table is sorted.
34200         * icall.c: change order of GetConstructor results to workaround mcs bug.
34201
34202 Fri Jun 14 16:24:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34203
34204         * reflection.h, reflection.c: handle field and param marshal
34205         information.
34206
34207 Wed Jun 12 16:30:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
34208
34209         * icall.c, marshal.c marshal.h: more Marshal class implementation.
34210
34211 Tue Jun 11 17:29:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34212
34213         * reflection.c: fix call convention.
34214
34215 Tue Jun 11 16:52:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34216
34217         * reflection.h, reflection.c: mono_image_get_memberref_token()
34218         takes a type instead of a class, now. Added
34219         mono_image_get_array_token() to create tokens for the special
34220         multi-dim array methods.
34221
34222 Tue Jun 11 13:21:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
34223
34224         * assembly.c: handle modules (no assembly table). Split
34225         loading references in its own function.
34226         * class.c: handle moduleref resolution scope.
34227         * image.c, image.h: cache module name in image.
34228
34229 2002-06-07  Martin Baulig  <martin@gnome.org>
34230
34231         * reflection.c (mono_image_get_type_info): Only add a class layout entry
34232         if we actually have a `tb->class_size' (ie. it's not UnspecifiedTypeSize).
34233
34234 Fri Jun 7 22:07:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34235
34236         * icall.c: more signature fixes that used uint instead of int.
34237
34238 Fri Jun 7 20:41:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34239
34240         * reflection.c: fixed signature of field refs.
34241
34242 Fri Jun 7 19:41:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34243
34244         * class.c, reflection.c: handle typerefs of nested types
34245         (both on read and when writing files).
34246
34247 Fri Jun 7 17:46:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
34248
34249         * icall.c: fix method signatures that tried to workaround the previous
34250         typo, d'oh!
34251
34252 Fri Jun 7 17:36:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34253
34254         * debug-helpers.c: fix typo.
34255
34256 Fri Jun 7 17:00:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34257
34258         * cil-coff.h, icall.c, image.c, reflection.c, reflection.h:
34259         rewrote the PE/COFF writing code (our programs are understood by the
34260         ms runtime, now).
34261
34262 Tue Jun 4 18:10:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
34263
34264         * gc.c, gc.h, icall.c: weakreference support.
34265
34266 Tue Jun 4 16:06:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
34267
34268         * Makefile.am, mono-config.c: use $(sysconfdir).
34269
34270 Mon Jun 3 13:13:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34271
34272         * icall.c: changed default precision of Double.ToString() to 15.
34273         Fixed memory leak. Unified with Single.ToString.
34274
34275 Sat Jun 1 14:26:45 CEST 2002 Paolo Molaro <lupus@ximian.com>
34276
34277         * sysmath.c: workaround systems missing NAN and/or HUGE_VAL.
34278
34279 Sat Jun 1 13:46:54 CEST 2002 Paolo Molaro <lupus@ximian.com>
34280
34281         * pedump.c, appdomain.c, appdomain.h, assembly.c, domain.c,
34282         gc.c, icall.c, image.c, mono-config.c, reflection.c: killed
34283         warnings and compilation fixes from Dennis Haney (davh@davh.dk)
34284         and myself.
34285
34286 Fri May 31 16:58:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34287
34288         * debug-symfile.c, sysmath.c: yet more compilation fixes.
34289
34290 Fri May 31 16:35:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34291
34292         * reflection.c, socket-io.c: more compilation fixes.
34293
34294 Fri May 31 15:58:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34295
34296         * appdomain.c, class.c, class.h, debug-symfile.c, decimal.c,
34297         domain.c, loader.c, object.c, object.h, reflection.c, string-icalls.h,
34298         unicode.c: warning and compiler compatibility fixes.
34299
34300 Fri May 31 15:36:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34301
34302         * class.h, metadata.c: fixed warnings/compilation errors.
34303
34304 Fri May 31 13:08:25 CEST 2002 Paolo Molaro <lupus@ximian.com>
34305
34306         * Makefile.am, mono-config.c, mono-config.h: configuration file
34307         support routines.
34308         * loader.c, loader.h: make Dll mapping configurable at runtime in the
34309         config file. Export methods to insert and lookup mappings.
34310
34311 Fri May 31 12:45:38 CEST 2002 Paolo Molaro <lupus@ximian.com>
34312
34313         * reflection.c: handle types and boxed objects in custom attr
34314         constructors.
34315
34316 2002-05-30  Martin Baulig  <martin@gnome.org>
34317
34318         * debug-symfile.c
34319         (ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token): Removed.
34320
34321 Thu May 30 14:15:02 CEST 2002 Paolo Molaro <lupus@ximian.com>
34322
34323         * metadata.c, metadata.h: added mono_metadata_implmap_from_method()
34324         to lookup the implmap row for a P/Invoke method.
34325         * loader.c: added mono_lookup_pinvoke_call(): we only lookup a
34326         P/Invoke method from the runtime on an as needed basis.
34327
34328 2002-05-28  Dietmar Maurer  <dietmar@ximian.com>
34329
34330         * metadata.c (mono_metadata_parse_signature): impl.
34331
34332 Tue May 28 16:02:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34333
34334         * class.c: handle .pack directive.
34335
34336 Tue May 28 11:04:46 CEST 2002 Paolo Molaro <lupus@ximian.com>
34337
34338         * object.c: initialize static fields with RVA data.
34339
34340 2002-05-25  Martin Baulig  <martin@gnome.org>
34341
34342         * debug-symfile.c
34343         (ves_icall_Debugger_DwarfFileWriter_get_type_token): Removed.
34344
34345 2002-05-24  Martin Baulig  <martin@gnome.org>
34346
34347         * debug-symfile.c
34348         (ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig): Removed.
34349         (ves_icall_Debugger_MonoSymbolWriter_method_from_token): Renamed to
34350         `ves_icall_Debugger_MonoSymbolWriter_method_builder_from_token'.
34351
34352 Thu May 23 18:44:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
34353
34354         * object.c: special case string ctros in invoke.
34355         * gc.c: silly whitespace changes.
34356
34357 2002-05-23  Dietmar Maurer  <dietmar@ximian.com>
34358
34359         * threadpool.[ch]: impl. a threadpool that can
34360         be used by mint and mono.
34361
34362 2002-05-22  Martin Baulig  <martin@gnome.org>
34363
34364         * debug-symfile.c (ves_icall_Debugger_MonoSymbolWriter_method_from_token):
34365         The first argument is now a `MonoReflectionModuleBuilder *', the return
34366         value is a `MonoReflectionModuleBuilder *'.  Use the AssemblyBuilder's
34367         `methods' field to get the method builder.  The `token' argument is the
34368         unfixed token.
34369
34370         * unicode.c (iconv_get_length, iconv_convert): Silently ignore all
34371         invalid characters instead of g_assert_not_reached()ing.  This seems
34372         to be the behaviour of mscorlib.
34373
34374 2002-05-22  Dietmar Maurer  <dietmar@ximian.com>
34375
34376         * object.c (mono_runtime_invoke_array): applied patch from Rachel
34377         Hestilow to fix bug #25104
34378
34379 2002-05-21  Martin Baulig  <martin@gnome.org>
34380
34381         * debug-symfile.c (mono_debug_find_source_location): New function.
34382         Looks up an IL offset in the line number table and returns the source
34383         location as a string.
34384
34385 2002-05-21  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34386
34387         * icall.c:
34388         (mono_double_ToStringImpl): changed %f by %g until we have something
34389         better.
34390
34391 2002-05-21  Nick Drochak  <ndrochak@gol.com>
34392
34393         * icall.c : Use different name for Math.Pow's icall.  Needed to check
34394         parameters first in C#.
34395
34396 Mon May 20 17:36:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34397
34398         * icall.c, reflection.h: added icall to get info about an event.
34399
34400 2002-05-20  Radek Doulik  <rodo@ximian.com>
34401
34402         * object.c (mono_value_box): don't use memcpy for boxing on BIG
34403         endian
34404         (mono_value_box): don't use memcpy for small sizes on
34405         architectures with unaligned access
34406
34407 2002-05-20  Martin Baulig  <martin@gnome.org>
34408
34409         * reflection.c (mono_reflection_setup_internal_class): Don't crash
34410         if `tb->parent == NULL'.
34411         (mono_reflection_create_internal_class): New function.  This is
34412         called from TypeBuilder.CreateType() and sets `klass->enum_basetype'
34413         for enum types.
34414
34415         * icall.c ("System.Reflection.Emit.TypeBuilder::create_internal_class"):
34416         New interncall.
34417
34418 2002-05-19  Martin Baulig  <martin@gnome.org>
34419
34420         * unicode.c (ves_icall_iconv_get_bytes): Actually use the `charCount'
34421         argument to get the length, don't default to the array length.
34422
34423 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
34424
34425         * assembly.c (mono_assembly_setrootdir): New function used to
34426         override the MONO_ASSEMBLIES directory.
34427
34428 Fri May 17 20:39:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34429
34430         * icall.c: ValueType_GetHashCode() initialize local var.
34431
34432 Thu May 16 17:20:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34433
34434         * reflection.c: sort custom attributes table.
34435
34436 Thu May 16 16:08:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34437
34438         * reflection.c: support named args in custom attributes (write support).
34439
34440 Thu May 16 13:04:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
34441
34442         * reflection.c: fix finally position calculation.
34443
34444 2002-05-15  Radek Doulik  <rodo@ximian.com>
34445
34446         * reflection.c: fixed endianess at many places
34447
34448         * icall.c (ves_icall_InitializeArray): comment out debug msg
34449
34450 2002-05-15  Dietmar Maurer  <dietmar@ximian.com>
34451
34452         * object.c (mono_unhandled_exception): new function to handle
34453         unhandled exceptions.
34454         (mono_unhandled_exception): call the UnhandledException event.
34455         (mono_runtime_delegate_invoke): impl.
34456
34457 Wed May 15 15:59:55 CEST 2002 Paolo Molaro <lupus@ximian.com>
34458
34459         * metadata.h, metadata.c, class.c: mono_metadata_field_info ()
34460         returns the RVA, not the direct pointer to the data. Handle the case
34461         when the class size is fixed.
34462
34463 Tue May 14 16:59:44 CEST 2002 Paolo Molaro <lupus@ximian.com>
34464
34465         * reflection.c: fix some endianess issues.
34466
34467 2002-05-14  Dietmar Maurer  <dietmar@ximian.com>
34468
34469         * object.c (mono_runtime_invoke): is now able to catch exceptions.
34470
34471         * threads.c (mono_thread_init): added a callback which is invoked
34472         at thread start.
34473
34474 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34475         
34476         * icall.c: make GetHashCode return non-negative values.
34477
34478 2002-05-14  Dan Lewis  <dihlewis@yahoo.co.uk>
34479
34480         * object.c, icall.c, gc.c: revert to address-based hashcode.
34481
34482 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
34483
34484         * icall.c (mono_double_ParseImpl): Added ParseImpl method.
34485
34486 Mon May 13 16:40:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34487
34488         * icall.c, class.c: special case <Module>.
34489
34490 2002-05-13  Dan Lewis  <dihlewis@yahoo.co.uk>
34491
34492         * icall.c: fix bug in GetNow().
34493
34494 2002-05-11  Dietmar Maurer  <dietmar@ximian.com>
34495
34496         * object.c (mono_runtime_class_init): make sure that we call all
34497         static class constructors.
34498
34499 Fri May 10 18:14:51 CEST 2002 Paolo Molaro <lupus@ximian.com>
34500
34501         * reflection.c: sort methodsemantics table.
34502
34503 Fri May 10 16:31:49 CEST 2002 Paolo Molaro <lupus@ximian.com>
34504
34505         * reflection.h, reflection.c: honour init locals setting.
34506
34507 Thu May 9 18:50:00 EDT 2002 Daniel Morgan <danmorg@sc.rr.com>
34508
34509         * icall.c: copied Double ToStringImpl for Single ToStringImpl
34510
34511 Wed May 8 12:28:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34512
34513         * reflection.c: support ContructorBuilders in attribute blob creation.
34514
34515 Wed May 8 12:06:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34516
34517         * reflection.c: some changes to build a binary that can be run
34518         directly in windows.
34519
34520 Mon May 6 13:10:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34521
34522         * loader.c: print a big message when an icall can't be found.
34523
34524 2002-05-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34525
34526         * string-icalls.c: fix bug 24248.
34527
34528 Sat May 4 14:03:21 CEST 2002 Paolo Molaro <lupus@ximian.com>
34529
34530         * appdomain.c, appdomain.h, assembly.c, assembly.h, image.h,
34531         icall.c, reflection.h: separate assembly loading by pathname and by
34532         assembly name. Use the MONO_PATH env var to search for assemblies.
34533
34534 Thu May 2 17:56:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34535
34536         * assembly.c, image.h: add some support for assemblies
34537         with multiple modules.
34538         * class.c, class.h: export mono_class_from_typeref().
34539         * loader.c: remove duplicated code and use mono_class_from_typeref(),
34540         instead.
34541
34542 Thu May 2 15:51:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34543
34544         * unicode.c: Char.IsNumber doesn't include hex digits as the ms
34545         documentation says (the ECMA one is correct).
34546
34547 2002-05-02  Dick Porter  <dick@ximian.com>
34548
34549         * threads.c: Use GC_debug_register_finalizer with GC_debug_malloc.
34550         Don't name the synchronisation mutex.
34551
34552 2002-04-30  Jeffrey Stedfast  <fejj@ximian.com>
34553
34554         * rand.c
34555         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetBytes):
34556         Make the prototypes match.
34557         (ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_GetNonZeroBytes):
34558         Same.
34559
34560         * icall.c
34561         (ves_icall_System_CurrentTimeZone_GetTimeZoneData): Fixed for
34562         systems that use 'timezone' rather than tm.tm_gmtoff. Also, not
34563         all systems have tm.tm_zone, so use strftime() with %Z to print
34564         the timezone abreviation into a temp string.
34565
34566         * object.c (mono_ldstr): Fixed to use mono_string_chars() macro
34567         rather than mono_array_addr() on a MonoString on Big Endian
34568         machines.
34569
34570 2002-04-30  Dietmar Maurer  <dietmar@ximian.com>
34571
34572         * string-icalls.c (ves_icall_System_String_InternalReplace_Str):
34573         fix bug 24041
34574
34575 2002-04-30  Dick Porter  <dick@ximian.com>
34576
34577         * socket-io.c: Cope with SOCKET being an integer rather than a
34578         pointer now.
34579
34580         * threads.c: Added Thread_free_internal, to deal with thread
34581         handle cleanup.  Moved calls to handle_store() and handle_remove()
34582         to start_wrapper(), so each can only be called once.  Allocate
34583         synchronisation blocks with GC_malloc(), and use GC finalisation
34584         to close the handles.
34585
34586         * icall.c: added System.Threading.Thread::Thread_free_internal
34587
34588 Mon Apr 29 15:33:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34589
34590         * icall.c: support Environment.Exit, CommandLineArgs().
34591
34592 Mon Apr 29 15:15:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
34593
34594         * object.c, object.h: added mono_runtime_run_main () and
34595         mono_runtime_get_main_args () for use in System.Environment.
34596
34597 Mon Apr 29 13:45:11 CEST 2002 Paolo Molaro <lupus@ximian.com>
34598
34599         * gc.c: fix thinko, enable actual finalization since the jit is now
34600         fixed.
34601
34602 Mon Apr 29 12:47:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34603
34604         * gc.c, object.c: take into account that an object may be offset wrt the address
34605         returned by GC_malloc().
34606
34607 Mon Apr 29 12:14:39 CEST 2002 Paolo Molaro <lupus@ximian.com>
34608
34609         * image.c: handle files without entries in the assembly table (modules).
34610
34611 2002-04-28 Patrik Torstensson <patrik.torstensson@intel.com>
34612
34613         * reflection.c (mono_reflection_setup_internal_class): remove g_assert_not_reached() to allow 
34614         mcs selfhosting again (build breaker) and did move the check to class instead. parent is
34615         allowed to be null when it's System.Object class setup.
34616
34617 2002-04-27  Martin Baulig  <martin@gnome.org>
34618
34619         * reflection.c (mono_reflection_setup_internal_class): g_assert_not_reached()
34620         if `tb->parent == NULL' rather than crashing.
34621
34622 2002-04-28  Nick Drochak  <ndrochak@gol.com>
34623
34624         * sysmath.c (ves_icall_System_Math_Asin): Fix copy-paste error.  Was
34625         calling acos() where asin() should have been called.
34626
34627 2002-04-26  Martin Baulig  <martin@gnome.org>
34628
34629         * assembly.c (default_assembly_name_resolver): Use G_FILE_TEST_IS_REGULAR
34630         instead of G_FILE_TEST_EXISTS - if you're in mcs/class/corlib/System/Test,
34631         there's a subdirectory called `System', but we don't want to read that
34632         subdirectory as an assembly.
34633
34634 2002-04-25  Martin Baulig  <martin@gnome.org>
34635
34636         * debug-symfile.c: Reflect latest MonoString changes.
34637
34638 Thu Apr 25 16:38:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
34639
34640         * rand.c, rand.h: instance method icalls need to have an explicit
34641         this pointer as first argument in the C implementation.
34642
34643 2002-04-25  Nick Drochak <ndrochak@gol.com>
34644
34645         * icall.c: Fix typo in map for GetNonZeroBytes
34646
34647 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34648
34649         * string-icalls.c : String does now passes unit tests without any 
34650         errors, the following changes has been made:
34651         
34652         Implemented replace methods.
34653         Renaming of methods to (try) follow the standard.
34654         Fixed compare ordinal
34655         Made all memory allocated directly to function instead of via icall function.
34656         Small performance fix in is_in_array function
34657                         
34658  (2002-04-23) Changes from Duncan Mak <duncan@ximian.com>
34659
34660         c (mono_string_Internal_ctor_charp_int_int):
34661         (mono_string_Internal_ctor_sbytep_int_int):  Removed check for
34662         sindex < 0, throw ArgumentOutOfRangeException instead of
34663         ArgumentNullException.
34664
34665         Added new check for length == 0, however
34666         I need to make it return String.Empty from the C code.
34667         
34668         (mono_string_Internal_ctor_sbytep): Use mono_string_new, and let
34669         that calculate the length for us here.
34670         
34671         (mono_string_Internal_ctor_sbytep_int_int): Replaced
34672         mono_string_new_utf16 with mono_string_new, since value is utf8.
34673
34674 Wed Apr 24 18:43:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34675
34676         * object.c: register the object for finalization if needed.
34677         Allocate one more char in the string for the terminating 0 char.
34678
34679 Wed Apr 24 18:22:27 CEST 2002 Paolo Molaro <lupus@ximian.com>
34680
34681         * class.c, class.h, image.c: check if a type implemenst a destructor.
34682         Use the proper key for array class lookups.
34683         * icall.c: register the icalls in the System.GC class.
34684         * gc.c, gc.h: GC-related functions and icalls.
34685
34686 2002-04-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34687
34688         * icall.c:
34689         * socket-io.c:
34690         * unicode.c: free some strings gotten from mono_string_to_utf8 and
34691         changed a couple of free () by g_free ().
34692
34693         * decimal.c: one-liner in the comments for decimal2string ().
34694
34695 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34696
34697         * object.c (mono_runtime_invoke_array) : Bug because of my incompetence.
34698
34699 2002-04-24      Patrik Torstensson <patrik.torstensson@labs2.com>
34700
34701         * reflection.c (mono_reflection_get_custom_attrs) : fixed image bug (crash)
34702         * object.c (mono_runtime_invoke_array) : handle null in params
34703
34704 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34705
34706         * string-icalls.c: fixed bug in split (one off bug)
34707
34708 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34709
34710         * string-icalls.c: fixed bug in remove and lastindexofany, add equals icall.
34711         * icalls.c: added String::Equals as internal method
34712
34713 2002-04-23      Patrik Torstensson <patrik.torstensson@labs2.com>
34714
34715         * threads.c: fixed bug in the double interlocked functions
34716
34717 2002-04-22      Patrik Torstensson <patrik.torstensson@labs2.com>
34718
34719         * threads.c: implemented all of the new interlocked icalls.
34720         * string-icalls.c: fix a bug in insert.
34721         * icalls.c: added the icalls for interlocked, removed old string functions.
34722         
34723 Mon Apr 22 19:44:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34724
34725         * loader.c: fix off-by-one error when reading argument names.
34726
34727 Mon Apr 22 19:28:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34728
34729         * profiler.c: win32 counter implementation (untested).
34730         * icall.cs: win32 GetNow() and GetTimeZoneData() implementations
34731         (the latter needs testing and more complete impl. from win32 folks).
34732
34733 2002-04-21  Dan Lewis  <dihlewis@yahoo.co.uk>
34734
34735         * object.c: mono_array_new_full workaround mono_array_class_get
34736         problem.
34737
34738 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34739
34740         * string-icalls.c (mono_string_InternalRemove): Fixed overwrite bug.
34741         * object.h (mono_string_chars): Changed casting type.
34742
34743 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34744
34745         * string-icalls.c: Fixed trim method, added the constructors done by Duncan, fixed
34746                            method signatures to use gunichar2 instead of gint16.
34747
34748 2002-04-20  Dan Lewis  <dihlewis@yahoo.co.uk>
34749
34750         * object.h, object.c: domain-specific versions of mono_object_new and
34751         mono_array_new.
34752
34753 2002-04-20  Dietmar Maurer  <dietmar@ximian.com>
34754
34755         * object.c: changed String layout
34756
34757         * string-icalls.c (mono_string_Internal_ctor_chara): added
34758         internal string constructors.
34759
34760 Sat Apr 20 13:33:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
34761
34762         * threads.c: pass 'this' to the thread start routine.
34763
34764 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34765
34766         * string-icalls.c: fix IndexOf and LastIndexOf. Now
34767         InternalCompareStr don't call twice mono_string_cmp_char for the last
34768         character. Improved performance in mono_string_cmp_char.
34769
34770 Fri Apr 19 19:26:28 CEST 2002 Paolo Molaro <lupus@ximian.com>
34771
34772         * Makefile.am, appdomain.c, class.c, object.c: split runtime-depended
34773         code into its own library: libmonoruntime.
34774
34775 2002-04-19  Dan Lewis  <dihlewis@yahoo.co.uk>
34776
34777         * object.h, object.c: changed array format so that szarrays do not
34778         require a bounds structure.
34779         * icall.c, appdomain.c: support for new szarray format.
34780
34781 Fri Apr 19 18:04:34 CEST 2002 Paolo Molaro <lupus@ximian.com>
34782
34783         * metadata.c: compare also the retuns type when comparing signatures:
34784         we didn't do this as an optimization since really overloaded methods
34785         must differ also in the arguments, but this doesn't work with
34786         low-level IL code (or when using explicit conversion operators: see
34787         bug#23498 for an example).
34788
34789 Fri Apr 19 16:14:52 CEST 2002 Paolo Molaro <lupus@ximian.com>
34790
34791         * loader.c: SZARRAY types can be saved as TYPESPEC, too.
34792
34793 Thu Apr 18 17:15:09 CEST 2002 Paolo Molaro <lupus@ximian.com>
34794
34795         * icall.c: make MonoType::GetElementType its own icall.
34796
34797 Thu Apr 18 16:41:30 CEST 2002 Paolo Molaro <lupus@ximian.com>
34798
34799         * icall.c: remove MonoMethod_get_Name().
34800         * reflection.c, reflection.h, verify: cache the method name in the MonoMethod
34801         object.
34802
34803 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34804
34805         * string-icalls.c: optimized a few methods.
34806
34807 2002-04-17      Patrik Torstensson <patrik.torstensson@labs2.com>
34808
34809         * icall.c: added all new string internal calls
34810         * string-icalls.c: added, new string internal call implementation.
34811         * object.c: added mono_string_new_size for allocating a string a size
34812
34813 2002-04-17  Dietmar Maurer  <dietmar@ximian.com>
34814
34815         * object.c (mono_object_isinst): use the same code as in the
34816         optimized x86 version.
34817
34818 Wed Apr 17 14:14:36 CEST 2002 Paolo Molaro <lupus@ximian.com>
34819
34820         * profiler.c: TSC-based timer code (faster and more accurate).
34821         Not hooked up in configure, yet (set USE_X86TSC to 1).
34822
34823 Wed Apr 17 12:33:10 CEST 2002 Paolo Molaro <lupus@ximian.com>
34824
34825         * profiler.c, profiler.h: track time spent compiling methods.
34826         * threads.c: track thread creation/destruction.
34827
34828 Tue Apr 16 20:08:43 CEST 2002 Paolo Molaro <lupus@ximian.com>
34829
34830         * profiler.c, profiler.h, profiler-private.h: profiling interface
34831         and sample implementation. Moved here so that it can be used also by
34832         the jit.
34833
34834 Tue Apr 16 12:58:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
34835
34836         * reflection.c, reflection.h: keep types and other handles separate in
34837         the hash tables for referred tokens. Add guid for modules.
34838
34839 Mon Apr 15 11:37:33 CEST 2002 Paolo Molaro <lupus@ximian.com>
34840
34841         * assembly.c: fix bugs found with valgrind.
34842         * metadata.h, metadata.c: added mono_metadata_guid_heap().
34843
34844 2002-04-14      Patrik Torstensson <patrik.torstensson@labs2.com>
34845
34846         * threads: added icall support for getting current domain for
34847                    the thread.
34848  
34849 2002-04-13  Martin Baulig  <martin@gnome.org>
34850
34851         * debug-symfile.h (MonoDebugLocalInfo): Renamed to MonoDebugVarInfo.
34852         (MonoDebugVarInfo): Added `index' field for register based addresses.
34853         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 9.
34854         (MonoDebugMethodInfo): Replaced `guint32 *param_offsets' with
34855         `MonoDebugVarInfo *params' and `guint32 this_offset' with
34856         `MonoDebugVarInfo *this_var'.
34857
34858         * debug-symfile.c (relocate_variable): New static function to write
34859         a location description for a local variable or method parameter.
34860
34861 2002-04-12  Martin Baulig  <martin@gnome.org>
34862
34863         * debug-symfile.h (MonoDebugLocalInfo): New type. This contains the
34864         stack offset and begin/end scope address of a local variable.
34865         (MonoDebugMethodInfo): Replaced `guint32 *local_offsets' with
34866         'MonoDebugLocalInfo *locals', added `prologue_end' and `epilogue_begin'.
34867         (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 8.
34868
34869         * debug-symfile.c (MRT_variable_start_scope, MRT_variable_end_scope):
34870         Added new relocation types for start/end scope of a local variable.
34871
34872 Fri Apr 12 18:30:29 CEST 2002 Paolo Molaro <lupus@ximian.com>
34873
34874         * object.h: add mono_object_domain() macro.
34875         * reflection.c: handle typespecs.
34876         * icall.c: MonoMethod::get_Name() implementation.
34877
34878 Thu Apr 11 12:29Ni:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34879
34880         * icall.c: String::GetHashCode() icall implementation.
34881
34882 Wed Apr 10 21:16:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34883
34884         * icall.c: String::IndexOfAny icall.
34885         * object.c, object.h: make array->max_length more useful.
34886         Intrduced mono_object_class() and mono_string_length() macros.
34887
34888 2002-04-10  Gonzalo Paniagua Javier <gonzalo@ximian.com>
34889
34890         * unicode.c (ves_icall_System_Char_IsNumber): use g_unichar_isxdigit
34891         instead of g_unichar_isdigit.
34892
34893 2002-04-11  Nick Drochak  <ndrochak@gol.com>
34894
34895         * icall.c: Implement a simple Double.ToString().
34896
34897 Tue Apr 9 21:31:16 CEST 2002 Paolo Molaro <lupus@ximian.com>
34898
34899         * appdomain.h: only io-layer.h is supposed to be included.
34900         * icall.c: explicitly import environ. Fix warning.
34901
34902 2002-04-10  Nick Drochak  <ndrochak@gol.com>
34903
34904         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData) :
34905                 return true even if it's not Daylight Savings time.
34906                 Only return false for the case where the function isn't
34907                 implemented for a plaform (read Windows).
34908
34909 Tue Apr 9 13:05:56 CEST 2002 Paolo Molaro <lupus@ximian.com>
34910
34911         * appdomain.h, appdomain.c, class.c, object.c: protect MonoDomain
34912         data with a mutex.
34913
34914 2002-04-09  Dietmar Maurer  <dietmar@ximian.com>
34915
34916         * mempool.c (mono_mempool_alloc): only use g_malloc when
34917         absolutely necessary.
34918
34919 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34920
34921         * mempool.c (MEM_ALIGN): hardcode MEM_ALIGN to 8
34922
34923         * class.c (mono_class_vtable): use domain mempool to allocate vtable
34924         (mono_class_proxy_vtable): use domain mempool
34925
34926 Mon Apr 8 17:17:04 CEST 2002 Paolo Molaro <lupus@ximian.com>
34927
34928         * appdomain.h, appdomain.c: split initialization that requires the
34929         execution engine support into mono_runtime_init().
34930
34931 2002-04-08  Dietmar Maurer  <dietmar@ximian.com>
34932
34933         * class.c (mono_class_init): don't include vtable inside MonoClass
34934         to save some memory, gather some statistics.
34935         (mono_class_vtable): use g_malloc instead of GC_malloc when possible
34936
34937 Sat Apr 6 20:07:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34938
34939         * icall.c: internalcall implementation for ValueType.Equals().
34940
34941 2002-04-06  Dietmar Maurer  <dietmar@ximian.com>
34942
34943         * object.c (mono_message_init): moved 
34944         (mono_runtime_exec_main): new arch. independent impl.
34945         (mono_runtime_invoke_array): new method - like
34946         mono_runtime_invoke, but you can pass an array of objects.
34947         (mono_remoting_invoke): new arch. independent impl.
34948         (mono_message_invoke): new arch. independent impl.
34949         (mono_runtime_class_init): new arch. independent impl.
34950         (mono_runtime_object_init): new arch. independent impl.
34951
34952 Fri Apr 5 18:29:14 CEST 2002 Paolo Molaro <lupus@ximian.com>
34953
34954         * metadata.c, object.c, reflection.c: documented the exported
34955         functions.
34956
34957 Fri Apr 5 15:42:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
34958
34959         * icall.c: simpler code to pass the assembly builder data to corlib.
34960         Implement GetNestedTypes() internalcall.
34961
34962 Thu Apr 4 21:46:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
34963
34964         * class.c: warn if a type can't be loaded.
34965
34966 2002-04-04  Dietmar Maurer  <dietmar@ximian.com>
34967
34968         * image.h: typedef MonoImageOpenStatus
34969         * types.h: removed unused file
34970         
34971 2002-04-04  Dan Lewis  <dihlewis@yahoo.co.uk>
34972
34973         * icall.c: Enum_ToObject accepts enum value arguments.
34974
34975 Thu Apr 4 11:35:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
34976
34977         * class.c: move initialization of properties, events and nested
34978         classes, so that they happen for interfaces, too.
34979
34980 Wed Apr 3 20:03:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
34981
34982         * icall.c: cleanup some ugly casts in Array_SetValue*.
34983
34984 Wed Apr 3 19:49:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
34985
34986         * icall.c: the values array fro enums is of the correct type, now.
34987         Implement (correctly) getFullName instead of assQualifiedName for
34988         MonoType.
34989         * reflection.h, reflection.c: added mono_type_get_name ().
34990
34991 Wed Apr 3 17:56:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
34992
34993         * assembly.c, image.h: for each MonoImage, record from wich assembly
34994         it was loaded.
34995         * reflection.h, icall.c: added System_Reflection_Assembly_GetTypes().
34996         Make Type.Assembly work.
34997
34998 2002-04-03  Dietmar Maurer  <dietmar@ximian.com>
34999
35000         * debug-symfile.h: use char* instead of gpointer to avoid
35001         unnecessary casts.
35002
35003         * appdomain.c (mono_jit_info_table_find): use char* instead of gpointer
35004
35005         * icall.c (ves_icall_InternalExecute): impl. FielSetter
35006         (ves_icall_System_Array_SetValueImpl): removed strange MonoArray cast
35007
35008 2002-03-30  Dietmar Maurer  <dietmar@ximian.com>
35009
35010         * icall.c (mono_message_init): impl. (code cleanup)
35011         (ves_icall_InternalExecute): impl. FieldGetter
35012
35013         * class.c (mono_class_init): added exerimental EXT_VTABLE_HACK, if
35014         defined we call all (non-static)methods through the vtable. 
35015
35016 Fri Mar 29 18:09:08 CET 2002 Paolo Molaro <lupus@ximian.com>
35017
35018         * class.c: it seems GC_debug_malloc() makes the Boehm GC call the
35019         finalizer even though the memory is still referenced (and the chunk of
35020         memory is not freed).
35021
35022 Fri Mar 29 17:43:04 CET 2002 Paolo Molaro <lupus@ximian.com>
35023
35024         * assembly.c: fix brokeness.
35025
35026 Fri Mar 29 16:09:54 CET 2002 Paolo Molaro <lupus@ximian.com>
35027
35028         * class.c: kill some warnings. Check explicit interface method
35029         implementation also without considering the namespace.
35030         Load also literal strings in static class data.
35031
35032 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
35033
35034         * assembly.c (default_assembly_name_resolver): Kill memory leak. 
35035         (default_assembly_name_resolver): Make the resolver take the
35036         "base" directory where the assembly was originally defined, so we
35037         can load DLLs that are in the same directory as the assembly that
35038         is being referenced.
35039
35040 2002-03-28  Dick Porter  <dick@ximian.com>
35041
35042         * file-io.h: 
35043         * file-io.c:
35044         * socket-io.c: 
35045         * unicode.h: 
35046         * unicode.c: Warning cleanups
35047
35048 Thu Mar 28 18:06:14 CET 2002 Paolo Molaro <lupus@ximian.com>
35049
35050         * object.h, reflection.h: use the correct type instead of MonoObject.
35051
35052 2002-03-28  Martin Baulig  <martin@gnome.org>
35053
35054         * debug-symfile.c (mono_debug_class_get): Don't look in referenced assemblies.
35055         (mono_debug_update_symbol_file): Initialize classes if necessary.
35056
35057 Thu Mar 28 15:58:43 CET 2002 Paolo Molaro <lupus@ximian.com>
35058
35059         * assembly.c, debug-helpers.c, image.c, image.h, metadata.c, pedump.c,
35060         rawbuffer.c, reflection.c, verify.c: mare warning cleanups.
35061
35062 Thu Mar 28 15:20:39 CET 2002 Paolo Molaro <lupus@ximian.com>
35063
35064         * assembly.h: fix function prototype.
35065         * metadata.h, metadata.c, object.h, private.h: get rid of warnings.
35066         * mono-endian.h: use const cast.
35067
35068 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
35069
35070         * icall.c (ves_icall_MonoMethodMessage_InitMessage): moved from message.c
35071
35072 Thu Mar 28 12:32:00 CET 2002 Paolo Molaro <lupus@ximian.com>
35073
35074         * loader.c: don't assert when a typeref can't be loaded, give
35075         a chance to the runtime to trow an exception instead.
35076         * loader.h: fix warning.
35077
35078 2002-03-28  Dietmar Maurer  <dietmar@ximian.com>
35079
35080         * class.c (mono_class_proxy_vtable): added proxy support
35081
35082 2002-03-27  Dan Lewis <dihlewis@yahoo.co.uk>
35083
35084         * icall.c: removed last of PAL calls, added System.Environment
35085         * file-io.h, file-io.c: MonoIO implementation
35086         * object.h, object.c: mono_string_to_utf16() now returns gunichar2*
35087
35088 Tue Mar 26 19:56:10 CET 2002 Paolo Molaro <lupus@ximian.com>
35089
35090         * appdomain.c: do not use the byte marker in ldstr table lookup.
35091         * debug-helpers.c: allow two ':' to separate class and method name.
35092         * object.c: allocate arrays bounds with the GC, too.
35093         * verify: add a few more checks.
35094
35095 Tue Mar 26 18:45:46 CET 2002 Paolo Molaro <lupus@ximian.com>
35096
35097         * reflection.c: output also literal strings. Allocate parameter data
35098         with GC_malloc() (thanks, Martin, for catching this!).
35099
35100 2002-03-26  Martin Baulig  <martin@gnome.org>
35101
35102         * debug-symfile.h (MonoDebugMethodInfo): Added `this_offset', don't
35103         include the `this' offset in the `param_offsets'.
35104
35105 2002-03-25  Martin Baulig  <martin@gnome.org>
35106
35107         * debug-symfile.c (mono_debug_update_symbol_file): Use a new
35108         mono_debug_get_class() function to get the classes. Added new
35109         relocation types for arrays and strings.
35110         (mono_debug_get_class): New static function to search in all
35111         referenced assemblies for a metadata token.
35112
35113         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 7.
35114
35115 Mon Mar 25 13:08:18 CET 2002 Paolo Molaro <lupus@ximian.com>
35116
35117         * reflection.h, reflection.c: use a gc-safe hash for hash tables that
35118         hold gc-allocated objects. Make the string heap a stream like the
35119         others. Removed duplicated code when writing stream info.
35120         Added asserts to catch possible buffer overflows. Set the sorted map
35121         for tables that need sorting. Added some documentation.
35122
35123 Mon Mar 25 13:04:56 CET 2002 Paolo Molaro <lupus@ximian.com>
35124
35125         * appdomain.h, appdomain.c, class.c, object.c: use a GC-safe hash table 
35126         for interned strings and vtables.
35127
35128 2002-03-24  Martin Baulig  <martin@gnome.org>
35129
35130         * icall.c (ves_icall_Type_GetFields): Reverse the list before storing
35131         it in the array since it was created with g_slist_prepend().
35132
35133 2002-03-24  Martin Baulig  <martin@gnome.org>
35134
35135         * debug-symfile.c (mono_debug_local_type_from_signature): Renamed
35136         to ves_icall_Debugger_MonoSymbolWriter_get_local_type_from_sig().
35137         (mono_debug_method_from_token): Renamed to
35138         ves_icall_Debugger_MonoSymbolWriter_method_from_token().
35139         (ves_icall_Debugger_DwarfFileWriter_get_type_token): New interncall.
35140
35141         * debug-symfile.c (MRT_type_sizeof, MRT_type_field_offset): New
35142         relocation types.
35143
35144         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 6.
35145
35146 2002-03-24  Martin Baulig  <martin@gnome.org>
35147
35148         * debug-symfile.c (mono_debug_local_type_from_signature): New func.
35149         (mono_debug_method_from_token): New func.
35150
35151         * icall.c (Mono.CSharp.Debugger.MonoSymbolWriter::get_local_type_from_sig):
35152         New interncall, calls mono_debug_local_type_from_signature().
35153         (Mono.CSharp.Debugger.MonoSymbolWriter::get_method): New interncall,
35154         calls mono_debug_method_from_token().
35155
35156 2002-03-23  Martin Baulig  <martin@gnome.org>
35157
35158         * unicode.c (ves_icall_iconv_get_char_count): The `count' argument
35159         specifies the number of bytes to be converted, not the array size.
35160         Return the number of chars, not the number of bytes.
35161         (ves_icall_iconv_get_chars): The `byteCount' argument
35162         specifies the number of bytes to be converted, not the array size.
35163
35164 2002-03-23  Martin Baulig  <martin@gnome.org>
35165
35166         * reflection.h (MonoReflectionSigHelper): New type.
35167
35168         * reflection.c (mono_reflection_sighelper_get_signature_local),
35169         (mono_reflection_sighelper_get_signature_local): New functions.
35170
35171         * icall.c (System.Reflection.Emit.SignatureHelper::get_signature_local),
35172         (System.Reflection.Emit.SignatureHelper::get_signature_field): New
35173         interncalls.
35174
35175 2002-03-23  Martin Baulig  <martin@gnome.org>
35176
35177         * rawbuffer.c (mono_raw_buffer_load_mmap): Use MAP_SHARED when
35178         is_writeable is set.
35179         (mono_raw_buffer_update): New function to write the modified map
35180         back to disk.
35181
35182         * debug-symfile.h (MonoDebugSymbolFile): Added `raw_contents_size'.
35183
35184         * debug-symfile.c (mono_debug_update_symbol_file): Call
35185         mono_raw_buffer_update() when done writing.
35186
35187 2002-03-23  Martin Baulig  <martin@gnome.org>
35188
35189         * debug-symfile.h (MONO_DEBUG_SYMBOL_FILE_VERSION): Increased to 5.
35190
35191         * debug-symfile.c: Added support for arguments and local variables.
35192
35193 2002-03-23  Dick Porter  <dick@ximian.com>
35194
35195         * debug-symfile.c: Remove extraneous 'include <elf.h>' that wasn't
35196         protected by ifdefs, hence breaking the w32 build.
35197
35198 Thu Mar 21 17:35:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35199
35200         * object.c: implement is_interned() the right way.
35201
35202 2002-03-21  Martin Baulig  <martin@gnome.org>
35203
35204         * debug-symfile.[ch]: New files to handle debugging information
35205         files. There's also support to dynamically update these symbol
35206         files to include machine dependent information.
35207
35208 2002-03-20  Dietmar Maurer  <dietmar@ximian.com>
35209
35210         * threads.c (mono_thread_create): new function to create thread
35211         from C
35212
35213 2002-03-20  Martin Baulig  <martin@gnome.org>
35214
35215         * icall.c (ves_icall_InternalInvoke): Create a new object if the
35216         method is a constructor.
35217         (icall_map): Added "System.Reflection.MonoCMethod::InternalInvoke",
35218         points to ves_icall_InternalInvoke().
35219
35220 2002-03-20  Dan Lewis <dihlewis@yahoo.co.uk>
35221
35222         * file-io.c: Flush shouldn't throw exceptions.
35223
35224 2002-03-19  Dan Lewis <dihlewis@yahoo.co.uk>
35225
35226         * file-io.c: FileStream flush support; FileSetLength now
35227         restores file pointer.
35228
35229 Tue Mar 19 18:17:21 CET 2002 Paolo Molaro <lupus@ximian.com>
35230
35231         * class.c: set image for pointer classes.
35232
35233 2002/03/19  Nick Drochak <ndrochak@gol.com>
35234
35235         * sysmath.c: Forgot one.
35236
35237 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
35238
35239         * sysmath.c: Avoid redefining existing names.
35240
35241 2002-03-18  Dan Lewis <dihlewis@yahoo.co.uk>
35242
35243         * sysmath.c, sysmath.h, icall.c, Makefile.am: math routines now
35244         handled by runtime as icall rather than dllimport from libm.so
35245         * file-io.c, file-io.h: fixed handle argument type.
35246
35247 2002-03-18  Dick Porter  <dick@ximian.com>
35248
35249         * reflection.c (mono_image_get_type_info): rename interface to
35250         iface, because of "#define interface struct" on windows.
35251
35252 Sat Mar 16 19:18:38 CET 2002 Paolo Molaro <lupus@ximian.com>
35253
35254         * class.c, class.h: rename and export mono_ptr_class_get().
35255         * metadata.c: support MONO_TYPE_ARRAY in MonoType compare.
35256         * reflection.c, reflection.h, icall.c: better/saner type name
35257         parsing and MonoType creation. Handle MONO_TYPE_ARRAY in
35258         method signatures.
35259
35260 2002-03-14  Dietmar Maurer  <dietmar@ximian.com>
35261
35262         * class.c (mono_class_init): removed hardcoded GHC_SLOT
35263
35264         * icall.c (ves_icall_InternalInvoke): impl.
35265
35266 Wed Mar 13 00:27:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35267
35268         * reflection.c: output the interface map table, too.
35269
35270 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35271
35272         * class.c (class_compute_field_layout): separate computation of 
35273         static field layout
35274
35275 2002-03-12  Dan Lewis <dihlewis@yahoo.co.uk>
35276
35277         * icall.c: added System.Buffer support.
35278         * file-io.c: moved file icalls from PAL to FileStream.
35279
35280 2002-03-12  Dietmar Maurer  <dietmar@ximian.com>
35281
35282         * icall.c (ves_icall_System_Object_GetHashCode): impl.
35283
35284 2002-03-11  Dietmar Maurer  <dietmar@ximian.com>
35285
35286         * icall.c (ves_icall_System_ValueType_GetHashCode): impl.
35287
35288 Mon Mar 11 14:45:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35289
35290         * verify.c, verify.h: moved here the corlib/runtime consistency checks.
35291
35292 Mon Mar 11 11:12:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35293
35294         * debug-helpers.{c,h}: moved here from monograph some useful functions
35295         to locate a method by name/signature in a class or image. Included
35296         also a small and flexible IL disassembler.
35297
35298 Fri Mar 8 16:29:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35299
35300         * reflection.c: fixup tokens in methods with small header size, too.
35301
35302 2002-03-08  Dietmar Maurer  <dietmar@ximian.com>
35303
35304         * object.c (mono_string_to_utf8): remove assert(!error), instead
35305         print a warning. 
35306
35307 Thu Mar 7 18:55:15 CET 2002 Paolo Molaro <lupus@ximian.com>
35308
35309         * icall.c: update to the new mono_Array_class_get interface.
35310
35311 Thu Mar 7 17:23:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35312
35313         * appdomain.c, object.c: Boehm-GC enable.
35314         * icall.c: make get_data_chunk() support split data requests.
35315         Ensure a class is initialized in more cases. Return only the first
35316         property found in GetProperties() or the compiler gets confused. 
35317         Implemented GetEvents(). Temporary fix to GetType(), needs rewriting.
35318         * reflection.h, reflection.c: add fixup mechanism for field and method
35319         tokens. Initialize assembly->typeref in a single place. Output
35320         properties after events. Support custom attributes for events, too.
35321         Typo fix for paramter custom attrs.
35322
35323 2002-03-07  Martin Baulig  <martin@gnome.org>
35324
35325         * icall.c (ves_icall_System_Array_FastCopy): Small fix.
35326
35327 2002-03-07  Dietmar Maurer  <dietmar@ximian.com>
35328
35329         * class.c (mono_array_class_get): fix. for multi. dim. arrays
35330
35331 2002-03-06  Martin Baulig  <martin@gnome.org>
35332
35333         * icall.c (ves_icall_System_Array_CreateInstanceImpl): Make this work with
35334         non-zero lower bounds. See testcases #F10-#F13.
35335
35336 2002-03-05  Martin Baulig  <martin@gnome.org>
35337
35338         * exception.c (mono_get_exception_argument_out_of_range): New exception.
35339
35340         * icall.c (ves_icall_System_Array_GetValue): Moved actual implementation to
35341         ves_icall_System_Array_GetValue(), only calculate the absolute array position
35342         here.
35343         (ves_icall_System_Array_SetValue): Likewise.
35344         (ves_icall_System_Array_GetValueImpl): New interncall. Takes an array position
35345         as argument and does the actual work. This function is used when copying a
35346         multi-dimensional array.
35347         (ves_icall_System_Array_SetValueImpl): Almost completely rewrote this. It can
35348         now do all the widening conversions of value types.
35349         (ves_icall_System_Array_CreateInstanceImpl): Implemented.
35350
35351 Tue Mar 5 18:14:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35352
35353         * class.c: remove some magic numbers and use the smbolic names,
35354         instead. Added init_events() to load event info at class init time.
35355         * metadata.h, metadata.c: added mono_metadata_events_from_typedef()
35356         and mono_metadata_methods_from_event().
35357         * reflection.h, reflection.c: added support for writing out the evnets
35358         related information.
35359
35360 Mon Mar 4 20:32:43 CET 2002 Paolo Molaro <lupus@ximian.com>
35361
35362         * reflection.h, icall.c: use a different method (GetInterfaces)
35363         to gather interface info and add isbyref, isprimitive and
35364         ispointer to the ves_icall_get_type_info() return value.
35365
35366 Mon Mar 4 11:22:26 CET 2002 Paolo Molaro <lupus@ximian.com>
35367
35368         * class.h: stared adding support for events.
35369         * icall.c: split find_members implementation. Added debug icall to get
35370         the address of an object.
35371         * reflection.c: handle TypeBuilders in mono_type_get_object().
35372
35373 2002-03-01  Martin Baulig  <martin@gnome.org>
35374
35375         * icall.c (ves_icall_System_Array_GetLength): This must throw an
35376         ArgumentOutOfRangeException(), not an ArgumentException().
35377         (ves_icall_System_Array_GetLowerBound): Likewise.
35378         (ves_icall_System_Array_GetValue): Improved argument checking.
35379         (ves_icall_System_Array_SetValue): Improved argument checking.
35380
35381 2002-03-01  Martin Baulig  <martin@gnome.org>
35382
35383         * icall.c (ves_icall_System_Array_GetValue): Raise an exception when
35384         called with invalid arguments rather than just dying with g_assert().
35385         (ves_icall_System_Array_SetValue): Likewise.
35386         (ves_icall_System_Array_CreateInstanceImpl): Don't g_assert_not_reached(),
35387         raise a NotImplementedException instead.
35388         (ves_icall_System_Array_GetLength): Added argument checking.
35389         (ves_icall_System_Array_GetLowerBound): Added argument checking.
35390
35391 2002-03-01  Dietmar Maurer  <dietmar@ximian.com>
35392
35393         * object.h (mono_assert): new macros mono_assert and
35394         mono_assert_not_reached
35395
35396 2002-02-28  Martin Baulig  <martin@gnome.org>
35397
35398         * icall.c: Rename "System::String::Intern" to "System::String::_Intern"
35399         and "System::String::IsInterned" to "System::String::_IsInterned".
35400
35401 Thu Feb 28 19:19:35 CET 2002 Paolo Molaro <lupus@ximian.com>
35402
35403         * icall.c: remove hacks for typebuilder. Added icall to create a
35404         modified type from a tybebuilder.
35405         * reflection.c: removed hacks for TypeBuilder. Create also a MonoImage
35406         in mono_image_basic_init (). Added mono_reflection_setup_internal_class ()
35407         to create a backing MonoClass for a TypeBuilder.
35408
35409 Thu Feb 28 15:35:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35410
35411         * class.c, class.h: more refactoring of class init.
35412         Export mono_class_setup_mono_type() and mono_class_setup_parent().
35413
35414 Thu Feb 28 12:33:41 CET 2002 Paolo Molaro <lupus@ximian.com>
35415
35416         * marshal.c, marshal.h: start of marshaling interface.
35417
35418 Wed Feb 27 22:15:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35419
35420         * icall.c: fix order in assembly qualified name icall.
35421
35422 Wed Feb 27 18:45:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35423
35424         * class.c: do not free str, since we store it in the hash table.
35425         * reflection.h: add label field to MonoILExceptionInfo.
35426         * reflection.c: handle references to more than one assembly. Handle
35427         case when there isn't a module created in the assembly.
35428
35429 Wed Feb 27 12:35:10 CET 2002 Paolo Molaro <lupus@ximian.com>
35430
35431         * class.c: Fix typo. Start refactoring of class init code.
35432
35433 Wed Feb 27 12:23:00 CET 2002 Paolo Molaro <lupus@ximian.com>
35434
35435         * appdomain.c: exit with 1 on error.
35436         * class.c: we already have the name in MonoClassField.
35437         * image.c, image.h, metadata.c, pedump.c: use directly a pointer in
35438         MonoStreamHeader instead of an offset of image->raw_metadata.
35439
35440 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
35441
35442         * appdomain.c (mono_init): Be even more descriptive about the error.
35443
35444 Tue Feb 26 16:18:07 CET 2002 Paolo Molaro <lupus@ximian.com>
35445
35446         * appdomain.c: give the user an informative message when corlib can't
35447         be loaded.
35448
35449 2002-02-26  Martin Baulig  <martin@gnome.org>
35450
35451         * icall.c (ves_icall_System_CurrentTimeZone_GetTimeZoneData):
35452         New icall to get the time zone data.
35453
35454 Mon Feb 25 15:51:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35455
35456         * reflection.c: set virtual and raw size of section correctly.
35457         * threads.c: transfer domain information to newly created threads.
35458
35459 Fri Feb 22 18:55:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35460
35461         * class.c: when instancing a class in a domain, load the default
35462         vaules for static fields from the constant table. Fix System.Enum to
35463         not be an enum.
35464         * icall.c: implement Object::GetType() internalcall. Implemented
35465         MonoField::GetValue() internalcall. Avoid SEGV in search_method().
35466         Fixed checking of binding flags in find_members().
35467         * metadata.c, metadata.h: introduce mono_metadata_type_hash().
35468         * reflection.c: handle enumerations when writing to the constant
35469         table. Use a different object cache for types.
35470
35471
35472 2002-02-22  Dietmar Maurer  <dietmar@ximian.com>
35473
35474         * object.c (mono_object_isinst): fix for arrays
35475
35476         * icall.c (ves_icall_type_is_subtype_of): fix for 2 interfaces
35477
35478 Thu Feb 21 21:00:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35479
35480         * object.c: don't use mprotect ()  and fix intern pool hash table
35481         lookup for big endian systems.
35482
35483 Thu Feb 21 19:30:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35484
35485         * icall.c: change type_is_subtype_of () signature.
35486
35487 2002-02-21  Mark Crichton  <crichton@gimp.org>
35488
35489         * rand.c, rand.h: Added random number generator for
35490         System.Security.Cryptography classes.
35491
35492         * exception.c, exception.h: Added mono_get_exception_not_implemeted.
35493
35494         * icall.c: Added System.Security.Cryptography calls.
35495
35496 Thu Feb 21 16:45:34 CET 2002 Paolo Molaro <lupus@ximian.com>
35497
35498         * class.c, icall.c, metadata.c: better support for pointer types.
35499         Create a class for them as suggested by dietmar. Fix TYPE_ARRAY class.
35500         * reflection.c: Add support for getting custom attrs for properties
35501         and simplify some code.
35502
35503 Wed Feb 20 22:20:29 CET 2002 Paolo Molaro <lupus@ximian.com>
35504
35505         * icall.c: change getToken () and add custom attribute GetBlob()helper
35506         method.
35507         * reflection.h: add custom attrs array to the reflection builder structures.
35508         * reflection.c: encode and emit custom attributes for all the relevant
35509         reflection objects. Cache fieldref and methodref tokens. Change
35510         mono_image_create_token() interface to take a MonoDynamicAssembly.
35511         More complete custom attributes decoder. Load custom attributes for
35512         Assembly, Field, Method and Constructor objects, too. Make the
35513         returned array an Attribute[] one, not object[]. Added
35514         mono_reflection_get_custom_attrs_blob() to encode the arguments of a
35515         custom attribute constructor.
35516
35517 2002-02-20  Dick Porter  <dick@ximian.com>
35518
35519         * icall.c:
35520         * rawbuffer.c:
35521         * socket-io.c: Windows portability fixes (sometimes just ifdeffing
35522         problem code out for now).
35523
35524 2002-02-19  Radek Doulik  <rodo@ximian.com>
35525
35526         * object.c (mono_ldstr): use hash table to avoid multiple swapping
35527
35528 Tue Feb 19 20:23:11 CET 2002 Paolo Molaro <lupus@ximian.com>
35529
35530         * icall.c: register the GetCustomAttributes method.
35531         * object.c, object.h: add mono_string_new_len ().
35532         * reflection.h, reflection.c: added mono_runtime_invoke(),
35533         mono_install_runtime_invoke(). Added
35534         mono_reflection_get_custom_attrs () to load custom attributes and
35535         create the attribute objects.
35536
35537 2002-02-19  Dick Porter  <dick@ximian.com>
35538         * threads-dummy-types.c:
35539         * threads-dummy-types.h:
35540         * threads-dummy.c:
35541         * threads-dummy.h:
35542         * threads-pthread-types.c:
35543         * threads-pthread-types.h:
35544         * threads-pthread.c:
35545         * threads-pthread.h:  Deleted obsolete files
35546
35547 2002-02-19  Dietmar Maurer  <dietmar@ximian.com>
35548
35549         * class.c (mono_class_vtable): runtime init the class when we
35550         allocate static class data.
35551
35552         * icall.c (ves_icall_System_Array_SetValue): check for null values.
35553
35554         * appdomain.c (mono_domain_transfer_object): impl. hack for Arrays
35555         and String - but we will need generic marshalling support in the
35556         future. 
35557         (mono_init): set the domain name in a ms compatible way
35558
35559         * object.c (mono_string_new_utf16): bug fix: use char[] instead of
35560         String[].
35561
35562 2002-02-18  Dietmar Maurer  <dietmar@ximian.com>
35563
35564         * object.c (mono_array_clone): use alloca() instead of g_malloc  
35565         for sizes
35566
35567         * appdomain.c (mono_domain_unload): impl.
35568
35569 Mon Feb 18 15:52:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35570
35571         * appdomain.c, object.c: fix intern pool implementation.
35572         * class.c: fix alignment code.
35573
35574 2002-02-16  Radek Doulik  <rodo@ximian.com>
35575
35576         * icall.c (ves_icall_System_Enum_ToObject): in case of big endian
35577         and s2 > s1, just copy lower bytes to be compatible with little
35578         endian (i.e. 64bit value & 0xffffffff --> 32bit value)
35579         (ves_icall_System_Enum_ToObject): and likewise for s1 > s2
35580
35581         * unicode.c (ves_icall_iconv_new_encoder): decide on big_endian,
35582         force big_endian to be 1 for big endian machines 
35583         (ves_icall_iconv_new_decoder): ditto
35584
35585 2002-02-16  Jeffrey Stedfast  <fejj@ximian.com>
35586
35587         * socket-io.c (convert_sockopt_level_and_name): If the system
35588         doesn't define SOL_IP or SOL_TCP, get them by hand using
35589         getprotobyname() and caching the values (because this could be a
35590         slow operation).
35591         (ves_icall_System_Net_Sockets_Socket_SetSocketOption_internal):
35592         Use the appropriate struct when the system does support it. Ie,
35593         not all systems have struct ip_mreqn so use struct ip_mreq when
35594         appropriate.
35595
35596 Fri Feb 15 18:15:44 CET 2002 Paolo Molaro <lupus@ximian.com>
35597
35598         * reflection.c: handle finally clauses.
35599
35600 Fri Feb 15 15:06:33 CET 2002 Paolo Molaro <lupus@ximian.com>
35601
35602         * socket-io.c: use g_snprintf() instead of snprintf.
35603
35604 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35605
35606         * reflection.c (mono_param_get_objects): Cast second argument to
35607         mono_method_get_param_names to a const char** to silence the
35608         compiler warning.
35609
35610         * appdomain.c (mono_domain_assembly_open): Put parens around the
35611         truth statement in the for-loop.
35612
35613         * unicode.c (iconv_convert): Got rid of a compiler warning about
35614         int i being unused when the system has a new iconv.
35615         (iconv_get_length): Same.
35616
35617         * image.c (load_class_names): Cast the second argument to
35618         g_hash_table_insert() to char* to hush compiler warnings about the
35619         arg being a const.
35620         (mono_image_open): Same here.
35621
35622         * socket-io.c: Don't conditionally include sys/filio.h or
35623         sys/sockio.h here anymore since we now get them from
35624         io-layer/io-layer.h
35625         (inet_pton): If the system doesn't support inet_aton, implement
35626         using inet_addr and also #define INADDR_NONE if it isn't defined
35627         by the system.
35628
35629 Thu Feb 14 19:01:06 CET 2002 Paolo Molaro <lupus@ximian.com>
35630
35631         * metadata.c, metadata.h: added function to get packing and size info
35632         of a typedef.
35633         * reflection.h, reflection.c: handle field RVA data. Save info about
35634         the table layout if needed. Assign typedef indexes to all the types
35635         before dumping the info about them to avoid forward reference problems.
35636
35637 2002-02-14  Dietmar Maurer  <dietmar@ximian.com>
35638
35639         * socket-io.c (convert_sockopt_level_and_name): ifdef
35640         SO_ACCEPTCONN because it is not defined on my system (old debian)
35641
35642 Thu Feb 14 11:49:30 CET 2002 Paolo Molaro <lupus@ximian.com>
35643
35644         * opcode.c: use stddef.h to get NULL.
35645
35646 2002-02-14  Jeffrey Stedfast  <fejj@ximian.com>
35647
35648         * socket-io.c: conditionally include sys/filio.h and sys/sockio.h
35649         for FIONBIO, FIONREAD and SIOCATMARK.
35650         (ves_icall_System_Net_Dns_GetHostByAddr_internal): SunOS doesn't
35651         define INADDR_NONE and besides, inet_addr() is deprecated and
35652         should not be used. Use inet_pton() instead - it also has the
35653         added bonus that it can easily handle IPv6 addresses as well.
35654         (inet_pton): Implement using inet_aton() ifndef HAVE_INET_PTON.
35655
35656 Wed Feb 13 23:00:21 CET 2002 Paolo Molaro <lupus@ximian.com>
35657
35658         * decimal.c: remove _MSC_VER conditional.
35659
35660 2002-02-13  Dick Porter  <dick@ximian.com>
35661
35662         * socket-io.c: 
35663         * icall.c: Internal calls for Blocking, Select, Shutdown,
35664         GetSocketOption and SetSocketOption
35665
35666 Wed Feb 13 19:20:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35667
35668         * assembly.cs: better resolver: use it instead of some kludgy
35669         code.
35670
35671 Wed Feb 13 18:25:55 CET 2002 Paolo Molaro <lupus@ximian.com>
35672
35673         * reflection.c: the best way to speed-up the compiler is to avoid
35674         infinite loops.
35675
35676 2002-02-13  Dietmar Maurer  <dietmar@ximian.com>
35677
35678         * class.c (mono_class_vtable): changed the object layout
35679         (obj->vtable->class). 
35680         (mono_class_create_from_typespec): consider MONO_TYPE_PTR
35681
35682 Tue Feb 12 20:06:01 CET 2002 Paolo Molaro <lupus@ximian.com>
35683
35684         * assembly.c: look for assemblies in the assembly dir, too.
35685
35686 Tue Feb 12 14:03:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35687
35688         * class.c: fix thinko in mono_class_from_type().
35689
35690 Mon Feb 11 19:43:51 CET 2002 Paolo Molaro <lupus@ximian.com>
35691
35692         * exception.h, exception.c: added TypeLoadException.
35693         * object.h, object.c: added mono_array_clone ().
35694         * icall.c: handle throwOnError in AssemblyGetType().
35695         Added Array.Clone().
35696         * opcode.h, opcode.c: use a single value for the opcode val.
35697         Compile fix for non-gcc compilers.
35698
35699 Fri Feb 8 12:26:37 CET 2002 Paolo Molaro <lupus@ximian.com>
35700
35701         * opcodes.c, opcodes.h: export interesting info about opcodes.
35702
35703 2002-02-05  Dietmar Maurer  <dietmar@ximian.com>
35704
35705         * object.h (MONO_CHECK_ARG, MONO_CHECK_ARG_NULL): new macro for
35706         icalls. 
35707
35708         * class.c (class_compute_field_layout): set element_class for enums
35709         (mono_class_create_from_typedef): set element_class for normal classes
35710
35711         * icall.c (ves_icall_System_Enum_get_value): impl.
35712
35713         * class.c (mono_class_create_from_typedef): do not set valuetype
35714         flag for System.ValueType and System.Enum
35715
35716 2002-02-04  Dietmar Maurer  <dietmar@ximian.com>
35717
35718         * unicode.c (iconv_convert): fix big endian problem.
35719
35720 Fri Feb 1 16:13:20 CET 2002 Paolo Molaro <lupus@ximian.com>
35721
35722         * class.c: add asserts if we are ever going to scribble over memory.
35723         * socket-io.c: not all systems have AF_IRDA defined.
35724
35725 2002-01-31  Dietmar Maurer  <dietmar@ximian.com>
35726
35727         * class.c (class_compute_field_layout): do not consider static
35728         fields to compute alignment
35729
35730 2002-01-25  Dietmar Maurer  <dietmar@ximian.com>
35731
35732         * appdomain.c (mono_appdomain_get): impl.
35733         (ves_icall_System_AppDomain_ExecuteAssembly): impl.
35734
35735 Thu Jan 24 12:59:23 CET 2002 Paolo Molaro <lupus@ximian.com>
35736
35737         * icall.c: ignore "file://" prefix when loading an assembly.
35738
35739 2002-01-23  Dick Porter  <dick@ximian.com>
35740
35741         * socket-io.c:
35742         * icall.c:
35743         * Makefile.am: Added socket support
35744
35745 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35746
35747         * icall.c (ves_icall_appdomain_get_default_assemblies): put this
35748         code back.  This should return the assemblies that are loaded by
35749         the runtime on behalf of an application domain. 
35750
35751         The current implementation is still broken, it just returns every
35752         assembly loaded, but until we get real applications domain this
35753         will do.
35754
35755 2002-01-23  Dietmar Maurer  <dietmar@ximian.com>
35756
35757         * icall.c (ves_icall_appdomain_get_cur_domain): runtime_init the
35758         AppDomain object.
35759
35760 2002-01-23  Miguel de Icaza  <miguel@ximian.com>
35761
35762         * icall.c (ves_icall_appdomain_get_cur_domain): Cache the value of
35763         the mono_class_from_name lookup.
35764         (ves_icall_get_parameter_info): ditto.
35765         (ves_icall_appdomain_get_assemblies, add_assembly): Implement new internal
35766         method.
35767         (ves_icall_System_Reflection_Assembly_get_code_base): Another new call.
35768
35769 Tue Jan 22 22:43:47 CET 2002 Paolo Molaro <lupus@ximian.com>
35770
35771         * class.c: load also nested classes on class init.
35772         System.ValueType instance methods gets passed boxed
35773         values, unless methods in derived classed that get a pointer to the
35774         data.
35775         * icall.c: use better name parsing code in GetType().
35776         * image.c, image.h: add mono_image_loaded ().
35777         * metadata.c, metadata.h: add mono_metadata_nesting_typedef ().
35778         * reflection.c, reflection.h: added mono_reflection_parse_type().
35779
35780 2002-01-22  Veronica De Santis <veron78@interfree.it>
35781
35782         * icall.c : Added mapping of internal calls for Manual and Auto reset events
35783         * threads.c : Added the implementation of internal calls for events
35784         * threads.h : Added prototypes of internal calls for events
35785         
35786 2002-01-21  Radek Doulik  <rodo@ximian.com>
35787
35788         * icall.c (ves_icall_InitializeArray): swap bytes on big endians
35789
35790 2002-01-21  Dietmar Maurer  <dietmar@ximian.com>
35791
35792         * class.c (mono_class_init): set min_align to 1 (instead of 0)
35793         (mono_class_value_size): use min_align
35794
35795 2002-01-20  Dick Porter  <dick@ximian.com>
35796
35797         * threads.h:
35798         * threads.c: Replaced all instances of WapiHandle * with HANDLE,
35799         so it compiles on w32.
35800
35801 2002-01-17  Dietmar Maurer  <dietmar@ximian.com>
35802
35803         * metadata.c (mono_type_stack_size): impl.
35804
35805         * class.c (mono_class_get_field): impl. memberref token
35806
35807 2002-01-16 Veronica De Santis <veron78@@interfree.it>
35808
35809         * icall.h : Added the internal calls mapping for CreateMutex_internal
35810                     and ReleaseMutex_internal.
35811         * threads.h : Added the prototype of mutexes internal calls.
35812         * threads.c : Added the implementations of mutexes internal calls.
35813
35814 Tue Jan 15 22:47:57 CET 2002 Paolo Molaro <lupus@ximian.com>
35815
35816         * metaparse.h: removed unused file.
35817         * reflection.c, reflection.h: added stream_data_align () function 
35818         to align data in streams and keep stream aligned. Add support for
35819         exception support in method headers.
35820
35821 Tue Jan 15 19:42:50 CET 2002 Paolo Molaro <lupus@ximian.com>
35822
35823         * unicode.c: make iconv_convert () return the number of bytess written
35824         in the output buffer.
35825
35826 2002-01-15  Dick Porter  <dick@ximian.com>
35827         * threads.c: Make the runtime's idea of infinite timeouts coincide
35828         with the class library's
35829
35830         Fix a particularly egregious bug in mono_thread_cleanup(). That
35831         code was so utterly bogus it must have been written on a Monday.
35832
35833 Mon Jan 14 17:01:03 CET 2002 Paolo Molaro <lupus@ximian.com>
35834
35835         * reflection.h: add subtypes field to TypeBuilder.
35836         * reflection.c: encode constants for literal fields.
35837         Handle subtypes. Fix user string token (and add a zero byte)
35838         at the end.
35839         
35840 2002-01-14  Dietmar Maurer  <dietmar@ximian.com>
35841
35842         * class.c (mono_class_init): bug fix: assign slot numbers for
35843         abstract methods.
35844
35845 Fri Jan 11 18:54:42 CET 2002 Paolo Molaro <lupus@ximian.com>
35846
35847         * reflection.c: don't try to output a code RVA for abstract methods.
35848         Small fixes for method header format. Output parameter info to the
35849         ParamDef table. Save method overriding info to MethodImpl table.
35850         Fix property support. Allow typedef.extends to be a type in the
35851         building assembly.
35852         * verify.c: fix off-by-one error.
35853
35854 Thu Jan 10 19:36:27 CET 2002 Paolo Molaro <lupus@ximian.com>
35855
35856         * class.c: fix mono_class_from_mono_type () for szarray types.
35857         Remove unused cache check in mono_class_from_type_spec().
35858         * icall.c: *type_from_name () functions handle simple arrays and byref.
35859         * reflection.c: handle byref and szarray types. Handle methods without
35860         body (gets P/Invoke compilation working). Handle types and fields in
35861         get_token ().
35862         * reflection.h: add rank to MonoTypeInfo.
35863
35864 2002-01-10  Dick Porter  <dick@ximian.com>
35865
35866         * threads.c: Implemented WaitAll(), WaitAny() and WaitOne()
35867         internal calls
35868
35869 Wed Jan 9 19:27:13 CET 2002 Paolo Molaro <lupus@ximian.com>
35870
35871         * icall.c: initialize class in type_from_handle ().
35872         Loop also in parent classes for get_method ().
35873         * reflection.c: properly encode class and valuetype types.
35874         Start on encoding TypeBuilder types. Handle fieldrefs.
35875         Use correct length when registering a user string.
35876         Handle ConstructorBuilder and MonoMethod in get_token ().
35877         Make mono_type_get_object () aware of cached types.
35878         * object.c: back out change to mono_string_new ().
35879
35880 Tue Jan 8 22:47:44 EST 2002 Matt Kimball <matt@kimball.net>
35881         * object.c: mono_string_new should return a NULL when the string 
35882         passed in is NULL -- not try to deference it.
35883         
35884 Sat Jan 5 15:48:04 CET 2002 Paolo Molaro <lupus@ximian.com>
35885
35886         * icall.c: hack to make IsSubType work for TypeBuilders.
35887         * reflection.c: emit constructors before methods.
35888         Retrieve param names in mono_param_get_objects().
35889
35890 2002/01/05  Nick Drochak  <ndrochak@gol.com>
35891
35892         * Makefile.am: fix list of headers and sources so automake 1.5
35893         doesn't complain. Removed \# at end of list.
35894
35895 Thu Jan 3 23:17:17 CET 2002 Paolo Molaro <lupus@ximian.com>
35896
35897         * reflection.c: get token for a method ref. Set return type of
35898         constructor to void.
35899         * loader.c: debug message.
35900         * class.c: typo fix.
35901
35902 Mon Dec 24 17:18:10 CET 2001 Paolo Molaro <lupus@ximian.com>
35903
35904         * icall.c: fix array init with rank > 1. FindMembers
35905         loops in parent class as well.
35906         * image.c: do not insert nested types in name cache.
35907         * reflection.c: warning fix.
35908         * reflection.h: add override method (for interface impl).
35909
35910 Mon Dec 24 16:16:56 CET 2001 Paolo Molaro <lupus@ximian.com>
35911
35912         * metadata.c: fix customattr decoding.
35913
35914 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
35915
35916         * rawbuffer.cs: Added native Win32 implementation, avoids using
35917         mmap on Cygwin.  This patch is from Dan Lewis (dihlewis@yahoo.co.uk)
35918
35919 Thu Dec 20 20:11:26 CET 2001 Paolo Molaro <lupus@ximian.com>
35920
35921         * class.c: make the low-level routines handle the cache.
35922
35923 Thu Dec 20 15:20:35 CET 2001 Paolo Molaro <lupus@ximian.com>
35924
35925         * image.c: fopen (file, "rb") ("David Dawkins" <david@dawkins.st>).
35926
35927 Tue Dec 18 18:50:00 CET 2001 Paolo Molaro <lupus@ximian.com>
35928
35929         * class.c: fix mono_array_element_size() for objects.
35930         * class.h, class.c: add properties to MonoClass and load them
35931         at init time.
35932         * icall.c: check with isinst() when assigning a value to an array
35933         instead of requiring the classes to match exactly.
35934         Implemented icall for System.Type::GetType().
35935         Implemented icalls to get ParameterInfo, ProprtyInfo and info about
35936         enums. Handle bindingflags when looking for methods and fields.
35937         * metadata.h, metadata.c: implemented mono_metadata_properties_from_typedef()
35938         and mono_metadata_methods_from_property().
35939         * reflection.h, reflection.c: added structures for propreties,
35940         parameters and enums. Implemented mono_property_get_object() and
35941         mono_param_get_objects().
35942
35943 2001-12-18  Dick Porter  <dick@ximian.com>
35944
35945         * file-io.c: Use mono_string_to_utf16() instead of
35946         mono_string_chars()
35947
35948         * object.c: Added mono_string_to_utf16(), which copies the non
35949         NULL-terminated MonoString into a new double-null-terminated
35950         buffer.
35951
35952 2001-12-17  Dietmar Maurer  <dietmar@ximian.com>
35953
35954         * icall.c (ves_icall_System_DateTime_GetNow): added EPOCH adjustment
35955
35956 2001-12-16  Dietmar Maurer  <dietmar@ximian.com>
35957
35958         * file-io.c: raise exceptions if handle is invalid.
35959
35960 Thu Dec 13 20:27:08 CET 2001 Paolo Molaro <lupus@ximian.com>
35961
35962         * assembly.c: yet another check for mscorlib.
35963         * class.c, class.h: load nesting info for classes.
35964         * icall.c: many new functions to support the Reflection classes.
35965         * metadata.c, metadata.h: mono_metadata_nested_in_typedef() added.
35966         * reflection.h, reflection.c: mono_image_create_token(),
35967         mono_assembly_get_object(), mono_type_get_object(),
35968         mono_method_get_object(), mono_field_get_object(): methods to return
35969         objects that parallel the C representation of assemblies, types,
35970         methods, fields.
35971
35972 2001-12-11  Dick Porter  <dick@ximian.com>
35973
35974         * icall.c:
35975         * file-io.c: Internal calls for file IO.
35976
35977 Thu Dec 6 16:21:30 CET 2001 Paolo Molaro <lupus@ximian.com>
35978
35979         * tabledefs.h: missing FileAttributes.
35980         * verify.h, verify.c: use is_valid_string () to simplify and check for
35981         valid strings more correctly. Fix warnings and speeling.
35982         Check more tables: Filed, File, ModuleRef, StandAloneSig.
35983         Check code: branches, maxstack, method calls.
35984
35985 2001-12-04  Dietmar Maurer  <dietmar@ximian.com>
35986
35987         * object.c (mono_object_allocate): removed static, so that the jit
35988         can allocate value types.
35989
35990         * icall.c (ves_icall_System_DateTime_GetNow): impl.
35991
35992 Mon Dec 3 17:02:01 CET 2001 Paolo Molaro <lupus@ximian.com>
35993
35994         * class.c: init enum types right away and register the
35995         token->MonoClass map in mono_class_create_from_typedef ().
35996         * verify.h, verify.c: first cut of the verifier.
35997         * pedump.c: add --verify switch to verify metadata tables.
35998         * tabledefs.h: add some missing enums.
35999
36000 2001-11-30  Dietmar Maurer  <dietmar@ximian.com>
36001
36002         * class.c (mono_install_runtime_class_init): impl.
36003         (mono_class_init): renamed mono_class_metadata_init to
36004         mono_class_init, also removed the metadata_inited flag
36005
36006         * object.c (mono_object_isinst): use faster algorithm
36007
36008 2001-11-30  Radek Doulik  <rodo@ximian.com>
36009
36010         * mono-endian.h: reverted last change
36011         added function prototypes
36012
36013         * Makefile.am (libmetadata_a_SOURCES): reverted my last change and
36014         add mono-endian.c back
36015
36016         * mono-endian.c: returned back, as Paolo pointed out, it's needed
36017         for unaligned access, I've mistaked it with endianess. I am
36018         sorry.
36019         (mono_read16): fix reverted endianess
36020         (mono_read64): ditto
36021         (mono_read32): ditto
36022
36023 2001-11-30  Dick Porter  <dick@ximian.com>
36024
36025         * exception.c: Implement mono_exception_from_name()
36026
36027 Fri Nov 30 12:01:02 CET 2001 Paolo Molaro <lupus@ximian.com>
36028
36029         * metadata.h, metadata.c: remove params_size and locals_size and their
36030         calculation from the metadata code: they are only usefult to the
36031         interp.
36032
36033 2001-11-29  Radek Doulik  <rodo@ximian.com>
36034
36035         * object.c (mono_ldstr): swap bytes here, it's probably not the
36036         best place, but works for me now, I'll redo it once I know mono
36037         better, also note that I add PROT_WRITE and don't reset back, also
36038         note that it's only affects big endians, so x86 should be OK
36039
36040         * mono-endian.h (read16): use just glib macros for both endians
36041
36042         * mono-endian.c: removed as glib macros are used in in
36043         mono-endian.h so we don't need to care about endianess for read
36044         macros as glib does that for us already
36045
36046 Thu Nov 29 18:20:58 CET 2001 Paolo Molaro <lupus@ximian.com>
36047
36048         * class.h, class.h: take minimum alignment into consideration so
36049         that the fields of a class remain aligned also when in an array.
36050
36051 Tue Nov 27 16:39:01 CET 2001 Paolo Molaro <lupus@ximian.com>
36052
36053         * loader.h, loader.c: add mono_method_get_param_names().
36054         * class.c: 0-init class fields.
36055
36056 2001-11-26  Dick Porter  <dick@ximian.com>
36057
36058         * icall.c:
36059         * threads-types.h:
36060         * threads.c: New file that handles System.Threading on all platforms
36061
36062         * object.c: 
36063         * object.h: Remove the synchronisation struct from MonoObject,
36064         replace it with a pointer that gets initialised on demand
36065
36066         * Makefile.am: Replace all the system-specific threading code with
36067         a single file that uses the new wrapper library
36068
36069 Mon Nov 19 11:37:14 CET 2001 Paolo Molaro <lupus@ximian.com>
36070
36071         * class.c, class.h: add mono_install_trampoline() so that the runtime
36072         can register a function to create a trampoline: removes the ugly
36073         requirement that a runtime needed to export arch_create_jit_trampoline.
36074         * object.h, object.c: added mono_install_handler() so that the runtime
36075         can install an handler for exceptions generated in C code (with
36076         mono_raise_exception()). Added C struct for System.Delegate.
36077         * pedump.c: removed arch_create_jit_trampoline.
36078         * reflection.c: some cleanups to allow registering user strings and
36079         later getting a token for methodrefs and fieldrefs before the assembly
36080         is built.
36081         * row-indexes.h: updates and fixes from the new ECMA specs.
36082
36083 Thu Nov 15 17:44:49 CET 2001 Paolo Molaro <lupus@ximian.com>
36084
36085         * class.h, class.c: add enum_basetype field to MonoClass.
36086         * metadata.h, metadata.c: add mono_metadata_get_constant_index()
36087         to get index in the constant table reated to a field, param or
36088         property.
36089         * reflection.h, reflection.c: handle constructors. Set public-key and
36090         version number of the built assembly to 0.
36091         * row-indexes.h: update from new ECMA spec.
36092
36093 Wed Nov 14 19:26:06 CET 2001 Paolo Molaro <lupus@ximian.com>
36094
36095         * class.h, class.c: add a max_interface_id to MonoClass.
36096         * icall.c: rename my_mono_new_object() to my_mono_new_mono_type()
36097         since it's used to do that. Added mono_type_type_from_obj().
36098         Make GetType() return NULL instead of segfaulting if the type was not
36099         found. Handle simple arrays in assQualifiedName.
36100         * object.h: add a struct to represent an Exception.
36101         * reflection.c: output call convention in method signature.
36102         Add code to support P/Invoke methods and fixed offsets for fields.
36103
36104 Mon Nov 12 12:41:32 CET 2001 Paolo Molaro <lupus@ximian.com>
36105
36106         * decimal.c, decimal.h: mono_double2decimal() get the sign bit from
36107         the value.
36108         * icall.c: use mono_array_addr instead of array->vector: fixes the
36109         reflection image writing.
36110         * reflection.c: init call convention byte to 0 in method signature.
36111         Encode the property signature. Don't output property-related methods
36112         twice. Really process the properties for a type (don't cast a field to
36113         a property, my mom always told me that).
36114         Fix 64 bit issues in pointer alignment in a different and more
36115         readable way.
36116
36117 2001-11-10  Sean MacIsaac  <macisaac@ximian.com>
36118
36119         * loader.h: Removed type class from MonoDefaults, added monotype
36120
36121         * loader.c: Loaded MonoType, removed loading of Type
36122
36123         * icall.c (my_mono_new_object): Now returns a System.MonoType,
36124         and fills in System.Type._impl with a RuntimeTypeHandle rather
36125         than the actual MonoClass *
36126
36127         (ves_icall_type_from_handle): change from type_class to
36128         monotype_class
36129
36130         (ves_icall_System_Runtime_InteropServices_Marshal_ReadIntPtr):
36131         implemented
36132
36133         (ves_icall_System_Runtime_InteropServices_Marshal_PtrToStringAuto):
36134         implemented
36135
36136         (ves_icall_System_Reflection_Assembly_LoadFrom): implemented
36137
36138         (ves_icall_System_Reflection_Assembly_GetType): implemented
36139
36140         (ves_icall_System_MonoType_assQualifiedName): implemented
36141
36142         (ves_icall_System_PAL_OpSys_GetCurrentDirecotry): implemented
36143
36144 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
36145
36146         * assembly.c (mono_assembly_open): Implement a cache for the
36147         assemblies. 
36148
36149         (mono_assembly_close): only destroy the assembly when the last
36150         reference is gone.
36151         
36152 2001-11-09  Dick Porter  <dick@ximian.com>
36153
36154         * Makefile.am (pedump_LDADD): Don't need THREAD_LIBS any more
36155
36156 2001-11-09  Dietmar Maurer  <dietmar@ximian.com>
36157
36158         * class.c (mono_class_metadata_init): bug fix: compute the right slot
36159
36160 Fri Nov 9 15:48:02 CET 2001 Paolo Molaro <lupus@ximian.com>
36161
36162         * icall.c, decimal.h, decimal.c: integrated decimal internalcalls
36163         from Martin Weindel.
36164         * object.h: add mono_string_chars ().
36165
36166 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
36167
36168         * reflection.c (build_compressed_metadata): Eliminates warnings
36169         and uses 64-bit clean code.
36170
36171         * metadata.c (mono_type_hash): Change signature to eliminate warnings.
36172         (mono_type_equal): Change signature to eliminate warnings.
36173
36174 Wed Nov 7 15:40:01 CET 2001 Paolo Molaro <lupus@ximian.com>
36175
36176         * icall.c, loader.c: remove the internalcall array constructors.
36177         Changes to match the new MonoArray structure.
36178         * object.h, object.c: an array object doesn't allocate an extra
36179         vector. Add mono_array_new_full () to create jagged arrays easily.
36180
36181 Mon Nov 5 19:51:06 CET 2001 Paolo Molaro <lupus@ximian.com>
36182
36183         * metadata.h, metadata.c: add mono_metadata_field_info () to
36184         retreive all the info about a field from vairous tables.
36185         * icall.c: implement S.Runtime.CServices::InitializeArray () icall.
36186         * class.h, class.c: augment MonoClassField with more info.
36187         Implemented mono_ldtoken for fields. Implemented ExplicitLayout
36188         policy and load a field's RVA if needed.
36189
36190 2001-11-05  Dietmar Maurer  <dietmar@ximian.com>
36191
36192         * class.c (mono_class_metadata_init): create a trampoline for all
36193         virtual functions instead of actually compiling them.
36194
36195 Fri Nov 2 19:37:51 CET 2001 Paolo Molaro <lupus@ximian.com>
36196
36197         * class.h, class.c: include name in MonoClassField.
36198         * class.c: fix fundamental type of System.Object and System.String.
36199         Set the right fundamental type for SZARRAY, too. Handle TypeSpec
36200         tokens in ldtoken.
36201         * icall.c: remove internalcalls for the Reflection stuff that is now
36202         done in C# code.
36203         * loader.c: mono_field_from_memberref () implementation.
36204         * mono-endian.c: thinko (s/struct/union/g).
36205         * object.c, object.h: make the mono_string_* prototypes actually use
36206         MonoString instead of MonoObject.
36207         * reflection.c, reflection.h: updates for changes in the reflection
36208         code in corlib: we use C structures that map to the actual C# classes.
36209         Handle SZARRAYs when encoding types. Handle locals in methods. Use a
36210         fat method header if needed and use the info from the ILGenerator for
36211         methods. Handle fields in types. Misc fixes.
36212
36213 2001-10-17  Dietmar Maurer  <dietmar@ximian.com>
36214
36215         * class.c (mono_class_metadata_init): bug fix: always allocate
36216         space for static class data
36217
36218 2001-10-25  Dietmar Maurer  <dietmar@ximian.com>
36219
36220         * class.c (mono_compute_relative_numbering): use relative
36221         numbering to support fast runtime type checks.
36222
36223 2001-10-17  Sean MacIsaac  <macisaac@ximian.com>
36224
36225         * class.c (mono_class_create_from_typeref): added debugging output
36226         to print class name when MonoDummy is returned instead of real class
36227
36228 2001-10-15  Dietmar Maurer  <dietmar@ximian.com>
36229
36230         * class.c (mono_class_metadata_init): interface offset table now
36231         contains pointers into the vtable - this is more efficient for the jit
36232
36233 2001-10-12  Dietmar Maurer  <dietmar@ximian.com>
36234
36235         * class.c (mono_class_metadata_init): use a temporary vtable (the
36236         old algorithm only worked for the interpreter, but not for the jit)
36237
36238 2001-10-11  Dietmar Maurer  <dietmar@ximian.com>
36239
36240         * loader.c (method_from_memberref): use mono_class_get to get the
36241         class of an array instead of using System.Array directly.
36242         (mono_get_method): also add MEMBERREF methods to the method cache
36243         which usefull for arrays.
36244
36245 2001-10-10  Dietmar Maurer  <dietmar@ximian.com>
36246
36247         * pedump.c (arch_compile_method): added to compute vtable entry
36248
36249         * metadata.c (mono_metadata_interfaces_from_typedef): also return the
36250         number of interfaces.
36251         
36252         * class.h: merged MonoArrayClass into MonoClass
36253
36254         * class.c (mono_class_create_from_typedef): compute the vtable size and
36255         allocate space to include the vtable inside MonoClass
36256         (mono_class_metadata_init): initialize the vtable
36257
36258 Mon Oct 8 16:12:38 CEST 2001 Paolo Molaro <lupus@ximian.com>
36259
36260         * metadata.c, metadata.h: use MonoArrayType to describe the shape of an array.
36261         Guard against calling bsearch with a NULL pointer (pointed out by Laurent Rioux, smoux).
36262         * image.c: endian fixes by Laurent Rioux.
36263         * object.h, object.c: rename MonoStringObject to MonoString and
36264         MonoArrayObject to MonoArray. Change some function names to conform to
36265         the style mono_<object>_<action>. mono_string_new_utf16 () takes a
36266         guint16* as first argument, so don't use char*.
36267         Provide macros to do the interesting things on arrays in a portable way.
36268         * threads-pthread.c: updates for the API changes and #include <sched.h>
36269         (required for sched_yield()).
36270         * icall.c: updates for the API changes above.
36271         * Makefile.am, mono-endian.c. mono-endian.h: include unaligned read routines for
36272         platforms that need them.
36273
36274 Mon Oct 8 10:43:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36275
36276         * class.c: set the correct type for all the fundamental
36277         type when loading the class.
36278
36279 2001-10-05  Dick Porter  <dick@ximian.com>
36280
36281         * threads-pthread.c (pthread_mutex_timedlock): Simple
36282         compatibility version for C libraries that lack this call.
36283
36284 Thu Oct 4 19:10:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36285
36286         * class.c: MonoTypes stored in MonoClass are stored as
36287         fundamental MonoTypes when the class represents a
36288         fundamental type (System.Int32, ...).
36289         The TypeHandle return by ldtoken is a MonoType*.
36290         * icall.c: ves_icall_get_data_chunk () write out all the
36291         PE/COFF stuff. Implement ves_icall_define_method (),
36292         ves_icall_set_method_body (), ves_icall_type_from_handle ().
36293         * image.c: properly skip unknown streams.
36294         * loader.h, loader.c: add type_class to mono_defaults.
36295         * metadata.c, metadata.h: export compute_size () as
36296         mono_metadata_compute_size () with a better interface.
36297         Typo and C&P fixes.
36298         * pedump.c: don't try to print the entry point RVA if there is no entry point.
36299         * reflection.c, reflection.h: many cleanups, fixes, output method
36300         signatures and headers, typedef and typeref info, compress the metadata
36301         tables, output all the heap streams, cli header etc.
36302         * row-indexes.h: typo fixes.
36303
36304 2001-10-04  Dick Porter  <dick@ximian.com>
36305
36306         * object.h: Add a synchronisation mutex struct to MonoObject
36307
36308         * object.c (mono_new_object): Initialise the object
36309         synchronisation mutexes
36310
36311         * icall.c: System.Threading.Monitor internal calls
36312         
36313         * threads-pthread.h:
36314         * threads-pthread.c: System.Threading.Monitor internal calls
36315
36316         * threads-types.h: New file, includes the system-specific thread
36317         structures
36318         
36319         * threads-pthread-types.h:
36320         * threads-pthread-types.c: New files, handle pthread-specific
36321         synchronisation types
36322
36323         * threads-dummy-types.h: 
36324         * threads-dummy-types.c: New files of dummy support for
36325         thread-specific types
36326
36327         * metadata.c:
36328         * image.c:
36329         * pedump.c: include mono-endian.h not endian.h
36330         
36331         * Makefile.am: More threads files.
36332         Name mono-endian.h not endian.h
36333
36334 Tue Oct 2 20:33:48 CEST 2001 Paolo Molaro <lupus@ximian.com>
36335
36336         * Makefile.am, reflection.h, reflection.c: move here the reflection related 
36337         stuff and implement a few more bits.
36338         * icall.c: a field needs to be dereferenced twice. Do not use the same
36339         name for two variables in the same scope.
36340         * image.c, image.h: cleanups.
36341
36342 2001-10-02  Dietmar Maurer  <dietmar@ximian.com>
36343
36344         * class.c (mono_class_metadata_init): bug fix: compute the right size
36345
36346 Mon Oct 1 20:43:57 CEST 2001 Paolo Molaro <lupus@ximian.com>
36347
36348         * icall.c: implemented some of the Reflection internalcalls.
36349         * image.c, image.h: start writing out the PE/COFF image.
36350         * metadata.h, metadata.c: implement mono_metadata_encode_value ()
36351         that does the reverse than decode_blob_size ().
36352         * object.c: use mono_metadata_encode_value (). Move here
36353         temporary implementation of mono_string_to_utf8 ().
36354         * rawbuffer.c: make malloc_map static.
36355
36356 Fri Sep 28 19:26:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36357
36358         * metadata.c: fix type comparison for arrays.
36359         * loader.h, loader.c: half-assed fix to get more tests work in cygwin.
36360         Added a couple of new classes to monodefaults.
36361         * icall.c: added a couple of Reflection-related internalcalls.
36362         * class.h, class.c: implemented mono_ldtoken () for RuntimeTypeHandles.
36363         Added a byval_arg MonoType to MonoClass.
36364
36365 2001-09-28  Dick Porter  <dick@ximian.com>
36366
36367         * icall.c:
36368         * threads-pthread.h: 
36369         * threads-pthread.c: Implemented internal calls for
36370         LocalDataStoreSlot operations.  Applied mutexes around all shared
36371         data.  Reworked the thread creation and Start() operations to
36372         avoid a race condition.
36373         
36374         * threads-dummy.h:
36375         * threads-dummy.c: Dummy calls for the LocalDataStoreSlot operations
36376
36377 Thu Sep 27 21:45:55 CEST 2001 Paolo Molaro <lupus@ximian.com>
36378
36379         * rawbuffer.c: disable mmap on cygwin since it seems to be broken there.
36380
36381 Thu Sep 27 19:52:11 CEST 2001 Paolo Molaro <lupus@ximian.com>
36382
36383         * class.c, loader.c: warn and return NULL instead of erroring out.
36384         * icall.c: added System.AppDomain::getCurDomain().
36385         * loader.c: we don't need to lookup the typedef again for p/invoke calls.
36386
36387 2001-09-25  Dick Porter  <dick@ximian.com>
36388
36389         * threads-pthread.h:
36390         * threads-pthread.c: Implemented timed thread joining and added
36391         System.Threading.Thread::Join_internal internal call
36392
36393         * icall.c: Added System.Threading.Thread::Join_internal internal call
36394
36395         * threads-dummy.h:
36396         * threads-dummy.c: Dummy calls for System.Thread.Thread::Join_internal
36397
36398 Mon Sep 24 18:56:59 CEST 2001 Paolo Molaro <lupus@ximian.com>
36399
36400         * object.c, object.h: added mono_ldstr (), mono_string_is_interned () and
36401         mono_string_intern () to implement the semantics of the ldstr opcode
36402         and the interning of System.Strings.
36403         * icall.c: provide hooks to make String::IsIntern and String::Intern
36404         internalcalls.
36405
36406 2001-09-23  Dick Porter  <dick@ximian.com>
36407
36408         * threads-dummy.c: 
36409         * threads-dummy.h: New files of dummy threading routines
36410
36411         * Makefile.am (THREAD_SOURCE): Arrange to compile different thread
36412         support code based on system specifics
36413
36414         Rename PTHREAD_LIBS to THREAD_LIBS
36415         
36416 2001-09-23  Dick Porter  <dick@ximian.com>
36417
36418         * threads-pthread.c: Implement the System.Threading.Thread::Sleep,
36419         Schedule (called when asked to Sleep for 0 ms) and CurrentThread
36420         internal calls.
36421         (mono_thread_init): Set up a Thread object instance to return when
36422         the main thread calls Thread.CurrentThread
36423         (mono_thread_cleanup): Wait for all subthreads to exit
36424
36425         * icall.c: New internal calls for System.Threading.Thread::Sleep
36426         (including Schedule) and CurrentThread
36427
36428         * threads.h: New file, to insulate thread-specific stuff from the
36429         rest of the code
36430
36431 2001-09-21  Dick Porter  <dick@ximian.com>
36432
36433         * threads-pthread.h: 
36434         * threads-pthread.c: New file, for handling pthreads-style
36435         threading support.  Start() now starts a new thread and executes
36436         the ThreadStart delegate instance.
36437
36438         * icall.c: Added the internalcall for
36439         System.Threading.Thread::Start_internal
36440
36441         * Makefile.am: Added new files, and PTHREADS_LIBS to the link line
36442
36443 Thu Sep 20 19:37:39 CEST 2001 Paolo Molaro <lupus@ximian.com>
36444
36445         * loader.c: work around the different signatures for delegates
36446         constructors csc generates in compiled code vs the ones compiled in mscorlib.
36447
36448 Tue Sep 18 13:16:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36449
36450         * class.h, class.c: add mono_class_get_field_from_name ().
36451         * *: Fix C comments and other ANSI C issues.
36452
36453 Mon Sep 10 20:21:34 CEST 2001 Paolo Molaro <lupus@ximian.com>
36454
36455         * endian.h, assembly.c: fix some endianness issues.
36456
36457 Fri Sep 7 18:40:40 CEST 2001 Paolo Molaro <lupus@ximian.com>
36458
36459         * loader.h, load.c: add delegate_class to mono_defaults.
36460         Handle runtime provided methods in mono_get_method ().
36461
36462 2001-08-29  Dietmar Maurer  <dietmar@ximian.com>
36463
36464         * loader.c (mono_get_method): use pinvoke for internal call
36465
36466         * icall.c: use pinvoke for internal call
36467
36468         * loader.c (method_from_memberref): set the method name
36469
36470 Wed Aug 29 12:43:41 CEST 2001 Paolo Molaro <lupus@ximian.com>
36471
36472         * metadata.c: help the compiler generate better code for
36473         mono_class_from_mono_type ().
36474
36475 2001-08-28  Dietmar Maurer  <dietmar@ximian.com>
36476
36477         * class.c (mono_class_metadata_init): delayed computing of the
36478         class size to mono_class_metadata_init ()
36479
36480 Tue Aug 28 15:47:15 CEST 2001 Paolo Molaro <lupus@ximian.com>
36481
36482         * class.c, class.h: add an interfaces member to MonoClass.
36483         * image.c, image.h: add assembly_name field to MonoImage
36484         from the assembly table.
36485         * metadata.c, metadata.h: add mono_metadata_interfaces_from_typedef ().
36486
36487 Mon Aug 27 20:12:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36488
36489         * class.c: Handle Array in mono_class_from_mono_type ().
36490         * metadata.c, pedump.c: some endian fixes.
36491
36492 Mon Aug 27 15:23:23 CEST 2001 Paolo Molaro <lupus@ximian.com>
36493
36494         * class.c, loader.c, loader.h: More types handled in mono_class_from_mono_type ().
36495         * metadata.c: fix small problem introduced with the latest commit.
36496
36497 Mon Aug 27 12:17:17 CEST 2001 Paolo Molaro <lupus@ximian.com>
36498
36499         * loader.c, metadata.c, metadata.h: Export mono_metadata_type_equal().
36500         We don't need a MonoMetadata pointer anymore to compare signatures in
36501         mono_metadata_signature_equal (), update callers.
36502         Reduced memory usage an number of allocations for MonoMethodHeader and
36503         MonoMethodSignature.
36504
36505 Sun Aug 26 23:03:09 CEST 2001 Paolo Molaro <lupus@ximian.com>
36506
36507         * metadata.c: added compare for szarray.
36508
36509 Sun Aug 26 11:34:24 CEST 2001 Paolo Molaro <lupus@ximian.com>
36510
36511         * class.h, class.c, loader.h, loader.c: export mono_class_from_mono_type ()
36512         and add a couple more types to it and mono_defaults. Give an hint on
36513         classes that need implementing in our corlib and are referenced
36514         in mscorlib.
36515
36516 Sat Aug 25 12:52:54 CEST 2001 Paolo Molaro <lupus@ximian.com>
36517
36518         * class.h, class.c: keep track if a class is also an Enum.
36519         * loader.c: Implement a couple more types for use in libffi
36520         marshalling. Gives better diagnostics when failing to dlopen
36521         a library. Set method->klass for P/Invoke methods, too.
36522
36523 Fri Aug 24 19:30:25 CEST 2001 Paolo Molaro <lupus@ximian.com>
36524
36525         * class.c, class.h: add a MonoType this_arg to MonoClass that
36526         represents a pointer to an object of the class' type that
36527         can be used by the interpreter and later the type cache.
36528         Add best guess alignment info for valuetype objects.
36529
36530 Fri Aug 24 15:50:31 CEST 2001 Paolo Molaro <lupus@ximian.com>
36531
36532         * metadata.h, metadata.c, class.h, class.c: squeezed MonoParam
36533         into MonoType: one less level of indirection and allocation and
36534         simplifies quite a bit of code. Added cache for MonoTypes that are
36535         used frequently, so that we don't need to allocate them all the time.
36536
36537 2001-08-24  Dietmar Maurer  <dietmar@ximian.com>
36538
36539         * class.c (mono_class_create_from_typedef): System.Enum is also a
36540         value type, although it does not derive from System.ValueType
36541         (maybe a bug in the ms compiler?)
36542
36543         * metadata.c (mono_type_size): return the right size for value types
36544
36545         * loader.c (mono_get_method): only initialize method header if not abstract
36546
36547         * class.c (mono_class_from_mono_type): use mono_default values. 
36548
36549 2001-08-23  Dietmar Maurer  <dietmar@ximian.com>
36550
36551         * *: use MonoClass pointers instead of <type_tokens>
36552         
36553         * class.h: new flag: metadata_inited.
36554
36555         * class.c (mono_class_metadata_init): impl.
36556         (mono_class_instance_size): impl.
36557         (mono_class_data_size): impl.
36558
36559 Wed Aug 22 16:27:30 CEST 2001 Paolo Molaro <lupus@ximian.com>
36560
36561         * metadata.c, loader.h, loader.c, image.h, image.c, class.h, class.c:
36562         MonoClass now has the name and name_space fields. 
36563         MonoMethod has a pointer to its MonoClass, instead of MonoImage.
36564         mono_get_method () takes and optional MonoClass as argument.
36565         Removed mono_typedef_from_name() and added mono_class_token_from_name()
36566         instead that takes advantage of a map from class names to typedef
36567         tokens in MonoImage.
36568
36569 Tue Aug 21 18:54:58 CEST 2001 Paolo Molaro <lupus@ximian.com>
36570
36571         * metadata.c: zero is not a valid alignment boundary.
36572         Merge MONO_TYPE_VOID in default decoding code.
36573
36574 2001-08-21  Dietmar Maurer  <dietmar@ximian.com>
36575
36576         * image.h: merged MonoMetadata into MonoImage
36577
36578         * class.h: cleanup of MonoArrayClass, use a MonoClass pointer to
36579         identify the type of elements.
36580
36581 Mon Aug 20 19:39:00 CEST 2001 Paolo Molaro <lupus@ximian.com>
36582
36583         * blob.h: fix MONO_TYPE_TYPEDBYREF value.
36584         * cil-coff.h: split MonoMSDOSHeader and add size info.
36585         * image.c: add some consistency checks.
36586         * metadata.c: fix row size computation: one programmer
36587         error and one LAMESPEC. Handle MONO_TYPE_TYPEDBYREF.
36588         add explanation for the locator routine.
36589         Fix decoding of size in method header.
36590         
36591 2001-08-20  Miguel de Icaza  <miguel@ximian.com>
36592
36593         * assembly.c    (g_concat_dir_and_file): Use _S for string concat.
36594         (g_concat_dir_and_file): Bring g_concat_dir_and_file
36595         function from gnome-libs.  This uses the right path separator
36596         based on the OS, and also works around a bug in some systems where
36597         a double slash is not allowed. 
36598         (default_assembly_name_resolver): Use g_concat_dir_and_file
36599         (mono_assembly_open): ditto.
36600
36601 2001-08-20  Dietmar Maurer  <dietmar@ximian.com>
36602
36603         * metadata.c (mono_metadata_signature_equal): impl.
36604
36605         * *: void is now a realy MonoType (instead of using NULL)
36606         
36607         * metadata.c (do_mono_metadata_parse_type): use
36608         mono_metadata_parse_type to parse void value.
36609
36610 Sat Aug 18 12:51:28 CEST 2001 Paolo Molaro <lupus@ximian.com>
36611
36612         * metadata.c, metadata.h: in the signature and method header store
36613         only the space required for holding the loca vars and incoming arguments.
36614
36615 2001-08-15  Dietmar Maurer  <dietmar@ximian.com>
36616
36617         * metadata.c (do_mono_metadata_parse_type): treat void like any
36618         other type (instead of assigning NULL);
36619
36620 2001-08-14  Dietmar Maurer  <dietmar@ximian.com>
36621
36622         * metadata.c (mono_metadata_parse_mh): fixxed pinned/byref value
36623
36624 2001-08-09  Dietmar Maurer  <dietmar@ximian.com>
36625
36626         * image.c (do_mono_image_open): added a cache for arrays.
36627
36628 Sat Aug 4 12:46:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36629
36630         * metadata.h, metadata.c: add mono_metadata_decode_row_col () to
36631         decode a single column from a row in a metadata table and changes
36632         to take advantage of it in the typedef locator (gives a nice speed up).
36633         Store offset info for function params.
36634
36635 2001-08-02  Dietmar Maurer  <dietmar@ximian.com>
36636
36637         * image.h (MONO_IMAGE_IS_CORLIB): removed 
36638
36639 Wed Aug 1 22:54:08 CEST 2001 Paolo Molaro <lupus@ximian.com>
36640
36641         * assembly.c: how could mono_assembly_close () had ever worked?
36642         * metadata.c, metadata.h: provide offset info for local vars.
36643         Implement mono_type_size () to take care of alignment as well
36644         as size (it was mono_field_type_size in cli/class.c before).
36645
36646 2001-08-01  Dietmar Maurer  <dietmar@ximian.com>
36647
36648         * image.h (MONO_IMAGE_IS_CORLIB): new macro to check root image
36649
36650         * assembly.h (CORLIB_NAME): set to corlib.dll
36651
36652         * assembly.c (mono_assembly_open): replaced strcmp() with !strcmp()
36653
36654 Tue Jul 31 17:54:02 CEST 2001 Paolo Molaro <lupus@ximian.com>
36655
36656         * metadata.h, metadata.c, Makefile.am, private.h, assembly.c, blob.h,
36657         cil-coff.h, image.c, image.h, pedump.c, rawbuffer.c, rawbuffer.h, row-indexes.h,
36658         tokentype.h: massive namespace cleanup.
36659
36660 Mon Jul 30 20:11:01 CEST 2001 Paolo Molaro <lupus@ximian.com>
36661
36662         * metadata.h, metadata.c: decode exception clauses when parsing method header.
36663
36664 2001-07-27  Dietmar Maurer  <dietmar@ximian.com>
36665
36666         * metadata.c (mono_metadata_free_type): added check for type !=
36667         NULL (void) before calling mono_metadata_free_type()
36668
36669 Thu Jul 26 19:11:19 CEST 2001 Paolo Molaro <lupus@ximian.com>
36670
36671         * metadata.h, row_indexes.h: added header with enumerations to use
36672         to index in the columns from tables in metadata and to decode coded
36673         tokens: we should start using this instead of embedding magic numbers
36674         all over the code.
36675
36676 Thu Jul 26 13:03:27 CEST 2001 Paolo Molaro <lupus@ximian.com>
36677
36678         * assembly.c, cil-coff.h, image.c, image.h, pedump.c, typedef.c:
36679         Move metadata_t info from cli_image_info_t to MonoImage, where
36680         it's easily accessible. Changed all the uses accordingly.
36681         Added the method and class caches to MonoImage.
36682         * metadata.c, metadata.h: Changed mono_metadata_decode_blob_size ()
36683         and mono_metadata_decode_value () signature to be more consistent
36684         with the other parse functions (and simplify code). Taken advantage
36685         of zero-length array allocation with GCC. Removed reduntant (and
36686         wrong) MonoFieldType struct and use MonoParam instead. Changed
36687         mono_metadata_parse_field_type () to use common code for parsing.
36688         Added mono_metadata_typedef_from_field () and
36689         mono_metadata_typedef_from_method () to lookup a typedef index from a
36690         field or method token.
36691         Pack the MonoRetType structure more tightly (fits in 8 bytes now).
36692
36693 2001-07-23  Miguel de Icaza  <miguel@ximian.com>
36694
36695         * metadata.c (mono_metadata_parse_field_type): Implement. 
36696         (do_mono_metadata_parse_type): Split engine from
36697         mono_metadata_parse_type, so that we can create smaller structures
36698         for things that just have one pointer to the MonoType (look at
36699         the MonoFieldType)
36700
36701 2001-07-20  Miguel de Icaza  <miguel@ximian.com>
36702
36703         * metadata.c (mono_metadata_parse_mh): Correct the implementation,
36704         as Jan Gray found out, it is incorrect. 
36705
36706 2001-07-18  Miguel de Icaza  <miguel@ximian.com>
36707
36708         * assembly.c: Implement asssembly loading.  This loads an image
36709         and loads all the referenced assemblies.  Come to think of it, we
36710         could always do lazy loading of the assemblies. 
36711
36712         * image.c (mono_image_open): Keep loaded images in a hashtable.
36713
36714         * image.h (MonoImage): Add reference count.
36715
36716 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
36717
36718         * assembly.c (mono_assembly_open): Keep track of the file name in
36719         case the assembly has no ASSEMBLY table.
36720
36721         * metadata.h: Fixed Paolo's quick hack.  Put the documnentation
36722         from get.c here.
36723
36724 Sun Jul 15 19:39:06 CEST 2001 Paolo Molaro <lupus@ximian.com>
36725
36726         * metadata.c, metadata.h: decode local vars in method header
36727         parse function. Change callers accordingly.
36728
36729 Sun Jul 15 17:40:47 CEST 2001 Paolo Molaro <lupus@ximian.com>
36730
36731         * metadata.h, cil-coff.h: protect against multiple inclusion.
36732         Added some new structures to hold information decoded from metadata:
36733         MonoType, MonoParam, MonoArray, MonoMethod, MonoMethodSignature
36734         and relevant decoding/free functions.
36735         * metadata.c: implement decoding functions. Add warning for out of bounds
36736         index in mono_metadata_locate(). Implement mono_get_method () to retreive
36737         all the info about a method signature and invocation. Remove check on
36738         uninitialized local var in parse_mh() and fix memory leak.
36739
36740 2001-07-12  Miguel de Icaza  <miguel@ximian.com>
36741
36742         * metadata.h: More macros.
36743
36744         * tokentype.h: New file.
36745
36746 Fri Jul  6 11:30:53 CEST 2001 Paolo Molaro <lupus@ximian.com>
36747
36748         * assembly.c: added a consistency check and initialize
36749         some structures with g_new0().
36750         * metadata.c: fixed a couple more bugs in table size computation
36751         and add other checks for out-of bound access to metadata.
36752
36753 Thu Jul  5 22:34:21 CEST 2001 Paolo Molaro <lupus@ximian.com>
36754
36755         * metatada.c: fix bugs computing table sizes. Spew a
36756         warning when index in string heap is out of bounds.
36757
36758 2001-07-04  Miguel de Icaza  <miguel@ximian.com>
36759
36760         * metadata.h: Add a couple of macros to manipulate tokens. 
36761
36762 Tue Jul  3 18:33:32 CEST 2001 Paolo Molaro <lupus@ximian.com>
36763
36764         * assembly.c: g_free(ii->cli_sections) (and avoid double free of
36765         cli_section_tables).
36766
36767 2001-07-01  Miguel de Icaza  <miguel@ximian.com>
36768
36769         * metadata.c (mono_metadata_user_string): New function, provides
36770         access to the UserString heap. 
36771
36772 2001-06-27  Miguel de Icaza  <miguel@ximian.com>
36773
36774         * metadata.c: Add inline documentation.
36775
36776 2001-06-26  Miguel de Icaza  <miguel@ximian.com>
36777
36778         * propertyattr.h, paramattr.h, methodsem.h, methodattr.h: New
36779         files. 
36780
36781 2001-06-22  Miguel de Icaza  <miguel@ximian.com>
36782
36783         * typeattr.h: New file, TypeAttribute flags. 
36784
36785 2001-06-21  Miguel de Icaza  <miguel@ximian.com>
36786
36787         * mono/metadata/assembly.c (mono_assembly_ensure_section_idx,
36788         mono_assembly_ensure_section): Section loading code.
36789         (load_section_tables): Load the sections.
36790
36791         * mono/metadata/metadata.c (mono_metadata_locate_token,
36792         mono_metadata_locate): Functions to locate the information
36793         definition given a token or a table and an index.
36794         (mono_metadata_compute_table_bases): New.
36795         (compute_size): New function to compute the sizes of the various
36796         tables.
36797
36798         * mono/metadata/metadata.h: Finish listing the different index
36799         types. 
36800
36801         * mono/metadata/pedump.c: Improve to dump new information.
36802
36803 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
36804
36805         * mono/metadata/metadata.c: Entered all the tables matching
36806         Beta2. 
36807
36808         * mono/metadata/assembly.c (load_metadata_ptrs): Fix for Beta2
36809
36810
36811
36812